|  |  | 
 |  |  |             throw new RuntimeException("计划名称不能重复"); | 
 |  |  |         } | 
 |  |  |         PrProductionProcess process = processDao.selectByPrimaryKey(plan.processId); | 
 |  |  |         if(process == null || process.proId != plan.proId){ | 
 |  |  |         if(process == null || !process.proId.equals(plan.proId)){ | 
 |  |  |             throw new RuntimeException("产品与生产流程不匹配"); | 
 |  |  |         } | 
 |  |  |         PrBatchNumber batch = new PrBatchNumber(); | 
 |  |  | 
 |  |  |         //计划名称不能重复 | 
 |  |  |         if(assemblyDao.exists(plan.name,plan.id)){ | 
 |  |  |             throw new RuntimeException("计划名称不能重复"); | 
 |  |  |         } | 
 |  |  |         PrProductionProcess process = processDao.selectByPrimaryKey(plan.processId); | 
 |  |  |         if(process == null || !process.proId.equals(plan.proId)){ | 
 |  |  |             throw new RuntimeException("产品与生产流程不匹配"); | 
 |  |  |         } | 
 |  |  |         PrAssemblyPlan origPlan = assemblyDao.selectByPrimaryKey(plan.id); | 
 |  |  |         PrBatchNumber batch = batchDao.selectByPrimaryKey(origPlan.batchId); | 
 |  |  | 
 |  |  |         PrAssemblyPlan param = new PrAssemblyPlan(); | 
 |  |  |         param.id =plan.id; | 
 |  |  |         param.status = plan.status; | 
 |  |  |         return assemblyDao.updateByPrimaryKeySelective(plan); | 
 |  |  |         return assemblyDao.updateByPrimaryKeySelective(param); | 
 |  |  |     } | 
 |  |  | } |