From 357ed71dbe1c4f9d5fb222b06ed17e5f0fe3c8bd Mon Sep 17 00:00:00 2001 From: wangliwen Date: Fri, 1 Jul 2022 09:28:40 +0800 Subject: [PATCH 1/6] =?UTF-8?q?=E6=91=84=E5=83=8F=E5=A4=B4=E7=94=B3?= =?UTF-8?q?=E8=AF=B7=20=E6=88=91=E7=9A=84=E7=94=B3=E8=AF=B7=E5=90=8D?= =?UTF-8?q?=E5=AD=97=E7=89=B9=E6=AE=8A=E5=A4=84=E7=90=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../controller/AbilityCenterControllerV2.java | 6 +++--- .../activiti/service/ActHistoryService.java | 21 ++++++++++++------- 2 files changed, 16 insertions(+), 11 deletions(-) diff --git a/renren-admin/src/main/java/io/renren/common/controller/AbilityCenterControllerV2.java b/renren-admin/src/main/java/io/renren/common/controller/AbilityCenterControllerV2.java index 36170043..487ae938 100644 --- a/renren-admin/src/main/java/io/renren/common/controller/AbilityCenterControllerV2.java +++ b/renren-admin/src/main/java/io/renren/common/controller/AbilityCenterControllerV2.java @@ -145,10 +145,9 @@ public class AbilityCenterControllerV2 { Boolean basic_facilities = dtoList.stream().map(index -> { Optional resourceDTOOptional = - Optional.ofNullable(resourceService.get(Long.valueOf(index.getResourceId()))); // + Optional.ofNullable(resourceService.get(Long.valueOf(index.getResourceId()))); // 从本库内查不到 视为其它平台的基础设施资源 return !resourceDTOOptional.isPresent() || !"基础设施".equals(resourceDTOOptional.get().getType()); } - ) .filter(index -> !index).findAny().orElse(Boolean.TRUE); logger.error("--------------------是否全是基础设施{}----------------------------------------------", basic_facilities); @@ -156,7 +155,8 @@ public class AbilityCenterControllerV2 { // 仿照请求接口 /act/running/startOfBusinessKey ProcessStartDTO processStartDTO = new ProcessStartDTO(); processStartDTO.setBusinessKey(basic_facilities ? - tAbilityApplicationDTOList.stream().filter(index -> StringUtils.isNotEmpty(index.getResourceId())) + tAbilityApplicationDTOList.stream() + .filter(index -> StringUtils.isNotEmpty(index.getResourceId())) .map(TAbilityApplicationDTO::getResourceId) .findFirst() .orElse(null) 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 c92f638f..7a4adf75 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 @@ -262,14 +262,19 @@ public class ActHistoryService { for (ProcessInstanceDTO dto : list) { List abilityApplicationDTO = tAbilityApplicationService.getByInstanceId(dto.getProcessInstanceId()); // 获取申请表单 if (abilityApplicationDTO != null && !abilityApplicationDTO.isEmpty()) { - StringBuffer stringBuffer = new StringBuffer(); - abilityApplicationDTO.stream().map(TAbilityApplicationDTO::getSystem).filter(index -> StringUtils.isNotEmpty(index)).forEach(index -> { - stringBuffer.append(index); - stringBuffer.append(","); - }); - stringBuffer.deleteCharAt(stringBuffer.length() - 1); - dto.setName(stringBuffer.toString()); - dto.setResourceId(null); + if (abilityApplicationDTO.stream().filter(index -> StringUtils.isNotEmpty(index.getCameraList())).findAny().isPresent()) { // 存在摄像头 + dto.setName("申请摄像头列表"); + dto.setResourceId(null); + } else { + StringBuffer stringBuffer = new StringBuffer(); + abilityApplicationDTO.stream().map(TAbilityApplicationDTO::getSystem).filter(index -> StringUtils.isNotEmpty(index)).forEach(index -> { + stringBuffer.append(index); + stringBuffer.append(","); + }); + stringBuffer.deleteCharAt(stringBuffer.length() - 1); + dto.setName(stringBuffer.toString()); + dto.setResourceId(null); + } } else { TAbilityApplicationDTO abilityApplicationDTO1 = tAbilityApplicationService.getByBusinessKey(dto.getBusinessKey()); if (abilityApplicationDTO1 != null) { From 03dee6f380b8075e0607a5141a9f0278319a1a79 Mon Sep 17 00:00:00 2001 From: wangliwen Date: Fri, 1 Jul 2022 09:50:48 +0800 Subject: [PATCH 2/6] =?UTF-8?q?=E5=B7=B2=E5=8A=9E=E4=BB=BB=E5=8A=A1?= =?UTF-8?q?=E6=94=AF=E6=8C=81=E8=83=BD=E5=8A=9B=E6=89=B9=E9=87=8F=E7=94=B3?= =?UTF-8?q?=E8=AF=B7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../controller/HistoryController.java | 22 +++++++++++++------ 1 file changed, 15 insertions(+), 7 deletions(-) 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 e0b9c0a2..fc3e18ae 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 @@ -135,8 +135,8 @@ public class HistoryController { @ApiImplicitParam(name = Constant.PAGE, value = "当前页码,从1开始", paramType = "query", required = true, dataType = "int"), @ApiImplicitParam(name = Constant.LIMIT, value = "每页显示记录数", paramType = "query", required = true, dataType = "int") }) - public Result> getDeptHandledInstancePage(@ApiIgnore @RequestParam Map params){ - Page page=activitiService.getDeptProcessInstancePage(params); + public Result> getDeptHandledInstancePage(@ApiIgnore @RequestParam Map params) { + Page page = activitiService.getDeptProcessInstancePage(params); setExtraProcessProperties(page.getRecords()); return new Result().ok(page); } @@ -153,7 +153,7 @@ public class HistoryController { return new Result().ok(list); } - private void setExtraProcessProperties(List list){ + private void setExtraProcessProperties(List list) { for (ProcessActivityDTO activityDTO : list) { if (StringUtils.isNotEmpty(activityDTO.getStartUserId())) { SysUserDTO userDTO = sysUserService.get(Long.valueOf(activityDTO.getStartUserId())); @@ -163,12 +163,20 @@ public class HistoryController { SysUserDTO userDTO = sysUserService.get(Long.valueOf(activityDTO.getAssignee())); activityDTO.setAssigneeName(userDTO != null ? userDTO.getRealName() : ""); } - TAbilityApplicationDTO abilityApplicationDTO = - abilityApplicationService.get(Long.valueOf(activityDTO.getBusinessKey())); + List abilityApplicationDTOS = + abilityApplicationService.getByInstanceId(activityDTO.getProcessInstanceId()); +// TAbilityApplicationDTO abilityApplicationDTO = +// abilityApplicationService.get(Long.valueOf(activityDTO.getBusinessKey())); TResourceMountApplyDTO tResourceMountApplyDTO = tResourceMountApplyService.get(Long.valueOf(activityDTO.getBusinessKey())); TDemandDataDTO tDemandDataDTO = tDemandDataService.get(Long.valueOf(activityDTO.getBusinessKey())); - if (abilityApplicationDTO != null) { - activityDTO.setResourceName(abilityApplicationDTO.getSystem()); + if (abilityApplicationDTOS != null && !abilityApplicationDTOS.isEmpty()) { + StringBuffer stringBuffer = new StringBuffer(); + abilityApplicationDTOS.stream().map(TAbilityApplicationDTO::getSystem).filter(index -> StringUtils.isNotEmpty(index)).forEach(index -> { + stringBuffer.append(index); + stringBuffer.append(","); + }); + stringBuffer.deleteCharAt(stringBuffer.length() - 1); + activityDTO.setResourceName(stringBuffer.toString()); } else if (tResourceMountApplyDTO != null) { activityDTO.setResourceName(tResourceMountApplyDTO.getResourceDTO().getName()); } else if (tDemandDataDTO != null) { From ef1cbe93fc221a5ef5c9f2dd58d386de416bb02d Mon Sep 17 00:00:00 2001 From: wangliwen Date: Fri, 1 Jul 2022 09:57:29 +0800 Subject: [PATCH 3/6] ... --- .../modules/activiti/controller/HistoryController.java | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) 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 fc3e18ae..490c981e 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 @@ -165,10 +165,12 @@ public class HistoryController { } List abilityApplicationDTOS = abilityApplicationService.getByInstanceId(activityDTO.getProcessInstanceId()); -// TAbilityApplicationDTO abilityApplicationDTO = -// abilityApplicationService.get(Long.valueOf(activityDTO.getBusinessKey())); - TResourceMountApplyDTO tResourceMountApplyDTO = tResourceMountApplyService.get(Long.valueOf(activityDTO.getBusinessKey())); - TDemandDataDTO tDemandDataDTO = tDemandDataService.get(Long.valueOf(activityDTO.getBusinessKey())); + TResourceMountApplyDTO tResourceMountApplyDTO = null; + TDemandDataDTO tDemandDataDTO = null; + if (!activityDTO.getBusinessKey().startsWith("[") && !activityDTO.getBusinessKey().startsWith("{")) { // json 内容(批量申请) + tResourceMountApplyDTO = tResourceMountApplyService.get(Long.valueOf(activityDTO.getBusinessKey())); + tDemandDataDTO = tDemandDataService.get(Long.valueOf(activityDTO.getBusinessKey())); + } if (abilityApplicationDTOS != null && !abilityApplicationDTOS.isEmpty()) { StringBuffer stringBuffer = new StringBuffer(); abilityApplicationDTOS.stream().map(TAbilityApplicationDTO::getSystem).filter(index -> StringUtils.isNotEmpty(index)).forEach(index -> { From e610457d13cba244de55dce0fcd711bc8503155f Mon Sep 17 00:00:00 2001 From: wangliwen Date: Fri, 1 Jul 2022 10:02:39 +0800 Subject: [PATCH 4/6] =?UTF-8?q?=E7=94=B3=E8=AF=B7=E7=9A=84=E8=A1=A8?= =?UTF-8?q?=E5=8D=95=20camera=5Flist=20=E6=9F=A5=E8=AF=A2=E4=B8=8D?= =?UTF-8?q?=E5=87=BA=E7=9A=84=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../modules/processForm/entity/TAbilityApplicationEntity.java | 3 +-- .../resources/mapper/processForm/TAbilityApplicationDao.xml | 3 +-- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/renren-admin/src/main/java/io/renren/modules/processForm/entity/TAbilityApplicationEntity.java b/renren-admin/src/main/java/io/renren/modules/processForm/entity/TAbilityApplicationEntity.java index 6dde5961..ed39ab73 100644 --- a/renren-admin/src/main/java/io/renren/modules/processForm/entity/TAbilityApplicationEntity.java +++ b/renren-admin/src/main/java/io/renren/modules/processForm/entity/TAbilityApplicationEntity.java @@ -4,7 +4,6 @@ import com.baomidou.mybatisplus.annotation.TableField; import com.baomidou.mybatisplus.annotation.TableId; import com.baomidou.mybatisplus.annotation.TableName; import com.baomidou.mybatisplus.extension.handlers.FastjsonTypeHandler; -import io.renren.modules.monitor.entity.CameraChannel; import lombok.Data; import lombok.EqualsAndHashCode; @@ -98,7 +97,7 @@ public class TAbilityApplicationEntity implements Serializable { /** * 摄像头列表 */ - @TableField(value = "camera_list", typeHandler = FastjsonTypeHandler.class) +// @TableField(value = "camera_list", typeHandler = FastjsonTypeHandler.class) private String cameraList; /** diff --git a/renren-admin/src/main/resources/mapper/processForm/TAbilityApplicationDao.xml b/renren-admin/src/main/resources/mapper/processForm/TAbilityApplicationDao.xml index 66132722..5d32361a 100644 --- a/renren-admin/src/main/resources/mapper/processForm/TAbilityApplicationDao.xml +++ b/renren-admin/src/main/resources/mapper/processForm/TAbilityApplicationDao.xml @@ -20,8 +20,7 @@ - + From a092e6b00fb812e04adbcedc215e3515082f57e3 Mon Sep 17 00:00:00 2001 From: wangliwen Date: Fri, 1 Jul 2022 10:30:54 +0800 Subject: [PATCH 5/6] =?UTF-8?q?=E7=94=B3=E8=AF=B7=E6=91=84=E5=83=8F?= =?UTF-8?q?=E5=A4=B4=E9=80=9A=E7=9F=A5=E5=BC=82=E5=B8=B8=E7=9A=84=E8=A7=A3?= =?UTF-8?q?=E5=86=B3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/io/renren/common/aspect/ActivitiNoticeAspect.java | 6 ++++-- .../processForm/listener/v2/CorrectionListenerV2.java | 4 ++-- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/renren-admin/src/main/java/io/renren/common/aspect/ActivitiNoticeAspect.java b/renren-admin/src/main/java/io/renren/common/aspect/ActivitiNoticeAspect.java index d77ef32c..f8b1ed1e 100644 --- a/renren-admin/src/main/java/io/renren/common/aspect/ActivitiNoticeAspect.java +++ b/renren-admin/src/main/java/io/renren/common/aspect/ActivitiNoticeAspect.java @@ -232,15 +232,17 @@ public class ActivitiNoticeAspect { Long resourceId = null; if (kv.containsKey("resourceId") && kv.get("resourceId") != null) { resourceId = Long.valueOf(kv.get("resourceId").toString()); - } else if (kv.containsKey("id") && kv.get("id") != null) { + } else if (kv.containsKey("id") && kv.get("id") != null && kv.containsKey("-")) { resourceId = Long.valueOf(kv.get("id").toString()); + } else { + resourceId = 0L; } Optional resourceDTO = Optional.ofNullable(resourceService.get(resourceId)); CompletableFuture.runAsync(() -> { // 发起人 SysUserDTO userDTO = sysUserService.get(Long.valueOf(finalCreator)); kv.get("resourceId"); kv.get("id"); - String content = "【通知】" + userDTO.getRealName() + ",您发起的" + (resourceDTO.isPresent() ? resourceDTO.get().getName() : "") + activitiNoticeOperation.process() + "已完成,审核结果为:" + finalResult; + String content = "【通知】" + userDTO.getRealName() + ",您发起的" + (resourceDTO.isPresent() ? resourceDTO.get().getName() : "申请摄像头列表") + activitiNoticeOperation.process() + "已完成,审核结果为:" + finalResult; SysNoticeDTO dto = new SysNoticeDTO(); dto.setType(2); dto.setTitle("流程结束系统通知"); diff --git a/renren-admin/src/main/java/io/renren/modules/processForm/listener/v2/CorrectionListenerV2.java b/renren-admin/src/main/java/io/renren/modules/processForm/listener/v2/CorrectionListenerV2.java index abefb3e6..a23b8361 100644 --- a/renren-admin/src/main/java/io/renren/modules/processForm/listener/v2/CorrectionListenerV2.java +++ b/renren-admin/src/main/java/io/renren/modules/processForm/listener/v2/CorrectionListenerV2.java @@ -68,7 +68,7 @@ public class CorrectionListenerV2 implements TaskListener, ExecutionListener, Ac private TAbilityApplicationService tAbilityApplicationService; @Override - @ActivitiNoticeOperation(value = "资源部门负责人审批", process = "能力申请流程") + @ActivitiNoticeOperation(value = "资源部门负责人审批", process = "能力申请流程v2") public void notify(DelegateTask delegateTask) { logger.error("-------------------------进入部门动态审批人流程-------------------------------"); final String eventName = delegateTask.getEventName(); @@ -85,7 +85,7 @@ public class CorrectionListenerV2 implements TaskListener, ExecutionListener, Ac } @Override - @ActivitiNoticeOperation(value = "流程结束", process = "能力申请流程", type = 2) + @ActivitiNoticeOperation(value = "流程结束", process = "能力申请流程v2", type = 2) public void notify(DelegateExecution delegateExecution) throws Exception { logger.error("----------------------进入部门审批结束节点---------------------------"); delegateExecution.getProcessBusinessKey(); From b21210e36f9d3e031fc490b0b087da597354cc68 Mon Sep 17 00:00:00 2001 From: wangliwen Date: Fri, 1 Jul 2022 10:42:11 +0800 Subject: [PATCH 6/6] ... --- .../resources/mapper/processForm/TAbilityApplicationDao.xml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/renren-admin/src/main/resources/mapper/processForm/TAbilityApplicationDao.xml b/renren-admin/src/main/resources/mapper/processForm/TAbilityApplicationDao.xml index 5d32361a..cf36a2d0 100644 --- a/renren-admin/src/main/resources/mapper/processForm/TAbilityApplicationDao.xml +++ b/renren-admin/src/main/resources/mapper/processForm/TAbilityApplicationDao.xml @@ -29,7 +29,7 @@ update t_ability_application set instance_id = #{instanceId} where id = #{id} - SELECT t1.* FROM @@ -38,7 +38,7 @@ t1.instance_id = #{instanceId} - SELECT t1.* FROM @@ -49,7 +49,7 @@