Merge branch 'uat-temp-wj-chongqingdaqu-prod-huaweiyun-shipping-repeat-bug' into yfai-20250418-dev

uat-temp-nht-2505020000-shippingkanban
王杰 3 months ago
commit e03ad02ae3

@ -1241,7 +1241,8 @@ public class MesInputDefectRecordService implements IMesInputDefectRecordService
partInspection.setNcStatus(MesExtEnumUtil.PART_INSPECTION_NC_STATUS.CREATE.getValue());
partInspection.setOrganizeCode(org);
String defectTypeCodeStr = configService.getCfgValue(org, "MES_SUSPICIOUS_DEFECT_TYPE_CODE") == null ? "QX130" :configService.getCfgValue(org, "MES_SUSPICIOUS_DEFECT_TYPE_CODE");
MesConfig mesConfig = configService.getMesConfigNoError(org, "MES_SUSPICIOUS_DEFECT_TYPE_CODE");
String defectTypeCodeStr = (null != mesConfig && !StringUtils.isEmpty(mesConfig.getCfgValue())) ? mesConfig.getCfgValue() : "QX130";
//根据页面上选择的位置 查询位置,若不存在则提示 位置不存在,请检查数据
DdlPackBean packBean = DdlPackBean.getDdlPackBean(org);

@ -646,6 +646,10 @@ public class MesSortShippingCheckService implements IMesSortShippingCheckService
if (StringUtils.isEmpty(orderManagement)) {
throw new ImppBusiException(String.format("【%s】此发运单不存在请检查数据", model.getShippingCode()));
}
if (orderManagement.getStatus().compareTo(MesExtEnumUtil.SHIPPING_ORDER_STATUS.SHIPPED.getValue()) >= 0) {
throw new ImppBusiException(String.format("【%s】此发运单当前状态【%s】请检查数据",
model.getShippingCode(), MesExtEnumUtil.SHIPPING_ORDER_STATUS.valueOfDescription(orderManagement.getStatus())));
}
return orderManagement;
}

@ -65,6 +65,7 @@ public class CqLjSortShippingPrintStrategyService extends SortShippingDispatchSt
//遍历处理每个发运单主表
for (MesShippingOrderManagement shippingOrderManagement : shippingOrderManagementList) {
log.info("工厂{}排序发运打印 --- 遍历 发运单:{} --- {}", bean.getOrganizeCode(), shippingOrderManagement.getShippingCode(), Thread.currentThread().getName());
//一张实体发运单包含三部分信息(顶部的通用数据、中部的第一份表格数据,底部的第二份表格数据)
//取出当前发运单的明细信息
List<MesShippingOrderManagementDetail> details = null == detailByPidMap ? null : detailByPidMap.get(shippingOrderManagement.getId());
@ -82,6 +83,7 @@ public class CqLjSortShippingPrintStrategyService extends SortShippingDispatchSt
detailList.stream().min(Comparator.comparing(MesShippingOrderManagementDetail::getLogicSeq));
min.ifPresent(mesShippingOrderManagementDetail -> logicSeqAndAssyCodeMap.put(mesShippingOrderManagementDetail.getLogicSeq(), assyCode));
}
log.info("工厂{}排序发运打印 --- 遍历 发运单:{} --- assyCodeList:{} --- logicSeqAndAssyCodeMap:{} --- {}", bean.getOrganizeCode(), shippingOrderManagement.getShippingCode(), assyCodeList.toString(), JSONObject.toJSONString(logicSeqAndAssyCodeMap), Thread.currentThread().getName());
List<Long> collect = logicSeqAndAssyCodeMap.keySet().stream().sorted().collect(Collectors.toList());
List<String> newAssyCodeList = new ArrayList<>();
for (Long logicSeq : collect) {
@ -92,12 +94,15 @@ public class CqLjSortShippingPrintStrategyService extends SortShippingDispatchSt
.filter(i -> i % 2 == 0)
.mapToObj(i -> newAssyCodeList.subList(i, Math.min(i + 2, newAssyCodeList.size())))
.collect(Collectors.toList());
if (!CollectionUtils.isEmpty(physicalOrderList)) {
log.info("工厂{}排序发运打印 --- 遍历 发运单:{} --- physicalOrderList:{} --- {}", bean.getOrganizeCode(), shippingOrderManagement.getShippingCode(), JSONObject.toJSONString(physicalOrderList), Thread.currentThread().getName());
for (List<String> list : physicalOrderList) {
//生成一张实体发运单
log.info("工厂{}排序发运打印 --- 生成一张实体发运单:{} --- {}", bean.getOrganizeCode(), list.toString(), Thread.currentThread().getName());
mainDataList.add(createPhysicalOrder(shippingOrderManagement, list, detailByAssyCodeMap, details));
}
}
}
shippingOrderManagement.setPrintCount(StringUtil.isEmpty(shippingOrderManagement.getPrintCount())? 1 : shippingOrderManagement.getPrintCount()+1);
shippingOrderManagement.setLastPrintTime(TimeTool.getNowTime(true));
shippingOrderManagement.setLastPrintUser(bean.getUserInfo());
@ -123,7 +128,8 @@ public class CqLjSortShippingPrintStrategyService extends SortShippingDispatchSt
//中部表结构赋值
model.setDetailModelsOne(createDetailList(assyCodeList.get(0), detailByAssyCodeMap, details, shippingOrderManagement.getRackNo()));
//底部表结构赋值
model.setDetailModelsTwo(createDetailList(assyCodeList.get(1), detailByAssyCodeMap, details, shippingOrderManagement.getRackNo()));
if (assyCodeList.size() > 1) model.setDetailModelsTwo(createDetailList(assyCodeList.get(1), detailByAssyCodeMap, details, shippingOrderManagement.getRackNo()));
else model.setDetailModelsTwo(new ArrayList<>());
log.info("工厂{}排序发运打印 --- MesShippingOrderManagementModelForLiJia:{} --- {}", shippingOrderManagement.getOrganizeCode(), JSONObject.toJSONString(model), Thread.currentThread().getName());
return model;
}

@ -115,7 +115,8 @@ public class MesProductResultErrorHandleStepService extends BaseStepService {
String defectTypeCode = MesEnumUtil.DEFECT_TYPE_CODE.DETERMIND.getValue();
productionPsOutContextList.forEach(mesProduceSn -> {
String productVersion = null;
List<MesProductionPartContext> mesProductionPartContextList = productionPartContextList.stream().filter(mesProductionPartContext -> Objects.equal(mesProduceSn.getForeignKey(),mesProductionPartContext.getForeignKey())).collect(Collectors.toList());
List<MesProductionPartContext> mesProductionPartContextList = CollectionUtils.isEmpty(productionPartContextList) ? null :
productionPartContextList.stream().filter(mesProductionPartContext -> Objects.equal(mesProduceSn.getForeignKey(),mesProductionPartContext.getForeignKey())).collect(Collectors.toList());
if (!CollectionUtils.isEmpty(mesProductionPartContextList)) {
productVersion = mesProductionPartContextList.get(0).getProductVersion();
}
@ -186,7 +187,7 @@ public class MesProductResultErrorHandleStepService extends BaseStepService {
inspectModel.setShiftCode(mesProduceSn.getShiftCode());
inspectModel.setProductVersion(productVersion);
inspectModel.setUserInfo(reqBean.getUserInfo());
inspectModel.setSourceType(MesExtEnumUtil.PART_INSPECTION_SOURCE_TYPE.SINGLE.getValue());
inputDefectRecordService.saveSusPartInspection(inspectModel, reqBean.getOrganizeCode());
}
});

Loading…
Cancel
Save