Эх сурвалжийг харах

Merge remote-tracking branch 'origin/dev' into dev

yangdamao 1 жил өмнө
parent
commit
599257fd35

+ 3 - 0
zhongzheng-system/src/main/java/com/zhongzheng/modules/grade/bo/ClassGradeAddBo.java

@@ -93,4 +93,7 @@ public class ClassGradeAddBo {
     /** 官方学习地址 */
     @ApiModelProperty("官方学习地址")
     private String officialLearningUrl;
+
+    @ApiModelProperty("班级提前截止天数")
+    private Integer pastDueDay;
 }

+ 3 - 0
zhongzheng-system/src/main/java/com/zhongzheng/modules/grade/bo/ClassGradeEditBo.java

@@ -111,4 +111,7 @@ public class ClassGradeEditBo {
     /** 官方学习地址 */
     @ApiModelProperty("官方学习地址")
     private String officialLearningUrl;
+
+    @ApiModelProperty("班级提前截止天数")
+    private Integer pastDueDay;
 }

+ 2 - 0
zhongzheng-system/src/main/java/com/zhongzheng/modules/grade/domain/ClassGrade.java

@@ -98,4 +98,6 @@ private static final long serialVersionUID=1L;
 
     @TableField(exist = false)
     private Boolean isNewClass;
+
+    private Integer pastDueDay;
 }

+ 3 - 0
zhongzheng-system/src/main/java/com/zhongzheng/modules/grade/service/impl/ClassGradeServiceImpl.java

@@ -877,6 +877,9 @@ public class ClassGradeServiceImpl extends ServiceImpl<ClassGradeMapper, ClassGr
         if(Validator.isNotEmpty(entity.getOfficialName())){
             entity.setOfficialName(entity.getOfficialName().trim());
         }
+        if(Validator.isNotEmpty(entity.getPastDueDay())&&entity.getPastDueDay()<10){
+            throw new CustomException("班级提前截止天数错误");
+        }
     }
 
     @Override

+ 2 - 0
zhongzheng-system/src/main/java/com/zhongzheng/modules/grade/vo/ClassGradeVo.java

@@ -225,4 +225,6 @@ public class ClassGradeVo {
 	private Long periodTime;
 
 	private String sevenPushDate;
+
+	private Integer pastDueDay;
 }

+ 3 - 1
zhongzheng-system/src/main/resources/mapper/modules/grade/ClassGradeMapper.xml

@@ -25,6 +25,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         <result property="interfaceAccountId" column="interface_account_id"/>
         <result property="interfacePeriodId" column="interface_period_id"/>
         <result property="officialLearningUrl" column="official_learning_url"/>
+        <result property="pastDueDay" column="past_due_day"/>
     </resultMap>
 
     <resultMap type="com.zhongzheng.modules.grade.vo.ClassGradeVo" id="ClassGradeVoResult">
@@ -60,6 +61,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         <result property="projectId" column="project_id"/>
         <result property="goodsId" column="goods_id"/>
         <result property="sevenCode" column="seven_code"/>
+        <result property="pastDueDay" column="past_due_day"/>
     </resultMap>
 
     <resultMap type="com.zhongzheng.modules.grade.vo.ClassGradeUserListVo" id="ClassGradeUserListVo">
@@ -308,7 +310,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             AND (#{classStartTime} BETWEEN g.class_start_time and g.class_end_time or #{classEndTime} BETWEEN g.class_start_time and g.class_end_time)
         </if>
         <if test="pastDue != null or pastDue != null ">
-            AND ((unix_timestamp(now())+6*24*3600) &lt; g.class_end_time or g.class_start_time is null)
+            AND ((unix_timestamp(now())+g.past_due_day*24*3600) &lt; g.class_end_time or g.class_start_time is null)
         </if>
         <if test="educationTypeId != null and educationTypeId !='' ">
             AND (

+ 3 - 1
zhongzheng-system/src/main/resources/mapper/modules/grade/ClassGradeUserMapper.xml

@@ -1971,7 +1971,8 @@
             cgu.order_goods_id,
             cg.class_end_time,
             og.goods_id,
-            g.goods_name
+            g.goods_name,
+            cg.class_name as grade_name
         FROM
             class_grade_user cgu
                 LEFT JOIN class_grade cg on  cgu.grade_id = cg.grade_id
@@ -1981,6 +1982,7 @@
           and cg.status = 1
           and cgu.status = 1
           and cgu.user_id = #{userId}
+          and (cgu.period_status = -1 or cgu.period_status = 0)
           AND unix_timestamp(now()) BETWEEN cg.class_end_time-#{startTime} and cg.class_end_time-#{endTime}
     </select>