From 63c979057f0bee66acd7774e1be787976fa0c524 Mon Sep 17 00:00:00 2001 From: wangliwen Date: Thu, 8 Dec 2022 09:19:59 +0800 Subject: [PATCH 01/13] fix 474 --- .../resource/controller/ResourceController.java | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/renren-admin/src/main/java/io/renren/modules/resource/controller/ResourceController.java b/renren-admin/src/main/java/io/renren/modules/resource/controller/ResourceController.java index 1697749f..c704907f 100644 --- a/renren-admin/src/main/java/io/renren/modules/resource/controller/ResourceController.java +++ b/renren-admin/src/main/java/io/renren/modules/resource/controller/ResourceController.java @@ -524,7 +524,7 @@ public class ResourceController { SysUserEntity sysUser = sysUserDao.getById(userId); if (sysUser == null || sysUser.getGuid() == null) { - return new Result<>().error("该账号没有权限"); + return new Result<>().error("该账号没有权限获取资源列表"); } String url = "http://15.72.158.81/zyjk/ZywMessage.asmx?op=ZySPPort"; @@ -553,8 +553,13 @@ public class ResourceController { return new Result().ok(result); } catch (Exception e) { - e.printStackTrace(); - return new Result().ok(new ArrayList(0)); + logger.error("资源列表转发异常", e); + Map result = new LinkedHashMap() {{ + put("PageCount", "0"); + put("data", new ArrayList<>()); + put("rows", "0"); + }}; + return new Result().ok(result); } } From 6c636ce3119d116ce513302d63373769e610cb9c Mon Sep 17 00:00:00 2001 From: wangliwen Date: Thu, 8 Dec 2022 16:04:56 +0800 Subject: [PATCH 02/13] =?UTF-8?q?=E5=82=AC=E5=8A=9E=E9=85=8D=E7=BD=AE?= =?UTF-8?q?=E5=A4=B1=E6=95=88=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../io/renren/modules/activiti/service/ActHistoryService.java | 4 +++- .../processForm/controller/TAbilityApplicationController.java | 2 +- .../modules/reminders/controller/TRemindersController.java | 2 +- .../modules/reminders/service/impl/TRemindersServiceImpl.java | 2 +- 4 files changed, 6 insertions(+), 4 deletions(-) diff --git a/renren-admin/src/main/java/io/renren/modules/activiti/service/ActHistoryService.java b/renren-admin/src/main/java/io/renren/modules/activiti/service/ActHistoryService.java index cce261f9..c6b90442 100644 --- a/renren-admin/src/main/java/io/renren/modules/activiti/service/ActHistoryService.java +++ b/renren-admin/src/main/java/io/renren/modules/activiti/service/ActHistoryService.java @@ -99,7 +99,7 @@ public class ActHistoryService { @Autowired private TRemindersService tRemindersService; - @Value("${reminders.interval:7}") // 流程发起后多少天允许催办 + @Value("${reminders.interval}") // 流程发起后多少天允许催办 private Integer interval; @@ -397,6 +397,7 @@ public class ActHistoryService { Optional nowTask = taskService.createTaskQuery().processInstanceId(index.getProcessInstanceId()) .orderByTaskCreateTime().desc().active().list().stream().findFirst(); // 尝试获取当前task if (nowTask.isPresent()) { // 存在正在进行的任务 + logger.info("当前任务id:" + nowTask.get().getId()); LocalDate localDate = tRemindersService.selectRemindersTime(nowTask.get().getId()); if (localDate == null) { // 未进行过催办 LocalDate taskCreateDate = nowTask.get().getCreateTime().toInstant().atZone(ZoneId.systemDefault()).toLocalDate(); @@ -424,6 +425,7 @@ public class ActHistoryService { } } } else { + logger.info("不存在正在进行流程节点"); index.setAllowReminders(Boolean.FALSE); index.setDoneReminders(Boolean.FALSE); index.setNextRemindersDays(0); diff --git a/renren-admin/src/main/java/io/renren/modules/processForm/controller/TAbilityApplicationController.java b/renren-admin/src/main/java/io/renren/modules/processForm/controller/TAbilityApplicationController.java index 0da56cf4..8e9e14b0 100644 --- a/renren-admin/src/main/java/io/renren/modules/processForm/controller/TAbilityApplicationController.java +++ b/renren-admin/src/main/java/io/renren/modules/processForm/controller/TAbilityApplicationController.java @@ -103,7 +103,7 @@ public class TAbilityApplicationController { @Value("${infrastructure.dept-can-apply-max}") private Integer infrastructureMax; - @Value("${reminders.interval:7}") // 流程发起后多少天允许催办 + @Value("${reminders.interval}") // 流程发起后多少天允许催办 private Integer interval; @Autowired diff --git a/renren-admin/src/main/java/io/renren/modules/reminders/controller/TRemindersController.java b/renren-admin/src/main/java/io/renren/modules/reminders/controller/TRemindersController.java index 29a6621f..59fa9ddb 100644 --- a/renren-admin/src/main/java/io/renren/modules/reminders/controller/TRemindersController.java +++ b/renren-admin/src/main/java/io/renren/modules/reminders/controller/TRemindersController.java @@ -57,7 +57,7 @@ public class TRemindersController { @Autowired protected TaskService taskService; - @Value("${reminders.interval:7}") // 流程发起后多少天允许催办 + @Value("${reminders.interval}") // 流程发起后多少天允许催办 private Integer interval; @GetMapping("page") diff --git a/renren-admin/src/main/java/io/renren/modules/reminders/service/impl/TRemindersServiceImpl.java b/renren-admin/src/main/java/io/renren/modules/reminders/service/impl/TRemindersServiceImpl.java index ce73e477..ac29ab3d 100644 --- a/renren-admin/src/main/java/io/renren/modules/reminders/service/impl/TRemindersServiceImpl.java +++ b/renren-admin/src/main/java/io/renren/modules/reminders/service/impl/TRemindersServiceImpl.java @@ -46,7 +46,7 @@ public class TRemindersServiceImpl extends CrudServiceImpl Date: Thu, 8 Dec 2022 16:11:01 +0800 Subject: [PATCH 03/13] =?UTF-8?q?=E5=87=8F=E5=B0=91=E4=B8=80=E4=BA=9B?= =?UTF-8?q?=E6=97=A5=E5=BF=97=E8=BE=93=E5=87=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../main/java/io/renren/modules/security/user/SecurityUser.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/renren-admin/src/main/java/io/renren/modules/security/user/SecurityUser.java b/renren-admin/src/main/java/io/renren/modules/security/user/SecurityUser.java index bb83b8c0..74afe875 100644 --- a/renren-admin/src/main/java/io/renren/modules/security/user/SecurityUser.java +++ b/renren-admin/src/main/java/io/renren/modules/security/user/SecurityUser.java @@ -25,7 +25,7 @@ public class SecurityUser { */ public static UserDetail getUser() { - logger.error("————————————————————————————当前调用的方法为{}", getMyGrandpaStackTrace()); +// logger.error("————————————————————————————当前调用的方法为{}", getMyGrandpaStackTrace()); Subject subject = getSubject(); if (subject == null) { From d56d2aa99b090ea93650c2d5f47ada34e663693c Mon Sep 17 00:00:00 2001 From: wangliwen Date: Fri, 9 Dec 2022 09:35:56 +0800 Subject: [PATCH 04/13] fix 557 --- .../listener/InitiatorDataEntryListener.java | 22 ++++++++++++++++++- 1 file changed, 21 insertions(+), 1 deletion(-) diff --git a/renren-admin/src/main/java/io/renren/common/listener/InitiatorDataEntryListener.java b/renren-admin/src/main/java/io/renren/common/listener/InitiatorDataEntryListener.java index 4c5d6dd8..4c9d1dd0 100644 --- a/renren-admin/src/main/java/io/renren/common/listener/InitiatorDataEntryListener.java +++ b/renren-admin/src/main/java/io/renren/common/listener/InitiatorDataEntryListener.java @@ -75,15 +75,35 @@ public class InitiatorDataEntryListener implements TaskListener { } else if (kv.containsKey("userId")) { creator = kv.get("userId").toString(); } + Integer type = 10; + String flowType = kv.getOrDefault("flowType", "").toString(); + switch (flowType) { + case "能力申请": + type = 0; + break; + case "能力需求申请": + type = 6; + break; + case "评论审核": + type = 8; + break; + case "资源上架": + type = 2; + break; + case "资源下架": + type = 4; + break; + } try { String result = "被驳回"; String finalCreator = creator; String finalResult = result; + Integer finalType = type; CompletableFuture.runAsync(() -> { // 发起人 SysUserDTO userDTO = sysUserService.get(Long.valueOf(finalCreator)); String content = "【通知】" + userDTO.getRealName() + ",您发起的流程 " + kv.getOrDefault("flowType", "") + finalResult; SysNoticeDTO dto = new SysNoticeDTO(); - dto.setType(2); + dto.setType(finalType); dto.setTitle("流程节点系统通知"); dto.setContent(content); // 通知内容 dto.setReceiverType(1); From e490ff7a252f3ca3bd797de7e2f18c3a97a56474 Mon Sep 17 00:00:00 2001 From: wangliwen Date: Fri, 9 Dec 2022 10:19:24 +0800 Subject: [PATCH 05/13] npe --- .../renren/modules/activiti/controller/HistoryController.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) 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 b806fcb7..e046e710 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 @@ -210,7 +210,9 @@ public class HistoryController { TResourceMountApplyDTO tResourceMountApplyDTO = null; TDemandDataDTO tDemandDataDTO = null; ResourceDTO resourceDTO = null; - if (!activityDTO.getBusinessKey().startsWith("[") && !activityDTO.getBusinessKey().startsWith("{")) { // json 内容(批量申请) + if (StringUtils.isNotEmpty(activityDTO.getBusinessKey()) + && !activityDTO.getBusinessKey().startsWith("[") + && !activityDTO.getBusinessKey().startsWith("{")) { // json 内容(批量申请) tResourceMountApplyDTO = tResourceMountApplyService.get(Long.valueOf(activityDTO.getBusinessKey())); tDemandDataDTO = tDemandDataService.get(Long.valueOf(activityDTO.getBusinessKey())); resourceDTO = resourceService.get(Long.valueOf(activityDTO.getBusinessKey())); From e229eacfdb109b33570b19be84932e1a9b5b5883 Mon Sep 17 00:00:00 2001 From: wangliwen Date: Fri, 9 Dec 2022 10:44:13 +0800 Subject: [PATCH 06/13] =?UTF-8?q?=E5=B7=A5=E4=BD=9C=E5=8F=B0=20=E5=B7=B2?= =?UTF-8?q?=E5=8A=9E=E4=BB=BB=E5=8A=A1=E5=8A=A0=E5=85=A5=E4=BC=9A=E5=AE=A2?= =?UTF-8?q?=E5=8E=85=E5=B7=B2=E5=8A=9E=E6=95=B0=E9=87=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../controller/HistoryController.java | 35 +++++++++++++++++++ 1 file changed, 35 insertions(+) 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 e046e710..ab3cfa93 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 @@ -1,5 +1,6 @@ package io.renren.modules.activiti.controller; +import com.alibaba.fastjson.JSON; import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import io.renren.common.annotation.LogOperation; import io.renren.common.constant.Constant; @@ -36,6 +37,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.jdbc.core.JdbcTemplate; import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestParam; @@ -85,6 +87,8 @@ public class HistoryController { protected RuntimeService runtimeService; @Autowired private SysDeptService sysDeptService; + @Autowired + private JdbcTemplate jdbcTemplate; @Autowired private SysUserDao sysUserDao; @@ -128,6 +132,37 @@ public class HistoryController { params.replace("processDefinitionKey", params.get("processDefinitionKey").toString() + "%"); } PageData page = activitiService.getMyProcessInstancePage(params); + 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); + } + } setExtraProcessProperties(Optional.ofNullable(page.getList()).orElse(new ArrayList<>())); return new Result().ok(page); } From 511772b051374273d591204fe243ddf86a95e1e3 Mon Sep 17 00:00:00 2001 From: wangliwen Date: Fri, 9 Dec 2022 11:31:55 +0800 Subject: [PATCH 07/13] ... --- .../renren/modules/activiti/controller/HistoryController.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 ab3cfa93..bd7cbd93 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 @@ -152,7 +152,7 @@ public class HistoryController { " t_meetingroom_book " + " LEFT JOIN t_meetingroom ON t_meetingroom_book.room_id = t_meetingroom.id " + "WHERE " + - " state = 1;"); + " state != 1 ;"); List meetingroom_bookTaskDto = meetingroom_bookTask .stream().map(index -> { ProcessActivityDTO taskDTO = JSON.parseObject(JSON.toJSONString(index), ProcessActivityDTO.class); From 4425851bed876e8d5515c728ce55597b1cf6fe12 Mon Sep 17 00:00:00 2001 From: wangliwen Date: Fri, 9 Dec 2022 11:42:30 +0800 Subject: [PATCH 08/13] ... --- .../renren/modules/activiti/controller/HistoryController.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 bd7cbd93..2239f181 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 @@ -133,7 +133,7 @@ public class HistoryController { } PageData page = activitiService.getMyProcessInstancePage(params); 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); + 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) { From 80cbecc6e0e3ef55f5d4c775661c8017f23e02a8 Mon Sep 17 00:00:00 2001 From: wangliwen Date: Fri, 9 Dec 2022 14:27:40 +0800 Subject: [PATCH 09/13] =?UTF-8?q?=E5=85=AC=E5=91=8A=E4=BF=AE=E6=94=B9?= =?UTF-8?q?=E6=8E=A5=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../SysNoticeManagementController.java | 37 +++++++++---------- 1 file changed, 18 insertions(+), 19 deletions(-) diff --git a/renren-admin/src/main/java/io/renren/modules/sysnoticemanagement/controller/SysNoticeManagementController.java b/renren-admin/src/main/java/io/renren/modules/sysnoticemanagement/controller/SysNoticeManagementController.java index cc8690b2..d71ca655 100644 --- a/renren-admin/src/main/java/io/renren/modules/sysnoticemanagement/controller/SysNoticeManagementController.java +++ b/renren-admin/src/main/java/io/renren/modules/sysnoticemanagement/controller/SysNoticeManagementController.java @@ -17,7 +17,6 @@ import io.swagger.annotations.Api; import io.swagger.annotations.ApiImplicitParam; import io.swagger.annotations.ApiImplicitParams; import io.swagger.annotations.ApiOperation; -import org.apache.shiro.authz.annotation.RequiresPermissions; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.*; import springfox.documentation.annotations.ApiIgnore; @@ -29,14 +28,14 @@ import java.util.Map; /** -* 公告管理 -* -* @author dg 2498628697@qq.com -* @since 1.0 2022-12-01 -*/ + * 公告管理 + * + * @author dg 2498628697@qq.com + * @since 1.0 2022-12-01 + */ @RestController @RequestMapping("/sysnoticemanagement") -@Api(tags="公告管理") +@Api(tags = "公告管理") public class SysNoticeManagementController { @Autowired private SysNoticeManagementService sysNoticeManagementService; @@ -44,15 +43,15 @@ public class SysNoticeManagementController { @GetMapping("page") @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") , - @ApiImplicitParam(name = "days", value = "公告显示周期", paramType = "query", dataType="int") , - @ApiImplicitParam(name = "content", value = "公告内容", paramType = "query", 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.PAGE, value = "当前页码,从1开始", paramType = "query", required = true, dataType = "int"), + @ApiImplicitParam(name = Constant.LIMIT, value = "每页显示记录数", paramType = "query", required = true, dataType = "int"), + @ApiImplicitParam(name = "days", value = "公告显示周期", paramType = "query", dataType = "int"), + @ApiImplicitParam(name = "content", value = "公告内容", paramType = "query", dataType = "int"), + @ApiImplicitParam(name = Constant.ORDER_FIELD, value = "排序字段", paramType = "query", dataType = "String"), + @ApiImplicitParam(name = Constant.ORDER, value = "排序方式,可选值(asc、desc)", paramType = "query", dataType = "String") }) //@RequiresPermissions("sysnoticemanagement:sysnoticemanagement:page") - public Result> page(@ApiIgnore @RequestParam Map params){ + public Result> page(@ApiIgnore @RequestParam Map params) { PageData page = sysNoticeManagementService.page(params); return new Result>().ok(page); @@ -61,7 +60,7 @@ public class SysNoticeManagementController { @GetMapping("{id}") @ApiOperation("信息") //@RequiresPermissions("sysnoticemanagement:sysnoticemanagement:info") - public Result get(@PathVariable("id") Long id){ + public Result get(@PathVariable("id") Long id) { SysNoticeManagementDTO data = sysNoticeManagementService.get(id); return new Result().ok(data); @@ -71,7 +70,7 @@ public class SysNoticeManagementController { @ApiOperation("保存") @LogOperation("保存") //@RequiresPermissions("sysnoticemanagement:sysnoticemanagement:save") - public Result save(@RequestBody SysNoticeManagementDTO dto){ + public Result save(@RequestBody SysNoticeManagementDTO dto) { //效验数据 ValidatorUtils.validateEntity(dto, AddGroup.class, DefaultGroup.class); dto.setDelFlag(0); @@ -81,11 +80,11 @@ public class SysNoticeManagementController { return new Result(); } - @PutMapping + @PostMapping(value = "/update") @ApiOperation("修改") @LogOperation("修改") //@RequiresPermissions("sysnoticemanagement:sysnoticemanagement:update") - public Result update(@RequestBody SysNoticeManagementDTO dto){ + public Result update(@RequestBody SysNoticeManagementDTO dto) { //效验数据 ValidatorUtils.validateEntity(dto, UpdateGroup.class, DefaultGroup.class); @@ -98,7 +97,7 @@ public class SysNoticeManagementController { @ApiOperation("删除") @LogOperation("删除") //@RequiresPermissions("sysnoticemanagement:sysnoticemanagement:delete") - public Result delete(@RequestBody Long[] ids){ + public Result delete(@RequestBody Long[] ids) { //效验数据 AssertUtils.isArrayEmpty(ids, "id"); From 07bb9d1ed93b7afe5d4b337c201bd4883523de56 Mon Sep 17 00:00:00 2001 From: wangliwen Date: Sat, 10 Dec 2022 15:00:28 +0800 Subject: [PATCH 10/13] =?UTF-8?q?=E4=BD=BF=E7=94=A8activiti=20NativeTaskQu?= =?UTF-8?q?ery=E6=9F=A5=E8=AF=A2=E5=BE=85=E5=8A=9E=E5=88=86=E9=A1=B5?= =?UTF-8?q?=EF=BC=8C=E4=B8=BA=E5=AE=A1=E6=A0=B8=E7=BB=84=E4=BA=92=E5=8A=A9?= =?UTF-8?q?=E5=AE=A1=E6=A0=B8=E5=81=9A=E6=9F=A5=E8=AF=A2=E5=9F=BA=E7=A1=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../controller/ActTaskController.java | 11 ++- .../activiti/service/ActTaskService.java | 99 +++++++++++++++---- 2 files changed, 84 insertions(+), 26 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 ab02b0f7..76c6a52d 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 @@ -11,7 +11,6 @@ import io.renren.common.utils.Result; import io.renren.modules.activiti.dto.BatchCompleteDTO; import io.renren.modules.activiti.dto.TaskDTO; import io.renren.modules.activiti.service.ActTaskService; -import io.renren.modules.device.dto.TbDeviceApplyDTO; import io.renren.modules.security.user.SecurityUser; import io.renren.modules.security.user.UserDetail; import io.renren.modules.sys.dto.SysUserDTO; @@ -26,7 +25,6 @@ import org.activiti.engine.repository.ProcessDefinition; import org.activiti.engine.repository.ProcessDefinitionQuery; import org.activiti.engine.task.TaskQuery; import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.dao.DataAccessException; import org.springframework.jdbc.core.JdbcTemplate; import org.springframework.util.StringUtils; import org.springframework.web.bind.annotation.*; @@ -36,7 +34,6 @@ import java.util.*; import java.util.concurrent.CompletableFuture; import java.util.concurrent.ExecutorService; import java.util.concurrent.Executors; -import java.util.logging.Logger; import java.util.stream.Collectors; /** @@ -110,6 +107,10 @@ public class ActTaskController { taskDTO.setAssigneeName(userDTO.getRealName()); } } + + /** + * 当未指定流程类型时 补充一下会客厅的待办 + */ 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); @@ -507,7 +508,7 @@ public class ActTaskController { @ApiOperation("根据政务云资源申请业务ID查询详情") @LogOperation("根据政务云资源申请业务ID查询详情") @ApiImplicitParams({ - @ApiImplicitParam(name = "id", value = "业务ID", paramType = "query",required = true, dataType = "String") + @ApiImplicitParam(name = "id", value = "业务ID", paramType = "query", required = true, dataType = "String") }) public Result getZwyBusinessInfoById(String id) { JdbcTemplate jdbcTemplate = getJDBCTemplate(); @@ -578,7 +579,7 @@ public class ActTaskController { @ApiOperation("根据政务云视频申请业务ID查询详情") @LogOperation("根据政务云视频申请业务ID查询详情") @ApiImplicitParams({ - @ApiImplicitParam(name = "id", value = "业务ID", paramType = "query",required = true, dataType = "String") + @ApiImplicitParam(name = "id", value = "业务ID", paramType = "query", required = true, dataType = "String") }) public Result getZwyVideoInfoById(String id) { JdbcTemplate jdbcTemplate = getJDBCTemplate(); 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 b468dd47..05d95254 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 @@ -19,8 +19,6 @@ import io.renren.modules.notice.service.SysNoticeService; import io.renren.modules.processForm.dto.TAbilityApplicationDTO; import io.renren.modules.processForm.service.TAbilityApplicationService; import io.renren.modules.resource.dao.ResourceDao; -import io.renren.modules.resource.dataResource.domain.TsingtaoDataResourceService; -import io.renren.modules.resource.dto.GetDataResourceListDto; import io.renren.modules.resource.dto.ResourceDTO; import io.renren.modules.resource.entity.ResourceEntity; import io.renren.modules.resource.service.ResourceService; @@ -53,6 +51,7 @@ import org.activiti.engine.impl.pvm.process.TransitionImpl; import org.activiti.engine.impl.task.TaskDefinition; import org.activiti.engine.repository.ProcessDefinition; import org.activiti.engine.runtime.ProcessInstance; +import org.activiti.engine.task.NativeTaskQuery; import org.activiti.engine.task.Task; import org.activiti.engine.task.TaskInfo; import org.activiti.engine.task.TaskQuery; @@ -135,6 +134,10 @@ public class ActTaskService extends BaseServiceImpl { * @return */ public PageData page(Map params) { + // TODO 同一审核组内成员 + List groupUserId = new ArrayList() {{ // 测试 + + }}; String userId = (String) params.get("userId"); Integer curPage = 1; Integer limit = 10; @@ -144,32 +147,86 @@ public class ActTaskService extends BaseServiceImpl { if (params.get(Constant.LIMIT) != null) { limit = Integer.parseInt((String) params.get(Constant.LIMIT)); } - TaskQuery taskQuery = taskService.createTaskQuery(); + String taskSql = "SELECT " + + " RES.* " + + "FROM " + + " ACT_RU_TASK RES " + + " INNER JOIN ACT_RE_PROCDEF D ON RES.PROC_DEF_ID_ = D.ID_ "; + String countSql = "SELECT " + + " COUNT(RES.ID_) " + + "FROM " + + " ACT_RU_TASK RES " + + " INNER JOIN ACT_RE_PROCDEF D ON RES.PROC_DEF_ID_ = D.ID_ "; + StringBuffer where = new StringBuffer(" WHERE 1 =1 "); if (StringUtils.isNotEmpty(userId)) { - taskQuery.taskAssignee(userId); + where.append("AND ( RES.ASSIGNEE_ = #{userId} "); + // 处理同一工作组内 + groupUserId.stream().forEach(index -> { + where.append(String.format(" OR RES.ASSIGNEE_ = '%s' ", index)); + }); + where.append(")"); } + if (StringUtils.isNotEmpty((String) params.get("taskName"))) { - taskQuery.taskNameLike("%" + params.get("taskName") + "%"); + where.append(" AND RES.NAME_ = #{taskName}"); } if (StringUtils.isNotEmpty((String) params.get("processDefinitionKey"))) { // 流程定义key - taskQuery.processDefinitionKey((String) params.get("processDefinitionKey")); + where.append(" AND D.KEY_ = #{processDefinitionKey} "); } - if (StringUtils.isNotEmpty((String) params.get("isRoleGroup")) && "1".equals(params.get("isRoleGroup"))) { - List listRoles = sysRoleUserService.getRoleIdList(SecurityUser.getUserId()); - List listStr = new ArrayList<>(); - for (Long role : listRoles) { - listStr.add(role.toString()); - } - listStr.add(SecurityUser.getUserId().toString()); - if (!listStr.isEmpty()) { - taskQuery.taskCandidateGroupIn(listStr); - } else { - return new PageData<>(new ArrayList<>(), 0); - } + where.append(" AND RES.SUSPENSION_STATE_ = 1 "); + + String order = " ORDER BY " + + " RES.CREATE_TIME_ DESC "; + NativeTaskQuery nativeTaskQuery = taskService.createNativeTaskQuery().sql(taskSql + where + order); + NativeTaskQuery nativeCountTaskQuery = taskService.createNativeTaskQuery().sql(countSql + where + order); + if (StringUtils.isNotEmpty(userId)) { // 分配审核员 + nativeTaskQuery.parameter("userId", userId); + nativeCountTaskQuery.parameter("userId", userId); } - taskQuery.orderByTaskCreateTime().desc(); - List list = taskQuery.active().includeProcessVariables().listPage((curPage - 1) * limit, limit); - return new PageData<>(tasks2TaskDtos(list), (int) taskQuery.count()); + if (StringUtils.isNotEmpty((String) params.get("taskName"))) { // 任务名称 + nativeTaskQuery.parameter("taskName", params.get("taskName")); + nativeCountTaskQuery.parameter("taskName", params.get("taskName")); + } + if (StringUtils.isNotEmpty((String) params.get("processDefinitionKey"))) { // 流程定义key + nativeTaskQuery.parameter("processDefinitionKey", params.get("processDefinitionKey")); + nativeCountTaskQuery.parameter("processDefinitionKey", params.get("processDefinitionKey")); + } + List tasks = nativeTaskQuery.listPage((curPage - 1) * limit, limit); + long count = nativeCountTaskQuery.count(); + List list_ = tasks.stream().map(index -> { + TaskQuery taskQuery = taskService.createTaskQuery(); + Task temp = taskQuery.taskId(index.getId()).includeProcessVariables().singleResult(); + return temp; + }).collect(Collectors.toList()); + return new PageData<>(tasks2TaskDtos(list_), (int) count); +// 以下注释为原实现方案 +// TaskQuery taskQuery = taskService.createTaskQuery(); +// if (StringUtils.isNotEmpty(userId)) { +// taskQuery.taskAssignee(userId); +// } +// if (StringUtils.isNotEmpty((String) params.get("taskName"))) { +// taskQuery.taskNameLike("%" + params.get("taskName") + "%"); +// } +// if (StringUtils.isNotEmpty((String) params.get("processDefinitionKey"))) { // 流程定义key +// taskQuery.processDefinitionKey((String) params.get("processDefinitionKey")); +// } +// if (StringUtils.isNotEmpty((String) params.get("isRoleGroup")) && "1".equals(params.get("isRoleGroup"))) { +// List listRoles = sysRoleUserService.getRoleIdList(SecurityUser.getUserId()); +// List listStr = new ArrayList<>(); +// for (Long role : listRoles) { +// listStr.add(role.toString()); +// } +// listStr.add(SecurityUser.getUserId().toString()); +// if (!listStr.isEmpty()) { +// taskQuery.taskCandidateGroupIn(listStr); +// } else { +// return new PageData<>(new ArrayList<>(), 0); +// } +// } +// taskQuery.orderByTaskCreateTime().desc(); +// List list = taskQuery.active() +// .includeProcessVariables().listPage((curPage - 1) * limit, limit); +// return new PageData<>(tasks2TaskDtos(list), (int) taskQuery.count()); } /** From 07c73216dd5db78e1a46e79c742df31ac4c16aa1 Mon Sep 17 00:00:00 2001 From: wangliwen Date: Sat, 10 Dec 2022 15:00:43 +0800 Subject: [PATCH 11/13] ... --- .../java/io/renren/modules/activiti/service/ActTaskService.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 05d95254..b562bd0b 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 @@ -136,7 +136,7 @@ public class ActTaskService extends BaseServiceImpl { public PageData page(Map params) { // TODO 同一审核组内成员 List groupUserId = new ArrayList() {{ // 测试 - + }}; String userId = (String) params.get("userId"); Integer curPage = 1; From ac188e41eb0390716dd229b2660a515bd9b6c2f2 Mon Sep 17 00:00:00 2001 From: wangliwen Date: Sat, 10 Dec 2022 15:46:04 +0800 Subject: [PATCH 12/13] =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E5=AE=A1=E6=A0=B8?= =?UTF-8?q?=E4=BB=BB=E5=8A=A1=E6=98=AF=E5=90=A6=E4=B8=BA=E5=AE=A1=E6=A0=B8?= =?UTF-8?q?=E7=BB=84=E5=86=85=E5=85=B6=E5=AE=83=E7=BB=84=E5=91=98=E4=BB=BB?= =?UTF-8?q?=E5=8A=A1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../modules/activiti/controller/ActTaskController.java | 8 +++++++- .../java/io/renren/modules/activiti/dto/TaskDTO.java | 2 ++ .../modules/sys/service/impl/SysUserServiceImpl.java | 6 ++++-- renren-admin/src/main/resources/ehcache.xml | 10 ++++++++++ 4 files changed, 23 insertions(+), 3 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 76c6a52d..2fe4e76e 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 @@ -99,12 +99,18 @@ public class ActTaskController { }) // @RequiresPermissions("sys:task:all") public Result> myToDoTaskPage(@ApiIgnore @RequestParam Map params) { - params.put("userId", SecurityUser.getUserId().toString()); + String userId = SecurityUser.getUserId().toString(); + params.put("userId", userId); PageData page = actTaskService.page(params); for (TaskDTO taskDTO : page.getList()) { if (!StringUtils.isEmpty(taskDTO.getAssignee())) { SysUserDTO userDTO = sysUserService.get(Long.valueOf(taskDTO.getAssignee())); taskDTO.setAssigneeName(userDTO.getRealName()); + if (userId.equals(taskDTO.getAssignee())) { + taskDTO.setSynergism(Boolean.FALSE); + } else { + taskDTO.setSynergism(Boolean.FALSE); + } } } diff --git a/renren-admin/src/main/java/io/renren/modules/activiti/dto/TaskDTO.java b/renren-admin/src/main/java/io/renren/modules/activiti/dto/TaskDTO.java index e3dfa9fc..c666d17a 100644 --- a/renren-admin/src/main/java/io/renren/modules/activiti/dto/TaskDTO.java +++ b/renren-admin/src/main/java/io/renren/modules/activiti/dto/TaskDTO.java @@ -100,6 +100,8 @@ public class TaskDTO { @ApiModelProperty(value = "提供部门") private String provideDept; + @ApiModelProperty(value = "是否为审核组内协助任务") + private Boolean synergism; @Override 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 53e5588d..ee946119 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 @@ -1,6 +1,5 @@ package io.renren.modules.sys.service.impl; -import cn.hutool.core.util.ObjectUtil; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper; import com.baomidou.mybatisplus.core.metadata.IPage; @@ -28,12 +27,12 @@ import io.renren.modules.sys.enums.JhDeptsEnum; import io.renren.modules.sys.enums.SuperAdminEnum; import io.renren.modules.sys.service.*; import lombok.extern.log4j.Log4j2; -import org.apache.commons.lang3.ObjectUtils; import org.h2.util.StringUtils; 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.cache.annotation.Cacheable; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; @@ -78,6 +77,8 @@ public class SysUserServiceImpl extends BaseServiceImpl + + + \ No newline at end of file From 14bbde1103fc851fd6f4c8ee0ce36db61ce6a65b Mon Sep 17 00:00:00 2001 From: wangliwen Date: Sat, 10 Dec 2022 16:09:53 +0800 Subject: [PATCH 13/13] =?UTF-8?q?=E9=85=8D=E7=BD=AE=E6=98=AF=E5=90=A6?= =?UTF-8?q?=E5=BC=80=E5=90=AF=E6=81=A9=E7=A7=91=E7=BB=84=E4=BC=9A=E5=8A=9F?= =?UTF-8?q?=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../enke/controller/EnkeController.java | 25 +++++++++++++------ .../src/main/resources/application.yml | 3 +++ 2 files changed, 21 insertions(+), 7 deletions(-) diff --git a/renren-admin/src/main/java/io/renren/modules/enke/controller/EnkeController.java b/renren-admin/src/main/java/io/renren/modules/enke/controller/EnkeController.java index f568d775..42e6b3bb 100644 --- a/renren-admin/src/main/java/io/renren/modules/enke/controller/EnkeController.java +++ b/renren-admin/src/main/java/io/renren/modules/enke/controller/EnkeController.java @@ -11,11 +11,13 @@ import org.apache.commons.lang3.StringUtils; 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.util.CollectionUtils; import org.springframework.web.bind.annotation.*; import springfox.documentation.annotations.ApiIgnore; import sw.vc3term.contingencyplan.ContingencyPlanUtil; +import javax.annotation.PostConstruct; import java.io.UnsupportedEncodingException; import java.net.Inet4Address; import java.net.InetAddress; @@ -39,19 +41,27 @@ public class EnkeController { private static final String videoConfernceIp = "35.1.190.62"; private static final int videoConferncePort = 8756; - private static final ContingencyPlanUtil cp; + private static ContingencyPlanUtil cp = null; private static final Logger logger = LoggerFactory.getLogger(ActHistoryService.class); @Autowired private EnkeService enkeService; + @Value("#{new Boolean(${enke.enable})}") + private Boolean enke; // 是否进行恩科会议组会 - static { - cp = ContingencyPlanUtil.getInstance(); - // 初始化会议 - cp.init(videoConfernceIp, videoConferncePort); - List ips = getLocalIP(); - cp.setLocalAddress(CollectionUtils.isEmpty(ips) ? "0.0.0.0" : ips.get(0), ContingencyPlanUtil.LOCAL_PORT); + @PostConstruct + public void init() { + if (enke) { + cp = ContingencyPlanUtil.getInstance(); + // 初始化会议 + cp.init(videoConfernceIp, videoConferncePort); + List ips = getLocalIP(); + cp.setLocalAddress(CollectionUtils.isEmpty(ips) ? "0.0.0.0" : ips.get(0), ContingencyPlanUtil.LOCAL_PORT); + logger.info("开启组会功能成功!"); + } else { + logger.info("不开启组会功能"); + } } /** @@ -112,6 +122,7 @@ public class EnkeController { } } } + logger.info("本机ip:" + ips); return ips; } } diff --git a/renren-admin/src/main/resources/application.yml b/renren-admin/src/main/resources/application.yml index 9c2d76cd..853b9125 100644 --- a/renren-admin/src/main/resources/application.yml +++ b/renren-admin/src/main/resources/application.yml @@ -179,4 +179,7 @@ shangdongtong: reminders: # 催办间隔天数 interval: 7 +# 恩科会议 +enke: + enable: true