فهرست منبع

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

Lijy 2 سال پیش
والد
کامیت
c7781a0e19

+ 60 - 40
fhKeeper/formulahousekeeper/management-platform/src/main/java/com/management/platform/service/impl/ProjectServiceImpl.java

@@ -3070,6 +3070,8 @@ public class ProjectServiceImpl extends ServiceImpl<ProjectMapper, Project> impl
     public HttpRespMsg importData(String userId, MultipartFile multipartFile,Integer key, HttpServletRequest request) {
         HttpRespMsg msg = new HttpRespMsg();
         User user = userMapper.selectById(userId);
+        TimeType timeType = timeTypeMapper.selectById(user.getCompanyId());
+        WxCorpInfo wxCorpInfo = wxCorpInfoMapper.selectOne(new QueryWrapper<WxCorpInfo>().eq("company_id", user.getCompanyId()));
         //然后处理文件
         String fileName = multipartFile.getOriginalFilename();
         File file = new File(fileName == null ? "file" : fileName);
@@ -3215,20 +3217,24 @@ public class ProjectServiceImpl extends ServiceImpl<ProjectMapper, Project> impl
                             }else s2=s1;
                             String[] split = s2.split("/");
                             Optional<User> first;
-                            Integer exception;
+                            Integer exception=null;
                             if(split.length==1){
-                                first= userList.stream().filter(u -> u.getName().equals(split[0])||(u.getJobNumber()!=null&&u.getJobNumber().equals(split[0]))).findFirst();
+                                if(wxCorpInfo.getSaasSyncContact()!=1){
+                                    first= userList.stream().filter(u -> u.getName().equals(split[0])||(u.getJobNumber()!=null&&u.getJobNumber().equals(split[0]))).findFirst();
+                                }else {first= userList.stream().filter(u ->(u.getJobNumber()!=null&&u.getJobNumber().equals(split[0]))).findFirst();}
                                 exception=0;
                             }else {
-                                first= userList.stream().filter(u -> u.getName().equals(split[0])&&(u.getJobNumber()!=null&&u.getJobNumber().equals(split[1]))).findFirst();
-                                exception=1;
+                                if(wxCorpInfo.getSaasSyncContact()!=1){
+                                    first= userList.stream().filter(u -> u.getName().equals(split[0])&&(u.getJobNumber()!=null&&u.getJobNumber().equals(split[1]))).findFirst();
+                                    exception=1;
+                                }else first= userList.stream().filter(u ->(u.getJobNumber()!=null&&u.getJobNumber().equals(split[1]))).findFirst();
                             }
                             if (first.isPresent()) {
                                 project.setInchargerId(first.get().getId());
                                 project.setInchargerName(first.get().getName());
                             } else {
                                 switch (exception){
-                                    case 0:throw new Exception("项目负责人姓名/工号为["+split[0]+"]的人员不存在");
+                                    case 0:throw new Exception(wxCorpInfo.getSaasSyncContact()==1?"项目负责人工号为["+split[0]+"]的人员不存在":"项目负责人姓名/工号为["+split[0]+"]的人员不存在");
                                     case 1:throw new Exception("项目负责人["+split[0]+"]姓名与工号不匹配");
                                 }
                             }
@@ -3307,13 +3313,17 @@ public class ProjectServiceImpl extends ServiceImpl<ProjectMapper, Project> impl
                         }else s2=s1;
                         String[] split = s2.split("/");
                         Optional<User> first;
