From d96077532f73ba1ea716cc967fc3ac8aa4cf7cd8 Mon Sep 17 00:00:00 2001 From: mythxb Date: Wed, 23 Aug 2023 17:09:27 +0800 Subject: [PATCH] =?UTF-8?q?=E5=B1=A5=E8=81=8C=E6=B8=85=E5=8D=95=20?= =?UTF-8?q?=E5=92=8C=20=E7=94=A8=E6=88=B7=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../mapper/user/ListPerformMapper.xml | 2 +- .../resources/mapper/user/SysUnitMapper.xml | 16 +++++- .../resources/mapper/user/SysUserMapper.xml | 13 ++--- .../com/rzyc/controller/BaseController.java | 32 ++++++++++-- .../com/rzyc/controller/DataController.java | 31 ++++++++++++ .../rzyc/controller/PcPersonalController.java | 49 ++++++++++++------- .../src/main/resources/application.yml | 2 +- 7 files changed, 113 insertions(+), 32 deletions(-) diff --git a/inventory-dao/src/main/resources/mapper/user/ListPerformMapper.xml b/inventory-dao/src/main/resources/mapper/user/ListPerformMapper.xml index 27003e0..62cc642 100644 --- a/inventory-dao/src/main/resources/mapper/user/ListPerformMapper.xml +++ b/inventory-dao/src/main/resources/mapper/user/ListPerformMapper.xml @@ -655,7 +655,7 @@ and FIND_IN_SET(#{superPerformId},lp.parent_path) - ORDER BY lp.SysLevel ASC, lp.`SortId` ASC + ORDER BY lp.SysLevel ASC, lp.`SortId` ASC,lp.ListPerformId ASC diff --git a/inventory-dao/src/main/resources/mapper/user/SysUnitMapper.xml b/inventory-dao/src/main/resources/mapper/user/SysUnitMapper.xml index e248ec1..96914e6 100644 --- a/inventory-dao/src/main/resources/mapper/user/SysUnitMapper.xml +++ b/inventory-dao/src/main/resources/mapper/user/SysUnitMapper.xml @@ -528,7 +528,21 @@ + + + - SELECT ut.`UnitName`,sp.`PerformClassName` superName,lf.`PerformClassName` performclassname,su.* + SELECT sp.`PerformClassName` superName,lf.`PerformClassName` performclassname,su.* FROM SysUser su - LEFT JOIN SysUnit ut ON su.`SysUnitOrEntId` = ut.`SysUnitId` LEFT JOIN ListPerform lf ON su.`SysTitle` = lf.`ListPerformId` LEFT JOIN ListPerform sp ON sp.`ListPerformId` = lf.`SupClassId` WHERE su.`UserType` = '政府用户' and FIND_IN_SET(#{areaCode},su.area_path) + + and FIND_IN_SET(#{unitId},su.post_path) + and su.State = #{State} - - AND (su.`ChinaName` LIKE #{condition} OR su.`SysUserName` LIKE #{condition}) - - AND su.SysUnitOrEntId = #{unitId} - AND sp.`ListPerformId` = #{performId} - ORDER BY su.State ASC,su.ModifiedOn DESC + ORDER BY su.State ASC,su.ModifiedOn DESC,su.SysUserId ASC /*ORDER BY lf.`SortId` ASC,lf.`PerformClassCode` ASC*/ diff --git a/inventory-gov/src/main/java/com/rzyc/controller/BaseController.java b/inventory-gov/src/main/java/com/rzyc/controller/BaseController.java index ef362ea..8e8a4a8 100644 --- a/inventory-gov/src/main/java/com/rzyc/controller/BaseController.java +++ b/inventory-gov/src/main/java/com/rzyc/controller/BaseController.java @@ -2359,11 +2359,17 @@ public class BaseController { protected void handleUser(List sysUsers)throws Exception{ for (SysUser sysUser : sysUsers){ if(StringUtils.isNotBlank(sysUser.getPerformclassname()) && StringUtils.isNotBlank(sysUser.getSuperName())){ - String postName = sysUser.getPerformClassName(); +// String postName = sysUser.getPerformClassName(); +// String deptName = sysUser.getSuperName(); +// postName = postName.replace(deptName,""); +// postName = deptName + postName; +// sysUser.setPerformclassname(postName); + +// String postName = sysUser.getPerformClassName(); String deptName = sysUser.getSuperName(); - postName = postName.replace(deptName,""); - postName = deptName + postName; - sysUser.setPerformclassname(postName); +// postName = postName.replace(deptName,""); +// postName = deptName + postName; + sysUser.setUnitName(deptName); } } } @@ -2406,6 +2412,21 @@ public class BaseController { return userId; } + /** + * 获取用户部门id + * @version v1.0 + * @author dong + * @date 2023/8/23 14:23 + */ + protected String getUnitId(String userId)throws Exception{ + String unitId = ""; + ListPerform listPerform = listPerformMapper.findBuUserId(userId); + if(null != listPerform){ + unitId = listPerform.getSupclassid(); + } + return unitId; + } + /** * 修改任务状态 * @param oaTask @@ -3728,6 +3749,9 @@ public class BaseController { if(StringUtils.isNotBlank(sysAuth.getUnitRoleId())){ authState = 1; } + + //都选择 + authState = 1; sysAuth.setAuthState(authState+""); } } diff --git a/inventory-gov/src/main/java/com/rzyc/controller/DataController.java b/inventory-gov/src/main/java/com/rzyc/controller/DataController.java index b09a18d..0bcdb21 100644 --- a/inventory-gov/src/main/java/com/rzyc/controller/DataController.java +++ b/inventory-gov/src/main/java/com/rzyc/controller/DataController.java @@ -9,6 +9,8 @@ import com.common.utils.encryption.PasswdFactory; import com.common.utils.model.SingleResult; import com.rzyc.enums.DelState; import com.rzyc.enums.ListTargerType; +import com.rzyc.enums.PositionTypeEnum; +import com.rzyc.enums.PostListType; import com.rzyc.model.*; import com.rzyc.model.check.ChkBillDetailWithBLOBs; import com.rzyc.model.ent.SysEnterprise; @@ -1187,4 +1189,33 @@ public class DataController extends com.rzyc.controller.BaseController { return result; } + /** + * 处理岗位类型 + * @version v1.0 + * @author dong + * @date 2023/8/23 14:39 + */ + @ApiOperation(value = "处理岗位类型", notes = "处理履职记录") + @RequestMapping(value = "/handlePerform", method = RequestMethod.GET) + @ResponseBody + public SingleResult handlePerform()throws Exception{ + SingleResult result = new SingleResult<>(); + + List performs = listPerformMapper.findAll(""); + for (ListPerform listPerform : performs){ + + Integer postType = PositionTypeEnum.POST.getType(); + + Integer postNum = listPerformMapper.countPost(listPerform.getListperformid()); + if(postNum > 0){ + postType = PositionTypeEnum.UNIT.getType(); + } + listPerformMapper.changePositionType(listPerform.getListperformid(),postType); + + } + + + return result; + } + } diff --git a/inventory-gov/src/main/java/com/rzyc/controller/PcPersonalController.java b/inventory-gov/src/main/java/com/rzyc/controller/PcPersonalController.java index d3c15d6..bcbde43 100644 --- a/inventory-gov/src/main/java/com/rzyc/controller/PcPersonalController.java +++ b/inventory-gov/src/main/java/com/rzyc/controller/PcPersonalController.java @@ -763,37 +763,25 @@ public class PcPersonalController extends com.rzyc.controller.BaseController { String condition = TypeConversion.getCondition(userPageDto.getCondition()); String userId = getUserId(); - //判断查看用户类别 - String unitType = UnitType.AREA.getType()+""; - SysUser sysUser = sysUserMapper.findById(userId); - if(null != sysUser){ - SysUnit sysUnit = sysUnitMapper.selectByPrimaryKey(sysUser.getSysunitorentid()); - if(null != sysUnit){ - unitType = sysUnit.getUnittype(); - } - } + userPageDto.setPerformId(userPageDto.getUnitId()); //部门id - String unitId = sysUser.getSysunitorentid(); + String unitId = getUnitId(userId); String areaCode = getUserArea(userId); - - //分页 PageHelper.startPage(userPageDto.getPage(), userPageDto.getPageSize()); - Page page = null; - - //属地类型 - String unitEnumType = UnitType.AREA.getType()+""; + Page page = (Page)sysUserMapper.govUserList(condition,unitId,userPageDto.getPerformId(),areaCode,userPageDto.getState()); + /* //判断是属地还是部门 if(unitEnumType.equals(unitType)){ page = (Page)sysUserMapper.govUserList(condition,userPageDto.getUnitId(),userPageDto.getPerformId(),areaCode,userPageDto.getState()); }else{ page = (Page)sysUserMapper.unitUserList(condition,unitId,userPageDto.getState()); } - +*/ Pager pager = new Pager<>(); getDatePage(pager,page); @@ -814,6 +802,33 @@ public class PcPersonalController extends com.rzyc.controller.BaseController { public MultiResult unitTree()throws Exception{ MultiResult result = new MultiResult<>(); + String userId = getUserId(); + String parentUnitId = getUnitId(userId); + + List units = sysUnitMapper.findUnit(parentUnitId); + if(units.size() > 0){ + JSONArray unitJson = handleUnitTree(units); + List sysUnits = JSONArray.parseArray(JSONArray.toJSONString(unitJson),SysUnit.class); + result.setData(sysUnits); + }else{ + result.setCode(Code.NO_DATA.getCode()); + result.setMessage(Message.NO_DATA); + } + return result; + } + + + /** + * 部门树形结构 + * @return + * @throws Exception + */ + @ApiOperation(value = "部门树形结构", notes = "部门树形结构") + @PostMapping(value = "unitTreeV1") + @ResponseBody + public MultiResult unitTreeV1()throws Exception{ + MultiResult result = new MultiResult<>(); + String userId = getUserId(); String parentUnitId = getSuperUnitId(userId); diff --git a/inventory-gov/src/main/resources/application.yml b/inventory-gov/src/main/resources/application.yml index 48f6f2c..cb53efc 100644 --- a/inventory-gov/src/main/resources/application.yml +++ b/inventory-gov/src/main/resources/application.yml @@ -1,6 +1,6 @@ spring: profiles: - active: test #设定打包配置文件 + active: yun #设定打包配置文件