Browse Source

修复导出分摊比例模板时后缀缺少x的bug.

seyason 2 years ago
parent
commit
aa046a3961

+ 13 - 11
fhKeeper/formulahousekeeper/management-platform/src/main/java/com/management/platform/controller/WeiXinCorpController.java

@@ -1010,16 +1010,18 @@ public class WeiXinCorpController {
                         }
                         if (curUserWXDeptid != 0) {
                             User user = userMapper.selectOne(new QueryWrapper<User>().eq("company_id", companyId).eq("corpwx_userid", openUserId));
-                            User changeUser = new User();
-                            changeUser.setId(user.getId());
-                            if (!curUserWXDeptid.equals(user.getCorpwxDeptid())) {
-                                changeUser.setCorpwxDeptid(curUserWXDeptid);
-                                Department department = departmentMapper.selectOne(new QueryWrapper<Department>().eq("company_id", companyId).eq("corpwx_deptid", curUserWXDeptid));
-                                if (department != null) {
-                                    changeUser.setDepartmentId(department.getDepartmentId());
-                                    List<Department> allDeptList = departmentMapper.selectList(new QueryWrapper<Department>().eq("company_id", companyId));
-                                    changeUser.setDepartmentCascade(convertDepartmentIdToCascade(changeUser.getDepartmentId(), allDeptList));
-                                    userMapper.updateById(changeUser);
+                            if (user != null) {
+                                User changeUser = new User();
+                                changeUser.setId(user.getId());
+                                if (!curUserWXDeptid.equals(user.getCorpwxDeptid())) {
+                                    changeUser.setCorpwxDeptid(curUserWXDeptid);
+                                    Department department = departmentMapper.selectOne(new QueryWrapper<Department>().eq("company_id", companyId).eq("corpwx_deptid", curUserWXDeptid));
+                                    if (department != null) {
+                                        changeUser.setDepartmentId(department.getDepartmentId());
+                                        List<Department> allDeptList = departmentMapper.selectList(new QueryWrapper<Department>().eq("company_id", companyId));
+                                        changeUser.setDepartmentCascade(convertDepartmentIdToCascade(changeUser.getDepartmentId(), allDeptList));
+                                        userMapper.updateById(changeUser);
+                                    }
                                 }
                             }
                         }
@@ -1143,7 +1145,7 @@ public class WeiXinCorpController {
                                 }
                             }
                         }
-                        if (jsonObject.getString("Name") != null) {
+                        if (jsonObject.has("Name")) {
                             //发生了部门名称变化
                             System.out.println("部门名称变化了,请处理==企业微信部门id="+deptId);
                             String remoteCorpConcactAccessToken = getRemoteCorpConcactAccessToken(wxCorpInfo);

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

@@ -411,8 +411,7 @@ public class ProjectPercentageServiceImpl extends ServiceImpl<ProjectPercentageM
             dataList.add(itemList);
         }
         String fileName = "人员分摊比例导入模板"+"_"+System.currentTimeMillis();
-        ExcelUtil.exportGeneralExcelByTitleAndList(fileName, dataList, path);
-        httpRespMsg.data =  "/upload/" + fileName+".xls";
+        httpRespMsg.data =  ExcelUtil.exportGeneralExcelByTitleAndList(fileName, dataList, path);
         return httpRespMsg;
     }
 }