From bb9851443ba2099f3ae367b41e7854dded9c1801 Mon Sep 17 00:00:00 2001 From: xs Date: Sun, 13 Oct 2024 16:54:40 +0800 Subject: [PATCH] =?UTF-8?q?3.1.9=20MES:=E8=87=AA=E6=A3=80=E5=B7=A5?= =?UTF-8?q?=E5=BA=8F=E7=94=9F=E6=88=90=E6=88=90=E5=93=81=E6=9D=A1=E7=A0=81?= =?UTF-8?q?=E4=BF=9D=E5=AD=98=E7=9A=84materialid=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../impl/MesBaseBarcodeInfoServiceImpl.java | 7 +------ .../hw/mes/service/impl/MesImportImpl.java | 20 +++++++++++++++---- 2 files changed, 17 insertions(+), 10 deletions(-) diff --git a/hw-modules/hw-mes/src/main/java/com/hw/mes/service/impl/MesBaseBarcodeInfoServiceImpl.java b/hw-modules/hw-mes/src/main/java/com/hw/mes/service/impl/MesBaseBarcodeInfoServiceImpl.java index 71ab867..20db462 100644 --- a/hw-modules/hw-mes/src/main/java/com/hw/mes/service/impl/MesBaseBarcodeInfoServiceImpl.java +++ b/hw-modules/hw-mes/src/main/java/com/hw/mes/service/impl/MesBaseBarcodeInfoServiceImpl.java @@ -349,8 +349,7 @@ public class MesBaseBarcodeInfoServiceImpl implements IMesBaseBarcodeInfoService Long saleOrderId = productPlan.getSaleOrderId(); String saleOrderCode = productPlan.getSaleorderCode(); - Long materialId = null;//在生产计划的materialid是根据saletype保存,如果是外部销售则保存productorder中的materialid,如果是内部生产则保存prpductorder中的producematerialid - + Long materialId = productPlan.getMaterialId();;//在生产计划的materialid是根据saletype保存,如果是外部销售则保存productorder中的materialid,如果是内部生产则保存prpductorder中的producematerialid //五楼自检工序根据原材料条码生成成品条码 if (StringUtils.isNotEmpty(mesBaseBarcodeInfo.getSingleFlag()) && @@ -408,9 +407,6 @@ public class MesBaseBarcodeInfoServiceImpl implements IMesBaseBarcodeInfoService + ",原材料条码派工单号:" + rawBarcodeProductPlan.getDispatchCode()); } - - materialId = rawBarcode.getMaterialId(); - mesBaseBarcodeInfo.setPalletInfoCode(rawBarcode.getPalletInfoCode());//重新绑定托盘号 mesBaseBarcodeInfo.setBindStatus(MesConstants.MES_BARCODE_BIND_STATUS_BINDING); @@ -436,7 +432,6 @@ public class MesBaseBarcodeInfoServiceImpl implements IMesBaseBarcodeInfoService mesProductPlanDetailMapper.updateMesProductPlanDetail(mesProductPlanDetail); } else { - materialId = productPlan.getMaterialId(); MesProductOrder mesProductOrder = mesProductOrderMapper.selectMesProductOrderByProductOrderId(productPlan.getProductOrderId()); mesBaseBarcodeInfo.setCompleteFlag(mesProductOrder.getSaleType().equals(MesConstants.MES_PRODUCT_ORDER_SALE) diff --git a/hw-modules/hw-mes/src/main/java/com/hw/mes/service/impl/MesImportImpl.java b/hw-modules/hw-mes/src/main/java/com/hw/mes/service/impl/MesImportImpl.java index 9885bac..b131ca0 100644 --- a/hw-modules/hw-mes/src/main/java/com/hw/mes/service/impl/MesImportImpl.java +++ b/hw-modules/hw-mes/src/main/java/com/hw/mes/service/impl/MesImportImpl.java @@ -154,6 +154,7 @@ public class MesImportImpl implements IMesImportService { /** * 物料BOM信息excel导入 * 接口作废 + * * @param file * @param updateSupport * @param operName @@ -271,6 +272,7 @@ public class MesImportImpl implements IMesImportService { /** * 提资单BOM信息excel导入 + * * @param file * @param updateSupport * @param operName @@ -297,7 +299,17 @@ public class MesImportImpl implements IMesImportService { if (StringUtils.isNull(cellT)) { throw new ServiceException("Excel格式错误!"); } - String productBom = cellT.getStringCellValue(); + + String productBom = null; + switch (cellT.getCellType()) { + case STRING: + productBom = cellT.getStringCellValue(); + break; + default: + throw new ServiceException("Excel格式错误:请设置成文本格式"); + } + + productBom = productBom.replaceAll("(.*?)", ""); MesBaseMaterialInfo productMaterial = mesBaseMaterialInfoMapper.selectMesBaseMaterialInfoByMaterialCode(productBom); if (productMaterial == null) { @@ -343,7 +355,7 @@ public class MesImportImpl implements IMesImportService { } Row rowC = sheet.getRow(i); Cell numberCell = rowC.getCell(0); - if (StringUtils.isNull(numberCell) || numberCell.getCellType() != NUMERIC) { + if (StringUtils.isNull(numberCell) || numberCell.getCellType() != NUMERIC) { break; } Cell materialCodeCell = rowC.getCell(1); @@ -368,7 +380,7 @@ public class MesImportImpl implements IMesImportService { materialBom.setActiveFlag("1"); materialBom.setStandardAmount(BigDecimal.valueOf(amountCell.getNumericCellValue())); materialBom.setErpMaterialId(materialInfo.getErpId()); - if (brandCell != null){ + if (brandCell != null) { materialBom.setBrand(brandCell.getStringCellValue()); } bomList.add(materialBom); @@ -378,7 +390,7 @@ public class MesImportImpl implements IMesImportService { } i++; } - if (failureMsg.length() != 0){ + if (failureMsg.length() != 0) { failureMsg.append("MES中未同步该物料信息!"); throw new ServiceException(failureMsg.toString()); }