he2802 пре 4 година
родитељ
комит
3e1217b5da

+ 3 - 0
run-admin-prod.sh

@@ -20,6 +20,7 @@ echo '----build image admin----'
 docker run \
 -p 9099:9099 \
 --name ${app_admin_name} \
+--restart=always \
 -e 'spring.profiles.active'=${profile_active} \
 -e TZ="Asia/Shanghai" \
 -v /etc/localtime:/etc/localtime \
@@ -53,6 +54,7 @@ echo '----build image admin----'
 docker run \
 -p 10000:9099 \
 --name ${app_admin_name_two} \
+--restart=always \
 -e 'spring.profiles.active'=${profile_active_two} \
 -e TZ="Asia/Shanghai" \
 -v /etc/localtime:/etc/localtime \
@@ -86,6 +88,7 @@ echo '----build image admin----'
 docker run \
 -p 10001:9099 \
 --name ${app_admin_name_three} \
+--restart=always \
 -e 'spring.profiles.active'=${profile_active_three} \
 -e TZ="Asia/Shanghai" \
 -v /etc/localtime:/etc/localtime \

+ 3 - 0
run-admin.sh

@@ -20,6 +20,7 @@ echo '----build image admin----'
 docker run \
 -p 9099:9099 \
 --name ${app_admin_name} \
+--restart=always \
 --link mysql:db \
 -e 'spring.profiles.active'=${profile_active} \
 -e TZ="Asia/Shanghai" \
@@ -54,6 +55,7 @@ echo '----build image admin----'
 docker run \
 -p 10000:9099 \
 --name ${app_admin_name_two} \
+--restart=always \
 --link mysql:db \
 -e 'spring.profiles.active'=${profile_active_two} \
 -e TZ="Asia/Shanghai" \
@@ -88,6 +90,7 @@ echo '----build image admin----'
 docker run \
 -p 10001:9099 \
 --name ${app_admin_name_three} \
+--restart=always \
 --link mysql:db \
 -e 'spring.profiles.active'=${profile_active_three} \
 -e TZ="Asia/Shanghai" \

+ 3 - 0
run-prod.sh

@@ -18,6 +18,7 @@ echo '----rm image----'
 docker build -f /mydata/maven/build/Dockerfile -t ${group_name}/${app_name}:${app_version} .
 echo '----build image----'
 docker run -p 8089:8088 --name ${app_name} \
+--restart=always \
 -e 'spring.profiles.active'=${profile_active} \
 -e TZ="Asia/Shanghai" \
 -v /etc/localtime:/etc/localtime \
@@ -50,6 +51,7 @@ echo '----rm image----'
 docker build -f /mydata/maven/build/Dockerfile -t ${group_name_two}/${app_name_two}:${app_version_two} .
 echo '----build image----'
 docker run -p 8090:8088 --name ${app_name_two} \
+--restart=always \
 -e 'spring.profiles.active'=${profile_active_two} \
 -e TZ="Asia/Shanghai" \
 -v /etc/localtime:/etc/localtime \
@@ -83,6 +85,7 @@ echo '----rm image----'
 docker build -f /mydata/maven/build/Dockerfile -t ${group_name_three}/${app_name_three}:${app_version_three} .
 echo '----build image----'
 docker run -p 8091:8088 --name ${app_name_three} \
+--restart=always \
 -e 'spring.profiles.active'=${profile_active_three} \
 -e TZ="Asia/Shanghai" \
 -v /etc/localtime:/etc/localtime \

+ 3 - 0
run.sh

@@ -18,6 +18,7 @@ echo '----rm image----'
 docker build -f /mydata/maven/build/Dockerfile -t ${group_name}/${app_name}:${app_version} .
 echo '----build image----'
 docker run -p 8088:8088 --name ${app_name} \
+--restart=always \
 --link mysql:db \
 -e 'spring.profiles.active'=${profile_active} \
 -e TZ="Asia/Shanghai" \
@@ -51,6 +52,7 @@ echo '----rm image----'
 docker build -f /mydata/maven/build/Dockerfile -t ${group_name_two}/${app_name_two}:${app_version_two} .
 echo '----build image----'
 docker run -p 8090:8088 --name ${app_name_two} \
+--restart=always \
 --link mysql:db \
 -e 'spring.profiles.active'=${profile_active_two} \
 -e TZ="Asia/Shanghai" \
@@ -85,6 +87,7 @@ echo '----rm image----'
 docker build -f /mydata/maven/build/Dockerfile -t ${group_name_three}/${app_name_three}:${app_version_three} .
 echo '----build image----'
 docker run -p 8091:8088 --name ${app_name_three} \
+--restart=always \
 --link mysql:db \
 -e 'spring.profiles.active'=${profile_active_three} \
 -e TZ="Asia/Shanghai" \

