|
@@ -139,15 +139,13 @@ public class ExamNumberServiceImpl extends ServiceImpl<ExamNumberMapper, ExamNum
|
|
|
}
|
|
|
if (bo.getGoodsId() != null){
|
|
|
for (Long goodsId : bo.getGoodsId()) {
|
|
|
- if (bo.getStatus() == 1) {
|
|
|
- Integer integer = baseMapper.selectExam(goodsId);
|
|
|
- if (integer > 0) {
|
|
|
- throw new IllegalArgumentException("当前商品已启用考次配置,不可开启,请重新创建新的配置考试次数和前培次数商品");
|
|
|
- }
|
|
|
+ Integer integer = baseMapper.selectExam(goodsId,update.getExamNumberId());
|
|
|
+ if (bo.getStatus() == 1 && integer > 0) {
|
|
|
+ throw new IllegalArgumentException("当前商品已启用考次配置,不可开启,请重新创建新的配置考试次数和前培次数商品");
|
|
|
}
|
|
|
if (bo.getStatus() == -1 || bo.getStatus()==0){
|
|
|
- Integer integer = baseMapper.selectApply(goodsId);
|
|
|
- if (integer > 0) {
|
|
|
+ Integer apply = baseMapper.selectApply(goodsId);
|
|
|
+ if (apply > 0) {
|
|
|
throw new IllegalArgumentException("当前商品已启用考试安排,不可关闭");
|
|
|
}
|
|
|
}
|