|
@@ -90,9 +90,10 @@ public class InspectionController extends SuperController<InspectionService, Lon
|
|
|
//在当前零件加工工序之后
|
|
|
wrapper.le(BomProcedure::getSort, sort);
|
|
|
}
|
|
|
- Long existProcedureId = baseService.getOne(new LbqWrapper<Inspection>().eq(Inspection::getWorkpieceId,workPiece.getId())).getProcedureId();
|
|
|
- if(null!= existProcedureId){
|
|
|
- wrapper.ne(BomProcedure::getId, existProcedureId);
|
|
|
+ Inspection inspection = baseService.getOne(new LbqWrapper<Inspection>().eq(Inspection::getWorkpieceId,workPiece.getId()));
|
|
|
+ //排除已经提交抽检的工序
|
|
|
+ if(null!= inspection && null!=inspection.getProcedureId()){
|
|
|
+ wrapper.ne(BomProcedure::getId, inspection.getProcedureId());
|
|
|
}
|
|
|
}
|
|
|
|
|
@@ -108,6 +109,9 @@ public class InspectionController extends SuperController<InspectionService, Lon
|
|
|
@PostMapping("/save")
|
|
|
public R<Inspection> save(@RequestBody InspectionSaveDTO model) {
|
|
|
Inspection inspection = BeanUtil.toBean(model, Inspection.class);
|
|
|
- return baseService.save(inspection)? success(inspection) : success(null);
|
|
|
+ if(baseService.check(model)) {
|
|
|
+ return baseService.save(inspection) ? success(inspection) : fail("新增失败");
|
|
|
+ }
|
|
|
+ return fail("新增条件判断失败");
|
|
|
}
|
|
|
}
|