소스 검색

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

Min 1 년 전
부모
커밋
6aa1ac133d

+ 2 - 0
fhKeeper/formulahousekeeper/management-platform/src/main/java/com/management/platform/controller/FeishuInfoController.java

@@ -129,6 +129,8 @@ public class FeishuInfoController {
             //生成工作时长
             TimeType timeType = new TimeType();
             timeType.setCompanyId(company.getId());
+            timeType.setFinanceJobnumEnabled(1);//启用工号来导入财务匹配
+            timeType.setProjectManDay(1);
             timeTypeMapper.insert(timeType);
             SysRole smanager = sysRoleService.generateDefaultRoles(company.getId());
             //生成项目的成本基线默认条目

+ 3 - 1
fhKeeper/formulahousekeeper/management-platform/src/main/java/com/management/platform/controller/WeiXinCorpController.java

@@ -1417,6 +1417,7 @@ public class WeiXinCorpController {
                         TimeType timeType = new TimeType();
                         timeType.setCompanyId(company.getId());
                         timeType.setFinanceJobnumEnabled(1);//启用工号来导入财务匹配
+                        timeType.setProjectManDay(1);//默认开启预估项目人天
                         timeTypeMapper.insert(timeType);
 
                         managerRole = sysRoleService.generateDefaultRoles(company.getId());
@@ -1458,7 +1459,6 @@ public class WeiXinCorpController {
                         project.setCreateDate(LocalDate.now());
                         project.setProjectCode("example");
                         project.setProjectName("示例项目");
-                        project.setManDay(1);//默认开通预估工时
                         //设置为公共项目,这样测试的用户都能填报
                         project.setIsPublic(1);
                         projectMapper.insert(project);
@@ -3543,6 +3543,8 @@ public class WeiXinCorpController {
                     //生成工作时长
                     TimeType timeType = new TimeType();
                     timeType.setCompanyId(company.getId());
+                    timeType.setFinanceJobnumEnabled(1);//启用工号来导入财务匹配
+                    timeType.setProjectManDay(1);
                     timeTypeMapper.insert(timeType);
                     SysRole smanager = sysRoleService.generateDefaultRoles(company.getId());
                     //生成项目的成本基线默认条目

+ 4 - 0
fhKeeper/formulahousekeeper/management-platform/src/main/java/com/management/platform/service/impl/DingDingServiceImpl.java

@@ -186,6 +186,8 @@ public class DingDingServiceImpl implements DingDingService {
                 //生成工作时长
                 TimeType timeType = new TimeType();
                 timeType.setCompanyId(company.getId());
+                timeType.setFinanceJobnumEnabled(1);//启用工号来导入财务匹配
+                timeType.setProjectManDay(1);
                 timeTypeMapper.insert(timeType);
 
                 SysRole smanager = sysRoleService.generateDefaultRoles(company.getId());
@@ -384,6 +386,8 @@ public class DingDingServiceImpl implements DingDingService {
             //生成工作时长
             TimeType timeType = new TimeType();
             timeType.setCompanyId(company.getId());
+            timeType.setFinanceJobnumEnabled(1);//启用工号来导入财务匹配
+            timeType.setProjectManDay(1);
             timeTypeMapper.insert(timeType);
 
             smanager = sysRoleService.generateDefaultRoles(company.getId());

+ 4 - 0
fhKeeper/formulahousekeeper/management-platform/src/main/java/com/management/platform/service/impl/UserServiceImpl.java

@@ -1113,6 +1113,8 @@ public class UserServiceImpl extends ServiceImpl<UserMapper, User> implements Us
             //生成工作时长
             TimeType timeType = new TimeType();
             timeType.setCompanyId(company.getId());
+            timeType.setFinanceJobnumEnabled(1);//启用工号来导入财务匹配
+            timeType.setProjectManDay(1);
             timeTypeMapper.insert(timeType);
 
             //生成超级管理员角色
@@ -3125,6 +3127,8 @@ public class UserServiceImpl extends ServiceImpl<UserMapper, User> implements Us
         //生成工作时长
         TimeType timeType = new TimeType();
         timeType.setCompanyId(company.getId());
+        timeType.setFinanceJobnumEnabled(1);//启用工号来导入财务匹配
+        timeType.setProjectManDay(1);
         timeTypeMapper.insert(timeType);
         SysRole smanager = sysRoleService.generateDefaultRoles(company.getId());
         //创建企业负责人账号

+ 34 - 34
fhKeeper/formulahousekeeper/management-platform/src/main/java/com/management/platform/service/impl/WxCorpInfoServiceImpl.java

@@ -50,6 +50,7 @@ public class WxCorpInfoServiceImpl extends ServiceImpl<WxCorpInfoMapper, WxCorpI
 
     public static final String URL_SEARCH_CONTACT = "https://qyapi.weixin.qq.com/cgi-bin/service/contact/search?provider_access_token=ACCESS_TOKEN";
 
+    public static final String URL_GET_USER_ID_LIST = "https://qyapi.weixin.qq.com/cgi-bin/user/list_id?access_token=ACCESS_TOKEN";
     public static String URL_SEND_WXCORP_MSG = "https://qyapi.weixin.qq.com/cgi-bin/message/send?access_token=ACCESS_TOKEN";
     //获取临时素材url
     public static String URL_GET_MEDIA = "https://qyapi.weixin.qq.com/cgi-bin/media/get?access_token=ACCESS_TOKEN&media_id=MEDIA_ID";
@@ -581,42 +582,41 @@ public class WxCorpInfoServiceImpl extends ServiceImpl<WxCorpInfoMapper, WxCorpI
             return msg;
         }
         String url = null;
-        try {
-            startDateTime = startDateTime.withHour(0).withMinute(0).withSecond(0).withNano(0);
-            long startTime = startDateTime.toEpochSecond(ZoneOffset.of("+8"));
-            endDateTime = endDateTime.withHour(0).withMinute(0).withSecond(0).withNano(0);
-            long endTime = endDateTime.toEpochSecond(ZoneOffset.of("+8"));
-            System.out.println("startTime=" + startTime + ",endTime=" + endTime);
-
-            int batchCount = 1;
-            int batchSize = 100;
-            int totalLength = 1;
-            List<String> corpwxUserIds = new ArrayList<>();
-            if (userId == null) {
-                //获取企业下的全部员工
-                List<User> users = userMapper.selectList(new QueryWrapper<User>().eq("company_id", companyId).isNotNull("corpwx_userid").eq("is_active", 1));
-                System.out.println("获取考勤记录users size==" + users.size()+", companyId="+companyId+", "+corpInfo.getCorpName());
-                corpwxUserIds = users.stream().map(User::getCorpwxUserid).collect(Collectors.toList());
-                totalLength = corpwxUserIds.size();
-                batchCount = totalLength / batchSize + (totalLength % batchSize == 0 ? 0 : 1);
-            } else {
-                //指定获取员工
-                User user = userMapper.selectById(userId);
-                corpwxUserIds.add(user.getCorpwxUserid());
-                System.out.println("获取corpwxuserid==" + user.getCorpwxUserid() + "的考勤记录");
-            }
-            //按批调用
-            for (int i = 0; i < batchCount; i++) {
-                int fromIndex = i * batchSize;
-                int toIndex = (i + 1) * batchSize;
-                if (toIndex > totalLength) toIndex = totalLength;
-                Object[] objects = corpwxUserIds.subList(fromIndex, toIndex).toArray(new String[0]);
+        startDateTime = startDateTime.withHour(0).withMinute(0).withSecond(0).withNano(0);
+        long startTime = startDateTime.toEpochSecond(ZoneOffset.of("+8"));
+        endDateTime = endDateTime.withHour(0).withMinute(0).withSecond(0).withNano(0);
+        long endTime = endDateTime.toEpochSecond(ZoneOffset.of("+8"));
+        System.out.println("startTime=" + startTime + ",endTime=" + endTime);
+
+        int batchCount = 1;
+        int batchSize = 1;
+        int totalLength = 1;
+        List<String> corpwxUserIds = new ArrayList<>();
+        if (userId == null) {
+            //获取企业下的全部员工
+            List<User> users = userMapper.selectList(new QueryWrapper<User>().eq("company_id", companyId).isNotNull("corpwx_userid").eq("is_active", 1).eq("report_status", 0));
+            System.out.println("获取考勤记录users size==" + users.size()+", companyId="+companyId+", "+corpInfo.getCorpName());
+            corpwxUserIds = users.stream().map(User::getCorpwxUserid).collect(Collectors.toList());
+            totalLength = corpwxUserIds.size();
+            batchCount = totalLength / batchSize + (totalLength % batchSize == 0 ? 0 : 1);
+        } else {
+            //指定获取员工
+            User user = userMapper.selectById(userId);
+            corpwxUserIds.add(user.getCorpwxUserid());
+            System.out.println("获取corpwxuserid==" + user.getCorpwxUserid() + "的考勤记录");
+        }
+        //按批调用
+        for (int i = 0; i < batchCount; i++) {
+            int fromIndex = i * batchSize;
+            int toIndex = (i + 1) * batchSize;
+            if (toIndex > totalLength) toIndex = totalLength;
+            Object[] objects = corpwxUserIds.subList(fromIndex, toIndex).toArray(new String[0]);
+            try {
                 reqOnceCardTime(corpInfo, startTime, endTime, objects, showLog);
+            } catch (Exception e) {
+                e.printStackTrace();
             }
-        } catch (Exception exception) {
-            exception.printStackTrace();
         }
-
         return msg;
     }
 
@@ -1138,7 +1138,7 @@ public class WxCorpInfoServiceImpl extends ServiceImpl<WxCorpInfoMapper, WxCorpI
         String url = GET_CHECKIN_DAYDATA.replace("ACCESS_TOKEN", getCorpAccessToken(corpInfo));
         HttpHeaders headers = new HttpHeaders();
         headers.setContentType(MediaType.APPLICATION_JSON);
-        System.out.println("" + objects.toString());
+        //检查openIds是否都是有效的
         JSONObject reqParam = new JSONObject();
         reqParam.put("starttime", startTime);
         reqParam.put("endtime", endTime);

BIN
fhKeeper/formulahousekeeper/ops-platform/src/main/resources/新模板.docx