-                        Integer exception;
+                        Integer exception=null;
                         if(split.length==1){
-                            first= userList.stream().filter(u -> u.getName().equals(split[0])||(u.getJobNumber()!=null&&u.getJobNumber().equals(split[0]))).findFirst();
+                            if(wxCorpInfo.getSaasSyncContact()!=1){
+                                first= userList.stream().filter(u -> u.getName().equals(split[0])||(u.getJobNumber()!=null&&u.getJobNumber().equals(split[0]))).findFirst();
+                            }else {first= userList.stream().filter(u ->(u.getJobNumber()!=null&&u.getJobNumber().equals(split[0]))).findFirst();}
                             exception=0;
                         }else {
-                            first= userList.stream().filter(u -> u.getName().equals(split[0])&&(u.getJobNumber()!=null&&u.getJobNumber().equals(split[1]))).findFirst();
-                            exception=1;
+                            if(wxCorpInfo.getSaasSyncContact()!=1){
+                                first= userList.stream().filter(u -> u.getName().equals(split[0])&&(u.getJobNumber()!=null&&u.getJobNumber().equals(split[1]))).findFirst();
+                                exception=1;
+                            }else first= userList.stream().filter(u ->(u.getJobNumber()!=null&&u.getJobNumber().equals(split[1]))).findFirst();
                         }
                         Participation p = new Participation();
                         if (first.isPresent()) {
@@ -3322,9 +3332,8 @@ public class ProjectServiceImpl extends ServiceImpl<ProjectMapper, Project> impl
                             participationList.add(p);
                         } else {
                             switch (exception){
-                                case 0:throw new Exception("参与人姓名/工号为["+split[0]+"]的人员不存在");
-
-                                case 1:throw new Exception("参与人["+split[0]+"]姓名工号不匹配");
+                                case 0:throw new Exception(wxCorpInfo.getSaasSyncContact()==1?"参与人工号为["+split[0]+"]的人员不存在":"参与人姓名/工号为["+split[0]+"]的人员不存在");
+                                case 1:throw new Exception("参与人["+split[0]+"]姓名与工号不匹配");
                             }
                         }
                     }
@@ -3344,13 +3353,17 @@ public class ProjectServiceImpl extends ServiceImpl<ProjectMapper, Project> impl
                                 }else s2=s1;
                                 String[] split = str.split("/");
                                 Optional<User> first;
-                                Integer exception;
+                                Integer exception=null;
                                 if(split.length==1){
-                                    first= userList.stream().filter(u -> u.getName().equals(split[0])||(u.getJobNumber()!=null&&u.getJobNumber().equals(split[0]))).findFirst();
+                                    if(wxCorpInfo.getSaasSyncContact()!=1){
+                                        first= userList.stream().filter(u -> u.getName().equals(split[0])||(u.getJobNumber()!=null&&u.getJobNumber().equals(split[0]))).findFirst();
+                                    }else {first= userList.stream().filter(u ->(u.getJobNumber()!=null&&u.getJobNumber().equals(split[0]))).findFirst();}
                                     exception=0;
                                 }else {
-                                    first= userList.stream().filter(u -> u.getName().equals(split[0])&&(u.getJobNumber()!=null&&u.getJobNumber().equals(split[1]))).findFirst();
-                                    exception=1;
+                                    if(wxCorpInfo.getSaasSyncContact()!=1){
+                                        first= userList.stream().filter(u -> u.getName().equals(split[0])&&(u.getJobNumber()!=null&&u.getJobNumber().equals(split[1]))).findFirst();
+                                        exception=1;
+                                    }else first= userList.stream().filter(u ->(u.getJobNumber()!=null&&u.getJobNumber().equals(split[1]))).findFirst();
                                 }
                                 if (first.isPresent()) {
                                     User partMemb = first.get();
@@ -3362,11 +3375,9 @@ public class ProjectServiceImpl extends ServiceImpl<ProjectMapper, Project> impl
                                     }
                                 } else {
                                     switch (exception){
-                                        case 0:throw new Exception("参与人姓名/工号为["+split[0]+"]的人员不存在");
-
-                                        case 1:throw new Exception("参与人["+split[0]+"]姓名工号不匹配");
+                                        case 0:throw new Exception(wxCorpInfo.getSaasSyncContact()==1?"参与人工号为["+split[0]+"]的人员不存在":"参与人姓名/工号为["+split[0]+"]的人员不存在");
+                                        case 1:throw new Exception("参与人["+split[0]+"]姓名与工号不匹配");
                                     }
-
                                 }
                             }
                         }
