Sfoglia il codice sorgente

Merge remote-tracking branch 'origin/master'

wuhb 7 mesi fa
parent
commit
656650314e

+ 2 - 0
ygtx-admin/src/main/java/com/ygtx/web/controller/system/SysDeptController.java

@@ -37,6 +37,7 @@ public class SysDeptController extends BaseController
     /**
      * 获取部门列表
      */
+    @PreAuthorize("@ss.hasPermi('system:dept:list')")
     @GetMapping("/list")
     public AjaxResult list(SysDept dept)
     {
@@ -47,6 +48,7 @@ public class SysDeptController extends BaseController
     /**
      * 查询部门列表(排除节点)
      */
+    @PreAuthorize("@ss.hasPermi('system:dept:list')")
     @GetMapping("/list/exclude/{deptId}")
     public AjaxResult excludeChild(@PathVariable(value = "deptId", required = false) Long deptId)
     {

+ 8 - 0
ygtx-admin/src/main/java/com/ygtx/web/controller/system/SysUserController.java

@@ -58,6 +58,7 @@ public class SysUserController extends BaseController
     /**
      * 获取用户列表
      */
+    @PreAuthorize("@ss.hasPermi('system:user:list')")
     @GetMapping("/list")
     public TableDataInfo list(SysUser user)
     {
@@ -282,4 +283,11 @@ public class SysUserController extends BaseController
     {
         return toAjax(userService.insertUserDeptPosts(userId, userDeptPosts));
     }
+
+    @GetMapping("/listNoPermi")
+    public AjaxResult listNoPermi(SysUser user)
+    {
+        List<SysUser> list = userService.selectUserListNoPermi(user);
+        return AjaxResult.success(list);
+    }
 }

+ 6 - 2
ygtx-gxt/src/main/java/com/ygtx/gxt/service/impl/GxtRepairOrderServiceImpl.java

@@ -105,8 +105,10 @@ public class GxtRepairOrderServiceImpl implements IGxtRepairOrderService
         // 根据pcsStationId获取部门id,设值给pcsStationPid
         if (gxtRepairOrder.getPcsStationId() != null) {
             SysDept dept = getDeptInfoAndParent(gxtRepairOrder.getPcsStationId());
-            if (dept != null) {
+            if (dept != null && "3".equals(dept.getLevel())) {
                 gxtRepairOrder.setPcsStationPid(dept.getDeptId());
+            }else{
+                gxtRepairOrder.setPcsStationPid(gxtRepairOrder.getPcsStationId());
             }
         }
         
@@ -159,8 +161,10 @@ public class GxtRepairOrderServiceImpl implements IGxtRepairOrderService
         // 根据pcsStationId获取部门id,设值给pcsStationPid
         if (gxtRepairOrder.getPcsStationId() != null) {
             SysDept dept = getDeptInfoAndParent(gxtRepairOrder.getPcsStationId());
-            if (dept != null) {
+            if (dept != null && "3".equals(dept.getLevel())) {
                 gxtRepairOrder.setPcsStationPid(dept.getDeptId());
+            }else{
+                gxtRepairOrder.setPcsStationPid(gxtRepairOrder.getPcsStationId());
             }
         }
         

+ 2 - 0
ygtx-system/src/main/java/com/ygtx/system/service/ISysUserService.java

@@ -241,4 +241,6 @@ public interface ISysUserService
      * @return 结果
      */
     public int insertUserDeptPosts(Long userId, List<UserDeptPost> userDeptPosts);
+
+    public List<SysUser> selectUserListNoPermi(SysUser user);
 }

+ 39 - 0
ygtx-system/src/main/java/com/ygtx/system/service/impl/SysUserServiceImpl.java

@@ -888,4 +888,43 @@ public class SysUserServiceImpl implements ISysUserService
         // 即使没有插入新记录,也返回1表示操作成功(删除旧记录成功)
         return 1;
     }
+
+    @Override
+    public List<SysUser> selectUserListNoPermi(SysUser user) {
+        List<SysUser> userList = userMapper.selectUserList(user);
+        // 为导出功能加载角色和岗位信息
+        if (userList != null && !userList.isEmpty()) {
+            for (SysUser sysUser : userList) {
+                // 加载角色信息
+                List<SysRole> roles = roleMapper.selectRolePermissionByUserId(sysUser.getUserId());
+                sysUser.setRoles(roles);
+                // 设置角色名称用于导出
+                if (roles != null && !roles.isEmpty()) {
+                    StringBuilder roleNames = new StringBuilder();
+                    for (int i = 0; i < roles.size(); i++) {
+                        if (i > 0) {
+                            roleNames.append(",");
+                        }
+                        roleNames.append(roles.get(i).getRoleName());
+                    }
+                    sysUser.setRoleNames(roleNames.toString());
+                }
+
+                // 加载岗位信息(从主岗位表获取)
+                List<SysPost> posts = postService.selectPostsByUserId(sysUser.getUserId());
+                // 设置岗位名称用于导出
+                if (posts != null && !posts.isEmpty()) {
+                    StringBuilder postNames = new StringBuilder();
+                    for (int i = 0; i < posts.size(); i++) {
+                        if (i > 0) {
+                            postNames.append(",");
+                        }
+                        postNames.append(posts.get(i).getPostName());
+                    }
+                    sysUser.setPostNames(postNames.toString());
+                }
+            }
+        }
+        return userList;
+    }
 }

+ 9 - 0
ygtx-ui/src/api/system/user.js

@@ -151,3 +151,12 @@ export function saveUserDeptPosts(userId, data) {
     data: data
   })
 }
