|
@@ -10,8 +10,11 @@ import com.baomidou.mybatisplus.core.toolkit.StringUtils;
|
|
|
import com.microsoft.schemas.office.visio.x2012.main.SectionType;
|
|
|
import com.zhongzheng.common.utils.DateUtils;
|
|
|
import com.zhongzheng.modules.bank.domain.Exam;
|
|
|
+import com.zhongzheng.modules.course.bo.CourseQueryBo;
|
|
|
import com.zhongzheng.modules.face.service.IFaceService;
|
|
|
+import com.zhongzheng.modules.goods.service.IGoodsService;
|
|
|
import com.zhongzheng.modules.goods.vo.GoodsUserVo;
|
|
|
+import com.zhongzheng.modules.goods.vo.GoodsVo;
|
|
|
import com.zhongzheng.modules.grade.bo.UserPeriodAddBo;
|
|
|
import com.zhongzheng.modules.grade.bo.UserPeriodStatusAddBo;
|
|
|
import com.zhongzheng.modules.grade.domain.UserPeriod;
|
|
@@ -19,16 +22,20 @@ import com.zhongzheng.modules.grade.domain.UserPeriodStatus;
|
|
|
import com.zhongzheng.modules.grade.service.IUserPeriodService;
|
|
|
import com.zhongzheng.modules.grade.service.IUserPeriodStatusService;
|
|
|
import com.zhongzheng.modules.grade.vo.UserPeriodStatusVo;
|
|
|
+import com.zhongzheng.modules.inform.bo.InformRemindQueryBo;
|
|
|
+import com.zhongzheng.modules.inform.bo.InformUserAddBo;
|
|
|
+import com.zhongzheng.modules.inform.service.IInformRemindService;
|
|
|
+import com.zhongzheng.modules.inform.service.IInformUserService;
|
|
|
+import com.zhongzheng.modules.inform.vo.InformRemindBusinessVo;
|
|
|
+import com.zhongzheng.modules.inform.vo.InformRemindVo;
|
|
|
import com.zhongzheng.modules.user.bo.*;
|
|
|
import com.zhongzheng.modules.user.domain.UserPlan;
|
|
|
import com.zhongzheng.modules.user.domain.UserStudyRecord;
|
|
|
import com.zhongzheng.modules.user.mapper.UserStudyRecordMapper;
|
|
|
-import com.zhongzheng.modules.user.service.IUserPlanGoodsService;
|
|
|
-import com.zhongzheng.modules.user.service.IUserPlanService;
|
|
|
-import com.zhongzheng.modules.user.service.IUserStudyRecordPhotoService;
|
|
|
-import com.zhongzheng.modules.user.service.IUserStudyRecordService;
|
|
|
+import com.zhongzheng.modules.user.service.*;
|
|
|
import com.zhongzheng.modules.user.vo.*;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
+import org.springframework.beans.factory.annotation.Value;
|
|
|
import org.springframework.stereotype.Service;
|
|
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
|
@@ -37,10 +44,7 @@ import com.github.pagehelper.Page;
|
|
|
import org.springframework.transaction.annotation.Transactional;
|
|
|
|
|
|
import java.math.BigDecimal;
|
|
|
-import java.util.Calendar;
|
|
|
-import java.util.Collection;
|
|
|
-import java.util.Collections;
|
|
|
-import java.util.List;
|
|
|
+import java.util.*;
|
|
|
import java.util.stream.Collectors;
|
|
|
|
|
|
/**
|
|
@@ -71,6 +75,25 @@ public class UserStudyRecordServiceImpl extends ServiceImpl<UserStudyRecordMappe
|
|
|
@Autowired
|
|
|
private IUserPlanService userPlanService;
|
|
|
|
|
|
+ @Autowired
|
|
|
+ private IInformRemindService iInformRemindService;
|
|
|
+
|
|
|
+ @Autowired
|
|
|
+ private IGoodsService iGoodsService;
|
|
|
+
|
|
|
+ @Autowired
|
|
|
+ private com.zhongzheng.modules.alisms.service.IAliSmsService IAliSmsService;
|
|
|
+
|
|
|
+ @Autowired
|
|
|
+ private IUserService iUserService;
|
|
|
+
|
|
|
+ @Autowired
|
|
|
+ private IInformUserService iInformUserService;
|
|
|
+
|
|
|
+ @Value("${aliyun.sms.completionReminderCode}")
|
|
|
+ private String completionReminderCode;
|
|
|
+
|
|
|
+
|
|
|
|
|
|
@Override
|
|
|
public UserStudyRecordVo queryById(Long recordId) {
|
|
@@ -162,7 +185,55 @@ public class UserStudyRecordServiceImpl extends ServiceImpl<UserStudyRecordMappe
|
|
|
}
|
|
|
//发送课时完成
|
|
|
if (secLong.equals(studyLong)) {
|
|
|
-
|
|
|
+ InformRemindQueryBo informRemindQueryBo = new InformRemindQueryBo();
|
|
|
+ informRemindQueryBo.setSort(8L);
|
|
|
+ List<InformRemindVo> list = iInformRemindService.queryList(informRemindQueryBo);
|
|
|
+ CourseQueryBo courseQueryBo = new CourseQueryBo();
|
|
|
+ courseQueryBo.setGoodsId(bo.getGoodsId());
|
|
|
+ GoodsVo goodsVo = iGoodsService.selectUserDetail(courseQueryBo);
|
|
|
+ if (!CollectionUtils.isEmpty(list)){
|
|
|
+ InformRemindVo informRemindVo = list.get(0);
|
|
|
+ if (!CollectionUtils.isEmpty(informRemindVo.getInformRemindBusiness())) {
|
|
|
+ for (InformRemindBusinessVo informRemindBusiness : informRemindVo.getInformRemindBusiness()) {
|
|
|
+ if (goodsVo.getBusinessId().equals(informRemindBusiness.getBusinessId())) {
|
|
|
+ if (informRemindVo.getWayStatus().equals(1)) {
|
|
|
+ InformUserAddBo informUserAddBo = new InformUserAddBo();
|
|
|
+ informUserAddBo.setUserId(bo.getUserId());
|
|
|
+ informUserAddBo.setSendStatus(1);
|
|
|
+ informUserAddBo.setSendTime(DateUtils.getNowTime());
|
|
|
+ informUserAddBo.setCreateTime(DateUtils.getNowTime());
|
|
|
+ informUserAddBo.setUpdateTime(DateUtils.getNowTime());
|
|
|
+ informUserAddBo.setRemindId(8L);
|
|
|
+ informUserAddBo.setSystemStatus(1);
|
|
|
+ informUserAddBo.setRemind("学时学习完成提醒");
|
|
|
+ informUserAddBo.setGoodsId(bo.getGoodsId());
|
|
|
+ GoodsVo goodsVo1 = iGoodsService.queryById(bo.getGoodsId());
|
|
|
+ informUserAddBo.setText("尊敬的用户:您购买的"+goodsVo1.getGoodsName()+"课程学时已全部学完,请耐心等待审核学时。");
|
|
|
+ iInformUserService.insertByAddBo(informUserAddBo);
|
|
|
+ }
|
|
|
+ if (informRemindVo.getNoteStatus().equals(1)){
|
|
|
+ InformUserAddBo informUserAddBo = new InformUserAddBo();
|
|
|
+ informUserAddBo.setUserId(bo.getUserId());
|
|
|
+ informUserAddBo.setSendTime(DateUtils.getNowTime());
|
|
|
+ informUserAddBo.setSendStatus(1);
|
|
|
+ informUserAddBo.setCreateTime(DateUtils.getNowTime());
|
|
|
+ informUserAddBo.setUpdateTime(DateUtils.getNowTime());
|
|
|
+ informUserAddBo.setRemindId(8L);
|
|
|
+ informUserAddBo.setSystemStatus(3);
|
|
|
+ informUserAddBo.setRemind("学时学习完成提醒");
|
|
|
+ informUserAddBo.setGoodsId(bo.getGoodsId());
|
|
|
+ GoodsVo goodsVo1 = iGoodsService.queryById(bo.getGoodsId());
|
|
|
+ informUserAddBo.setText("尊敬的用户:您购买的"+goodsVo1.getGoodsName()+"课程学时已全部学完,请耐心等待审核学时。");
|
|
|
+ iInformUserService.insertByAddBo(informUserAddBo);
|
|
|
+ UserVo userVo = iUserService.queryById(bo.getUserId());
|
|
|
+ Map<String, Object> param = new HashMap<>();
|
|
|
+ param.put("goods", goodsVo1.getGoodsName());
|
|
|
+ IAliSmsService.sendInformSms(userVo.getTelphone(), JSON.toJSONString(param), completionReminderCode);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
}
|