+ 1 - 1
zhongzheng-admin/src/main/resources/application-dev.yml

@@ -86,7 +86,7 @@ aliyun:
         policy:
             expire: 30 # 签名有效期(S)
         maxSize: 10 # 上传文件大小(M)
-        callback: http://120.79.166.78:7072/aliyun/oss/callback # 文件上传成功后的回调地址
+        callback: http://120.79.166.78:19004/aliyun/oss/callback # 文件上传成功后的回调地址
         dir:
             prefix: oss/images/ # 上传文件夹路径前缀 `
 

+ 1 - 1
zhongzheng-api/src/main/resources/application-dev.yml

@@ -86,7 +86,7 @@ aliyun:
         policy:
             expire: 30 # 签名有效期(S)
         maxSize: 10 # 上传文件大小(M)
-        callback: http://120.79.166.78:7072/aliyun/oss/callback # 文件上传成功后的回调地址
+        callback: http://120.79.166.78:19004/aliyun/oss/callback # 文件上传成功后的回调地址
         dir:
             prefix: oss/images/ # 上传文件夹路径前缀 `
 poliv:

+ 1 - 4
zhongzheng-system/src/main/java/com/zhongzheng/modules/activity/vo/ActivityAdvertisingVo.java

@@ -53,10 +53,7 @@ public class ActivityAdvertisingVo {
 	@Excel(name = "0删除 1待发布 2 撤回 3发布成功")
 	@ApiModelProperty("0删除 1待发布 2 撤回 3发布成功")
 	private Integer status;
-	/** 定时发布的时间 */
-	@Excel(name = "定时发布的时间")
-	@ApiModelProperty("定时发布的时间")
-	private Long releaseTime;
+
 	/** 广告名称 */
 	@Excel(name = "广告名称")
 	@ApiModelProperty("广告名称")

+ 38 - 18
zhongzheng-system/src/main/java/com/zhongzheng/modules/user/service/impl/UserPlanServiceImpl.java

@@ -81,11 +81,11 @@ public class UserPlanServiceImpl extends ServiceImpl<UserPlanMapper, UserPlan> i
     }
 
     /**
-    * 实体类转化成视图对象
-    *
-    * @param collection 实体类集合
-    * @return
-    */
+     * 实体类转化成视图对象
+     *
+     * @param collection 实体类集合
+     * @return
+     */
     private List<UserPlanVo> entity2Vo(Collection<UserPlan> collection) {
         List<UserPlanVo> voList = collection.stream()
                 .map(any -> BeanUtil.toBean(any, UserPlanVo.class))
@@ -372,7 +372,7 @@ public class UserPlanServiceImpl extends ServiceImpl<UserPlanMapper, UserPlan> i
 
 
             userPlanVo.setCoursePlanVo(coursePlanVo);
-                userPlanVos.add(userPlanVo);
+            userPlanVos.add(userPlanVo);
 
         }
 
@@ -571,11 +571,11 @@ public class UserPlanServiceImpl extends ServiceImpl<UserPlanMapper, UserPlan> i
 
 
             calendarStudyVos.stream().filter(c -> c.getMonth() == (cal.get(Calendar.MONTH)+1))
-                   .forEach(c -> {
-                       finalDayStudyVos.addAll(c.getDayStudyList().stream()
-                        .filter(v -> v.getDate() < 7 + cal.get(Calendar.DAY_OF_MONTH) && v.getDate() > cal.get(Calendar.DAY_OF_MONTH) - 7)
-                        .collect(Collectors.toList()));
-            });
+                    .forEach(c -> {
+                        finalDayStudyVos.addAll(c.getDayStudyList().stream()
+                                .filter(v -> v.getDate() < 7 + cal.get(Calendar.DAY_OF_MONTH) && v.getDate() > cal.get(Calendar.DAY_OF_MONTH) - 7)
+                                .collect(Collectors.toList()));
+                    });
             switch (cal.get(Calendar.DAY_OF_WEEK)- 1){
                 case 0:
                     dayStudyVos=finalDayStudyVos.stream()
@@ -669,7 +669,7 @@ public class UserPlanServiceImpl extends ServiceImpl<UserPlanMapper, UserPlan> i
             userPlanVos.setCalendarStudyVo(calendarStudyVos);
         }
 
-        
+
         return userPlanVos;
     }
 
@@ -711,7 +711,7 @@ public class UserPlanServiceImpl extends ServiceImpl<UserPlanMapper, UserPlan> i
 
 
             //最近考试时间七天前到现在的天数,学习视频时长
-            Date date1 = new Date(bo.getExamDate()*1000L);
+            Date date1 = new Date(userPlan.getExamDate()*1000L);
             //获得相隔天数
             //得到学习的周
             List<Long> cont = JSONObject.parseArray(userPlan.getStudyCount(), Long.class);
