bug53476+53461相关人员模板校验修改
This commit is contained in:
+54
-63
@@ -499,21 +499,19 @@ public class ProjectRelatedPersonnelServiceImpl extends ServiceImpl<ProjectRelat
|
||||
String explainInfo= null;
|
||||
|
||||
if(CutEnum.CN.getValue().equals(cut)){
|
||||
explainInfo = "填写说明\n" +
|
||||
"1.导入数据从第三行开始\n" +
|
||||
"2.所有带*号的字段必须填写\n"+
|
||||
"3.认证类型,认证级别,实施类别,交付物类型,发起人,责任人,字段是单选属性,必须和系统中的对应字段选项相匹配\n" +
|
||||
"4.责任领域,字段是多选属性,必须和系统中的对应字段选项相匹配,填写多个时采用英文或中文逗号分割\n" +
|
||||
"5.编号,子标题,WVTA ID,备注,填写文本内容\n" +
|
||||
"6.交付物模板字段为文件属性,填写时需要在本文件同级目录下以标准号为名称建立文件夹,并在文件夹下放置文件,假设在AAA标准号下放置了B.docx,则应填写AAA/B.docx";
|
||||
explainInfo =
|
||||
"填写说明\n"
|
||||
+ "1.导入数据从第三行开始,第一行为表头,第二行为填写说明,第三行是正式数据\n"
|
||||
+ "2.所有带*号的字段必须填写\n"
|
||||
+ "3.填写人员时,必须使用人员账号进行填写。\n"
|
||||
+ "4.填写的人员账号必须与系统中账号保持一致";
|
||||
}else{
|
||||
explainInfo = "filling explanation\n" +
|
||||
"1.import data starts at the third line\n" +
|
||||
"2.all fields marked with * must be filled in\n"+
|
||||
"3.Certification Type,Certification Level,Usage,type of deliverables,initiator,person liable,Fields are radio attributes that must match the corresponding field option in the system\n" +
|
||||
"4.Responsible Field, field is a multi-select attribute and must match the corresponding field in the system. If multiple fields are filled in, separate them by commas (,)\n" +
|
||||
"5.Number,Sub-Title,WVTA ID,Comments,Fill in the text\n" +
|
||||
"6.deliverable template,When filling in the field, you need to create a folder in the directory of the same level as the file with the name of the standard number and place the file in the folder. If b. diocx is stored under the AAA standard number, enter AAA/B. diocx";
|
||||
explainInfo =
|
||||
"filling explanation\n"
|
||||
+ "1. Import data from the third line, the first line is header, the second line is description, and the third line is official data.\n"
|
||||
+ "2. All fields marked with * must be filled in.\n"
|
||||
+ "3. When filling in personnel, you must use the personnel account number to fill in.\n"
|
||||
+ "4. The personnel account number filled in must be consistent with the account number in the system";
|
||||
}
|
||||
HSSFRichTextString explain=new HSSFRichTextString(explainInfo);
|
||||
|
||||
@@ -609,21 +607,19 @@ public class ProjectRelatedPersonnelServiceImpl extends ServiceImpl<ProjectRelat
|
||||
String explainInfo = null;
|
||||
|
||||
if (CutEnum.CN.getValue().equals(projectRelatedPersonnel.getCut())) {
|
||||
explainInfo = "填写说明\n" +
|
||||
"1.导入数据从第三行开始\n" +
|
||||
"2.所有带*号的字段必须填写\n" +
|
||||
"3.认证类型,认证级别,实施类别,交付物类型,发起人,责任人,字段是单选属性,必须和系统中的对应字段选项相匹配\n" +
|
||||
"4.责任领域,字段是多选属性,必须和系统中的对应字段选项相匹配,填写多个时采用英文或中文逗号分割\n" +
|
||||
"5.编号,子标题,WVTA ID,备注,填写文本内容\n" +
|
||||
"6.交付物模板字段为文件属性,填写时需要在本文件同级目录下以标准号为名称建立文件夹,并在文件夹下放置文件,假设在AAA标准号下放置了B.docx,则应填写AAA/B.docx";
|
||||
explainInfo =
|
||||
"填写说明\n"
|
||||
+ "1.导入数据从第三行开始,第一行为表头,第二行为填写说明,第三行是正式数据\n"
|
||||
+ "2.所有带*号的字段必须填写\n"
|
||||
+ "3.填写人员时,必须使用人员账号进行填写。\n"
|
||||
+ "4.填写的人员账号必须与系统中账号保持一致";
|
||||
} else {
|
||||
explainInfo = "filling explanation\n" +
|
||||
"1.import data starts at the third line\n" +
|
||||
"2.all fields marked with * must be filled in\n" +
|
||||
"3.Certification Type,Certification Level,Usage,type of deliverables,initiator,person liable,Fields are radio attributes that must match the corresponding field option in the system\n" +
|
||||
"4.Responsible Field, field is a multi-select attribute and must match the corresponding field in the system. If multiple fields are filled in, separate them by commas (,)\n" +
|
||||
"5.Number,Sub-Title,WVTA ID,Comments,Fill in the text\n" +
|
||||
"6.deliverable template,When filling in the field, you need to create a folder in the directory of the same level as the file with the name of the standard number and place the file in the folder. If b. diocx is stored under the AAA standard number, enter AAA/B. diocx";
|
||||
explainInfo =
|
||||
"filling explanation\n"
|
||||
+ "1. Import data from the third line, the first line is header, the second line is description, and the third line is official data.\n"
|
||||
+ "2. All fields marked with * must be filled in.\n"
|
||||
+ "3. When filling in personnel, you must use the personnel account number to fill in.\n"
|
||||
+ "4. The personnel account number filled in must be consistent with the account number in the system";
|
||||
}
|
||||
HSSFRichTextString explain = new HSSFRichTextString(explainInfo);
|
||||
|
||||
@@ -674,22 +670,20 @@ public class ProjectRelatedPersonnelServiceImpl extends ServiceImpl<ProjectRelat
|
||||
|
||||
if(CutEnum.CN.getValue().equals(cut)){
|
||||
titleOne = "责任领域,法规工程师,工程接口人,认证工程师,备注";
|
||||
explainInfo = "填写说明\n" +
|
||||
"1.导入数据从第三行开始\n" +
|
||||
"2.所有带*号的字段必须填写\n"+
|
||||
"3.认证类型,认证级别,实施类别,交付物类型,发起人,责任人,字段是单选属性,必须和系统中的对应字段选项相匹配\n" +
|
||||
"4.责任领域,字段是多选属性,必须和系统中的对应字段选项相匹配,填写多个时采用英文或中文逗号分割\n" +
|
||||
"5.编号,子标题,WVTA ID,备注,填写文本内容\n" +
|
||||
"6.交付物模板字段为文件属性,填写时需要在本文件同级目录下以标准号为名称建立文件夹,并在文件夹下放置文件,假设在AAA标准号下放置了B.docx,则应填写AAA/B.docx";
|
||||
explainInfo =
|
||||
"填写说明\n"
|
||||
+ "1.导入数据从第三行开始,第一行为表头,第二行为填写说明,第三行是正式数据\n"
|
||||
+ "2.所有带*号的字段必须填写\n"
|
||||
+ "3.填写人员时,必须使用人员账号进行填写。\n"
|
||||
+ "4.填写的人员账号必须与系统中账号保持一致";
|
||||
}else{
|
||||
titleOne = "Responsible Field,Regulation Engineer,Engineering Interface,Homologation Engineer,Comments";
|
||||
explainInfo = "filling explanation\n" +
|
||||
"1.import data starts at the third line\n" +
|
||||
"2.all fields marked with * must be filled in\n"+
|
||||
"3.Certification Type,Certification Level,Usage,type of deliverables,initiator,person liable,Fields are radio attributes that must match the corresponding field option in the system\n" +
|
||||
"4.Responsible Field, field is a multi-select attribute and must match the corresponding field in the system. If multiple fields are filled in, separate them by commas (,)\n" +
|
||||
"5.Number,Sub-Title,WVTA ID,Comments,Fill in the text\n" +
|
||||
"6.deliverable template,When filling in the field, you need to create a folder in the directory of the same level as the file with the name of the standard number and place the file in the folder. If b. diocx is stored under the AAA standard number, enter AAA/B. diocx";
|
||||
explainInfo =
|
||||
"filling explanation\n"
|
||||
+ "1. Import data from the third line, the first line is header, the second line is description, and the third line is official data.\n"
|
||||
+ "2. All fields marked with * must be filled in.\n"
|
||||
+ "3. When filling in personnel, you must use the personnel account number to fill in.\n"
|
||||
+ "4. The personnel account number filled in must be consistent with the account number in the system";
|
||||
}
|
||||
List<String> titleOneList = Arrays.asList(titleOne.split(","));
|
||||
|
||||
@@ -714,27 +708,27 @@ public class ProjectRelatedPersonnelServiceImpl extends ServiceImpl<ProjectRelat
|
||||
boolean isBlank = dummyInventoryInfoEOService.isRowEmpty(row);
|
||||
|
||||
if (row != null && !isBlank) {
|
||||
int columHeadNos = headerRow.getLastCellNum();// 表头总共的列数
|
||||
if (columHeadNos == 5) {//列数对
|
||||
for (int j = 0; j < columHeadNos; j++) {
|
||||
Cell cell = row.getCell(j,Row.MissingCellPolicy.CREATE_NULL_AS_BLANK);
|
||||
if (i == 0){
|
||||
if (i == 0 && !cell.getStringCellValue().equals(titleOneList.get(j))) {//检查表头
|
||||
if (CutEnum.CN.getValue().equals(cut)) {
|
||||
throw new JeroBootException("读取失败.请检查第 " + (i+1) + " 行表头,请严格按照模板文件导入数据");
|
||||
} else {
|
||||
throw new JeroBootException("The data fails to be read.Please check header in line " + (i+1) + " .Import data strictly according to the template file.");
|
||||
int columHeadNos = headerRow.getLastCellNum();// 表头总共的列数
|
||||
if (columHeadNos == 5) {//列数对
|
||||
for (int j = 0; j < columHeadNos; j++) {
|
||||
Cell cell = row.getCell(j,Row.MissingCellPolicy.CREATE_NULL_AS_BLANK);
|
||||
if (i == 0){
|
||||
if (i == 0 && !cell.getStringCellValue().equals(titleOneList.get(j))) {//检查表头
|
||||
if (CutEnum.CN.getValue().equals(cut)) {
|
||||
throw new JeroBootException("读取失败.请检查第 " + (i+1) + " 行表头,请严格按照模板文件导入数据");
|
||||
} else {
|
||||
throw new JeroBootException("The data fails to be read.Please check header in line " + (i+1) + " .Import data strictly according to the template file.");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}/*else if(i!=1 && columNos != 5) {
|
||||
}else if(i!=1 && columHeadNos != 5) {
|
||||
if (CutEnum.CN.getValue().equals(cut)) {
|
||||
throw new JeroBootException("导入的列数不对,请检查");
|
||||
throw new JeroBootException("导入的列数不对,请按照模板格式填写内容");
|
||||
} else {
|
||||
throw new JeroBootException("The number of imported columns is wrong. Please check!");
|
||||
throw new JeroBootException("The number of imported columns is wrong. Please fill in the contents according to the template format.");
|
||||
}
|
||||
}*/
|
||||
}
|
||||
}else{
|
||||
if (CutEnum.CN.getValue().equals(cut)) {
|
||||
throw new JeroBootException("导入的数据不能为空,请检查");
|
||||
@@ -745,13 +739,12 @@ public class ProjectRelatedPersonnelServiceImpl extends ServiceImpl<ProjectRelat
|
||||
if (i == 1) {//校验填写说明
|
||||
row = sheet.getRow(i);
|
||||
int columNos = row.getLastCellNum();
|
||||
//if(columNos != 1 /*|| (!row.getCell(0).getStringCellValue().equals(explainInfo))*/){
|
||||
for (int k = 0; k < columNos; k++){
|
||||
if (k>0 && StringUtils.isNotBlank(row.getCell(k).getStringCellValue())) {
|
||||
if (row.getPhysicalNumberOfCells()>1 && StringUtils.isNotBlank(row.getCell(k).getStringCellValue())) {
|
||||
if (CutEnum.CN.getValue().equals(cut)) {
|
||||
throw new JeroBootException("填写说明列数不对,请严格按照模板文件导入数据");
|
||||
throw new JeroBootException("填写说明列数不对,请按照模板格式填写内容");
|
||||
} else {
|
||||
throw new JeroBootException("The number of columns of filling explanation is wrong. Please import data strictly according to the template file.");
|
||||
throw new JeroBootException("The number of columns of filling explanation is wrong. Please fill in the contents according to the template format.");
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -827,10 +820,8 @@ public class ProjectRelatedPersonnelServiceImpl extends ServiceImpl<ProjectRelat
|
||||
//按照责任领域名,查value
|
||||
if (CutEnum.CN.getValue().equals(cut)) {
|
||||
dutyTerritoryValueList = sysDictItemList.stream().filter(f -> f.getItemText().equals(projectRelatedPersonnel.getDutyTerritory())).map(e -> e.getItemValue()).collect(Collectors.toList());
|
||||
System.out.println(dutyTerritoryValueList);
|
||||
} else {
|
||||
dutyTerritoryValueList = sysDictItemList.stream().filter(f -> f.getEnName().equals(projectRelatedPersonnel.getDutyTerritory())).map(e -> e.getItemValue()).collect(Collectors.toList());
|
||||
System.out.println(dutyTerritoryValueList);
|
||||
}
|
||||
|
||||
//责任领域
|
||||
|
||||
Reference in New Issue
Block a user