|
|
@@ -138,9 +138,6 @@ public class ExamNumberServiceImpl extends ServiceImpl<ExamNumberMapper, ExamNum
|
|
|
throw new IllegalArgumentException("前培次数不能小于更改前");
|
|
|
}
|
|
|
if (bo.getGoodsId() != null){
|
|
|
- LambdaQueryWrapper<ExamNumberGoods> lqw = Wrappers.lambdaQuery();
|
|
|
- lqw.eq(ExamNumberGoods::getExamNumberId, bo.getExamNumberId());
|
|
|
- examNumberGoodsService.remove(lqw);
|
|
|
for (Long goodsId : bo.getGoodsId()) {
|
|
|
if (bo.getStatus() == 1) {
|
|
|
Integer integer = baseMapper.selectExam(goodsId);
|
|
|
@@ -148,12 +145,15 @@ public class ExamNumberServiceImpl extends ServiceImpl<ExamNumberMapper, ExamNum
|
|
|
throw new IllegalArgumentException("当前商品已启用考次配置,不可开启,请重新创建新的配置考试次数和前培次数商品");
|
|
|
}
|
|
|
}
|
|
|
- if (bo.getStatus() == -1 || bo.getStatus()==1){
|
|
|
+ if (bo.getStatus() == -1 || bo.getStatus()==0){
|
|
|
Integer integer = baseMapper.selectApply(goodsId);
|
|
|
if (integer > 0) {
|
|
|
- throw new IllegalArgumentException("当前商品已启用考试安排,不可开启");
|
|
|
+ throw new IllegalArgumentException("当前商品已启用考试安排,不可关闭");
|
|
|
}
|
|
|
}
|
|
|
+ LambdaQueryWrapper<ExamNumberGoods> lqw = Wrappers.lambdaQuery();
|
|
|
+ lqw.eq(ExamNumberGoods::getExamNumberId, bo.getExamNumberId());
|
|
|
+ examNumberGoodsService.remove(lqw);
|
|
|
ExamNumberGoodsAddBo examNumberGoodsAddBo = new ExamNumberGoodsAddBo();
|
|
|
examNumberGoodsAddBo.setGoodsId(goodsId);
|
|
|
examNumberGoodsAddBo.setExamNumberId(update.getExamNumberId());
|