Преглед изворни кода

Merge branch 'master' of http://47.100.37.243:10191/wutt/manHourHousekeeper

Guo1B0 пре 1 година
родитељ
комит
da8a9bb037

+ 88 - 12
fhKeeper/formulahousekeeper/management-platform/src/main/java/com/management/platform/service/impl/ProjectServiceImpl.java

@@ -4487,9 +4487,22 @@ public class ProjectServiceImpl extends ServiceImpl<ProjectMapper, Project> impl
                     }
                     XSSFCell participatorCell = row.getCell(6+(projectWithDept?1:0));
                     XSSFCell inchargerCell = row.getCell(7+(projectWithDept?1:0));
+                    XSSFCell reportAuditorsCell=null;
+                    XSSFCell reportCcCell=null;
+                    int i=0;
+                    if(timeType.getReportAuditType()==0||timeType.getReportAuditType()==4||timeType.getReportAuditType()==6){
+                        i++;
+                        reportAuditorsCell = row.getCell(7+(projectWithDept?1:0)+i);
+                    }
+                    if(timeType.getReportAuditType()==7){
+                        i++;
+                        reportCcCell=row.getCell(7+(projectWithDept?1:0)+i);
+                    }
 
                     String part = "";
                     String inchargerName = "";
+                    String reportAuditors = "";
+                    String reportCc = "";
                     if (participatorCell!=null) {
                         participatorCell.setCellType(CellType.STRING);
                         part = participatorCell.getStringCellValue().trim();
@@ -4498,16 +4511,36 @@ public class ProjectServiceImpl extends ServiceImpl<ProjectMapper, Project> impl
                         inchargerCell.setCellType(CellType.STRING);
                         inchargerName = inchargerCell.getStringCellValue().trim();
                     }
+                    if (reportAuditorsCell!=null) {
+                        reportAuditorsCell.setCellType(CellType.STRING);
+                        reportAuditors = reportAuditorsCell.getStringCellValue().trim();
+                    }
+                    if (reportCcCell!=null) {
+                        participatorCell.setCellType(CellType.STRING);
+                        reportCc = participatorCell.getStringCellValue().trim();
+                    }
                     //兼容繁体
                     if(part.equals("参与人") || part.equals("參與人")){
                         continue;
                     }
                     String[] partSplit = part.split("\\,|\\,");
+                    String[] reportAuditorsSplit = reportAuditors.split("\\,|\\,");
+                    String[] reportCcSplit = reportCc.split("\\,|\\,");
                     for (String s : partSplit) {
                         if(!userNameList.contains(s)&&!s.equals("")){
                             userNameList.add(s);
                         }
                     }
+                    for (String s : reportAuditorsSplit) {
+                        if(!userNameList.contains(s)&&!s.equals("")){
+                            userNameList.add(s);
+                        }
+                    }
+                    for (String s : reportCcSplit) {
+                        if(!userNameList.contains(s)&&!s.equals("")){
+                            userNameList.add(s);
+                        }
+                    }
                     if(!userNameList.contains(inchargerName)&&!inchargerName.equals("")){
                         userNameList.add(inchargerName);
                     }
