From db860f9c08a23fe916121a2c76001e05d2acee3e Mon Sep 17 00:00:00 2001
From: wangting <675591594@qq.com>
Date: 星期一, 07 八月 2023 15:17:16 +0800
Subject: [PATCH] Merge remote-tracking branch 'origin/master'

---
 Source/UBCS-WEB/src/components/template/FlowPath.vue                                                              |   29 ++++++++------
 Source/UBCS-WEB/src/components/Theme/ThemeClassifyTrees.vue                                                       |   56 +++++++++++++++------------
 Source/UBCS/ubcs-ops/ubcs-flow/src/main/java/com/vci/ubcs/flow/business/service/impl/FlowBusinessServiceImpl.java |   15 ++++---
 Source/UBCS/ubcs-ops/ubcs-flow/src/main/java/com/vci/ubcs/flow/engine/service/impl/VCIFlowserviceImpl.java        |   19 +++++++++
 4 files changed, 76 insertions(+), 43 deletions(-)

diff --git a/Source/UBCS-WEB/src/components/Theme/ThemeClassifyTrees.vue b/Source/UBCS-WEB/src/components/Theme/ThemeClassifyTrees.vue
index 581c486..2868e1a 100644
--- a/Source/UBCS-WEB/src/components/Theme/ThemeClassifyTrees.vue
+++ b/Source/UBCS-WEB/src/components/Theme/ThemeClassifyTrees.vue
@@ -26,7 +26,7 @@
         <!--        鏍戣妭鐐规坊鍔犲璇濇-->
         <el-dialog :title="this.TreeFlag ? '娣诲姞鍒嗙被' :'娣诲姞涓婚搴�'" :before-close="TreeEscHandler" :visible.sync="TreeAddFormVisible"  v-loading="AddLoading" append-to-body
                    style="width: 1700px;margin: auto">
-          <el-form :model="TreeAddform" :rules="rules">
+          <el-form ref="myForm" :model="TreeAddform" :rules="rules">
             <el-form-item :label="this.TreeFlag ? '鍒嗙被缂栧彿锛�' :'涓婚搴撶紪鍙凤細'" label-width="150px" style="display: inline-block" prop="id">
               <el-input v-model="TreeAddform.id" autocomplete="off" style="width: 170px"></el-input>
             </el-form-item>
