|
@@ -28,6 +28,7 @@ import com.zhongzheng.modules.grade.service.IClassGradeGoodsService;
|
|
|
import com.zhongzheng.modules.grade.service.IClassGradeService;
|
|
|
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.InformUserAddBo;
|
|
|
import com.zhongzheng.modules.inform.service.IInformRemindService;
|
|
@@ -141,6 +142,9 @@ public class ScheduleServiceImpl extends ServiceImpl<PolyvVideoMapper, PolyvVide
|
|
|
@Value("${aliyun.sms.examinationRemind}")
|
|
|
private String examinationRemind;
|
|
|
|
|
|
+ @Value("${aliyun.sms.remainingDaysValidityCode}")
|
|
|
+ private String remainingDaysValidityCode;
|
|
|
+
|
|
|
@Override
|
|
|
public String updateGoodsSend(UserQueryBo bo) {
|
|
|
InformRemindVo informRemindVo = informRemindService.queryById(1L);
|
|
@@ -239,12 +243,161 @@ public class ScheduleServiceImpl extends ServiceImpl<PolyvVideoMapper, PolyvVide
|
|
|
}
|
|
|
|
|
|
private void sendClassEnd() {
|
|
|
- List<ClassGradeUserVo> classTwentyGradeUserVos = iClassGradeUserService.sendTwentyClassGradeUser();
|
|
|
- List<ClassGradeUserVo> classTenGradeUserVos = iClassGradeUserService.sendTenClassGradeUser();
|
|
|
- List<ClassGradeUserVo> classFiveGradeUserVos = iClassGradeUserService.sendFiveClassGradeUser();
|
|
|
+ List<ClassGradeUserGoodsVo> classTwentyGradeUserVos = iClassGradeUserService.sendTwentyClassGradeUser();
|
|
|
+ List<ClassGradeUserGoodsVo> classTenGradeUserVos = iClassGradeUserService.sendTenClassGradeUser();
|
|
|
+ List<ClassGradeUserGoodsVo> classFiveGradeUserVos = iClassGradeUserService.sendFiveClassGradeUser();
|
|
|
InformRemindVo informTwentyRemindVo = informRemindService.queryById(5L);
|
|
|
InformRemindVo informTenRemindVo = informRemindService.queryById(6L);
|
|
|
InformRemindVo informFiveRemindVo = informRemindService.queryById(7L);
|
|
|
+ for (ClassGradeUserGoodsVo classTwentyGradeUserVo : classTwentyGradeUserVos) {
|
|
|
+ String res;
|
|
|
+ String resEnd;
|
|
|
+ SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd");
|
|
|
+ Long timeId = classTwentyGradeUserVo.getClassStartTime()*1000;
|
|
|
+ Long timeEndId = classTwentyGradeUserVo.getClassStartTime()*1000;
|
|
|
+ Date date = new Date(timeId);
|
|
|
+ Date dateEnd = new Date(timeEndId);
|
|
|
+ res = simpleDateFormat.format(date);
|
|
|
+ resEnd = simpleDateFormat.format(dateEnd);
|
|
|
+
|
|
|
+ if (informTwentyRemindVo.getWayStatus().equals(1)) {
|
|
|
+ InformUserAddBo informUserAddBo = new InformUserAddBo();
|
|
|
+ informUserAddBo.setUserId(classTwentyGradeUserVo.getUserId());
|
|
|
+ informUserAddBo.setSendStatus(1);
|
|
|
+ informUserAddBo.setSendTime(DateUtils.getNowTime());
|
|
|
+ informUserAddBo.setCreateTime(DateUtils.getNowTime());
|
|
|
+ informUserAddBo.setUpdateTime(DateUtils.getNowTime());
|
|
|
+ informUserAddBo.setRemindId(5L);
|
|
|
+ informUserAddBo.setSystemStatus(1);
|
|
|
+ informUserAddBo.setRemind("您开通班级有效期还剩20天");
|
|
|
+ informUserAddBo.setGradeId(classTwentyGradeUserVo.getGradeId());
|
|
|
+ informUserAddBo.setGoodsId(classTwentyGradeUserVo.getGoodsId());
|
|
|
+ GoodsVo goodsVo1 = iGoodsService.queryById(classTwentyGradeUserVo.getGoodsId());
|
|
|
+ informUserAddBo.setText("尊敬的用户:您购买的课程班级有效期还剩20天,未在"+resEnd+"前完成全部学时,可能会影响审核进度,最终导致学时无效,请尽快完成学习");
|
|
|
+ iInformUserService.insertByAddBo(informUserAddBo);
|
|
|
+ }
|
|
|
+ if (informTwentyRemindVo.getNoteStatus().equals(1)){
|
|
|
+ InformUserAddBo informUserAddBo = new InformUserAddBo();
|
|
|
+ informUserAddBo.setUserId(classTwentyGradeUserVo.getUserId());
|
|
|
+ informUserAddBo.setSendTime(DateUtils.getNowTime());
|
|
|
+ informUserAddBo.setSendStatus(1);
|
|
|
+ informUserAddBo.setCreateTime(DateUtils.getNowTime());
|
|
|
+ informUserAddBo.setUpdateTime(DateUtils.getNowTime());
|
|
|
+ informUserAddBo.setRemindId(5L);
|
|
|
+ informUserAddBo.setSystemStatus(3);
|
|
|
+ informUserAddBo.setRemind("考试提醒");
|
|
|
+ informUserAddBo.setGoodsId(classTwentyGradeUserVo.getGoodsId());
|
|
|
+ informUserAddBo.setGradeId(classTwentyGradeUserVo.getGradeId());
|
|
|
+ GoodsVo goodsVo1 = iGoodsService.queryById(classTwentyGradeUserVo.getGoodsId());
|
|
|
+ informUserAddBo.setText("尊敬的用户:您购买的课程班级有效期还剩20天,未在"+resEnd+"前完成全部学时,可能会影响审核进度,最终导致学时无效,请尽快完成学习");
|
|
|
+ iInformUserService.insertByAddBo(informUserAddBo);
|
|
|
+ UserVo userVo = iUserService.queryById(classTwentyGradeUserVo.getUserId());
|
|
|
+ Map<String, Object> param = new HashMap<>();
|
|
|
+ param.put("time", resEnd);
|
|
|
+ param.put("day", 20);
|
|
|
+ IAliSmsService.sendInformSms(userVo.getTelphone(), JSON.toJSONString(param), remainingDaysValidityCode);
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ for (ClassGradeUserGoodsVo classTenGradeUserVo : classTenGradeUserVos) {
|
|
|
+ String res;
|
|
|
+ String resEnd;
|
|
|
+ SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd");
|
|
|
+ Long timeId = classTenGradeUserVo.getClassStartTime()*1000;
|
|
|
+ Long timeEndId = classTenGradeUserVo.getClassStartTime()*1000;
|
|
|
+ Date date = new Date(timeId);
|
|
|
+ Date dateEnd = new Date(timeEndId);
|
|
|
+ res = simpleDateFormat.format(date);
|
|
|
+ resEnd = simpleDateFormat.format(dateEnd);
|
|
|
+
|
|
|
+ if (informTenRemindVo.getWayStatus().equals(1)) {
|
|
|
+ InformUserAddBo informUserAddBo = new InformUserAddBo();
|
|
|
+ informUserAddBo.setUserId(classTenGradeUserVo.getUserId());
|
|
|
+ informUserAddBo.setSendStatus(1);
|
|
|
+ informUserAddBo.setSendTime(DateUtils.getNowTime());
|
|
|
+ informUserAddBo.setCreateTime(DateUtils.getNowTime());
|
|
|
+ informUserAddBo.setUpdateTime(DateUtils.getNowTime());
|
|
|
+ informUserAddBo.setRemindId(6L);
|
|
|
+ informUserAddBo.setSystemStatus(1);
|
|
|
+ informUserAddBo.setRemind("您开通班级有效期还剩10天");
|
|
|
+ informUserAddBo.setGradeId(classTenGradeUserVo.getGradeId());
|
|
|
+ informUserAddBo.setGoodsId(classTenGradeUserVo.getGoodsId());
|
|
|
+ GoodsVo goodsVo1 = iGoodsService.queryById(classTenGradeUserVo.getGoodsId());
|
|
|
+ informUserAddBo.setText("尊敬的用户:您购买的课程班级有效期还剩10天,未在"+resEnd+"前完成全部学时,可能会影响审核进度,最终导致学时无效,请尽快完成学习");
|
|
|
+ iInformUserService.insertByAddBo(informUserAddBo);
|
|
|
+ }
|
|
|
+ if (informTenRemindVo.getNoteStatus().equals(1)){
|
|
|
+ InformUserAddBo informUserAddBo = new InformUserAddBo();
|
|
|
+ informUserAddBo.setUserId(classTenGradeUserVo.getUserId());
|
|
|
+ informUserAddBo.setSendTime(DateUtils.getNowTime());
|
|
|
+ informUserAddBo.setSendStatus(1);
|
|
|
+ informUserAddBo.setCreateTime(DateUtils.getNowTime());
|
|
|
+ informUserAddBo.setUpdateTime(DateUtils.getNowTime());
|
|
|
+ informUserAddBo.setRemindId(6L);
|
|
|
+ informUserAddBo.setSystemStatus(3);
|
|
|
+ informUserAddBo.setRemind("您开通班级有效期还剩10天");
|
|
|
+ informUserAddBo.setGoodsId(classTenGradeUserVo.getGoodsId());
|
|
|
+ informUserAddBo.setGradeId(classTenGradeUserVo.getGradeId());
|
|
|
+ GoodsVo goodsVo1 = iGoodsService.queryById(classTenGradeUserVo.getGoodsId());
|
|
|
+ informUserAddBo.setText("尊敬的用户:您购买的课程班级有效期还剩10天,未在"+resEnd+"前完成全部学时,可能会影响审核进度,最终导致学时无效,请尽快完成学习");
|
|
|
+ iInformUserService.insertByAddBo(informUserAddBo);
|
|
|
+ UserVo userVo = iUserService.queryById(classTenGradeUserVo.getUserId());
|
|
|
+ Map<String, Object> param = new HashMap<>();
|
|
|
+ param.put("time", resEnd);
|
|
|
+ param.put("day", 10);
|
|
|
+ IAliSmsService.sendInformSms(userVo.getTelphone(), JSON.toJSONString(param), remainingDaysValidityCode);
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ for (ClassGradeUserGoodsVo classFiveGradeUserVo : classFiveGradeUserVos) {
|
|
|
+ String res;
|
|
|
+ String resEnd;
|
|
|
+ SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd");
|
|
|
+ Long timeId = classFiveGradeUserVo.getClassStartTime()*1000;
|
|
|
+ Long timeEndId = classFiveGradeUserVo.getClassStartTime()*1000;
|
|
|
+ Date date = new Date(timeId);
|
|
|
+ Date dateEnd = new Date(timeEndId);
|
|
|
+ res = simpleDateFormat.format(date);
|
|
|
+ resEnd = simpleDateFormat.format(dateEnd);
|
|
|
+
|
|
|
+ if (informTenRemindVo.getWayStatus().equals(1)) {
|
|
|
+ InformUserAddBo informUserAddBo = new InformUserAddBo();
|
|
|
+ informUserAddBo.setUserId(classFiveGradeUserVo.getUserId());
|
|
|
+ informUserAddBo.setSendStatus(1);
|
|
|
+ informUserAddBo.setSendTime(DateUtils.getNowTime());
|
|
|
+ informUserAddBo.setCreateTime(DateUtils.getNowTime());
|
|
|
+ informUserAddBo.setUpdateTime(DateUtils.getNowTime());
|
|
|
+ informUserAddBo.setRemindId(7L);
|
|
|
+ informUserAddBo.setSystemStatus(1);
|
|
|
+ informUserAddBo.setRemind("您开通班级有效期还剩10天");
|
|
|
+ informUserAddBo.setGradeId(classFiveGradeUserVo.getGradeId());
|
|
|
+ informUserAddBo.setGoodsId(classFiveGradeUserVo.getGoodsId());
|
|
|
+ GoodsVo goodsVo1 = iGoodsService.queryById(classFiveGradeUserVo.getGoodsId());
|
|
|
+ informUserAddBo.setText("尊敬的用户:您购买的课程班级有效期还剩10天,未在"+resEnd+"前完成全部学时,可能会影响审核进度,最终导致学时无效,请尽快完成学习");
|
|
|
+ iInformUserService.insertByAddBo(informUserAddBo);
|
|
|
+ }
|
|
|
+ if (informTenRemindVo.getNoteStatus().equals(1)){
|
|
|
+ InformUserAddBo informUserAddBo = new InformUserAddBo();
|
|
|
+ informUserAddBo.setUserId(classFiveGradeUserVo.getUserId());
|
|
|
+ informUserAddBo.setSendTime(DateUtils.getNowTime());
|
|
|
+ informUserAddBo.setSendStatus(1);
|
|
|
+ informUserAddBo.setCreateTime(DateUtils.getNowTime());
|
|
|
+ informUserAddBo.setUpdateTime(DateUtils.getNowTime());
|
|
|
+ informUserAddBo.setRemindId(7L);
|
|
|
+ informUserAddBo.setSystemStatus(3);
|
|
|
+ informUserAddBo.setRemind("您开通班级有效期还剩5天");
|
|
|
+ informUserAddBo.setGoodsId(classFiveGradeUserVo.getGoodsId());
|
|
|
+ informUserAddBo.setGradeId(classFiveGradeUserVo.getGradeId());
|
|
|
+ GoodsVo goodsVo1 = iGoodsService.queryById(classFiveGradeUserVo.getGoodsId());
|
|
|
+ informUserAddBo.setText("尊敬的用户:您购买的课程班级有效期还剩5天,未在"+resEnd+"前完成全部学时,可能会影响审核进度,最终导致学时无效,请尽快完成学习");
|
|
|
+ iInformUserService.insertByAddBo(informUserAddBo);
|
|
|
+ UserVo userVo = iUserService.queryById(classFiveGradeUserVo.getUserId());
|
|
|
+ Map<String, Object> param = new HashMap<>();
|
|
|
+ param.put("time", resEnd);
|
|
|
+ param.put("day", 5);
|
|
|
+ IAliSmsService.sendInformSms(userVo.getTelphone(), JSON.toJSONString(param), remainingDaysValidityCode);
|
|
|
+ }
|
|
|
+ }
|
|
|
|
|
|
}
|
|
|
|