Quellcode durchsuchen

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

ggooalice vor 2 Jahren
Ursprung
Commit
8a7b99e6eb

+ 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]+"]姓名与工号不匹配");
                                     }
                                 }
                             }

BIN
fhKeeper/formulahousekeeper/timesheet/src/assets/image/qwcode.png


+ 2 - 1
fhKeeper/formulahousekeeper/timesheet/src/i18n/en.json

@@ -1448,5 +1448,6 @@
   "xiang-mu-chuang-jian-shi-jian-duan": "Project Creation Period",
   "dao-chu-jia-qi": "Export holidays",
   "an-ji-du-dao-chu": "export by quarter",
-  "han-qing-jia": "(including leave)"
+  "han-qing-jia": "(including leave)",
+  "ke-fu-wei-xin": "Customer service wechat"
 }

+ 2 - 1
fhKeeper/formulahousekeeper/timesheet/src/i18n/zh.json

@@ -1448,5 +1448,6 @@
   "xiang-mu-chuang-jian-shi-jian-duan": "项目创建时间段",
   "dao-chu-jia-qi": "导出假期",
   "an-ji-du-dao-chu": "按季度导出",
-  "han-qing-jia": "(含请假)"
+  "han-qing-jia": "(含请假)",
+  "ke-fu-wei-xin": "客服微信"
 }

+ 14 - 6
fhKeeper/formulahousekeeper/timesheet/src/views/Home.vue

@@ -36,11 +36,17 @@
                     </span> 
                     <el-dropdown-menu slot="dropdown">
                         <el-dropdown-item >
-                            <div>
-                            <div>{{$t('other.sweepWeChatYards')}}</div>
-                            <img
-                            style="width: 120px; height: 120px"
-                            src="../assets/image/code.jpg" />
+                            <div v-if="!isCorpWX">
+                                <div>{{$t('other.sweepWeChatYards')}}</div>
+                                <img
+                                style="width: 120px; height: 120px"
+                                src="../assets/image/code.jpg" />
+                            </div>
+                            <div v-if="isCorpWX">
+                                <div>客服微信</div>
+                                <img
+                                style="width: 120px; height: 120px"
+                                src="../assets/image/qwcode.png" />
                             </div>
                         </el-dropdown-item>
                     </el-dropdown-menu>
@@ -264,7 +270,8 @@
                 popoverData: [],
                 num: 0,
 
-                language: ''
+                language: '',
+                setTimeLoad: null
             };
         },
         methods: {
@@ -472,6 +479,7 @@
                     });
                 });
             },
+
             //点击消息的跳转
             locationHerf(id, date, type) {
                 this.http.post( this.port.manage.check, { id: id },