From 582431a5042a1e98f327a4f4c142c4eb5c0f445e Mon Sep 17 00:00:00 2001 From: zhc077 <565291854@qq.com> Date: Sun, 10 Nov 2024 17:35:12 +0800 Subject: [PATCH 1/2] =?UTF-8?q?=E9=97=AE=E9=A2=98=E4=BF=AE=E6=94=B9=2011.1?= =?UTF-8?q?0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../controller/SysDepartController.java | 9 ++++--- .../system/controller/SysUserController.java | 25 ++++++++----------- .../views/declarantUnit/declarantUnitList.vue | 4 +-- .../views/declarantUnit/depart.user.data.ts | 4 +-- .../project/ProjectList.vue | 6 ++--- 5 files changed, 23 insertions(+), 25 deletions(-) diff --git a/jeecg-boot/jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/system/controller/SysDepartController.java b/jeecg-boot/jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/system/controller/SysDepartController.java index 803fd42..94d75ba 100644 --- a/jeecg-boot/jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/system/controller/SysDepartController.java +++ b/jeecg-boot/jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/system/controller/SysDepartController.java @@ -151,7 +151,7 @@ public class SysDepartController { /** * @description: 根据当前登录角色查询 下级部门数据 * @param: [parentId, ids, primaryKey] - * @return: org.jeecg.common.api.vo.Result> + * @return: org.jeecg.common.api.vo.Result> * @author: z.h.c * @date: 24/11/9 16:07 */ @@ -174,7 +174,7 @@ public class SysDepartController { /** * @description: 法人注册时,只显示市和县区科技局,不显示下属单位 * @param: [parentId, ids, primaryKey] - * @return: org.jeecg.common.api.vo.Result> + * @return: org.jeecg.common.api.vo.Result> * @author: z.h.c * @date: 24/11/9 16:07 */ @@ -244,8 +244,11 @@ public class SysDepartController { //单位法人角色时,只查询自己部门 if ("faren_admin".equals(user.getRoleCode())) { queryWrapper.eq("id", user.getOrgId()); - } else { // 查询下级部门 + } else if ("quxian_admin".equals(user.getRoleCode())) { queryWrapper.eq("parent_id", user.getOrgId()); + } else if ("kejiju_admin".equals(user.getRoleCode())) {// 查询所有法人级部门 + queryWrapper.ne("depart_name_abbr","null"); + queryWrapper.ne("depart_name_abbr",""); } return sysDepartService.queryPageList(req, queryWrapper, pageSize, pageNo); diff --git a/jeecg-boot/jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/system/controller/SysUserController.java b/jeecg-boot/jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/system/controller/SysUserController.java index 1ac5577..1c2c097 100644 --- a/jeecg-boot/jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/system/controller/SysUserController.java +++ b/jeecg-boot/jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/system/controller/SysUserController.java @@ -8,7 +8,6 @@ import com.alibaba.fastjson.JSONArray; import com.alibaba.fastjson.JSONObject; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; -import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper; import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.core.toolkit.IdWorker; import com.baomidou.mybatisplus.extension.plugins.pagination.Page; @@ -166,14 +165,14 @@ public class SysUserController { /** * @description: 根据用户角色查询下属用户 * @param: [user, pageNo, pageSize, req] - * @return: org.jeecg.common.api.vo.Result> + * @return: org.jeecg.common.api.vo.Result> * @author: z.h.c * @date: 24/11/8 15:19 */ // @RequiresPermissions("system:user:listAll") @RequestMapping(value = "/listByRollCode", method = RequestMethod.GET) public Result> listByRollCode(SysUser user, @RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo, - @RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize, HttpServletRequest req) { + @RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize, HttpServletRequest req) { QueryWrapper queryWrapper = QueryGenerator.initQueryWrapper(user, req.getParameterMap()); LoginUser loginUser = (LoginUser) SecurityUtils.getSubject().getPrincipal(); @@ -192,21 +191,17 @@ public class SysUserController { */ @RequestMapping(value = "/getDeclarantList", method = RequestMethod.GET) public Result> getDeclarantList(SysUser user, @RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo, - @RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize, HttpServletRequest req) { + @RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize, HttpServletRequest req) { LoginUser loginUser = (LoginUser) SecurityUtils.getSubject().getPrincipal(); + user.setUserType("shenbaoren"); String roleCode = loginUser.getRoleCode(); - List userIds = new LinkedList<>(); +// List userIds = new LinkedList<>(); //申报人是只查询自己 - if (StringUtils.equals(roleCode, "shenbaoren_role")) { - userIds.add(loginUser.getId()); - } else if (StringUtils.equals(roleCode, "faren_admin")) { - List departList = sysUserDepartService.list(new LambdaQueryWrapper().eq(SysUserDepart::getDepId, loginUser.getOrgId())); - userIds = Optional.ofNullable(departList).orElse(new LinkedList<>()).stream().map(u -> u.getUserId()).collect(Collectors.toList()); - } - user.setUserType("shenbaoren"); QueryWrapper queryWrapper = QueryGenerator.initQueryWrapper(user, req.getParameterMap()); - if (ObjectUtil.isNotEmpty(userIds)) { - queryWrapper.in("id", userIds); + if (StringUtils.equals(roleCode, "shenbaoren_role")) { + queryWrapper.eq("org_code", loginUser.getOrgCode()); + } else { + queryWrapper.likeRight("org_code", loginUser.getOrgCode()); } return sysUserService.queryPageList(req, queryWrapper, pageSize, pageNo); } @@ -1967,7 +1962,7 @@ public class SysUserController { SysDepart depart = sysDepartService.getById(departmentid); //所先部门状态为0时,说明该部门注册后未通过审核,申报人此时不能选择该部门注册 - if(StringUtils.equals(depart.getStatus(),"0")){ + if (StringUtils.equals(depart.getStatus(), "0")) { throw new JeecgBootException("该单位未通过审核,暂时不能注册为该单位申报人"); } diff --git a/jeecgboot-vue3/src/views/declarantUnit/declarantUnitList.vue b/jeecgboot-vue3/src/views/declarantUnit/declarantUnitList.vue index e1098b0..15a5a14 100644 --- a/jeecgboot-vue3/src/views/declarantUnit/declarantUnitList.vue +++ b/jeecgboot-vue3/src/views/declarantUnit/declarantUnitList.vue @@ -182,7 +182,7 @@ function getTableAction(record) { // }, { label: '驳回', - ifShow: userStore.getUserInfo.roleCode !='faren_admin' && record.status == 1, + ifShow: userStore.getUserInfo.roleCode =='quxian_admin' && record.status == 1, popConfirm: { title: '确定驳回吗?', confirm: handleFrozen.bind(null, record, 0), @@ -190,7 +190,7 @@ function getTableAction(record) { }, { label: '通过', - ifShow: userStore.getUserInfo.roleCode !='faren_admin' && record.status == 0, + ifShow: userStore.getUserInfo.roleCode =='quxian_admin' && record.status == 0, popConfirm: { title: '确定通过吗?', confirm: handleFrozen.bind(null, record, 1), diff --git a/jeecgboot-vue3/src/views/declarantUnit/depart.user.data.ts b/jeecgboot-vue3/src/views/declarantUnit/depart.user.data.ts index 2bb4dde..843810a 100644 --- a/jeecgboot-vue3/src/views/declarantUnit/depart.user.data.ts +++ b/jeecgboot-vue3/src/views/declarantUnit/depart.user.data.ts @@ -15,11 +15,11 @@ export const columns: BasicColumn[] = [ align:"center", dataIndex: 'departNameAbbr', }, - { + /* { title: '编码', align:"center", dataIndex: 'orgCode' - }, + },*/ { title: '手机号', align:"center", diff --git a/jeecgboot-vue3/src/views/projectApplication/project/ProjectList.vue b/jeecgboot-vue3/src/views/projectApplication/project/ProjectList.vue index 5d978bb..675a4f3 100644 --- a/jeecgboot-vue3/src/views/projectApplication/project/ProjectList.vue +++ b/jeecgboot-vue3/src/views/projectApplication/project/ProjectList.vue @@ -5,7 +5,7 @@ - 新建审报 + 新建申报 @@ -91,7 +91,7 @@ const { prefixCls,tableContext,onExportXls,onImportXls } = useListPage({ ], }, actionColumn: { - width: 320, + width: 380, fixed:'right' }, beforeFetch: (params) => { From 34a50a01c00101e798632be9cb96d3d47f718709 Mon Sep 17 00:00:00 2001 From: zhc077 <565291854@qq.com> Date: Sun, 10 Nov 2024 17:53:08 +0800 Subject: [PATCH 2/2] =?UTF-8?q?=E9=97=AE=E9=A2=98=E4=BF=AE=E6=94=B9=2011.1?= =?UTF-8?q?0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../system/depart/components/DepartLeftTree.vue | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) diff --git a/jeecgboot-vue3/src/views/system/depart/components/DepartLeftTree.vue b/jeecgboot-vue3/src/views/system/depart/components/DepartLeftTree.vue index fccda7e..aa21af5 100644 --- a/jeecgboot-vue3/src/views/system/depart/components/DepartLeftTree.vue +++ b/jeecgboot-vue3/src/views/system/depart/components/DepartLeftTree.vue @@ -92,11 +92,10 @@ import { useModal } from '/@/components/Modal'; import { useMessage } from '/@/hooks/web/useMessage'; import { useMethods } from '/@/hooks/system/useMethods'; - import { Api, deleteBatchDepart, queryDepartTreeSync4ZhuGuanBuMen } from '../depart.api'; + import { Api, deleteBatchDepart, queryDepartTreeSync } from '../depart.api'; import { searchByKeywords } from '/@/views/system/departUser/depart.user.api'; import DepartFormModal from '/@/views/system/depart/components/DepartFormModal.vue'; import { Popconfirm } from 'ant-design-vue'; - import {useUserStore} from "@/store/modules/user"; const prefixCls = inject('prefixCls'); const emit = defineEmits(['select', 'rootTreeData']); @@ -125,16 +124,13 @@ // 注册 modal const [registerModal, { openModal }] = useModal(); - const userStore = useUserStore(); // 加载顶级部门信息 async function loadRootTreeData() { try { loading.value = true; treeData.value = []; - const result = await queryDepartTreeSync4ZhuGuanBuMen({ - parentOrgCode: userStore.getUserInfo.orgCode, - }); + const result = await queryDepartTreeSync(); if (Array.isArray(result)) { treeData.value = result; } @@ -162,9 +158,8 @@ // 加载子级部门信息 async function loadChildrenTreeData(treeNode) { try { - const result = await queryDepartTreeSync4ZhuGuanBuMen({ - // pid: treeNode.dataRef.id, - parentOrgCode: treeNode.dataRef.orgCode, + const result = await queryDepartTreeSync({ + pid: treeNode.dataRef.id, }); if (result.length == 0) { treeNode.dataRef.isLeaf = true;