From d009afa03023ce9e2c450fc7c0652de46b270b60 Mon Sep 17 00:00:00 2001 From: wangliwen Date: Tue, 13 Dec 2022 09:15:44 +0800 Subject: [PATCH 01/11] =?UTF-8?q?sql=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/io/renren/modules/activiti/service/ActTaskService.java | 1 + .../db/{V8.3__tb_fuse_add_col.sql => V8.4__tb_fuse_add_col.sql} | 0 2 files changed, 1 insertion(+) rename renren-admin/src/main/resources/db/{V8.3__tb_fuse_add_col.sql => V8.4__tb_fuse_add_col.sql} (100%) diff --git a/renren-admin/src/main/java/io/renren/modules/activiti/service/ActTaskService.java b/renren-admin/src/main/java/io/renren/modules/activiti/service/ActTaskService.java index e2a759ff..c3dcdbd8 100644 --- a/renren-admin/src/main/java/io/renren/modules/activiti/service/ActTaskService.java +++ b/renren-admin/src/main/java/io/renren/modules/activiti/service/ActTaskService.java @@ -151,6 +151,7 @@ public class ActTaskService extends BaseServiceImpl { .stream() .map(index -> index.getMember()) .filter(Objects::nonNull) + .filter(index -> !index.isEmpty()) .flatMap(index -> index.stream()) .map(index -> (String) index.get("id")) .filter(index -> !userId.equals(index)) // 过滤非本人 diff --git a/renren-admin/src/main/resources/db/V8.3__tb_fuse_add_col.sql b/renren-admin/src/main/resources/db/V8.4__tb_fuse_add_col.sql similarity index 100% rename from renren-admin/src/main/resources/db/V8.3__tb_fuse_add_col.sql rename to renren-admin/src/main/resources/db/V8.4__tb_fuse_add_col.sql From 1565a9ca706e353a5a8b3fad85a8746b28d62075 Mon Sep 17 00:00:00 2001 From: wangliwen Date: Tue, 13 Dec 2022 09:54:38 +0800 Subject: [PATCH 02/11] =?UTF-8?q?=E8=83=BD=E5=8A=9B=E9=9C=80=E6=B1=82?= =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E9=99=84=E4=BB=B6=E5=90=8D=E7=A7=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/main/resources/db/V8.5__t_demand_data_add_col.sql | 1 + 1 file changed, 1 insertion(+) create mode 100644 renren-admin/src/main/resources/db/V8.5__t_demand_data_add_col.sql diff --git a/renren-admin/src/main/resources/db/V8.5__t_demand_data_add_col.sql b/renren-admin/src/main/resources/db/V8.5__t_demand_data_add_col.sql new file mode 100644 index 00000000..f63eaf31 --- /dev/null +++ b/renren-admin/src/main/resources/db/V8.5__t_demand_data_add_col.sql @@ -0,0 +1 @@ +ALTER TABLE `t_demand_data` ADD COLUMN `enclosure_name` longtext NULL COMMENT '附件名称' AFTER `apply_number`; \ No newline at end of file From 2994ebde69e9c8603ef3e5d0e66fcbbffa01e70a Mon Sep 17 00:00:00 2001 From: wangliwen Date: Tue, 13 Dec 2022 10:22:49 +0800 Subject: [PATCH 03/11] =?UTF-8?q?=E9=99=84=E4=BB=B6=E5=90=8D=E7=A7=B0?= =?UTF-8?q?=E5=AD=97=E6=AE=B5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/io/renren/modules/demanData/dto/TDemandDataDTO.java | 4 +++- .../renren/modules/demanData/entity/TDemandDataEntity.java | 5 +++++ .../src/main/resources/mapper/demanData/TDemandDataDao.xml | 1 + 3 files changed, 9 insertions(+), 1 deletion(-) diff --git a/renren-admin/src/main/java/io/renren/modules/demanData/dto/TDemandDataDTO.java b/renren-admin/src/main/java/io/renren/modules/demanData/dto/TDemandDataDTO.java index 5edace2a..145e238e 100644 --- a/renren-admin/src/main/java/io/renren/modules/demanData/dto/TDemandDataDTO.java +++ b/renren-admin/src/main/java/io/renren/modules/demanData/dto/TDemandDataDTO.java @@ -43,8 +43,10 @@ public class TDemandDataDTO extends AuditingBaseDTO implements Serializable { private String detailsField; private Long creator; private Date createDate; - @ApiModelProperty(value = "附件") + @ApiModelProperty(value = "附件名称") private String enclosure; + @ApiModelProperty(value = "附件") + private String enclosureName; @ApiModelProperty(value = "业务标志(0:初始化 1:审批中 2:审批拒绝 3:审批通过)") private Integer flag; @ApiModelProperty(value = "业务标志提示(0:初始化 1:审批中 2:审批拒绝 3:审批通过)") diff --git a/renren-admin/src/main/java/io/renren/modules/demanData/entity/TDemandDataEntity.java b/renren-admin/src/main/java/io/renren/modules/demanData/entity/TDemandDataEntity.java index ab874861..d16d57ab 100644 --- a/renren-admin/src/main/java/io/renren/modules/demanData/entity/TDemandDataEntity.java +++ b/renren-admin/src/main/java/io/renren/modules/demanData/entity/TDemandDataEntity.java @@ -57,6 +57,11 @@ public class TDemandDataEntity extends BaseEntity { * 附件 */ private String enclosure; + + /** + * 附件名称 + */ + private String enclosureName; /** * 业务标志(0:初始化 1:审批中 2:审批拒绝 3:审批通过) */ diff --git a/renren-admin/src/main/resources/mapper/demanData/TDemandDataDao.xml b/renren-admin/src/main/resources/mapper/demanData/TDemandDataDao.xml index 4ed9b99c..aa0e8894 100644 --- a/renren-admin/src/main/resources/mapper/demanData/TDemandDataDao.xml +++ b/renren-admin/src/main/resources/mapper/demanData/TDemandDataDao.xml @@ -23,6 +23,7 @@ + From fafd6f48cdfebddb8c7686380cf8ff304f8079ed Mon Sep 17 00:00:00 2001 From: wangliwen Date: Tue, 13 Dec 2022 11:00:19 +0800 Subject: [PATCH 04/11] ... --- .../mapper/activiti/ProcessActivityDao.xml | 22 +++++++++++++------ 1 file changed, 15 insertions(+), 7 deletions(-) diff --git a/renren-admin/src/main/resources/mapper/activiti/ProcessActivityDao.xml b/renren-admin/src/main/resources/mapper/activiti/ProcessActivityDao.xml index eb40161e..2995f245 100644 --- a/renren-admin/src/main/resources/mapper/activiti/ProcessActivityDao.xml +++ b/renren-admin/src/main/resources/mapper/activiti/ProcessActivityDao.xml @@ -29,12 +29,20 @@ From 7418814fbd85f89546521ab33c684f53b0252c13 Mon Sep 17 00:00:00 2001 From: wangliwen Date: Tue, 13 Dec 2022 11:33:00 +0800 Subject: [PATCH 05/11] =?UTF-8?q?=E5=B7=B2=E5=8A=9E=E3=80=81=E5=BE=85?= =?UTF-8?q?=E5=8A=9E=20=E6=8B=A5=E6=9C=89=E8=BF=90=E7=BB=B4=E7=AE=A1?= =?UTF-8?q?=E7=90=86=E5=91=98=E6=9D=83=E9=99=90=E7=94=A8=E6=88=B7=E6=89=8D?= =?UTF-8?q?=E8=BF=94=E5=9B=9E=E4=BC=9A=E5=AE=A2=E5=8E=85=E7=9B=B8=E5=85=B3?= =?UTF-8?q?=E6=95=B0=E6=8D=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../controller/ActTaskController.java | 68 +++++++++++-------- .../controller/HistoryController.java | 67 ++++++++++-------- 2 files changed, 78 insertions(+), 57 deletions(-) diff --git a/renren-admin/src/main/java/io/renren/modules/activiti/controller/ActTaskController.java b/renren-admin/src/main/java/io/renren/modules/activiti/controller/ActTaskController.java index 2161331f..b41f6968 100644 --- a/renren-admin/src/main/java/io/renren/modules/activiti/controller/ActTaskController.java +++ b/renren-admin/src/main/java/io/renren/modules/activiti/controller/ActTaskController.java @@ -16,6 +16,7 @@ import io.renren.modules.audit_team.service.SysAuditTeamService; import io.renren.modules.security.user.SecurityUser; import io.renren.modules.security.user.UserDetail; import io.renren.modules.sys.dto.SysUserDTO; +import io.renren.modules.sys.service.SysRoleUserService; import io.renren.modules.sys.service.SysUserService; import io.swagger.annotations.Api; import io.swagger.annotations.ApiImplicitParam; @@ -29,8 +30,8 @@ import org.activiti.engine.task.TaskQuery; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.dao.DataAccessException; import org.springframework.beans.factory.annotation.Value; +import org.springframework.dao.DataAccessException; import org.springframework.jdbc.core.JdbcTemplate; import org.springframework.util.StringUtils; import org.springframework.web.bind.annotation.*; @@ -73,6 +74,12 @@ public class ActTaskController { @Value("#{new Boolean(${auditteam.enable})}") private Boolean auditteam; // 是否进行审核组 + @Value("${big_date.assignee_meet_role_id}") + private String defaultAssigneeRoleId; // 会客厅审核人角色 + + @Autowired + private SysRoleUserService sysRoleUserService; + private JdbcTemplate lcJdbcTemplate = JdbcTemplateFactory.getJdbcTemplate(); /** @@ -132,34 +139,37 @@ public class ActTaskController { * 当未指定流程类型时 补充一下会客厅的待办 */ if (!(params.containsKey("processDefinitionKey") && org.apache.commons.lang3.StringUtils.isNotEmpty(params.get("processDefinitionKey").toString()))) { - int meetingroom_book = jdbcTemplate.queryForObject("SELECT COUNT(id) FROM t_meetingroom_book WHERE state = 1;", Integer.class); - page.setTotal(page.getTotal() + meetingroom_book); - Integer limit = 10; - if (params.get(Constant.LIMIT) != null) { - limit = Integer.parseInt((String) params.get(Constant.LIMIT)); - } - if (page.getList().size() < limit) { - List> meetingroom_bookTask = jdbcTemplate.queryForList("SELECT " + - " t_meetingroom_book.id AS `taskId`, " + - " t_meetingroom_book.dept AS `userDeptName`, " + - " '会客厅' AS `resourceType`, " + - " '青岛市大数据发展管理局' AS `provideDept`, " + - " t_meetingroom.`name` AS `userName`, " + - " '会客厅审核' AS `taskName `, " + - " t_meetingroom.create_date AS `createTime` " + - "FROM " + - " t_meetingroom_book " + - " LEFT JOIN t_meetingroom ON t_meetingroom_book.room_id = t_meetingroom.id " + - "WHERE " + - " state = 1;"); - List meetingroom_bookTaskDto = meetingroom_bookTask - .stream().map(index -> { - TaskDTO taskDTO = JSON.parseObject(JSON.toJSONString(index), TaskDTO.class); - return taskDTO; - }).collect(Collectors.toList()); - List temp = page.getList(); - temp.addAll(meetingroom_bookTaskDto); - page.setList(temp); + List useIds = sysRoleUserService.getUserIdListByRoleId(Long.parseLong(defaultAssigneeRoleId)); + if (useIds.stream().filter(index -> index == SecurityUser.getUserId()).findFirst().isPresent()) { // 拥有会客厅审核权限 + int meetingroom_book = jdbcTemplate.queryForObject("SELECT COUNT(id) FROM t_meetingroom_book WHERE state = 1;", Integer.class); + page.setTotal(page.getTotal() + meetingroom_book); + Integer limit = 10; + if (params.get(Constant.LIMIT) != null) { + limit = Integer.parseInt((String) params.get(Constant.LIMIT)); + } + if (page.getList().size() < limit) { + List> meetingroom_bookTask = jdbcTemplate.queryForList("SELECT " + + " t_meetingroom_book.id AS `taskId`, " + + " t_meetingroom_book.dept AS `userDeptName`, " + + " '会客厅' AS `resourceType`, " + + " '青岛市大数据发展管理局' AS `provideDept`, " + + " t_meetingroom.`name` AS `userName`, " + + " '会客厅审核' AS `taskName `, " + + " t_meetingroom.create_date AS `createTime` " + + "FROM " + + " t_meetingroom_book " + + " LEFT JOIN t_meetingroom ON t_meetingroom_book.room_id = t_meetingroom.id " + + "WHERE " + + " state = 1;"); + List meetingroom_bookTaskDto = meetingroom_bookTask + .stream().map(index -> { + TaskDTO taskDTO = JSON.parseObject(JSON.toJSONString(index), TaskDTO.class); + return taskDTO; + }).collect(Collectors.toList()); + List temp = page.getList(); + temp.addAll(meetingroom_bookTaskDto); + page.setList(temp); + } } } return new Result>().ok(page); diff --git a/renren-admin/src/main/java/io/renren/modules/activiti/controller/HistoryController.java b/renren-admin/src/main/java/io/renren/modules/activiti/controller/HistoryController.java index 2239f181..3ca1593d 100644 --- a/renren-admin/src/main/java/io/renren/modules/activiti/controller/HistoryController.java +++ b/renren-admin/src/main/java/io/renren/modules/activiti/controller/HistoryController.java @@ -19,10 +19,12 @@ import io.renren.modules.resource.dto.ResourceDTO; import io.renren.modules.resource.service.ResourceService; import io.renren.modules.resourceMountApply.dto.TResourceMountApplyDTO; import io.renren.modules.resourceMountApply.service.TResourceMountApplyService; +import io.renren.modules.security.user.SecurityUser; import io.renren.modules.sys.dao.SysUserDao; import io.renren.modules.sys.dto.SysDeptDTO; import io.renren.modules.sys.dto.SysUserDTO; import io.renren.modules.sys.service.SysDeptService; +import io.renren.modules.sys.service.SysRoleUserService; import io.renren.modules.sys.service.SysUserService; import io.swagger.annotations.Api; import io.swagger.annotations.ApiImplicitParam; @@ -37,6 +39,7 @@ import org.activiti.engine.history.HistoricProcessInstanceQuery; import org.activiti.engine.task.Task; import org.apache.commons.lang3.StringUtils; import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.beans.factory.annotation.Value; import org.springframework.jdbc.core.JdbcTemplate; import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.RequestMapping; @@ -89,10 +92,15 @@ public class HistoryController { private SysDeptService sysDeptService; @Autowired private JdbcTemplate jdbcTemplate; + @Autowired + private SysRoleUserService sysRoleUserService; @Autowired private SysUserDao sysUserDao; + @Value("${big_date.assignee_meet_role_id}") + private String defaultAssigneeRoleId; // 会客厅审核人角色 + @GetMapping("getInstImage") @ApiOperation(value = "获取流程活动图", produces = "application/octet-stream") @LogOperation("获取流程活动图") @@ -132,35 +140,38 @@ public class HistoryController { params.replace("processDefinitionKey", params.get("processDefinitionKey").toString() + "%"); } PageData page = activitiService.getMyProcessInstancePage(params); + List useIds = sysRoleUserService.getUserIdListByRoleId(Long.parseLong(defaultAssigneeRoleId)); if (!(params.containsKey("processDefinitionKey") && org.apache.commons.lang3.StringUtils.isNotEmpty(params.get("processDefinitionKey").toString()))) { - int meetingroom_book = jdbcTemplate.queryForObject("SELECT COUNT(id) FROM t_meetingroom_book WHERE state != 1;", Integer.class); - page.setTotal(page.getTotal() + meetingroom_book); - Integer limit = 10; - if (params.get(Constant.LIMIT) != null) { - limit = Integer.parseInt((String) params.get(Constant.LIMIT)); - } - if (page.getList().size() < limit) { - List> meetingroom_bookTask = jdbcTemplate.queryForList("SELECT " + - " t_meetingroom_book.id AS `businessKey`, " + - " t_meetingroom_book.dept AS `startUserDeptName`, " + - " '会客厅' AS `resourceName`, " + - " '青岛市大数据发展管理局' AS `provideDept`, " + - " t_meetingroom.`name` AS `userName`, " + - " '会客厅审核' AS `processDefinitionName `, " + - " t_meetingroom.create_date AS `startTime` " + - "FROM " + - " t_meetingroom_book " + - " LEFT JOIN t_meetingroom ON t_meetingroom_book.room_id = t_meetingroom.id " + - "WHERE " + - " state != 1 ;"); - List meetingroom_bookTaskDto = meetingroom_bookTask - .stream().map(index -> { - ProcessActivityDTO taskDTO = JSON.parseObject(JSON.toJSONString(index), ProcessActivityDTO.class); - return taskDTO; - }).collect(Collectors.toList()); - List temp = page.getList(); - temp.addAll(meetingroom_bookTaskDto); - page.setList(temp); + if (useIds.stream().filter(index -> index == SecurityUser.getUserId()).findFirst().isPresent()) { // 拥有会客厅审核权限 + int meetingroom_book = jdbcTemplate.queryForObject("SELECT COUNT(id) FROM t_meetingroom_book WHERE state != 1;", Integer.class); + page.setTotal(page.getTotal() + meetingroom_book); + Integer limit = 10; + if (params.get(Constant.LIMIT) != null) { + limit = Integer.parseInt((String) params.get(Constant.LIMIT)); + } + if (page.getList().size() < limit) { + List> meetingroom_bookTask = jdbcTemplate.queryForList("SELECT " + + " t_meetingroom_book.id AS `businessKey`, " + + " t_meetingroom_book.dept AS `startUserDeptName`, " + + " '会客厅' AS `resourceName`, " + + " '青岛市大数据发展管理局' AS `provideDept`, " + + " t_meetingroom.`name` AS `userName`, " + + " '会客厅审核' AS `processDefinitionName `, " + + " t_meetingroom.create_date AS `startTime` " + + "FROM " + + " t_meetingroom_book " + + " LEFT JOIN t_meetingroom ON t_meetingroom_book.room_id = t_meetingroom.id " + + "WHERE " + + " state != 1 ;"); + List meetingroom_bookTaskDto = meetingroom_bookTask + .stream().map(index -> { + ProcessActivityDTO taskDTO = JSON.parseObject(JSON.toJSONString(index), ProcessActivityDTO.class); + return taskDTO; + }).collect(Collectors.toList()); + List temp = page.getList(); + temp.addAll(meetingroom_bookTaskDto); + page.setList(temp); + } } } setExtraProcessProperties(Optional.ofNullable(page.getList()).orElse(new ArrayList<>())); From 4c935c611528ad481f0dee99e304c210452223da Mon Sep 17 00:00:00 2001 From: wangliwen Date: Tue, 13 Dec 2022 13:33:51 +0800 Subject: [PATCH 06/11] ... --- .../modules/demanData/controller/TDemandDataController.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/renren-admin/src/main/java/io/renren/modules/demanData/controller/TDemandDataController.java b/renren-admin/src/main/java/io/renren/modules/demanData/controller/TDemandDataController.java index 4b292c3b..2d35b183 100644 --- a/renren-admin/src/main/java/io/renren/modules/demanData/controller/TDemandDataController.java +++ b/renren-admin/src/main/java/io/renren/modules/demanData/controller/TDemandDataController.java @@ -95,7 +95,7 @@ public class TDemandDataController { tDemandDataService.save(dto); - return new Result(); + return new Result().ok("保存成功"); } @PutMapping @@ -108,7 +108,7 @@ public class TDemandDataController { tDemandDataService.update(dto); - return new Result(); + return new Result().ok("修改成功"); } @DeleteMapping From d9df6029102c5cc33e292e86a0c75af6790a5fd8 Mon Sep 17 00:00:00 2001 From: wangliwen Date: Tue, 13 Dec 2022 16:45:12 +0800 Subject: [PATCH 07/11] =?UTF-8?q?=E5=AE=A1=E6=A0=B8=E7=BB=84=E5=A4=96?= =?UTF-8?q?=E5=9B=B4=E6=94=AF=E6=8C=81=E6=8E=A5=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../common/controller/RejectController.java | 10 +- .../controller/SysAuditTeamController.java | 3 +- .../audit_team/dto/SysAuditTeamDTO.java | 2 + .../audit_team/entity/SysAuditTeamEntity.java | 5 + .../service/impl/SysAuditTeamServiceImpl.java | 12 +- .../sys/controller/SysUserController.java | 59 +++++- .../io/renren/modules/sys/dao/SysUserDao.java | 5 +- .../modules/sys/service/SysUserService.java | 10 + .../sys/service/impl/SysUserServiceImpl.java | 16 ++ .../resources/db/V8.6__audio_team_add_col.sql | 1 + .../mapper/audit_team/SysAuditTeamDao.xml | 2 + .../main/resources/mapper/sys/SysUserDao.xml | 187 +++++++++++------- 12 files changed, 228 insertions(+), 84 deletions(-) create mode 100644 renren-admin/src/main/resources/db/V8.6__audio_team_add_col.sql diff --git a/renren-admin/src/main/java/io/renren/common/controller/RejectController.java b/renren-admin/src/main/java/io/renren/common/controller/RejectController.java index 46892259..0400d724 100644 --- a/renren-admin/src/main/java/io/renren/common/controller/RejectController.java +++ b/renren-admin/src/main/java/io/renren/common/controller/RejectController.java @@ -33,7 +33,11 @@ public class RejectController { @Autowired private SysUserService sysUserService; - + /** + * @param taskId 驳回到第一节点的当前task + * @param params 尝试更新表单 + * @return + */ @PostMapping("relaunch/{taskId}") @ApiOperation("携带更新后的表单重新发起流程") @LogOperation("携带更新后的表单重新发起流程") @@ -54,7 +58,7 @@ public class RejectController { taskService.removeVariable(task.getId(), "parameterContent"); taskService.removeVariable(task.getId(), "resourceDTO"); taskService.setVariables(task.getId(), combineResultMap); // 更新 - logger.error("-----------{}", JSON.toJSONString(combineResultMap)); + logger.info("携带更新后的表单重新发起流程:{}", JSON.toJSONString(combineResultMap)); taskService.setVariable(task.getId(), "backToFirst", Boolean.FALSE); // 标识驳回标签false taskService.setVariable(task.getId(), "completeEntry", Boolean.FALSE); // 标志为非首次录入 taskService.setVariable(task.getId(), "reject", Boolean.FALSE); // 标识流程中是否存在拒绝false @@ -64,7 +68,7 @@ public class RejectController { String name = userDTOOptional.isPresent() ? userDTOOptional.get().getRealName() : ""; actTaskService.completeTask(task.getId(), name + "重新发起审核"); result.set(new Result().ok(name + "重新发起审核成功")); - logger.error("{}重新发起审核成功", name); + logger.info("{} 重新发起审核成功", name); }); return result.get(); } diff --git a/renren-admin/src/main/java/io/renren/modules/audit_team/controller/SysAuditTeamController.java b/renren-admin/src/main/java/io/renren/modules/audit_team/controller/SysAuditTeamController.java index 7d78e58d..40de33dd 100644 --- a/renren-admin/src/main/java/io/renren/modules/audit_team/controller/SysAuditTeamController.java +++ b/renren-admin/src/main/java/io/renren/modules/audit_team/controller/SysAuditTeamController.java @@ -52,7 +52,8 @@ public class SysAuditTeamController { @ApiImplicitParam(name = Constant.PAGE, value = "当前页码,从1开始", paramType = "query", required = true, dataType = "int"), @ApiImplicitParam(name = Constant.LIMIT, value = "每页显示记录数", paramType = "query", required = true, dataType = "int"), @ApiImplicitParam(name = Constant.ORDER_FIELD, value = "排序字段", paramType = "query", dataType = "String"), - @ApiImplicitParam(name = Constant.ORDER, value = "排序方式,可选值(asc、desc)", paramType = "query", dataType = "String") + @ApiImplicitParam(name = Constant.ORDER, value = "排序方式,可选值(asc、desc)", paramType = "query", dataType = "String"), + @ApiImplicitParam(name = "name", value = "根据审核组名称模糊查", paramType = "query", dataType = "String") }) // @RequiresPermissions("audit_team:sysauditteam:page") public Result> page(@ApiIgnore @RequestParam Map params) { diff --git a/renren-admin/src/main/java/io/renren/modules/audit_team/dto/SysAuditTeamDTO.java b/renren-admin/src/main/java/io/renren/modules/audit_team/dto/SysAuditTeamDTO.java index 3e438067..a11130b5 100644 --- a/renren-admin/src/main/java/io/renren/modules/audit_team/dto/SysAuditTeamDTO.java +++ b/renren-admin/src/main/java/io/renren/modules/audit_team/dto/SysAuditTeamDTO.java @@ -32,5 +32,7 @@ public class SysAuditTeamDTO implements Serializable { private List member; @ApiModelProperty(value = "审核组索引") private String index; + @ApiModelProperty(value = "审核组备注内容") + private String description; } \ No newline at end of file diff --git a/renren-admin/src/main/java/io/renren/modules/audit_team/entity/SysAuditTeamEntity.java b/renren-admin/src/main/java/io/renren/modules/audit_team/entity/SysAuditTeamEntity.java index 20c0fb04..8c3bae1c 100644 --- a/renren-admin/src/main/java/io/renren/modules/audit_team/entity/SysAuditTeamEntity.java +++ b/renren-admin/src/main/java/io/renren/modules/audit_team/entity/SysAuditTeamEntity.java @@ -39,4 +39,9 @@ public class SysAuditTeamEntity extends BaseEntity implements Serializable { */ @TableField(value = "`index`") private String index; + + /** + * 审核组备注内容 + */ + private String description; } \ No newline at end of file diff --git a/renren-admin/src/main/java/io/renren/modules/audit_team/service/impl/SysAuditTeamServiceImpl.java b/renren-admin/src/main/java/io/renren/modules/audit_team/service/impl/SysAuditTeamServiceImpl.java index 86e9ce48..3f1bd4ba 100644 --- a/renren-admin/src/main/java/io/renren/modules/audit_team/service/impl/SysAuditTeamServiceImpl.java +++ b/renren-admin/src/main/java/io/renren/modules/audit_team/service/impl/SysAuditTeamServiceImpl.java @@ -1,6 +1,7 @@ package io.renren.modules.audit_team.service.impl; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.core.toolkit.StringUtils; import io.renren.common.service.impl.CrudServiceImpl; import io.renren.modules.audit_team.dao.SysAuditTeamDao; import io.renren.modules.audit_team.dto.SysAuditTeamDTO; @@ -23,8 +24,15 @@ public class SysAuditTeamServiceImpl extends CrudServiceImpl getWrapper(Map params) { QueryWrapper wrapper = new QueryWrapper<>(); - - + params.keySet().stream().filter(index -> null != params.get(index)).forEach(index -> { + switch (index) { + case "name": + wrapper.like(StringUtils.isNotBlank(params.get("name").toString()), "name", params.get("name").toString()); + break; + default: + break; + } + }); return wrapper; } diff --git a/renren-admin/src/main/java/io/renren/modules/sys/controller/SysUserController.java b/renren-admin/src/main/java/io/renren/modules/sys/controller/SysUserController.java index 2bd19259..a82beef5 100644 --- a/renren-admin/src/main/java/io/renren/modules/sys/controller/SysUserController.java +++ b/renren-admin/src/main/java/io/renren/modules/sys/controller/SysUserController.java @@ -16,12 +16,10 @@ import io.renren.modules.security.user.SecurityUser; import io.renren.modules.security.user.UserDetail; import io.renren.modules.sys.dto.PasswordDTO; import io.renren.modules.sys.dto.SysDeptDTO; +import io.renren.modules.sys.dto.SysRoleDTO; import io.renren.modules.sys.dto.SysUserDTO; import io.renren.modules.sys.excel.SysUserExcel; -import io.renren.modules.sys.service.SysDeptService; -import io.renren.modules.sys.service.SysRoleUserService; -import io.renren.modules.sys.service.SysUserPostService; -import io.renren.modules.sys.service.SysUserService; +import io.renren.modules.sys.service.*; import io.swagger.annotations.Api; import io.swagger.annotations.ApiImplicitParam; import io.swagger.annotations.ApiImplicitParams; @@ -29,10 +27,12 @@ import io.swagger.annotations.ApiOperation; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.beans.factory.annotation.Value; import org.springframework.web.bind.annotation.*; import springfox.documentation.annotations.ApiIgnore; import javax.servlet.http.HttpServletResponse; +import java.util.ArrayList; import java.util.Arrays; import java.util.List; import java.util.Map; @@ -54,6 +54,20 @@ public class SysUserController { private SysRoleUserService sysRoleUserService; @Autowired private SysDeptService sysDeptService; + @Autowired + private SysRoleService sysRoleService; + + @Value("${big_date.assignee_role_name}") + private String roleName0; // 具备审批的角色名称(普通) + + @Value("${big_date.assignee_district_role_name}") + private String roleName1; // 具备审批的角色名称(区县) + @Value("${big_date.assignee_city_role_name}") + private String roleName2; // 具备审批的角色名称(市区) + + @Value("${big_date.assignee_meet_role_id}") + private String defaultAssigneeRoleId; // 会客厅审核人角色 + @GetMapping("page") @ApiOperation("分页") @@ -223,4 +237,41 @@ public class SysUserController { public Result getApproverUnconfiguredRegion(@ApiIgnore @RequestParam Map params) { return new Result().ok(sysUserService.getApproverUnconfiguredRegion(params)); } + + + @GetMapping("auditingUserPage") + @ApiOperation("审核权限用户分页") + @ApiImplicitParams({ + @ApiImplicitParam(name = Constant.PAGE, value = "当前页码,从1开始", paramType = "query", required = true, dataType = "int"), + @ApiImplicitParam(name = Constant.LIMIT, value = "每页显示记录数", paramType = "query", required = true, dataType = "int") + }) +// @RequiresPermissions("sys:user:page") + public Result> auditingUserPage(@ApiIgnore @RequestParam Map params) { + //分页参数 + long curPage = 1; + long limit = 10; + + if (params.get(Constant.PAGE) != null) { + curPage = Long.parseLong((String) params.get(Constant.PAGE)); + } + if (params.get(Constant.LIMIT) != null) { + limit = Long.parseLong((String) params.get(Constant.LIMIT)); + } + SysRoleDTO roleDTO0 = sysRoleService.getByName(roleName0); + SysRoleDTO roleDTO1 = sysRoleService.getByName(roleName1); + SysRoleDTO roleDTO2 = sysRoleService.getByName(roleName2); + List roleId = new ArrayList() {{ + if (roleDTO0 != null) { + add(roleDTO0.getId()); + } + if (roleDTO1 != null) { + add(roleDTO1.getId()); + } + if (roleDTO2 != null) { + add(roleDTO2.getId()); + } + add(Long.parseLong(defaultAssigneeRoleId)); + }}; + return new Result>().ok(new PageData<>(sysUserService.getUserByRoleList(roleId, (int) curPage, (int) limit), sysUserService.getUserByRoleListCount(roleId))); + } } \ No newline at end of file diff --git a/renren-admin/src/main/java/io/renren/modules/sys/dao/SysUserDao.java b/renren-admin/src/main/java/io/renren/modules/sys/dao/SysUserDao.java index 50fe7e48..c3eca517 100644 --- a/renren-admin/src/main/java/io/renren/modules/sys/dao/SysUserDao.java +++ b/renren-admin/src/main/java/io/renren/modules/sys/dao/SysUserDao.java @@ -5,7 +5,6 @@ import io.renren.modules.sys.entity.SysUserEntity; import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Param; -import java.util.Collection; import java.util.List; import java.util.Map; @@ -57,4 +56,8 @@ public interface SysUserDao extends BaseDao { Integer getApproverUnconfiguredDepartmentCount(); Integer getApproverUnconfiguredRegionCount(); + + List getUserByRoleList(@Param("roleIds") List roleIds, @Param("pageNum") int pageNum, @Param("pageSize") int pageSize); + + Long getUserByRoleListCount(@Param("roleIds") List roleIds); } \ No newline at end of file diff --git a/renren-admin/src/main/java/io/renren/modules/sys/service/SysUserService.java b/renren-admin/src/main/java/io/renren/modules/sys/service/SysUserService.java index e155b9fb..d8bb0092 100644 --- a/renren-admin/src/main/java/io/renren/modules/sys/service/SysUserService.java +++ b/renren-admin/src/main/java/io/renren/modules/sys/service/SysUserService.java @@ -65,4 +65,14 @@ public interface SysUserService extends BaseService { Object getApproverUnconfiguredDepartment(Map params); Object getApproverUnconfiguredRegion(Map params); + + /** + * 获取拥有 + * + * @param roleIds + * @return + */ + List getUserByRoleList(List roleIds, int pageNum, int pageSize); + + Long getUserByRoleListCount(List roleIds); } diff --git a/renren-admin/src/main/java/io/renren/modules/sys/service/impl/SysUserServiceImpl.java b/renren-admin/src/main/java/io/renren/modules/sys/service/impl/SysUserServiceImpl.java index ee946119..930fbf69 100644 --- a/renren-admin/src/main/java/io/renren/modules/sys/service/impl/SysUserServiceImpl.java +++ b/renren-admin/src/main/java/io/renren/modules/sys/service/impl/SysUserServiceImpl.java @@ -555,4 +555,20 @@ public class SysUserServiceImpl extends BaseServiceImpl getUserByRoleList(List roleIds, int pageNum, int pageSize) { + return baseDao.getUserByRoleList(roleIds, (pageNum - 1) * pageSize, pageSize); + } + + @Override + public Long getUserByRoleListCount(List roleIds) { + return baseDao.getUserByRoleListCount(roleIds); + } } diff --git a/renren-admin/src/main/resources/db/V8.6__audio_team_add_col.sql b/renren-admin/src/main/resources/db/V8.6__audio_team_add_col.sql new file mode 100644 index 00000000..4d31362a --- /dev/null +++ b/renren-admin/src/main/resources/db/V8.6__audio_team_add_col.sql @@ -0,0 +1 @@ +alter table `sys_audit_team` ADD COLUMN `description` longtext NULL comment '审核组备注信息'; \ No newline at end of file diff --git a/renren-admin/src/main/resources/mapper/audit_team/SysAuditTeamDao.xml b/renren-admin/src/main/resources/mapper/audit_team/SysAuditTeamDao.xml index c830806f..467956a1 100644 --- a/renren-admin/src/main/resources/mapper/audit_team/SysAuditTeamDao.xml +++ b/renren-admin/src/main/resources/mapper/audit_team/SysAuditTeamDao.xml @@ -11,6 +11,7 @@ + @@ -21,6 +22,7 @@ + SELECT - id, - name, - (CASE type - WHEN 1 THEN - '省' - WHEN 2 THEN - '市' - WHEN 3 THEN - '区' - ELSE - ' ' - END) AS "type", - sort + id, + name, + (CASE type + WHEN 1 THEN + '省' + WHEN 2 THEN + '市' + WHEN 3 THEN + '区' + ELSE + ' ' + END) AS "type", + sort FROM - sys_dept sd + sys_dept sd WHERE - id NOT IN ( - SELECT - sd.id - FROM - sys_user su, - sys_dept sd, - sys_role sr, - sys_role_user sru - WHERE - su.dept_id = sd.id - AND su.id = sru.user_id - AND sru.role_id = sr.id - AND sru.del_flag = 0 - AND sr.`name` = '部门审批人' + id NOT IN ( + SELECT + sd.id + FROM + sys_user su, + sys_dept sd, + sys_role sr, + sys_role_user sru + WHERE + su.dept_id = sd.id + AND su.id = sru.user_id + AND sru.role_id = sr.id + AND sru.del_flag = 0 + AND sr.`name` = '部门审批人' ) - AND sd.type != 4 + AND sd.type != 4 ORDER BY sd.type, sort - LIMIT ${pageNum}, ${pageSize} + LIMIT ${pageNum}, ${pageSize} SELECT COUNT(1) FROM ( - SELECT - id - FROM - sys_dept sd - WHERE - id NOT IN ( - SELECT - sd.id - FROM - sys_user su, - sys_dept sd, - sys_role sr, - sys_role_user sru - WHERE - su.dept_id = sd.id - AND su.id = sru.user_id - AND sru.role_id = sr.id - AND sru.del_flag = 0 - AND sr.`name` = '部门审批人' - ) - AND sd.type != 4 - ) temp + SELECT + id + FROM + sys_dept sd + WHERE + id NOT IN ( + SELECT + sd.id + FROM + sys_user su, + sys_dept sd, + sys_role sr, + sys_role_user sru + WHERE + su.dept_id = sd.id + AND su.id = sru.user_id + AND sru.role_id = sr.id + AND sru.del_flag = 0 + AND sr.`name` = '部门审批人' + ) + AND sd.type != 4 + ) temp + + + + From 35d08fe63fab52f6e45e6c0979d486f0ea9143a0 Mon Sep 17 00:00:00 2001 From: wangliwen Date: Tue, 13 Dec 2022 17:11:40 +0800 Subject: [PATCH 08/11] =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E5=B7=B2=E5=9C=A8?= =?UTF-8?q?=E5=AE=A1=E6=A0=B8=E7=BB=84=E5=86=85=E7=9A=84=E5=AE=A1=E6=A0=B8?= =?UTF-8?q?=E7=BB=84=E5=90=8D=E7=A7=B0=E4=B8=8E=E5=8E=BB=E9=87=8D=E5=AE=A1?= =?UTF-8?q?=E6=A0=B8=E6=9D=83=E9=99=90=E4=BA=BA=E5=91=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../modules/sys/controller/SysUserController.java | 14 +++++++++++++- .../src/main/resources/mapper/sys/SysUserDao.xml | 3 ++- 2 files changed, 15 insertions(+), 2 deletions(-) diff --git a/renren-admin/src/main/java/io/renren/modules/sys/controller/SysUserController.java b/renren-admin/src/main/java/io/renren/modules/sys/controller/SysUserController.java index a82beef5..fc580934 100644 --- a/renren-admin/src/main/java/io/renren/modules/sys/controller/SysUserController.java +++ b/renren-admin/src/main/java/io/renren/modules/sys/controller/SysUserController.java @@ -11,6 +11,8 @@ import io.renren.common.validator.ValidatorUtils; import io.renren.common.validator.group.AddGroup; import io.renren.common.validator.group.DefaultGroup; import io.renren.common.validator.group.UpdateGroup; +import io.renren.modules.audit_team.dto.SysAuditTeamDTO; +import io.renren.modules.audit_team.service.SysAuditTeamService; import io.renren.modules.security.password.PasswordUtils; import io.renren.modules.security.user.SecurityUser; import io.renren.modules.security.user.UserDetail; @@ -36,6 +38,7 @@ import java.util.ArrayList; import java.util.Arrays; import java.util.List; import java.util.Map; +import java.util.stream.Collectors; /** * 用户管理 @@ -56,6 +59,8 @@ public class SysUserController { private SysDeptService sysDeptService; @Autowired private SysRoleService sysRoleService; + @Autowired + private SysAuditTeamService sysAuditTeamService; @Value("${big_date.assignee_role_name}") private String roleName0; // 具备审批的角色名称(普通) @@ -272,6 +277,13 @@ public class SysUserController { } add(Long.parseLong(defaultAssigneeRoleId)); }}; - return new Result>().ok(new PageData<>(sysUserService.getUserByRoleList(roleId, (int) curPage, (int) limit), sysUserService.getUserByRoleListCount(roleId))); + List temp = sysUserService.getUserByRoleList(roleId, (int) curPage, (int) limit); + temp = temp.stream().map(index -> { + List sysAuditTeamDTOList = sysAuditTeamService.selectByMemberOne(index.get("id").toString()); + index.put("inAuditTeam", !sysAuditTeamDTOList.isEmpty()); + index.put("auditTeamName", sysAuditTeamDTOList.stream().findFirst().isPresent() ? sysAuditTeamDTOList.stream().findFirst().get().getName() : ""); + return index; + }).collect(Collectors.toList()); + return new Result>().ok(new PageData<>(temp, sysUserService.getUserByRoleListCount(roleId))); } } \ No newline at end of file diff --git a/renren-admin/src/main/resources/mapper/sys/SysUserDao.xml b/renren-admin/src/main/resources/mapper/sys/SysUserDao.xml index 333dde6e..23ba470e 100644 --- a/renren-admin/src/main/resources/mapper/sys/SysUserDao.xml +++ b/renren-admin/src/main/resources/mapper/sys/SysUserDao.xml @@ -200,6 +200,7 @@