|
@@ -3250,10 +3250,16 @@ public class ProjectServiceImpl extends ServiceImpl<ProjectMapper, Project> impl
|
|
|
XSSFCell subNameCell = row.getCell(4);
|
|
|
XSSFCell participatorCell = row.getCell(5);
|
|
|
XSSFCell inchargerCell = row.getCell(6);
|
|
|
- XSSFCell levelCell = row.getCell(7);
|
|
|
- XSSFCell startDateCell = row.getCell(8);
|
|
|
- XSSFCell endDateCell = row.getCell(9);
|
|
|
- XSSFCell amountCell = row.getCell(10);
|
|
|
+ XSSFCell reportAuditorsCell=null;
|
|
|
+ int i=0;
|
|
|
+ if(timeType.getReportAuditType()==0||timeType.getReportAuditType()==4){
|
|
|
+ i++;
|
|
|
+ reportAuditorsCell = row.getCell(6+i);
|
|
|
+ }
|
|
|
+ XSSFCell levelCell = row.getCell(7+i);
|
|
|
+ XSSFCell startDateCell = row.getCell(8+i);
|
|
|
+ XSSFCell endDateCell = row.getCell(9+i);
|
|
|
+ XSSFCell amountCell = row.getCell(10+i);
|
|
|
|
|
|
|
|
|
if (codeCell != null)codeCell.setCellType(CellType.STRING);
|
|
@@ -3263,6 +3269,7 @@ public class ProjectServiceImpl extends ServiceImpl<ProjectMapper, Project> impl
|
|
|
if (subNameCell != null)subNameCell.setCellType(CellType.STRING);
|
|
|
if (participatorCell != null)participatorCell.setCellType(CellType.STRING);
|
|
|
if (inchargerCell != null)inchargerCell.setCellType(CellType.STRING);
|
|
|
+ if (reportAuditorsCell != null)reportAuditorsCell.setCellType(CellType.STRING);
|
|
|
if (levelCell != null)levelCell.setCellType(CellType.STRING);
|
|
|
if (startDateCell != null)startDateCell.setCellType(CellType.NUMERIC);
|
|
|
if (endDateCell != null)endDateCell.setCellType(CellType.NUMERIC);
|
|
@@ -3434,9 +3441,11 @@ public class ProjectServiceImpl extends ServiceImpl<ProjectMapper, Project> impl
|
|
|
}
|
|
|
//导入项目参与人,遵守只增不减的原则, 避免误删
|
|
|
List<Participation> oldPartList = new ArrayList<>();
|
|
|
+ List<ProjectAuditor> oldAuditorList = new ArrayList<>();
|
|
|
if (exists) {
|
|
|
//更新的项目,检查已经存在的项目参与人
|
|
|
oldPartList = participationMapper.selectList(new QueryWrapper<Participation>().eq("project_id", project.getId()));
|
|
|
+ oldAuditorList = projectAuditorMapper.selectList(new QueryWrapper<ProjectAuditor>().eq("project_id", project.getId()));
|
|
|
}
|
|
|
List<Participation> participationList = new ArrayList<>();
|
|
|
if(inchargerCell!=null){
|
|
@@ -3547,6 +3556,67 @@ public class ProjectServiceImpl extends ServiceImpl<ProjectMapper, Project> impl
|
|
|
participationService.saveBatch(addPartList);
|
|
|
}
|
|
|
}
|
|
|
+ List<ProjectAuditor> projectAuditorList = new ArrayList<>();
|
|
|
+ if (reportAuditorsCell != null) {
|
|
|
+ String part = reportAuditorsCell.getStringCellValue().trim();
|
|
|
+ if (!StringUtils.isEmpty(part)) {
|
|
|
+ String[] partSplit = part.split("\\,|\\,");
|
|
|
+ for (String str : partSplit) {
|
|
|
+ ProjectAuditor projectAuditor = new ProjectAuditor();
|
|
|
+ String s1;
|
|
|
+ if(str.startsWith("/")){
|
|
|
+ s1=str.substring(1,str.length());
|
|
|
+ }else s1=str;
|
|
|
+ String s2;
|
|
|
+ if(s1.endsWith("/")){
|
|
|
+ s2=s1.substring(0,s1.length()-1);
|
|
|
+ }else s2=s1;
|
|
|
+ String[] split = str.split("/");
|
|
|
+ Optional<User> first;
|
|
|
+ Integer exception=null;
|
|
|
+ if(split.length==1){
|
|
|
+ if(wxCorpInfo!=null&&wxCorpInfo.getSaasSyncContact()==1){
|
|
|
+ Optional<User> optional = targetUserList.stream().filter(tl -> tl.getName().equals(split[0])).findFirst();
|
|
|
+ first= userList.stream().filter(u ->(u.getJobNumber()!=null&&u.getJobNumber().equals(split[0]))||(optional.isPresent()&&u.getCorpwxUserid()!=null&&u.getCorpwxUserid().equals(optional.get().getCorpwxUserid()))).findFirst();
|
|
|
+ }else {
|
|
|
+ first= userList.stream().filter(u -> u.getName().equals(split[0])||(u.getJobNumber()!=null&&u.getJobNumber().equals(split[0]))).findFirst();
|
|
|
+ }
|
|
|
+ exception=0;
|
|
|
+ }else {
|
|
|
+ if(wxCorpInfo!=null&&wxCorpInfo.getSaasSyncContact()==1){
|
|
|
+ Optional<User> optional = targetUserList.stream().filter(tl -> tl.getName().equals(split[1])).findFirst();
|
|
|
+ first= userList.stream().filter(u ->(u.getJobNumber()!=null&&u.getJobNumber().equals(split[1]))||(optional.isPresent()&&u.getCorpwxUserid()!=null&&u.getCorpwxUserid().equals(optional.get().getCorpwxUserid()))).findFirst();
|
|
|
+ exception=1;
|
|
|
+ }else {
|
|
|
+ first= userList.stream().filter(u -> u.getName().equals(split[0])&&(u.getJobNumber()!=null&&u.getJobNumber().equals(split[1]))).findFirst();
|
|
|
+ }
|
|
|
+ }
|
|
|
+ if (first.isPresent()) {
|
|
|
+ User partMemb = first.get();
|
|
|
+// System.out.println("参与人:"+partMemb.getName());
|
|
|
+ if (!projectAuditorList.stream().anyMatch(partOne->partOne.getAuditorId().equals(partMemb.getId()))) {
|
|
|
+ projectAuditor.setAuditorId(partMemb.getId());
|
|
|
+ projectAuditor.setAuditorName(partMemb.getName());
|
|
|
+ projectAuditor.setProjectId(project.getId());
|
|
|
+ projectAuditorList.add(projectAuditor);
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ switch (exception){
|
|
|
+ case 0:throw new Exception("["+split[0]+"]在系统中不存在");
|
|
|
+ case 1:throw new Exception("["+split[0]+"]在系统中不存在");
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ if (projectAuditorList.size() > 0) {
|
|
|
+ //批量保存
|
|
|
+ List<ProjectAuditor> finalOldAuditorList = oldAuditorList;
|
|
|
+ List<ProjectAuditor> addAuditorList = projectAuditorList.stream().filter(newP-> !finalOldAuditorList.stream().anyMatch(oldP->oldP.getAuditorId().equals(newP.getAuditorId()))).collect(Collectors.toList());
|
|
|
+ if (addAuditorList.size() > 0) {
|
|
|
+ projectAuditorService.saveBatch(addAuditorList);
|
|
|
+ }
|
|
|
+ }
|
|
|
}
|
|
|
//msg.data = "成功导入"+importCount+"条数据。";
|
|
|
msg.data = MessageUtils.message("data.importSucRow",importCount);
|
|
@@ -3686,6 +3756,7 @@ public class ProjectServiceImpl extends ServiceImpl<ProjectMapper, Project> impl
|
|
|
HSSFCell nameCell=null;
|
|
|
HSSFCell participatorCell=null;
|
|
|
HSSFCell inchargerCell=null;
|
|
|
+ HSSFCell reportAuditorsCell=null;
|
|
|
HSSFCell levelCell=null;
|
|
|
HSSFCell deptCell=null;
|
|
|
HSSFCell customerCell=null;
|
|
@@ -3723,6 +3794,7 @@ public class ProjectServiceImpl extends ServiceImpl<ProjectMapper, Project> impl
|
|
|
int k=0;
|
|
|
int c=0;
|
|
|
int d=0;
|
|
|
+ int e=0;
|
|
|
if(timeType.getMainProjectState()==1){
|
|
|
mainNameCell = row.getCell(0);
|
|
|
codeCell = row.getCell(1);
|
|
@@ -3734,13 +3806,17 @@ public class ProjectServiceImpl extends ServiceImpl<ProjectMapper, Project> impl
|
|
|
nameCell = row.getCell(3+c);
|
|
|
participatorCell = row.getCell(4+c);
|
|
|
inchargerCell = row.getCell(5+c);
|
|
|
- levelCell = row.getCell(6+c);
|
|
|
+ if(timeType.getReportAuditType()==0||timeType.getReportAuditType()==4){
|
|
|
+ e++;
|
|
|
+ reportAuditorsCell=row.getCell(5+c+e);
|
|
|
+ }
|
|
|
+ levelCell = row.getCell(6+c+e);
|
|
|
if(timeType.getProjectWithDept()==1){
|
|
|
- deptCell=row.getCell(7+c);
|
|
|
+ deptCell=row.getCell(7+c+e);
|
|
|
d++;
|
|
|
}
|
|
|
if(company.getPackageCustomer()==1){
|
|
|
- customerCell=row.getCell(7+c+d);
|
|
|
+ customerCell=row.getCell(7+c+d+e);
|
|
|
i++;
|
|
|
}
|
|
|
if(company.getPackageProvider()==1){
|
|
@@ -3750,35 +3826,35 @@ public class ProjectServiceImpl extends ServiceImpl<ProjectMapper, Project> impl
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
- startDateCell = row.getCell(7+i+k+c+d);
|
|
|
- endDateCell = row.getCell(8+i+k+c+d);
|
|
|
- amountCell = row.getCell(9+i+k+c+d);
|
|
|
+ startDateCell = row.getCell(7+i+k+c+d+e);
|
|
|
+ endDateCell = row.getCell(8+i+k+c+d+e);
|
|
|
+ amountCell = row.getCell(9+i+k+c+d+e);
|
|
|
if(company.getId()==936){
|
|
|
- warrantyStartDateCell=row.getCell(10+i+k+c+d);
|
|
|
- warrantyEndDateCell=row.getCell(11+i+k+c+d);
|
|
|
- projectCategorySubCell=row.getCell(12+i+k+c+d);
|
|
|
- regionCell=row.getCell(13+i+k+c+d);
|
|
|
- buCell=row.getCell(14+i+k+c+d);
|
|
|
- stateCell=row.getCell(15+i+k+c+d);
|
|
|
- stageCell=row.getCell(16+i+k+c+d);
|
|
|
- plate1=row.getCell(17+i+k+c+d);
|
|
|
- plate2=row.getCell(18+i+k+c+d);
|
|
|
- plate3=row.getCell(19+i+k+c+d);
|
|
|
- plate4=row.getCell(20+i+k+c+d);
|
|
|
- plate5=row.getCell(21+i+k+c+d);
|
|
|
- plate6=row.getCell(22+i+k+c+d);
|
|
|
- plate7=row.getCell(23+i+k+c+d);
|
|
|
- plate8=row.getCell(24+i+k+c+d);
|
|
|
- plate9=row.getCell(25+i+k+c+d);
|
|
|
- plate10=row.getCell(26+i+k+c+d);
|
|
|
- plate11=row.getCell(27+i+k+c+d);
|
|
|
- plate12=row.getCell(28+i+k+c+d);
|
|
|
- plate13=row.getCell(29+i+k+c+d);
|
|
|
- plate14=row.getCell(30+i+k+c+d);
|
|
|
- plate15=row.getCell(31+i+k+c+d);
|
|
|
- plate16=row.getCell(32+i+k+c+d);
|
|
|
- plate17=row.getCell(33+i+k+c+d);
|
|
|
- plate18=row.getCell(34+i+k+c+d);
|
|
|
+ warrantyStartDateCell=row.getCell(10+i+k+c+d+e);
|
|
|
+ warrantyEndDateCell=row.getCell(11+i+k+c+d+e);
|
|
|
+ projectCategorySubCell=row.getCell(12+i+k+c+d+e);
|
|
|
+ regionCell=row.getCell(13+i+k+c+d+e);
|
|
|
+ buCell=row.getCell(14+i+k+c+d+e);
|
|
|
+ stateCell=row.getCell(15+i+k+c+d+e);
|
|
|
+ stageCell=row.getCell(16+i+k+c+d+e);
|
|
|
+ plate1=row.getCell(17+i+k+c+d+e);
|
|
|
+ plate2=row.getCell(18+i+k+c+d+e);
|
|
|
+ plate3=row.getCell(19+i+k+c+d+e);
|
|
|
+ plate4=row.getCell(20+i+k+c+d+e);
|
|
|
+ plate5=row.getCell(21+i+k+c+d+e);
|
|
|
+ plate6=row.getCell(22+i+k+c+d+e);
|
|
|
+ plate7=row.getCell(23+i+k+c+d+e);
|
|
|
+ plate8=row.getCell(24+i+k+c+d+e);
|
|
|
+ plate9=row.getCell(25+i+k+c+d+e);
|
|
|
+ plate10=row.getCell(26+i+k+c+d+e);
|
|
|
+ plate11=row.getCell(27+i+k+c+d+e);
|
|
|
+ plate12=row.getCell(28+i+k+c+d+e);
|
|
|
+ plate13=row.getCell(29+i+k+c+d+e);
|
|
|
+ plate14=row.getCell(30+i+k+c+d+e);
|
|
|
+ plate15=row.getCell(31+i+k+c+d+e);
|
|
|
+ plate16=row.getCell(32+i+k+c+d+e);
|
|
|
+ plate17=row.getCell(33+i+k+c+d+e);
|
|
|
+ plate18=row.getCell(34+i+k+c+d+e);
|
|
|
}
|
|
|
}else {
|
|
|
codeCell = row.getCell(0);
|
|
@@ -3792,13 +3868,17 @@ public class ProjectServiceImpl extends ServiceImpl<ProjectMapper, Project> impl
|
|
|
subNameCell = row.getCell(4+c);
|
|
|
participatorCell = row.getCell(5+c);
|
|
|
inchargerCell = row.getCell(6+c);
|
|
|
- levelCell = row.getCell(7+c);
|
|
|
+ if(timeType.getReportAuditType()==0||timeType.getReportAuditType()==4){
|
|
|
+ e++;
|
|
|
+ reportAuditorsCell=row.getCell(6+c+e);
|
|
|
+ }
|
|
|
+ levelCell = row.getCell(7+c+e);
|
|
|
if(timeType.getProjectWithDept()==1){
|
|
|
- deptCell=row.getCell(8+c);
|
|
|
+ deptCell=row.getCell(8+c+e);
|
|
|
d++;
|
|
|
}
|
|
|
if(company.getPackageCustomer()==1){
|
|
|
- customerCell=row.getCell(8+c+d);
|
|
|
+ customerCell=row.getCell(8+c+d+e);
|
|
|
i++;
|
|
|
}
|
|
|
if(company.getPackageProvider()==1){
|
|
@@ -3808,35 +3888,35 @@ public class ProjectServiceImpl extends ServiceImpl<ProjectMapper, Project> impl
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
- startDateCell = row.getCell(8+i+k+c+d);
|
|
|
- endDateCell = row.getCell(9+i+k+c+d);
|
|
|
- amountCell = row.getCell(10+i+k+c+d);
|
|
|
+ startDateCell = row.getCell(8+i+k+c+d+e);
|
|
|
+ endDateCell = row.getCell(9+i+k+c+d+e);
|
|
|
+ amountCell = row.getCell(10+i+k+c+d+e);
|
|
|
if(company.getId()==936){
|
|
|
- warrantyStartDateCell=row.getCell(11+i+k+c+d);
|
|
|
- warrantyEndDateCell=row.getCell(12+i+k+c+d);
|
|
|
- projectCategorySubCell=row.getCell(13+i+k+c+d);
|
|
|
- regionCell=row.getCell(14+i+k+c+d);
|
|
|
- buCell=row.getCell(15+i+k+c+d);
|
|
|
- stateCell=row.getCell(16+i+k+c+d);
|
|
|
- stageCell=row.getCell(17+i+k+c+d);
|
|
|
- plate1=row.getCell(18+i+k+c+d);
|
|
|
- plate2=row.getCell(19+i+k+c+d);
|
|
|
- plate3=row.getCell(20+i+k+c+d);
|
|
|
- plate4=row.getCell(21+i+k+c+d);
|
|
|
- plate5=row.getCell(22+i+k+c+d);
|
|
|
- plate6=row.getCell(23+i+k+c+d);
|
|
|
- plate7=row.getCell(24+i+k+c+d);
|
|
|
- plate8=row.getCell(25+i+k+c+d);
|
|
|
- plate9=row.getCell(26+i+k+c+d);
|
|
|
- plate10=row.getCell(27+i+k+c+d);
|
|
|
- plate11=row.getCell(28+i+k+c+d);
|
|
|
- plate12=row.getCell(29+i+k+c+d);
|
|
|
- plate13=row.getCell(30+i+k+c+d);
|
|
|
- plate14=row.getCell(31+i+k+c+d);
|
|
|
- plate15=row.getCell(32+i+k+c+d);
|
|
|
- plate16=row.getCell(33+i+k+c+d);
|
|
|
- plate17=row.getCell(34+i+k+c+d);
|
|
|
- plate18=row.getCell(35+i+k+c+d);
|
|
|
+ warrantyStartDateCell=row.getCell(11+i+k+c+d+e);
|
|
|
+ warrantyEndDateCell=row.getCell(12+i+k+c+d+e);
|
|
|
+ projectCategorySubCell=row.getCell(13+i+k+c+d+e);
|
|
|
+ regionCell=row.getCell(14+i+k+c+d+e);
|
|
|
+ buCell=row.getCell(15+i+k+c+d+e);
|
|
|
+ stateCell=row.getCell(16+i+k+c+d+e);
|
|
|
+ stageCell=row.getCell(17+i+k+c+d+e);
|
|
|
+ plate1=row.getCell(18+i+k+c+d+e);
|
|
|
+ plate2=row.getCell(19+i+k+c+d+e);
|
|
|
+ plate3=row.getCell(20+i+k+c+d+e);
|
|
|
+ plate4=row.getCell(21+i+k+c+d+e);
|
|
|
+ plate5=row.getCell(22+i+k+c+d+e);
|
|
|
+ plate6=row.getCell(23+i+k+c+d+e);
|
|
|
+ plate7=row.getCell(24+i+k+c+d+e);
|
|
|
+ plate8=row.getCell(25+i+k+c+d+e);
|
|
|
+ plate9=row.getCell(26+i+k+c+d+e);
|
|
|
+ plate10=row.getCell(27+i+k+c+d+e);
|
|
|
+ plate11=row.getCell(28+i+k+c+d+e);
|
|
|
+ plate12=row.getCell(29+i+k+c+d+e);
|
|
|
+ plate13=row.getCell(30+i+k+c+d+e);
|
|
|
+ plate14=row.getCell(31+i+k+c+d+e);
|
|
|
+ plate15=row.getCell(32+i+k+c+d+e);
|
|
|
+ plate16=row.getCell(33+i+k+c+d+e);
|
|
|
+ plate17=row.getCell(34+i+k+c+d+e);
|
|
|
+ plate18=row.getCell(35+i+k+c+d+e);
|
|
|
}
|
|
|
}
|
|
|
if (codeCell != null)codeCell.setCellType(CellType.STRING);
|
|
@@ -3847,6 +3927,7 @@ public class ProjectServiceImpl extends ServiceImpl<ProjectMapper, Project> impl
|
|
|
if (mainNameCell != null)mainNameCell.setCellType(CellType.STRING);
|
|
|
if (participatorCell != null)participatorCell.setCellType(CellType.STRING);
|
|
|
if (inchargerCell != null)inchargerCell.setCellType(CellType.STRING);
|
|
|
+ if (reportAuditorsCell != null)reportAuditorsCell.setCellType(CellType.STRING);
|
|
|
if (levelCell != null)levelCell.setCellType(CellType.STRING);
|
|
|
if (deptCell != null)deptCell.setCellType(CellType.STRING);
|
|
|
if (customerCell != null)customerCell.setCellType(CellType.STRING);
|
|
@@ -3965,8 +4046,6 @@ public class ProjectServiceImpl extends ServiceImpl<ProjectMapper, Project> impl
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
-
|
|
|
-
|
|
|
if (levelCell != null) {
|
|
|
String levelStr = levelCell.getStringCellValue();
|
|
|
if (!StringUtils.isEmpty(levelStr)) {
|
|
@@ -4521,9 +4600,11 @@ public class ProjectServiceImpl extends ServiceImpl<ProjectMapper, Project> impl
|
|
|
importCount++;
|
|
|
//导入项目参与人,遵守只增不减的原则, 避免误删
|
|
|
List<Participation> oldPartList = new ArrayList<>();
|
|
|
+ List<ProjectAuditor> oldAuditorList = new ArrayList<>();
|
|
|
if (exists) {
|
|
|
//更新的项目,检查已经存在的项目参与人
|
|
|
oldPartList = participationMapper.selectList(new QueryWrapper<Participation>().eq("project_id", project.getId()));
|
|
|
+ oldAuditorList = projectAuditorMapper.selectList(new QueryWrapper<ProjectAuditor>().eq("project_id", project.getId()));
|
|
|
System.out.println("获取到已有项目参与人:"+oldPartList.size());
|
|
|
}
|
|
|
List<Participation> participationList = new ArrayList<>();
|
|
@@ -4628,6 +4709,67 @@ public class ProjectServiceImpl extends ServiceImpl<ProjectMapper, Project> impl
|
|
|
participationService.saveBatch(addPartList);
|
|
|
}
|
|
|
}
|
|
|
+ List<ProjectAuditor> projectAuditorList = new ArrayList<>();
|
|
|
+ if (reportAuditorsCell != null) {
|
|
|
+ String part = reportAuditorsCell.getStringCellValue().trim();
|
|
|
+ if (!StringUtils.isEmpty(part)) {
|
|
|
+ String[] partSplit = part.split("\\,|\\,");
|
|
|
+ for (String str : partSplit) {
|
|
|
+ String s1;
|
|
|
+ if(str.startsWith("/")){
|
|
|
+ s1=str.substring(1,str.length());
|
|
|
+ }else s1=str;
|
|
|
+ String s2;
|
|
|
+ if(s1.endsWith("/")){
|
|
|
+ s2=s1.substring(0,s1.length()-1);
|
|
|
+ }else s2=s1;
|
|
|
+ String[] split = s2.split("/");
|
|
|
+ Optional<User> first;
|
|
|
+ Integer exception=null;
|
|
|
+ if(split.length==1){
|
|
|
+ if(wxCorpInfo!=null&&wxCorpInfo.getSaasSyncContact()==1){
|
|
|
+ Optional<User> optional = targetUserList.stream().filter(tl -> tl.getName().equals(split[0])).findFirst();
|
|
|
+ first= userList.stream().filter(u ->(u.getJobNumber()!=null&&u.getJobNumber().equals(split[0]))||(optional.isPresent()&&u.getCorpwxUserid()!=null&&u.getCorpwxUserid().equals(optional.get().getCorpwxUserid()))).findFirst();
|
|
|
+ }else {
|
|
|
+ first= userList.stream().filter(u -> u.getName().equals(split[0])||(u.getJobNumber()!=null&&u.getJobNumber().equals(split[0]))).findFirst();
|
|
|
+ }
|
|
|
+ exception=0;
|
|
|
+ }else {
|
|
|
+ if(wxCorpInfo!=null&&wxCorpInfo.getSaasSyncContact()==1){
|
|
|
+ Optional<User> optional = targetUserList.stream().filter(tl -> tl.getName().equals(split[1])).findFirst();
|
|
|
+ first= userList.stream().filter(u ->(u.getJobNumber()!=null&&u.getJobNumber().equals(split[1]))||(optional.isPresent()&&u.getCorpwxUserid()!=null&&u.getCorpwxUserid().equals(optional.get().getCorpwxUserid()))).findFirst();
|
|
|
+ exception=1;
|
|
|
+ }else {
|
|
|
+ first= userList.stream().filter(u -> u.getName().equals(split[0])&&(u.getJobNumber()!=null&&u.getJobNumber().equals(split[1]))).findFirst();
|
|
|
+ }
|
|
|
+ }
|
|
|
+ ProjectAuditor p = new ProjectAuditor();
|
|
|
+ if (first.isPresent()) {
|
|
|
+ User partMemb = first.get();
|
|
|
+// System.out.println("参与人:"+partMemb.getName());
|
|
|
+ if (!projectAuditorList.stream().anyMatch(partOne->partOne.getAuditorId().equals(partMemb.getId()))) {
|
|
|
+ p.setAuditorId(partMemb.getId());
|
|
|
+ p.setAuditorName(partMemb.getName());
|
|
|
+ p.setProjectId(project.getId());
|
|
|
+ projectAuditorList.add(p);
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ switch (exception){
|
|
|
+ case 0:throw new Exception("["+split[0]+"]在系统中不存在");
|
|
|
+ case 1:throw new Exception("["+split[0]+"]在系统中不存在");
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ if (projectAuditorList.size() > 0) {
|
|
|
+ //批量保存
|
|
|
+ List<ProjectAuditor> finalOldAuditorList = oldAuditorList;
|
|
|
+ List<ProjectAuditor> addAuditorList = projectAuditorList.stream().filter(newP-> !finalOldAuditorList.stream().anyMatch(oldP->oldP.getAuditorId().equals(newP.getAuditorId()))).collect(Collectors.toList());
|
|
|
+ if (addAuditorList.size() > 0) {
|
|
|
+ projectAuditorService.saveBatch(addAuditorList);
|
|
|
+ }
|
|
|
+ }
|
|
|
}
|
|
|
//msg.data = "成功导入"+importCount+"条数据。";
|
|
|
msg.data = MessageUtils.message("data.importSucRow",importCount);
|