| | |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | |
| | | import java.time.LocalDate; |
| | | import java.time.format.DateTimeFormatter; |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | |
| | | if(process == null || !process.proId.equals(plan.proId)){ |
| | | throw new RuntimeException("产品与生产流程不匹配"); |
| | | } |
| | | //Fancy add 2024/07/09 如果状态为执行 ,则结束日期必须大于等于当前日期 |
| | | if(plan.status == PlanStatusEnum.NORMAL.getCode()){ |
| | | String endDateStr = plan.getEndDate(); |
| | | LocalDate endDate = LocalDate.parse(endDateStr, DateTimeFormatter.ISO_LOCAL_DATE); |
| | | LocalDate nextDay = endDate.plusDays(1); |
| | | LocalDate today = LocalDate.now(); // 获取当前日期 |
| | | if (nextDay.isBefore(today)) { |
| | | throw new RuntimeException("执行状态结束日期必须大于等于当前日期"); |
| | | } |
| | | } |
| | | PrAssemblyPlan origPlan = assemblyDao.selectByPrimaryKey(plan.id); |
| | | PrBatchNumber batch = batchDao.selectByPrimaryKey(origPlan.batchId); |
| | | //产品改变则更新全部已生成设备号 |