瀏覽代碼

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

seyason 2 年之前
父節點
當前提交
7c4d710f55

+ 15 - 6
fhKeeper/formulahousekeeper/management-platform/src/main/java/com/management/platform/controller/WeiXinCorpController.java

@@ -3405,6 +3405,10 @@ public class WeiXinCorpController {
                             JSONObject userJson = jsonArray.getJSONObject(m);
                             String curUserid = userJson.getString("userid");
                             String openUserid = userJson.getString("open_userid");
+                            int status = userJson.getIntValue("status");
+                            if(status!=1){
+                                continue;
+                            }
                             List<Integer> departments = (List<Integer>) userJson.get("department");
                             System.out.println("user info======:"+userJson.toString());
                             //不存在的人员, 进行插入
@@ -3415,10 +3419,10 @@ public class WeiXinCorpController {
                                     .setRoleName(role.getRolename())
                                     .setCompanyId(company.getId())
                                     .setName(userJson.getString("name"))
-                                    .setCorpwxUserid(openUserid)
+                                    .setCorpwxUserid(curUserid)
                                     .setCorpwxRealUserid(curUserid)
                                     .setColor(ColorUtil.randomColor())
-                                    .setJobNumber(curUserid.equals(openUserid)?null:curUserid)
+                                    .setJobNumber(curUserid)
                                     .setPassword(MD5Util.getPassword("000000"))
                                     .setCorpwxDeptid(departmentWx.getWxDeptid());
                             Integer max = Collections.max(departments);
@@ -3429,7 +3433,7 @@ public class WeiXinCorpController {
                                 user.setDepartmentId(dp.get().getDepartmentId());
                                 user.setDepartmentCascade(convertDepartmentIdToCascade(dp.get().getDepartmentId(),departmentList));
                             }
-                            boolean b = userList.stream().anyMatch(ul ->ul.getCorpwxUserid()!=null&&ul.getCorpwxUserid().equals(openUserid));
+                            boolean b = userList.stream().anyMatch(ul ->ul.getCorpwxUserid()!=null&&ul.getCorpwxUserid().equals(user.getCorpwxUserid()));
                             if(!b){
                                 userList.add(user);
                             }
@@ -3450,6 +3454,10 @@ public class WeiXinCorpController {
                             for (int i = 0; i < userInfo.size(); i++) {
                                 JSONObject object = userInfo.getJSONObject(i);
                                 String corpWxuserid = object.getString("userid");
+                                int status = object.getIntValue("status");
+                                if(status!=1){
+                                    continue;
+                                }
                                 String userInfoResp=wxCorpInfoService.getUserInfoWithApplication(accessToken,corpWxuserid);
                                 System.out.println("this is userinfo======="+userInfoResp);
                                 JSONObject userInfoOb = JSONObject.parseObject(userInfoResp);
@@ -3475,7 +3483,7 @@ public class WeiXinCorpController {
                                         }
                                     }
                                 }
-                                user.setCorpwxUserid(openUserid)
+                                user.setCorpwxUserid(corpWxuserid)
                                     .setName(userName)
                                     .setRoleName(role.getRolename())
                                     .setRoleId(role.getId())
@@ -3483,8 +3491,8 @@ public class WeiXinCorpController {
                                     .setCorpwxRealUserid(corpWxuserid)
                                     .setColor(ColorUtil.randomColor())
                                     .setPassword(MD5Util.getPassword("000000"))
-                                    .setJobNumber(corpWxuserid.equals(openUserid)?null:corpWxuserid);
-                                boolean b = userList.stream().anyMatch(ul -> ul.getCorpwxUserid().equals(openUserid));
+                                    .setJobNumber(corpWxuserid);
+                                boolean b = userList.stream().anyMatch(ul -> ul.getCorpwxUserid().equals(user.getCorpwxUserid()));
                                 if(!b){
                                     userList.add(user);
                                 }
@@ -3493,6 +3501,7 @@ public class WeiXinCorpController {
                             throw new Exception(json.toJSONString());
                         }
                     }
+                    System.out.println("resutlList========="+userList);
                     userService.saveBatch(userList);
                 }
             }

+ 6 - 2
fhKeeper/formulahousekeeper/management-platform/src/main/java/com/management/platform/service/impl/ProjectServiceImpl.java

@@ -286,10 +286,14 @@ public class ProjectServiceImpl extends ServiceImpl<ProjectMapper, Project> impl
             }
             if(!StringUtils.isEmpty(participation)){
                 List<Participation> participationList = participationMapper.selectList(new QueryWrapper<Participation>().eq("user_id", participation).select("project_id"));
+                List<Integer> collect;
                 if(participationList.size()>0){
-                    List<Integer> collect = participationList.stream().map(Participation::getProjectId).collect(Collectors.toList());
-                    queryWrapper.in("id",collect);
+                    collect = participationList.stream().map(Participation::getProjectId).collect(Collectors.toList());
+                }else {
+                    collect=new ArrayList<>();
+                    collect.add(-1);
                 }
+                queryWrapper.in("id",collect);
             }
             if (status != null && status != 0) {
                 queryWrapper.eq("status", status);

+ 2 - 2
fhKeeper/formulahousekeeper/management-platform/src/main/java/com/management/platform/service/impl/ReportServiceImpl.java

@@ -3548,14 +3548,14 @@ public class ReportServiceImpl extends ServiceImpl<ReportMapper, Report> impleme
                     String username = withCheckIn==null?row.getCell(1).getStringCellValue().trim():row.getCell(2).getStringCellValue().trim();
                     //检查人员是否存在
                     Optional<User> any;
-                    if(wxCorpInfo!=null&&wxCorpInfo.getSaasSyncContact()==1){
+                    if(wxCorpInfo!=null&&wxCorpInfo.getSaasSyncContact()!=1){
                         any = allUserList.stream().filter(u -> u.getName().equals(username)).findAny();
                     }else {
                         any = allUserList.stream().filter(u -> u.getName().equals(username)||(u.getJobNumber()!=null&&u.getJobNumber().equals(username))).findAny();
                     }
                     if (!any.isPresent()) {
                         //msg.setError("人员["+username+"]不存在,请先在组织结构中添加或者通过钉钉同步导入");
-                        if(wxCorpInfo!=null&&wxCorpInfo.getSaasSyncContact()==1){
+                        if(wxCorpInfo!=null&&wxCorpInfo.getSaasSyncContact()!=1){
                             msg.setError(MessageUtils.message("staff.peopleNullAndAdd",username));
                         }else {
                             msg.setError(MessageUtils.message("staff.peopleNullAndAddPlus",username));

+ 4 - 4
fhKeeper/formulahousekeeper/timesheet/index.html

@@ -69,7 +69,9 @@
                 max-width: 1000px;
             }
             .projectSelectPopperClass li{
-                display: flex;
+                overflow: hidden;
+                white-space: nowrap;
+                text-overflow: ellipsis;
             }
             .projectSelectPopperClass .el-select-dropdown__item span:nth-child(1){
                 font-size: 13px;
@@ -80,9 +82,7 @@
                 font-size: 13px;
                 height: 34px;
                 max-width: 650px;
-                overflow: hidden;
-                white-space: nowrap;
-                text-overflow: ellipsis;
+                
                 text-align: right;
             }
         </style>