浏览代码

fix: 回显别名

shc 9 月之前
父节点
当前提交
880e8b99b4

+ 15 - 1
hnqz-upms/hnqz-upms-biz/src/main/java/com/qunzhixinxi/hnqz/admin/service/impl/WmDaAgentServiceImpl.java

@@ -599,7 +599,7 @@ public class WmDaAgentServiceImpl extends ServiceImpl<WmDaAgentMapper, WmDaAgent
         }
 
         // 如果是二级cso 则允许更新区域
-        if (sysDept.getLevel() == 4 && CollUtil.isNotEmpty(wmDaAgent.getAreaCodes())){
+        if (sysDept.getLevel() == 4 && CollUtil.isNotEmpty(wmDaAgent.getAreaCodes())) {
             enterpriseAreaService.updateRelation(Long.valueOf(sysDept.getDeptId()), wmDaAgent.getAreaCodes());
         }
 
@@ -674,6 +674,20 @@ public class WmDaAgentServiceImpl extends ServiceImpl<WmDaAgentMapper, WmDaAgent
                 wmDeptList.add(wmDept);
             }
             return wmDeptList;
+        } else if (SecurityUtils.getRoles().contains(50)) {
+
+            List<SysDept> sysDepts = sysDeptMapper.selectList(Wrappers.<SysDept>lambdaQuery()
+                    .gt(SysDept::getLevel, 1)
+                    .eq(SysDept::getDelFlag, CommonConstants.STATUS_NORMAL));
+
+            for (SysDept dept : sysDepts) {
+                WmDept wmDept = new WmDept();
+                wmDept.setDeptId(Integer.parseInt(String.valueOf(dept.getDeptId())));
+                wmDept.setName(dept.getName());
+                wmDeptList.add(wmDept);
+            }
+            return wmDeptList;
+
         } else {
 
             final List<SysDeptRelation> sysDeptRelationList = new ArrayList<>();

+ 1 - 0
hnqz-upms/hnqz-upms-biz/src/main/resources/mapper/WmDaAgentMapper.xml

@@ -199,6 +199,7 @@
     select
     a.*,
     d.level as dept_level,
+    d.abbr,
     d.dept_permissions
     from wm_da_agent a
     left join sys_dept d on a.dept_id = d.dept_id