From e853c35455332a4652ec604c650ca82c411c864d Mon Sep 17 00:00:00 2001
From: yangys <y_ys79@sina.com>
Date: 星期六, 13 九月 2025 15:24:46 +0800
Subject: [PATCH] 流程常量位置重构
---
blade-service/blade-mdm/src/main/java/org/springblade/mdm/flow/service/FlowBusinessService.java | 77 +++++++++++++++++++-------------------
1 files changed, 39 insertions(+), 38 deletions(-)
diff --git a/blade-service/blade-mdm/src/main/java/org/springblade/mdm/flow/service/FlowBusinessService.java b/blade-service/blade-mdm/src/main/java/org/springblade/mdm/flow/service/FlowBusinessService.java
index 86b6dd2..f6e0bf3 100644
--- a/blade-service/blade-mdm/src/main/java/org/springblade/mdm/flow/service/FlowBusinessService.java
+++ b/blade-service/blade-mdm/src/main/java/org/springblade/mdm/flow/service/FlowBusinessService.java
@@ -19,12 +19,11 @@
import org.springblade.core.tool.utils.*;
import org.springblade.mdm.flow.constants.FlowContants;
+import org.springblade.mdm.flow.constants.FlowVariableContants;
import org.springblade.mdm.flow.entity.FlowProgramFile;
import org.springblade.mdm.flow.entity.MdmFlowProcess;
import org.springblade.mdm.flow.util.MdmFlowCache;
import org.springblade.mdm.flow.vo.FlowVO;
-import org.springblade.mdm.program.service.NcProgramService;
-import org.springblade.mdm.program.service.ProcessProgRefService;
import org.springblade.system.feign.IUserClient;
import org.springblade.system.pojo.entity.User;
import org.springframework.stereotype.Service;
@@ -36,7 +35,7 @@
/**
* 娴佺▼涓氬姟瀹炵幇绫�
*
- * @author Chill
+ * @author yangys
*/
@Service
@AllArgsConstructor
@@ -92,13 +91,13 @@
if(Func.isNotEmpty(keyword)) {
String likeVal = "%" + keyword + "%";
todoQuery.or();
- todoQuery.processVariableValueLike(FlowContants.TITLE,likeVal);
- todoQuery.processVariableValueLike(FlowContants.PROCESS_NO, likeVal);
- todoQuery.processVariableValueLike(FlowContants.MACHINE_CODE, likeVal);
- todoQuery.processVariableValueLike(FlowContants.MACHINE_MODE, likeVal);
- todoQuery.processVariableValueLike(FlowContants.PROCESS_NAME, likeVal);
- todoQuery.processVariableValueLike(FlowContants.PROCESS_EDITION, likeVal);
- todoQuery.processVariableValueLike(FlowContants.CRAFT_EDITION, likeVal);
+ todoQuery.processVariableValueLike(FlowVariableContants.TITLE,likeVal);
+ todoQuery.processVariableValueLike(FlowVariableContants.PROCESS_NO, likeVal);
+ todoQuery.processVariableValueLike(FlowVariableContants.MACHINE_CODE, likeVal);
+ todoQuery.processVariableValueLike(FlowVariableContants.MACHINE_MODE, likeVal);
+ todoQuery.processVariableValueLike(FlowVariableContants.PROCESS_NAME, likeVal);
+ todoQuery.processVariableValueLike(FlowVariableContants.PROCESS_EDITION, likeVal);
+ todoQuery.processVariableValueLike(FlowVariableContants.CRAFT_EDITION, likeVal);
todoQuery.processDefinitionNameLike(likeVal);
todoQuery.endOr();
@@ -156,7 +155,6 @@
if(ru.isSuccess()) {
flow.setStartUserName(ru.getData().getName());
}
- ;
List<Comment> comments = lastStepComments(task);//taskService.getTaskComments(task.getId());
if(!comments.isEmpty()){
flow.setComment(comments.get(0).getFullMessage());
@@ -203,15 +201,7 @@
return Collections.emptyList();
}
}
- /**
- * 鑾峰彇鍘嗗彶娴佺▼
- *
- * @param processInstanceId 娴佺▼瀹炰緥id
- * @return HistoricProcessInstance
- */
- private HistoricProcessInstance getHistoricProcessInstance(String processInstanceId) {
- return historyService.createHistoricProcessInstanceQuery().processInstanceId(processInstanceId).singleResult();
- }
+
public IPage<FlowVO> selectAllTaskPage(IPage<FlowVO> page, String keyword) {
@@ -298,7 +288,7 @@
taskQuery.taskCreatedBefore(DateUtil.toDate(createTimeEnd.plusDays(1)));
}
if(Func.isNotEmpty(myProcessName)) {
- taskQuery.processVariableValueEquals(FlowContants.MY_PROCESS_NAME, myProcessName);
+ taskQuery.processVariableValueEquals(FlowVariableContants.MY_PROCESS_NAME, myProcessName);
}
addKeywordCondition(taskQuery, keyword);
@@ -335,7 +325,7 @@
HistoricProcessInstanceQuery query = this.historyService.createHistoricProcessInstanceQuery().finished().includeProcessVariables();
//.finished() // 鍙煡璇㈠凡瀹屾垚鐨勬祦绋�.unfinished() // 鏌ヨ鏈畬鎴愮殑娴佺▼
if(Func.isNotEmpty(myProcessName)) {
- query.variableValueEquals(FlowContants.MY_PROCESS_NAME, myProcessName);
+ query.variableValueEquals(FlowVariableContants.MY_PROCESS_NAME, myProcessName);
}
if(createTimeBegin!=null) {
query.startedAfter(DateUtil.toDate(createTimeBegin));
@@ -346,13 +336,13 @@
if(Func.isNotEmpty(keyword)) {
String likeVal = "%" + keyword + "%";
query.or();
- query.variableValueLike(FlowContants.TITLE,likeVal);
- query.variableValueLike(FlowContants.PROCESS_NO, likeVal);
- query.variableValueLike(FlowContants.MACHINE_CODE, likeVal);
- query.variableValueLike(FlowContants.MACHINE_MODE, likeVal);
- query.variableValueLike(FlowContants.PROCESS_NAME, likeVal);
- query.variableValueLike(FlowContants.PROCESS_EDITION, likeVal);
- query.variableValueLike(FlowContants.CRAFT_EDITION, likeVal);
+ query.variableValueLike(FlowVariableContants.TITLE,likeVal);
+ query.variableValueLike(FlowVariableContants.PROCESS_NO, likeVal);
+ query.variableValueLike(FlowVariableContants.MACHINE_CODE, likeVal);
+ query.variableValueLike(FlowVariableContants.MACHINE_MODE, likeVal);
+ query.variableValueLike(FlowVariableContants.PROCESS_NAME, likeVal);
+ query.variableValueLike(FlowVariableContants.PROCESS_EDITION, likeVal);
+ query.variableValueLike(FlowVariableContants.CRAFT_EDITION, likeVal);
query.endOr();
}
@@ -376,6 +366,11 @@
vo.setProcessCreateTime(processInstance.getStartTime());
vo.setHistoryTaskEndTime(processInstance.getEndTime());
+
+ R<User> ru = userClient.userInfoById(Long.valueOf(processInstance.getStartUserId()));
+ if(ru.isSuccess()) {
+ vo.setStartUserName(ru.getData().getName());
+ }
vo.setFile(getFileString(processInstance.getId()));
records.add(vo);
@@ -398,8 +393,10 @@
public IPage<FlowVO> selectExceptionPage(IPage<FlowVO> page, String myProcessName, String keyword,LocalDateTime createTimeBegin, LocalDateTime createTimeEnd) {
HistoricProcessInstanceQuery query = this.historyService.createHistoricProcessInstanceQuery().finished().includeProcessVariables();
//.finished() // 鍙煡璇㈠凡瀹屾垚鐨勬祦绋�.unfinished() // 鏌ヨ鏈畬鎴愮殑娴佺▼
+
+ query.variableValueEquals(FlowVariableContants.EXCEPTION, "1");
if(Func.isNotEmpty(myProcessName)) {
- query.variableValueEquals(FlowContants.MY_PROCESS_NAME, myProcessName);
+ query.variableValueEquals(FlowVariableContants.MY_PROCESS_NAME, myProcessName);
}
if(createTimeBegin!=null) {
query.startedAfter(DateUtil.toDate(createTimeBegin));
@@ -410,13 +407,13 @@
if(Func.isNotEmpty(keyword)) {
String likeVal = "%" + keyword + "%";
query.or();
- query.variableValueLike(FlowContants.TITLE,likeVal);
- query.variableValueLike(FlowContants.PROCESS_NO, likeVal);
- query.variableValueLike(FlowContants.MACHINE_CODE, likeVal);
- query.variableValueLike(FlowContants.MACHINE_MODE, likeVal);
- query.variableValueLike(FlowContants.PROCESS_NAME, likeVal);
- query.variableValueLike(FlowContants.PROCESS_EDITION, likeVal);
- query.variableValueLike(FlowContants.CRAFT_EDITION, likeVal);
+ query.variableValueLike(FlowVariableContants.TITLE,likeVal);
+ query.variableValueLike(FlowVariableContants.PROCESS_NO, likeVal);
+ query.variableValueLike(FlowVariableContants.MACHINE_CODE, likeVal);
+ query.variableValueLike(FlowVariableContants.MACHINE_MODE, likeVal);
+ query.variableValueLike(FlowVariableContants.PROCESS_NAME, likeVal);
+ query.variableValueLike(FlowVariableContants.PROCESS_EDITION, likeVal);
+ query.variableValueLike(FlowVariableContants.CRAFT_EDITION, likeVal);
query.endOr();
}
@@ -440,7 +437,10 @@
vo.setProcessCreateTime(processInstance.getStartTime());
vo.setHistoryTaskEndTime(processInstance.getEndTime());
-
+ R<User> ru = userClient.userInfoById(Long.valueOf(processInstance.getStartUserId()));
+ if(ru.isSuccess()) {
+ vo.setStartUserName(ru.getData().getName());
+ }
vo.setFile(getFileString(processInstance.getId()));
records.add(vo);
}
@@ -548,4 +548,5 @@
return page;
}
+
}
--
Gitblit v1.9.3