Эх сурвалжийг харах

submit:二建班级限制提交

yangdamao 2 жил өмнө
parent
commit
17577f8917

+ 4 - 2
zhongzheng-system/src/main/java/com/zhongzheng/modules/grade/service/impl/ClassGradeServiceImpl.java

@@ -248,6 +248,8 @@ public class ClassGradeServiceImpl extends ServiceImpl<ClassGradeMapper, ClassGr
                     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){
@@ -272,9 +274,9 @@ public class ClassGradeServiceImpl extends ServiceImpl<ClassGradeMapper, ClassGr
                             //获取当前机构商品下的班级
                             List<ClassGradeGoods> gradeGoods = iClassGradeGoodsService.getGradeGoodsList(goods.getGoodsId());
                             if (gradeGoods.size() < listGrade.size()) {
-                                ClassGrade grade = list.get(gradeGoods.size());
+                                ClassGrade grade = listGrade.get(gradeGoods.size());
                                 if (checkEjjjPeopleNumLimit(business.getId(),grade.getGradeId())){
-                                    add.setOfficialName(list.get(gradeGoods.size()).getOfficialName());
+                                    add.setOfficialName(listGrade.get(gradeGoods.size()).getOfficialName());
                                     add.setClassStatus(0);
                                 }else {
                                     add.setOfficialName(ServletUtils.getEncoded("PIY"));

+ 11 - 2
zhongzheng-system/src/main/java/com/zhongzheng/modules/order/service/impl/OrderServiceImpl.java

@@ -20,6 +20,7 @@ import com.zhongzheng.modules.bank.domain.QuestionChapterExam;
 import com.zhongzheng.modules.base.bo.ConsoleQueryBo;
 import com.zhongzheng.modules.base.service.IProfileTpService;
 import com.zhongzheng.modules.base.service.IShoppingCartService;
+import com.zhongzheng.modules.course.bo.CourseBusinessQueryBo;
 import com.zhongzheng.modules.course.bo.CourseMenuQueryBo;
 import com.zhongzheng.modules.course.domain.CourseBusiness;
 import com.zhongzheng.modules.course.domain.CourseEducationType;
@@ -1742,8 +1743,14 @@ public class OrderServiceImpl extends ServiceImpl<OrderMapper, Order> implements
             classGrade.setClassStatus(0);
             classGrade.setLearningStatus(2);//待定
             classGrade.setStudentUpper(ClassGrade.INIT_UPPER); //上限300
-            //生成预开班编号
-            classGrade.setOfficialName( createGradeCode(goodsId,businessVo));
+
+            CourseBusinessQueryBo businessQueryBo = new CourseBusinessQueryBo();
+            businessQueryBo.setId(businessId);
+            String fullName = iCourseBusinessService.queryFullName(businessQueryBo);
+            if (("继续教育二级建造师".equals(fullName)) || ("继续教育二级造价师".equals(fullName))) {
+                //生成预开班编号
+                classGrade.setOfficialName(createGradeCode(goodsId, businessVo));
+            }
         } else {
             classGrade.setLearningStatus(1);//即刻
             classGrade.setStudentUpper(ClassGrade.INIT_UPPER2); //上限1000000
@@ -1802,6 +1809,8 @@ public class OrderServiceImpl extends ServiceImpl<OrderMapper, Order> implements
             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){

+ 1 - 1
zhongzheng-system/src/main/resources/mapper/modules/grade/ClassGradeMapper.xml

@@ -990,7 +990,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             LEFT JOIN goods g ON cgg.goods_id = g.goods_id
             LEFT JOIN course_business cb ON g.business_id = cb.id
         WHERE
-            cb.alias_name = #{aliasName} AND cg.class_status = 0 AND cg.`status` = 1 AND g.goods_status = 1 AND cb.`status` = 1
+            cb.alias_name = #{aliasName} AND cg.class_status = 0 AND cg.`status` = 1 AND g.goods_status = 1 AND cb.`status` = 1 AND g.`status` = 1
         <if test="subIds != null and subIds.size()!=0 ">
             AND (
             <foreach collection="subIds" item="id" index="index">