@@ -3423,7 +3434,6 @@ public class ProjectServiceImpl extends ServiceImpl<ProjectMapper, Project> impl
                 List<Department> departmentList = departmentMapper.selectList(new QueryWrapper<Department>().eq("company_id", user.getCompanyId()));
                 //获取所有节点
                 List<ProjectKeyNodesSetting> projectKeyNodesSettingList = projectKeyNodesSettingMapper.selectList(new QueryWrapper<ProjectKeyNodesSetting>().eq("company_id", user.getCompanyId()));
-                TimeType timeType = timeTypeMapper.selectById(company.getId());
                 List<Project> projectList = new ArrayList<Project>();
                 //由于第一行需要指明列对应的标题
                 int rowNum = sheet.getLastRowNum();
@@ -3718,20 +3728,24 @@ public class ProjectServiceImpl extends ServiceImpl<ProjectMapper, Project> impl
                             }else s2=s1;
                             String[] split = s2.split("/");
                             Optional<User> first;
-                            Integer exception;
+                            Integer exception=null;
                             if(split.length==1){
-                                first= userList.stream().filter(u -> u.getName().equals(split[0])||(u.getJobNumber()!=null&&u.getJobNumber().equals(split[0]))).findFirst();
+                                if(wxCorpInfo.getSaasSyncContact()!=1){
+                                    first= userList.stream().filter(u -> u.getName().equals(split[0])||(u.getJobNumber()!=null&&u.getJobNumber().equals(split[0]))).findFirst();
+                                }else {first= userList.stream().filter(u ->(u.getJobNumber()!=null&&u.getJobNumber().equals(split[0]))).findFirst();}
                                 exception=0;
                             }else {
-                                first= userList.stream().filter(u -> u.getName().equals(split[0])&&(u.getJobNumber()!=null&&u.getJobNumber().equals(split[1]))).findFirst();
-                                exception=1;
+                                if(wxCorpInfo.getSaasSyncContact()!=1){
+                                    first= userList.stream().filter(u -> u.getName().equals(split[0])&&(u.getJobNumber()!=null&&u.getJobNumber().equals(split[1]))).findFirst();
+                                    exception=1;
+                                }else first= userList.stream().filter(u ->(u.getJobNumber()!=null&&u.getJobNumber().equals(split[1]))).findFirst();
                             }
                             if (first.isPresent()) {
                                 project.setInchargerId(first.get().getId());
                                 project.setInchargerName(first.get().getName());
                             } else {
                                 switch (exception){
-                                    case 0:throw new Exception("项目负责人姓名/工号为["+split[0]+"]的人员不存在");
+                                    case 0:throw new Exception(wxCorpInfo.getSaasSyncContact()==1?"项目负责人工号为["+split[0]+"]的人员不存在":"项目负责人姓名/工号为["+split[0]+"]的人员不存在");
                                     case 1:throw new Exception("项目负责人["+split[0]+"]姓名与工号不匹配");
                                 }
                             }
@@ -4290,13 +4304,17 @@ public class ProjectServiceImpl extends ServiceImpl<ProjectMapper, Project> impl
                         }else s2=s1;
                         String[] split = s2.split("/");
                         Optional<User> first;
