|
|
|
@ -300,6 +300,9 @@ public class RoutingManagementServiceImpl extends ServiceImpl<RoutingManagementM |
|
|
|
} |
|
|
|
// 校验物料类型 |
|
|
|
PartInformationEntity partInformationEntity = partInformationMapper.selectOne(new QueryWrapper<PartInformationEntity>().eq("site", data.getSite()).eq("sourceBu", data.getBuNo()).eq("part_no", data.getPartNo())); |
|
|
|
if (partInformationEntity == null) { |
|
|
|
throw new RuntimeException("查不到该物料信息,请确认工厂和BU!"); |
|
|
|
} |
|
|
|
if ("Purchased (raw)".equals(partInformationEntity.getPartType()) || "Purchased".equals(partInformationEntity.getPartType())) { |
|
|
|
throw new RuntimeException("物料类型为:" + partInformationEntity.getPartType() + " !"); |
|
|
|
} |
|
|
|
@ -488,11 +491,11 @@ public class RoutingManagementServiceImpl extends ServiceImpl<RoutingManagementM |
|
|
|
} |
|
|
|
data.setRoutingRevision(routingRevision); |
|
|
|
|
|
|
|
// 校验日期是否冲突 |
|
|
|
List<RoutingHeaderEntity> headerEntities = routingManagementMapper.queryHeaderPhaseDate(data); |
|
|
|
if (!headerEntities.isEmpty()) { |
|
|
|
throw new RuntimeException("日期冲突!"); |
|
|
|
} |
|
|
|
// // 校验日期是否冲突 |
|
|
|
// List<RoutingHeaderEntity> headerEntities = routingManagementMapper.queryHeaderPhaseDate(data); |
|
|
|
// if (!headerEntities.isEmpty()) { |
|
|
|
// throw new RuntimeException("日期冲突!"); |
|
|
|
// } |
|
|
|
|
|
|
|
// 1.3 新增routing主信息 |
|
|
|
routingManagementMapper.saveRoutingHeader(data); |
|
|
|
@ -616,6 +619,12 @@ public class RoutingManagementServiceImpl extends ServiceImpl<RoutingManagementM |
|
|
|
if (StringUtils.isNotBlank(data.getStatus()) && StringUtils.isNotBlank(checkList.get(0).getStatus())) { // 判断状态是否为null |
|
|
|
if (data.getStatus().equals(checkList.get(0).getStatus())) { // 判断状态是否已改变 |
|
|
|
if ("Tentative".equals(checkList.get(0).getStatus()) || "Obsolete".equals(checkList.get(0).getStatus())) { |
|
|
|
// 校验日期 |
|
|
|
RoutingHeaderEntity routingHeaderEntity = routingManagementMapper.selectOne(new QueryWrapper<RoutingHeaderEntity>().eq("site", data.getSite()).eq("bu_no", data.getBuNo()).eq("part_no", data.getPartNo()).eq("routing_revision", data.getRoutingRevision()).eq("routing_type", data.getRoutingType())); |
|
|
|
List<RoutingHeaderEntity> headerEntities = routingManagementMapper.queryHeaderPhaseDate(routingHeaderEntity); |
|
|
|
if (!headerEntities.isEmpty() && headerEntities.size() > 1) { |
|
|
|
throw new RuntimeException("日期冲突!"); |
|
|
|
} |
|
|
|
data.setStatus("Buildable"); |
|
|
|
} else if ("Buildable".equals(checkList.get(0).getStatus())) { |
|
|
|
data.setStatus("Obsolete"); |
|
|
|
|