|
|
|
@ -17,7 +17,6 @@ import cn.estsh.i3plus.pojo.base.enumutil.CommonEnumUtil;
|
|
|
|
|
import cn.estsh.i3plus.pojo.base.tool.DdlPreparedPack;
|
|
|
|
|
import cn.estsh.i3plus.pojo.base.util.StringUtil;
|
|
|
|
|
import cn.estsh.i3plus.pojo.mes.bean.*;
|
|
|
|
|
import cn.estsh.i3plus.pojo.mes.bean.shipping.*;
|
|
|
|
|
import cn.estsh.i3plus.pojo.mes.bean.edi.cd.MesCimVolvoJisRackIdDetail;
|
|
|
|
|
import cn.estsh.i3plus.pojo.mes.bean.shipping.*;
|
|
|
|
|
import cn.estsh.i3plus.pojo.mes.model.MesEquipVariableRwResult;
|
|
|
|
@ -118,6 +117,9 @@ public class MesSortShippingCheckService implements IMesSortShippingCheckService
|
|
|
|
|
private IMesProduceSnExtService mesProduceSnExtService;
|
|
|
|
|
|
|
|
|
|
@Autowired
|
|
|
|
|
private MesMoveRepository moveRepository;
|
|
|
|
|
|
|
|
|
|
@Autowired
|
|
|
|
|
private MesShippingQueueRepository shippingQueueRDao;
|
|
|
|
|
|
|
|
|
|
@Autowired
|
|
|
|
@ -125,8 +127,10 @@ public class MesSortShippingCheckService implements IMesSortShippingCheckService
|
|
|
|
|
|
|
|
|
|
@Autowired
|
|
|
|
|
private MesVolvoRackRepository mesVolvoRackRDao;
|
|
|
|
|
|
|
|
|
|
@Autowired
|
|
|
|
|
private MesCustSoftInfoRepository custSoftInfoRDao;
|
|
|
|
|
|
|
|
|
|
@Autowired
|
|
|
|
|
private MesCimVolvoJisRackIdDetailRepository rackIdDetailRDao;
|
|
|
|
|
|
|
|
|
@ -177,6 +181,7 @@ public class MesSortShippingCheckService implements IMesSortShippingCheckService
|
|
|
|
|
//零件发运组
|
|
|
|
|
MesPartShippingGroup shippingGroup = Objects.isNull(model.getMesPartShippingGroup()) ? getMesPartShippingGroup(orderManagement.getOrganizeCode(), orderManagement.getShippingGroupCode()) : model.getMesPartShippingGroup();
|
|
|
|
|
//扫描跳过码
|
|
|
|
|
model.setMesPartShippingGroup(shippingGroup);
|
|
|
|
|
if (!Objects.isNull(model.getIsPass()) && Objects.equals(MesPcnExtConstWords.ONE, model.getIsPass())) {
|
|
|
|
|
skipShippingDetails(model, model.getUserInfo(), orderManagement);
|
|
|
|
|
//扫描条码
|
|
|
|
@ -303,7 +308,7 @@ public class MesSortShippingCheckService implements IMesSortShippingCheckService
|
|
|
|
|
throw new ImppBusiException(String.format("料箱类型与顺序不一致,请检查数据"));
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
String detailPosition = ddddd(model, detail);
|
|
|
|
|
String detailPosition = detailPosition(model, detail);
|
|
|
|
|
String tmpPosition = tmpAfterBarCode.substring(tmpAfterBarCode.length() - 2);
|
|
|
|
|
StringBuilder splitPosition = new StringBuilder();
|
|
|
|
|
for (char c : tmpPosition.toCharArray()) {
|
|
|
|
@ -341,7 +346,7 @@ public class MesSortShippingCheckService implements IMesSortShippingCheckService
|
|
|
|
|
return model;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private String ddddd(MesSortShippingCheckModel model, MesShippingOrderManagementDetail detail) {
|
|
|
|
|
private String detailPosition(MesSortShippingCheckModel model, MesShippingOrderManagementDetail detail) {
|
|
|
|
|
MesWorkOrder workOrder = mesWorkOrderService.getWorkOrderNoByCustSn(model.getOrganizeCode(), model.getSn());
|
|
|
|
|
if (workOrder == null || StringUtils.isEmpty(workOrder.getWorkOrderSource())) {
|
|
|
|
|
return "";
|
|
|
|
@ -350,11 +355,11 @@ public class MesSortShippingCheckService implements IMesSortShippingCheckService
|
|
|
|
|
MesCustSortInfo custSoftInfo = custSoftInfoRDao.getById(Long.parseLong(workOrder.getWorkOrderSource()));
|
|
|
|
|
if (custSoftInfo != null) {
|
|
|
|
|
MesCimVolvoJisRackIdDetail rackIdDetail = rackIdDetailRDao.getById(custSoftInfo.getSourceId());
|
|
|
|
|
if (rackIdDetail != null) {
|
|
|
|
|
detail.setVisualOrderNo(workOrder.getWorkOrderNo());
|
|
|
|
|
return rackIdDetail.getPosition();
|
|
|
|
|
}
|
|
|
|
|
if (rackIdDetail != null) {
|
|
|
|
|
detail.setVisualOrderNo(workOrder.getWorkOrderNo());
|
|
|
|
|
return rackIdDetail.getPosition();
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
return "";
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@ -710,7 +715,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);
|
|
|
|
@ -865,9 +870,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.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;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@ -879,7 +885,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());
|
|
|
|
|
//散件发运
|
|
|
|
@ -902,9 +908,55 @@ public class MesSortShippingCheckService implements IMesSortShippingCheckService
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
} 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 (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 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);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private void saveShippingQueue(MesShippingOrderManagement orderManagement, MesShippingOrderManagementDetail detail, String userInfo) {
|
|
|
|
|
if (StringUtil.isEmpty(detail.getVin())) {
|
|
|
|
|
MesPcnException.throwMesBusiException("发运单【%s】零件号【%s】vin号为空,请检查数据", orderManagement.getShippingCode(), detail.getPartNo());
|
|
|
|
|