change пре 4 година
родитељ
комит
c72e039cd2

+ 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/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();

+ 6 - 0
zhongzheng-system/src/main/resources/mapper/modules/inform/InformMapper.xml

@@ -94,6 +94,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>