|
@@ -3816,6 +3816,54 @@ public class OrderServiceImpl extends ServiceImpl<OrderMapper, Order> implements
|
|
|
.in(OrderGoods::getOrderGoodsId,bo.getOrderGoodsIds()));
|
|
.in(OrderGoods::getOrderGoodsId,bo.getOrderGoodsIds()));
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+ @Override
|
|
|
|
|
+ @Transactional(rollbackFor = Exception.class)
|
|
|
|
|
+ public String closeOrderImport(List<CloseOrderImport> importList) {
|
|
|
|
|
+ if (CollectionUtils.isEmpty(importList)){
|
|
|
|
|
+ return "";
|
|
|
|
|
+ }
|
|
|
|
|
+ for (CloseOrderImport orderImport : importList) {
|
|
|
|
|
+ if (!orderImport.getYear().equals("2025")){
|
|
|
|
|
+ //不是25年的不用关闭
|
|
|
|
|
+ continue;
|
|
|
|
|
+ }
|
|
|
|
|
+ User user = iUserService.getOne(new LambdaQueryWrapper<User>().eq(User::getIdCard, EncryptHandler.encrypt(orderImport.getIdCard())).eq(User::getStatus, 1));
|
|
|
|
|
+ if (ObjectUtils.isNull(user)){
|
|
|
|
|
+ continue;
|
|
|
|
|
+ }
|
|
|
|
|
+ //获取订单
|
|
|
|
|
+ OrderGoods og = baseMapper.getOrderByUser(user.getUserId(),orderImport.getYear(),orderImport.getMajorName());
|
|
|
|
|
+ if (ObjectUtils.isNull(og)){
|
|
|
|
|
+ continue;
|
|
|
|
|
+ }
|
|
|
|
|
+ //班级信息
|
|
|
|
|
+ ClassGradeUser gradeUser = iClassGradeUserService
|
|
|
|
|
+ .getOne(new LambdaQueryWrapper<ClassGradeUser>().eq(ClassGradeUser::getStatus, 1).eq(ClassGradeUser::getOrderGoodsId, og.getOrderGoodsId()).last("limit 1"));
|
|
|
|
|
+
|
|
|
|
|
+ if (ObjectUtils.isNull(gradeUser)){
|
|
|
|
|
+ continue;
|
|
|
|
|
+ }
|
|
|
|
|
+ //是否已学完
|
|
|
|
|
+ if (ObjectUtils.isNotNull(gradeUser.getFinishStatus()) && gradeUser.getFinishStatus() == 1){
|
|
|
|
|
+ continue;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ ClassGrade classGrade = iClassGradeService.getById(gradeUser.getGradeId());
|
|
|
|
|
+ if (classGrade.getClassEndTime() > DateUtils.getNowTime()){
|
|
|
|
|
+ //班级未结束不关闭
|
|
|
|
|
+ continue;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ //关闭订单和关闭班级
|
|
|
|
|
+ og.setStatus(0);
|
|
|
|
|
+ iOrderGoodsService.updateById(og);
|
|
|
|
|
+ gradeUser.setStatus(0);
|
|
|
|
|
+ iClassGradeUserService.updateById(gradeUser);
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ return "";
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
/**
|
|
/**
|
|
|
* 根据身份证号码判断性别
|
|
* 根据身份证号码判断性别
|
|
|
*
|
|
*
|