Browse Source

fix 通知

tanzh 3 years ago
parent
commit
fc98f71035

+ 3 - 0
zhongzheng-admin-saas/src/main/resources/application.yml

@@ -290,3 +290,6 @@ aliyun:
     planReminder: SMS_230970248     #学习计划提醒
     commitmentCode: SMS_231190546     #承诺书审核通过通知
     commitmentFailsCode: SMS_231215516     #承诺书审核不通过通知
+    mockBookingReminder: SMS_243430276     #模考预约提醒
+    mockRemind: SMS_243355276      #模考开始提醒
+    liveStartRemind: SMS_243345514      #直播开课提醒

+ 3 - 0
zhongzheng-admin/src/main/resources/application.yml

@@ -291,3 +291,6 @@ aliyun:
     planReminder: SMS_230970248     #学习计划提醒
     commitmentCode: SMS_231190546     #承诺书审核通过通知
     commitmentFailsCode: SMS_231215516     #承诺书审核不通过通知
+    mockBookingReminder: SMS_243430276     #模考预约提醒
+    mockRemind: SMS_243355276      #模考开始提醒
+    liveStartRemind: SMS_243345514      #直播开课提醒

+ 3 - 0
zhongzheng-api/src/main/resources/application.yml

@@ -286,3 +286,6 @@ aliyun:
     planReminder: SMS_230970248     #学习计划提醒
     commitmentCode: SMS_231190546     #承诺书审核通过通知
     commitmentFailsCode: SMS_231215516     #承诺书审核不通过通知
+    mockBookingReminder: SMS_243430276     #模考预约提醒
+    mockRemind: SMS_243355276      #模考开始提醒
+    liveStartRemind: SMS_243345514      #直播开课提醒

+ 35 - 25
zhongzheng-system/src/main/java/com/zhongzheng/modules/schedule/service/impl/ScheduleServiceImpl.java

@@ -263,6 +263,15 @@ public class ScheduleServiceImpl extends ServiceImpl<PolyvVideoMapper, PolyvVide
     @Value("${aliyun.sms.remainingDaysValidityCode}")
     private String remainingDaysValidityCode;
 
