This is an automated email from the ASF dual-hosted git repository.

leonbao pushed a commit to branch json_split
in repository https://gitbox.apache.org/repos/asf/incubator-dolphinscheduler.git


The following commit(s) were added to refs/heads/json_split by this push:
     new f24ecff  [Feature][jsonsplit]add mapper module ut and some bugfix 
(#4957)
f24ecff is described below

commit f24ecff840da133e1ef1d26ff6bf27c2fb112737
Author: Simon <[email protected]>
AuthorDate: Sat Mar 6 14:25:00 2021 +0800

    [Feature][jsonsplit]add mapper module ut and some bugfix (#4957)
    
    * Modify Project and ProjectUser Mapper
    
    * Modify Project and ProjectUser Mapper
    
    * project_code is bigint(20)
    
    * modify ERROR name
    
    * modify saveProcessDefine, remove the duplicate code with 
createTaskAndRelation
    
    * modify import/export processdefinition, add genProcessData
    
    * fix ut and bug
    
    * code style
    
    * repalce project_id with code
    
    * conflicts solve
    
    * conflicts solve
    
    * conflicts solve
    
    * bugfix
    
    * modify listResources mothod and remove getResourceIds mothod
    
    * 1
    
    * conflicts solve
    
    * modify listResources mothod and remove getResourceIds mothod
    
    * modify listResources mothod and remove getResourceIds mothod
    
    * replace processDefinitionVersion with processDefinitionLog
    
    * codestyle
    
    * codestyle
    
    * add mapper module ut
    
    * codestyle
---
 .../dao/entity/ProcessTaskRelation.java            |  20 +--
 .../dao/entity/ProcessTaskRelationLog.java         |   4 +-
 .../dao/mapper/ProcessTaskRelationMapper.java      |   2 +-
 .../dao/mapper/ProcessDefinitionLogMapper.xml      |   2 +-
 .../dao/mapper/ProcessTaskRelationMapper.xml       |   5 +-
 .../dao/mapper/ProcessDefinitionLogMapperTest.java | 174 +++++++++++++++++++++
 .../mapper/ProcessTaskRelationLogMapperTest.java   |  71 +++++++++
 .../dao/mapper/ProcessTaskRelationMapperTest.java  |  94 +++++++++++
 .../service/process/ProcessService.java            |  12 +-
 9 files changed, 361 insertions(+), 23 deletions(-)

diff --git 
a/dolphinscheduler-dao/src/main/java/org/apache/dolphinscheduler/dao/entity/ProcessTaskRelation.java
 
b/dolphinscheduler-dao/src/main/java/org/apache/dolphinscheduler/dao/entity/ProcessTaskRelation.java
index 9633abe..9c04a67 100644
--- 
a/dolphinscheduler-dao/src/main/java/org/apache/dolphinscheduler/dao/entity/ProcessTaskRelation.java
+++ 
b/dolphinscheduler-dao/src/main/java/org/apache/dolphinscheduler/dao/entity/ProcessTaskRelation.java
@@ -73,7 +73,7 @@ public class ProcessTaskRelation {
     /**
      * pre node version
      */
-    private int preNodeVersion;
+    private int preTaskVersion;
 
     /**
      * post task code
@@ -83,7 +83,7 @@ public class ProcessTaskRelation {
     /**
      * post node version
      */
-    private int postNodeVersion;
+    private int postTaskVersion;
 
     /**
      * condition type
@@ -259,19 +259,19 @@ public class ProcessTaskRelation {
         this.conditionType = conditionType;
     }
 
-    public int getPreNodeVersion() {
-        return preNodeVersion;
+    public int getPreTaskVersion() {
+        return preTaskVersion;
     }
 
-    public void setPreNodeVersion(int preNodeVersion) {
-        this.preNodeVersion = preNodeVersion;
+    public void setPreTaskVersion(int preTaskVersion) {
+        this.preTaskVersion = preTaskVersion;
     }
 
-    public int getPostNodeVersion() {
-        return postNodeVersion;
+    public int getPostTaskVersion() {
+        return postTaskVersion;
     }
 
-    public void setPostNodeVersion(int postNodeVersion) {
-        this.postNodeVersion = postNodeVersion;
+    public void setPostTaskVersion(int postTaskVersion) {
+        this.postTaskVersion = postTaskVersion;
     }
 }
diff --git 
a/dolphinscheduler-dao/src/main/java/org/apache/dolphinscheduler/dao/entity/ProcessTaskRelationLog.java
 
b/dolphinscheduler-dao/src/main/java/org/apache/dolphinscheduler/dao/entity/ProcessTaskRelationLog.java
index 812c501..36e67a6 100644
--- 
a/dolphinscheduler-dao/src/main/java/org/apache/dolphinscheduler/dao/entity/ProcessTaskRelationLog.java
+++ 
b/dolphinscheduler-dao/src/main/java/org/apache/dolphinscheduler/dao/entity/ProcessTaskRelationLog.java
@@ -51,9 +51,9 @@ public class ProcessTaskRelationLog extends 
ProcessTaskRelation {
         
this.setProcessDefinitionVersion(processTaskRelation.getProcessDefinitionVersion());
         this.setProjectCode(processTaskRelation.getProjectCode());
         this.setPreTaskCode(processTaskRelation.getPreTaskCode());
-        this.setPreNodeVersion(processTaskRelation.getPreNodeVersion());
+        this.setPreTaskVersion(processTaskRelation.getPreTaskVersion());
         this.setPostTaskCode(processTaskRelation.getPostTaskCode());
-        this.setPostNodeVersion(processTaskRelation.getPostNodeVersion());
+        this.setPostTaskVersion(processTaskRelation.getPostTaskVersion());
         this.setConditionType(processTaskRelation.getConditionType());
         this.setConditionParams(processTaskRelation.getConditionParams());
         
this.setConditionParamList(processTaskRelation.getConditionParamList());
diff --git 
a/dolphinscheduler-dao/src/main/java/org/apache/dolphinscheduler/dao/mapper/ProcessTaskRelationMapper.java
 
b/dolphinscheduler-dao/src/main/java/org/apache/dolphinscheduler/dao/mapper/ProcessTaskRelationMapper.java
index 5e5fd31..9330d2c 100644
--- 
a/dolphinscheduler-dao/src/main/java/org/apache/dolphinscheduler/dao/mapper/ProcessTaskRelationMapper.java
+++ 
b/dolphinscheduler-dao/src/main/java/org/apache/dolphinscheduler/dao/mapper/ProcessTaskRelationMapper.java
@@ -47,7 +47,7 @@ public interface ProcessTaskRelationMapper extends 
BaseMapper<ProcessTaskRelatio
      * @param taskCodes taskCode list
      * @return ProcessTaskRelation
      */
-    List<ProcessTaskRelation> queryByTaskCodes(@Param("taskCodes") 
Collection<Long> taskCodes);
+    List<ProcessTaskRelation> queryByTaskCodes(@Param("taskCodes") Long[] 
taskCodes);
 
     /**
      * process task relation by taskCode
diff --git 
a/dolphinscheduler-dao/src/main/resources/org/apache/dolphinscheduler/dao/mapper/ProcessDefinitionLogMapper.xml
 
b/dolphinscheduler-dao/src/main/resources/org/apache/dolphinscheduler/dao/mapper/ProcessDefinitionLogMapper.xml
index 436a668..401e458 100644
--- 
a/dolphinscheduler-dao/src/main/resources/org/apache/dolphinscheduler/dao/mapper/ProcessDefinitionLogMapper.xml
+++ 
b/dolphinscheduler-dao/src/main/resources/org/apache/dolphinscheduler/dao/mapper/ProcessDefinitionLogMapper.xml
@@ -40,7 +40,7 @@
         select
         <include refid="baseSql"/>
         from t_ds_process_definition_log
-        WHERE pd.code = #{processDefinitionCode}
+        WHERE code = #{processDefinitionCode}
     </select>
     <select id="queryByDefinitionCodeAndVersion"
             
resultType="org.apache.dolphinscheduler.dao.entity.ProcessDefinitionLog">
diff --git 
a/dolphinscheduler-dao/src/main/resources/org/apache/dolphinscheduler/dao/mapper/ProcessTaskRelationMapper.xml
 
b/dolphinscheduler-dao/src/main/resources/org/apache/dolphinscheduler/dao/mapper/ProcessTaskRelationMapper.xml
index 2e4ff4c..963f6b4 100644
--- 
a/dolphinscheduler-dao/src/main/resources/org/apache/dolphinscheduler/dao/mapper/ProcessTaskRelationMapper.xml
+++ 
b/dolphinscheduler-dao/src/main/resources/org/apache/dolphinscheduler/dao/mapper/ProcessTaskRelationMapper.xml
@@ -34,7 +34,7 @@
         <include refid="baseSql"/>
         from t_ds_process_task_relation
         WHERE pre_task_code = #{taskCode}
-        <if test="postTaskCode != 0">
+        <if test="taskCode != 0">
             or post_task_code = #{taskCode}
         </if>
     </select>
@@ -44,7 +44,7 @@
         from t_ds_process_task_relation
         WHERE 1 = 1
         <if test="taskCodes != null and taskCodes.length != 0">
-            (and pre_task_code in
+            and pre_task_code in
             <foreach collection="taskCodes" index="index" item="i" open="(" 
separator="," close=")">
                 #{i}
             </foreach>
@@ -52,7 +52,6 @@
             <foreach collection="taskCodes" index="index" item="i" open="(" 
separator="," close=")">
                 #{i}
             </foreach>
-            )
         </if>
     </select>
     <delete id="deleteByCode">
diff --git 
a/dolphinscheduler-dao/src/test/java/org/apache/dolphinscheduler/dao/mapper/ProcessDefinitionLogMapperTest.java
 
b/dolphinscheduler-dao/src/test/java/org/apache/dolphinscheduler/dao/mapper/ProcessDefinitionLogMapperTest.java
new file mode 100644
index 0000000..b294eee
--- /dev/null
+++ 
b/dolphinscheduler-dao/src/test/java/org/apache/dolphinscheduler/dao/mapper/ProcessDefinitionLogMapperTest.java
@@ -0,0 +1,174 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *    http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.dolphinscheduler.dao.mapper;
+
+import org.apache.dolphinscheduler.common.enums.UserType;
+import org.apache.dolphinscheduler.dao.entity.ProcessDefinitionLog;
+import org.apache.dolphinscheduler.dao.entity.Project;
+import org.apache.dolphinscheduler.dao.entity.User;
+
+import java.util.Date;
+import java.util.List;
+
+import org.junit.Assert;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.boot.test.context.SpringBootTest;
+import org.springframework.test.annotation.Rollback;
+import org.springframework.test.context.junit4.SpringRunner;
+import org.springframework.transaction.annotation.Transactional;
+
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+
+@RunWith(SpringRunner.class)
+@SpringBootTest
+@Transactional
+@Rollback(true)
+public class ProcessDefinitionLogMapperTest {
+    @Autowired
+    ProcessDefinitionMapper processDefinitionMapper;
+
+    @Autowired
+    UserMapper userMapper;
+
+    @Autowired
+    QueueMapper queueMapper;
+
+    @Autowired
+    TenantMapper tenantMapper;
+
+    @Autowired
+    ProjectMapper projectMapper;
+
+    @Autowired
+    ProcessDefinitionLogMapper processDefinitionLogMapper;
+
+    /**
+     * insert
+     *
+     * @return ProcessDefinition
+     */
+    private ProcessDefinitionLog insertOne() {
+        //insertOne
+        ProcessDefinitionLog processDefinitionLog = new ProcessDefinitionLog();
+        processDefinitionLog.setCode(1L);
+        processDefinitionLog.setName("def 1");
+        processDefinitionLog.setProjectCode(1L);
+        processDefinitionLog.setUserId(101);
+        processDefinitionLog.setVersion(1);
+        processDefinitionLog.setUpdateTime(new Date());
+        processDefinitionLog.setCreateTime(new Date());
+        processDefinitionLogMapper.insert(processDefinitionLog);
+        return processDefinitionLog;
+    }
+
+    /**
+     * insert
+     *
+     * @return ProcessDefinition
+     */
+    private ProcessDefinitionLog insertTwo() {
+        //insertOne
+        ProcessDefinitionLog processDefinitionLog = new ProcessDefinitionLog();
+        processDefinitionLog.setCode(1L);
+        processDefinitionLog.setName("def 2");
+        processDefinitionLog.setProjectCode(1L);
+        processDefinitionLog.setUserId(101);
+        processDefinitionLog.setVersion(2);
+
+        processDefinitionLog.setUpdateTime(new Date());
+        processDefinitionLog.setCreateTime(new Date());
+        processDefinitionLogMapper.insert(processDefinitionLog);
+        return processDefinitionLog;
+    }
+    
+    @Test
+    public void testInsert() {
+        ProcessDefinitionLog processDefinitionLog = insertOne();
+        Assert.assertNotEquals(processDefinitionLog.getId(), 0);
+    }
+
+    @Test
+    public void testQueryByDefinitionName() {
+        ProcessDefinitionLog processDefinitionLog = insertOne();
+        Project project = new Project();
+        project.setCode(1L);
+        project.setName("ut project");
+        project.setUserId(101);
+        project.setCreateTime(new Date());
+        projectMapper.insert(project);
+
+        User user = new User();
+        user.setUserName("hello");
+        user.setUserPassword("pwd");
+        user.setUserType(UserType.GENERAL_USER);
+        user.setId(101);
+        userMapper.insert(user);
+
+        List<ProcessDefinitionLog> processDefinitionLogs = 
processDefinitionLogMapper
+                .queryByDefinitionName(1L, "def 1");
+        Assert.assertEquals(0, processDefinitionLogs.size());
+
+    }
+
+    @Test
+    public void testQueryByDefinitionCode() {
+        ProcessDefinitionLog processDefinitionLog = insertOne();
+
+        List<ProcessDefinitionLog> processDefinitionLogs = 
processDefinitionLogMapper
+                .queryByDefinitionCode(1L);
+        Assert.assertNotEquals(0, processDefinitionLogs.size());
+    }
+
+    @Test
+    public void testQueryByDefinitionCodeAndVersion() {
+        ProcessDefinitionLog processDefinitionLog = insertOne();
+
+        ProcessDefinitionLog processDefinitionLogs = processDefinitionLogMapper
+                .queryByDefinitionCodeAndVersion(1L, 1);
+        Assert.assertNotEquals(null, processDefinitionLogs);
+    }
+
+    @Test
+    public void testQueryMaxVersionForDefinition() {
+        ProcessDefinitionLog processDefinitionLog = insertOne();
+        ProcessDefinitionLog processDefinitionLog1 = insertTwo();
+
+        int version = 
processDefinitionLogMapper.queryMaxVersionForDefinition(1L);
+        Assert.assertEquals(2, version);
+    }
+
+    @Test
+    public void testQueryProcessDefinitionVersionsPaging() {
+        ProcessDefinitionLog processDefinitionLog = insertOne();
+        Page<ProcessDefinitionLog> page = new Page(1, 3);
+        IPage<ProcessDefinitionLog> processDefinitionLogs = 
processDefinitionLogMapper.queryProcessDefinitionVersionsPaging(page, 1L);
+        Assert.assertNotEquals(processDefinitionLogs.getTotal(), 0);
+    }
+
+    @Test
+    public void testDeleteByProcessDefinitionCodeAndVersion() {
+        ProcessDefinitionLog processDefinitionLog = insertOne();
+        Page<ProcessDefinitionLog> page = new Page(1, 3);
+        int processDefinitionLogs = 
processDefinitionLogMapper.deleteByProcessDefinitionCodeAndVersion(1L, 1);
+        Assert.assertNotEquals(processDefinitionLogs, 0);
+    }
+
+}
diff --git 
a/dolphinscheduler-dao/src/test/java/org/apache/dolphinscheduler/dao/mapper/ProcessTaskRelationLogMapperTest.java
 
b/dolphinscheduler-dao/src/test/java/org/apache/dolphinscheduler/dao/mapper/ProcessTaskRelationLogMapperTest.java
new file mode 100644
index 0000000..c2bb3ab
--- /dev/null
+++ 
b/dolphinscheduler-dao/src/test/java/org/apache/dolphinscheduler/dao/mapper/ProcessTaskRelationLogMapperTest.java
@@ -0,0 +1,71 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *    http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.dolphinscheduler.dao.mapper;
+
+import org.apache.dolphinscheduler.dao.entity.ProcessTaskRelationLog;
+
+import java.util.Date;
+import java.util.List;
+
+import org.junit.Assert;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.boot.test.context.SpringBootTest;
+import org.springframework.test.annotation.Rollback;
+import org.springframework.test.context.junit4.SpringRunner;
+import org.springframework.transaction.annotation.Transactional;
+
+@RunWith(SpringRunner.class)
+@SpringBootTest
+@Transactional
+@Rollback(true)
+public class ProcessTaskRelationLogMapperTest {
+
+    @Autowired
+    ProcessTaskRelationLogMapper processTaskRelationLogMapper;
+
+    /**
+     * insert
+     *
+     * @return ProcessDefinition
+     */
+    private ProcessTaskRelationLog insertOne() {
+        //insertOne
+        ProcessTaskRelationLog processTaskRelationLog = new 
ProcessTaskRelationLog();
+        processTaskRelationLog.setName("def 1");
+        processTaskRelationLog.setProcessDefinitionVersion(1);
+        processTaskRelationLog.setProjectCode(1L);
+        processTaskRelationLog.setProcessDefinitionCode(1L);
+        processTaskRelationLog.setPostTaskCode(3L);
+        processTaskRelationLog.setPreTaskCode(2L);
+        processTaskRelationLog.setUpdateTime(new Date());
+        processTaskRelationLog.setCreateTime(new Date());
+        processTaskRelationLogMapper.insert(processTaskRelationLog);
+        return processTaskRelationLog;
+    }
+
+    @Test
+    public void testQueryByProcessCodeAndVersion() {
+        ProcessTaskRelationLog processTaskRelationLog = insertOne();
+        List<ProcessTaskRelationLog> processTaskRelationLogs = 
processTaskRelationLogMapper
+                .queryByProcessCodeAndVersion(1L, 1);
+        Assert.assertNotEquals(processTaskRelationLogs.size(), 0);
+    }
+
+}
diff --git 
a/dolphinscheduler-dao/src/test/java/org/apache/dolphinscheduler/dao/mapper/ProcessTaskRelationMapperTest.java
 
b/dolphinscheduler-dao/src/test/java/org/apache/dolphinscheduler/dao/mapper/ProcessTaskRelationMapperTest.java
new file mode 100644
index 0000000..8ece9fe
--- /dev/null
+++ 
b/dolphinscheduler-dao/src/test/java/org/apache/dolphinscheduler/dao/mapper/ProcessTaskRelationMapperTest.java
@@ -0,0 +1,94 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *    http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.dolphinscheduler.dao.mapper;
+
+import org.apache.dolphinscheduler.dao.entity.ProcessTaskRelation;
+
+import java.util.Date;
+import java.util.List;
+
+import org.assertj.core.util.Arrays;
+import org.junit.Assert;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.boot.test.context.SpringBootTest;
+import org.springframework.test.annotation.Rollback;
+import org.springframework.test.context.junit4.SpringRunner;
+import org.springframework.transaction.annotation.Transactional;
+
+@RunWith(SpringRunner.class)
+@SpringBootTest
+@Transactional
+@Rollback(true)
+public class ProcessTaskRelationMapperTest {
+
+    @Autowired
+    ProcessTaskRelationMapper processTaskRelationMapper;
+
+    /**
+     * insert
+     *
+     * @return ProcessDefinition
+     */
+    private ProcessTaskRelation insertOne() {
+        //insertOne
+        ProcessTaskRelation processTaskRelation = new ProcessTaskRelation();
+        processTaskRelation.setName("def 1");
+
+        processTaskRelation.setProjectCode(1L);
+        processTaskRelation.setProcessDefinitionCode(1L);
+        processTaskRelation.setPostTaskCode(3L);
+        processTaskRelation.setPreTaskCode(2L);
+        processTaskRelation.setUpdateTime(new Date());
+        processTaskRelation.setCreateTime(new Date());
+        processTaskRelationMapper.insert(processTaskRelation);
+        return processTaskRelation;
+    }
+
+    @Test
+    public void testQueryByProcessCode() {
+        ProcessTaskRelation processTaskRelation = insertOne();
+        List<ProcessTaskRelation> processTaskRelations = 
processTaskRelationMapper.queryByProcessCode(1L, 1L);
+        Assert.assertNotEquals(processTaskRelations.size(), 0);
+    }
+
+    @Test
+    public void testQueryByTaskCode() {
+        ProcessTaskRelation processTaskRelation = insertOne();
+        List<ProcessTaskRelation> processTaskRelations = 
processTaskRelationMapper.queryByTaskCode(2L);
+        Assert.assertNotEquals(processTaskRelations.size(), 0);
+    }
+
+    @Test
+    public void testQueryByTaskCodes() {
+        ProcessTaskRelation processTaskRelation = insertOne();
+
+        Long[] codes = Arrays.array(1L, 2L);
+        List<ProcessTaskRelation> processTaskRelations = 
processTaskRelationMapper.queryByTaskCodes(codes);
+        Assert.assertNotEquals(processTaskRelations.size(), 0);
+    }
+
+    @Test
+    public void testDeleteByCode() {
+        ProcessTaskRelation processTaskRelation = insertOne();
+        int i = processTaskRelationMapper.deleteByCode(1L, 1L);
+        Assert.assertNotEquals(i, 0);
+    }
+
+}
diff --git 
a/dolphinscheduler-service/src/main/java/org/apache/dolphinscheduler/service/process/ProcessService.java
 
b/dolphinscheduler-service/src/main/java/org/apache/dolphinscheduler/service/process/ProcessService.java
index 981767a..13eb726 100644
--- 
a/dolphinscheduler-service/src/main/java/org/apache/dolphinscheduler/service/process/ProcessService.java
+++ 
b/dolphinscheduler-service/src/main/java/org/apache/dolphinscheduler/service/process/ProcessService.java
@@ -354,7 +354,7 @@ public class ProcessService {
         Set<TaskDefinition> taskDefinitionSet = new HashSet<>();
         for (ProcessTaskRelationLog processTaskRelation : 
processTaskRelations) {
             if (processTaskRelation.getPostTaskCode() > 0) {
-                taskDefinitionSet.add(new 
TaskDefinition(processTaskRelation.getPostTaskCode(), 
processTaskRelation.getPostNodeVersion()));
+                taskDefinitionSet.add(new 
TaskDefinition(processTaskRelation.getPostTaskCode(), 
processTaskRelation.getPostTaskVersion()));
             }
         }
         List<TaskDefinitionLog> taskDefinitionLogs = 
taskDefinitionLogMapper.queryByTaskDefinitions(taskDefinitionSet);
@@ -2413,25 +2413,25 @@ public class ProcessService {
         Map<Long, TaskNode> taskNodeMap = new HashMap<>();
         for (ProcessTaskRelationLog processTaskRelation : 
processTaskRelations) {
             if (processTaskRelation.getPreTaskCode() > 0) {
-                taskDefinitionSet.add(new 
TaskDefinition(processTaskRelation.getPreTaskCode(), 
processTaskRelation.getPreNodeVersion()));
+                taskDefinitionSet.add(new 
TaskDefinition(processTaskRelation.getPreTaskCode(), 
processTaskRelation.getPreTaskVersion()));
             }
             if (processTaskRelation.getPostTaskCode() > 0) {
-                taskDefinitionSet.add(new 
TaskDefinition(processTaskRelation.getPostTaskCode(), 
processTaskRelation.getPostNodeVersion()));
+                taskDefinitionSet.add(new 
TaskDefinition(processTaskRelation.getPostTaskCode(), 
processTaskRelation.getPostTaskVersion()));
             }
             taskNodeMap.compute(processTaskRelation.getPostTaskCode(), (k, v) 
-> {
                 if (v == null) {
                     v = new TaskNode();
                     v.setCode(processTaskRelation.getPostTaskCode());
-                    v.setVersion(processTaskRelation.getPostNodeVersion());
+                    v.setVersion(processTaskRelation.getPostTaskVersion());
                     
v.setConditionResult(processTaskRelation.getConditionParams());
                     List<PreviousTaskNode> preTaskNodeList = new ArrayList<>();
                     if (processTaskRelation.getPreTaskCode() > 0) {
-                        preTaskNodeList.add(new 
PreviousTaskNode(processTaskRelation.getPreTaskCode(), "", 
processTaskRelation.getPreNodeVersion()));
+                        preTaskNodeList.add(new 
PreviousTaskNode(processTaskRelation.getPreTaskCode(), "", 
processTaskRelation.getPreTaskVersion()));
                     }
                     v.setPreTaskNodeList(preTaskNodeList);
                 } else {
                     List<PreviousTaskNode> preTaskDefinitionList = 
v.getPreTaskNodeList();
-                    preTaskDefinitionList.add(new 
PreviousTaskNode(processTaskRelation.getPreTaskCode(), "", 
processTaskRelation.getPreNodeVersion()));
+                    preTaskDefinitionList.add(new 
PreviousTaskNode(processTaskRelation.getPreTaskCode(), "", 
processTaskRelation.getPreTaskVersion()));
                 }
                 return v;
             });

Reply via email to