|
@@ -14,6 +14,7 @@ import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
|
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
|
|
import com.fasterxml.jackson.databind.ObjectMapper;
|
|
|
import com.github.pagehelper.Page;
|
|
|
+import com.zhongzheng.common.core.domain.entity.SysUser;
|
|
|
import com.zhongzheng.common.core.redis.RedisCache;
|
|
|
import com.zhongzheng.common.exception.CustomException;
|
|
|
import com.zhongzheng.common.utils.DateUtils;
|
|
@@ -60,11 +61,13 @@ import com.zhongzheng.modules.grade.domain.*;
|
|
|
import com.zhongzheng.modules.grade.service.*;
|
|
|
import com.zhongzheng.modules.grade.vo.*;
|
|
|
import com.zhongzheng.modules.inform.bo.InformQueryBo;
|
|
|
+import com.zhongzheng.modules.inform.bo.InformSysUserAddBo;
|
|
|
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.IInformSysUserService;
|
|
|
import com.zhongzheng.modules.inform.service.IInformUserService;
|
|
|
import com.zhongzheng.modules.inform.vo.InformRemindVo;
|
|
|
import com.zhongzheng.modules.inform.vo.InformVo;
|
|
@@ -101,12 +104,14 @@ import com.zhongzheng.modules.polyv.vo.PolyvVideoQuerVo;
|
|
|
import com.zhongzheng.modules.polyv.vo.PolyvVideoVo;
|
|
|
import com.zhongzheng.modules.polyv.vo.PolyvVo;
|
|
|
import com.zhongzheng.modules.schedule.service.IScheduleService;
|
|
|
+import com.zhongzheng.modules.system.service.ISysUserService;
|
|
|
import com.zhongzheng.modules.user.bo.*;
|
|
|
import com.zhongzheng.modules.user.domain.*;
|
|
|
import com.zhongzheng.modules.user.mapper.UserPlanMapper;
|
|
|
import com.zhongzheng.modules.user.mapper.UserStudyRecordMapper;
|
|
|
import com.zhongzheng.modules.user.service.*;
|
|
|
import com.zhongzheng.modules.user.vo.*;
|
|
|
+import com.zhongzheng.modules.wx.service.IWxLoginService;
|
|
|
import com.zhongzheng.modules.wx.service.IWxPayService;
|
|
|
import net.polyv.live.v1.entity.channel.playback.LiveChannelVideoListResponse;
|
|
|
import net.polyv.live.v1.entity.channel.playback.LiveListChannelSessionInfoResponse;
|
|
@@ -145,7 +150,6 @@ public class ScheduleServiceImpl extends ServiceImpl<PolyvVideoMapper, PolyvVide
|
|
|
@Autowired
|
|
|
private IProfileTpService iProfileTpService;
|
|
|
|
|
|
-
|
|
|
@Autowired
|
|
|
private OrderMapper orderMapper;
|
|
|
|
|
@@ -158,6 +162,9 @@ public class ScheduleServiceImpl extends ServiceImpl<PolyvVideoMapper, PolyvVide
|
|
|
@Autowired
|
|
|
private IInformUserService iInformUserService;
|
|
|
|
|
|
+ @Autowired
|
|
|
+ private IInformSysUserService iInformSysUserService;
|
|
|
+
|
|
|
@Autowired
|
|
|
private IOrderGoodsService iOrderGoodsService;
|
|
|
|
|
@@ -239,6 +246,9 @@ public class ScheduleServiceImpl extends ServiceImpl<PolyvVideoMapper, PolyvVide
|
|
|
@Autowired
|
|
|
private IMockApplyService iMockApplyService;
|
|
|
|
|
|
+ @Autowired
|
|
|
+ private ISysUserService iSysUserService;
|
|
|
+
|
|
|
@Autowired
|
|
|
private IUserMockSubscribeService iUserMockSubscribeService;
|
|
|
|
|
@@ -254,6 +264,9 @@ public class ScheduleServiceImpl extends ServiceImpl<PolyvVideoMapper, PolyvVide
|
|
|
@Autowired
|
|
|
private ICourseSubjectService iCourseSubjectService;
|
|
|
|
|
|
+ @Autowired
|
|
|
+ private IWxLoginService iWxLoginService;
|
|
|
+
|
|
|
@Value("${aliyun.sms.OpenTheGoodsCode}")
|
|
|
private String OpenTheGoodsCode;
|
|
|
|
|
@@ -278,6 +291,18 @@ public class ScheduleServiceImpl extends ServiceImpl<PolyvVideoMapper, PolyvVide
|
|
|
@Value("${aliyun.sms.liveStartRemind}")
|
|
|
private String liveStartRemind;
|
|
|
|
|
|
+ @Value("${aliyun.sms.buyNotStudyStudentRemind}")
|
|
|
+ private String buyNotStudyStudentRemind;
|
|
|
+
|
|
|
+ @Value("${aliyun.sms.buyNotStudyTeacherRemind}")
|
|
|
+ private String buyNotStudyTeacherRemind;
|
|
|
+
|
|
|
+ @Value("${aliyun.sms.longNotStudyStudentRemind}")
|
|
|
+ private String longNotStudyStudentRemind;
|
|
|
+
|
|
|
+ @Value("${aliyun.sms.longNotStudyTeacherRemind}")
|
|
|
+ private String longNotStudyTeacherRemind;
|
|
|
+
|
|
|
@Override
|
|
|
public String updateGoodsSend(UserQueryBo bo) {
|
|
|
InformRemindVo informRemindVo = informRemindService.queryById(1L);
|
|
@@ -1545,6 +1570,458 @@ public class ScheduleServiceImpl extends ServiceImpl<PolyvVideoMapper, PolyvVide
|
|
|
|
|
|
}
|
|
|
|
|
|
+ @Override
|
|
|
+ public void buyNotReadToStudentTwo(UserQueryBo bo) {
|
|
|
+ //购买2天未学提醒
|
|
|
+ Calendar cal1 = new GregorianCalendar();
|
|
|
+ cal1.add(Calendar.DATE, -3);
|
|
|
+ Long startTime = cal1.getTimeInMillis() / 1000;
|
|
|
+ Calendar cal2 = new GregorianCalendar();
|
|
|
+ cal2.add(Calendar.DATE, -2);
|
|
|
+ Long endTime = cal2.getTimeInMillis() / 1000;
|
|
|
+ //购买2天未学习
|
|
|
+ OrderQueryBo queryBo2 = new OrderQueryBo();
|
|
|
+ queryBo2.setStartTime(startTime);
|
|
|
+ queryBo2.setEndTime(endTime);
|
|
|
+ List<OrderGoodsVo> list2 = iOrderGoodsService.getBuyNotStudyList(queryBo2);
|
|
|
+ InformRemindVo informRemindVo = informRemindService.queryById(28L);
|
|
|
+ for(OrderGoodsVo goodsVo : list2){
|
|
|
+ GoodsVo goods = iGoodsService.queryById(goodsVo.getGoodsId());
|
|
|
+ if (!com.baomidou.mybatisplus.core.toolkit.CollectionUtils.isEmpty(informRemindVo.getInformRemindBusiness()) && !com.baomidou.mybatisplus.core.toolkit.CollectionUtils.isEmpty(informRemindVo.getInformRemindBusiness().stream().filter(informRemindBusinessVo -> informRemindBusinessVo.getBusinessId().equals(goods.getBusinessId())).collect(Collectors.toList()))) {
|
|
|
+ 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(28L);
|
|
|
+ informUserAddBo.setSystemStatus(1);
|
|
|
+ informUserAddBo.setOrderGoodsId(goodsVo.getOrderGoodsId());
|
|
|
+ informUserAddBo.setRemind("您新开通的课程已有2天,尽快去学习吧");
|
|
|
+ informUserAddBo.setGoodsId(goodsVo.getGoodsId());
|
|
|
+ informUserAddBo.setText("您开通《"+goods.getGoodsName()+"》课程已有2天,但未开始学习,请尽快去学习吧。");
|
|
|
+ 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(28L);
|
|
|
+ informUserAddBo.setSystemStatus(3);
|
|
|
+ informUserAddBo.setOrderGoodsId(goodsVo.getOrderGoodsId());
|
|
|
+ informUserAddBo.setRemind("您新开通的课程已有2天,尽快去学习吧");
|
|
|
+ informUserAddBo.setGoodsId(goodsVo.getGoodsId());
|
|
|
+ informUserAddBo.setText("您开通《"+goods.getGoodsName()+"》课程已有2天,但未开始学习,请尽快去学习吧。");
|
|
|
+ Map<String, Object> param = new HashMap<>();
|
|
|
+ param.put("goodsName", goods.getGoodsName());
|
|
|
+ param.put("day", "2");
|
|
|
+ if (Validator.isNotEmpty(IAliSmsService.sendInformSms(userVo.getTelphone(), JSON.toJSONString(param), buyNotStudyStudentRemind))) {
|
|
|
+ iInformUserService.insertByAddBo(informUserAddBo);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ if (informRemindVo.getGzhTpStatus().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(28L);
|
|
|
+ informUserAddBo.setSystemStatus(4);
|
|
|
+ informUserAddBo.setOrderGoodsId(goodsVo.getOrderGoodsId());
|
|
|
+ informUserAddBo.setRemind("您新开通的课程已有2天,尽快去学习吧");
|
|
|
+ informUserAddBo.setGoodsId(goodsVo.getGoodsId());
|
|
|
+ informUserAddBo.setText("您开通《"+goods.getGoodsName()+"》课程已有2天,但未开始学习,请尽快去学习吧。");
|
|
|
+ iInformUserService.insertByAddBo(informUserAddBo);
|
|
|
+ if(Validator.isNotEmpty(userVo.getOpenId())){
|
|
|
+ Map<String,String> paramMap = new HashMap<>();
|
|
|
+ paramMap.put("first","您新开通的课程已超过2天没有学习,请合理安排学习时间!");
|
|
|
+ paramMap.put("keyword1",goods.getGoodsName());
|
|
|
+ paramMap.put("keyword2","未开始学习");
|
|
|
+ paramMap.put("pagepath","pages2/wd/course?id="+goodsVo.getGoodsId()+"&gid="+goodsVo.getGradeId()+"&orderGoodsId="+goodsVo.getOrderGoodsId());
|
|
|
+ iWxLoginService.sendSmallTpMsg(userVo.getOpenId(),paramMap);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ @Override
|
|
|
+ public void buyNotReadToStudentFive(UserQueryBo bo) {
|
|
|
+ //购买5天未学提醒
|
|
|
+ Calendar cal1 = new GregorianCalendar();
|
|
|
+ cal1.add(Calendar.DATE, -6);
|
|
|
+ Long startTime = cal1.getTimeInMillis() / 1000;
|
|
|
+ Calendar cal2 = new GregorianCalendar();
|
|
|
+ cal2.add(Calendar.DATE, -5);
|
|
|
+ Long endTime = cal2.getTimeInMillis() / 1000;
|
|
|
+ //购买5天未学习
|
|
|
+ OrderQueryBo queryBo2 = new OrderQueryBo();
|
|
|
+ queryBo2.setStartTime(startTime);
|
|
|
+ queryBo2.setEndTime(endTime);
|
|
|
+ List<OrderGoodsVo> list2 = iOrderGoodsService.getBuyNotStudyList(queryBo2);
|
|
|
+ InformRemindVo informRemindVo = informRemindService.queryById(29L);
|
|
|
+ for(OrderGoodsVo goodsVo : list2){
|
|
|
+ GoodsVo goods = iGoodsService.queryById(goodsVo.getGoodsId());
|
|
|
+ if (!com.baomidou.mybatisplus.core.toolkit.CollectionUtils.isEmpty(informRemindVo.getInformRemindBusiness()) && !com.baomidou.mybatisplus.core.toolkit.CollectionUtils.isEmpty(informRemindVo.getInformRemindBusiness().stream().filter(informRemindBusinessVo -> informRemindBusinessVo.getBusinessId().equals(goods.getBusinessId())).collect(Collectors.toList()))) {
|
|
|
+ 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(29L);
|
|
|
+ informUserAddBo.setSystemStatus(1);
|
|
|
+ informUserAddBo.setOrderGoodsId(goodsVo.getOrderGoodsId());
|
|
|
+ informUserAddBo.setRemind("您新开通的课程已有5天,尽快去学习吧");
|
|
|
+ informUserAddBo.setGoodsId(goodsVo.getGoodsId());
|
|
|
+ informUserAddBo.setText("您开通《"+goods.getGoodsName()+"》课程已有5天,但未开始学习,请尽快去学习吧。");
|
|
|
+ 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(29L);
|
|
|
+ informUserAddBo.setSystemStatus(3);
|
|
|
+ informUserAddBo.setOrderGoodsId(goodsVo.getOrderGoodsId());
|
|
|
+ informUserAddBo.setRemind("您新开通的课程已有5天,尽快去学习吧");
|
|
|
+ informUserAddBo.setGoodsId(goodsVo.getGoodsId());
|
|
|
+ informUserAddBo.setText("您开通《"+goods.getGoodsName()+"》课程已有5天,但未开始学习,请尽快去学习吧。");
|
|
|
+ Map<String, Object> param = new HashMap<>();
|
|
|
+ param.put("goodsName", goods.getGoodsName());
|
|
|
+ param.put("day", "5");
|
|
|
+ if (Validator.isNotEmpty(IAliSmsService.sendInformSms(userVo.getTelphone(), JSON.toJSONString(param), buyNotStudyStudentRemind))) {
|
|
|
+ iInformUserService.insertByAddBo(informUserAddBo);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ if (informRemindVo.getGzhTpStatus().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(29L);
|
|
|
+ informUserAddBo.setSystemStatus(4);
|
|
|
+ informUserAddBo.setOrderGoodsId(goodsVo.getOrderGoodsId());
|
|
|
+ informUserAddBo.setRemind("您新开通的课程已有5天,尽快去学习吧");
|
|
|
+ informUserAddBo.setGoodsId(goodsVo.getGoodsId());
|
|
|
+ informUserAddBo.setText("您开通《"+goods.getGoodsName()+"》课程已有5天,但未开始学习,请尽快去学习吧。");
|
|
|
+ iInformUserService.insertByAddBo(informUserAddBo);
|
|
|
+ if(Validator.isNotEmpty(userVo.getOpenId())){
|
|
|
+ Map<String,String> paramMap = new HashMap<>();
|
|
|
+ paramMap.put("first","您新开通的课程已超过5天没有学习,请合理安排学习时间!");
|
|
|
+ paramMap.put("keyword1",goods.getGoodsName());
|
|
|
+ paramMap.put("keyword2","未开始学习");
|
|
|
+ paramMap.put("pagepath","pages2/wd/course?id="+goodsVo.getGoodsId()+"&gid="+goodsVo.getGradeId()+"&orderGoodsId="+goodsVo.getOrderGoodsId());
|
|
|
+ iWxLoginService.sendSmallTpMsg(userVo.getOpenId(),paramMap);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ @Override
|
|
|
+ public void buyNotReadToTeacher(UserQueryBo bo) {
|
|
|
+ //购买7天未学教务提醒
|
|
|
+ Calendar cal1 = new GregorianCalendar();
|
|
|
+ cal1.add(Calendar.DATE, -8);
|
|
|
+ Long startTime = cal1.getTimeInMillis() / 1000;
|
|
|
+ Calendar cal2 = new GregorianCalendar();
|
|
|
+ cal2.add(Calendar.DATE, -7);
|
|
|
+ Long endTime = cal2.getTimeInMillis() / 1000;
|
|
|
+ //购买5天未学习
|
|
|
+ OrderQueryBo queryBo2 = new OrderQueryBo();
|
|
|
+ queryBo2.setStartTime(startTime);
|
|
|
+ queryBo2.setEndTime(endTime);
|
|
|
+ List<OrderGoodsVo> list2 = iOrderGoodsService.getBuyNotStudyList(queryBo2);
|
|
|
+ InformRemindVo informRemindVo = informRemindService.queryById(30L);
|
|
|
+ for(OrderGoodsVo goodsVo : list2){
|
|
|
+ if(Validator.isEmpty(goodsVo.getSysUserId())){
|
|
|
+ continue;
|
|
|
+ }
|
|
|
+ GoodsVo goods = iGoodsService.queryById(goodsVo.getGoodsId());
|
|
|
+ if (!com.baomidou.mybatisplus.core.toolkit.CollectionUtils.isEmpty(informRemindVo.getInformRemindBusiness()) && !com.baomidou.mybatisplus.core.toolkit.CollectionUtils.isEmpty(informRemindVo.getInformRemindBusiness().stream().filter(informRemindBusinessVo -> informRemindBusinessVo.getBusinessId().equals(goods.getBusinessId())).collect(Collectors.toList()))) {
|
|
|
+ UserVo userVo = iUserService.queryById(goodsVo.getUserId());//学生
|
|
|
+ SysUser teacher = iSysUserService.selectUserById(goodsVo.getSysUserId());//教务信息
|
|
|
+ if (informRemindVo.getWayStatus().equals(1)) {
|
|
|
+ InformSysUserAddBo informUserAddBo = new InformSysUserAddBo();
|
|
|
+ informUserAddBo.setUserId(teacher.getUserId());
|
|
|
+ informUserAddBo.setSendStatus(1);
|
|
|
+ informUserAddBo.setSendTime(DateUtils.getNowTime());
|
|
|
+ informUserAddBo.setCreateTime(DateUtils.getNowTime());
|
|
|
+ informUserAddBo.setUpdateTime(DateUtils.getNowTime());
|
|
|
+ informUserAddBo.setRemindId(30L);
|
|
|
+ informUserAddBo.setSystemStatus(1);
|
|
|
+ informUserAddBo.setOrderGoodsId(goodsVo.getOrderGoodsId());
|
|
|
+ informUserAddBo.setRemind("学员学习提醒,请尽快处理");
|
|
|
+ informUserAddBo.setGoodsId(goodsVo.getGoodsId());
|
|
|
+ informUserAddBo.setText("学员"+userVo.getRealname()+",开通《"+goods.getGoodsName()+"》课程已有7天,但未开始学习,请尽快与学员沟通情况。");
|
|
|
+ iInformSysUserService.insertByAddBo(informUserAddBo);
|
|
|
+ }
|
|
|
+ if (informRemindVo.getNoteStatus().equals(1)) {
|
|
|
+ InformSysUserAddBo informUserAddBo = new InformSysUserAddBo();
|
|
|
+ informUserAddBo.setUserId(teacher.getUserId());
|
|
|
+ informUserAddBo.setSendStatus(1);
|
|
|
+ informUserAddBo.setSendTime(DateUtils.getNowTime());
|
|
|
+ informUserAddBo.setCreateTime(DateUtils.getNowTime());
|
|
|
+ informUserAddBo.setUpdateTime(DateUtils.getNowTime());
|
|
|
+ informUserAddBo.setRemindId(30L);
|
|
|
+ informUserAddBo.setSystemStatus(3);
|
|
|
+ informUserAddBo.setOrderGoodsId(goodsVo.getOrderGoodsId());
|
|
|
+ informUserAddBo.setRemind("学员学习提醒,请尽快处理");
|
|
|
+ informUserAddBo.setGoodsId(goodsVo.getGoodsId());
|
|
|
+ informUserAddBo.setText("学员"+userVo.getRealname()+",开通《"+goods.getGoodsName()+"》课程已有7天,但未开始学习,请尽快与学员沟通情况。");
|
|
|
+ Map<String, Object> param = new HashMap<>();
|
|
|
+ param.put("name", userVo.getRealname());
|
|
|
+ param.put("goodsName", goods.getGoodsName());
|
|
|
+ param.put("day", "7");
|
|
|
+ if(Validator.isNotEmpty(teacher.getPhonenumber())){
|
|
|
+ if (Validator.isNotEmpty(IAliSmsService.sendInformSms(teacher.getPhonenumber(), JSON.toJSONString(param), buyNotStudyTeacherRemind))) {
|
|
|
+ iInformSysUserService.insertByAddBo(informUserAddBo);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ @Override
|
|
|
+ public void longNotReadToStudentThree(UserQueryBo bo) {
|
|
|
+ //3天未学提醒
|
|
|
+ Calendar cal1 = new GregorianCalendar();
|
|
|
+ cal1.add(Calendar.DATE, -4);
|
|
|
+ Long startTime = cal1.getTimeInMillis() / 1000;
|
|
|
+ Calendar cal2 = new GregorianCalendar();
|
|
|
+ cal2.add(Calendar.DATE, -3);
|
|
|
+ Long endTime = cal2.getTimeInMillis() / 1000;
|
|
|
+ OrderQueryBo queryBo2 = new OrderQueryBo();
|
|
|
+ queryBo2.setStartTime(startTime);
|
|
|
+ queryBo2.setEndTime(endTime);
|
|
|
+ List<OrderGoodsVo> list2 = iOrderGoodsService.getLongNotStudyList(queryBo2);
|
|
|
+ InformRemindVo informRemindVo = informRemindService.queryById(31L);
|
|
|
+ for(OrderGoodsVo goodsVo : list2){
|
|
|
+ GoodsVo goods = iGoodsService.queryById(goodsVo.getGoodsId());
|
|
|
+ if (!com.baomidou.mybatisplus.core.toolkit.CollectionUtils.isEmpty(informRemindVo.getInformRemindBusiness()) && !com.baomidou.mybatisplus.core.toolkit.CollectionUtils.isEmpty(informRemindVo.getInformRemindBusiness().stream().filter(informRemindBusinessVo -> informRemindBusinessVo.getBusinessId().equals(goods.getBusinessId())).collect(Collectors.toList()))) {
|
|
|
+ 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(31L);
|
|
|
+ informUserAddBo.setSystemStatus(1);
|
|
|
+ informUserAddBo.setOrderGoodsId(goodsVo.getOrderGoodsId());
|
|
|
+ informUserAddBo.setRemind("您已超过3天没有学习课程,尽快去学习吧");
|
|
|
+ informUserAddBo.setGoodsId(goodsVo.getGoodsId());
|
|
|
+ informUserAddBo.setText("您已超过3天没有学习《"+goods.getGoodsName()+"》课程,为了您的学习效果,请尽快去学习吧。");
|
|
|
+ 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(31L);
|
|
|
+ informUserAddBo.setSystemStatus(3);
|
|
|
+ informUserAddBo.setOrderGoodsId(goodsVo.getOrderGoodsId());
|
|
|
+ informUserAddBo.setRemind("您已超过3天没有学习课程,尽快去学习吧");
|
|
|
+ informUserAddBo.setGoodsId(goodsVo.getGoodsId());
|
|
|
+ informUserAddBo.setText("您已超过3天没有学习《"+goods.getGoodsName()+"》课程,为了您的学习效果,请尽快去学习吧。");
|
|
|
+ Map<String, Object> param = new HashMap<>();
|
|
|
+ param.put("goodsName", goods.getGoodsName());
|
|
|
+ param.put("day", "3");
|
|
|
+ if (Validator.isNotEmpty(IAliSmsService.sendInformSms(userVo.getTelphone(), JSON.toJSONString(param), longNotStudyStudentRemind))) {
|
|
|
+ iInformUserService.insertByAddBo(informUserAddBo);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ if (informRemindVo.getGzhTpStatus().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(31L);
|
|
|
+ informUserAddBo.setSystemStatus(4);
|
|
|
+ informUserAddBo.setOrderGoodsId(goodsVo.getOrderGoodsId());
|
|
|
+ informUserAddBo.setRemind("您已超过3天没有学习课程,尽快去学习吧");
|
|
|
+ informUserAddBo.setGoodsId(goodsVo.getGoodsId());
|
|
|
+ informUserAddBo.setText("您已超过3天没有学习《"+goods.getGoodsName()+"》课程,为了您的学习效果,请尽快去学习吧。");
|
|
|
+ iInformUserService.insertByAddBo(informUserAddBo);
|
|
|
+ if(Validator.isNotEmpty(userVo.getOpenId())){
|
|
|
+ Map<String,String> paramMap = new HashMap<>();
|
|
|
+ paramMap.put("first","您已超过3天没有学习,请合理安排学习时间!");
|
|
|
+ paramMap.put("keyword1",goods.getGoodsName());
|
|
|
+ paramMap.put("keyword2","已超过3天没有学习");
|
|
|
+ paramMap.put("pagepath","pages2/wd/course?id="+goodsVo.getGoodsId()+"&gid="+goodsVo.getGradeId()+"&orderGoodsId="+goodsVo.getOrderGoodsId());
|
|
|
+ iWxLoginService.sendSmallTpMsg(userVo.getOpenId(),paramMap);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ @Override
|
|
|
+ public void longNotReadToStudentFive(UserQueryBo bo) {
|
|
|
+ //5天未学提醒
|
|
|
+ Calendar cal1 = new GregorianCalendar();
|
|
|
+ cal1.add(Calendar.DATE, -6);
|
|
|
+ Long startTime = cal1.getTimeInMillis() / 1000;
|
|
|
+ Calendar cal2 = new GregorianCalendar();
|
|
|
+ cal2.add(Calendar.DATE, -5);
|
|
|
+ Long endTime = cal2.getTimeInMillis() / 1000;
|
|
|
+ OrderQueryBo queryBo2 = new OrderQueryBo();
|
|
|
+ queryBo2.setStartTime(startTime);
|
|
|
+ queryBo2.setEndTime(endTime);
|
|
|
+ List<OrderGoodsVo> list2 = iOrderGoodsService.getLongNotStudyList(queryBo2);
|
|
|
+ InformRemindVo informRemindVo = informRemindService.queryById(32L);
|
|
|
+ for(OrderGoodsVo goodsVo : list2){
|
|
|
+ GoodsVo goods = iGoodsService.queryById(goodsVo.getGoodsId());
|
|
|
+ if (!com.baomidou.mybatisplus.core.toolkit.CollectionUtils.isEmpty(informRemindVo.getInformRemindBusiness()) && !com.baomidou.mybatisplus.core.toolkit.CollectionUtils.isEmpty(informRemindVo.getInformRemindBusiness().stream().filter(informRemindBusinessVo -> informRemindBusinessVo.getBusinessId().equals(goods.getBusinessId())).collect(Collectors.toList()))) {
|
|
|
+ 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(32L);
|
|
|
+ informUserAddBo.setSystemStatus(1);
|
|
|
+ informUserAddBo.setOrderGoodsId(goodsVo.getOrderGoodsId());
|
|
|
+ informUserAddBo.setRemind("您已超过5天没有学习课程,尽快去学习吧");
|
|
|
+ informUserAddBo.setGoodsId(goodsVo.getGoodsId());
|
|
|
+ informUserAddBo.setText("您已超过5天没有学习《"+goods.getGoodsName()+"》课程,为了您的学习效果,请尽快去学习吧。");
|
|
|
+ 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(32L);
|
|
|
+ informUserAddBo.setSystemStatus(3);
|
|
|
+ informUserAddBo.setOrderGoodsId(goodsVo.getOrderGoodsId());
|
|
|
+ informUserAddBo.setRemind("您已超过5天没有学习课程,尽快去学习吧");
|
|
|
+ informUserAddBo.setGoodsId(goodsVo.getGoodsId());
|
|
|
+ informUserAddBo.setText("您已超过5天没有学习《"+goods.getGoodsName()+"》课程,为了您的学习效果,请尽快去学习吧。");
|
|
|
+ Map<String, Object> param = new HashMap<>();
|
|
|
+ param.put("goodsName", goods.getGoodsName());
|
|
|
+ param.put("day", "5");
|
|
|
+ if (Validator.isNotEmpty(IAliSmsService.sendInformSms(userVo.getTelphone(), JSON.toJSONString(param), longNotStudyStudentRemind))) {
|
|
|
+ iInformUserService.insertByAddBo(informUserAddBo);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ if (informRemindVo.getGzhTpStatus().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(32L);
|
|
|
+ informUserAddBo.setSystemStatus(4);
|
|
|
+ informUserAddBo.setOrderGoodsId(goodsVo.getOrderGoodsId());
|
|
|
+ informUserAddBo.setRemind("您已超过5天没有学习课程,尽快去学习吧");
|
|
|
+ informUserAddBo.setGoodsId(goodsVo.getGoodsId());
|
|
|
+ informUserAddBo.setText("您已超过5天没有学习《"+goods.getGoodsName()+"》课程,为了您的学习效果,请尽快去学习吧。");
|
|
|
+ iInformUserService.insertByAddBo(informUserAddBo);
|
|
|
+ if(Validator.isNotEmpty(userVo.getOpenId())){
|
|
|
+ Map<String,String> paramMap = new HashMap<>();
|
|
|
+ paramMap.put("first","您已超过5天没有学习,请合理安排学习时间!");
|
|
|
+ paramMap.put("keyword1",goods.getGoodsName());
|
|
|
+ paramMap.put("keyword2","已超过5天没有学习");
|
|
|
+ paramMap.put("pagepath","pages2/wd/course?id="+goodsVo.getGoodsId()+"&gid="+goodsVo.getGradeId()+"&orderGoodsId="+goodsVo.getOrderGoodsId());
|
|
|
+ iWxLoginService.sendSmallTpMsg(userVo.getOpenId(),paramMap);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ @Override
|
|
|
+ public void longNotReadToTeacher(UserQueryBo bo) {
|
|
|
+ //购买7天未学教务提醒
|
|
|
+ Calendar cal1 = new GregorianCalendar();
|
|
|
+ cal1.add(Calendar.DATE, -8);
|
|
|
+ Long startTime = cal1.getTimeInMillis() / 1000;
|
|
|
+ Calendar cal2 = new GregorianCalendar();
|
|
|
+ cal2.add(Calendar.DATE, -7);
|
|
|
+ Long endTime = cal2.getTimeInMillis() / 1000;
|
|
|
+ //购买5天未学习
|
|
|
+ OrderQueryBo queryBo2 = new OrderQueryBo();
|
|
|
+ queryBo2.setStartTime(startTime);
|
|
|
+ queryBo2.setEndTime(endTime);
|
|
|
+ List<OrderGoodsVo> list2 = iOrderGoodsService.getLongNotStudyList(queryBo2);
|
|
|
+ InformRemindVo informRemindVo = informRemindService.queryById(33L);
|
|
|
+ for(OrderGoodsVo goodsVo : list2){
|
|
|
+ if(Validator.isEmpty(goodsVo.getSysUserId())){
|
|
|
+ continue;
|
|
|
+ }
|
|
|
+ GoodsVo goods = iGoodsService.queryById(goodsVo.getGoodsId());
|
|
|
+ if (!com.baomidou.mybatisplus.core.toolkit.CollectionUtils.isEmpty(informRemindVo.getInformRemindBusiness()) && !com.baomidou.mybatisplus.core.toolkit.CollectionUtils.isEmpty(informRemindVo.getInformRemindBusiness().stream().filter(informRemindBusinessVo -> informRemindBusinessVo.getBusinessId().equals(goods.getBusinessId())).collect(Collectors.toList()))) {
|
|
|
+ UserVo userVo = iUserService.queryById(goodsVo.getUserId());//学生
|
|
|
+ SysUser teacher = iSysUserService.selectUserById(goodsVo.getSysUserId());//教务信息
|
|
|
+ if (informRemindVo.getWayStatus().equals(1)) {
|
|
|
+ InformSysUserAddBo informUserAddBo = new InformSysUserAddBo();
|
|
|
+ informUserAddBo.setUserId(teacher.getUserId());
|
|
|
+ informUserAddBo.setSendStatus(1);
|
|
|
+ informUserAddBo.setSendTime(DateUtils.getNowTime());
|
|
|
+ informUserAddBo.setCreateTime(DateUtils.getNowTime());
|
|
|
+ informUserAddBo.setUpdateTime(DateUtils.getNowTime());
|
|
|
+ informUserAddBo.setRemindId(30L);
|
|
|
+ informUserAddBo.setSystemStatus(1);
|
|
|
+ informUserAddBo.setOrderGoodsId(goodsVo.getOrderGoodsId());
|
|
|
+ informUserAddBo.setRemind("学员学习提醒,请尽快处理");
|
|
|
+ informUserAddBo.setGoodsId(goodsVo.getGoodsId());
|
|
|
+ informUserAddBo.setText("学员"+userVo.getRealname()+",已超过7天没有学习《"+goods.getGoodsName()+"》课程,请尽快与学员沟通情况。");
|
|
|
+ iInformSysUserService.insertByAddBo(informUserAddBo);
|
|
|
+ }
|
|
|
+ if (informRemindVo.getNoteStatus().equals(1)) {
|
|
|
+ InformSysUserAddBo informUserAddBo = new InformSysUserAddBo();
|
|
|
+ informUserAddBo.setUserId(teacher.getUserId());
|
|
|
+ informUserAddBo.setSendStatus(1);
|
|
|
+ informUserAddBo.setSendTime(DateUtils.getNowTime());
|
|
|
+ informUserAddBo.setCreateTime(DateUtils.getNowTime());
|
|
|
+ informUserAddBo.setUpdateTime(DateUtils.getNowTime());
|
|
|
+ informUserAddBo.setRemindId(30L);
|
|
|
+ informUserAddBo.setSystemStatus(3);
|
|
|
+ informUserAddBo.setOrderGoodsId(goodsVo.getOrderGoodsId());
|
|
|
+ informUserAddBo.setRemind("学员学习提醒,请尽快处理");
|
|
|
+ informUserAddBo.setGoodsId(goodsVo.getGoodsId());
|
|
|
+ informUserAddBo.setText("学员"+userVo.getRealname()+",已超过7天没有学习《"+goods.getGoodsName()+"》课程,请尽快与学员沟通情况。");
|
|
|
+ Map<String, Object> param = new HashMap<>();
|
|
|
+ param.put("goodsName", goods.getGoodsName());
|
|
|
+ param.put("day", "7");
|
|
|
+ param.put("name", userVo.getRealname());
|
|
|
+ if(Validator.isNotEmpty(teacher.getPhonenumber())){
|
|
|
+ if (Validator.isNotEmpty(IAliSmsService.sendInformSms(teacher.getPhonenumber(), JSON.toJSONString(param), longNotStudyTeacherRemind))) {
|
|
|
+ iInformSysUserService.insertByAddBo(informUserAddBo);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
private Long formatTime(Long startTime, String addTime) throws ParseException{
|
|
|
Long times = startTime*1000;//时间戳
|
|
|
SimpleDateFormat formatter = new SimpleDateFormat("yyyy-MM-dd");
|