物料导入数据去掉空格

tags/yfai-mes-ext-v1.0
yxw 1 year ago
parent 416b98ee4d
commit 92223877ba

@ -138,7 +138,7 @@ public class PartExtExcelService implements IExcelImportExtService {
//物料代码 //物料代码
String partNo; String partNo;
try { 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) { } catch (Exception e) {
continue; continue;
} }
@ -146,259 +146,259 @@ public class PartExtExcelService implements IExcelImportExtService {
//物料名称 //物料名称
String partName = null; String partName = null;
try { 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) { } catch (Exception e) {
} }
//物料简称 //物料简称
String briefText = null; String briefText = null;
try { 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) { } catch (Exception e) {
} }
//单位 //单位
String unit = null; String unit = null;
try { 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) { } catch (Exception e) {
} }
//物料类型1 //物料类型1
String categoryCode1 = null; String categoryCode1 = null;
try { 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) { } catch (Exception e) {
} }
//物料类型2 //物料类型2
String categoryCode2 = null; String categoryCode2 = null;
try { 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) { } catch (Exception e) {
} }
//物料类型3 //物料类型3
String categoryCode3 = null; String categoryCode3 = null;
try { 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) { } catch (Exception e) {
} }
//产品编码匹配类型 //产品编码匹配类型
String processMatchType = null; String processMatchType = null;
try { 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) { } catch (Exception e) {
} }
//产品编码匹配类型 //产品编码匹配类型
String productMatchType = null; String productMatchType = null;
try { 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) { } catch (Exception e) {
} }
//包装编码匹配类型 //包装编码匹配类型
String packageMatchType = null; String packageMatchType = null;
try { 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) { } catch (Exception e) {
} }
//包装数量 //包装数量
String qty2 = null; String qty2 = null;
try { 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) { } catch (Exception e) {
} }
//产品生产类型 //产品生产类型
String pptCode = null; String pptCode = null;
try { 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) { } catch (Exception e) {
} }
//颜色代码 //颜色代码
String colorCode = null; String colorCode = null;
try { 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) { } catch (Exception e) {
} }
//颜色名称 //颜色名称
String colorName = null; String colorName = null;
try { 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) { } catch (Exception e) {
} }
//销售向 //销售向
String salesTo = null; String salesTo = null;
try { 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) { } catch (Exception e) {
} }
//是否出货检验 //是否出货检验
String isOqc = null; String isOqc = null;
try { 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) { } catch (Exception e) {
} }
//是否生成条码 //是否生成条码
String isCreateSn = null; String isCreateSn = null;
try { 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) { } catch (Exception e) {
} }
//是否PS部件 //是否PS部件
String isPSParts = null; String isPSParts = null;
try { 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) { } catch (Exception e) {
} }
//标准工数(min) //标准工数(min)
String standardWork = null; String standardWork = null;
try { 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) { } catch (Exception e) {
} }
//日文描述 //日文描述
String japanDesc = null; String japanDesc = null;
try { 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) { } catch (Exception e) {
} }
//商品码 //商品码
String goodsCode = null; String goodsCode = null;
try { 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) { } catch (Exception e) {
} }
//前缀 //前缀
String prefix = null; String prefix = null;
try { 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) { } catch (Exception e) {
} }
//质保书码 //质保书码
String qualityAssureCode = null; String qualityAssureCode = null;
try { 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) { } catch (Exception e) {
} }
//物料识别码 //物料识别码
String identifyCode = null; String identifyCode = null;
try { 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) { } catch (Exception e) {
} }
//条码末位数 //条码末位数
String snLastCode = null; String snLastCode = null;
try { 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) { } catch (Exception e) {
} }
//文件原名 //文件原名
String fileOriginName = null; String fileOriginName = null;
try { 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) { } catch (Exception e) {
} }
//包装条码打印张数 //包装条码打印张数
String packNoPrintTimes = null; String packNoPrintTimes = null;
try { 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) { } catch (Exception e) {
} }
//本体条码打印张数 //本体条码打印张数
String snPrintTimes = null; String snPrintTimes = null;
try { 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) { } catch (Exception e) {
} }
//本体条码打印列数 //本体条码打印列数
String printColumnNumber = null; String printColumnNumber = null;
try { 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) { } catch (Exception e) {
} }
//大本体条码匹配类型 //大本体条码匹配类型
String bigProcessMatchType = null; String bigProcessMatchType = null;
try { 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) { } catch (Exception e) {
} }
//是否打印质保书 //是否打印质保书
String isPrintQualityAssureIndia = null; String isPrintQualityAssureIndia = null;
try { 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) { } catch (Exception e) {
} }
//仕向地代码 //仕向地代码
String shiXiangDiCode = null; String shiXiangDiCode = null;
try { 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) { } catch (Exception e) {
} }
//型号 //型号
String model = null; String model = null;
try { 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) { } catch (Exception e) {
} }
//品番 //品番
String productNumber = null; String productNumber = null;
try { 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) { } catch (Exception e) {
} }
//大包装条码张数 //大包装条码张数
String snPackagePrintColumnNumber = null; String snPackagePrintColumnNumber = null;
try { 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) { } catch (Exception e) {
} }
//大包装条码匹配类型 //大包装条码匹配类型
String bigPackageMatchType = null; String bigPackageMatchType = null;
try { 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) { } catch (Exception e) {
} }
//是否补件确认 //是否补件确认
String isRepairWorkReport = null; String isRepairWorkReport = null;
try { 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) { } catch (Exception e) {
} }
//是否可手动报工 //是否可手动报工
String isManualReport = null; String isManualReport = null;
try { 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) { } catch (Exception e) {
} }

Loading…
Cancel
Save