From 117c79eb0dba00bfce35a06bedab5aadb738f7e8 Mon Sep 17 00:00:00 2001 From: lizhicheng Date: Tue, 4 Oct 2022 18:01:49 +0800 Subject: [PATCH] =?UTF-8?q?=E9=80=9A=E7=9F=A5=E6=B6=88=E6=81=AF=E8=B7=B3?= =?UTF-8?q?=E8=BD=ACbug=20fix?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../renren/common/aspect/ActivitiNoticeAspect.java | 12 +++++++++--- .../processForm/listener/v3/ApplyDeptListener.java | 4 ++++ .../listener/v3/ApplyDistrictListener.java | 6 ++++++ .../processForm/listener/v3/CityListener.java | 6 ++++++ .../listener/v3/CorrectionListenerV3.java | 6 ++++++ .../listener/v3/OwnerDistrictListener.java | 6 ++++++ 6 files changed, 37 insertions(+), 3 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 cd51b9c3..433c9499 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 @@ -217,7 +217,9 @@ public class ActivitiNoticeAspect { dto.setCreator(sysUserService.getByUsername("admin").getId()); dto.setCreateDate(new Date()); dto.setFrom("通知"); - dto.setApplyId(tAbilityApplicationDTOList.get(0).getApplyFlag()); + if(tAbilityApplicationDTOList != null){ + dto.setApplyId(tAbilityApplicationDTOList.get(0).getApplyFlag()); + } dto.setApplyState(0); sysNoticeService.save(dto); }, EXECUTOR); @@ -327,7 +329,9 @@ public class ActivitiNoticeAspect { dto.setCreator(sysUserService.getByUsername("admin").getId()); dto.setCreateDate(new Date()); dto.setFrom("通知"); - dto.setApplyId(tAbilityApplicationDTOList.get(0).getApplyFlag()); + if(tAbilityApplicationDTOList != null){ + dto.setApplyId(tAbilityApplicationDTOList.get(0).getApplyFlag()); + } dto.setApplyState(0); sysNoticeService.save(dto); }, EXECUTOR).thenRunAsync(() -> { @@ -466,7 +470,9 @@ public class ActivitiNoticeAspect { dto.setCreator(sysUserService.getByUsername("admin").getId()); dto.setCreateDate(new Date()); dto.setFrom("通知"); - dto.setApplyId(tAbilityApplicationDTOList.get(0).getApplyFlag()); + if(tAbilityApplicationDTOList != null){ + dto.setApplyId(tAbilityApplicationDTOList.get(0).getApplyFlag()); + } dto.setApplyState(0); sysNoticeService.save(dto); } catch (Exception exception) { diff --git a/renren-admin/src/main/java/io/renren/modules/processForm/listener/v3/ApplyDeptListener.java b/renren-admin/src/main/java/io/renren/modules/processForm/listener/v3/ApplyDeptListener.java index 48bdf2f8..a559ac08 100644 --- a/renren-admin/src/main/java/io/renren/modules/processForm/listener/v3/ApplyDeptListener.java +++ b/renren-admin/src/main/java/io/renren/modules/processForm/listener/v3/ApplyDeptListener.java @@ -6,6 +6,7 @@ import com.google.gson.GsonBuilder; import com.google.gson.JsonDeserializer; import com.google.gson.JsonElement; import io.renren.common.annotation.ActivitiNoticeOperation; +import io.renren.modules.notice.service.SysNoticeService; import io.renren.modules.processForm.dto.TAbilityApplicationDTO; import io.renren.modules.resource.dto.ResourceDTO; import io.renren.modules.resource.service.ResourceService; @@ -51,6 +52,8 @@ public class ApplyDeptListener implements TaskListener, ExecutionListener, Activ private ResourceService resourceService; @Value("${big_date.assignee_role_name}") private String roleName; // 具备审批的角色名称 + @Autowired + private SysNoticeService sysNoticeService; @Value("${big_date.default_assignee_role_id}") private String defaultAssigneeRoleId; // 当未查到审批人时将使用该用户审批 @@ -142,6 +145,7 @@ public class ApplyDeptListener implements TaskListener, ExecutionListener, Activ if (!tAbilityApplicationDTO.isPresent()) { // 全是免批 taskService.addComment(delegateTask.getId(), delegateTask.getProcessInstanceId(), "免批资源申请默认通过"); taskService.complete(delegateTask.getId(), delegateTask.getVariables()); + sysNoticeService.updateApplyStateById(delegateTask.getProcessInstanceId(), 1); return; } } diff --git a/renren-admin/src/main/java/io/renren/modules/processForm/listener/v3/ApplyDistrictListener.java b/renren-admin/src/main/java/io/renren/modules/processForm/listener/v3/ApplyDistrictListener.java index 3f899c72..766f1478 100644 --- a/renren-admin/src/main/java/io/renren/modules/processForm/listener/v3/ApplyDistrictListener.java +++ b/renren-admin/src/main/java/io/renren/modules/processForm/listener/v3/ApplyDistrictListener.java @@ -4,6 +4,7 @@ import com.alibaba.fastjson.JSON; import com.google.common.collect.ImmutableMap; import io.renren.common.annotation.ActivitiNoticeOperation; import io.renren.modules.activiti.service.ActTaskService; +import io.renren.modules.notice.service.SysNoticeService; import io.renren.modules.processForm.dto.TAbilityApplicationDTO; import io.renren.modules.resource.dto.ResourceDTO; import io.renren.modules.resource.service.ResourceService; @@ -62,6 +63,8 @@ public class ApplyDistrictListener implements TaskListener, ExecutionListener, A @Value("${big_date.default_assignee_role_id}") private String defaultAssigneeRoleId; // 当未查到审批人时将使用该用户审批 + @Autowired + private SysNoticeService sysNoticeService; @Override @ActivitiNoticeOperation(value = "申请发起人区市管理员审批", process = "能力申请流程") @@ -137,6 +140,7 @@ public class ApplyDistrictListener implements TaskListener, ExecutionListener, A taskService.setVariable(delegateTask.getId(), "backToFirst", Boolean.FALSE); taskService.setVariable(delegateTask.getId(), "autoApply", delegateTask.getId()); taskService.complete(delegateTask.getId(), delegateTask.getVariables()); + sysNoticeService.updateApplyStateById(delegateTask.getProcessInstanceId(), 1); return; } //规则2:同一审批人连续出现时(仅保留第一个) @@ -148,6 +152,7 @@ public class ApplyDistrictListener implements TaskListener, ExecutionListener, A taskService.setVariable(delegateTask.getId(), "backToFirst", Boolean.FALSE); taskService.setVariable(delegateTask.getId(), "autoApply", delegateTask.getId()); taskService.complete(delegateTask.getId(), delegateTask.getVariables()); + sysNoticeService.updateApplyStateById(delegateTask.getProcessInstanceId(), 1); return; } @@ -163,6 +168,7 @@ public class ApplyDistrictListener implements TaskListener, ExecutionListener, A if (!tAbilityApplicationDTO.isPresent()) { // 全是免批 taskService.addComment(delegateTask.getId(), delegateTask.getProcessInstanceId(), "免批资源申请默认通过"); taskService.complete(delegateTask.getId(), delegateTask.getVariables()); + sysNoticeService.updateApplyStateById(delegateTask.getProcessInstanceId(), 1); return; } } diff --git a/renren-admin/src/main/java/io/renren/modules/processForm/listener/v3/CityListener.java b/renren-admin/src/main/java/io/renren/modules/processForm/listener/v3/CityListener.java index bd2b423c..b52f10ad 100644 --- a/renren-admin/src/main/java/io/renren/modules/processForm/listener/v3/CityListener.java +++ b/renren-admin/src/main/java/io/renren/modules/processForm/listener/v3/CityListener.java @@ -4,6 +4,7 @@ import com.alibaba.fastjson.JSON; import com.google.common.collect.ImmutableMap; import io.renren.common.annotation.ActivitiNoticeOperation; import io.renren.modules.activiti.service.ActTaskService; +import io.renren.modules.notice.service.SysNoticeService; import io.renren.modules.processForm.dto.TAbilityApplicationDTO; import io.renren.modules.resource.dto.ResourceDTO; import io.renren.modules.resource.service.ResourceService; @@ -62,6 +63,8 @@ public class CityListener implements TaskListener, ExecutionListener, ActivitiEv @Value("${big_date.default_assignee_role_id}") private String defaultAssigneeRoleId; // 当未查到审批人时将使用该用户审批 + @Autowired + private SysNoticeService sysNoticeService; @Override @ActivitiNoticeOperation(value = "市级区市管理员审批", process = "能力申请流程") @@ -138,6 +141,7 @@ public class CityListener implements TaskListener, ExecutionListener, ActivitiEv taskService.setVariable(delegateTask.getId(), "backToFirst", Boolean.FALSE); taskService.setVariable(delegateTask.getId(), "autoApply", delegateTask.getId()); taskService.complete(delegateTask.getId(), delegateTask.getVariables()); + sysNoticeService.updateApplyStateById(delegateTask.getProcessInstanceId(), 1); return; } //规则2:同一审批人连续出现时(仅保留第一个) @@ -149,6 +153,7 @@ public class CityListener implements TaskListener, ExecutionListener, ActivitiEv taskService.setVariable(delegateTask.getId(), "backToFirst", Boolean.FALSE); taskService.setVariable(delegateTask.getId(), "autoApply", delegateTask.getId()); taskService.complete(delegateTask.getId(), delegateTask.getVariables()); + sysNoticeService.updateApplyStateById(delegateTask.getProcessInstanceId(), 1); return; } @@ -164,6 +169,7 @@ public class CityListener implements TaskListener, ExecutionListener, ActivitiEv if (!tAbilityApplicationDTO.isPresent()) { // 全是免批 taskService.addComment(delegateTask.getId(), delegateTask.getProcessInstanceId(), "免批资源申请默认通过"); taskService.complete(delegateTask.getId(), delegateTask.getVariables()); + sysNoticeService.updateApplyStateById(delegateTask.getProcessInstanceId(), 1); return; } } diff --git a/renren-admin/src/main/java/io/renren/modules/processForm/listener/v3/CorrectionListenerV3.java b/renren-admin/src/main/java/io/renren/modules/processForm/listener/v3/CorrectionListenerV3.java index aef92ba0..875e3706 100644 --- a/renren-admin/src/main/java/io/renren/modules/processForm/listener/v3/CorrectionListenerV3.java +++ b/renren-admin/src/main/java/io/renren/modules/processForm/listener/v3/CorrectionListenerV3.java @@ -8,6 +8,7 @@ import com.google.gson.JsonElement; import io.renren.common.annotation.ActivitiNoticeOperation; import io.renren.common.dto.AuditingBaseDTO; import io.renren.modules.activiti.service.ActTaskService; +import io.renren.modules.notice.service.SysNoticeService; import io.renren.modules.processForm.dto.TAbilityApplicationDTO; import io.renren.modules.processForm.service.ApiGateway; import io.renren.modules.processForm.service.TAbilityApplicationService; @@ -68,6 +69,8 @@ public class CorrectionListenerV3 implements TaskListener, ExecutionListener, Ac private SysDeptService sysDeptService; @Resource(name = "${hisense.gateway.name}") private ApiGateway apiGateway; + @Autowired + private SysNoticeService sysNoticeService; @Autowired private ResourceService resourceService; @@ -226,6 +229,7 @@ public class CorrectionListenerV3 implements TaskListener, ExecutionListener, Ac taskService.setVariable(delegateTask.getId(), "backToFirst", Boolean.FALSE); taskService.setVariable(delegateTask.getId(), "autoApply", delegateTask.getId()); taskService.complete(delegateTask.getId(), delegateTask.getVariables()); + sysNoticeService.updateApplyStateById(delegateTask.getProcessInstanceId(), 1); return; } @@ -237,6 +241,7 @@ public class CorrectionListenerV3 implements TaskListener, ExecutionListener, Ac taskService.setVariable(delegateTask.getId(), "backToFirst", Boolean.FALSE); taskService.setVariable(delegateTask.getId(), "autoApply", delegateTask.getId()); taskService.complete(delegateTask.getId(), delegateTask.getVariables()); + sysNoticeService.updateApplyStateById(delegateTask.getProcessInstanceId(), 1); return; } @@ -252,6 +257,7 @@ public class CorrectionListenerV3 implements TaskListener, ExecutionListener, Ac if (!tAbilityApplicationDTO.isPresent()) { // 全是免批 taskService.addComment(delegateTask.getId(), delegateTask.getProcessInstanceId(), "免批资源申请默认通过"); taskService.complete(delegateTask.getId(), delegateTask.getVariables()); + sysNoticeService.updateApplyStateById(delegateTask.getProcessInstanceId(), 1); return; } } diff --git a/renren-admin/src/main/java/io/renren/modules/processForm/listener/v3/OwnerDistrictListener.java b/renren-admin/src/main/java/io/renren/modules/processForm/listener/v3/OwnerDistrictListener.java index 25c194c9..c2c5ec6c 100644 --- a/renren-admin/src/main/java/io/renren/modules/processForm/listener/v3/OwnerDistrictListener.java +++ b/renren-admin/src/main/java/io/renren/modules/processForm/listener/v3/OwnerDistrictListener.java @@ -4,6 +4,7 @@ import com.alibaba.fastjson.JSON; import com.google.common.collect.ImmutableMap; import io.renren.common.annotation.ActivitiNoticeOperation; import io.renren.modules.activiti.service.ActTaskService; +import io.renren.modules.notice.service.SysNoticeService; import io.renren.modules.processForm.dto.TAbilityApplicationDTO; import io.renren.modules.resource.dto.ResourceDTO; import io.renren.modules.resource.service.ResourceService; @@ -59,6 +60,8 @@ public class OwnerDistrictListener implements TaskListener, ExecutionListener, A @Value("${big_date.default_assignee_role_id}") private String defaultAssigneeRoleId; // 当未查到审批人时将使用该用户审批 + @Autowired + private SysNoticeService sysNoticeService; @Override @ActivitiNoticeOperation(value = "资源所属区市管理员审批", process = "能力申请流程") @@ -134,6 +137,7 @@ public class OwnerDistrictListener implements TaskListener, ExecutionListener, A taskService.setVariable(delegateTask.getId(), "backToFirst", Boolean.FALSE); taskService.setVariable(delegateTask.getId(), "autoApply", delegateTask.getId()); taskService.complete(delegateTask.getId(), delegateTask.getVariables()); + sysNoticeService.updateApplyStateById(delegateTask.getProcessInstanceId(), 1); return; } //规则2:同一审批人连续出现时(仅保留第一个) @@ -145,6 +149,7 @@ public class OwnerDistrictListener implements TaskListener, ExecutionListener, A taskService.setVariable(delegateTask.getId(), "backToFirst", Boolean.FALSE); taskService.setVariable(delegateTask.getId(), "autoApply", delegateTask.getId()); taskService.complete(delegateTask.getId(), delegateTask.getVariables()); + sysNoticeService.updateApplyStateById(delegateTask.getProcessInstanceId(), 1); return; } @@ -160,6 +165,7 @@ public class OwnerDistrictListener implements TaskListener, ExecutionListener, A if (!tAbilityApplicationDTO.isPresent()) { // 全是免批 taskService.addComment(delegateTask.getId(), delegateTask.getProcessInstanceId(), "免批资源申请默认通过"); taskService.complete(delegateTask.getId(), delegateTask.getVariables()); + sysNoticeService.updateApplyStateById(delegateTask.getProcessInstanceId(), 1); return; } }