+    @Value("${aliyun.sms.mockBookingReminder}")
+    private String mockBookingReminder;
+
+    @Value("${aliyun.sms.mockRemind}")
+    private String mockRemind;
+
+    @Value("${aliyun.sms.liveStartRemind}")
+    private String liveStartRemind;
+
     @Override
     public String updateGoodsSend(UserQueryBo bo) {
         InformRemindVo informRemindVo = informRemindService.queryById(1L);
@@ -1331,13 +1340,17 @@ public class ScheduleServiceImpl extends ServiceImpl<PolyvVideoMapper, PolyvVide
         List<MockApplyVo> mockApplyVos = iMockApplyService.listSubjects();
         List<Long> gradeIds = new ArrayList<>();
         classGradeVos.forEach(classGradeVo -> {
-           String[] subjectId = classGradeVo.getSubjectIds().split(",");
-           List<String> subjectIds = Arrays.asList(subjectId);
-           for (MockApplyVo mockApplyVo : mockApplyVos) {
-               if (subjectIds.contains(mockApplyVo.getSubjectId())) {
-                   gradeIds.add(classGradeVo.getGradeId());
-               }
-           }
+            if (Validator.isNotEmpty(classGradeVo.getSubjectIds())) {
+                String[] subjectId = classGradeVo.getSubjectIds().split(",");
+                List<String> subjectIds = Arrays.asList(subjectId);
+                if (mockApplyVos != null && mockApplyVos.size() > 0) {
+                    for (MockApplyVo mockApplyVo : mockApplyVos) {
+                        if (subjectIds.contains(mockApplyVo.getSubjectId())) {
+                            gradeIds.add(classGradeVo.getGradeId());
+                        }
+                    }
+                }
+            }
         });
         List<ClassGradeStudentVo> classGradeStudentVos = new ArrayList<>();
         if (gradeIds != null && gradeIds.size() > 0) {
@@ -1361,7 +1374,7 @@ public class ScheduleServiceImpl extends ServiceImpl<PolyvVideoMapper, PolyvVide
                 informUserAddBo.setRemindId(25L);
                 informUserAddBo.setSystemStatus(1);
                 informUserAddBo.setRemind("模考预约提醒");
-                informUserAddBo.setText("尊敬的用户:【" + classGradeStudentVo.getBusinessName() + classGradeStudentVo.getProjectName() + "】考前模拟考试将开始报名参加模拟考试。请登录【祥粤云小程序】或【web.xyyxt.net】进行报名。");
+                informUserAddBo.setText("尊敬的用户:【" + classGradeStudentVo.getBusinessName() + classGradeStudentVo.getProjectName() + "】考前模拟考试将开始报名参加模拟考试。请登录【祥粤云小程序】或【web.xyyxt.net】进行报名。");
                 iInformUserService.insertByAddBo(informUserAddBo);
             }
             if (informRemindVo.getNoteStatus().equals(1)) {
@@ -1374,10 +1387,11 @@ public class ScheduleServiceImpl extends ServiceImpl<PolyvVideoMapper, PolyvVide
                 informUserAddBo.setRemindId(25L);
                 informUserAddBo.setSystemStatus(3);
                 informUserAddBo.setRemind("模考预约提醒");
-                informUserAddBo.setText("尊敬的用户:【" + classGradeStudentVo.getBusinessName() + classGradeStudentVo.getProjectName() + "】考前模拟考试将开始报名参加模拟考试。请登录【祥粤云小程序】或【web.xyyxt.net】进行报名。");
+                informUserAddBo.setText("尊敬的用户:【" + classGradeStudentVo.getBusinessName() + classGradeStudentVo.getProjectName() + "】考前模拟考试将开始报名参加模拟考试。请登录【祥粤云小程序】或【web.xyyxt.net】进行报名。");
                 UserVo userVo = iUserService.queryById(classGradeStudentVo.getUserId());
                 Map<String, Object> param = new HashMap<>();
-                if (Validator.isNotEmpty(IAliSmsService.sendInformSms(userVo.getTelphone(), JSON.toJSONString(param), bookingReminder))) {
+                param.put("businessName", classGradeStudentVo.getBusinessName() + classGradeStudentVo.getProjectName());
+                if (Validator.isNotEmpty(IAliSmsService.sendInformSms(userVo.getTelphone(), JSON.toJSONString(param), mockBookingReminder))) {
                     iInformUserService.insertByAddBo(informUserAddBo);
                 }
             }
@@ -1401,13 +1415,6 @@ public class ScheduleServiceImpl extends ServiceImpl<PolyvVideoMapper, PolyvVide
         InformRemindVo informRemindVo = informRemindService.queryById(26L);
         if (userMockSubscribeList != null && userMockSubscribeList.size() > 0) {
             for (UserMockSubscribe subscribeVo : userMockSubscribeList) {
-                String res;
-                SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd");
-                Long timeId = subscribeVo.getApplySiteExamTime() * 1000;
-                Date date = new Date(timeId);
-                res = simpleDateFormat.format(date);
-                String startTime = subscribeVo.getApplySiteStartTime();
-                String endTime = subscribeVo.getApplySiteEndTime();
                 LambdaQueryWrapper<MockMajorSubjectTime> lqw2 = Wrappers.lambdaQuery();
                 lqw2.eq(MockMajorSubjectTime::getId, subscribeVo.getEachExamId());
                 MockMajorSubjectTime mockMajorSubjectTime = iMockMajorSubjectTimeService.getOne(lqw2);
@@ -1430,7 +1437,7 @@ public class ScheduleServiceImpl extends ServiceImpl<PolyvVideoMapper, PolyvVide
                     informUserAddBo.setRemindId(26L);
                     informUserAddBo.setSystemStatus(1);
                     informUserAddBo.setRemind("模考提醒");
-                    informUserAddBo.setText("祥粤云学堂提醒:您学习【" + courseSubject.getSubjectName() + "】科目中的【" + mockApply.getApplyName() + "模考】已将于60分钟后开始直播,请及时在【祥粤云小程序】或【web.xyyxt.net】进行考试。");
+                    informUserAddBo.setText("祥粤云学堂提醒:您学习【" + courseSubject.getSubjectName() + "】科目中的【" + mockApply.getApplyName() + "模考】已将于60分钟后开始考试,请及时在【祥粤云小程序】或【web.xyyxt.net】进行考试。");
                     iInformUserService.insertByAddBo(informUserAddBo);
                 }
                 if (informRemindVo.getNoteStatus().equals(1)) {
@@ -1440,14 +1447,15 @@ public class ScheduleServiceImpl extends ServiceImpl<PolyvVideoMapper, PolyvVide
                     informUserAddBo.setSendStatus(1);
                     informUserAddBo.setCreateTime(DateUtils.getNowTime());
                     informUserAddBo.setUpdateTime(DateUtils.getNowTime());
-                    informUserAddBo.setRemindId(3L);
+                    informUserAddBo.setRemindId(26L);
                     informUserAddBo.setSystemStatus(3);
                     informUserAddBo.setRemind("模考提醒");
-                    informUserAddBo.setText("祥粤云学堂提醒:您学习【" + courseSubject.getSubjectName() + "】科目中的【" + mockApply.getApplyName() + "模考】已将于60分钟后开始直播,请及时在【祥粤云小程序】或【web.xyyxt.net】进行考试。");
+                    informUserAddBo.setText("祥粤云学堂提醒:您学习【" + courseSubject.getSubjectName() + "】科目中的【" + mockApply.getApplyName() + "模考】已将于60分钟后开始考试,请及时在【祥粤云小程序】或【web.xyyxt.net】进行考试。");
                     UserVo userVo = iUserService.queryById(subscribeVo.getUserId());
                     Map<String, Object> param = new HashMap<>();
-                    param.put("time", res + "(" + startTime + "-" + endTime + ")");
-                    if (Validator.isNotEmpty(IAliSmsService.sendInformSms(userVo.getTelphone(), JSON.toJSONString(param), examinationRemind))) {
+                    param.put("subjectName", courseSubject.getSubjectName());
+                    param.put("applyName", mockApply.getApplyName());
+                    if (Validator.isNotEmpty(IAliSmsService.sendInformSms(userVo.getTelphone(), JSON.toJSONString(param), mockRemind))) {
                         iInformUserService.insertByAddBo(informUserAddBo);
                     }
                 }
@@ -1481,13 +1489,15 @@ public class ScheduleServiceImpl extends ServiceImpl<PolyvVideoMapper, PolyvVide
                 informUserAddBo.setSendStatus(1);
                 informUserAddBo.setCreateTime(DateUtils.getNowTime());
                 informUserAddBo.setUpdateTime(DateUtils.getNowTime());
-                informUserAddBo.setRemindId(13L);
+                informUserAddBo.setRemindId(27L);
                 informUserAddBo.setSystemStatus(3);
-                informUserAddBo.setRemind("考试预约提醒");
+                informUserAddBo.setRemind("直播开课提醒");
                 informUserAddBo.setText("祥粤云学堂提醒:您学习【" + userMockSubscribeVo.getSubjectName() + "】科目中的【" + userMockSubscribeVo.getPrefixName() + "直播】已将于60分钟后开始直播,请及时在【祥粤云小程序】或【web.xyyxt.net】进行观看。");
                 UserVo userVo = iUserService.queryById(userMockSubscribeVo.getUserId());
                 Map<String, Object> param = new HashMap<>();
-                if (Validator.isNotEmpty(IAliSmsService.sendInformSms(userVo.getTelphone(), JSON.toJSONString(param), bookingReminder))) {
+                param.put("subjectName", userMockSubscribeVo.getSubjectName());
+                param.put("prefixName", userMockSubscribeVo.getPrefixName());
+                if (Validator.isNotEmpty(IAliSmsService.sendInformSms(userVo.getTelphone(), JSON.toJSONString(param), liveStartRemind))) {
                     iInformUserService.insertByAddBo(informUserAddBo);
                 }
             }