From 601ca081b41e924036b2ce9d6e794501cb1a0b26 Mon Sep 17 00:00:00 2001 From: "1437892690@qq.com" <1437892690@qq.com> Date: Fri, 14 Jun 2024 17:17:05 +0800 Subject: [PATCH 1/2] =?UTF-8?q?[=E5=8A=9F=E8=83=BD]=20=E5=90=8E=E7=AB=AF-?= =?UTF-8?q?=E5=81=9A=E4=BA=86=E8=BD=AC=E4=BA=A4=E6=93=8D=E4=BD=9C=E7=9A=84?= =?UTF-8?q?=EF=BC=8C=E9=83=BD=E8=A6=81=E5=9C=A8=E5=A4=84=E7=90=86=E5=8E=86?= =?UTF-8?q?=E5=8F=B2=E4=B8=AD=E7=95=99=E8=AE=B0=E5=BD=95=EF=BC=8C=E5=81=9A?= =?UTF-8?q?=E4=BA=86=E8=BD=AC=E4=BA=A4=E6=93=8D=E4=BD=9C=E7=9A=84=E4=BA=BA?= =?UTF-8?q?=EF=BC=8C=E4=B9=9F=E5=8F=AF=E4=BB=A5=E5=9C=A8=E6=88=91=E7=9A=84?= =?UTF-8?q?=E5=B7=B2=E5=8A=9E=E4=B8=AD=E6=9F=A5=E5=88=B0=E8=BF=99=E6=9D=A1?= =?UTF-8?q?=E5=B7=A5=E5=8D=95=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit #[1178993405952000]后端-做了转交操作的,都要在处理历史中留记录,做了转交操作的人,也可以在我的已办中查到这条工单。 http://192.168.0.96:8090/demo/rdm.html#/task-detail/939050947543040/939050947543050/1178993405952000 --- .../process/dto/ProcessTaskStepReplyVo.java | 19 +++++++++++++++---- .../core/ProcessStepHandlerBase.java | 10 +++++++++- 2 files changed, 24 insertions(+), 5 deletions(-) diff --git a/src/main/java/neatlogic/framework/process/dto/ProcessTaskStepReplyVo.java b/src/main/java/neatlogic/framework/process/dto/ProcessTaskStepReplyVo.java index 5ab860c2..c9558f93 100644 --- a/src/main/java/neatlogic/framework/process/dto/ProcessTaskStepReplyVo.java +++ b/src/main/java/neatlogic/framework/process/dto/ProcessTaskStepReplyVo.java @@ -1,15 +1,15 @@ package neatlogic.framework.process.dto; -import java.util.ArrayList; -import java.util.List; - import com.alibaba.fastjson.annotation.JSONField; - import neatlogic.framework.common.constvalue.ApiParamType; import neatlogic.framework.common.dto.BaseEditorVo; +import neatlogic.framework.dto.WorkAssignmentUnitVo; import neatlogic.framework.file.dto.FileVo; import neatlogic.framework.restful.annotation.EntityField; +import java.util.ArrayList; +import java.util.List; + public class ProcessTaskStepReplyVo extends BaseEditorVo { @EntityField(name = "回复id", type = ApiParamType.LONG) private Long id; @@ -40,6 +40,9 @@ public class ProcessTaskStepReplyVo extends BaseEditorVo { private String sourceName; @EntityField(name = "操作人角色", type = ApiParamType.STRING) private String operatorRole; + @EntityField(name = "目标对象列表", type = ApiParamType.JSONARRAY) + List targetList; + public ProcessTaskStepReplyVo() {} public ProcessTaskStepReplyVo(ProcessTaskStepContentVo processTaskStepContentVo) { super.setFcd(processTaskStepContentVo.getFcd()); @@ -147,4 +150,12 @@ public class ProcessTaskStepReplyVo extends BaseEditorVo { public void setOperatorRole(String operatorRole) { this.operatorRole = operatorRole; } + + public List getTargetList() { + return targetList; + } + + public void setTargetList(List targetList) { + this.targetList = targetList; + } } 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 0ead69d4..b96204d4 100644 --- a/src/main/java/neatlogic/framework/process/stephandler/core/ProcessStepHandlerBase.java +++ b/src/main/java/neatlogic/framework/process/stephandler/core/ProcessStepHandlerBase.java @@ -1710,6 +1710,14 @@ public abstract class ProcessStepHandlerBase implements IProcessStepHandler { } /* 保存描述内容 **/ + JSONArray contentTargetList = new JSONArray(); + for (ProcessTaskStepWorkerVo workerVo : workerList) { + JSONObject contentTargetObj = new JSONObject(); + contentTargetObj.put("type", workerVo.getType()); + contentTargetObj.put("uuid", workerVo.getUuid()); + contentTargetList.add(contentTargetObj); + } + currentProcessTaskStepVo.getParamObj().put("contentTargetList", contentTargetList); processStepHandlerCrossoverUtil.saveContentAndFile(currentProcessTaskStepVo, ProcessTaskOperationType.STEP_TRANSFER); /* 根据子类需要把最终处理人放进来,引擎将自动写入数据库,也可能为空,例如一些特殊的流程节点 **/ @@ -1764,7 +1772,7 @@ public abstract class ProcessStepHandlerBase implements IProcessStepHandler { } catch (ProcessTaskException e) { logger.error(e.getMessage(), e); processTaskStepVo.setError(e.getMessage()); - currentProcessTaskStepVo.setIsActive(1); + processTaskStepVo.setIsActive(1); processTaskStepVo.setStatus(ProcessTaskStepStatus.FAILED.getValue()); updateProcessTaskStepStatus(processTaskStepVo); } finally { -- Gitee From cf8414a560a9145130220c0bfc25d9c09124dfbc Mon Sep 17 00:00:00 2001 From: "1437892690@qq.com" <1437892690@qq.com> Date: Fri, 14 Jun 2024 20:20:37 +0800 Subject: [PATCH 2/2] =?UTF-8?q?[=E5=8A=9F=E8=83=BD]=20=E5=90=8E=E7=AB=AF-?= =?UTF-8?q?=E5=81=9A=E4=BA=86=E8=BD=AC=E4=BA=A4=E6=93=8D=E4=BD=9C=E7=9A=84?= =?UTF-8?q?=EF=BC=8C=E9=83=BD=E8=A6=81=E5=9C=A8=E5=A4=84=E7=90=86=E5=8E=86?= =?UTF-8?q?=E5=8F=B2=E4=B8=AD=E7=95=99=E8=AE=B0=E5=BD=95=EF=BC=8C=E5=81=9A?= =?UTF-8?q?=E4=BA=86=E8=BD=AC=E4=BA=A4=E6=93=8D=E4=BD=9C=E7=9A=84=E4=BA=BA?= =?UTF-8?q?=EF=BC=8C=E4=B9=9F=E5=8F=AF=E4=BB=A5=E5=9C=A8=E6=88=91=E7=9A=84?= =?UTF-8?q?=E5=B7=B2=E5=8A=9E=E4=B8=AD=E6=9F=A5=E5=88=B0=E8=BF=99=E6=9D=A1?= =?UTF-8?q?=E5=B7=A5=E5=8D=95=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit #[1178993405952000]后端-做了转交操作的,都要在处理历史中留记录,做了转交操作的人,也可以在我的已办中查到这条工单。 http://192.168.0.96:8090/demo/rdm.html#/task-detail/939050947543040/939050947543050/1178993405952000 --- .../constvalue/ProcessTaskStepUserStatus.java | 12 +++--- .../constvalue/ProcessTaskStepUserType.java | 41 +++++++++++++++++++ .../IProcessTaskCrossoverMapper.java | 2 + .../core/ProcessStepHandlerBase.java | 40 ++++++++++++++---- 4 files changed, 80 insertions(+), 15 deletions(-) create mode 100644 src/main/java/neatlogic/framework/process/constvalue/ProcessTaskStepUserType.java diff --git a/src/main/java/neatlogic/framework/process/constvalue/ProcessTaskStepUserStatus.java b/src/main/java/neatlogic/framework/process/constvalue/ProcessTaskStepUserStatus.java index 70918af2..80ea17d2 100755 --- a/src/main/java/neatlogic/framework/process/constvalue/ProcessTaskStepUserStatus.java +++ b/src/main/java/neatlogic/framework/process/constvalue/ProcessTaskStepUserStatus.java @@ -1,14 +1,14 @@ package neatlogic.framework.process.constvalue; -import neatlogic.framework.util.I18n; - public enum ProcessTaskStepUserStatus { - DOING("doing", new I18n("处理中")), DONE("done", new I18n("处理完毕")); + DOING("doing", "处理中"), + DONE("done", "处理完毕"), + TRANSFERRED("transferred", "已转交"); private String status; - private I18n text; + private String text; - private ProcessTaskStepUserStatus(String _status, I18n _text) { + ProcessTaskStepUserStatus(String _status, String _text) { this.status = _status; this.text = _text; } @@ -18,7 +18,7 @@ public enum ProcessTaskStepUserStatus { } public String getText() { - return text.toString(); + return text; } public static String getValue(String _status) { diff --git a/src/main/java/neatlogic/framework/process/constvalue/ProcessTaskStepUserType.java b/src/main/java/neatlogic/framework/process/constvalue/ProcessTaskStepUserType.java new file mode 100644 index 00000000..cdffe598 --- /dev/null +++ b/src/main/java/neatlogic/framework/process/constvalue/ProcessTaskStepUserType.java @@ -0,0 +1,41 @@ +/* + * 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.constvalue; + +public enum ProcessTaskStepUserType { + MAJOR("major", "处理人"), + MINOR("minor", "协助处理人"), + HISTORY_MAJOR("history_major", "历史处理人"), + ; + + private final String value; + private final String text; + + ProcessTaskStepUserType(String value, String text) { + this.value = value; + this.text = text; + } + + public String getValue() { + return value; + } + + public String getText() { + 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 00e6c228..45aba42b 100644 --- a/src/main/java/neatlogic/framework/process/crossover/IProcessTaskCrossoverMapper.java +++ b/src/main/java/neatlogic/framework/process/crossover/IProcessTaskCrossoverMapper.java @@ -174,6 +174,8 @@ public interface IProcessTaskCrossoverMapper extends ICrossoverService { int updateProcessTaskStepUserStatus(ProcessTaskStepUserVo processTaskStepUserVo); + int updateProcessTaskStepMajorUserUserTypeAndStatus(ProcessTaskStepUserVo processTaskStepUserVo); + int updateProcessTaskTitleOwnerPriorityUuid(ProcessTaskVo processTaskVo); int updateProcessTaskStepWorkerUuid(ProcessTaskStepWorkerVo processTaskStepWorkerVo); 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 b96204d4..d1ffb85b 100644 --- a/src/main/java/neatlogic/framework/process/stephandler/core/ProcessStepHandlerBase.java +++ b/src/main/java/neatlogic/framework/process/stephandler/core/ProcessStepHandlerBase.java @@ -372,11 +372,29 @@ public abstract class ProcessStepHandlerBase implements IProcessStepHandler { throw new ProcessTaskStepNoMatchedWorkerException(); } - ProcessTaskStepUserVo processTaskStepUserVo = new ProcessTaskStepUserVo(); - processTaskStepUserVo.setProcessTaskStepId(currentProcessTaskStepVo.getId()); - processTaskStepUserVo.setUserType(ProcessUserType.MAJOR.getValue());// 只删除主处理人人 - processTaskCrossoverMapper.deleteProcessTaskStepUser(processTaskStepUserVo); - + if (!oldUserList.isEmpty()) { + boolean changeMajorUser = true; + ProcessTaskStepUserVo oldUserVo = oldUserList.get(0); + for (ProcessTaskStepWorkerVo workerVo : workerSet) { + if (Objects.equals(workerVo.getUuid(), oldUserVo.getUserUuid())) { + changeMajorUser = false; + break; + } + } + if (changeMajorUser) { + oldUserVo.setUserType(ProcessTaskStepUserType.HISTORY_MAJOR.getValue()); + oldUserVo.setStatus(ProcessTaskStepUserStatus.DONE.getValue()); + int count = processTaskCrossoverMapper.updateProcessTaskStepMajorUserUserTypeAndStatus(oldUserVo); + System.out.println("count = " + count); + List processTaskStepUserList = processTaskCrossoverMapper.getProcessTaskStepUserListByProcessTaskIdList(Collections.singletonList(currentProcessTaskStepVo.getProcessTaskId())); + System.out.println("processTaskStepUserList = " + JSONObject.toJSONString(processTaskStepUserList)); + } else { + ProcessTaskStepUserVo processTaskStepUserVo = new ProcessTaskStepUserVo(); + processTaskStepUserVo.setProcessTaskStepId(currentProcessTaskStepVo.getId()); + processTaskStepUserVo.setUserType(ProcessUserType.MAJOR.getValue());// 只删除主处理人人 + processTaskCrossoverMapper.deleteProcessTaskStepUser(processTaskStepUserVo); + } + } /* 当只分配到一个用户时,自动设置为处理人,不需要抢单 **/ if (workerSet.size() == 1 && autoStart == 1) { for (ProcessTaskStepWorkerVo workerVo : workerSet) { @@ -1691,6 +1709,10 @@ public abstract class ProcessStepHandlerBase implements IProcessStepHandler { } } for (ProcessTaskStepUserVo oldUser : oldUserList) { + /* 更新处理人状态 **/ + oldUser.setUserType(ProcessTaskStepUserType.HISTORY_MAJOR.getValue()); + oldUser.setStatus(ProcessTaskStepUserStatus.TRANSFERRED.getValue()); + processTaskCrossoverMapper.updateProcessTaskStepMajorUserUserTypeAndStatus(oldUser); if (workerUserUuidList.contains(oldUser.getUserUuid())) { String userName = oldUser.getUserName(); if (StringUtils.isBlank(userName)) { @@ -1703,10 +1725,10 @@ public abstract class ProcessStepHandlerBase implements IProcessStepHandler { } } /* 清空user表 **/ - ProcessTaskStepUserVo processTaskStepUserVo = new ProcessTaskStepUserVo(); - processTaskStepUserVo.setProcessTaskStepId(currentProcessTaskStepVo.getId()); - processTaskStepUserVo.setUserType(ProcessUserType.MAJOR.getValue()); - processTaskCrossoverMapper.deleteProcessTaskStepUser(processTaskStepUserVo); +// ProcessTaskStepUserVo processTaskStepUserVo = new ProcessTaskStepUserVo(); +// processTaskStepUserVo.setProcessTaskStepId(currentProcessTaskStepVo.getId()); +// processTaskStepUserVo.setUserType(ProcessUserType.MAJOR.getValue()); +// processTaskCrossoverMapper.deleteProcessTaskStepUser(processTaskStepUserVo); } /* 保存描述内容 **/ -- Gitee