@@ -4953,9 +4986,11 @@ public class ProjectServiceImpl extends ServiceImpl<ProjectMapper, Project> impl
                                 }
                                 Participation p = new Participation();
                                 if (first.isPresent()) {
-                                    p.setUserId(first.get().getId());
-                                    p.setProjectId(project.getId());
-                                    participationList.add(p);
+                                    if (!participationList.stream().anyMatch(partOne->partOne.getUserId().equals(first.get().getId()))) {
+                                        p.setUserId(first.get().getId());
+                                        p.setProjectId(project.getId());
+                                        participationList.add(p);
+                                    }
                                 } else {
                                     switch (exception){
                                         case 0:throw new Exception("["+split[0]+"]在系统中不存在");
@@ -5001,9 +5036,11 @@ public class ProjectServiceImpl extends ServiceImpl<ProjectMapper, Project> impl
                                 }
                                 Participation p = new Participation();
                                 if (first.isPresent()) {
-                                    p.setUserId(first.get().getId());
-                                    p.setProjectId(project.getId());
-                                    participationList.add(p);
+                                    if (!participationList.stream().anyMatch(partOne->partOne.getUserId().equals(first.get().getId()))) {
+                                        p.setUserId(first.get().getId());
+                                        p.setProjectId(project.getId());
+                                        participationList.add(p);
+                                    }
                                 } else {
                                     switch (exception){
                                         case 0:throw new Exception("["+split[0]+"]在系统中不存在");
@@ -5236,30 +5273,65 @@ public class ProjectServiceImpl extends ServiceImpl<ProjectMapper, Project> impl
                     }
                     HSSFCell participatorCell=null;
                     HSSFCell inchargerCell=null;
+                    HSSFCell reportAuditorsCell=null;
+                    HSSFCell reportCcCell=null;
                     int c=0;
+                    int i=0;
                     if(company.getId()==936){
                         c++;
                     }
                     if(timeType.getMainProjectState()==1){
                         participatorCell = row.getCell(5+c);
                         inchargerCell = row.getCell(6+c);
+                        if(timeType.getReportAuditType()==0||timeType.getReportAuditType()==4||timeType.getReportAuditType()==6){
+                            i++;
+                            reportAuditorsCell=row.getCell(6+i);
+                        }
+                        if(timeType.getReportAuditType()==6){
+                            i++;
+                            reportCcCell=row.getCell(6+i);
+                        }
                     }else {
                         participatorCell = row.getCell(6+c);
                         inchargerCell = row.getCell(7+c);
+                        if(timeType.getReportAuditType()==0||timeType.getReportAuditType()==4||timeType.getReportAuditType()==6){
+                            i++;
+                            reportAuditorsCell=row.getCell(7+i);
+                        }
+                        if(timeType.getReportAuditType()==6){
+                            i++;
+                            reportCcCell=row.getCell(7+i);
+                        }
                     }
                     if (participatorCell!=null)participatorCell.setCellType(CellType.STRING);
                     if (inchargerCell != null)inchargerCell.setCellType(CellType.STRING);
+                    if (reportAuditorsCell != null)reportAuditorsCell.setCellType(CellType.STRING);
+                    if (reportCcCell != null)reportCcCell.setCellType(CellType.STRING);
                     String part = participatorCell.getStringCellValue().trim();
                     String inchargerName = inchargerCell.getStringCellValue().trim();
+                    String reportAuditors = reportAuditorsCell.getStringCellValue().trim();
+                    String reportCc = reportCcCell.getStringCellValue().trim();
                     if(part.equals("参与人") || part.equals("參與人")){
                         continue;
                     }
                     String[] partSplit = part.split("\\,|\\,");
+                    String[] reportAuditorsSplit = reportAuditors.split("\\,|\\,");
+                    String[] reportCcSplit = reportCc.split("\\,|\\,");
                     for (String s : partSplit) {
                         if(!userNameList.contains(s)&&!s.equals("")){
                             userNameList.add(s);
                         }
                     }
+                    for (String s : reportAuditorsSplit) {
+                        if(!userNameList.contains(s)&&!s.equals("")){
+                            userNameList.add(s);
+                        }
+                    }
+                    for (String s : reportCcSplit) {
+                        if(!userNameList.contains(s)&&!s.equals("")){
+                            userNameList.add(s);
+                        }
+                    }
                     if(!userNameList.contains(inchargerName)&&!inchargerName.equals("")){
                         userNameList.add(inchargerName);
                     }
@@ -6308,9 +6380,11 @@ public class ProjectServiceImpl extends ServiceImpl<ProjectMapper, Project> impl
                                 }
                                 Participation p = new Participation();
                                 if (first.isPresent()) {
-                                    p.setUserId(first.get().getId());
-                                    p.setProjectId(project.getId());
-                                    participationList.add(p);
+                                    if (!participationList.stream().anyMatch(partOne->partOne.getUserId().equals(first.get().getId()))) {
+                                        p.setUserId(first.get().getId());
+                                        p.setProjectId(project.getId());
+                                        participationList.add(p);
+                                    }
                                 } else {
                                     switch (exception){
                                         case 0:throw new Exception("["+split[0]+"]在系统中不存在");
@@ -6356,9 +6430,11 @@ public class ProjectServiceImpl extends ServiceImpl<ProjectMapper, Project> impl
                                 }
                                 Participation p = new Participation();
                                 if (first.isPresent()) {
-                                    p.setUserId(first.get().getId());
-                                    p.setProjectId(project.getId());
-                                    participationList.add(p);
+                                    if (!participationList.stream().anyMatch(partOne->partOne.getUserId().equals(first.get().getId()))) {
+                                        p.setUserId(first.get().getId());
+                                        p.setProjectId(project.getId());
+                                        participationList.add(p);
+                                    }
                                 } else {
                                     switch (exception){
                                         case 0:throw new Exception("["+split[0]+"]在系统中不存在");