|
@@ -64,6 +64,12 @@ public class UserPeriodServiceImpl extends ServiceImpl<UserPeriodMapper, UserPer
|
|
|
@Value("${aliyun.sms.auditFailedCode}")
|
|
|
private String auditFailedCode;
|
|
|
|
|
|
+ @Value("${aliyun.sms.ReminderApproval}")
|
|
|
+ private String ReminderApproval;
|
|
|
+
|
|
|
+ @Value("${aliyun.sms.passTheReminder}")
|
|
|
+ private String passTheReminder;
|
|
|
+
|
|
|
@Autowired
|
|
|
private com.zhongzheng.modules.alisms.service.IAliSmsService IAliSmsService;
|
|
|
|
|
@@ -120,16 +126,44 @@ public class UserPeriodServiceImpl extends ServiceImpl<UserPeriodMapper, UserPer
|
|
|
@Override
|
|
|
@Transactional(rollbackFor = Exception.class)
|
|
|
public Boolean updateByEditBo(UserPeriodEditBo bo) {
|
|
|
- for (Long aLong : bo.getId()) {
|
|
|
- UserPeriodStatus userPeriodStatus = new UserPeriodStatus();
|
|
|
- userPeriodStatus.setPeriodStatus(1);
|
|
|
- userPeriodStatus.setStatus(bo.getStatus());
|
|
|
- userPeriodStatus.setUpdateTime(DateUtils.getNowTime());
|
|
|
- LambdaQueryWrapper<UserPeriodStatus> lqw = Wrappers.lambdaQuery();
|
|
|
- lqw.eq( UserPeriodStatus::getPeriodId, aLong);
|
|
|
- lqw.eq( UserPeriodStatus::getPeriodStatus, 1);
|
|
|
- userPeriodStatusService.update(userPeriodStatus,lqw);
|
|
|
+ List<UserPeriodStatus> list = new ArrayList<>();
|
|
|
+ for (Long aLong : bo.getId()) {
|
|
|
+ UserPeriodStatus userPeriodStatus = new UserPeriodStatus();
|
|
|
+ userPeriodStatus.setPeriodStatus(1);
|
|
|
+ userPeriodStatus.setStatus(bo.getStatus());
|
|
|
+ userPeriodStatus.setUpdateTime(DateUtils.getNowTime());
|
|
|
+ LambdaQueryWrapper<UserPeriodStatus> lqw = Wrappers.lambdaQuery();
|
|
|
+ lqw.eq( UserPeriodStatus::getPeriodId, aLong);
|
|
|
+ lqw.eq( UserPeriodStatus::getPeriodStatus, 1);
|
|
|
+ userPeriodStatusService.update(userPeriodStatus,lqw);
|
|
|
+ list = userPeriodStatusService.list(lqw);
|
|
|
+ }
|
|
|
+ if (!CollectionUtils.isEmpty(list)){
|
|
|
+ UserPeriodStatus userPeriodStatus = list.get(0);
|
|
|
+ UserPeriodVo userPeriodVo = this.queryById(userPeriodStatus.getPeriodId());
|
|
|
+
|
|
|
+ LambdaQueryWrapper<UserPeriod> lqw = Wrappers.lambdaQuery();
|
|
|
+ lqw.eq(userPeriodVo.getUserId() != null, UserPeriod::getUserId, userPeriodVo.getUserId());
|
|
|
+ lqw.eq(userPeriodVo.getGoodsId() != null, UserPeriod::getGoodsId, userPeriodVo.getGoodsId());
|
|
|
+ lqw.eq(userPeriodVo.getGradeId() != null, UserPeriod::getGradeId, userPeriodVo.getGradeId());
|
|
|
+ List<UserPeriod> listPeriodVo = this.list(lqw);
|
|
|
+ for (UserPeriod userPeriod : listPeriodVo) {
|
|
|
+ LambdaQueryWrapper<UserPeriodStatus> userPeriods = Wrappers.lambdaQuery();
|
|
|
+ userPeriods.eq(UserPeriodStatus::getPeriodId, userPeriod.getId());
|
|
|
+ userPeriods.eq(UserPeriodStatus::getPeriodStatus, 1);
|
|
|
+ userPeriods.eq(UserPeriodStatus::getStatus, 1);
|
|
|
+ List<UserPeriodStatus> list1 = userPeriodStatusService.list(userPeriods);
|
|
|
+ if (CollectionUtils.isEmpty(list1)){
|
|
|
+ return true;
|
|
|
+ }
|
|
|
}
|
|
|
+ UserPeriodEditBo userPeriodEditBo = new UserPeriodEditBo();
|
|
|
+ userPeriodEditBo.setUserId(userPeriodVo.getUserId());
|
|
|
+ userPeriodEditBo.setGoodsId(userPeriodVo.getGoodsId());
|
|
|
+ userPeriodEditBo.setGradeId(userPeriodVo.getGradeId());
|
|
|
+ sendPeriodSMS(userPeriodEditBo);
|
|
|
+ sendPeriodSevenSMS(userPeriodEditBo);
|
|
|
+ }
|
|
|
return true;
|
|
|
}
|
|
|
|
|
@@ -156,6 +190,7 @@ public class UserPeriodServiceImpl extends ServiceImpl<UserPeriodMapper, UserPer
|
|
|
LambdaQueryWrapper<UserPeriod> lqw = Wrappers.lambdaQuery();
|
|
|
lqw.eq(bo.getUserId() != null, UserPeriod::getUserId, bo.getUserId());
|
|
|
lqw.eq(bo.getGoodsId() != null, UserPeriod::getGoodsId, bo.getGoodsId());
|
|
|
+ lqw.eq(bo.getGradeId() != null, UserPeriod::getGradeId, bo.getGradeId());
|
|
|
List<UserPeriod> list = this.list(lqw);
|
|
|
for (UserPeriod userPeriod : list) {
|
|
|
UserPeriodStatus userPeriodStatus = new UserPeriodStatus();
|
|
@@ -169,6 +204,7 @@ public class UserPeriodServiceImpl extends ServiceImpl<UserPeriodMapper, UserPer
|
|
|
userPeriodStatusService.update(userPeriodStatus,userPeriods);
|
|
|
}
|
|
|
sendPeriodSMS(bo);
|
|
|
+ sendPeriodSevenSMS(bo);
|
|
|
return true;
|
|
|
}
|
|
|
|
|
@@ -283,7 +319,7 @@ public class UserPeriodServiceImpl extends ServiceImpl<UserPeriodMapper, UserPer
|
|
|
iInformUserService.insertByAddBo(informUserAddBo);
|
|
|
UserVo userVo = iUserService.queryById(bo.getUserId());
|
|
|
Map<String, Object> param = new HashMap<>();
|
|
|
- IAliSmsService.sendInformSms(userVo.getTelphone(), JSON.toJSONString(param), schoolHoursCode);
|
|
|
+ IAliSmsService.sendInformSms(userVo.getTelphone(), JSON.toJSONString(param), ReminderApproval);
|
|
|
}
|
|
|
}
|
|
|
}else {
|
|
@@ -297,11 +333,11 @@ public class UserPeriodServiceImpl extends ServiceImpl<UserPeriodMapper, UserPer
|
|
|
informUserAddBo.setCreateTime(DateUtils.getNowTime());
|
|
|
informUserAddBo.setSendTime(DateUtils.getNowTime());
|
|
|
informUserAddBo.setUpdateTime(DateUtils.getNowTime());
|
|
|
- informUserAddBo.setRemindId(10L);
|
|
|
+ informUserAddBo.setRemindId(12L);
|
|
|
informUserAddBo.setSystemStatus(1);
|
|
|
informUserAddBo.setRemind("学时机构审核不通过提醒");
|
|
|
informUserAddBo.setGoodsId(bo.getGoodsId());
|
|
|
- informUserAddBo.setText("尊敬的用户:您购买的"+goodsVo1.getGoodsName()+"课程学时机构审核不通过,为了不影响您的学习进度,请点击立即重学进行重学。");
|
|
|
+ informUserAddBo.setText("尊敬的用户:您购买的"+goodsVo1.getGoodsName()+"课程学时审核不通过,为了不影响您的学习进度,请点击立即重学进行重学。");
|
|
|
iInformUserService.insertByAddBo(informUserAddBo);
|
|
|
}
|
|
|
if (informRemindTwoVo.getNoteStatus().equals(1)) {
|
|
@@ -311,16 +347,16 @@ public class UserPeriodServiceImpl extends ServiceImpl<UserPeriodMapper, UserPer
|
|
|
informUserAddBo.setSendStatus(1);
|
|
|
informUserAddBo.setCreateTime(DateUtils.getNowTime());
|
|
|
informUserAddBo.setUpdateTime(DateUtils.getNowTime());
|
|
|
- informUserAddBo.setRemindId(10L);
|
|
|
+ informUserAddBo.setRemindId(12L);
|
|
|
informUserAddBo.setSystemStatus(3);
|
|
|
informUserAddBo.setRemind("学时机构审核不通过提醒");
|
|
|
informUserAddBo.setGoodsId(bo.getGoodsId());
|
|
|
- informUserAddBo.setText("尊敬的用户:您购买的"+goodsVo1.getGoodsName()+"课程学时机构审核不通过,为了不影响您的学习进度,请点击立即重学进行重学。");
|
|
|
+ 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), auditFailedCode);
|
|
|
+ IAliSmsService.sendInformSms(userVo.getTelphone(), JSON.toJSONString(param), passTheReminder);
|
|
|
}
|
|
|
}
|
|
|
}
|