change 3 жил өмнө
parent
commit
bc678567c4

+ 1 - 5
zhongzheng-admin/src/main/java/com/zhongzheng/controller/user/UserSubscribeController.java

@@ -121,11 +121,7 @@ public class UserSubscribeController extends BaseController {
         ExcelUtil<UserSubscribeImport> util = new ExcelUtil<UserSubscribeImport>(UserSubscribeImport.class);
         List<UserSubscribeImport> userSubscribeImportList = util.importExcel(file.getInputStream());
         List<UserSubscribeImport> userSubscribeImport = iUserSubscribeService.importData(userSubscribeImportList);
-        for (int i = 0; i < userSubscribeImport.size(); i++) {
-            if (StringUtils.isBlank(userSubscribeImport.get(i).getUserName()) && StringUtils.isBlank(userSubscribeImport.get(i).getApplyName()) && StringUtils.isBlank(userSubscribeImport.get(i).getUserName())){
-                userSubscribeImport.remove(i);
-            }
-        }
+
         if (!CollectionUtils.isEmpty(userSubscribeImport)) {
             return util.exportExcel(userSubscribeImport, "导入失败原因,请勿将此excel修改后再次上传,请在导入模板修改上传");
         }

+ 6 - 0
zhongzheng-system/src/main/java/com/zhongzheng/modules/grade/mapper/ClassGradeUserMapper.java

@@ -40,4 +40,10 @@ public interface ClassGradeUserMapper extends BaseMapper<ClassGradeUser> {
     List<ClassPeriodSectionVo> listPeriodSectionExam(@Param("chapterId") Long id,@Param("goodsId") Long goodsId,@Param("courseId") Long courseId,@Param("userId") Long userId);
 
     List<Long> selectStart(@Param("userId") Long userId,@Param("goodsId") Long goodsId,@Param("gradeId") Long gradeId);
+
+    List<ClassGradeUserVo> sendClassGradeUser();
+
+    List<ClassGradeUserVo> sendTenClassGradeUser();
+
+    List<ClassGradeUserVo> sendFiveClassGradeUser();
 }

+ 6 - 0
zhongzheng-system/src/main/java/com/zhongzheng/modules/grade/service/IClassGradeUserService.java

@@ -66,4 +66,10 @@ public interface IClassGradeUserService extends IService<ClassGradeUser> {
 	List<ClassPeriodSectionVo> listPeriodAuditSection(ClassGradeUserQueryBo bo);
 
 	ClassPeriodSectionVo listPeriodAuditStatus(UserPeriodQueryBo bo);
+
+    List<ClassGradeUserVo> sendTwentyClassGradeUser();
+
+	List<ClassGradeUserVo> sendTenClassGradeUser();
+
+	List<ClassGradeUserVo> sendFiveClassGradeUser();
 }

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

@@ -280,7 +280,7 @@ public class ClassGradeServiceImpl extends ServiceImpl<ClassGradeMapper, ClassGr
                         informUserAddBo.setRemind("二建继教开班提醒");
                         informUserAddBo.setGoodsId(classGradeVo.getGoodsList().get(0).getGoodsId());
                         GoodsVo goodsVo1 = iGoodsService.queryById(classGradeVo.getGoodsList().get(0).getGoodsId());
-                        informUserAddBo.setText("尊敬的用户:您购买的"+goodsVo1+"课程已开班,班级有效期为"+startTime+"至"+endTime+",请及时完成学习,如过期未完成学习,则需要重新购买学习,马上点击“立即学习”进行学习。");
+                        informUserAddBo.setText("尊敬的用户:您购买的"+goodsVo1.getGoodsName()+"课程已开班,班级有效期为"+startTime+"至"+endTime+",请及时完成学习,如过期未完成学习,则需要重新购买学习,马上点击“立即学习”进行学习。");
                         iInformUserService.insertByAddBo(informUserAddBo);
                     }
                     if (informRemindVo.getNoteStatus().equals(1)) {
@@ -295,7 +295,7 @@ public class ClassGradeServiceImpl extends ServiceImpl<ClassGradeMapper, ClassGr
                         informUserAddBo.setRemind("二建继教开班提醒");
                         informUserAddBo.setGoodsId(classGradeVo.getGoodsList().get(0).getGoodsId());
                         GoodsVo goodsVo1 = iGoodsService.queryById(classGradeVo.getGoodsList().get(0).getGoodsId());
-                        informUserAddBo.setText("尊敬的用户:您购买的"+goodsVo1+"课程已开班,班级有效期为"+startTime+"至"+endTime+",请及时完成学习,如过期未完成学习,则需要重新购买学习,马上点击“立即学习”进行学习。");
+                        informUserAddBo.setText("尊敬的用户:您购买的"+goodsVo1.getGoodsName()+"课程已开班,班级有效期为"+startTime+"至"+endTime+",请及时完成学习,如过期未完成学习,则需要重新购买学习,马上点击“立即学习”进行学习。");
                         iInformUserService.insertByAddBo(informUserAddBo);
                         UserVo userVo = iUserService.queryById(userId);
                         Map<String, Object> param = new HashMap<>();

+ 15 - 0
zhongzheng-system/src/main/java/com/zhongzheng/modules/grade/service/impl/ClassGradeUserServiceImpl.java

@@ -460,6 +460,21 @@ public class ClassGradeUserServiceImpl extends ServiceImpl<ClassGradeUserMapper,
         return classPeriodSectionVo;
     }
 
