|
@@ -5,6 +5,7 @@ import cn.hutool.core.lang.Validator;
|
|
import cn.hutool.core.util.IdUtil;
|
|
import cn.hutool.core.util.IdUtil;
|
|
import cn.hutool.core.util.StrUtil;
|
|
import cn.hutool.core.util.StrUtil;
|
|
import com.alibaba.fastjson.JSON;
|
|
import com.alibaba.fastjson.JSON;
|
|
|
|
+import com.baomidou.mybatisplus.core.toolkit.CollectionUtils;
|
|
import com.zhongzheng.common.core.redis.RedisCache;
|
|
import com.zhongzheng.common.core.redis.RedisCache;
|
|
import com.zhongzheng.common.core.redis.RedisLockEntity;
|
|
import com.zhongzheng.common.core.redis.RedisLockEntity;
|
|
import com.zhongzheng.common.exception.CustomException;
|
|
import com.zhongzheng.common.exception.CustomException;
|
|
@@ -16,8 +17,12 @@ import com.zhongzheng.modules.base.bo.ConsoleQueryBo;
|
|
import com.zhongzheng.modules.base.service.IProfileTpService;
|
|
import com.zhongzheng.modules.base.service.IProfileTpService;
|
|
import com.zhongzheng.modules.base.service.IShoppingCartService;
|
|
import com.zhongzheng.modules.base.service.IShoppingCartService;
|
|
import com.zhongzheng.modules.course.bo.CourseMenuQueryBo;
|
|
import com.zhongzheng.modules.course.bo.CourseMenuQueryBo;
|
|
|
|
+import com.zhongzheng.modules.course.domain.CourseEducationType;
|
|
|
|
+import com.zhongzheng.modules.course.domain.CourseSubject;
|
|
import com.zhongzheng.modules.course.service.ICourseBusinessService;
|
|
import com.zhongzheng.modules.course.service.ICourseBusinessService;
|
|
|
|
+import com.zhongzheng.modules.course.service.ICourseEducationTypeService;
|
|
import com.zhongzheng.modules.course.service.ICourseMenuService;
|
|
import com.zhongzheng.modules.course.service.ICourseMenuService;
|
|
|
|
+import com.zhongzheng.modules.course.service.ICourseSubjectService;
|
|
import com.zhongzheng.modules.course.vo.CourseBusinessVo;
|
|
import com.zhongzheng.modules.course.vo.CourseBusinessVo;
|
|
import com.zhongzheng.modules.course.vo.CourseMenuVo;
|
|
import com.zhongzheng.modules.course.vo.CourseMenuVo;
|
|
import com.zhongzheng.modules.course.vo.CourseModuleFreeExamVo;
|
|
import com.zhongzheng.modules.course.vo.CourseModuleFreeExamVo;
|
|
@@ -56,6 +61,7 @@ import com.zhongzheng.modules.user.service.IUserMockSubscribeService;
|
|
import com.zhongzheng.modules.user.service.IUserService;
|
|
import com.zhongzheng.modules.user.service.IUserService;
|
|
import com.zhongzheng.modules.user.vo.UserVo;
|
|
import com.zhongzheng.modules.user.vo.UserVo;
|
|
import com.zhongzheng.modules.wx.service.IWxPayService;
|
|
import com.zhongzheng.modules.wx.service.IWxPayService;
|
|
|
|
+import net.polyv.common.v1.util.StringUtils;
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
import org.springframework.stereotype.Service;
|
|
import org.springframework.stereotype.Service;
|
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
|
@@ -140,6 +146,11 @@ public class OrderServiceImpl extends ServiceImpl<OrderMapper, Order> implements
|
|
@Autowired
|
|
@Autowired
|
|
private IUserMockSubscribeService iUserMockSubscribeService;
|
|
private IUserMockSubscribeService iUserMockSubscribeService;
|
|
|
|
|
|
|
|
+ @Autowired
|
|
|
|
+ private ICourseEducationTypeService courseEducationTypeService;
|
|
|
|
+ @Autowired
|
|
|
|
+ private ICourseSubjectService courseSubjectService;
|
|
|
|
+
|
|
|
|
|
|
@Override
|
|
@Override
|
|
public OrderVo queryById(Long orderId) {
|
|
public OrderVo queryById(Long orderId) {
|
|
@@ -1529,7 +1540,36 @@ public class OrderServiceImpl extends ServiceImpl<OrderMapper, Order> implements
|
|
classGrade.setStatus(1);
|
|
classGrade.setStatus(1);
|
|
String gradeCode = ServletUtils.getEncoded("BJ");
|
|
String gradeCode = ServletUtils.getEncoded("BJ");
|
|
classGrade.setGradeCode(gradeCode);
|
|
classGrade.setGradeCode(gradeCode);
|
|
- classGrade.setClassName(goodsName + gradeCode);
|
|
|
|
|
|
+// classGrade.setClassName(goodsName + gradeCode);
|
|
|
|
+ //班级名称 年份+期数+业务层次(俗名)+教育类型+科目(存在多个科目时,显示多个科目,用“+”分割)
|
|
|
|
+ String businessName = businessVo.getAliasName();
|
|
|
|
+ Goods goods = iGoodsService.getById(goodsId);
|
|
|
|
+ CourseEducationType educationType = courseEducationTypeService.getById(goods.getEducationTypeId());
|
|
|
|
+ String educationName = educationType.getEducationName();
|
|
|
|
+ String className = businessName + educationName;
|
|
|
|
+ if (StringUtils.isNotBlank(goods.getSubjectIds())){
|
|
|
|
+ List<CourseSubject> subjects = courseSubjectService.listByIds(Arrays.stream(goods.getSubjectIds().split(",")).collect(Collectors.toList()));
|
|
|
|
+ List<String> names = subjects.stream().map(CourseSubject::getSubjectName).collect(Collectors.toList());
|
|
|
|
+ className = String.format("%s(%s)",className,org.apache.commons.lang3.StringUtils.join(names,'+'));
|
|
|
|
+ }
|
|
|
|
+ Integer nameSort = 1;
|
|
|
|
+ //获取排序值
|
|
|
|
+ List<ClassGrade> list = iClassGradeService
|
|
|
|
+ .list(new LambdaQueryWrapper<ClassGrade>()
|
|
|
|
+ .like(ClassGrade::getClassName, className));
|
|
|
|
+ if (CollectionUtils.isNotEmpty(list)){
|
|
|
|
+ List<Integer> collect = list.stream().filter(x -> x.getClassName().contains("第") && x.getClassName().contains("期")).map(item -> {
|
|
|
|
+ String name = item.getClassName();
|
|
|
|
+ String substring = name.substring(name.indexOf("第") + 1, name.indexOf("期"));
|
|
|
|
+ return Integer.parseInt(substring);
|
|
|
|
+ }).collect(Collectors.toList());
|
|
|
|
+ if (CollectionUtils.isNotEmpty(collect)){
|
|
|
|
+ Integer integer = collect.stream().sorted(Comparator.reverseOrder()).findFirst().get();
|
|
|
|
+ nameSort = integer + 1;
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ classGrade.setClassName(String.format("%s年第%s期%s",goods.getYear(),nameSort,className));
|
|
|
|
+
|
|
boolean save = iClassGradeService.save(classGrade);
|
|
boolean save = iClassGradeService.save(classGrade);
|
|
//绑定班级商品
|
|
//绑定班级商品
|
|
ClassGradeGoods classGradeGoods = new ClassGradeGoods();
|
|
ClassGradeGoods classGradeGoods = new ClassGradeGoods();
|
|
@@ -1543,6 +1583,7 @@ public class OrderServiceImpl extends ServiceImpl<OrderMapper, Order> implements
|
|
return true;
|
|
return true;
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+
|
|
//选择新的班级
|
|
//选择新的班级
|
|
@Override
|
|
@Override
|
|
public Long changeGrade(String goodsName, Long goodsId, Long orderGoodsId, Long gradeId, Long userId, Long businessId) {
|
|
public Long changeGrade(String goodsName, Long goodsId, Long orderGoodsId, Long gradeId, Long userId, Long businessId) {
|