he2802 il y a 1 an
Parent
commit
824fea8c40

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

@@ -20,6 +20,8 @@ public interface IScheduleService extends IService<PolyvVideo> {
 
     void updateExamSend(UserQueryBo bo);
 
+    void sendServiceEnd();
+
     void timeSend(UserQueryBo bo);
 
     void closeTimeOutOrder();

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

@@ -586,6 +586,56 @@ public class ScheduleServiceImpl extends ServiceImpl<PolyvVideoMapper, PolyvVide
         sendClassEnd();
     }
 
+    @Override
+    public void sendServiceEnd() {
+        InformRemindVo informRemindVo = informRemindService.queryByName("二建继教学习服务还剩10天");
+        if(Validator.isNotEmpty(informRemindVo)){
+            List<OrderGoodsVo> list = orderGoodsMapper.sendTenOrderGoods(informRemindVo.getId());
+            for (OrderGoodsVo goodsVo : list) {
+                GoodsVo goods = iGoodsService.queryById(goodsVo.getGoodsId());
+                UserVo userVo = iUserService.queryById(goodsVo.getUserId());
+                if (informRemindVo.getWayStatus().equals(1)) {
+                    InformUserAddBo informUserAddBo = new InformUserAddBo();
+                    informUserAddBo.setUserId(goodsVo.getUserId());
+                    informUserAddBo.setSendStatus(1);
+                    informUserAddBo.setSendTime(DateUtils.getNowTime());
+                    informUserAddBo.setCreateTime(DateUtils.getNowTime());
+                    informUserAddBo.setUpdateTime(DateUtils.getNowTime());
+                    informUserAddBo.setRemindId(informRemindVo.getId());
+                    informUserAddBo.setSystemStatus(1);
+                    informUserAddBo.setGradeId(goodsVo.getGradeId());
+                    informUserAddBo.setOrderGoodsId(goodsVo.getOrderGoodsId());
+                    informUserAddBo.setRemind("二建继教学习服务还剩10天提醒");
+                    informUserAddBo.setGoodsId(goodsVo.getGoodsId());
+                    informUserAddBo.setText("尊敬的用户:您购买的课程二建继教学习服务还剩10天,请在"+DateUtils.timestampToDateFormat(goodsVo.getServiceEndTime(),DateUtils.YYYY__MM__DD)+"前完成学习,避免课程过期作废,无法学习给您带来不便。");
+                    iInformUserService.insertByAddBo(informUserAddBo);
+                }
+                if (informRemindVo.getNoteStatus().equals(1)) {
+                    InformUserAddBo informUserAddBo = new InformUserAddBo();
+                    informUserAddBo.setUserId(goodsVo.getUserId());
+                    informUserAddBo.setSendStatus(1);
+                    informUserAddBo.setSendTime(DateUtils.getNowTime());
+                    informUserAddBo.setCreateTime(DateUtils.getNowTime());
+                    informUserAddBo.setUpdateTime(DateUtils.getNowTime());
+                    informUserAddBo.setRemindId(informRemindVo.getId());
+                    informUserAddBo.setSystemStatus(3);
+                    informUserAddBo.setOrderGoodsId(goodsVo.getOrderGoodsId());
+                    informUserAddBo.setGradeId(goodsVo.getGradeId());
+                    informUserAddBo.setRemind("二建继教学习服务还剩10天提醒");
+                    informUserAddBo.setGoodsId(goodsVo.getGoodsId());
+                    informUserAddBo.setText("尊敬的用户:您购买的课程二建继教学习服务还剩10天,请在"+DateUtils.timestampToDateFormat(goodsVo.getServiceEndTime(),DateUtils.YYYY__MM__DD)+"前完成学习,避免课程过期作废,无法学习给您带来不便。");
+                    Map<String, Object> param = new HashMap<>();
+                    param.put("date", DateUtils.timestampToDateFormat(goodsVo.getServiceEndTime(),DateUtils.YYYY__MM__DD));
+                    param.put("day", "10");
+                    if (Validator.isNotEmpty(IAliSmsService.sendInformSms(userVo.getTelphone(), JSON.toJSONString(param), orderServiceEndRemind))) {
+                        iInformUserService.insertByAddBo(informUserAddBo);
+                    }
+                }
+            }
+        }
+
+    }
+
     private void sendClassEnd() {
         List<ClassGradeUserGoodsVo> classTwentyGradeUserVos = iClassGradeUserService.sendTwentyClassGradeUser();
         List<ClassGradeUserGoodsVo> classTenGradeUserVos = iClassGradeUserService.sendTenClassGradeUser();