Quellcode durchsuchen

批量导出bug+初入公司时间更新修改

jzh vor 9 Monaten
Ursprung
Commit
37ecbb64db

+ 19 - 1
zjugis-module-adm/zjugis-module-adm-biz/src/main/java/com/zjugis/module/adm/controller/admin/staff/vo/records/StaffExcelResponse.java

@@ -263,7 +263,7 @@ public class StaffExcelResponse {
     /**
      * 续签次数
      */
-    @ExcelProperty(value = "签次数")
+    @ExcelProperty(value = "签次数")
     private Integer xqcs;
 
     /**
@@ -273,4 +273,22 @@ public class StaffExcelResponse {
     private LocalDateTime lzsj;
 
 
+    /**
+     * 籍贯
+     */
+    @ExcelProperty(value = "籍贯")
+    private String jg;
+
+    /**
+     * 身份证有效期
+     */
+    @ExcelProperty(value = "身份证有效期")
+    private LocalDateTime sfzyxq;
+
+
+    /**
+     * 拟转正时间
+     */
+    @ExcelProperty(value = "拟转正时间")
+    private LocalDateTime nzzsj;
 }

+ 24 - 9
zjugis-module-adm/zjugis-module-adm-biz/src/main/java/com/zjugis/module/adm/service/staff/RecordsServiceImpl.java

@@ -104,11 +104,31 @@ public class RecordsServiceImpl implements RecordsService {
         List<StaffRecordSDO> dtoList = page.getRecords();
         if (CollectionUtil.isNotEmpty(dtoList)) {
             List<String> users = dtoList.stream().map(StaffRecordSDO::getUserId).filter(Objects::nonNull).collect(Collectors.toList());
-            CommonResult<List<AdminUserRespDTO>> result = userApi.getUsers(users);
-            if (result.getCode() != 0) {
-                throw new RuntimeException(result.getMsg());
+
+            //在获取用户请求时数据会有长度限制  所以在这里分批次的请求 100条查一次
+            List<AdminUserRespDTO> userList = new ArrayList<>();
+            List<String> us = new ArrayList<>();
+            users.forEach(user -> {
+                us.add(user);
+                if (us.size() == 100) {
+                    CommonResult<List<AdminUserRespDTO>> result = userApi.getUsers(us);
+                    if (result.getCode() != 0) {
+                        throw new RuntimeException(result.getMsg());
+                    }
+                    userList.addAll(result.getData());
+                    us.clear();
+                }
+            });
+
+            if(CollectionUtil.isNotEmpty(us)){
+                CommonResult<List<AdminUserRespDTO>> result = userApi.getUsers(us);
+                if (result.getCode() != 0) {
+                    throw new RuntimeException(result.getMsg());
+                }
+                userList.addAll(result.getData());
             }
-            List<AdminUserRespDTO> userList = result.getData();
+
+
             Map<String, AdminUserRespDTO> map = new HashMap<>();
             userList.forEach(v -> map.put(v.getId(), v));
             page.getRecords().forEach(v -> {
@@ -203,11 +223,6 @@ public class RecordsServiceImpl implements RecordsService {
             vo.setPerformanceList(performList);
         }
 
-        if (vo.getYsrzsj() != null) {
-            vo.setRgssj(vo.getYsrzsj());
-        }
-
-
         return vo;
     }