2025-12-19bug修改
This commit is contained in:
@ -261,13 +261,37 @@ public class DesVolumeCatalogController extends BaseController {
|
|||||||
Row row = sheet.getRow(rowIndex);
|
Row row = sheet.getRow(rowIndex);
|
||||||
if (hasValidData(row)) {
|
if (hasValidData(row)) {
|
||||||
String designSubitem = getCellValue(row.getCell(0));
|
String designSubitem = getCellValue(row.getCell(0));
|
||||||
|
if (designSubitem == null || designSubitem.isEmpty()){
|
||||||
|
throw new RuntimeException("第"+(rowIndex+1)+"行:子项名称不能为空");
|
||||||
|
}
|
||||||
String specialty = getCellValue(row.getCell(1));
|
String specialty = getCellValue(row.getCell(1));
|
||||||
|
if (specialty == null || specialty.isEmpty()){
|
||||||
|
throw new RuntimeException("第"+(rowIndex+1)+"行:专业不能为空");
|
||||||
|
}
|
||||||
String specialtyId = getCellValue(row.getCell(2));
|
String specialtyId = getCellValue(row.getCell(2));
|
||||||
|
if (specialtyId == null || specialtyId.isEmpty()){
|
||||||
|
throw new RuntimeException("第"+(rowIndex+1)+"行:专业"+specialty+"不存在,推荐使用系统下载模板进行数据填充");
|
||||||
|
}
|
||||||
String principal = getCellValue(row.getCell(3));
|
String principal = getCellValue(row.getCell(3));
|
||||||
|
if (principal == null || principal.isEmpty()){
|
||||||
|
throw new RuntimeException("第"+(rowIndex+1)+"行:人员不能为空");
|
||||||
|
}
|
||||||
String principalId = getCellValue(row.getCell(4));
|
String principalId = getCellValue(row.getCell(4));
|
||||||
|
if (principalId == null || principalId.isEmpty()){
|
||||||
|
throw new RuntimeException("第"+(rowIndex+1)+"行:人员"+principal+"不存在,推荐使用系统下载模板进行数据填充");
|
||||||
|
}
|
||||||
String volumeNumber = getCellValue(row.getCell(5));
|
String volumeNumber = getCellValue(row.getCell(5));
|
||||||
|
if (volumeNumber == null || volumeNumber.isEmpty()){
|
||||||
|
throw new RuntimeException("第"+(rowIndex+1)+"行:卷册编号不能为空");
|
||||||
|
}
|
||||||
String documentName = getCellValue(row.getCell(6));
|
String documentName = getCellValue(row.getCell(6));
|
||||||
|
if (documentName == null || documentName.isEmpty()){
|
||||||
|
throw new RuntimeException("第"+(rowIndex+1)+"行:资料名称不能为空");
|
||||||
|
}
|
||||||
LocalDate plannedCompletion = getLocalDateValue(row.getCell(7));
|
LocalDate plannedCompletion = getLocalDateValue(row.getCell(7));
|
||||||
|
if (plannedCompletion == null){
|
||||||
|
throw new RuntimeException("第"+(rowIndex+1)+"行:计划出图时间不能为空");
|
||||||
|
}
|
||||||
|
|
||||||
ExcelData excelData = new ExcelData(
|
ExcelData excelData = new ExcelData(
|
||||||
designSubitem, specialtyId, principalId, volumeNumber, documentName,
|
designSubitem, specialtyId, principalId, volumeNumber, documentName,
|
||||||
|
|||||||
@ -37,7 +37,7 @@ public class BusBillofquantitiesBo extends BaseEntity {
|
|||||||
/**
|
/**
|
||||||
* 表名
|
* 表名
|
||||||
*/
|
*/
|
||||||
@NotBlank(message = "表名不能为空", groups = { AddGroup.class, EditGroup.class })
|
// @NotBlank(message = "表名不能为空", groups = { AddGroup.class, EditGroup.class })
|
||||||
private String sheet;
|
private String sheet;
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -529,8 +529,8 @@ public class DesVolumeCatalogServiceImpl extends ServiceImpl<DesVolumeCatalogMap
|
|||||||
|
|
||||||
// 主 Sheet 设置表头
|
// 主 Sheet 设置表头
|
||||||
Row sheetRow = mainSheet.createRow(0);
|
Row sheetRow = mainSheet.createRow(0);
|
||||||
String[] headers = {"子项名称", "专业", "专业编码",
|
String[] headers = {"*子项名称", "*专业", "*专业编码",
|
||||||
"人员", "人员编码", "卷册号", "资料名称", "计划出图时间"};
|
"*人员", "*人员编码", "*卷册号", "*资料名称", "*计划出图时间"};
|
||||||
for (int i = 0; i < headers.length; i++) {
|
for (int i = 0; i < headers.length; i++) {
|
||||||
Cell cell = sheetRow.createCell(i);
|
Cell cell = sheetRow.createCell(i);
|
||||||
cell.setCellValue(headers[i]);
|
cell.setCellValue(headers[i]);
|
||||||
|
|||||||
Reference in New Issue
Block a user