Fancy
2024-07-10 2bc94fed189ef2da4112f9f836343a6a579b93c6
pms-parent/pms-web-product/src/main/java/com/dy/pmsProduct/taskPlan/AssemblySv.java
@@ -106,7 +106,14 @@
        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();
@@ -117,8 +124,7 @@
                throw new RuntimeException("执行状态结束日期必须大于等于当前日期");
            }
        }
        PrAssemblyPlan origPlan = assemblyDao.selectByPrimaryKey(plan.id);
        PrBatchNumber batch = batchDao.selectByPrimaryKey(origPlan.batchId);
        //产品改变则更新全部已生成设备号
        if(origPlan.proId != plan.proId){
            batch.proId = plan.proId;