|
@@ -17,6 +17,7 @@ import com.zhongzheng.common.exception.CustomException;
|
|
|
import com.zhongzheng.common.type.EncryptHandler;
|
|
|
import com.zhongzheng.common.utils.DateUtils;
|
|
|
import com.zhongzheng.common.utils.ServletUtils;
|
|
|
+import com.zhongzheng.common.utils.ToolsUtils;
|
|
|
import com.zhongzheng.common.utils.file.FileUtils;
|
|
|
import com.zhongzheng.common.utils.http.HttpUtils;
|
|
|
import com.zhongzheng.common.utils.poi.ExcelUtil;
|
|
@@ -63,11 +64,11 @@ import com.zhongzheng.modules.goods.service.IGoodsService;
|
|
|
import com.zhongzheng.modules.goods.vo.BankGoodsExamVo;
|
|
|
import com.zhongzheng.modules.goods.vo.GoodsCourseVo;
|
|
|
import com.zhongzheng.modules.goods.vo.GoodsVo;
|
|
|
-import com.zhongzheng.modules.grade.bo.ClassGradeQueryBo;
|
|
|
-import com.zhongzheng.modules.grade.bo.ClassGradeUserQueryBo;
|
|
|
+import com.zhongzheng.modules.grade.bo.*;
|
|
|
import com.zhongzheng.modules.grade.domain.*;
|
|
|
import com.zhongzheng.modules.grade.mapper.ClassGradeUserMapper;
|
|
|
import com.zhongzheng.modules.grade.service.*;
|
|
|
+import com.zhongzheng.modules.grade.vo.ClassExpirationVo;
|
|
|
import com.zhongzheng.modules.grade.vo.ClassGradeUserGoodsVo;
|
|
|
import com.zhongzheng.modules.grade.vo.ClassGradeVo;
|
|
|
import com.zhongzheng.modules.grade.vo.ClassPeriodVo;
|
|
@@ -111,6 +112,7 @@ import com.zhongzheng.modules.system.service.ISysTaskService;
|
|
|
import com.zhongzheng.modules.system.service.ISysTenantService;
|
|
|
import com.zhongzheng.modules.system.service.ISysUserService;
|
|
|
import com.zhongzheng.modules.system.vo.SysTenantVo;
|
|
|
+import com.zhongzheng.modules.top.financial.bo.CheckOrderStudentBo;
|
|
|
import com.zhongzheng.modules.top.financial.bo.TopDivideOrderAddBo;
|
|
|
import com.zhongzheng.modules.top.financial.bo.TopDivideOrderQueryBo;
|
|
|
import com.zhongzheng.modules.top.financial.domain.TopDivideLog;
|
|
@@ -118,6 +120,10 @@ import com.zhongzheng.modules.top.financial.service.ITopDivideLogService;
|
|
|
import com.zhongzheng.modules.top.financial.service.ITopDivideOrderService;
|
|
|
import com.zhongzheng.modules.top.financial.vo.TopCreateUserVo;
|
|
|
import com.zhongzheng.modules.top.financial.vo.TopDivideOrderVo;
|
|
|
+import com.zhongzheng.modules.top.goods.domain.TopOldOrder;
|
|
|
+import com.zhongzheng.modules.top.goods.domain.TopOldOrderGoods;
|
|
|
+import com.zhongzheng.modules.top.goods.service.ITopOldOrderGoodsService;
|
|
|
+import com.zhongzheng.modules.top.goods.service.ITopOldOrderService;
|
|
|
import com.zhongzheng.modules.top.user.service.ITopSysConfigService;
|
|
|
import com.zhongzheng.modules.user.bo.*;
|
|
|
import com.zhongzheng.modules.user.domain.*;
|
|
@@ -355,6 +361,10 @@ public class ScheduleServiceImpl extends ServiceImpl<PolyvVideoMapper, PolyvVide
|
|
|
private OssService ossService;
|
|
|
@Autowired
|
|
|
private ClassGradeUserMapper classGradeUserMapper;
|
|
|
+ @Autowired
|
|
|
+ private ITopOldOrderService topOldOrderService;
|
|
|
+ @Autowired
|
|
|
+ private ITopOldOrderGoodsService topOldOrderGoodsService;
|
|
|
|
|
|
@Value("${aliyun.sms.OpenTheGoodsCode}")
|
|
|
private String OpenTheGoodsCode;
|
|
@@ -407,6 +417,9 @@ public class ScheduleServiceImpl extends ServiceImpl<PolyvVideoMapper, PolyvVide
|
|
|
@Value("${aliyun.sms.classEndRemind}")
|
|
|
private String classEndRemind;
|
|
|
|
|
|
+ @Value("${oldOrder.classEndSaleTipMsg}")
|
|
|
+ private String CLASS_END_SALETIP_MSG;
|
|
|
+
|
|
|
@Autowired
|
|
|
private RedisCache redisCache;
|
|
|
|
|
@@ -2204,6 +2217,54 @@ public class ScheduleServiceImpl extends ServiceImpl<PolyvVideoMapper, PolyvVide
|
|
|
|
|
|
}
|
|
|
|
|
|
+ @Override
|
|
|
+ public void classExpirationReminder() {
|
|
|
+ List<ClassExpirationVo> expirationVos = baseMapper.getClassExpirationList();
|
|
|
+ if (CollectionUtils.isEmpty(expirationVos)){
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ Map<Long, List<ClassExpirationVo>> map = expirationVos.stream().collect(Collectors.groupingBy(ClassExpirationVo::getGradeId));
|
|
|
+ List<ClassExpirationListBo> list = new ArrayList<>();
|
|
|
+ map.forEach((k,v) -> {
|
|
|
+ String name = v.get(0).getClassName();
|
|
|
+ Map<String, List<ClassExpirationVo>> collect = v.stream().collect(Collectors.groupingBy(ClassExpirationVo::getInputOrderSn));
|
|
|
+ collect.forEach((j,h) -> {
|
|
|
+ TopOldOrder oldOrder = topOldOrderService.getOne(new LambdaQueryWrapper<TopOldOrder>()
|
|
|
+ .eq(TopOldOrder::getInputOrderSn, j)
|
|
|
+ .eq(TopOldOrder::getCheckStatus,1)
|
|
|
+ .eq(TopOldOrder::getStatus,1)
|
|
|
+ .last("limit 1"));
|
|
|
+ if (ObjectUtils.isNull(oldOrder)){
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ ClassExpirationListBo listBo = new ClassExpirationListBo();
|
|
|
+ listBo.setOrderNo(oldOrder.getOrderSn());
|
|
|
+ ClassExpirationUserBo userBo = new ClassExpirationUserBo();
|
|
|
+ userBo.setInputOrderSn(j);
|
|
|
+ userBo.setGradeId(k);
|
|
|
+ List<String> userNames = baseMapper.getOrderUserName(userBo);
|
|
|
+ listBo.setName(userNames.stream().collect(Collectors.joining(",")));
|
|
|
+ listBo.setRemark(String.format("%s还有10天过期",name));
|
|
|
+ list.add(listBo);
|
|
|
+ });
|
|
|
+ });
|
|
|
+ ClassExpirationBo bo = new ClassExpirationBo();
|
|
|
+ bo.setList(list);
|
|
|
+ Long nowTime = DateUtils.getNowTime();
|
|
|
+ String sign = ToolsUtils.EncoderByMd5(nowTime + "pubilc2022");
|
|
|
+ bo.setStamp(nowTime);
|
|
|
+ bo.setSign(sign);
|
|
|
+ String respone = "";
|
|
|
+ try {
|
|
|
+ respone = HttpUtils.sendPostHeader(CLASS_END_SALETIP_MSG, JSONObject.parseObject(JSONObject.toJSONString(bo)), new HashMap<>());
|
|
|
+ if (!respone.contains("\"Status\":true")) {
|
|
|
+ throw new CustomException("旧系统班级过期提醒接口请求错误");
|
|
|
+ }
|
|
|
+ } catch (Exception e) {
|
|
|
+ throw new CustomException("旧系统班级过期提醒接口请求错误");
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
|
|
|
private String getWeeks(Long time){
|
|
|
Calendar calendar = Calendar.getInstance();
|