| | |
| | | if(process == null || !process.proId.equals(plan.proId)){ |
| | | throw new RuntimeException("产品与生产流程不匹配"); |
| | | } |
| | | PrAssemblyPlan origPlan = assemblyDao.selectByPrimaryKey(plan.id); |
| | | PrBatchNumber batch = batchDao.selectByPrimaryKey(origPlan.batchId); |
| | | //如果有投入,产品和流程不能变更 |
| | | if(origPlan.getInputNumber() > 0){ |
| | | if(!origPlan.proId.equals(plan.proId) || !origPlan.processId.equals(plan.processId)){ |
| | | throw new RuntimeException("计划已投入,产品与生产流程不能变更"); |
| | | } |
| | | } |
| | | //Fancy add 2024/07/09 如果状态为执行 ,则结束日期必须大于等于当前日期 |
| | | if(plan.status == PlanStatusEnum.NORMAL.getCode()){ |
| | | String endDateStr = plan.getEndDate(); |
| | |
| | | throw new RuntimeException("执行状态结束日期必须大于等于当前日期"); |
| | | } |
| | | } |
| | | PrAssemblyPlan origPlan = assemblyDao.selectByPrimaryKey(plan.id); |
| | | PrBatchNumber batch = batchDao.selectByPrimaryKey(origPlan.batchId); |
| | | |
| | | //产品改变则更新全部已生成设备号 |
| | | if(origPlan.proId != plan.proId){ |
| | | batch.proId = plan.proId; |