|
@@ -98,21 +98,23 @@ public class ExamApplyServiceImpl extends ServiceImpl<ExamApplyMapper, ExamApply
|
|
|
ExamApply update = BeanUtil.toBean(bo, ExamApply.class);
|
|
ExamApply update = BeanUtil.toBean(bo, ExamApply.class);
|
|
|
if (bo.getStatus() == 1){
|
|
if (bo.getStatus() == 1){
|
|
|
List<Long> contGoodsId = baseMapper.countGoods(bo.getApplyId());
|
|
List<Long> contGoodsId = baseMapper.countGoods(bo.getApplyId());
|
|
|
|
|
+ if (CollectionUtils.isEmpty(contGoodsId)){
|
|
|
|
|
+ throw new RuntimeException("请先设置适用商品");
|
|
|
|
|
+ }
|
|
|
List<ExamApplySiteVo> examApplySite = baseMapper.addressExam(bo.getApplyId(),1L);
|
|
List<ExamApplySiteVo> examApplySite = baseMapper.addressExam(bo.getApplyId(),1L);
|
|
|
if (CollectionUtils.isEmpty(examApplySite)){
|
|
if (CollectionUtils.isEmpty(examApplySite)){
|
|
|
throw new RuntimeException("请先设置考试地点和时间");
|
|
throw new RuntimeException("请先设置考试地点和时间");
|
|
|
}
|
|
}
|
|
|
- if (CollectionUtils.isNotEmpty(contGoodsId)){
|
|
|
|
|
|
|
+ List<Long> contGoods = baseMapper.countGoodsHold(bo.getApplyId());
|
|
|
|
|
+ if (CollectionUtils.isNotEmpty(contGoods)){
|
|
|
String goodsName ="";
|
|
String goodsName ="";
|
|
|
- for (Long goodsId : contGoodsId) {
|
|
|
|
|
|
|
+ for (Long goodsId : contGoods) {
|
|
|
ExamNumberGoodsQueryBo examNumberGoodsQueryBo = new ExamNumberGoodsQueryBo();
|
|
ExamNumberGoodsQueryBo examNumberGoodsQueryBo = new ExamNumberGoodsQueryBo();
|
|
|
examNumberGoodsQueryBo.setGoodsId(goodsId);
|
|
examNumberGoodsQueryBo.setGoodsId(goodsId);
|
|
|
List<ExamNumberGoodsVo> examNumberGoodsVos = this.listGoods(examNumberGoodsQueryBo);
|
|
List<ExamNumberGoodsVo> examNumberGoodsVos = this.listGoods(examNumberGoodsQueryBo);
|
|
|
goodsName.concat(examNumberGoodsVos.get(0).getGoodsName()+",");
|
|
goodsName.concat(examNumberGoodsVos.get(0).getGoodsName()+",");
|
|
|
}
|
|
}
|
|
|
throw new RuntimeException(goodsName+"已被其他进行中的考试计划使用,请修改,再启用");
|
|
throw new RuntimeException(goodsName+"已被其他进行中的考试计划使用,请修改,再启用");
|
|
|
- }else {
|
|
|
|
|
- throw new RuntimeException("请先设置适用商品");
|
|
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
validEntityBeforeSave(update);
|
|
validEntityBeforeSave(update);
|