|
|
|
@ -7,6 +7,7 @@ import cn.estsh.i3plus.ext.mes.pcn.apiservice.aspect.MonitorLog;
|
|
|
|
|
import cn.estsh.i3plus.ext.mes.pcn.apiservice.serviceimpl.busi.shippingscan.IMesShippingScanStrategyService;
|
|
|
|
|
import cn.estsh.i3plus.ext.mes.pcn.apiservice.util.MesPcnException;
|
|
|
|
|
import cn.estsh.i3plus.ext.mes.pcn.pojo.constant.MesCommonConstant;
|
|
|
|
|
import cn.estsh.i3plus.ext.mes.pcn.pojo.model.MesReworkTaskRequestModel;
|
|
|
|
|
import cn.estsh.i3plus.ext.mes.pcn.pojo.model.MesSortShippingCheckModel;
|
|
|
|
|
import cn.estsh.i3plus.ext.mes.pcn.pojo.model.MesSortShippingModel;
|
|
|
|
|
import cn.estsh.i3plus.ext.mes.pcn.pojo.util.MesPcnExtConstWords;
|
|
|
|
@ -117,6 +118,9 @@ public class MesSortShippingCheckService implements IMesSortShippingCheckService
|
|
|
|
|
@Autowired
|
|
|
|
|
private MesShippingQueueRepository shippingQueueRDao;
|
|
|
|
|
|
|
|
|
|
@Autowired
|
|
|
|
|
private MesMoveRepository moveRepository;
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
public MesSortShippingCheckModel doShippingOrderNoQuery(MesShippingOrderManagement shippingOrderManagement) {
|
|
|
|
|
//校验发运单
|
|
|
|
@ -580,7 +584,7 @@ public class MesSortShippingCheckService implements IMesSortShippingCheckService
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
//客供品移库
|
|
|
|
|
customerSupplyMove(orderManagement, userInfo, sortShippingModel, shippingList, detail);
|
|
|
|
|
customerSupplyMove(orderManagement, userInfo, sortShippingModel, shippingList, detail, model.getMesPartShippingGroup());
|
|
|
|
|
|
|
|
|
|
detail.setSystemSyncStatus(CommonEnumUtil.FALSE);
|
|
|
|
|
detail.setActualQty(MesPcnExtConstWords.ONE);
|
|
|
|
@ -730,9 +734,10 @@ public class MesSortShippingCheckService implements IMesSortShippingCheckService
|
|
|
|
|
sortShippingModel.setMesWorkOrderList(mesWorkOrderExtService.getWorkOrderList(organizeCode, orderNoList));
|
|
|
|
|
sortShippingModel.setMesWorkOrderPartList(mesWorkOrderService.findMesWorkOrderPartByOrderNo(organizeCode, orderNoList));
|
|
|
|
|
sortShippingModel.setMesProductionRecordList(mesProductionRecordService.findProductionRecordList(organizeCode, orderNoList, MesExtEnumUtil.MES_REPORT_TYPE.CUSTOMER_SUPPLY_MOVE.getValue()));
|
|
|
|
|
sortShippingModel.setMesMoveRuleList(mesMoveRuleService.findMesMoveRuleByPartProdGroupCode(shippingGroupCode, organizeCode,MesExtEnumUtil.MOVE_RULE_GROUP_TYPE.MOVE_RULE_GROUP_TYPE_10.getValue()));
|
|
|
|
|
sortShippingModel.setMesPartList(mesPartService.findMesPartByPartNo(sortShippingModel.getPartNoAllList(), organizeCode));
|
|
|
|
|
}
|
|
|
|
|
sortShippingModel.setMesMoveRuleList(mesMoveRuleService.findMesMoveRuleByPartProdGroupCode(shippingGroupCode, organizeCode,MesExtEnumUtil.MOVE_RULE_GROUP_TYPE.MOVE_RULE_GROUP_TYPE_10.getValue()));
|
|
|
|
|
|
|
|
|
|
return sortShippingModel;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@ -744,7 +749,7 @@ public class MesSortShippingCheckService implements IMesSortShippingCheckService
|
|
|
|
|
return produceSnByCustSnMap;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private void customerSupplyMove(MesShippingOrderManagement orderManagement, String userInfo, MesSortShippingModel sortShippingModel, List<MesJisShipping> shippingList, MesShippingOrderManagementDetail detail) {
|
|
|
|
|
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());
|
|
|
|
|
//散件发运
|
|
|
|
@ -767,6 +772,27 @@ public class MesSortShippingCheckService implements IMesSortShippingCheckService
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
} else if (Objects.equals(MesExtEnumUtil.PART_GROUP_MOVE_TYPE.PART_GROUP_MOVE_TYPE_10.getValue(), mesPartShippingGroup.getMoveType())) {
|
|
|
|
|
|
|
|
|
|
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;
|
|
|
|
|
MesPart itemPart = Objects.isNull(sortShippingModel.getMesPartMap()) || !sortShippingModel.getMesPartMap().containsKey(detail.getPartNo()) ? null : sortShippingModel.getMesPartMap().get(detail.getPartNo());
|
|
|
|
|
if (Objects.isNull(itemPart) || StringUtil.isEmpty(itemPart.getEsd()) || Objects.isNull(sortShippingModel.getMesMoveRuleMap()) || !sortShippingModel.getMesMoveRuleMap().containsKey(itemPart.getEsd())) {
|
|
|
|
|
log.info("客供品移库零件【{}】维护的ESD属性未匹配到零件发运组【{}】中的移库规则", detail.getPartNo(), workOrder.getPartProdGroupCode());
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
moveRule = sortShippingModel.getMesMoveRuleMap().get(itemPart.getEsd());
|
|
|
|
|
if (MesExtEnumUtil.MOVE_TYPE_REPORT_TYPE.MOVE.getValue() == moveRule.getReportType()) {
|
|
|
|
|
doCreateReworkMove(orderManagement.getOrganizeCode(),userInfo,moveRule.getErpSrcLocateNo(),moveRule.getErpDestLocateNo(), workOrder.getWorkCenterCode(), detail.getPartNo(), detail.getActualQty(),detail.getBarcode());
|
|
|
|
|
} else if (MesExtEnumUtil.MOVE_TYPE_REPORT_TYPE.NOT_HANDLER.getValue() == moveRule.getReportType()) {
|
|
|
|
|
log.info("客供品移库零件【{}】维护的移库规则不做处理", detail.getPartNo(), workOrder.getPartProdGroupCode());
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@ -789,4 +815,24 @@ public class MesSortShippingCheckService implements IMesSortShippingCheckService
|
|
|
|
|
ConvertBean.serviceModelInitialize(mesShippingQueue, userInfo);
|
|
|
|
|
shippingQueueRDao.insert(mesShippingQueue);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private void doCreateReworkMove(String organizeCode,String userName, String srcLocate, String destLocate, String workCenterCode, String partNo, double qty, String sn) {
|
|
|
|
|
MesPartSap mesPartSap = mesPartService.getMesPartSapByPartNo(partNo, organizeCode);
|
|
|
|
|
MesMove move = new MesMove();
|
|
|
|
|
move.setMatnr(mesPartSap.getPartNo());
|
|
|
|
|
move.setOrganizeCode(organizeCode);
|
|
|
|
|
move.setFactoryCode(organizeCode);
|
|
|
|
|
move.setLgort(srcLocate);
|
|
|
|
|
move.setUmlgo(destLocate);
|
|
|
|
|
move.setPartInspectionId(0L);
|
|
|
|
|
move.setMenge(qty);
|
|
|
|
|
move.setMeins(mesPartSap.getUnit());
|
|
|
|
|
move.setPostDate(TimeTool.getToday());
|
|
|
|
|
move.setPostTime(TimeTool.getTimeShortWithColon());
|
|
|
|
|
move.setMoveType(MesExtEnumUtil.MOVE_TYPE.RETURN_MOVE.getValue());
|
|
|
|
|
move.setProductSn(sn);
|
|
|
|
|
move.setWorkCenter(workCenterCode);
|
|
|
|
|
ConvertBean.serviceModelInitialize(move, userName);
|
|
|
|
|
moveRepository.insert(move);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|