From 92223877ba84876f4281f6bdd5b2ce2cc7f570e9 Mon Sep 17 00:00:00 2001 From: yxw Date: Tue, 16 Jan 2024 09:29:32 +0800 Subject: [PATCH] =?UTF-8?q?=E7=89=A9=E6=96=99=E5=AF=BC=E5=85=A5=E6=95=B0?= =?UTF-8?q?=E6=8D=AE=E5=8E=BB=E6=8E=89=E7=A9=BA=E6=A0=BC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../serviceimpl/excel/PartExtExcelService.java | 76 +++++++++++----------- 1 file changed, 38 insertions(+), 38 deletions(-) diff --git a/modules/i3plus-ext-mes-apiservice/src/main/java/cn/estsh/i3plus/ext/mes/apiservice/serviceimpl/excel/PartExtExcelService.java b/modules/i3plus-ext-mes-apiservice/src/main/java/cn/estsh/i3plus/ext/mes/apiservice/serviceimpl/excel/PartExtExcelService.java index 4bbfa8a..5663140 100644 --- a/modules/i3plus-ext-mes-apiservice/src/main/java/cn/estsh/i3plus/ext/mes/apiservice/serviceimpl/excel/PartExtExcelService.java +++ b/modules/i3plus-ext-mes-apiservice/src/main/java/cn/estsh/i3plus/ext/mes/apiservice/serviceimpl/excel/PartExtExcelService.java @@ -138,7 +138,7 @@ public class PartExtExcelService implements IExcelImportExtService { //物料代码 String partNo; try { - partNo = new DataFormatter().formatCellValue(row.getCell(0, Row.MissingCellPolicy.CREATE_NULL_AS_BLANK)); + partNo = new DataFormatter().formatCellValue(row.getCell(0, Row.MissingCellPolicy.CREATE_NULL_AS_BLANK)).trim(); } catch (Exception e) { continue; } @@ -146,259 +146,259 @@ public class PartExtExcelService implements IExcelImportExtService { //物料名称 String partName = null; try { - partName = new DataFormatter().formatCellValue(row.getCell(1, Row.MissingCellPolicy.CREATE_NULL_AS_BLANK)); + partName = new DataFormatter().formatCellValue(row.getCell(1, Row.MissingCellPolicy.CREATE_NULL_AS_BLANK)).trim(); } catch (Exception e) { } //物料简称 String briefText = null; try { - briefText = new DataFormatter().formatCellValue(row.getCell(2, Row.MissingCellPolicy.CREATE_NULL_AS_BLANK)); + briefText = new DataFormatter().formatCellValue(row.getCell(2, Row.MissingCellPolicy.CREATE_NULL_AS_BLANK)).trim(); } catch (Exception e) { } //单位 String unit = null; try { - unit = new DataFormatter().formatCellValue(row.getCell(3, Row.MissingCellPolicy.CREATE_NULL_AS_BLANK)); + unit = new DataFormatter().formatCellValue(row.getCell(3, Row.MissingCellPolicy.CREATE_NULL_AS_BLANK)).trim(); } catch (Exception e) { } //物料类型1 String categoryCode1 = null; try { - categoryCode1 = new DataFormatter().formatCellValue(row.getCell(4, Row.MissingCellPolicy.CREATE_NULL_AS_BLANK)); + categoryCode1 = new DataFormatter().formatCellValue(row.getCell(4, Row.MissingCellPolicy.CREATE_NULL_AS_BLANK)).trim(); } catch (Exception e) { } //物料类型2 String categoryCode2 = null; try { - categoryCode2 = new DataFormatter().formatCellValue(row.getCell(5, Row.MissingCellPolicy.CREATE_NULL_AS_BLANK)); + categoryCode2 = new DataFormatter().formatCellValue(row.getCell(5, Row.MissingCellPolicy.CREATE_NULL_AS_BLANK)).trim(); } catch (Exception e) { } //物料类型3 String categoryCode3 = null; try { - categoryCode3 = new DataFormatter().formatCellValue(row.getCell(6, Row.MissingCellPolicy.CREATE_NULL_AS_BLANK)); + categoryCode3 = new DataFormatter().formatCellValue(row.getCell(6, Row.MissingCellPolicy.CREATE_NULL_AS_BLANK)).trim(); } catch (Exception e) { } //产品编码匹配类型 String processMatchType = null; try { - processMatchType = new DataFormatter().formatCellValue(row.getCell(7, Row.MissingCellPolicy.CREATE_NULL_AS_BLANK)); + processMatchType = new DataFormatter().formatCellValue(row.getCell(7, Row.MissingCellPolicy.CREATE_NULL_AS_BLANK)).trim(); } catch (Exception e) { } //产品编码匹配类型 String productMatchType = null; try { - productMatchType = new DataFormatter().formatCellValue(row.getCell(8, Row.MissingCellPolicy.CREATE_NULL_AS_BLANK)); + productMatchType = new DataFormatter().formatCellValue(row.getCell(8, Row.MissingCellPolicy.CREATE_NULL_AS_BLANK)).trim(); } catch (Exception e) { } //包装编码匹配类型 String packageMatchType = null; try { - packageMatchType = new DataFormatter().formatCellValue(row.getCell(9, Row.MissingCellPolicy.CREATE_NULL_AS_BLANK)); + packageMatchType = new DataFormatter().formatCellValue(row.getCell(9, Row.MissingCellPolicy.CREATE_NULL_AS_BLANK)).trim(); } catch (Exception e) { } //包装数量 String qty2 = null; try { - qty2 = new DataFormatter().formatCellValue(row.getCell(10, Row.MissingCellPolicy.CREATE_NULL_AS_BLANK)); + qty2 = new DataFormatter().formatCellValue(row.getCell(10, Row.MissingCellPolicy.CREATE_NULL_AS_BLANK)).trim(); } catch (Exception e) { } //产品生产类型 String pptCode = null; try { - pptCode = new DataFormatter().formatCellValue(row.getCell(11, Row.MissingCellPolicy.CREATE_NULL_AS_BLANK)); + pptCode = new DataFormatter().formatCellValue(row.getCell(11, Row.MissingCellPolicy.CREATE_NULL_AS_BLANK)).trim(); } catch (Exception e) { } //颜色代码 String colorCode = null; try { - colorCode = new DataFormatter().formatCellValue(row.getCell(12, Row.MissingCellPolicy.CREATE_NULL_AS_BLANK)); + colorCode = new DataFormatter().formatCellValue(row.getCell(12, Row.MissingCellPolicy.CREATE_NULL_AS_BLANK)).trim(); } catch (Exception e) { } //颜色名称 String colorName = null; try { - colorName = new DataFormatter().formatCellValue(row.getCell(13, Row.MissingCellPolicy.CREATE_NULL_AS_BLANK)); + colorName = new DataFormatter().formatCellValue(row.getCell(13, Row.MissingCellPolicy.CREATE_NULL_AS_BLANK)).trim(); } catch (Exception e) { } //销售向 String salesTo = null; try { - salesTo = new DataFormatter().formatCellValue(row.getCell(14, Row.MissingCellPolicy.CREATE_NULL_AS_BLANK)); + salesTo = new DataFormatter().formatCellValue(row.getCell(14, Row.MissingCellPolicy.CREATE_NULL_AS_BLANK)).trim(); } catch (Exception e) { } //是否出货检验 String isOqc = null; try { - isOqc = new DataFormatter().formatCellValue(row.getCell(15, Row.MissingCellPolicy.CREATE_NULL_AS_BLANK)); + isOqc = new DataFormatter().formatCellValue(row.getCell(15, Row.MissingCellPolicy.CREATE_NULL_AS_BLANK)).trim(); } catch (Exception e) { } //是否生成条码 String isCreateSn = null; try { - isCreateSn = new DataFormatter().formatCellValue(row.getCell(16, Row.MissingCellPolicy.CREATE_NULL_AS_BLANK)); + isCreateSn = new DataFormatter().formatCellValue(row.getCell(16, Row.MissingCellPolicy.CREATE_NULL_AS_BLANK)).trim(); } catch (Exception e) { } //是否PS部件 String isPSParts = null; try { - isPSParts = new DataFormatter().formatCellValue(row.getCell(17, Row.MissingCellPolicy.CREATE_NULL_AS_BLANK)); + isPSParts = new DataFormatter().formatCellValue(row.getCell(17, Row.MissingCellPolicy.CREATE_NULL_AS_BLANK)).trim(); } catch (Exception e) { } //标准工数(min) String standardWork = null; try { - standardWork = new DataFormatter().formatCellValue(row.getCell(18, Row.MissingCellPolicy.CREATE_NULL_AS_BLANK)); + standardWork = new DataFormatter().formatCellValue(row.getCell(18, Row.MissingCellPolicy.CREATE_NULL_AS_BLANK)).trim(); } catch (Exception e) { } //日文描述 String japanDesc = null; try { - japanDesc = new DataFormatter().formatCellValue(row.getCell(19, Row.MissingCellPolicy.CREATE_NULL_AS_BLANK)); + japanDesc = new DataFormatter().formatCellValue(row.getCell(19, Row.MissingCellPolicy.CREATE_NULL_AS_BLANK)).trim(); } catch (Exception e) { } //商品码 String goodsCode = null; try { - goodsCode = new DataFormatter().formatCellValue(row.getCell(20, Row.MissingCellPolicy.CREATE_NULL_AS_BLANK)); + goodsCode = new DataFormatter().formatCellValue(row.getCell(20, Row.MissingCellPolicy.CREATE_NULL_AS_BLANK)).trim(); } catch (Exception e) { } //前缀 String prefix = null; try { - prefix = new DataFormatter().formatCellValue(row.getCell(21, Row.MissingCellPolicy.CREATE_NULL_AS_BLANK)); + prefix = new DataFormatter().formatCellValue(row.getCell(21, Row.MissingCellPolicy.CREATE_NULL_AS_BLANK)).trim(); } catch (Exception e) { } //质保书码 String qualityAssureCode = null; try { - qualityAssureCode = new DataFormatter().formatCellValue(row.getCell(22, Row.MissingCellPolicy.CREATE_NULL_AS_BLANK)); + qualityAssureCode = new DataFormatter().formatCellValue(row.getCell(22, Row.MissingCellPolicy.CREATE_NULL_AS_BLANK)).trim(); } catch (Exception e) { } //物料识别码 String identifyCode = null; try { - identifyCode = new DataFormatter().formatCellValue(row.getCell(23, Row.MissingCellPolicy.CREATE_NULL_AS_BLANK)); + identifyCode = new DataFormatter().formatCellValue(row.getCell(23, Row.MissingCellPolicy.CREATE_NULL_AS_BLANK)).trim(); } catch (Exception e) { } //条码末位数 String snLastCode = null; try { - snLastCode = new DataFormatter().formatCellValue(row.getCell(24, Row.MissingCellPolicy.CREATE_NULL_AS_BLANK)); + snLastCode = new DataFormatter().formatCellValue(row.getCell(24, Row.MissingCellPolicy.CREATE_NULL_AS_BLANK)).trim(); } catch (Exception e) { } //文件原名 String fileOriginName = null; try { - fileOriginName = new DataFormatter().formatCellValue(row.getCell(25, Row.MissingCellPolicy.CREATE_NULL_AS_BLANK)); + fileOriginName = new DataFormatter().formatCellValue(row.getCell(25, Row.MissingCellPolicy.CREATE_NULL_AS_BLANK)).trim(); } catch (Exception e) { } //包装条码打印张数 String packNoPrintTimes = null; try { - packNoPrintTimes = new DataFormatter().formatCellValue(row.getCell(26, Row.MissingCellPolicy.CREATE_NULL_AS_BLANK)); + packNoPrintTimes = new DataFormatter().formatCellValue(row.getCell(26, Row.MissingCellPolicy.CREATE_NULL_AS_BLANK)).trim(); } catch (Exception e) { } //本体条码打印张数 String snPrintTimes = null; try { - snPrintTimes = new DataFormatter().formatCellValue(row.getCell(27, Row.MissingCellPolicy.CREATE_NULL_AS_BLANK)); + snPrintTimes = new DataFormatter().formatCellValue(row.getCell(27, Row.MissingCellPolicy.CREATE_NULL_AS_BLANK)).trim(); } catch (Exception e) { } //本体条码打印列数 String printColumnNumber = null; try { - printColumnNumber = new DataFormatter().formatCellValue(row.getCell(28, Row.MissingCellPolicy.CREATE_NULL_AS_BLANK)); + printColumnNumber = new DataFormatter().formatCellValue(row.getCell(28, Row.MissingCellPolicy.CREATE_NULL_AS_BLANK)).trim(); } catch (Exception e) { } //大本体条码匹配类型 String bigProcessMatchType = null; try { - bigProcessMatchType = new DataFormatter().formatCellValue(row.getCell(29, Row.MissingCellPolicy.CREATE_NULL_AS_BLANK)); + bigProcessMatchType = new DataFormatter().formatCellValue(row.getCell(29, Row.MissingCellPolicy.CREATE_NULL_AS_BLANK)).trim(); } catch (Exception e) { } //是否打印质保书 String isPrintQualityAssureIndia = null; try { - isPrintQualityAssureIndia = new DataFormatter().formatCellValue(row.getCell(30, Row.MissingCellPolicy.CREATE_NULL_AS_BLANK)); + isPrintQualityAssureIndia = new DataFormatter().formatCellValue(row.getCell(30, Row.MissingCellPolicy.CREATE_NULL_AS_BLANK)).trim(); } catch (Exception e) { } //仕向地代码 String shiXiangDiCode = null; try { - shiXiangDiCode = new DataFormatter().formatCellValue(row.getCell(31, Row.MissingCellPolicy.CREATE_NULL_AS_BLANK)); + shiXiangDiCode = new DataFormatter().formatCellValue(row.getCell(31, Row.MissingCellPolicy.CREATE_NULL_AS_BLANK)).trim(); } catch (Exception e) { } //型号 String model = null; try { - model = new DataFormatter().formatCellValue(row.getCell(32, Row.MissingCellPolicy.CREATE_NULL_AS_BLANK)); + model = new DataFormatter().formatCellValue(row.getCell(32, Row.MissingCellPolicy.CREATE_NULL_AS_BLANK)).trim(); } catch (Exception e) { } //品番 String productNumber = null; try { - productNumber = new DataFormatter().formatCellValue(row.getCell(33, Row.MissingCellPolicy.CREATE_NULL_AS_BLANK)); + productNumber = new DataFormatter().formatCellValue(row.getCell(33, Row.MissingCellPolicy.CREATE_NULL_AS_BLANK)).trim(); } catch (Exception e) { } //大包装条码张数 String snPackagePrintColumnNumber = null; try { - snPackagePrintColumnNumber = new DataFormatter().formatCellValue(row.getCell(34, Row.MissingCellPolicy.CREATE_NULL_AS_BLANK)); + snPackagePrintColumnNumber = new DataFormatter().formatCellValue(row.getCell(34, Row.MissingCellPolicy.CREATE_NULL_AS_BLANK)).trim(); } catch (Exception e) { } //大包装条码匹配类型 String bigPackageMatchType = null; try { - bigPackageMatchType = new DataFormatter().formatCellValue(row.getCell(35, Row.MissingCellPolicy.CREATE_NULL_AS_BLANK)); + bigPackageMatchType = new DataFormatter().formatCellValue(row.getCell(35, Row.MissingCellPolicy.CREATE_NULL_AS_BLANK)).trim(); } catch (Exception e) { } //是否补件确认 String isRepairWorkReport = null; try { - isRepairWorkReport = new DataFormatter().formatCellValue(row.getCell(36, Row.MissingCellPolicy.CREATE_NULL_AS_BLANK)); + isRepairWorkReport = new DataFormatter().formatCellValue(row.getCell(36, Row.MissingCellPolicy.CREATE_NULL_AS_BLANK)).trim(); } catch (Exception e) { } //是否可手动报工 String isManualReport = null; try { - isManualReport = new DataFormatter().formatCellValue(row.getCell(37, Row.MissingCellPolicy.CREATE_NULL_AS_BLANK)); + isManualReport = new DataFormatter().formatCellValue(row.getCell(37, Row.MissingCellPolicy.CREATE_NULL_AS_BLANK)).trim(); } catch (Exception e) { }