From 1ac0d92fc65b6e1524b172af4adffbf8974e467b Mon Sep 17 00:00:00 2001
From: liyj <15602261488@163.com>
Date: Mon, 28 Oct 2024 08:00:17 +0800
Subject: [PATCH] 1、新功能优化

---
 dyh-service/dyh-sys/src/main/java/cn/huge/module/grid/service/GridUserService.java |   56 +++++++++++++++++++++++++++++++++++++++++++++++++++++---
 1 files changed, 53 insertions(+), 3 deletions(-)

diff --git a/dyh-service/dyh-sys/src/main/java/cn/huge/module/grid/service/GridUserService.java b/dyh-service/dyh-sys/src/main/java/cn/huge/module/grid/service/GridUserService.java
index 76b521b..a677523 100644
--- a/dyh-service/dyh-sys/src/main/java/cn/huge/module/grid/service/GridUserService.java
+++ b/dyh-service/dyh-sys/src/main/java/cn/huge/module/grid/service/GridUserService.java
@@ -3,11 +3,13 @@
 import cn.huge.base.common.bo.R;
 import cn.huge.base.common.utils.HttpClientUtils;
 import cn.huge.base.common.utils.SpringContextUtil;
-import cn.huge.module.grid.domain.dto.GridOrgDTO;
-import cn.huge.module.grid.domain.dto.GridRoleMenuDTO;
 import cn.huge.module.grid.domain.dto.GridSysRoleDTO;
-import cn.huge.module.grid.domain.dto.GridUserRoleDTO;
 import cn.huge.module.grid.domain.vo.*;
+import cn.huge.module.sys.dto.GridRoleMenuDTO;
+import cn.huge.module.sys.dto.GridUserRoleDTO;
+import cn.huge.module.sys.vo.GridOrgUsersVo;
+import cn.huge.module.sys.vo.GridRoleMenuVo;
+import cn.huge.module.sys.vo.GridUserRoleVo;
 import com.alibaba.fastjson.JSON;
 import com.alibaba.fastjson.JSONArray;
 import com.alibaba.fastjson.JSONObject;
@@ -15,6 +17,7 @@
 import org.springframework.beans.factory.annotation.Value;
 import org.springframework.stereotype.Service;
 
+import java.util.ArrayList;
 import java.util.HashMap;
 import java.util.List;
 import java.util.UUID;
@@ -131,4 +134,51 @@
         List<GridRoleMenuDTO> gridRoleMenuDTOList = data.toJavaList(GridRoleMenuDTO.class);
         return R.ok(gridRoleMenuDTOList);
     }
+
+    public R<String> initNewUsers(GridUserRoleVo gridUserRoleVo) {
+        //根据用户id获取用户信息
+
+        //拿到用户机构信息
+
+        //拿到用户角色菜单权限信息
+
+        //如果全部菜单权限,分配管理员角色;如果部分菜单权限,分配纠纷化解员角色
+
+
+        //初始化完成用户信息,返回给前端登录
+        return R.fail();
+    }
+
+    public R<List<GridUserVo>> getUserListByOrg(GridOrgUsersVo gridOrgUsersVo) {
+        String s = null;
+        HeadVo headVo = initHeadVo();
+        GridOrgUserRequestVo requestVo = new GridOrgUserRequestVo();
+        requestVo.setHeadVo(headVo);
+        List<String> roleIds = new ArrayList<>();
+        roleIds.add("43fc22e6-7276-11ef-a6d1-005056820c5f");
+        roleIds.add("442be8dd-7276-11ef-a6d1-005056820c5f");
+        roleIds.add("679b1846-71c5-11ef-a6d1-005056820c5f");
+        roleIds.add("67affc74-71c5-11ef-a6d1-005056820c5f");
+        gridOrgUsersVo.setRoleIds(roleIds);
+        requestVo.setBodyVo(gridOrgUsersVo);
+        try {
+//            log.info("xsdobject:{}",JSON.toJSONString(requestVo));
+            // 开发环境
+            if (SpringContextUtil.checkDev()) {
+                log.info("xsdurl:{}",testUrl + "/api/thrid/grid/user/get-org-users");
+                s = HttpClientUtils.httpPostRaw(testUrl + "/api/thrid/grid/user/get-org-users", JSON.toJSONString(requestVo), new HashMap<>(), "utf-8");
+            }else {
+                log.info("xsdurl:{}",gridUrl + "/sys/user/getUserListByOrg");
+                s = HttpClientUtils.httpPostRaw(gridUrl + "/sys/user/getUserListByOrg", JSON.toJSONString(requestVo), new HashMap<>(), "utf-8");
+            }
+            log.info("xsd:{}",s);
+        } catch (Exception e) {
+            log.info("xsderror:{}",e.getLocalizedMessage());
+            throw new RuntimeException(e);
+        }
+        JSONArray data = JSONObject.parseObject(s).getJSONArray("data");
+        List<GridUserVo> gridUserVos = data.toJavaList(GridUserVo.class);
+        return R.ok(gridUserVos);
+
+    }
 }

--
Gitblit v1.8.0