|
|
|
@ -582,7 +582,7 @@ public class MesNingDeShippingCheckService implements IMesNingDeShippingCheckSer
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
//客供品移库
|
|
|
|
|
customerSupplyMove(orderManagement, userInfo, sortShippingModel, shippingList, detail, shippingGroup);
|
|
|
|
|
customerSupplyMove(sortShippingModel, detail);
|
|
|
|
|
|
|
|
|
|
detail.setIsValid(CommonEnumUtil.VALID);
|
|
|
|
|
detail.setSystemSyncStatus(CommonEnumUtil.FALSE);
|
|
|
|
@ -720,54 +720,13 @@ public class MesNingDeShippingCheckService implements IMesNingDeShippingCheckSer
|
|
|
|
|
return produceSnByCustSnMap;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private void customerSupplyMove(MesShippingOrderManagement orderManagement, String userInfo, MesSortShippingModel sortShippingModel, List<MesJisShipping> shippingList, MesShippingOrderManagementDetail detail, MesPartShippingGroup mesPartShippingGroup) {
|
|
|
|
|
if (!StringUtils.isEmpty(detail.getVisualOrderNo()) && !Objects.isNull(sortShippingModel.getMesWorkOrderMap()) && sortShippingModel.getMesWorkOrderMap().containsKey(detail.getVisualOrderNo())) {
|
|
|
|
|
MesWorkOrder workOrder = sortShippingModel.getMesWorkOrderMap().get(detail.getVisualOrderNo());
|
|
|
|
|
//散件发运
|
|
|
|
|
if (!Objects.isNull(sortShippingModel.getMesProductionRecordMap()) && sortShippingModel.getMesProductionRecordMap().containsKey(detail.getVisualOrderNo()) && !Objects.isNull(sortShippingModel.getMesWorkOrderPartMap()) && sortShippingModel.getMesWorkOrderPartMap().containsKey(detail.getVisualOrderNo())) {
|
|
|
|
|
//标记为总成不记录回传表
|
|
|
|
|
detail.setSaveFlag(CommonEnumUtil.TRUE_OR_FALSE.FALSE.getValue());
|
|
|
|
|
MesMoveRule moveRule = null;
|
|
|
|
|
//移库规则
|
|
|
|
|
for (MesWorkOrderPart orderPart : sortShippingModel.getMesWorkOrderPartMap().get(detail.getVisualOrderNo())) {
|
|
|
|
|
MesPart itemPart = Objects.isNull(sortShippingModel.getMesPartMap()) || !sortShippingModel.getMesPartMap().containsKey(orderPart.getPartNo()) ? null : sortShippingModel.getMesPartMap().get(orderPart.getPartNo());
|
|
|
|
|
if (Objects.isNull(itemPart) || StringUtil.isEmpty(itemPart.getEsd()) || Objects.isNull(sortShippingModel.getMesMoveRuleMap()) || !sortShippingModel.getMesMoveRuleMap().containsKey(itemPart.getEsd())) {
|
|
|
|
|
log.info("客供品移库零件【{}】维护的ESD属性未匹配到零件发运组【{}】中的移库规则", orderPart.getPartNo(), workOrder.getPartProdGroupCode());
|
|
|
|
|
continue;
|
|
|
|
|
}
|
|
|
|
|
moveRule = sortShippingModel.getMesMoveRuleMap().get(itemPart.getEsd());
|
|
|
|
|
if (Objects.equals(moveRule.getMoveNum(), MesExtEnumUtil.MOVE_RULE_MOVE_NUM.MOVE_RULE_MOVE_NUM_40.getValue()) && MesExtEnumUtil.MOVE_TYPE_REPORT_TYPE.SHIPPING.getValue() == moveRule.getReportType()) {
|
|
|
|
|
shippingList.add(jisShippingService.getMesJisShipping(orderManagement, detail, moveRule.getErpSrcLocateNo(), orderPart, userInfo));
|
|
|
|
|
} else {
|
|
|
|
|
log.info("客供品移库零件【{}】在零件发运组【{}】的移库规则中,汇报类型未维护或不为发运", orderPart.getPartNo(), workOrder.getPartProdGroupCode());
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
} else if (Objects.equals(MesExtEnumUtil.PART_GROUP_MOVE_TYPE.PART_GROUP_MOVE_TYPE_10.getValue(), mesPartShippingGroup.getMoveType())) {
|
|
|
|
|
|
|
|
|
|
//散件发运
|
|
|
|
|
if (!Objects.isNull(sortShippingModel.getMesMoveRuleMap())) {
|
|
|
|
|
//标记为总成不记录回传表
|
|
|
|
|
detail.setSaveFlag(CommonEnumUtil.TRUE_OR_FALSE.FALSE.getValue());
|
|
|
|
|
MesMoveRule moveRule = null;
|
|
|
|
|
MesPart itemPart = mesPartService.getMesPartByPartNo(detail.getPartNo(), detail.getOrganizeCode());
|
|
|
|
|
if (Objects.isNull(itemPart) || StringUtil.isEmpty(itemPart.getEsd()) || Objects.isNull(sortShippingModel.getMesMoveRuleMap()) || !sortShippingModel.getMesMoveRuleMap().containsKey(itemPart.getEsd())) {
|
|
|
|
|
detail.setSaveFlag(CommonEnumUtil.TRUE_OR_FALSE.TRUE.getValue());
|
|
|
|
|
log.info("客供品移库零件【{}】维护的ESD属性未匹配到零件发运组【{}】中的移库规则", detail.getPartNo(), orderManagement.getShippingGroupCode());
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
moveRule = sortShippingModel.getMesMoveRuleMap().get(itemPart.getEsd());
|
|
|
|
|
if (moveRule == null) {
|
|
|
|
|
detail.setSaveFlag(CommonEnumUtil.TRUE_OR_FALSE.TRUE.getValue());
|
|
|
|
|
log.info("客供品移库零件【{}】维护的移库规则不做处理", detail.getPartNo(), orderManagement.getShippingGroupCode());
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
if (Objects.equals(moveRule.getMoveNum(), MesExtEnumUtil.MOVE_RULE_MOVE_NUM.MOVE_RULE_MOVE_NUM_40.getValue()) && MesExtEnumUtil.MOVE_TYPE_REPORT_TYPE.MOVE.getValue() == moveRule.getReportType()) {
|
|
|
|
|
doCreateReworkMove(orderManagement.getOrganizeCode(),userInfo,moveRule.getErpSrcLocateNo(),moveRule.getErpDestLocateNo(), "", detail.getPartNo(), detail.getActualQty(),detail.getBarcode());
|
|
|
|
|
} else if (MesExtEnumUtil.MOVE_TYPE_REPORT_TYPE.NOT_HANDLER.getValue() == moveRule.getReportType()) {
|
|
|
|
|
log.info("客供品移库零件【{}】维护的移库规则不做处理", detail.getPartNo(), orderManagement.getShippingGroupCode());
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
private void customerSupplyMove(MesSortShippingModel sortShippingModel, MesShippingOrderManagementDetail detail) {
|
|
|
|
|
detail.setSaveFlag(CommonEnumUtil.TRUE_OR_FALSE.FALSE.getValue());
|
|
|
|
|
// 宁德配置了移库规则为二次发运后,则第一次发运时不写入jis_Shipping表,二次发运才写入,否则第一次写入,二次发运后不写入。
|
|
|
|
|
if (!CollectionUtils.isEmpty(sortShippingModel.getMesMoveRuleList())) {
|
|
|
|
|
MesMoveRule moveRule = sortShippingModel.getMesMoveRuleList().get(0);
|
|
|
|
|
if (moveRule != null && Objects.equals(moveRule.getMoveNum(), MesExtEnumUtil.MOVE_RULE_MOVE_NUM.MOVE_RULE_MOVE_NUM_40.getValue())) {
|
|
|
|
|
detail.setSaveFlag(CommonEnumUtil.TRUE_OR_FALSE.TRUE.getValue());
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|