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()); }