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 f58f1dd..4bbfa8a 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 @@ -25,10 +25,7 @@ import cn.estsh.i3plus.pojo.mes.bean.MesPartCategory; import cn.estsh.i3plus.pojo.mes.repository.MesPartCategoryRepository; import cn.estsh.i3plus.pojo.mes.repository.MesPartProduceTypeRepository; import cn.estsh.impp.framework.boot.exception.ImppExceptionBuilder; -import org.apache.poi.ss.usermodel.CellType; -import org.apache.poi.ss.usermodel.Row; -import org.apache.poi.ss.usermodel.Sheet; -import org.apache.poi.ss.usermodel.Workbook; +import org.apache.poi.ss.usermodel.*; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import org.springframework.util.CollectionUtils; @@ -139,307 +136,269 @@ public class PartExtExcelService implements IExcelImportExtService { String errorInfo = ""; //错误信息 //物料代码 - String partNo = null; + String partNo; try { - row.getCell(0).setCellType(CellType.STRING); - partNo = row.getCell(0, Row.MissingCellPolicy.CREATE_NULL_AS_BLANK).getStringCellValue().trim(); - } catch (Exception var88) { + partNo = new DataFormatter().formatCellValue(row.getCell(0, Row.MissingCellPolicy.CREATE_NULL_AS_BLANK)); + } catch (Exception e) { continue; } //物料名称 String partName = null; try { - row.getCell(1).setCellType(CellType.STRING); - partName = row.getCell(1, Row.MissingCellPolicy.CREATE_NULL_AS_BLANK).getStringCellValue().trim(); - } catch (Exception var80) { + partName = new DataFormatter().formatCellValue(row.getCell(1, Row.MissingCellPolicy.CREATE_NULL_AS_BLANK)); + } catch (Exception e) { } //物料简称 String briefText = null; try { - row.getCell(2).setCellType(CellType.STRING); - briefText = row.getCell(2, Row.MissingCellPolicy.CREATE_NULL_AS_BLANK).getStringCellValue().trim(); - } catch (Exception var79) { + briefText = new DataFormatter().formatCellValue(row.getCell(2, Row.MissingCellPolicy.CREATE_NULL_AS_BLANK)); + } catch (Exception e) { } //单位 String unit = null; try { - row.getCell(3).setCellType(CellType.STRING); - unit = row.getCell(3, Row.MissingCellPolicy.CREATE_NULL_AS_BLANK).getStringCellValue().trim(); - } catch (Exception var77) { + unit = new DataFormatter().formatCellValue(row.getCell(3, Row.MissingCellPolicy.CREATE_NULL_AS_BLANK)); + } catch (Exception e) { } //物料类型1 String categoryCode1 = null; try { - row.getCell(4).setCellType(CellType.STRING); - categoryCode1 = row.getCell(4, Row.MissingCellPolicy.CREATE_NULL_AS_BLANK).getStringCellValue().trim(); - } catch (Exception var76) { + categoryCode1 = new DataFormatter().formatCellValue(row.getCell(4, Row.MissingCellPolicy.CREATE_NULL_AS_BLANK)); + } catch (Exception e) { } //物料类型2 String categoryCode2 = null; try { - row.getCell(5).setCellType(CellType.STRING); - categoryCode2 = row.getCell(5, Row.MissingCellPolicy.CREATE_NULL_AS_BLANK).getStringCellValue().trim(); - } catch (Exception var75) { + categoryCode2 = new DataFormatter().formatCellValue(row.getCell(5, Row.MissingCellPolicy.CREATE_NULL_AS_BLANK)); + } catch (Exception e) { } //物料类型3 String categoryCode3 = null; try { - row.getCell(6).setCellType(CellType.STRING); - categoryCode3 = row.getCell(6, Row.MissingCellPolicy.CREATE_NULL_AS_BLANK).getStringCellValue().trim(); - } catch (Exception var74) { + categoryCode3 = new DataFormatter().formatCellValue(row.getCell(6, Row.MissingCellPolicy.CREATE_NULL_AS_BLANK)); + } catch (Exception e) { } //产品编码匹配类型 String processMatchType = null; try { - row.getCell(7).setCellType(CellType.STRING); - processMatchType = row.getCell(7, Row.MissingCellPolicy.CREATE_NULL_AS_BLANK).getStringCellValue().trim(); - } catch (Exception var70) { + processMatchType = new DataFormatter().formatCellValue(row.getCell(7, Row.MissingCellPolicy.CREATE_NULL_AS_BLANK)); + } catch (Exception e) { } //产品编码匹配类型 String productMatchType = null; try { - row.getCell(8).setCellType(CellType.STRING); - productMatchType = row.getCell(8, Row.MissingCellPolicy.CREATE_NULL_AS_BLANK).getStringCellValue().trim(); - } catch (Exception var68) { + productMatchType = new DataFormatter().formatCellValue(row.getCell(8, Row.MissingCellPolicy.CREATE_NULL_AS_BLANK)); + } catch (Exception e) { } -// //包装编码匹配类型 -// String packageMatchType = null; -// try { -// row.getCell(8).setCellType(CellType.STRING); -// packageMatchType = row.getCell(8, Row.MissingCellPolicy.CREATE_NULL_AS_BLANK).getStringCellValue().trim(); -// } catch (Exception var68) { -// } + //包装编码匹配类型 + String packageMatchType = null; + try { + packageMatchType = new DataFormatter().formatCellValue(row.getCell(9, Row.MissingCellPolicy.CREATE_NULL_AS_BLANK)); + } catch (Exception e) { + } //包装数量 String qty2 = null; try { - row.getCell(9).setCellType(CellType.STRING); - qty2 = row.getCell(9, Row.MissingCellPolicy.CREATE_NULL_AS_BLANK).getStringCellValue().trim(); - } catch (Exception var67) { + qty2 = new DataFormatter().formatCellValue(row.getCell(10, Row.MissingCellPolicy.CREATE_NULL_AS_BLANK)); + } catch (Exception e) { } //产品生产类型 String pptCode = null; try { - row.getCell(10).setCellType(CellType.STRING); - pptCode = row.getCell(10, Row.MissingCellPolicy.CREATE_NULL_AS_BLANK).getStringCellValue().trim(); - } catch (Exception var66) { + pptCode = new DataFormatter().formatCellValue(row.getCell(11, Row.MissingCellPolicy.CREATE_NULL_AS_BLANK)); + } catch (Exception e) { } //颜色代码 String colorCode = null; try { - row.getCell(11).setCellType(CellType.STRING); - colorCode = row.getCell(11, Row.MissingCellPolicy.CREATE_NULL_AS_BLANK).getStringCellValue().trim(); - } catch (Exception var64) { + colorCode = new DataFormatter().formatCellValue(row.getCell(12, Row.MissingCellPolicy.CREATE_NULL_AS_BLANK)); + } catch (Exception e) { } //颜色名称 String colorName = null; try { - row.getCell(12).setCellType(CellType.STRING); - colorName = row.getCell(12, Row.MissingCellPolicy.CREATE_NULL_AS_BLANK).getStringCellValue().trim(); - } catch (Exception var63) { + colorName = new DataFormatter().formatCellValue(row.getCell(13, Row.MissingCellPolicy.CREATE_NULL_AS_BLANK)); + } catch (Exception e) { } //销售向 String salesTo = null; try { - row.getCell(13).setCellType(CellType.STRING); - salesTo = row.getCell(13, Row.MissingCellPolicy.CREATE_NULL_AS_BLANK).getStringCellValue().trim(); - } catch (Exception var62) { + salesTo = new DataFormatter().formatCellValue(row.getCell(14, Row.MissingCellPolicy.CREATE_NULL_AS_BLANK)); + } catch (Exception e) { } //是否出货检验 String isOqc = null; try { - row.getCell(14).setCellType(CellType.STRING); - isOqc = row.getCell(14, Row.MissingCellPolicy.CREATE_NULL_AS_BLANK).getStringCellValue().trim(); - } catch (Exception var61) { + isOqc = new DataFormatter().formatCellValue(row.getCell(15, Row.MissingCellPolicy.CREATE_NULL_AS_BLANK)); + } catch (Exception e) { } //是否生成条码 String isCreateSn = null; try { - row.getCell(15).setCellType(CellType.STRING); - isCreateSn = row.getCell(15, Row.MissingCellPolicy.CREATE_NULL_AS_BLANK).getStringCellValue().trim(); - } catch (Exception var60) { + isCreateSn = new DataFormatter().formatCellValue(row.getCell(16, Row.MissingCellPolicy.CREATE_NULL_AS_BLANK)); + } catch (Exception e) { } //是否PS部件 String isPSParts = null; try { - row.getCell(16).setCellType(CellType.STRING); - isPSParts = row.getCell(16, Row.MissingCellPolicy.CREATE_NULL_AS_BLANK).getStringCellValue().trim(); - } catch (Exception var59) { + isPSParts = new DataFormatter().formatCellValue(row.getCell(17, Row.MissingCellPolicy.CREATE_NULL_AS_BLANK)); + } catch (Exception e) { } //标准工数(min) String standardWork = null; try { - row.getCell(17).setCellType(CellType.STRING); - standardWork = row.getCell(17, Row.MissingCellPolicy.CREATE_NULL_AS_BLANK).getStringCellValue().trim(); - } catch (Exception var58) { + standardWork = new DataFormatter().formatCellValue(row.getCell(18, Row.MissingCellPolicy.CREATE_NULL_AS_BLANK)); + } catch (Exception e) { } //日文描述 String japanDesc = null; try { - row.getCell(18).setCellType(CellType.STRING); - japanDesc = row.getCell(18, Row.MissingCellPolicy.CREATE_NULL_AS_BLANK).getStringCellValue().trim(); - } catch (Exception var58) { + japanDesc = new DataFormatter().formatCellValue(row.getCell(19, Row.MissingCellPolicy.CREATE_NULL_AS_BLANK)); + } catch (Exception e) { } //商品码 String goodsCode = null; try { - row.getCell(19).setCellType(CellType.STRING); - goodsCode = row.getCell(19, Row.MissingCellPolicy.CREATE_NULL_AS_BLANK).getStringCellValue().trim(); - } catch (Exception var58) { + goodsCode = new DataFormatter().formatCellValue(row.getCell(20, Row.MissingCellPolicy.CREATE_NULL_AS_BLANK)); + } catch (Exception e) { } //前缀 String prefix = null; try { - row.getCell(20).setCellType(CellType.STRING); - prefix = row.getCell(20, Row.MissingCellPolicy.CREATE_NULL_AS_BLANK).getStringCellValue().trim(); - } catch (Exception var58) { + prefix = new DataFormatter().formatCellValue(row.getCell(21, Row.MissingCellPolicy.CREATE_NULL_AS_BLANK)); + } catch (Exception e) { } //质保书码 String qualityAssureCode = null; try { - row.getCell(21).setCellType(CellType.STRING); - qualityAssureCode = row.getCell(21, Row.MissingCellPolicy.CREATE_NULL_AS_BLANK).getStringCellValue().trim(); - } catch (Exception var58) { + qualityAssureCode = new DataFormatter().formatCellValue(row.getCell(22, Row.MissingCellPolicy.CREATE_NULL_AS_BLANK)); + } catch (Exception e) { } //物料识别码 String identifyCode = null; try { - row.getCell(22).setCellType(CellType.STRING); - identifyCode = row.getCell(22, Row.MissingCellPolicy.CREATE_NULL_AS_BLANK).getStringCellValue().trim(); - } catch (Exception var58) { + identifyCode = new DataFormatter().formatCellValue(row.getCell(23, Row.MissingCellPolicy.CREATE_NULL_AS_BLANK)); + } catch (Exception e) { } //条码末位数 String snLastCode = null; try { - row.getCell(23).setCellType(CellType.STRING); - snLastCode = row.getCell(23, Row.MissingCellPolicy.CREATE_NULL_AS_BLANK).getStringCellValue().trim(); - } catch (Exception var58) { + snLastCode = new DataFormatter().formatCellValue(row.getCell(24, Row.MissingCellPolicy.CREATE_NULL_AS_BLANK)); + } catch (Exception e) { } //文件原名 String fileOriginName = null; try { - row.getCell(24).setCellType(CellType.STRING); - fileOriginName = row.getCell(24, Row.MissingCellPolicy.CREATE_NULL_AS_BLANK).getStringCellValue().trim(); + fileOriginName = new DataFormatter().formatCellValue(row.getCell(25, Row.MissingCellPolicy.CREATE_NULL_AS_BLANK)); } catch (Exception e) { } //包装条码打印张数 String packNoPrintTimes = null; try { - row.getCell(25).setCellType(CellType.STRING); - packNoPrintTimes = row.getCell(25, Row.MissingCellPolicy.CREATE_NULL_AS_BLANK).getStringCellValue().trim(); + packNoPrintTimes = new DataFormatter().formatCellValue(row.getCell(26, Row.MissingCellPolicy.CREATE_NULL_AS_BLANK)); } catch (Exception e) { } //本体条码打印张数 String snPrintTimes = null; try { - row.getCell(26).setCellType(CellType.STRING); - snPrintTimes = row.getCell(26, Row.MissingCellPolicy.CREATE_NULL_AS_BLANK).getStringCellValue().trim(); + snPrintTimes = new DataFormatter().formatCellValue(row.getCell(27, Row.MissingCellPolicy.CREATE_NULL_AS_BLANK)); } catch (Exception e) { } //本体条码打印列数 String printColumnNumber = null; try { - row.getCell(27).setCellType(CellType.STRING); - printColumnNumber = row.getCell(27, Row.MissingCellPolicy.CREATE_NULL_AS_BLANK).getStringCellValue().trim(); + printColumnNumber = new DataFormatter().formatCellValue(row.getCell(28, Row.MissingCellPolicy.CREATE_NULL_AS_BLANK)); } catch (Exception e) { } //大本体条码匹配类型 String bigProcessMatchType = null; try { - row.getCell(28).setCellType(CellType.STRING); - bigProcessMatchType = row.getCell(28, Row.MissingCellPolicy.CREATE_NULL_AS_BLANK).getStringCellValue().trim(); + bigProcessMatchType = new DataFormatter().formatCellValue(row.getCell(29, Row.MissingCellPolicy.CREATE_NULL_AS_BLANK)); } catch (Exception e) { } //是否打印质保书 String isPrintQualityAssureIndia = null; try { - row.getCell(29).setCellType(CellType.STRING); - isPrintQualityAssureIndia = row.getCell(29, Row.MissingCellPolicy.CREATE_NULL_AS_BLANK).getStringCellValue().trim(); + isPrintQualityAssureIndia = new DataFormatter().formatCellValue(row.getCell(30, Row.MissingCellPolicy.CREATE_NULL_AS_BLANK)); } catch (Exception e) { } //仕向地代码 String shiXiangDiCode = null; try { - row.getCell(30).setCellType(CellType.STRING); - shiXiangDiCode = row.getCell(30, Row.MissingCellPolicy.CREATE_NULL_AS_BLANK).getStringCellValue().trim(); + shiXiangDiCode = new DataFormatter().formatCellValue(row.getCell(31, Row.MissingCellPolicy.CREATE_NULL_AS_BLANK)); } catch (Exception e) { } //型号 String model = null; try { - row.getCell(31).setCellType(CellType.STRING); - model = row.getCell(31, Row.MissingCellPolicy.CREATE_NULL_AS_BLANK).getStringCellValue().trim(); + model = new DataFormatter().formatCellValue(row.getCell(32, Row.MissingCellPolicy.CREATE_NULL_AS_BLANK)); } catch (Exception e) { } //品番 String productNumber = null; try { - row.getCell(32).setCellType(CellType.STRING); - productNumber = row.getCell(32, Row.MissingCellPolicy.CREATE_NULL_AS_BLANK).getStringCellValue().trim(); + productNumber = new DataFormatter().formatCellValue(row.getCell(33, Row.MissingCellPolicy.CREATE_NULL_AS_BLANK)); } catch (Exception e) { } //大包装条码张数 String snPackagePrintColumnNumber = null; try { - row.getCell(33).setCellType(CellType.STRING); - snPackagePrintColumnNumber = row.getCell(33, Row.MissingCellPolicy.CREATE_NULL_AS_BLANK).getStringCellValue().trim(); + snPackagePrintColumnNumber = new DataFormatter().formatCellValue(row.getCell(34, Row.MissingCellPolicy.CREATE_NULL_AS_BLANK)); } catch (Exception e) { } //大包装条码匹配类型 String bigPackageMatchType = null; try { - row.getCell(34).setCellType(CellType.STRING); - bigPackageMatchType = row.getCell(34, Row.MissingCellPolicy.CREATE_NULL_AS_BLANK).getStringCellValue().trim(); + bigPackageMatchType = new DataFormatter().formatCellValue(row.getCell(35, Row.MissingCellPolicy.CREATE_NULL_AS_BLANK)); } catch (Exception e) { } //是否补件确认 String isRepairWorkReport = null; try { - row.getCell(35).setCellType(CellType.STRING); - isRepairWorkReport = row.getCell(35, Row.MissingCellPolicy.CREATE_NULL_AS_BLANK).getStringCellValue().trim(); + isRepairWorkReport = new DataFormatter().formatCellValue(row.getCell(36, Row.MissingCellPolicy.CREATE_NULL_AS_BLANK)); } catch (Exception e) { } //是否可手动报工 String isManualReport = null; try { - row.getCell(36).setCellType(CellType.STRING); - isRepairWorkReport = row.getCell(36, Row.MissingCellPolicy.CREATE_NULL_AS_BLANK).getStringCellValue().trim(); + isManualReport = new DataFormatter().formatCellValue(row.getCell(37, Row.MissingCellPolicy.CREATE_NULL_AS_BLANK)); } catch (Exception e) { } @@ -485,28 +444,22 @@ public class PartExtExcelService implements IExcelImportExtService { errorInfo = errorInfo + "第G列数据无效;"; } - if (StringUtils.isEmpty(processMatchType)) { + if (!StringUtils.isEmpty(processMatchType) && StringUtils.isEmpty(MesExtEnumUtil.ENCODE_MATCH_TYPE.descriptionOfValue(processMatchType))) { ++errorNum; cellNum = cellNum + "H;"; - errorInfo = errorInfo + "第H列数据必填;"; - } else { - if (StringUtils.isEmpty(MesExtEnumUtil.ENCODE_MATCH_TYPE.descriptionOfValue(processMatchType))) { - ++errorNum; - cellNum = cellNum + "H;"; - errorInfo = errorInfo + "第H列数据无效;"; - } + errorInfo = errorInfo + "第H列数据无效;"; } - if (StringUtils.isEmpty(productMatchType)) { + if (!StringUtils.isEmpty(productMatchType) && StringUtils.isEmpty(MesExtEnumUtil.ENCODE_MATCH_TYPE.descriptionOfValue(productMatchType))) { ++errorNum; cellNum = cellNum + "I;"; - errorInfo = errorInfo + "第I列数据必填;"; - } else { - if (StringUtils.isEmpty(MesExtEnumUtil.ENCODE_MATCH_TYPE.descriptionOfValue(productMatchType))) { - ++errorNum; - cellNum = cellNum + "I;"; - errorInfo = errorInfo + "第I列数据无效;"; - } + errorInfo = errorInfo + "第I列数据无效;"; + } + + if (!StringUtils.isEmpty(packageMatchType) && StringUtils.isEmpty(MesExtEnumUtil.ENCODE_MATCH_TYPE.descriptionOfValue(packageMatchType))) { + ++errorNum; + cellNum = cellNum + "J;"; + errorInfo = errorInfo + "第J列数据无效;"; } if (!StringUtils.isEmpty(qty2)) { @@ -514,56 +467,56 @@ public class PartExtExcelService implements IExcelImportExtService { Integer.valueOf(qty2); } catch (NumberFormatException var83) { ++errorNum; - cellNum = cellNum + "J;"; - errorInfo = errorInfo + "第J列数据无效;"; + cellNum = cellNum + "K;"; + errorInfo = errorInfo + "第K列数据无效;"; } } if (!StringUtils.isEmpty(pptCode) && (CollectionUtils.isEmpty(partProduceTypeEntityMap) || !CollectionUtils.isEmpty(partProduceTypeEntityMap) && !partProduceTypeEntityMap.containsKey(pptCode))) { ++errorNum; - cellNum = cellNum + "K;"; - errorInfo = errorInfo + "第K列数据无效;"; + cellNum = cellNum + "L;"; + errorInfo = errorInfo + "第L列数据无效;"; } if (!StringUtils.isEmpty(salesTo) && StringUtils.isEmpty(MesExtEnumUtil.SALES_TO.descriptionOfValue(salesTo))) { ++errorNum; - cellNum = cellNum + "N;"; - errorInfo = errorInfo + "第N列数据无效;"; + cellNum = cellNum + "O;"; + errorInfo = errorInfo + "第O列数据无效;"; } if (StringUtils.isEmpty(isOqc)) { ++errorNum; - cellNum = cellNum + "O;"; - errorInfo = errorInfo + "第O列数据必填;"; + cellNum = cellNum + "P;"; + errorInfo = errorInfo + "第P列数据必填;"; } else { if (StringUtils.isEmpty(CommonEnumUtil.TRUE_OR_FALSE.descriptionOfValue(isOqc))) { ++errorNum; - cellNum = cellNum + "O"; - errorInfo = errorInfo + "第O列数据无效;"; + cellNum = cellNum + "P"; + errorInfo = errorInfo + "第P列数据无效;"; } } if (StringUtils.isEmpty(isCreateSn)) { ++errorNum; - cellNum = cellNum + "P;"; - errorInfo = errorInfo + "第P列数据必填;"; + cellNum = cellNum + "Q;"; + errorInfo = errorInfo + "第Q列数据必填;"; } else { if (StringUtils.isEmpty(CommonEnumUtil.TRUE_OR_FALSE.descriptionOfValue(isCreateSn))) { ++errorNum; - cellNum = cellNum + "P"; - errorInfo = errorInfo + "第P列数据无效;"; + cellNum = cellNum + "Q"; + errorInfo = errorInfo + "第Q列数据无效;"; } } if (StringUtils.isEmpty(isPSParts)) { ++errorNum; - cellNum = cellNum + "Q;"; - errorInfo = errorInfo + "第Q列数据必填;"; + cellNum = cellNum + "R;"; + errorInfo = errorInfo + "第R列数据必填;"; } else { if (StringUtils.isEmpty(CommonEnumUtil.TRUE_OR_FALSE.descriptionOfValue(isPSParts))) { ++errorNum; - cellNum = cellNum + "Q"; - errorInfo = errorInfo + "第Q列数据无效;"; + cellNum = cellNum + "R"; + errorInfo = errorInfo + "第R列数据无效;"; } } @@ -571,19 +524,19 @@ public class PartExtExcelService implements IExcelImportExtService { try { if (MathOperation.compareTo(Double.valueOf(standardWork), new Double(0)) < 0) { errorNum++; - cellNum += "R;"; - errorInfo += "第R列数据不能小于0;"; + cellNum += "S;"; + errorInfo += "第S列数据不能小于0;"; } String[] standardWorkArr = standardWork.split(MesExtConstWords.DECIMAL_POINT); if (null != standardWorkArr && standardWorkArr.length == 2 && standardWorkArr[1].length() > 2) { errorNum++; - cellNum += "R;"; - errorInfo += "第R列数据无效,最多2位小数;"; + cellNum += "S;"; + errorInfo += "第S列数据无效,最多2位小数;"; } } catch (NumberFormatException e) { errorNum ++; - cellNum += "R;"; - errorInfo += "第R列数据无效;"; + cellNum += "S;"; + errorInfo += "第S列数据无效;"; } } @@ -591,14 +544,14 @@ public class PartExtExcelService implements IExcelImportExtService { if (!StringUtils.isEmpty(fileOriginName)) { if (!fileOriginName.contains(".")) { errorNum ++; - cellNum += "Y;"; - errorInfo += "第Y列数据无效;"; + cellNum += "Z;"; + errorInfo += "第Z列数据无效;"; } else { String fileType = fileOriginName.substring(fileOriginName.lastIndexOf(".")); if (StringUtils.isEmpty(fileType) || (!fileType.equals(".jpg") && !fileType.equals(".jpeg") && !fileType.equals(".png"))) { errorNum ++; - cellNum += "Y;"; - errorInfo += "第Y列数据无效;"; + cellNum += "Z;"; + errorInfo += "第Z列数据无效;"; } } } @@ -608,13 +561,13 @@ public class PartExtExcelService implements IExcelImportExtService { Integer packNoPrintTimesNumber = Integer.valueOf(packNoPrintTimes); if(packNoPrintTimesNumber <= 0){ ++errorNum; - cellNum = cellNum + "Z;"; - errorInfo = errorInfo + "第Z列数据无效;"; + cellNum = cellNum + "AA;"; + errorInfo = errorInfo + "第AA列数据无效;"; } } catch (NumberFormatException var83) { ++errorNum; - cellNum = cellNum + "Z;"; - errorInfo = errorInfo + "第Z列数据无效;"; + cellNum = cellNum + "AA;"; + errorInfo = errorInfo + "第AA列数据无效;"; } } @@ -623,13 +576,13 @@ public class PartExtExcelService implements IExcelImportExtService { Integer snPrintTimesNumber = Integer.valueOf(snPrintTimes); if(snPrintTimesNumber <= 0){ ++errorNum; - cellNum = cellNum + "AA;"; - errorInfo = errorInfo + "第AA列数据无效;"; + cellNum = cellNum + "AB;"; + errorInfo = errorInfo + "第AB列数据无效;"; } } catch (NumberFormatException var83) { ++errorNum; - cellNum = cellNum + "AA;"; - errorInfo = errorInfo + "第AA列数据无效;"; + cellNum = cellNum + "AB;"; + errorInfo = errorInfo + "第AB列数据无效;"; } } @@ -638,32 +591,32 @@ public class PartExtExcelService implements IExcelImportExtService { Integer snPrintTimesNumber = Integer.valueOf(printColumnNumber); if(snPrintTimesNumber <= 0){ ++errorNum; - cellNum = cellNum + "AB;"; - errorInfo = errorInfo + "第AB列数据无效;"; + cellNum = cellNum + "AC;"; + errorInfo = errorInfo + "第AC列数据无效;"; } } catch (NumberFormatException var83) { ++errorNum; - cellNum = cellNum + "AB;"; - errorInfo = errorInfo + "第AB列数据无效;"; + cellNum = cellNum + "AC;"; + errorInfo = errorInfo + "第AC列数据无效;"; } } if (!StringUtils.isEmpty(bigProcessMatchType)) { if (StringUtils.isEmpty(MesExtEnumUtil.ENCODE_MATCH_TYPE.descriptionOfValue(bigProcessMatchType))) { ++errorNum; - cellNum = cellNum + "AC;"; - errorInfo = errorInfo + "第AC列数据无效;"; + cellNum = cellNum + "AD;"; + errorInfo = errorInfo + "第AD列数据无效;"; } } if(StringUtils.isEmpty(isPrintQualityAssureIndia)){ ++errorNum; - cellNum = cellNum + "AD;"; - errorInfo = errorInfo + "第AD列数据必填;"; + cellNum = cellNum + "AE;"; + errorInfo = errorInfo + "第AE列数据必填;"; }else if (StringUtils.isEmpty(MesExtEnumUtil.IS_PRINT_QUALITY_ASSURE_INDIA.valueOfDescription(Integer.parseInt(isPrintQualityAssureIndia)))){ ++errorNum; - cellNum = cellNum + "AD;"; - errorInfo = errorInfo + "第AD列数据无效;"; + cellNum = cellNum + "AE;"; + errorInfo = errorInfo + "第AE列数据无效;"; } if (!StringUtils.isEmpty(snPackagePrintColumnNumber)) { @@ -671,37 +624,32 @@ public class PartExtExcelService implements IExcelImportExtService { Integer snPrintTimesNumber = Integer.valueOf(snPackagePrintColumnNumber); if(snPrintTimesNumber <= 0){ ++errorNum; - cellNum = cellNum + "AH;"; - errorInfo = errorInfo + "第AH列数据无效;"; + cellNum = cellNum + "AI;"; + errorInfo = errorInfo + "第AI列数据无效;"; } } catch (NumberFormatException var83) { ++errorNum; - cellNum = cellNum + "AH;"; - errorInfo = errorInfo + "第AH列数据无效;"; + cellNum = cellNum + "AI;"; + errorInfo = errorInfo + "第AI列数据无效;"; } } - if (!StringUtils.isEmpty(bigPackageMatchType)) { - if (StringUtils.isEmpty(MesExtEnumUtil.ENCODE_MATCH_TYPE.descriptionOfValue(bigPackageMatchType))) { - ++errorNum; - cellNum = cellNum + "AC;"; - errorInfo = errorInfo + "第AC列数据无效;"; - } + if (!StringUtils.isEmpty(bigPackageMatchType) && StringUtils.isEmpty(MesExtEnumUtil.ENCODE_MATCH_TYPE.descriptionOfValue(bigPackageMatchType))) { + ++errorNum; + cellNum = cellNum + "AJ;"; + errorInfo = errorInfo + "第AJ列数据无效;"; } - if (!StringUtils.isEmpty(isRepairWorkReport)) { - if (StringUtils.isEmpty(MesExtEnumUtil.IS_REPAIR_WORK_REPORT.valueOfDescription(Integer.parseInt(isRepairWorkReport)))) { - ++errorNum; - cellNum = cellNum + "AJ;"; - errorInfo = errorInfo + "第AJ列数据无效;"; - } + + if (!StringUtils.isEmpty(isRepairWorkReport) && StringUtils.isEmpty(MesExtEnumUtil.IS_REPAIR_WORK_REPORT.valueOfDescription(Integer.parseInt(isRepairWorkReport)))) { + ++errorNum; + cellNum = cellNum + "AK;"; + errorInfo = errorInfo + "第AK列数据无效;"; } - if (!StringUtils.isEmpty(isRepairWorkReport)) { - if (StringUtils.isEmpty(MesExtEnumUtil.IS_REPAIR_WORK_REPORT.valueOfDescription(Integer.parseInt(isRepairWorkReport)))) { - ++errorNum; - cellNum = cellNum + "AJ;"; - errorInfo = errorInfo + "第AJ列数据无效;"; - } + if (!StringUtils.isEmpty(isManualReport) && StringUtils.isEmpty(MesExtEnumUtil.IS_MANUAL_REPORT.valueOfDescription(Integer.parseInt(isManualReport)))) { + ++errorNum; + cellNum = cellNum + "AL;"; + errorInfo = errorInfo + "第AL列数据无效;"; } if (errorNum == 0) { @@ -720,7 +668,7 @@ public class PartExtExcelService implements IExcelImportExtService { newPartExt.setCategoryCode3(StringUtils.isEmpty(categoryCode3) ? null : categoryCode3); newPartExt.setProcessMatchType(StringUtils.isEmpty(processMatchType) ? null : MesExtEnumUtil.ENCODE_MATCH_TYPE.descriptionOfValue(processMatchType)); newPartExt.setProductMatchType(StringUtils.isEmpty(productMatchType) ? null : MesExtEnumUtil.ENCODE_MATCH_TYPE.descriptionOfValue(productMatchType)); -// newPartExt.setPackageMatchType(StringUtils.isEmpty(packageMatchType) ? null : MesExtEnumUtil.ENCODE_MATCH_TYPE.descriptionOfValue(packageMatchType)); + newPartExt.setPackageMatchType(StringUtils.isEmpty(packageMatchType) ? null : MesExtEnumUtil.ENCODE_MATCH_TYPE.descriptionOfValue(packageMatchType)); newPartExt.setQty2(StringUtils.isEmpty(qty2) ? null : Double.parseDouble(qty2)); newPartExt.setPptCode(pptCode); newPartExt.setColorCode(colorCode); @@ -767,7 +715,7 @@ public class PartExtExcelService implements IExcelImportExtService { mesPart.setCategoryCode3(StringUtils.isEmpty(categoryCode3) ? null : categoryCode3); mesPart.setProcessMatchType(StringUtils.isEmpty(processMatchType) ? null : MesExtEnumUtil.ENCODE_MATCH_TYPE.descriptionOfValue(processMatchType)); mesPart.setProductMatchType(StringUtils.isEmpty(productMatchType) ? null : MesExtEnumUtil.ENCODE_MATCH_TYPE.descriptionOfValue(productMatchType)); -// mesPart.setPackageMatchType(StringUtils.isEmpty(packageMatchType) ? null : MesExtEnumUtil.ENCODE_MATCH_TYPE.descriptionOfValue(packageMatchType)); + mesPart.setPackageMatchType(StringUtils.isEmpty(packageMatchType) ? null : MesExtEnumUtil.ENCODE_MATCH_TYPE.descriptionOfValue(packageMatchType)); mesPart.setQty2(StringUtils.isEmpty(qty2) ? null : Double.parseDouble(qty2)); mesPart.setPptCode(pptCode); mesPart.setColorCode(colorCode);