Forráskód Böngészése

submit:班级新增

yangdamao 2 éve
szülő
commit
95a37d229b

+ 1 - 0
zhongzheng-admin/src/main/java/com/zhongzheng/controller/goods/GoodsController.java

@@ -366,4 +366,5 @@ public class GoodsController extends BaseController {
     public AjaxResult<Void> updateGoodsRepair(@RequestBody UpdateGoodsRepairBo bo) {
         return toAjax(iGoodsService.updateGoodsRepair(bo) ? 1 : 0);
     }
+
 }

+ 13 - 0
zhongzheng-system/src/main/java/com/zhongzheng/modules/grade/service/impl/ClassGradeServiceImpl.java

@@ -236,6 +236,19 @@ public class ClassGradeServiceImpl extends ServiceImpl<ClassGradeMapper, ClassGr
         if (CollectionUtils.isNotEmpty(list)) {
             throw new RuntimeException("班级名称不能重复");
         }
+        //校验是否二建/二造商品创建班级
+        if (bo.getClassGradeGoodsAddBos() != null &&
+                (ObjectUtils.isNull(bo.getClassStatus()) || 1 == bo.getClassStatus())) {
+            Long goodsId = bo.getClassGradeGoodsAddBos()[0];
+            Goods goods = iGoodsService.getById(goodsId);
+            CourseBusinessQueryBo businessQueryBo = new CourseBusinessQueryBo();
+            businessQueryBo.setId(goods.getBusinessId());
+            String fullName = iCourseBusinessService.queryFullName(businessQueryBo);
+            if (("继续教育二级建造师".equals(fullName)) || ("继续教育二级造价师".equals(fullName))) {
+                throw new CustomException("二建/二造不允许直接创建开班班级!");
+            }
+        }
+
         //是否创建官方班级编号
         if (bo.getClassGradeGoodsAddBos() != null &&
                 (ObjectUtils.isNull(bo.getClassStatus()) || 0 == bo.getClassStatus())) {