change il y a 3 ans
Parent
commit
e7a9ff3c62

+ 3 - 1
zhongzheng-system/src/main/java/com/zhongzheng/modules/exam/service/impl/ExamApplyServiceImpl.java

@@ -112,7 +112,9 @@ public class ExamApplyServiceImpl extends ServiceImpl<ExamApplyMapper, ExamApply
                     ExamNumberGoodsQueryBo examNumberGoodsQueryBo = new ExamNumberGoodsQueryBo();
                     examNumberGoodsQueryBo.setGoodsId(goodsId);
                     List<ExamNumberGoodsVo> examNumberGoodsVos = this.listGoods(examNumberGoodsQueryBo);
-                    goodsName.concat(examNumberGoodsVos.get(0).getGoodsName()+",");
+                    if(CollectionUtils.isNotEmpty(examNumberGoodsVos)) {
+                        goodsName.concat(examNumberGoodsVos.get(0).getGoodsName() + ",");
+                    }
                 }
                 throw new RuntimeException(goodsName+"已被其他进行中的考试计划使用,请修改,再启用");
             }

+ 0 - 9
zhongzheng-system/src/main/resources/mapper/modules/exam/ExamApplyMapper.xml

@@ -93,15 +93,6 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         FROM
             exam_apply ea
             LEFT JOIN exam_apply_goods eag ON ea.apply_id = eag.apply_id where ea.apply_id =#{applyId}
-           and (
-        SELECT
-            COUNT( eay.apply_id )
-        FROM
-            exam_apply eay
-                LEFT JOIN exam_apply_goods eags ON eay.apply_id = eags.apply_id
-        WHERE
-            eags.goods_id = eag.goods_id
-          AND eags.apply_id != eag.apply_id) > 0
 	</select>
 
     <select id="countGoodsHold" parameterType="long" resultType="long">