+
+// 查询用户,没有分页,不带权限
+export function listUserNoPermi(query) {
+  return request({
+    url: '/system/user/listNoPermi',
+    method: 'get',
+    params: query
+  })
+}

+ 11 - 7
ygtx-ui/src/views/gxt/repairOrder/index.vue

@@ -1355,8 +1355,8 @@ import {
 } from "@/api/gxt/repairOrder";
 import { listDept,getDept } from "@/api/system/dept";
 import { listFaultCodes } from "@/api/gxt/faultCodes"
-import { listGxtOrder } from "@/api/gxt/gxtOrder";
-import { listUser } from "@/api/system/user";
+/*import { listGxtOrder } from "@/api/gxt/gxtOrder";*/
+import { listUser,listUserNoPermi } from "@/api/system/user";
 import EquipmentSelectSingle from "@/components/equipmentSelect/single.vue"
 import { ElMessage, ElMessageBox, ElNotification, ElLoading } from 'element-plus'
 import { listMaintenanceCenters, listStationsByMaintenanceCenter } from "@/api/gxt/equipment"
@@ -2027,7 +2027,7 @@ function handleRelatedOrderChange() {
 }
 
 /** 搜索维保工单 */
-function searchWorkOrders(query) {
+/*function searchWorkOrders(query) {
   if (!query) {
     workOrderOptions.value = []
     return
@@ -2041,7 +2041,7 @@ function searchWorkOrders(query) {
     workOrderSearchLoading.value = false
     workOrderOptions.value = []
   })
-}
+}*/
 
 /** 选择维保工单 */
 function handleWorkOrderChange(val) {
@@ -2086,11 +2086,15 @@ function handleAccept(row) {
     acceptForm.value.pcsStationPid = response.data.pcsStationPid
     // 根据场站ID查询该场站的用户列表
     if (acceptForm.value.pcsStationPid) {
-      listUser({ pageNum: 1, pageSize: 100, deptId: acceptForm.value.pcsStationPid }).then(response => {
+      /*listUser({ pageNum: 1, pageSize: 100, deptId: acceptForm.value.pcsStationPid }).then(response => {
         userList.value = response.rows
         acceptDialogVisible.value = true
+      })*/
+      listUserNoPermi({ deptId: acceptForm.value.pcsStationPid }).then(response => {
+        userList.value = response.data
+        acceptDialogVisible.value = true
       })
-    }else if (acceptForm.value.pcsStationId) {
+    }/*else if (acceptForm.value.pcsStationId) {
       // 先获取部门信息,判断level是否为4,如果是则查找其父部门直到level为3
       getDeptAndUserByLevel(acceptForm.value.pcsStationId).then(deptId => {
         // 确保 deptId 是有效的再调用 listUser
@@ -2105,7 +2109,7 @@ function handleAccept(row) {
           acceptDialogVisible.value = true
         }
       })
-    } else {
+    }*/ else {
       proxy.$modal.msgWarning("未找到有效的部门信息,无法加载用户列表");
       acceptDialogVisible.value = true
     }