From 6e6ead267dcc32862cc0c4c67d1e70714e500712 Mon Sep 17 00:00:00 2001 From: "1437892690@qq.com" <1437892690@qq.com> Date: Mon, 15 Jul 2024 18:44:56 +0800 Subject: [PATCH] =?UTF-8?q?[=E5=8A=9F=E8=83=BD]=20=E5=90=8E=E7=AB=AF-sla?= =?UTF-8?q?=E6=94=AF=E6=8C=81=E5=B7=A5=E5=8D=95=E9=A2=9D=E5=A4=96=E5=BB=B6?= =?UTF-8?q?=E8=BF=9F=E8=B6=85=E6=97=B6=E6=97=B6=E9=97=B4=E7=82=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 关联 #[1199325999235072]后端-sla支持工单额外延迟超时时间点 http://192.168.0.96:8090/demo/rdm.html#/task-detail/939050947543040/939050947543050/1199325999235072 --- .../process/constvalue/ProcessTaskSource.java | 18 ++-- .../IProcessTaskCrossoverMapper.java | 2 + .../IProcessTaskSlaCrossoverMapper.java | 2 + .../process/dto/ProcessTaskSlaTimeVo.java | 11 +++ .../dto/ProcessTaskStepSlaDelayVo.java | 82 +++++++++++++++++++ .../core/ProcessStepHandlerBase.java | 17 +++- 6 files changed, 119 insertions(+), 13 deletions(-) create mode 100644 src/main/java/neatlogic/framework/process/dto/ProcessTaskStepSlaDelayVo.java diff --git a/src/main/java/neatlogic/framework/process/constvalue/ProcessTaskSource.java b/src/main/java/neatlogic/framework/process/constvalue/ProcessTaskSource.java index fec5a05c..a2c00941 100644 --- a/src/main/java/neatlogic/framework/process/constvalue/ProcessTaskSource.java +++ b/src/main/java/neatlogic/framework/process/constvalue/ProcessTaskSource.java @@ -1,18 +1,18 @@ package neatlogic.framework.process.constvalue; -import neatlogic.framework.util.I18n; - public enum ProcessTaskSource implements IProcessTaskSource { - PC("pc", new I18n("PC端")), - MOBILE("mobile", new I18n("移动端")), - IMPORT("import", new I18n("导入")), - SYSTEM("system", new I18n("系统")); + PC("pc", "PC端"), + MOBILE("mobile", "移动端"), + IMPORT("import", "导入"), + SYSTEM("system", "系统"), + PROCESSTASK_TRANSFER_REPORT("processtasktransferreport", "转报"), + ; private String value; - private I18n text; + private String text; - ProcessTaskSource(String value, I18n text) { + ProcessTaskSource(String value, String text) { this.value = value; this.text = text; } @@ -24,6 +24,6 @@ public enum ProcessTaskSource implements IProcessTaskSource { @Override public String getText() { - return text.toString(); + return text; } } diff --git a/src/main/java/neatlogic/framework/process/crossover/IProcessTaskCrossoverMapper.java b/src/main/java/neatlogic/framework/process/crossover/IProcessTaskCrossoverMapper.java index 17b68c60..b4d2c902 100644 --- a/src/main/java/neatlogic/framework/process/crossover/IProcessTaskCrossoverMapper.java +++ b/src/main/java/neatlogic/framework/process/crossover/IProcessTaskCrossoverMapper.java @@ -164,6 +164,8 @@ public interface IProcessTaskCrossoverMapper extends ICrossoverService { void insertProcessTaskTimeCost(ProcessTaskTimeCostVo processTaskTimeCostVo); + int insertProcessTaskInvoke(@Param("processTaskId") Long processTaskId, @Param("source") String invoke, @Param("sourceType") String invokeType, @Param("invokeId") Long invokeId); + int updateProcessTaskStepStatus(ProcessTaskStepVo processTaskStepVo); int updateProcessTaskStatus(ProcessTaskVo processTaskVo); diff --git a/src/main/java/neatlogic/framework/process/crossover/IProcessTaskSlaCrossoverMapper.java b/src/main/java/neatlogic/framework/process/crossover/IProcessTaskSlaCrossoverMapper.java index 367f5ed8..5ceb294e 100644 --- a/src/main/java/neatlogic/framework/process/crossover/IProcessTaskSlaCrossoverMapper.java +++ b/src/main/java/neatlogic/framework/process/crossover/IProcessTaskSlaCrossoverMapper.java @@ -26,4 +26,6 @@ public interface IProcessTaskSlaCrossoverMapper extends ICrossoverService { int insertProcessTaskSla(ProcessTaskSlaVo processTaskSlaVo); int insertProcessTaskStepSla(@Param("processTaskStepId") Long processTaskStepId, @Param("slaId") Long slaId); + + int deleteProcessTaskStepSlaDelayByTargetProcessTaskStepId(Long targetProcessTaskStepId); } diff --git a/src/main/java/neatlogic/framework/process/dto/ProcessTaskSlaTimeVo.java b/src/main/java/neatlogic/framework/process/dto/ProcessTaskSlaTimeVo.java index 2e8de5b3..7197c2b7 100644 --- a/src/main/java/neatlogic/framework/process/dto/ProcessTaskSlaTimeVo.java +++ b/src/main/java/neatlogic/framework/process/dto/ProcessTaskSlaTimeVo.java @@ -4,6 +4,7 @@ import neatlogic.framework.common.constvalue.ApiParamType; import neatlogic.framework.restful.annotation.EntityField; import java.util.Date; +import java.util.List; public class ProcessTaskSlaTimeVo { // @ESKey(type = ESKeyType.PKEY, name ="processTaskId") @@ -34,6 +35,8 @@ public class ProcessTaskSlaTimeVo { private Long calculationTimeLong; @EntityField(name = "工单时效超时后显示方式", type = ApiParamType.STRING) private String displayModeAfterTimeout; + @EntityField(name = "延迟列表", type = ApiParamType.JSONARRAY) + private List delayList; public Long getProcessTaskId() { return processTaskId; @@ -155,6 +158,14 @@ public class ProcessTaskSlaTimeVo { this.displayModeAfterTimeout = displayModeAfterTimeout; } + public List getDelayList() { + return delayList; + } + + public void setDelayList(List delayList) { + this.delayList = delayList; + } + @Override public String toString() { return "{slaId=" + slaId diff --git a/src/main/java/neatlogic/framework/process/dto/ProcessTaskStepSlaDelayVo.java b/src/main/java/neatlogic/framework/process/dto/ProcessTaskStepSlaDelayVo.java new file mode 100644 index 00000000..eb9cdcc8 --- /dev/null +++ b/src/main/java/neatlogic/framework/process/dto/ProcessTaskStepSlaDelayVo.java @@ -0,0 +1,82 @@ +/* + * Copyright (C) 2024 深圳极向量科技有限公司 All Rights Reserved. + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see . + */ + +package neatlogic.framework.process.dto; + +import neatlogic.framework.common.dto.BaseEditorVo; +import neatlogic.framework.util.SnowflakeUtil; + +public class ProcessTaskStepSlaDelayVo extends BaseEditorVo { + + private Long id; + private Long processTaskId; + private Long targetProcessTaskId; + private Long targetProcessTaskStepId; + private Long slaId; + private Long time; + + public Long getId() { + if (id == null) { + id = SnowflakeUtil.uniqueLong(); + } + return id; + } + + public void setId(Long id) { + this.id = id; + } + + public Long getProcessTaskId() { + return processTaskId; + } + + public void setProcessTaskId(Long processTaskId) { + this.processTaskId = processTaskId; + } + + public Long getTargetProcessTaskId() { + return targetProcessTaskId; + } + + public void setTargetProcessTaskId(Long targetProcessTaskId) { + this.targetProcessTaskId = targetProcessTaskId; + } + + public Long getTargetProcessTaskStepId() { + return targetProcessTaskStepId; + } + + public void setTargetProcessTaskStepId(Long targetProcessTaskStepId) { + this.targetProcessTaskStepId = targetProcessTaskStepId; + } + + public Long getSlaId() { + return slaId; + } + + public void setSlaId(Long slaId) { + this.slaId = slaId; + } + + public Long getTime() { + return time; + } + + public void setTime(Long time) { + this.time = time; + } +} diff --git a/src/main/java/neatlogic/framework/process/stephandler/core/ProcessStepHandlerBase.java b/src/main/java/neatlogic/framework/process/stephandler/core/ProcessStepHandlerBase.java index 2c486c5b..1eb80e5f 100644 --- a/src/main/java/neatlogic/framework/process/stephandler/core/ProcessStepHandlerBase.java +++ b/src/main/java/neatlogic/framework/process/stephandler/core/ProcessStepHandlerBase.java @@ -275,7 +275,9 @@ public abstract class ProcessStepHandlerBase implements IProcessStepHandler { processStepHandlerCrossoverUtil.notify(currentProcessTaskStepVo, ProcessTaskStepNotifyTriggerType.START); processStepHandlerCrossoverUtil.action(currentProcessTaskStepVo, ProcessTaskStepNotifyTriggerType.START); } - + // 删除时效延时数据 + IProcessTaskSlaCrossoverMapper processTaskSlaCrossoverMapper = CrossoverServiceFactory.getApi(IProcessTaskSlaCrossoverMapper.class); + processTaskSlaCrossoverMapper.deleteProcessTaskStepSlaDelayByTargetProcessTaskStepId(currentProcessTaskStepVo.getId()); /* 计算SLA并触发超时警告 **/ processStepHandlerCrossoverUtil.calculateSla(currentProcessTaskStepVo); @@ -2137,6 +2139,12 @@ public abstract class ProcessStepHandlerBase implements IProcessStepHandler { Long channelTypeRelationId = paramObj.getLong("channelTypeRelationId"); if (fromProcessTaskId != null && channelTypeRelationId != null) { processTaskCrossoverMapper.insertProcessTaskTransferReport(new ProcessTaskTransferReportVo(channelTypeRelationId, fromProcessTaskId, processTaskVo.getId())); + Long invokeId = fromProcessTaskId; + Long fromProcessTaskStepId = paramObj.getLong("fromProcessTaskStepId"); + if (fromProcessTaskStepId != null) { + invokeId = fromProcessTaskStepId; + } + processTaskCrossoverMapper.insertProcessTaskInvoke(processTaskVo.getId(), ProcessTaskSource.PROCESSTASK_TRANSFER_REPORT.getValue(), ProcessTaskSourceType.ITSM.getValue(), invokeId); } //父子工单 @@ -2293,10 +2301,11 @@ public abstract class ProcessStepHandlerBase implements IProcessStepHandler { ProcessTaskInvokeVo processTaskInvokeVo = processTaskCrossoverMapper.getInvokeByProcessTaskId(currentProcessTaskStepVo.getProcessTaskId()); if (processTaskInvokeVo != null) { IProcessTaskSource processTaskSource = ProcessTaskSourceFactory.getHandler(processTaskInvokeVo.getSource()); - if (processTaskSource == null) { - throw new ProcessTaskSourceNotFoundException(processTaskInvokeVo.getSource()); + if (processTaskSource != null) { + processTaskSource.startProcess(currentProcessTaskStepVo); +// throw new ProcessTaskSourceNotFoundException(processTaskInvokeVo.getSource()); } - processTaskSource.startProcess(currentProcessTaskStepVo); + } } catch (ProcessTaskException ex) { logger.error(ex.getMessage(), ex); -- Gitee