Quellcode durchsuchen

fix 通知规则

tanzh vor 3 Jahren
Ursprung
Commit
2b1c254610

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

@@ -1417,7 +1417,6 @@ public class ScheduleServiceImpl extends ServiceImpl<PolyvVideoMapper, PolyvVide
     public void mockTimeSend(UserQueryBo bo) {
         //提醒考试
         LambdaQueryWrapper<UserMockSubscribe> lqw = Wrappers.lambdaQuery();
-        lqw.eq(UserMockSubscribe::getMockRemind,1);
         lqw.eq(UserMockSubscribe::getHasMockRemind,0);
         List<UserMockSubscribe> userMockSubscribeList = iUserMockSubscribeService.list(lqw);
         userMockSubscribeList.removeIf(userMockSubscribe -> {
@@ -1443,18 +1442,20 @@ public class ScheduleServiceImpl extends ServiceImpl<PolyvVideoMapper, PolyvVide
                 LambdaQueryWrapper<MockApply> lqw5 = Wrappers.lambdaQuery();
                 lqw5.eq(MockApply::getApplyId, subscribeVo.getApplyId());
                 MockApply mockApply = iMockApplyService.getOne(lqw5);
-                if (informRemindVo.getWayStatus().equals(1)) {
-                    InformUserAddBo informUserAddBo = new InformUserAddBo();
-                    informUserAddBo.setUserId(subscribeVo.getUserId());
-                    informUserAddBo.setSendStatus(1);
-                    informUserAddBo.setSendTime(DateUtils.getNowTime());
-                    informUserAddBo.setCreateTime(DateUtils.getNowTime());
-                    informUserAddBo.setUpdateTime(DateUtils.getNowTime());
-                    informUserAddBo.setRemindId(26L);
-                    informUserAddBo.setSystemStatus(1);
-                    informUserAddBo.setRemind("模考提醒");
-                    informUserAddBo.setText("祥粤云学堂提醒:您学习【" + courseSubject.getSubjectName() + "】科目中的【" + mockApply.getApplyName() + "模考】已将于60分钟后开始考试,请及时在【祥粤云小程序】或【web.xyyxt.net】进行考试。");
-                    iInformUserService.insertByAddBo(informUserAddBo);
+                if (subscribeVo.getMockRemind() == 1) {
+                    if (informRemindVo.getWayStatus().equals(1)) {
+                        InformUserAddBo informUserAddBo = new InformUserAddBo();
+                        informUserAddBo.setUserId(subscribeVo.getUserId());
+                        informUserAddBo.setSendStatus(1);
+                        informUserAddBo.setSendTime(DateUtils.getNowTime());
+                        informUserAddBo.setCreateTime(DateUtils.getNowTime());
+                        informUserAddBo.setUpdateTime(DateUtils.getNowTime());
+                        informUserAddBo.setRemindId(26L);
+                        informUserAddBo.setSystemStatus(1);
+                        informUserAddBo.setRemind("模考提醒");
+                        informUserAddBo.setText("祥粤云学堂提醒:您学习【" + courseSubject.getSubjectName() + "】科目中的【" + mockApply.getApplyName() + "模考】已将于60分钟后开始考试,请及时在【祥粤云小程序】或【web.xyyxt.net】进行考试。");
+                        iInformUserService.insertByAddBo(informUserAddBo);
+                    }
                 }
                 if (informRemindVo.getNoteStatus().equals(1)) {
                     InformUserAddBo informUserAddBo = new InformUserAddBo();
@@ -1490,18 +1491,20 @@ public class ScheduleServiceImpl extends ServiceImpl<PolyvVideoMapper, PolyvVide
         userMockSubscribeVoList.removeIf(userMockSubscribeVo -> System.currentTimeMillis()/1000 + 3600 <= userMockSubscribeVo.getLiveStartTime());
         for (UserMockSubscribeVo userMockSubscribeVo : userMockSubscribeVoList) {
             InformRemindVo informRemindVo = informRemindService.queryById(27L);
-            if (informRemindVo.getWayStatus().equals(1)) {
-                InformUserAddBo informUserAddBo = new InformUserAddBo();
-                informUserAddBo.setUserId(userMockSubscribeVo.getUserId());
-                informUserAddBo.setSendStatus(1);
-                informUserAddBo.setSendTime(DateUtils.getNowTime());
-                informUserAddBo.setCreateTime(DateUtils.getNowTime());
-                informUserAddBo.setUpdateTime(DateUtils.getNowTime());
-                informUserAddBo.setRemindId(27L);
-                informUserAddBo.setSystemStatus(1);
-                informUserAddBo.setRemind("直播开课提醒");
-                informUserAddBo.setText("祥粤云学堂提醒:您学习【" + userMockSubscribeVo.getSubjectName() + "】科目中的【" + userMockSubscribeVo.getName() + "直播】已将于60分钟后开始直播,请及时在【祥粤云小程序】或【web.xyyxt.net】进行观看。");
-                iInformUserService.insertByAddBo(informUserAddBo);
+            if (userMockSubscribeVo.getLiveSubscribe() == 1) {
+                if (informRemindVo.getWayStatus().equals(1)) {
+                    InformUserAddBo informUserAddBo = new InformUserAddBo();
+                    informUserAddBo.setUserId(userMockSubscribeVo.getUserId());
+                    informUserAddBo.setSendStatus(1);
+                    informUserAddBo.setSendTime(DateUtils.getNowTime());
+                    informUserAddBo.setCreateTime(DateUtils.getNowTime());
+                    informUserAddBo.setUpdateTime(DateUtils.getNowTime());
+                    informUserAddBo.setRemindId(27L);
+                    informUserAddBo.setSystemStatus(1);
+                    informUserAddBo.setRemind("直播开课提醒");
+                    informUserAddBo.setText("祥粤云学堂提醒:您学习【" + userMockSubscribeVo.getSubjectName() + "】科目中的【" + userMockSubscribeVo.getName() + "直播】已将于60分钟后开始直播,请及时在【祥粤云小程序】或【web.xyyxt.net】进行观看。");
+                    iInformUserService.insertByAddBo(informUserAddBo);
+                }
             }
             if (informRemindVo.getNoteStatus().equals(1)) {
                 InformUserAddBo informUserAddBo = new InformUserAddBo();

+ 2 - 3
zhongzheng-system/src/main/resources/mapper/modules/user/UserMockSubscribeMapper.xml

@@ -205,9 +205,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         LEFT JOIN course_section cs ON mms.section_id = cs.section_id
         LEFT JOIN course_subject css ON mms.subject_id = css.id
         WHERE
-            ums.live_subscribe = 1
-          and ums.has_live_subscribe = 0
-          and cs.live_start_time is not null
+        ums.has_live_subscribe = 0
+        and cs.live_start_time is not null
     </select>
     <select id="listSubscribeInfo" parameterType="java.lang.Long" resultMap="UserMockSubscribeVoResult">
         SELECT