|
@@ -266,7 +266,7 @@ public class ClassGradeServiceImpl extends ServiceImpl<ClassGradeMapper, ClassGr
|
|
|
|
|
|
//企业ID
|
|
|
String tenant = ServletUtils.getRequest().getHeader("TenantId");
|
|
|
-// SysTenant sysTenant = sysTenantService.getById(Long.valueOf(tenant));
|
|
|
+ SysTenant sysTenant = sysTenantService.getById(Long.valueOf(tenant));
|
|
|
SysOldOrg org = sysOldOrgService.list(new LambdaQueryWrapper<SysOldOrg>()
|
|
|
.eq(SysOldOrg::getTenantId, tenant)
|
|
|
.last("limit 1")).stream().findFirst().orElse(null);
|
|
@@ -313,111 +313,111 @@ public class ClassGradeServiceImpl extends ServiceImpl<ClassGradeMapper, ClassGr
|
|
|
String sevenCode = getSevenCode(goodsId);
|
|
|
add.setSevenCode(sevenCode);
|
|
|
}
|
|
|
-// else if (("继续教育二级建造师".equals(businessName)) || ("继续教育二级造价师".equals(businessName))){
|
|
|
-// erJfalg = true;
|
|
|
-// ezJfalg = "继续教育二级造价师".equals(businessName);
|
|
|
-// add.setOfficialName(ServletUtils.getEncoded("PIY"));
|
|
|
-// }
|
|
|
- }
|
|
|
- //是否创建官方班级编号
|
|
|
- if (bo.getClassGradeGoodsAddBos() != null &&
|
|
|
- (ObjectUtils.isNull(bo.getClassStatus()) || 0 == bo.getClassStatus()) && org.getShareClass() == 1) {
|
|
|
- Long goodsId = bo.getClassGradeGoodsAddBos()[0];
|
|
|
- Goods goods = iGoodsService.getById(goodsId);
|
|
|
- CourseBusiness business = iCourseBusinessService.getById(goods.getBusinessId());
|
|
|
- CourseBusinessQueryBo businessQueryBo = new CourseBusinessQueryBo();
|
|
|
- businessQueryBo.setId(goods.getBusinessId());
|
|
|
- String fullName = iCourseBusinessService.queryFullName(businessQueryBo);
|
|
|
- if (("继续教育二级建造师".equals(fullName)) || ("继续教育二级造价师".equals(fullName))) {
|
|
|
- List<Goods> goodsList = iGoodsService.list(new LambdaQueryWrapper<Goods>()
|
|
|
- .eq(Goods::getEducationTypeId, goods.getEducationTypeId())
|
|
|
- .eq(Goods::getBusinessId, goods.getBusinessId())
|
|
|
- .eq(Goods::getStatus, 1)
|
|
|
- .eq(Goods::getGoodsStatus, 1)
|
|
|
- .eq(Goods::getProjectId, goods.getProjectId())
|
|
|
- .eq(Goods::getSubjectIds, goods.getSubjectIds()));
|
|
|
- if (goodsList.size() > 1) {
|
|
|
- //该业务层次下有多个商品
|
|
|
- List<Long> goodsIds = goodsList.stream().filter(item -> !item.getGoodsId().equals(goodsId)).map(Goods::getGoodsId).collect(Collectors.toList());
|
|
|
- List<ClassGradeGoods> goodsGradeList = iClassGradeGoodsService
|
|
|
- .list(new LambdaQueryWrapper<ClassGradeGoods>()
|
|
|
- .in(ClassGradeGoods::getGoodsId, goodsIds));
|
|
|
- if (CollectionUtils.isNotEmpty(goodsGradeList)) {
|
|
|
- Map<Long, List<ClassGradeGoods>> map = goodsGradeList.stream().collect(Collectors.groupingBy(ClassGradeGoods::getGoodsId));
|
|
|
- List<ClassGradeSortBo> sortList = new ArrayList<>();
|
|
|
- map.forEach((k, v) -> {
|
|
|
- ClassGradeSortBo sortBo = new ClassGradeSortBo();
|
|
|
- sortBo.setKey(k);
|
|
|
- sortBo.setSize(v.size());
|
|
|
- sortList.add(sortBo);
|
|
|
- });
|
|
|
- ClassGradeSortBo sortBo = sortList.stream().sorted(Comparator.comparing(ClassGradeSortBo::getSize).reversed()).findFirst().orElse(null);
|
|
|
- List<ClassGradeGoods> classGradesMax = map.get(sortBo.getKey()).stream().sorted(Comparator.comparing(ClassGradeGoods::getCreateTime)).collect(Collectors.toList());
|
|
|
- //班级信息
|
|
|
- List<ClassGrade> listGrade = listByIds(classGradesMax.stream().map(ClassGradeGoods::getGradeId).collect(Collectors.toList()));
|
|
|
- //获取当前机构商品下的班级
|
|
|
- List<ClassGradeGoods> gradeGoods = iClassGradeGoodsService.getGradeGoodsList(goods.getGoodsId());
|
|
|
- if (gradeGoods.size() < listGrade.size()) {
|
|
|
- ClassGrade grade = listGrade.get(gradeGoods.size());
|
|
|
- if (checkEjjjPeopleNumLimit(business.getId(), grade.getGradeId())) {
|
|
|
- add.setOfficialName(listGrade.get(gradeGoods.size()).getOfficialName());
|
|
|
- add.setClassStatus(0);
|
|
|
- } else {
|
|
|
- add.setOfficialName(ServletUtils.getEncoded("PIY"));
|
|
|
- add.setClassStatus(0);
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
- if (StringUtils.isBlank(add.getOfficialName())) {
|
|
|
- List<CourseSubject> courseSubjectList = iCourseSubjectService.listByIds(Arrays.asList(goods.getSubjectIds().split(",")));
|
|
|
- List<String> subNames = courseSubjectList.stream().map(CourseSubject::getSubjectName).collect(Collectors.toList());
|
|
|
- List<Long> subIds = iCourseSubjectService.getIdsByTenant(subNames);
|
|
|
- //获取业务层次下所有班级
|
|
|
- ClassGradeListBo bgListBo = new ClassGradeListBo();
|
|
|
- bgListBo.setAliasName(business.getAliasName());
|
|
|
- bgListBo.setSubIds(subIds);
|
|
|
- List<ClassGrade> classGrades = baseMapper.getGradeListByTenant(bgListBo);
|
|
|
- if (CollectionUtils.isEmpty(classGrades)) {
|
|
|
- //生成预报名官方编号
|
|
|
- add.setOfficialName(ServletUtils.getEncoded("PIY"));
|
|
|
- add.setClassStatus(0);
|
|
|
- } else {
|
|
|
- //获取班级创建最多的机构
|
|
|
- Map<Long, List<ClassGrade>> map = classGrades.stream().collect(Collectors.groupingBy(ClassGrade::getTenantId));
|
|
|
- List<ClassGradeSortBo> sortList = new ArrayList<>();
|
|
|
- map.forEach((k, v) -> {
|
|
|
- ClassGradeSortBo sortBo = new ClassGradeSortBo();
|
|
|
- sortBo.setKey(k);
|
|
|
- Map<String, List<ClassGrade>> collect = v.stream().collect(Collectors.groupingBy(ClassGrade::getOfficialName));
|
|
|
- sortBo.setSize(collect.keySet().size());
|
|
|
- sortList.add(sortBo);
|
|
|
- });
|
|
|
- ClassGradeSortBo sortBo = sortList.stream().sorted(Comparator.comparing(ClassGradeSortBo::getSize).reversed()).findFirst().orElse(null);
|
|
|
- List<ClassGrade> classGradesMax = map.get(sortBo.getKey()).stream().sorted(Comparator.comparing(ClassGrade::getCreateTime)).collect(Collectors.toList());
|
|
|
- //去重
|
|
|
- List<String> codeStrs = new ArrayList<>();
|
|
|
- for (ClassGrade gradesMax : classGradesMax) {
|
|
|
- if (codeStrs.contains(gradesMax.getOfficialName())) {
|
|
|
- continue;
|
|
|
- }
|
|
|
- codeStrs.add(gradesMax.getOfficialName());
|
|
|
- }
|
|
|
- //获取当前机构商品下的班级
|
|
|
- List<ClassGradeGoods> gradeGoods = iClassGradeGoodsService.getGradeGoodsList(goodsId);
|
|
|
- if (gradeGoods.size() < codeStrs.size()) {
|
|
|
- add.setOfficialName(codeStrs.get(gradeGoods.size()));
|
|
|
- add.setClassStatus(0);
|
|
|
- } else {
|
|
|
- //生成预报名官方编号
|
|
|
- add.setOfficialName(ServletUtils.getEncoded("PIY"));
|
|
|
- add.setClassStatus(0);
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
+ else if (("继续教育二级建造师".equals(businessName)) || ("继续教育二级造价师".equals(businessName))){
|
|
|
+ erJfalg = true;
|
|
|
+ ezJfalg = "继续教育二级造价师".equals(businessName);
|
|
|
+ add.setOfficialName(ServletUtils.getEncoded("PIY"));
|
|
|
}
|
|
|
}
|
|
|
+ //是否创建官方班级编号
|
|
|
+// if (bo.getClassGradeGoodsAddBos() != null &&
|
|
|
+// (ObjectUtils.isNull(bo.getClassStatus()) || 0 == bo.getClassStatus()) && org.getShareClass() == 1) {
|
|
|
+// Long goodsId = bo.getClassGradeGoodsAddBos()[0];
|
|
|
+// Goods goods = iGoodsService.getById(goodsId);
|
|
|
+// CourseBusiness business = iCourseBusinessService.getById(goods.getBusinessId());
|
|
|
+// CourseBusinessQueryBo businessQueryBo = new CourseBusinessQueryBo();
|
|
|
+// businessQueryBo.setId(goods.getBusinessId());
|
|
|
+// String fullName = iCourseBusinessService.queryFullName(businessQueryBo);
|
|
|
+// if (("继续教育二级建造师".equals(fullName)) || ("继续教育二级造价师".equals(fullName))) {
|
|
|
+// List<Goods> goodsList = iGoodsService.list(new LambdaQueryWrapper<Goods>()
|
|
|
+// .eq(Goods::getEducationTypeId, goods.getEducationTypeId())
|
|
|
+// .eq(Goods::getBusinessId, goods.getBusinessId())
|
|
|
+// .eq(Goods::getStatus, 1)
|
|
|
+// .eq(Goods::getGoodsStatus, 1)
|
|
|
+// .eq(Goods::getProjectId, goods.getProjectId())
|
|
|
+// .eq(Goods::getSubjectIds, goods.getSubjectIds()));
|
|
|
+// if (goodsList.size() > 1) {
|
|
|
+// //该业务层次下有多个商品
|
|
|
+// List<Long> goodsIds = goodsList.stream().filter(item -> !item.getGoodsId().equals(goodsId)).map(Goods::getGoodsId).collect(Collectors.toList());
|
|
|
+// List<ClassGradeGoods> goodsGradeList = iClassGradeGoodsService
|
|
|
+// .list(new LambdaQueryWrapper<ClassGradeGoods>()
|
|
|
+// .in(ClassGradeGoods::getGoodsId, goodsIds));
|
|
|
+// if (CollectionUtils.isNotEmpty(goodsGradeList)) {
|
|
|
+// Map<Long, List<ClassGradeGoods>> map = goodsGradeList.stream().collect(Collectors.groupingBy(ClassGradeGoods::getGoodsId));
|
|
|
+// List<ClassGradeSortBo> sortList = new ArrayList<>();
|
|
|
+// map.forEach((k, v) -> {
|
|
|
+// ClassGradeSortBo sortBo = new ClassGradeSortBo();
|
|
|
+// sortBo.setKey(k);
|
|
|
+// sortBo.setSize(v.size());
|
|
|
+// sortList.add(sortBo);
|
|
|
+// });
|
|
|
+// ClassGradeSortBo sortBo = sortList.stream().sorted(Comparator.comparing(ClassGradeSortBo::getSize).reversed()).findFirst().orElse(null);
|
|
|
+// List<ClassGradeGoods> classGradesMax = map.get(sortBo.getKey()).stream().sorted(Comparator.comparing(ClassGradeGoods::getCreateTime)).collect(Collectors.toList());
|
|
|
+// //班级信息
|
|
|
+// List<ClassGrade> listGrade = listByIds(classGradesMax.stream().map(ClassGradeGoods::getGradeId).collect(Collectors.toList()));
|
|
|
+// //获取当前机构商品下的班级
|
|
|
+// List<ClassGradeGoods> gradeGoods = iClassGradeGoodsService.getGradeGoodsList(goods.getGoodsId());
|
|
|
+// if (gradeGoods.size() < listGrade.size()) {
|
|
|
+// ClassGrade grade = listGrade.get(gradeGoods.size());
|
|
|
+// if (checkEjjjPeopleNumLimit(business.getId(), grade.getGradeId())) {
|
|
|
+// add.setOfficialName(listGrade.get(gradeGoods.size()).getOfficialName());
|
|
|
+// add.setClassStatus(0);
|
|
|
+// } else {
|
|
|
+// add.setOfficialName(ServletUtils.getEncoded("PIY"));
|
|
|
+// add.setClassStatus(0);
|
|
|
+// }
|
|
|
+// }
|
|
|
+// }
|
|
|
+// }
|
|
|
+//
|
|
|
+// if (StringUtils.isBlank(add.getOfficialName())) {
|
|
|
+// List<CourseSubject> courseSubjectList = iCourseSubjectService.listByIds(Arrays.asList(goods.getSubjectIds().split(",")));
|
|
|
+// List<String> subNames = courseSubjectList.stream().map(CourseSubject::getSubjectName).collect(Collectors.toList());
|
|
|
+// List<Long> subIds = iCourseSubjectService.getIdsByTenant(subNames);
|
|
|
+// //获取业务层次下所有班级
|
|
|
+// ClassGradeListBo bgListBo = new ClassGradeListBo();
|
|
|
+// bgListBo.setAliasName(business.getAliasName());
|
|
|
+// bgListBo.setSubIds(subIds);
|
|
|
+// List<ClassGrade> classGrades = baseMapper.getGradeListByTenant(bgListBo);
|
|
|
+// if (CollectionUtils.isEmpty(classGrades)) {
|
|
|
+// //生成预报名官方编号
|
|
|
+// add.setOfficialName(ServletUtils.getEncoded("PIY"));
|
|
|
+// add.setClassStatus(0);
|
|
|
+// } else {
|
|
|
+// //获取班级创建最多的机构
|
|
|
+// Map<Long, List<ClassGrade>> map = classGrades.stream().collect(Collectors.groupingBy(ClassGrade::getTenantId));
|
|
|
+// List<ClassGradeSortBo> sortList = new ArrayList<>();
|
|
|
+// map.forEach((k, v) -> {
|
|
|
+// ClassGradeSortBo sortBo = new ClassGradeSortBo();
|
|
|
+// sortBo.setKey(k);
|
|
|
+// Map<String, List<ClassGrade>> collect = v.stream().collect(Collectors.groupingBy(ClassGrade::getOfficialName));
|
|
|
+// sortBo.setSize(collect.keySet().size());
|
|
|
+// sortList.add(sortBo);
|
|
|
+// });
|
|
|
+// ClassGradeSortBo sortBo = sortList.stream().sorted(Comparator.comparing(ClassGradeSortBo::getSize).reversed()).findFirst().orElse(null);
|
|
|
+// List<ClassGrade> classGradesMax = map.get(sortBo.getKey()).stream().sorted(Comparator.comparing(ClassGrade::getCreateTime)).collect(Collectors.toList());
|
|
|
+// //去重
|
|
|
+// List<String> codeStrs = new ArrayList<>();
|
|
|
+// for (ClassGrade gradesMax : classGradesMax) {
|
|
|
+// if (codeStrs.contains(gradesMax.getOfficialName())) {
|
|
|
+// continue;
|
|
|
+// }
|
|
|
+// codeStrs.add(gradesMax.getOfficialName());
|
|
|
+// }
|
|
|
+// //获取当前机构商品下的班级
|
|
|
+// List<ClassGradeGoods> gradeGoods = iClassGradeGoodsService.getGradeGoodsList(goodsId);
|
|
|
+// if (gradeGoods.size() < codeStrs.size()) {
|
|
|
+// add.setOfficialName(codeStrs.get(gradeGoods.size()));
|
|
|
+// add.setClassStatus(0);
|
|
|
+// } else {
|
|
|
+// //生成预报名官方编号
|
|
|
+// add.setOfficialName(ServletUtils.getEncoded("PIY"));
|
|
|
+// add.setClassStatus(0);
|
|
|
+// }
|
|
|
+// }
|
|
|
+// }
|
|
|
+// }
|
|
|
+// }
|
|
|
boolean save = this.save(add);
|
|
|
|
|
|
//添加班级商品
|
|
@@ -445,42 +445,42 @@ public class ClassGradeServiceImpl extends ServiceImpl<ClassGradeMapper, ClassGr
|
|
|
classGradeSysService.save(classGradeSys);
|
|
|
}
|
|
|
|
|
|
-// if (erJfalg && bo.getClassGradeGoodsAddBos() != null){
|
|
|
-// //二建继教班级创建,所有共享班级机构同步创建
|
|
|
-// synchronousCreation(add,sysTenant,bo.getClassGradeGoodsAddBos()[0]);
|
|
|
-// //通知旧系统
|
|
|
-// CreateSameClassBo classBo = new CreateSameClassBo();
|
|
|
-// if (ObjectUtils.isNotNull(bo.getClassStatus()) && bo.getClassStatus() == 1){
|
|
|
-// classBo.setClassNo(add.getOfficialName());
|
|
|
-// classBo.setOpenclassState(1);
|
|
|
-// classBo.setBeginTime(DateUtils.timestampToDateFormat(add.getClassStartTime(),"yyyy-MM-dd HH:mm:ss"));
|
|
|
-// classBo.setEndTime(DateUtils.timestampToDateFormat(add.getClassEndTime(),"yyyy-MM-dd HH:mm:ss"));
|
|
|
-// }else {
|
|
|
-// classBo.setClassNo(add.getOfficialName());
|
|
|
-// classBo.setOpenclassState(0);
|
|
|
-// }
|
|
|
-// classBo.setCategoryName(add.getClassName());
|
|
|
-// classBo.setPlatformId(ezJfalg?8:5);
|
|
|
-// Goods goods = iGoodsService.getById(bo.getClassGradeGoodsAddBos()[0]);
|
|
|
-// Major major = iMajorService.getById(goods.getMajorId());
|
|
|
-// if (ObjectUtils.isNotNull(major)){
|
|
|
-// classBo.setMajorName(major.getCategoryName());
|
|
|
-// }
|
|
|
-// Long nowTime = DateUtils.getNowTime();
|
|
|
-// String sign = ToolsUtils.EncoderByMd5(classBo.getClassNo()+nowTime.toString() + "pubilc2022");
|
|
|
-// classBo.setSign(sign);
|
|
|
-// classBo.setStamp(nowTime);
|
|
|
-// JSONObject param = JSONObject.parseObject(JSONObject.toJSONString(classBo));
|
|
|
-// String respone = "";
|
|
|
-// try {
|
|
|
-// respone = HttpUtils.sendPost(CREATE_EXAM_PATH, param);
|
|
|
-// if (!respone.contains("\"Status\":true")) {
|
|
|
-// throw new CustomException("旧系统创建班级错误" + respone);
|
|
|
-// }
|
|
|
-// } catch (Exception e) {
|
|
|
-// throw new CustomException("旧系统创建班级错误" + e.getMessage());
|
|
|
-// }
|
|
|
-// }
|
|
|
+ if (erJfalg && bo.getClassGradeGoodsAddBos() != null){
|
|
|
+ //二建继教班级创建,所有共享班级机构同步创建
|
|
|
+ synchronousCreation(add,sysTenant,bo.getClassGradeGoodsAddBos()[0]);
|
|
|
+ //通知旧系统
|
|
|
+ CreateSameClassBo classBo = new CreateSameClassBo();
|
|
|
+ if (ObjectUtils.isNotNull(bo.getClassStatus()) && bo.getClassStatus() == 1){
|
|
|
+ classBo.setClassNo(add.getOfficialName());
|
|
|
+ classBo.setOpenclassState(1);
|
|
|
+ classBo.setBeginTime(DateUtils.timestampToDateFormat(add.getClassStartTime(),"yyyy-MM-dd HH:mm:ss"));
|
|
|
+ classBo.setEndTime(DateUtils.timestampToDateFormat(add.getClassEndTime(),"yyyy-MM-dd HH:mm:ss"));
|
|
|
+ }else {
|
|
|
+ classBo.setClassNo(add.getOfficialName());
|
|
|
+ classBo.setOpenclassState(0);
|
|
|
+ }
|
|
|
+ classBo.setCategoryName(add.getClassName());
|
|
|
+ classBo.setPlatformId(ezJfalg?8:5);
|
|
|
+ Goods goods = iGoodsService.getById(bo.getClassGradeGoodsAddBos()[0]);
|
|
|
+ Major major = iMajorService.getById(goods.getMajorId());
|
|
|
+ if (ObjectUtils.isNotNull(major)){
|
|
|
+ classBo.setMajorName(major.getCategoryName());
|
|
|
+ }
|
|
|
+ Long nowTime = DateUtils.getNowTime();
|
|
|
+ String sign = ToolsUtils.EncoderByMd5(classBo.getClassNo()+nowTime.toString() + "pubilc2022");
|
|
|
+ classBo.setSign(sign);
|
|
|
+ classBo.setStamp(nowTime);
|
|
|
+ JSONObject param = JSONObject.parseObject(JSONObject.toJSONString(classBo));
|
|
|
+ String respone = "";
|
|
|
+ try {
|
|
|
+ respone = HttpUtils.sendPost(CREATE_EXAM_PATH, param);
|
|
|
+ if (!respone.contains("\"Status\":true")) {
|
|
|
+ throw new CustomException("旧系统创建班级错误" + respone);
|
|
|
+ }
|
|
|
+ } catch (Exception e) {
|
|
|
+ throw new CustomException("旧系统创建班级错误" + e.getMessage());
|
|
|
+ }
|
|
|
+ }
|
|
|
|
|
|
return save;
|
|
|
}
|
|
@@ -720,7 +720,8 @@ public class ClassGradeServiceImpl extends ServiceImpl<ClassGradeMapper, ClassGr
|
|
|
|
|
|
ClassGradeOpenBo openBo = new ClassGradeOpenBo();
|
|
|
openBo.setOfficialName(grade.getOfficialName());
|
|
|
- openBo.setRegisterCode(grade.getRegisterCode());
|
|
|
+// openBo.setRegisterCode(grade.getRegisterCode());
|
|
|
+ openBo.setRegisterCode(officialName);
|
|
|
openBo.setClassName(grade.getClassName());
|
|
|
openBo.setClassStartTime(grade.getClassStartTime());
|
|
|
openBo.setClassEndTime(grade.getClassEndTime());
|
|
@@ -1519,7 +1520,7 @@ public class ClassGradeServiceImpl extends ServiceImpl<ClassGradeMapper, ClassGr
|
|
|
}
|
|
|
List<Long> ids = list.stream().map(ClassGrade::getGradeId).collect(Collectors.toList());
|
|
|
// //保留预报名编号
|
|
|
- baseMapper.UpGradeCodeByIdTenant(ids);
|
|
|
+// baseMapper.UpGradeCodeByIdTenant(ids);
|
|
|
|
|
|
ClassGradeOpenUpBo openUpBo = new ClassGradeOpenUpBo();
|
|
|
openUpBo.setGradeIds(ids);
|