|
@@ -271,8 +271,14 @@ public class ClassGradeServiceImpl extends ServiceImpl<ClassGradeMapper, ClassGr
|
|
//获取当前机构商品下的班级
|
|
//获取当前机构商品下的班级
|
|
List<ClassGradeGoods> gradeGoods = iClassGradeGoodsService.getGradeGoodsList(goods.getGoodsId());
|
|
List<ClassGradeGoods> gradeGoods = iClassGradeGoodsService.getGradeGoodsList(goods.getGoodsId());
|
|
if (gradeGoods.size() < listGrade.size()) {
|
|
if (gradeGoods.size() < listGrade.size()) {
|
|
- add.setOfficialName(list.get(gradeGoods.size()).getOfficialName());
|
|
|
|
- add.setClassStatus(0);
|
|
|
|
|
|
+ ClassGrade grade = list.get(gradeGoods.size());
|
|
|
|
+ if (checkEjjjPeopleNumLimit(business.getId(),grade.getGradeId())){
|
|
|
|
+ add.setOfficialName(list.get(gradeGoods.size()).getOfficialName());
|
|
|
|
+ add.setClassStatus(0);
|
|
|
|
+ }else {
|
|
|
|
+ add.setOfficialName(ServletUtils.getEncoded("PIY"));
|
|
|
|
+ add.setClassStatus(0);
|
|
|
|
+ }
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
@@ -371,7 +377,7 @@ public class ClassGradeServiceImpl extends ServiceImpl<ClassGradeMapper, ClassGr
|
|
throw new RuntimeException("班级商品信息查询失败");
|
|
throw new RuntimeException("班级商品信息查询失败");
|
|
}
|
|
}
|
|
Goods goods = iGoodsService.getById(gradeGoods.getGoodsId());
|
|
Goods goods = iGoodsService.getById(gradeGoods.getGoodsId());
|
|
- if (!checkEjjjPeopleNumLimit(goods.getBusinessId(),update.getGradeId())){
|
|
|
|
|
|
+ if (!checkClassUserNum(goods.getBusinessId(),update.getGradeId())){
|
|
throw new RuntimeException("班级人数超过上限,不能开班,请检查!");
|
|
throw new RuntimeException("班级人数超过上限,不能开班,请检查!");
|
|
}
|
|
}
|
|
|
|
|
|
@@ -963,7 +969,52 @@ public class ClassGradeServiceImpl extends ServiceImpl<ClassGradeMapper, ClassGr
|
|
log.info("查询业务系统班级人数失败参数" + params, "");
|
|
log.info("查询业务系统班级人数失败参数" + params, "");
|
|
throw new CustomException("同步查询班级人数请求错误" + e.getMessage());
|
|
throw new CustomException("同步查询班级人数请求错误" + e.getMessage());
|
|
}
|
|
}
|
|
- if ((peopleNum + oldGradeNum) >= 5) { //全系统平台二建班级人数不能超300
|
|
|
|
|
|
+ if ((peopleNum + oldGradeNum) >= 7) { //全系统平台二建班级人数不能超300
|
|
|
|
+ return false;
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ }
|
|
|
|
+ return true;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+ @Override
|
|
|
|
+ public boolean checkClassUserNum(Long businessId, Long gradeId) {
|
|
|
|
+ CourseBusinessQueryBo businessQueryBo = new CourseBusinessQueryBo();
|
|
|
|
+ businessQueryBo.setId(businessId);
|
|
|
|
+ String fullName = iCourseBusinessService.queryFullName(businessQueryBo);
|
|
|
|
+ if (("继续教育二级建造师".equals(fullName)) || ("继续教育二级造价师".equals(fullName))) {
|
|
|
|
+ //继教二建或者继教二造班级
|
|
|
|
+ ClassGradeVo gradeVo = queryById(gradeId);
|
|
|
|
+ if (Validator.isNotEmpty(gradeVo) && Validator.isNotEmpty(gradeVo.getOfficialName())) {
|
|
|
|
+ ClassGradeQueryBo queryBo = new ClassGradeQueryBo();
|
|
|
|
+ queryBo.setOfficialName(gradeVo.getOfficialName());
|
|
|
|
+ Integer peopleNum = queryOfficialGradeCount(queryBo);
|
|
|
|
+ //查询旧系统
|
|
|
|
+ Map<String, String> params = new HashMap<>();
|
|
|
|
+ Long nowTime = DateUtils.getNowTime();
|
|
|
|
+ String sign = ToolsUtils.EncoderByMd5(nowTime.toString() + "pubilc2022");
|
|
|
|
+ params.put("stamp", nowTime.toString());
|
|
|
|
+ params.put("sign", sign);
|
|
|
|
+ params.put("jsonstr", gradeVo.getOfficialName());
|
|
|
|
+ String respone = "";
|
|
|
|
+ Integer oldGradeNum = 0;
|
|
|
|
+ try {
|
|
|
|
+ respone = HttpUtils.postFormBody(GRADE_COUNT_PATH, params);
|
|
|
|
+ log.info("查询业务系统班级人数结果" + respone, "");
|
|
|
|
+ if (!respone.contains("\"Status\":true")) {
|
|
|
|
+ throw new CustomException("同步请求错误" + respone);
|
|
|
|
+ }
|
|
|
|
+ JSONObject jsonObject = (JSONObject) JSONObject.parse(respone);
|
|
|
|
+ JSONArray dataArray = jsonObject.getJSONArray("Data");
|
|
|
|
+ JSONObject fObject = dataArray.getJSONObject(0);
|
|
|
|
+ oldGradeNum = (Integer) fObject.get("num");
|
|
|
|
+ } catch (IOException e) {
|
|
|
|
+ log.info("查询业务系统班级人数失败参数" + params, "");
|
|
|
|
+ throw new CustomException("同步查询班级人数请求错误" + e.getMessage());
|
|
|
|
+ }
|
|
|
|
+ if ((peopleNum + oldGradeNum) > 7) { //全系统平台二建班级人数不能超300
|
|
return false;
|
|
return false;
|
|
}
|
|
}
|
|
}
|
|
}
|