he2802 4 anni fa
parent
commit
67446ffde8

+ 11 - 0
zhongzheng-admin/src/main/java/com/zhongzheng/controller/schedule/ScheduleController.java

@@ -72,4 +72,15 @@ public class ScheduleController extends BaseController {
         iScheduleService.closeTimeOutOrder();
         return AjaxResult.success();
     }
+
+    /**
+     * 考试提醒
+     * @return
+     */
+    @ApiOperation("考试预约提醒")
+    @GetMapping("/issue")
+    public AjaxResult updateIssue(UserQueryBo bo) {
+        iScheduleService.updateIssue(bo);
+        return AjaxResult.success();
+    }
 }

+ 3 - 0
zhongzheng-system/src/main/java/com/zhongzheng/modules/inform/bo/InformQueryBo.java

@@ -42,6 +42,9 @@ public class InformQueryBo extends BaseEntity {
 	/** 1 学员通知 */
 	@ApiModelProperty("1 学员通知")
 	private Integer informType;
+
+	@ApiModelProperty("查询定时发布")
+	private Integer issue;
 	/** 通知标题 */
 	@ApiModelProperty("通知标题")
 	private String informName;

+ 1 - 0
zhongzheng-system/src/main/java/com/zhongzheng/modules/inform/service/impl/InformServiceImpl.java

@@ -175,6 +175,7 @@ public class InformServiceImpl extends ServiceImpl<InformMapper, Inform> impleme
                 Inform update = new Inform();
                 update.setInformId(informId);
                 update.setStatus(-1);
+                update.setUpdateTime(DateUtils.getNowTime());
                 return  this.updateById(update);
             }
         }

+ 1 - 0
zhongzheng-system/src/main/java/com/zhongzheng/modules/inform/service/impl/InformUserServiceImpl.java

@@ -82,6 +82,7 @@ public class InformUserServiceImpl extends ServiceImpl<InformUserMapper, InformU
         lqw.eq(bo.getSendTime() != null, InformUser::getSendTime, bo.getSendTime());
         lqw.eq(bo.getSendStatus() != null, InformUser::getSendStatus, bo.getSendStatus());
         lqw.eq(bo.getReceiptStatus() != null, InformUser::getReceiptStatus, bo.getReceiptStatus());
+        lqw.eq( InformUser::getSendStatus, 1);
         lqw.in( InformUser::getSystemStatus, status);
         lqw.orderByDesc(InformUser::getSendTime);
         List<InformUserVo> informUserVos = entity2Vo(this.list(lqw));

+ 2 - 0
zhongzheng-system/src/main/java/com/zhongzheng/modules/schedule/service/IScheduleService.java

@@ -29,4 +29,6 @@ public interface IScheduleService extends IService<PolyvVideo> {
     void timeSend(UserQueryBo bo);
 
     void closeTimeOutOrder();
+
+    void updateIssue(UserQueryBo bo);
 }

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

@@ -30,11 +30,15 @@ import com.zhongzheng.modules.grade.service.IClassGradeUserService;
 import com.zhongzheng.modules.grade.service.IClassGradeUserTempService;
 import com.zhongzheng.modules.grade.vo.ClassGradeUserGoodsVo;
 import com.zhongzheng.modules.grade.vo.ClassGradeUserVo;
+import com.zhongzheng.modules.inform.bo.InformQueryBo;
 import com.zhongzheng.modules.inform.bo.InformUserAddBo;
+import com.zhongzheng.modules.inform.domain.Inform;
+import com.zhongzheng.modules.inform.domain.InformUser;
 import com.zhongzheng.modules.inform.service.IInformRemindService;
 import com.zhongzheng.modules.inform.service.IInformService;
 import com.zhongzheng.modules.inform.service.IInformUserService;
 import com.zhongzheng.modules.inform.vo.InformRemindVo;
+import com.zhongzheng.modules.inform.vo.InformVo;
 import com.zhongzheng.modules.order.bo.OrderQueryBo;
 import com.zhongzheng.modules.order.domain.Order;
 import com.zhongzheng.modules.order.mapper.OrderMapper;
@@ -482,6 +486,22 @@ public class ScheduleServiceImpl extends ServiceImpl<PolyvVideoMapper, PolyvVide
         }
     }
 
