|
|
@@ -132,28 +132,15 @@ public class ExamNumberServiceImpl extends ServiceImpl<ExamNumberMapper, ExamNum
|
|
|
examNumberGoodsService.remove(lqw);
|
|
|
for (Long goodsId : bo.getGoodsId()) {
|
|
|
if (bo.getStatus() == 1) {
|
|
|
- ExamNumberQueryBo examNumberQueryBo = new ExamNumberQueryBo();
|
|
|
- List<Integer> status = new ArrayList<>();
|
|
|
- status.add(1);
|
|
|
- examNumberQueryBo.setStatus(status);
|
|
|
- examNumberQueryBo.setGoodsId(goodsId);
|
|
|
- List<ExamNumberVo> examNumberVos = baseMapper.ListExamNumber(examNumberQueryBo);
|
|
|
- if (CollectionUtils.isNotEmpty(examNumberVos)) {
|
|
|
+ Integer integer = baseMapper.selectExam(goodsId);
|
|
|
+ if (integer > 0) {
|
|
|
throw new IllegalArgumentException("当前商品已启用考次配置,不可开启,请重新创建新的配置考试次数和前培次数商品");
|
|
|
}
|
|
|
}
|
|
|
if (bo.getStatus() == -1 || bo.getStatus()==1){
|
|
|
- ExamNumberGoodsQueryBo examNumberGoodsQueryBo = new ExamNumberGoodsQueryBo();
|
|
|
- List<Integer> status = new ArrayList<>();
|
|
|
- status.add(1);
|
|
|
- examNumberGoodsQueryBo.setGoodsId(goodsId);
|
|
|
- List<ExamNumberGoodsVo> examNumberGoodsVos = examApplyMapper.listGoods(examNumberGoodsQueryBo);
|
|
|
- if (CollectionUtils.isNotEmpty(examNumberGoodsVos)){
|
|
|
- for (ExamNumberGoodsVo examNumberGoodsVo : examNumberGoodsVos) {
|
|
|
- if (examNumberGoodsVo.getGoodsStatus() == 0){
|
|
|
- throw new IllegalArgumentException("当前商品已启用考试安排,不可开启或关闭");
|
|
|
- }
|
|
|
- }
|
|
|
+ Integer integer = baseMapper.selectApply(goodsId);
|
|
|
+ if (integer > 0) {
|
|
|
+ throw new IllegalArgumentException("当前商品已启用考试安排,不可开启");
|
|
|
}
|
|
|
}
|
|
|
ExamNumberGoodsAddBo examNumberGoodsAddBo = new ExamNumberGoodsAddBo();
|