-                        Integer exception;
+                        Integer exception=null;
                         if(split.length==1){
-                            first= userList.stream().filter(u -> u.getName().equals(split[0])||(u.getJobNumber()!=null&&u.getJobNumber().equals(split[0]))).findFirst();
+                            if(wxCorpInfo.getSaasSyncContact()!=1){
+                                first= userList.stream().filter(u -> u.getName().equals(split[0])||(u.getJobNumber()!=null&&u.getJobNumber().equals(split[0]))).findFirst();
+                            }else {first= userList.stream().filter(u ->(u.getJobNumber()!=null&&u.getJobNumber().equals(split[0]))).findFirst();}
                             exception=0;
                         }else {
-                            first= userList.stream().filter(u -> u.getName().equals(split[0])&&(u.getJobNumber()!=null&&u.getJobNumber().equals(split[1]))).findFirst();
-                            exception=1;
+                            if(wxCorpInfo.getSaasSyncContact()!=1){
+                                first= userList.stream().filter(u -> u.getName().equals(split[0])&&(u.getJobNumber()!=null&&u.getJobNumber().equals(split[1]))).findFirst();
+                                exception=1;
+                            }else first= userList.stream().filter(u ->(u.getJobNumber()!=null&&u.getJobNumber().equals(split[1]))).findFirst();
                         }
                         Participation p = new Participation();
                         if (first.isPresent()) {
@@ -4305,9 +4323,8 @@ public class ProjectServiceImpl extends ServiceImpl<ProjectMapper, Project> impl
                             participationList.add(p);
                         } else {
                             switch (exception){
-                                case 0:throw new Exception("参与人姓名/工号为["+split[0]+"]的人员不存在");
-
-                                case 1:throw new Exception("参与人["+split[0]+"]姓名工号不匹配");
+                                case 0:throw new Exception(wxCorpInfo.getSaasSyncContact()==1?"参与人工号为["+split[0]+"]的人员不存在":"参与人姓名/工号为["+split[0]+"]的人员不存在");
+                                case 1:throw new Exception("参与人["+split[0]+"]姓名与工号不匹配");
                             }
                         }
                     }
@@ -4326,13 +4343,17 @@ public class ProjectServiceImpl extends ServiceImpl<ProjectMapper, Project> impl
                                 }else s2=s1;
                                 String[] split = s2.split("/");
                                 Optional<User> first;
-                                Integer exception;
+                                Integer exception=null;
                                 if(split.length==1){
-                                    first= userList.stream().filter(u -> u.getName().equals(split[0])||(u.getJobNumber()!=null&&u.getJobNumber().equals(split[0]))).findFirst();
+                                    if(wxCorpInfo.getSaasSyncContact()!=1){
+                                        first= userList.stream().filter(u -> u.getName().equals(split[0])||(u.getJobNumber()!=null&&u.getJobNumber().equals(split[0]))).findFirst();
+                                    }else {first= userList.stream().filter(u ->(u.getJobNumber()!=null&&u.getJobNumber().equals(split[0]))).findFirst();}
                                     exception=0;
                                 }else {
-                                    first= userList.stream().filter(u -> u.getName().equals(split[0])&&(u.getJobNumber()!=null&&u.getJobNumber().equals(split[1]))).findFirst();
-                                    exception=1;
+                                    if(wxCorpInfo.getSaasSyncContact()!=1){
+                                        first= userList.stream().filter(u -> u.getName().equals(split[0])&&(u.getJobNumber()!=null&&u.getJobNumber().equals(split[1]))).findFirst();
+                                        exception=1;
+                                    }else first= userList.stream().filter(u ->(u.getJobNumber()!=null&&u.getJobNumber().equals(split[1]))).findFirst();
                                 }
                                 Participation p = new Participation();
                                 if (first.isPresent()) {
@@ -4345,9 +4366,8 @@ public class ProjectServiceImpl extends ServiceImpl<ProjectMapper, Project> impl
                                     }
                                 } else {
                                     switch (exception){
-                                        case 0:throw new Exception("参与人姓名/工号为["+split[0]+"]的人员不存在");
-
-                                        case 1:throw new Exception("参与人["+split[0]+"]姓名工号不匹配");
+                                        case 0:throw new Exception(wxCorpInfo.getSaasSyncContact()==1?"参与人工号为["+split[0]+"]的人员不存在":"参与人姓名/工号为["+split[0]+"]的人员不存在");
+                                        case 1:throw new Exception("参与人["+split[0]+"]姓名与工号不匹配");
                                     }
                                 }
                             }

+ 1 - 1
fhKeeper/formulahousekeeper/timesheet_h5/src/views/project/index.vue

@@ -480,7 +480,7 @@
                             this.yanjiuzx()
                         } else {
                             this.$toast.clear();
-                            this.$toast.fail(this.form.id==null?'新增失败':'修改失败');
+                            this.$toast.fail(res.msg);
                         }
                     }).catch(err=> {this.$toast.clear();});
                 } else {