|
|
@ -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.serviceimpl.busi.shippingscan.IMesShippingScanStrategyService;
|
|
|
|
import cn.estsh.i3plus.ext.mes.pcn.apiservice.util.MesPcnException;
|
|
|
|
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.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.MesSortShippingCheckModel;
|
|
|
|
import cn.estsh.i3plus.ext.mes.pcn.pojo.model.MesSortShippingModel;
|
|
|
|
import cn.estsh.i3plus.ext.mes.pcn.pojo.model.MesSortShippingModel;
|
|
|
|
import cn.estsh.i3plus.ext.mes.pcn.pojo.util.MesPcnExtConstWords;
|
|
|
|
import cn.estsh.i3plus.ext.mes.pcn.pojo.util.MesPcnExtConstWords;
|
|
|
@ -117,6 +118,9 @@ public class MesSortShippingCheckService implements IMesSortShippingCheckService
|
|
|
|
@Autowired
|
|
|
|
@Autowired
|
|
|
|
private IMesProduceSnExtService mesProduceSnExtService;
|
|
|
|
private IMesProduceSnExtService mesProduceSnExtService;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@Autowired
|
|
|
|
|
|
|
|
private MesMoveRepository moveRepository;
|
|
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
@Override
|
|
|
|
public MesSortShippingCheckModel doShippingOrderNoQuery(MesShippingOrderManagement shippingOrderManagement) {
|
|
|
|
public MesSortShippingCheckModel doShippingOrderNoQuery(MesShippingOrderManagement shippingOrderManagement) {
|
|
|
|
//校验发运单
|
|
|
|
//校验发运单
|
|
|
@ -773,21 +777,39 @@ public class MesSortShippingCheckService implements IMesSortShippingCheckService
|
|
|
|
//标记为总成不记录回传表
|
|
|
|
//标记为总成不记录回传表
|
|
|
|
detail.setSaveFlag(CommonEnumUtil.TRUE_OR_FALSE.FALSE.getValue());
|
|
|
|
detail.setSaveFlag(CommonEnumUtil.TRUE_OR_FALSE.FALSE.getValue());
|
|
|
|
MesMoveRule moveRule = null;
|
|
|
|
MesMoveRule moveRule = null;
|
|
|
|
//移库规则
|
|
|
|
MesPart itemPart = Objects.isNull(sortShippingModel.getMesPartMap()) || !sortShippingModel.getMesPartMap().containsKey(detail.getPartNo()) ? null : sortShippingModel.getMesPartMap().get(detail.getPartNo());
|
|
|
|
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())) {
|
|
|
|
if (Objects.isNull(itemPart) || StringUtil.isEmpty(itemPart.getEsd()) || Objects.isNull(sortShippingModel.getMesMoveRuleMap()) || !sortShippingModel.getMesMoveRuleMap().containsKey(itemPart.getEsd())) {
|
|
|
|
log.info("客供品移库零件【{}】维护的ESD属性未匹配到零件发运组【{}】中的移库规则", orderPart.getPartNo(), workOrder.getPartProdGroupCode());
|
|
|
|
log.info("客供品移库零件【{}】维护的ESD属性未匹配到零件发运组【{}】中的移库规则", detail.getPartNo(), workOrder.getPartProdGroupCode());
|
|
|
|
continue;
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
moveRule = sortShippingModel.getMesMoveRuleMap().get(itemPart.getEsd());
|
|
|
|
moveRule = sortShippingModel.getMesMoveRuleMap().get(itemPart.getEsd());
|
|
|
|
if (Objects.equals(moveRule.getMoveNum(), MesExtEnumUtil.MOVE_RULE_MOVE_NUM.MOVE_RULE_MOVE_NUM_20.getValue()) && MesExtEnumUtil.MOVE_TYPE_REPORT_TYPE.SHIPPING.getValue() == moveRule.getReportType()) {
|
|
|
|
if (MesExtEnumUtil.MOVE_TYPE_REPORT_TYPE.MOVE.getValue() == moveRule.getReportType()) {
|
|
|
|
shippingList.add(jisShippingService.getMesJisShipping(orderManagement, detail, moveRule.getErpSrcLocateNo(), orderPart, userInfo));
|
|
|
|
doCreateReworkMove(orderManagement.getOrganizeCode(),userInfo,moveRule.getErpSrcLocateNo(),moveRule.getErpDestLocateNo(), workOrder.getWorkCenterCode(), detail.getPartNo(), detail.getActualQty(),detail.getBarcode());
|
|
|
|
} else {
|
|
|
|
} else if (MesExtEnumUtil.MOVE_TYPE_REPORT_TYPE.NOT_HANDLER.getValue() == moveRule.getReportType()) {
|
|
|
|
log.info("客供品移库零件【{}】在零件发运组【{}】的移库规则中,汇报类型未维护或不为发运", orderPart.getPartNo(), workOrder.getPartProdGroupCode());
|
|
|
|
log.info("客供品移库零件【{}】维护的移库规则不做处理", detail.getPartNo(), workOrder.getPartProdGroupCode());
|
|
|
|
}
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|