相关人员导入修改

This commit is contained in:
xiejunyu
2022-06-16 09:34:47 +08:00
parent 08eec96bcd
commit ddc00ef684
@@ -746,7 +746,7 @@ public class ProjectRelatedPersonnelServiceImpl extends ServiceImpl<ProjectRelat
List<ProjectRelatedPersonnel> list = new ArrayList<>(); List<ProjectRelatedPersonnel> list = new ArrayList<>();
if (workbook != null) { if (workbook != null) {
Sheet sheet = workbook.getSheetAt(0); Sheet sheet = workbook.getSheetAt(0);
deleteBlankRow(sheet); //deleteBlankRow(sheet);
if (sheet != null) { if (sheet != null) {
if(sheet.getPhysicalNumberOfRows()==0){ if(sheet.getPhysicalNumberOfRows()==0){
if (CutEnum.CN.getValue().equals(cut)) { if (CutEnum.CN.getValue().equals(cut)) {
@@ -791,27 +791,27 @@ public class ProjectRelatedPersonnelServiceImpl extends ServiceImpl<ProjectRelat
} }
} }
} }
if (i == 1) {//校验填写说明 // if (i == 1) {//校验填写说明
row = sheet.getRow(i); // row = sheet.getRow(i);
int columNos = row.getLastCellNum(); // int columNos = row.getLastCellNum();
if (StringUtils.isNotBlank(row.getCell(0).getStringCellValue())){ // if (StringUtils.isNotBlank(row.getCell(0).getStringCellValue())){
for (int k = 1; k < columNos; k++){ // for (int k = 1; k < columNos; k++){
if(StringUtils.isNotBlank(row.getCell(k).getStringCellValue())){ // if(StringUtils.isNotBlank(row.getCell(k).getStringCellValue())){
if (CutEnum.CN.getValue().equals(cut)) { // if (CutEnum.CN.getValue().equals(cut)) {
throw new JeroBootException("第二行填写说明列数不对,请按照模板格式填写内容"); // throw new JeroBootException("第二行填写说明列数不对,请按照模板格式填写内容");
} else { // } else {
throw new JeroBootException("The number of explanatory columns in the second line is incorrect. Please fill in the contents according to the template format."); // throw new JeroBootException("The number of explanatory columns in the second line is incorrect. Please fill in the contents according to the template format.");
} // }
} // }
} // }
}else { // }else {
if (CutEnum.CN.getValue().equals(cut)) { // if (CutEnum.CN.getValue().equals(cut)) {
throw new JeroBootException("填写说明不能为空,请按照模板格式填写内容"); // throw new JeroBootException("填写说明不能为空,请按照模板格式填写内容");
} else { // } else {
throw new JeroBootException("The description cannot be blank. Please fill in the content according to the template format."); // throw new JeroBootException("The description cannot be blank. Please fill in the content according to the template format.");
} // }
} // }
} // }
if (i > 1) {//读取数据 if (i > 1) {//读取数据
//获取每一行数据 //获取每一行数据
row = sheet.getRow(i); row = sheet.getRow(i);