|
@@ -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;
|
|
|
}
|
|
@@ -570,16 +570,14 @@ public class ClassGradeServiceImpl extends ServiceImpl<ClassGradeMapper, ClassGr
|
|
|
String officialName = classGrade.getOfficialName();//预开班班级编号
|
|
|
//企业ID
|
|
|
String tenant = ServletUtils.getRequest().getHeader("TenantId");
|
|
|
- SysOldOrg org = sysOldOrgService.list(new LambdaQueryWrapper<SysOldOrg>()
|
|
|
- .eq(SysOldOrg::getTenantId, tenant)
|
|
|
- .last("limit 1")).stream().findFirst().orElse(null);
|
|
|
+ SysTenant sysTenant = sysTenantService.getById(Long.valueOf(tenant));
|
|
|
|
|
|
Goods goods = iGoodsService.getById(gradeGoods.getGoodsId());
|
|
|
CourseBusinessQueryBo businessQueryBo = new CourseBusinessQueryBo();
|
|
|
businessQueryBo.setId(goods.getBusinessId());
|
|
|
String fullName = iCourseBusinessService.queryFullName(businessQueryBo);
|
|
|
|
|
|
- if ((("继续教育二级建造师".equals(fullName)) || ("继续教育二级造价师".equals(fullName)))&& org.getShareClass() == 1) {
|
|
|
+ if ((("继续教育二级建造师".equals(fullName)) || ("继续教育二级造价师".equals(fullName)))&& sysTenant.getShareClass() == 1) {
|
|
|
if (update.getClassStatus() != null && update.getClassStatus().equals(1)) {
|
|
|
//二造和二建班级开班校验班级人数(300人)
|
|
|
if (!checkClassUserNum(goods.getBusinessId(), update.getGradeId())) {
|
|
@@ -637,7 +635,7 @@ public class ClassGradeServiceImpl extends ServiceImpl<ClassGradeMapper, ClassGr
|
|
|
throw new RuntimeException("班级还有学员,无法设置为无效");
|
|
|
}
|
|
|
}
|
|
|
- if (StringUtils.isNotBlank(oldGrade.getOfficialName()) && org.getShareClass() == 1) {
|
|
|
+ if (StringUtils.isNotBlank(oldGrade.getOfficialName()) && sysTenant.getShareClass() == 1) {
|
|
|
throw new RuntimeException("二建/二造班级无法设置为无效,请联系技术人员!");
|
|
|
}
|
|
|
}
|
|
@@ -702,25 +700,13 @@ public class ClassGradeServiceImpl extends ServiceImpl<ClassGradeMapper, ClassGr
|
|
|
}
|
|
|
|
|
|
ClassGrade grade = getById(update.getGradeId());
|
|
|
- if ((("继续教育二级建造师".equals(fullName)) || ("继续教育二级造价师".equals(fullName))) && org.getShareClass() == 1) {
|
|
|
- if (ObjectUtils.isNotNull(grade) && ObjectUtils.isNotNull(grade.getClassStatus())
|
|
|
- && StringUtils.isNotBlank(grade.getOfficialName()) && grade.getClassStatus() == 1) {
|
|
|
-// List<ClassGrade> list = list(new LambdaQueryWrapper<ClassGrade>().eq(ClassGrade::getOfficialName, update.getRegisterCode()));
|
|
|
-// if (CollectionUtils.isNotEmpty(list)){
|
|
|
-// update(new LambdaUpdateWrapper<ClassGrade>()
|
|
|
-// .set(ClassGrade::getOfficialName,update.getOfficialName())
|
|
|
-// .set(ClassGrade::getRegisterCode,update.getRegisterCode())
|
|
|
-// .set(ClassGrade::getClassStartTime,update.getClassStartTime())
|
|
|
-// .set(ClassGrade::getClassEndTime,update.getClassEndTime())
|
|
|
-// .set(ClassGrade::getClassStatus,update.getClassStatus())
|
|
|
-// .set(ClassGrade::getLearningStatus,update.getLearningStatus())
|
|
|
-// .set(ClassGrade::getInterfacePushId,update.getInterfacePushId())
|
|
|
-// .in(ClassGrade::getGradeId,list.stream().map(ClassGrade::getGradeId).collect(Collectors.toList())));
|
|
|
-// }
|
|
|
+ if ((("继续教育二级建造师".equals(fullName)) || ("继续教育二级造价师".equals(fullName))) && sysTenant.getShareClass() == 1) {
|
|
|
+ if (StringUtils.isNotBlank(grade.getOfficialName()) && grade.getClassStatus() == 1) {
|
|
|
|
|
|
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());
|
|
@@ -1658,50 +1644,51 @@ public class ClassGradeServiceImpl extends ServiceImpl<ClassGradeMapper, ClassGr
|
|
|
return;
|
|
|
}
|
|
|
//班级是否存在
|
|
|
- ClassGrade grade = baseMapper.getCodeNoTenant(bo.getRegisterCode(),tenant.getTenantId());
|
|
|
- if (ObjectUtils.isNotNull(grade)){
|
|
|
- //已经存在 不创建
|
|
|
- return;
|
|
|
- }
|
|
|
- ClassGrade classGrade = new ClassGrade();
|
|
|
- classGrade.setCreateTime(DateUtils.getNowTime());
|
|
|
- if (bo.getClassStatus() == 1){
|
|
|
- //开班
|
|
|
- classGrade.setClassStatus(1);
|
|
|
- classGrade.setOfficialName(bo.getOfficialName());
|
|
|
- classGrade.setLearningStatus(1);
|
|
|
- classGrade.setClassStartTime(bo.getClassStartTime());
|
|
|
- classGrade.setClassEndTime(bo.getClassEndTime());
|
|
|
- //二建/二造官方信息推送开关打开
|
|
|
- List<ClassGradeInterface> interfaceList = iClassGradeInterfaceService
|
|
|
- .list(new LambdaQueryWrapper<ClassGradeInterface>()
|
|
|
- .eq(ClassGradeInterface::getType, 1).last("limit 1"));
|
|
|
- if (CollectionUtils.isNotEmpty(interfaceList)) {
|
|
|
- classGrade.setInterfacePushId(interfaceList.get(0).getId());
|
|
|
+ if (StringUtils.isNotBlank(bo.getRegisterCode())){
|
|
|
+ ClassGrade grade = baseMapper.getCodeNoTenant(bo.getRegisterCode(),tenant.getTenantId());
|
|
|
+ if (ObjectUtils.isNotNull(grade)){
|
|
|
+ //已经存在 不创建
|
|
|
+ return;
|
|
|
}
|
|
|
- }else {
|
|
|
- classGrade.setClassStatus(0);
|
|
|
- classGrade.setLearningStatus(2);//待定
|
|
|
}
|
|
|
- classGrade.setStudentUpper(ClassGrade.INIT_UPPER); //上限300
|
|
|
- classGrade.setUpdateTime(DateUtils.getNowTime());
|
|
|
- classGrade.setStatus(1);
|
|
|
- String gradeCode = ServletUtils.getEncoded("BJ");
|
|
|
- classGrade.setGradeCode(gradeCode);
|
|
|
- classGrade.setClassName(bo.getClassName());
|
|
|
- classGrade.setTenantId(tenant.getTenantId());
|
|
|
- classGrade.setRegisterCode(bo.getRegisterCode());
|
|
|
- save(classGrade);
|
|
|
- List<ClassGradeGoods> gradeGoods = relGoods.stream().map(item -> {
|
|
|
+ relGoods.forEach(item -> {
|
|
|
+ ClassGrade classGrade = new ClassGrade();
|
|
|
+ classGrade.setCreateTime(DateUtils.getNowTime());
|
|
|
+ if (bo.getClassStatus() == 1){
|
|
|
+ //开班
|
|
|
+ classGrade.setClassStatus(1);
|
|
|
+ classGrade.setOfficialName(bo.getOfficialName());
|
|
|
+ classGrade.setLearningStatus(1);
|
|
|
+ classGrade.setClassStartTime(bo.getClassStartTime());
|
|
|
+ classGrade.setClassEndTime(bo.getClassEndTime());
|
|
|
+ //二建/二造官方信息推送开关打开
|
|
|
+ List<ClassGradeInterface> interfaceList = iClassGradeInterfaceService
|
|
|
+ .list(new LambdaQueryWrapper<ClassGradeInterface>()
|
|
|
+ .eq(ClassGradeInterface::getType, 1).last("limit 1"));
|
|
|
+ if (CollectionUtils.isNotEmpty(interfaceList)) {
|
|
|
+ classGrade.setInterfacePushId(interfaceList.get(0).getId());
|
|
|
+ }
|
|
|
+ }else {
|
|
|
+ classGrade.setClassStatus(0);
|
|
|
+ classGrade.setLearningStatus(2);//待定
|
|
|
+ classGrade.setOfficialName(bo.getRegisterCode());
|
|
|
+ }
|
|
|
+ classGrade.setStudentUpper(ClassGrade.INIT_UPPER); //上限300
|
|
|
+ classGrade.setUpdateTime(DateUtils.getNowTime());
|
|
|
+ classGrade.setStatus(1);
|
|
|
+ String gradeCode = ServletUtils.getEncoded("BJ");
|
|
|
+ classGrade.setGradeCode(gradeCode);
|
|
|
+ classGrade.setClassName(bo.getClassName());
|
|
|
+ classGrade.setTenantId(tenant.getTenantId());
|
|
|
+ save(classGrade);
|
|
|
ClassGradeGoods classGradeGoods = new ClassGradeGoods();
|
|
|
classGradeGoods.setGradeId(classGrade.getGradeId());
|
|
|
classGradeGoods.setGoodsId(item.getGoodsId());
|
|
|
classGradeGoods.setCreateTime(DateUtils.getNowTime());
|
|
|
classGradeGoods.setUpdateTime(DateUtils.getNowTime());
|
|
|
classGradeGoods.setTenantId(tenant.getTenantId());
|
|
|
- return classGradeGoods;
|
|
|
- }).collect(Collectors.toList());
|
|
|
- iClassGradeGoodsService.saveBatch(gradeGoods);
|
|
|
+ iClassGradeGoodsService.save(classGradeGoods);
|
|
|
+ });
|
|
|
});
|
|
|
}
|
|
|
|