Bladeren bron

增加用章管理员人员接口

zhangjq 1 jaar geleden
bovenliggende
commit
13b4f7c974

+ 12 - 0
zjugis-business/src/main/java/com/zjugis/business/constants/OfficialSealNameConstants.java

@@ -0,0 +1,12 @@
+package com.zjugis.business.constants;
+
+/**
+ * @Author:zjq
+ * @Date:2024-03-18
+ */
+public class OfficialSealNameConstants {
+
+    public static final int WW = 1;
+
+    public static final int WW_JS = 2;
+}

+ 14 - 0
zjugis-business/src/main/java/com/zjugis/business/constants/PostConstants.java

@@ -0,0 +1,14 @@
+package com.zjugis.business.constants;
+
+/**
+ * @author zjq
+ * @version 1.0
+ * @date 2024/03/18 15:00
+ */
+public class PostConstants {
+
+    public final static int OFFICIAL_SEAL_MANAGER = 82;
+
+    public final static int JIANGSU_OFFICIAL_SEAL_MANAGER = 101;
+
+}

+ 47 - 7
zjugis-business/src/main/java/com/zjugis/business/flow/officialSeal/event/OfficialSealUseEvent.java

@@ -1,6 +1,8 @@
 package com.zjugis.business.flow.officialSeal.event;
 
 
+import com.zjugis.business.constants.OfficialSealNameConstants;
+import com.zjugis.business.constants.PostConstants;
 import com.zjugis.business.converter.officialSeal.OfficialSealConvert;
 import com.zjugis.business.flow.officialSeal.entity.OfficialSealUseDO;
 import com.zjugis.business.flow.officialSeal.service.OfficialSealUseService;
@@ -31,7 +33,6 @@ import java.util.*;
 import static com.zjugis.business.constants.FlowStatusConstants.*;
 
 /**
- *
  * @author zjq
  * @since 2024-03-15
  */
@@ -192,6 +193,7 @@ public class OfficialSealUseEvent extends BaseController {
 
     /**
      * 部门经理
+     *
      * @param flowInstanceId
      * @return
      */
@@ -202,15 +204,15 @@ public class OfficialSealUseEvent extends BaseController {
                 OfficialSealUseDO entity = officialSealUseService.findByInstanceId(flowInstanceId);
                 DeptRespDTO deptRespDTO = deptApi.getDept(entity.getDeptId()).getCheckedData();
                 List<Map<String, String>> userMaps = new ArrayList<>();
-                HashMap<String,String> map = new HashMap<>();
-                map.put("id",deptRespDTO.getLeaderUserId());
+                HashMap<String, String> map = new HashMap<>();
+                map.put("id", deptRespDTO.getLeaderUserId());
                 userMaps.add(map);
                 return ok(userMaps);
             } else {
                 throw new BusinessException("执行事件出错,请联系管理员!");
             }
         } catch (Exception e) {
-            log.error(e.getMessage(),e);
+            log.error(e.getMessage(), e);
             throw new BusinessException("执行事件出错,请联系管理员!");
         }
     }
@@ -230,16 +232,54 @@ public class OfficialSealUseEvent extends BaseController {
 
                 List<Map<String, String>> userMaps = new ArrayList<>();
                 AdminUserRespDTO userLeader = adminUserApi.getUserLeader(deptRespDTO.getLeaderUserId()).getCheckedData();
-                HashMap<String,String> map = new HashMap<>();
-                map.put("id",userLeader.getId());
+                HashMap<String, String> map = new HashMap<>();
+                map.put("id", userLeader.getId());
                 userMaps.add(map);
                 return ok(userMaps);
             } else {
                 throw new BusinessException("执行事件出错,请联系管理员!");
             }
         } catch (Exception e) {
-            log.error(e.getMessage(),e);
+            log.error(e.getMessage(), e);
+            throw new BusinessException("执行事件出错,请联系管理员!");
+        }
+    }
+
+    /**
+     * 用章参与人
+     *
+     * @param flowInstanceId
+     * @return
+     */
+    @PostMapping("/use-people")
+    public String userOfficialSealFlow1(String flowInstanceId) {
+        try {
+            if (StringUtils.isNotBlank(flowInstanceId)) {
+                OfficialSealUseDO entity = officialSealUseService.findByInstanceId(flowInstanceId);
+                List<Map<String, String>> userMaps = new ArrayList<>();
+                if (entity.getOfficialSealName().equals(OfficialSealNameConstants.WW) || entity.getOfficialSealName().equals(OfficialSealNameConstants.WW_JS)) {
+                    int pId = entity.getOfficialSealName().equals(OfficialSealNameConstants.WW) ? PostConstants.OFFICIAL_SEAL_MANAGER : PostConstants.JIANGSU_OFFICIAL_SEAL_MANAGER;
+                    Collection<Long> collection = new ArrayList<>();
+                    collection.add(Long.valueOf(pId));
+                    List<AdminUserRespDTO> userList = adminUserApi.getUserListByPostIds(collection).getCheckedData();
+                    for (AdminUserRespDTO adminUserRespDTO : userList) {
+                        HashMap<String, String> map = new HashMap<>();
+                        map.put("id", adminUserRespDTO.getId());
+                        userMaps.add(map);
+                    }
+                    return ok(userMaps);
+                } else {
+                    throw new BusinessException("执行事件出错,请联系管理员!");
+                }
+
+            } else {
+                throw new BusinessException("执行事件出错,请联系管理员!");
+            }
+        } catch (Exception e) {
+            log.error(e.getMessage(), e);
             throw new BusinessException("执行事件出错,请联系管理员!");
         }
     }
+
+
 }