|
|
@ -155,12 +155,15 @@ public class ProductionMainServiceImpl implements ProductionMainService { |
|
|
|
|
|
|
|
@Override |
|
|
|
@Transactional |
|
|
|
public void updateProductionMain(ProductionMainUpdateReqVO updateReqVO) { |
|
|
|
public Integer updateProductionMain(ProductionMainUpdateReqVO updateReqVO) { |
|
|
|
// 校验存在
|
|
|
|
validateProductionMainExists(updateReqVO.getId()); |
|
|
|
// 更新
|
|
|
|
ProductionMainDO updateObj = ProductionMainConvert.INSTANCE.convert(updateReqVO); |
|
|
|
productionMainMapper.updateById(updateObj); |
|
|
|
this.validateProductionMainUpdate(updateObj); |
|
|
|
//增加操作记录
|
|
|
|
trendsApi.createTrends(updateObj.getId(), "productionMain", "更新了生产计划", TrendsTypeEnum.UPDATE); |
|
|
|
return productionMainMapper.updateById(updateObj); |
|
|
|
} |
|
|
|
|
|
|
|
@Override |
|
|
@ -260,6 +263,23 @@ public class ProductionMainServiceImpl implements ProductionMainService { |
|
|
|
bomService.bomItemCodeAndVersionExist(detailDo.getItemCode(), detailDo.getBomVersion()); |
|
|
|
} |
|
|
|
|
|
|
|
private void validateProductionMainUpdate(ProductionMainDO mainDo) { |
|
|
|
// 校验车间 基础信息
|
|
|
|
workshopService.selectWorkshopExist(mainDo.getWorkshop()); |
|
|
|
// 校验生产线基础信息
|
|
|
|
productionlineService.productionLineCodeExist(mainDo.getProductionLine()); |
|
|
|
// 校验班组基础信息
|
|
|
|
teamService.selectTeamExist(mainDo.getTeam()); |
|
|
|
// 校验班次基础信息
|
|
|
|
shiftService.selectShiftExist(mainDo.getShift()); |
|
|
|
// 校验生产线和物品关系
|
|
|
|
// productionlineitemService.productionLineCodeAndpItemCodeExist(mainDo.getProductionLine(), detailDo.getItemCode());
|
|
|
|
// 校验物品和bom关系
|
|
|
|
// bomService.bomItemCodeAndVersionExist(detailDo.getItemCode(), detailDo.getBomVersion());
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
* 主表校验导入 |
|
|
|
* @param mainDo |
|
|
|