@@ -721,6 +721,7 @@ public class UserPlanServiceImpl extends ServiceImpl<UserPlanMapper, UserPlan> i
             int dutyDays = getDutyDays(new Date(), date1,longs,7L);
 
             //计算每天需要学习多少节课
+            int size = listMap.size();
 
             int Sec = (int)Math.ceil((double)listMap.size()/dutyDays);
 
@@ -731,6 +732,7 @@ public class UserPlanServiceImpl extends ServiceImpl<UserPlanMapper, UserPlan> i
             }
 
             //key和value都循环
+            listId = new ArrayList<>();
             for(Map.Entry<Long,Long> entry : listMap.entrySet()) {
                 listId.add(entry.getKey());
             }
@@ -739,6 +741,24 @@ public class UserPlanServiceImpl extends ServiceImpl<UserPlanMapper, UserPlan> i
             Calendar cal = Calendar.getInstance();
             int year = cal.get(Calendar.YEAR);
             Integer month = 0;
+
+            for (CalendarStudyVo calendarStudyVo : calendarStudyVos) {
+                if (month < calendarStudyVo.getMonth()){
+                    month = Convert.toInt(calendarStudyVo.getMonth());
+                }
+                for (DayStudyVo dayStudyVo : calendarStudyVo.getDayStudyList()) {
+                    if (dayStudyVo.getDate() > Calendar.getInstance().get(Calendar.DAY_OF_MONTH) && calendarStudyVo.getMonth() == (cal.get(Calendar.MONTH) + 1) && ifTrue(dayStudyVo.getStudyDay(),longs)) {
+                        dayStudyVo.setStudyCourseKnob(0L);
+                        dayStudyVo.setCourseDayMap(new HashMap<>());
+                        dayStudyVo.setSectionIdMap(new HashMap<>());
+                    }else if(calendarStudyVo.getMonth() > (cal.get(Calendar.MONTH) + 1) && ifTrue(dayStudyVo.getStudyDay(),longs)){
+                        dayStudyVo.setStudyCourseKnob(0L);
+                        dayStudyVo.setCourseDayMap(new HashMap<>());
+                        dayStudyVo.setSectionIdMap(new HashMap<>());
+                    }
+                }
+            }
+
             //将原有的月份添加课程的节数
             for (CalendarStudyVo calendarStudyVo : calendarStudyVos) {
                 if (month < calendarStudyVo.getMonth()){
@@ -779,7 +799,7 @@ public class UserPlanServiceImpl extends ServiceImpl<UserPlanMapper, UserPlan> i
                             dayStudyVo.setSectionIdMap(sectionIdMap);
                             dayStudyVo.setCourseDayMap(courseDayMap);
                         }
-                    }else if(calendarStudyVo.getMonth() != (cal.get(Calendar.MONTH) + 1) && ifTrue(dayStudyVo.getStudyDay(),longs)){
+                    }else if(calendarStudyVo.getMonth() > (cal.get(Calendar.MONTH) + 1) && ifTrue(dayStudyVo.getStudyDay(),longs)){
                         if (Sec < sectionNum) {
                             dayStudyVo.setStudyCourseKnob(Convert.toLong(Sec)+dayStudyVo.getStudyCourseKnob());
 
@@ -879,7 +899,7 @@ public class UserPlanServiceImpl extends ServiceImpl<UserPlanMapper, UserPlan> i
                                 sectionNum = 0;
                                 dayStudyVo.setPerform(0);
                             }
-                        }else if(month != (cal.get(Calendar.MONTH) + 1) && ifTrue(dayStudyVo.getStudyDay(),longs)){
+                        }else if(month > (cal.get(Calendar.MONTH) + 1) && ifTrue(dayStudyVo.getStudyDay(),longs)){
                             if (Sec < sectionNum) {
                                 dayStudyVo.setStudyCourseKnob(Convert.toLong(Sec));
                                 sectionNum = sectionNum-Sec;
@@ -1373,9 +1393,9 @@ public class UserPlanServiceImpl extends ServiceImpl<UserPlanMapper, UserPlan> i
             //获得当月
             if (!CollectionUtils.isEmpty(calendarStudyVos) && calendarStudyVos.size() > 0){
                 for (CalendarStudyVo calendarStudyVo : calendarStudyVos) {
-                        if (month < calendarStudyVo.getMonth()){
-                            month = Convert.toInt(calendarStudyVo.getMonth()+1);
-                        }
+                    if (month < calendarStudyVo.getMonth()){
+                        month = Convert.toInt(calendarStudyVo.getMonth()+1);
+                    }
                 }
             }else {
                 month = cal.get(Calendar.MONTH) + 1;