+    @Override
+    public List<ClassGradeUserVo> sendTwentyClassGradeUser() {
+        return baseMapper.sendClassGradeUser();
+    }
+
+    @Override
+    public List<ClassGradeUserVo> sendTenClassGradeUser() {
+        return baseMapper.sendTenClassGradeUser();
+    }
+
+    @Override
+    public List<ClassGradeUserVo> sendFiveClassGradeUser() {
+        return baseMapper.sendFiveClassGradeUser();
+    }
+
     /**
      * 实体类转化成视图对象
      *

+ 12 - 0
zhongzheng-system/src/main/java/com/zhongzheng/modules/grade/vo/ClassGradeUserGoodsVo.java

@@ -35,6 +35,18 @@ public class ClassGradeUserGoodsVo {
 	@ApiModelProperty("商品编码")
 	private String goodsCode;
 
+	@Excel(name = "商品ID")
+	@ApiModelProperty("商品ID")
+	private Long goodsId;
+
+	@Excel(name = "班级有效期")
+	@ApiModelProperty("班级有效期")
+	private Long classStartTime;
+
+	@Excel(name = "班级有效期")
+	@ApiModelProperty("班级有效期")
+	private Long classEndTime;
+
 	@Excel(name = "商品编码")
 	@ApiModelProperty("商品编码")
 	private String goodsName;

+ 12 - 0
zhongzheng-system/src/main/java/com/zhongzheng/modules/schedule/service/impl/ScheduleServiceImpl.java

@@ -22,11 +22,13 @@ import com.zhongzheng.modules.base.vo.UserProfileVo;
 import com.zhongzheng.modules.exam.vo.ExamUserApplyVo;
 import com.zhongzheng.modules.goods.service.IGoodsService;
 import com.zhongzheng.modules.goods.vo.GoodsVo;
+import com.zhongzheng.modules.grade.domain.ClassGradeUser;
 import com.zhongzheng.modules.grade.domain.ClassGradeUserTemp;
 import com.zhongzheng.modules.grade.service.IClassGradeGoodsService;
 import com.zhongzheng.modules.grade.service.IClassGradeService;
 import com.zhongzheng.modules.grade.service.IClassGradeUserService;
 import com.zhongzheng.modules.grade.service.IClassGradeUserTempService;
+import com.zhongzheng.modules.grade.vo.ClassGradeUserVo;
 import com.zhongzheng.modules.inform.bo.InformUserAddBo;
 import com.zhongzheng.modules.inform.service.IInformRemindService;
 import com.zhongzheng.modules.inform.service.IInformService;
@@ -233,6 +235,16 @@ public class ScheduleServiceImpl extends ServiceImpl<PolyvVideoMapper, PolyvVide
         //新考预约提醒
         sendExamSubscribe();
 
+        sendClassEnd();
+    }
+
+    private void sendClassEnd() {
+        List<ClassGradeUserVo> classTwentyGradeUserVos = iClassGradeUserService.sendTwentyClassGradeUser();
+        List<ClassGradeUserVo> classTenGradeUserVos = iClassGradeUserService.sendTenClassGradeUser();
+        List<ClassGradeUserVo> classFiveGradeUserVos = iClassGradeUserService.sendFiveClassGradeUser();
+        InformRemindVo informTwentyRemindVo = informRemindService.queryById(5L);
+        InformRemindVo informTenRemindVo = informRemindService.queryById(6L);
+        InformRemindVo informFiveRemindVo = informRemindService.queryById(7L);
 
     }
 

+ 6 - 0
zhongzheng-system/src/main/java/com/zhongzheng/modules/user/service/impl/UserSubscribeServiceImpl.java

@@ -315,6 +315,9 @@ public class UserSubscribeServiceImpl extends ServiceImpl<UserSubscribeMapper, U
         List<UserSubscribeImport> userSubscribeImports = new ArrayList<>();
         for (UserSubscribeImport userSubscribeImport : userSubscribeImportList) {
             UserSubscribeAddBo userSubscribeAddBo = new UserSubscribeAddBo();
+            if (StringUtils.isEmpty(userSubscribeImport.getUserName()) && StringUtils.isEmpty(userSubscribeImport.getApplyName()) && StringUtils.isEmpty(userSubscribeImport.getUserName())){
+                continue;
+            }
             //查询商品
             if (StringUtils.isEmpty(userSubscribeImport.getCode())) {
                 userSubscribeImport.setCause("未填商品编码");
@@ -503,6 +506,9 @@ public class UserSubscribeServiceImpl extends ServiceImpl<UserSubscribeMapper, U
         List<UserSubscribeImport> userSubscribeImports = new ArrayList<>();
         for (UserSubscribeImport userSubscribeImport : userSubscribeImportList) {
             UserSubscribe userSbusciEditBo = new UserSubscribe();
+            if (StringUtils.isEmpty(userSubscribeImport.getUserName()) && StringUtils.isEmpty(userSubscribeImport.getApplyName()) && StringUtils.isEmpty(userSubscribeImport.getUserName())){
+                continue;
+            }
             //查询商品
             if (StringUtils.isEmpty(userSubscribeImport.getCode())) {
                 userSubscribeImport.setCause("未填商品编码");

+ 64 - 0
zhongzheng-system/src/main/resources/mapper/modules/grade/ClassGradeUserMapper.xml

@@ -45,6 +45,9 @@
         <result property="schoolName" column="school_name"/>
         <result property="createTime" column="create_time"/>
         <result property="createBy" column="create_by"/>
+        <result property="goodsId" column="goods_id"/>
+        <result property="classStartTime" column="class_start_time"/>
+        <result property="classEndTime" column="class_end_time"/>
     </resultMap>
 
     <resultMap type="com.zhongzheng.modules.grade.vo.ClassPeriodStudentVo" id="ClassPeriodStudentVo">
@@ -652,4 +655,65 @@
         ORDER BY create_time ASC
     </select>
 
+    <select id="sendClassGradeUser"  resultMap="ClassGradeUserGoodsVoResult">
+        SELECT
+        cgu.user_id,
+        cg.class_start_time,
+        cg.class_end_time,
+        cgg.goods_id,
+        cg.grade_id
+        FROM
+        class_grade_user cgu
+        LEFT JOIN class_grade cg on  cgu.grade_id = cg.grade_id
+        LEFT JOIN class_grade_goods cgg on cg.grade_id = cgg.grade_id
+        LEFT JOIN goods g on cgg.goods_id = g.goods_id
+        LEFT JOIN inform_remind_business irb on  irb.business_id = g.business_id
+        where 1=1
+        and irb.remind_id =5
+        AND unix_timestamp(now()) BETWEEN cg.class_end_time-1728000 and cg.class_end_time-1641600
+        AND (SELECT COUNT(1) FROM inform_user iu where 1=1 and iu.remind_id = 5 and cgu.user_id = iu.user_id and cgu.grade_id = iu.grade_id and iu.system_status=3) &lt; 1
+    </select>
+
+
+    <select id="sendTenClassGradeUser"  resultMap="ClassGradeUserGoodsVoResult">
+
+        SELECT
+        cgu.user_id,
+        cg.class_start_time,
+        cg.class_end_time,
+        cgg.goods_id,
+        cg.grade_id
+        FROM
+        class_grade_user cgu
+        LEFT JOIN class_grade cg on  cgu.grade_id = cg.grade_id
+        LEFT JOIN class_grade_goods cgg on cg.grade_id = cgg.grade_id
+        LEFT JOIN goods g on cgg.goods_id = g.goods_id
+        LEFT JOIN inform_remind_business irb on  irb.business_id = g.business_id
+        where 1=1
+        and irb.remind_id =5
+        AND unix_timestamp(now()) BETWEEN cg.class_end_time-864000 and cg.class_end_time-777600
+        AND (SELECT COUNT(1) FROM inform_user iu where 1=1 and iu.remind_id = 6 and cgu.user_id = iu.user_id and cgu.grade_id = iu.grade_id and iu.system_status=3) &lt; 1
+    </select>
+
+
+    <select id="sendFiveClassGradeUser"  resultMap="ClassGradeUserGoodsVoResult">
+
+        SELECT
+        cgu.user_id,
+        cg.class_start_time,
+        cg.class_end_time,
+        cgg.goods_id,
+        cg.grade_id
+        FROM
+        class_grade_user cgu
+        LEFT JOIN class_grade cg on  cgu.grade_id = cg.grade_id
+        LEFT JOIN class_grade_goods cgg on cg.grade_id = cgg.grade_id
+        LEFT JOIN goods g on cgg.goods_id = g.goods_id
+        LEFT JOIN inform_remind_business irb on  irb.business_id = g.business_id
+        where 1=1
+        and irb.remind_id =5
+        AND unix_timestamp(now()) BETWEEN cg.class_end_time-432000 and cg.class_end_time-345600
+        AND (SELECT COUNT(1) FROM inform_user iu where 1=1 and iu.remind_id = 6 and cgu.user_id = iu.user_id and cgu.grade_id = iu.grade_id and iu.system_status=3) &lt; 1
+    </select>
+
 </mapper>