+    @Override
+    public void updateIssue(UserQueryBo bo) {
+        InformQueryBo informQueryBo = new InformQueryBo();
+        informQueryBo.setIssue(1);
+        informQueryBo.setIssueStatus(2);
+        List<InformVo> informVos = informService.listInform(informQueryBo);
+        for (InformVo informVo : informVos) {
+            LambdaQueryWrapper<InformUser> lqw = Wrappers.lambdaQuery();
+            lqw.eq(InformUser::getInformId, informVo.getInformId());
+            InformUser informUser = new InformUser();
+            informUser.setSendTime(DateUtils.getNowTime());
+            informUser.setSendStatus(1);
+            iInformUserService.update(informUser,lqw);
+        }
+    }
+
 
     private void sendExamSubscribe() {
         List<ExamUserApplyVo> examUserApplyVos = iInformUserService.listUserApply();

+ 17 - 1
zhongzheng-system/src/main/resources/mapper/modules/inform/InformMapper.xml

@@ -66,14 +66,24 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
     </resultMap>
     <select id="listInform" parameterType="com.zhongzheng.modules.inform.bo.InformQueryBo"  resultMap="InformVo">
         SELECT
+       /* i.*,
+        (SELECT COUNT(iu.id) FROM inform_user iu where i.inform_id=iu.inform_id) as user_num,
+        (SELECT ic.classify_name FROM inform_classify ic where i.classify_id=ic.classify_id) as classify_name,
+        (SELECT iu.send_time FROM inform_user iu where i.inform_id=iu.inform_id ORDER BY iu.send_time ASC limit 1) as send_time,
+        IF((SELECT io.`status` FROM inform io where io.inform_id = i.inform_id)=0,null,
+        IF((SELECT COUNT(iu.inform_id) FROM inform_user iu where i.inform_id=iu.inform_id and iu.send_status=1)>0,4,
+        IF((SELECT COUNT(iu.inform_id) FROM inform_user iu where i.inform_id=iu.inform_id and iu.send_status=1)=0,2,
+        IF((SELECT COUNT(iu.inform_id) FROM inform_user iu where i.inform_id=iu.inform_id and iu.send_status=1)=(SELECT COUNT(iu.inform_id) FROM inform_user iu where i.inform_id=iu.inform_id),1,
+        IF((SELECT COUNT(iu.inform_id) FROM inform_user iu where i.inform_id=iu.inform_id and iu.send_status=1)&lt;(SELECT COUNT(iu.inform_id) FROM inform_user iu where i.inform_id=iu.inform_id),3))))) as user_status, (SELECT COUNT(iu.inform_id) FROM inform_user iu where i.inform_id=iu.inform_id and iu.send_status=1) as receipt_num */      FROM
         i.*,
         (SELECT COUNT(iu.id) FROM inform_user iu where i.inform_id=iu.inform_id) as user_num,
         (SELECT ic.classify_name FROM inform_classify ic where i.classify_id=ic.classify_id) as classify_name,
         (SELECT iu.send_time FROM inform_user iu where i.inform_id=iu.inform_id ORDER BY iu.send_time ASC limit 1) as send_time,
         IF((SELECT io.`status` FROM inform io where io.inform_id = i.inform_id)=0,null,
+        IF((SELECT COUNT(iu.inform_id) FROM inform_user iu where i.inform_id=iu.inform_id and iu.send_status is null)>0,4,
         IF((SELECT COUNT(iu.inform_id) FROM inform_user iu where i.inform_id=iu.inform_id and iu.send_status=1)=0,2,
         IF((SELECT COUNT(iu.inform_id) FROM inform_user iu where i.inform_id=iu.inform_id and iu.send_status=1)=(SELECT COUNT(iu.inform_id) FROM inform_user iu where i.inform_id=iu.inform_id),1,
-        IF((SELECT COUNT(iu.inform_id) FROM inform_user iu where i.inform_id=iu.inform_id and iu.send_status=1)&lt;(SELECT COUNT(iu.inform_id) FROM inform_user iu where i.inform_id=iu.inform_id),3,4)))) as user_status, (SELECT COUNT(iu.inform_id) FROM inform_user iu where i.inform_id=iu.inform_id and iu.send_status=1) as receipt_num
+        3)))) as user_status, (SELECT COUNT(iu.inform_id) FROM inform_user iu where i.inform_id=iu.inform_id and iu.send_status=1) as receipt_num
         FROM
         inform i where 1=1
         <if test="status != null and status.size()!=0 ">
@@ -94,6 +104,12 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         <if test="informId != null and informId != ''">
             and i.inform_id = #{informId}
         </if>
+        <if test="issueStatus != null and issueStatus != ''">
+            and i.issue_status = #{issueStatus}
+        </if>
+        <if test="issue != null and issue != ''">
+            and unix_timestamp(now()) >i.issue_time
+        </if>
         <if test="startTime != null and startTime != ''">
             and (SELECT iu.send_time FROM inform_user iu where i.inform_id=iu.inform_id ORDER BY iu.send_time ASC limit 1) BETWEEN #{startTime} and #{endTime}
         </if>