Browse Source

2026-09-14

项目信息【Excel导入】,删除模板中的“模板编码”列
master
fengyuan_yang 6 days ago
parent
commit
68a8335f6a
  1. 15
      src/main/java/com/spring/modules/part/service/impl/PartInformationServiceImpl.java

15
src/main/java/com/spring/modules/part/service/impl/PartInformationServiceImpl.java

@ -4444,10 +4444,10 @@ public class PartInformationServiceImpl extends ServiceImpl<PartInformationMappe
task.setPartType(row.getCell(3).getStringCellValue()); // 零件类型 task.setPartType(row.getCell(3).getStringCellValue()); // 零件类型
task.setProductGroupId4(row.getCell(4).getStringCellValue()); // 计划人 task.setProductGroupId4(row.getCell(4).getStringCellValue()); // 计划人
task.setUmId(row.getCell(5).getStringCellValue()); // 计量单位 task.setUmId(row.getCell(5).getStringCellValue()); // 计量单位
if (row.getCell(6) == null) { // 属性模板
task.setCodeNo("");
if (row.getCell(6) == null) { // 应用描述
task.setApplicationDesc("");
} else { } else {
task.setCodeNo(row.getCell(6).getStringCellValue());
task.setApplicationDesc(row.getCell(6).getStringCellValue());
}*/ }*/
task.setBuNo(getCellValueAsString(row.getCell(0))); task.setBuNo(getCellValueAsString(row.getCell(0)));
task.setPartDesc(getCellValueAsString(row.getCell(1))); task.setPartDesc(getCellValueAsString(row.getCell(1)));
@ -4455,12 +4455,11 @@ public class PartInformationServiceImpl extends ServiceImpl<PartInformationMappe
task.setPartType(getCellValueAsString(row.getCell(3))); task.setPartType(getCellValueAsString(row.getCell(3)));
task.setProductGroupId4(getCellValueAsString(row.getCell(4))); task.setProductGroupId4(getCellValueAsString(row.getCell(4)));
task.setUmId(getCellValueAsString(row.getCell(5))); task.setUmId(getCellValueAsString(row.getCell(5)));
task.setCodeNo(getCellValueAsString(row.getCell(6)));
task.setApplicationDesc(getCellValueAsString(row.getCell(7)));
task.setApplicationDesc(getCellValueAsString(row.getCell(6)));
if (!StringUtils.hasText(task.getApplicationDesc())) { if (!StringUtils.hasText(task.getApplicationDesc())) {
throw new RuntimeException("第" + (j + 1) + "行应用描述不能为空"); throw new RuntimeException("第" + (j + 1) + "行应用描述不能为空");
} }
String productCategory = getCellValueAsString(row.getCell(8));
String productCategory = getCellValueAsString(row.getCell(7));
if (!StringUtils.hasText(productCategory)) { if (!StringUtils.hasText(productCategory)) {
throw new RuntimeException("第" + (j + 1) + "行产品类别不能为空"); throw new RuntimeException("第" + (j + 1) + "行产品类别不能为空");
} }
@ -4499,8 +4498,8 @@ public class PartInformationServiceImpl extends ServiceImpl<PartInformationMappe
if (row == null) { if (row == null) {
return true; return true;
} }
// Excel模板约定有效导入列为A-G均为空则视为导入结束
for (int i = 0; i <= 6; i++) {
// Excel模板约定有效导入列为A-H均为空则视为导入结束
for (int i = 0; i <= 7; i++) {
if (StringUtils.hasText(getCellValueAsString(row.getCell(i)))) { if (StringUtils.hasText(getCellValueAsString(row.getCell(i)))) {
return false; return false;
} }

Loading…
Cancel
Save