@@ -1041,34 +1041,40 @@
     //鏍戣妭鐐瑰彇娑堜簨浠�
     TreeEscHandler(){
       this.TreeAddform={};
-      this.TreeAddFormVisible=false
+      this.TreeAddFormVisible=false;
+      // 鍏抽棴寮圭獥娓呯┖鏍¢獙
+      this.$refs.myForm.clearValidate();
     },
     //鏍戣妭鐐规坊鍔犱簨浠�
     TreeAddHandler() {
-      const data = this.TreeAddform;
-      // data.btmtypename= this.TreeList.btmtypename
-      this.$set(data, "parentCodeClassifyOid", this.nodeClickList.oid);
-      TreeSave(data)
-        .then(() => {
-          this.$message({
-            type: "success",
-            message: "娣诲姞鎴愬姛!",
+      if ((!this.TreeAddform.id || !this.TreeAddform.name) || (this.TreeFlagCode && !this.TreeAddform.btmTypeName)) {
+        this.$message.warning('璇疯緭鍏ュ唴瀹癸紒');
+      }else {
+        const data = this.TreeAddform;
+        // data.btmtypename= this.TreeList.btmtypename
+        this.$set(data, "parentCodeClassifyOid", this.nodeClickList.oid);
+        TreeSave(data)
+          .then(() => {
+            this.$message({
+              type: "success",
+              message: "娣诲姞鎴愬姛!",
+            });
+            Object.keys(this.TreeAddform).forEach(key => {
+              this.TreeAddform[key] = "";
+            });
+            this.getAttr();
+            this.TreeAddFormVisible = false;
+            //娣诲姞瀹屾垚鍚庡彸渚ф竻绌�
+            this.ProData=[];
+            this.Formlist=[];
+          })
+          .catch((res) => {
+            this.$message({
+              type: "warning",
+              message: res,
+            });
           });
-          Object.keys(this.TreeAddform).forEach(key => {
-            this.TreeAddform[key] = "";
-          });
-          this.getAttr();
-          this.TreeAddFormVisible = false;
-          //娣诲姞瀹屾垚鍚庡彸渚ф竻绌�
-          this.ProData=[];
-          this.Formlist=[];
-        })
-        .catch((res) => {
-          this.$message({
-            type: "warning",
-            message: res,
-          });
-        });
+      }
     },
     //鏍戣妭鐐瑰垹闄ゆ寜閽�
     TreeDel() {
diff --git a/Source/UBCS-WEB/src/components/template/FlowPath.vue b/Source/UBCS-WEB/src/components/template/FlowPath.vue
index f3d30c7..72d9567 100644
--- a/Source/UBCS-WEB/src/components/template/FlowPath.vue
+++ b/Source/UBCS-WEB/src/components/template/FlowPath.vue
@@ -171,17 +171,19 @@
         // 鏂板
         async handleSave(row, done, loading) {
             console.log(row)
-            const response = await flowpathSave({ ...row, ...{ templateId: this.code } })
-            if (response.status === 200) {
-                loading()
+            await flowpathSave({ ...row, ...{ templateId: this.code } }).then(response=>{
+              if (response.status === 200) {
                 console.log(response)
                 this.$message({
-                    type: 'success',
-                    message: '鏂板鏁版嵁鎴愬姛锛�'
+                  type: 'success',
+                  message: '鏂板鏁版嵁鎴愬姛锛�'
                 })
                 done()
                 this.getDataList()
-            }
+              }
+            }).catch(res=>{
+              loading()
+            })
 
         },
         // 缂栬緫
@@ -189,16 +191,19 @@
             console.log(row)
             const { modelName, modelKey, buttonTypeKey, id ,description} = row
             let param = { modelName, modelKey, buttonTypeKey, id,description }
-            const response = await flowpathSave({ ...param, ...{ templateId: this.code } })
-            if (response.status === 200) {
-                loading()
+            await flowpathSave({ ...param, ...{ templateId: this.code } }).then(response=>{
+              if (response.status === 200) {
                 this.$message({
-                    type: 'success',
-                    message: '淇敼鏁版嵁鎴愬姛锛�'
+                  type: 'success',
+                  message: '淇敼鏁版嵁鎴愬姛锛�'
                 })
                 done()
                 this.getDataList()
-            }
+              }
+            }).catch(()=>{
+              //loading鎺у埗绂佺敤 榛樿鏄紑鍚�
+              loading()
+            })
 
         },
         // 鍒犻櫎鍗曟潯
diff --git a/Source/UBCS/ubcs-ops/ubcs-flow/src/main/java/com/vci/ubcs/flow/business/service/impl/FlowBusinessServiceImpl.java b/Source/UBCS/ubcs-ops/ubcs-flow/src/main/java/com/vci/ubcs/flow/business/service/impl/FlowBusinessServiceImpl.java
index a8581d4..e39c37e 100644
--- a/Source/UBCS/ubcs-ops/ubcs-flow/src/main/java/com/vci/ubcs/flow/business/service/impl/FlowBusinessServiceImpl.java
+++ b/Source/UBCS/ubcs-ops/ubcs-flow/src/main/java/com/vci/ubcs/flow/business/service/impl/FlowBusinessServiceImpl.java
@@ -82,9 +82,9 @@
 			.includeProcessVariables().active().orderByTaskCreateTime().desc();
 
 		// 鏋勫缓鍒楄〃鏁版嵁
-		buildFlowTaskList(bladeFlow, flowList, claimUserQuery, FlowEngineConstant.STATUS_CLAIM);
-		buildFlowTaskList(bladeFlow, flowList, claimRoleWithTenantIdQuery, FlowEngineConstant.STATUS_CLAIM);
-		buildFlowTaskList(bladeFlow, flowList, claimRoleWithoutTenantIdQuery, FlowEngineConstant.STATUS_CLAIM);
+		buildFlowTaskList(bladeFlow, flowList, claimUserQuery, FlowEngineConstant.STATUS_CLAIM, page);
+		buildFlowTaskList(bladeFlow, flowList, claimRoleWithTenantIdQuery, FlowEngineConstant.STATUS_CLAIM, page);
+		buildFlowTaskList(bladeFlow, flowList, claimRoleWithoutTenantIdQuery, FlowEngineConstant.STATUS_CLAIM, page);
 
 		// 璁$畻鎬绘暟
 		long count = claimUserQuery.count() + claimRoleWithTenantIdQuery.count() + claimRoleWithoutTenantIdQuery.count();
@@ -107,7 +107,7 @@
 			.includeProcessVariables().orderByTaskCreateTime().desc();
 
 		// 鏋勫缓鍒楄〃鏁版嵁
-		buildFlowTaskList(bladeFlow, flowList, todoQuery, FlowEngineConstant.STATUS_TODO);
+		buildFlowTaskList(bladeFlow, flowList, todoQuery, FlowEngineConstant.STATUS_TODO,page);
 
 		// 璁$畻鎬绘暟
 		long count = todoQuery.count();
@@ -299,8 +299,9 @@
 	 * @param flowList  娴佺▼鍒楄〃
 	 * @param taskQuery 浠诲姟鏌ヨ绫�
 	 * @param status    鐘舵��
+	 * @param page
 	 */
-	private void buildFlowTaskList(BladeFlow bladeFlow, List<BladeFlow> flowList, TaskQuery taskQuery, String status) {
+	private void buildFlowTaskList(BladeFlow bladeFlow, List<BladeFlow> flowList, TaskQuery taskQuery, String status, IPage<BladeFlow> page) {
 //		if (bladeFlow.getCategory() != null) {
 		if (StringUtils.isNotEmpty(bladeFlow.getCategory())) {
 			taskQuery.processCategoryIn(Func.toStrList(bladeFlow.getCategory()));
@@ -314,7 +315,9 @@
 		if (bladeFlow.getEndDate() != null) {
 			taskQuery.taskCreatedBefore(bladeFlow.getEndDate());
 		}
-		taskQuery.list().forEach(task -> {
+		int firstResult = (int) ((page.getCurrent()-1)* page.getSize());
+		int maxResult = (int) page.getSize();
+		taskQuery.listPage(firstResult,maxResult).forEach(task -> {
 			BladeFlow flow = new BladeFlow();
 			flow.setTaskId(task.getId());
 			flow.setTaskDefinitionKey(task.getTaskDefinitionKey());
diff --git a/Source/UBCS/ubcs-ops/ubcs-flow/src/main/java/com/vci/ubcs/flow/engine/service/impl/VCIFlowserviceImpl.java b/Source/UBCS/ubcs-ops/ubcs-flow/src/main/java/com/vci/ubcs/flow/engine/service/impl/VCIFlowserviceImpl.java
index 4a1ea85..731fb62 100644
--- a/Source/UBCS/ubcs-ops/ubcs-flow/src/main/java/com/vci/ubcs/flow/engine/service/impl/VCIFlowserviceImpl.java
+++ b/Source/UBCS/ubcs-ops/ubcs-flow/src/main/java/com/vci/ubcs/flow/engine/service/impl/VCIFlowserviceImpl.java
@@ -19,14 +19,17 @@
 import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
 import com.vci.ubcs.flow.core.constant.ProcessConstant;
 import com.vci.ubcs.flow.core.dto.FlowTaskDTO;
+import com.vci.ubcs.flow.core.dto.ProcessStageAttrDTO;
 import com.vci.ubcs.flow.core.entity.BladeFlow;
 import com.vci.ubcs.flow.core.entity.FlowTaskUser;
+import com.vci.ubcs.flow.core.entity.ProcessStageAttr;
 import com.vci.ubcs.flow.core.utils.TaskUtil;
 import com.vci.ubcs.flow.engine.entity.*;
 import com.vci.ubcs.flow.engine.service.FlowEngineService;
 import com.vci.ubcs.flow.engine.service.FlowTaskUserService;
 import com.vci.ubcs.flow.engine.service.ProcessStageAttrService;
 import com.vci.ubcs.flow.engine.service.VICFlowService;
+import com.vci.ubcs.starter.web.util.BeanUtil;
 import lombok.AllArgsConstructor;
 import lombok.extern.slf4j.Slf4j;
 import org.apache.commons.lang3.StringUtils;
@@ -232,6 +235,22 @@
 			flowTaskDTO.setVariables(variables);
 		}
 
+		//娴佺▼闃舵
+		Map<String, Object> m = new HashMap<>();
+		String templateId = variables.get("templateId").toString();
+		m.put("template_id", templateId);
+		m.put("task_id", crruentActivityId);
+		m.put("model_key", modelKey);
+		QueryWrapper q = Condition.getQueryWrapper(m, ProcessStageAttr.class)
+			.select("attr_id attrId,attr_name attrName,attr_group attrGroup");
+		List<ProcessStageAttr> stageAttrs = processStageAttrService.list(q);
+		List<ProcessStageAttrDTO> stageAttrsDto = new ArrayList<>();
+		stageAttrs.stream().forEach(e->{
+			ProcessStageAttrDTO dto = new ProcessStageAttrDTO();
+			BeanUtil.convert(e,dto);
+			stageAttrsDto.add(dto);
+		});
+		flowTaskDTO.setStageAttrs(stageAttrsDto);
 
 		//鏀惧叆娴佺▼闃舵銆佹祦绋媘odelkey
 		variables.put(TASKID,crruentActivityId);

--
Gitblit v1.9.3