Sfoglia il codice sorgente

@IPU_FIXBUG_2022@调整服务逻辑流模板、testcase

weihf 3 anni fa
parent
commit
2f43bcb8e0

+ 32 - 1
qb-auth-server/pom.xml

@ -41,6 +41,7 @@
41 41
    </repositories>
42 42
43 43
    <properties>
44
        <env>dev</env>
44 45
        <start-class>com.ipu.logicflow.server.LogicflowServerStart</start-class>
45 46
        <spring-boot>2.3.1.RELEASE</spring-boot>
46 47
        <ipu>3.3-SNAPSHOT</ipu>
@ -104,11 +105,41 @@
104 105
            <artifactId>mvel2</artifactId>
105 106
            <version>2.4.12.Final</version>
106 107
        </dependency>
108
        <dependency>
109
			<groupId>org.springframework.boot</groupId>
110
			<artifactId>spring-boot-starter-log4j2</artifactId>
111
			<exclusions>
112
				<exclusion>
113
					<groupId>org.apache.logging.log4j</groupId>
114
					<artifactId>log4j-core</artifactId>
115
				</exclusion>
116
				<exclusion>
117
					<groupId>org.apache.logging.log4j</groupId>
118
					<artifactId>log4j-api</artifactId>
119
				</exclusion>
120
				<exclusion>
121
					<groupId>org.apache.logging.log4j</groupId>
122
					<artifactId>log4j-slf4j-impl</artifactId>
123
				</exclusion>
124
			</exclusions>
125
		</dependency>
126
		<dependency>
127
			<groupId>org.apache.logging.log4j</groupId>
128
			<artifactId>log4j-slf4j-impl</artifactId>
129
		</dependency>
130
        <!--log4j2核心包-->
131
		<dependency>
132
			<groupId>org.apache.logging.log4j</groupId>
133
			<artifactId>log4j-api</artifactId>
134
		</dependency>
135
		<dependency>
136
			<groupId>org.apache.logging.log4j</groupId>
137
			<artifactId>log4j-core</artifactId>
138
		</dependency>
107 139
    </dependencies>
108 140
109 141
    <build>
110 142
        <plugins>
111
            <!-- ==========应用包和依赖包分离的打包方法================ -->
112 143
            <plugin>
113 144
                <groupId>org.apache.maven.plugins</groupId>
114 145
                <artifactId>maven-resources-plugin</artifactId>

+ 6 - 0
qb-auth-server/src/main/java/com/ipu/logicflow/server/util/LogicFlowConfig.java

@ -55,6 +55,12 @@ public class LogicFlowConfig {
55 55
		flowPathMap.put("user_insert", "flow/user/user_insert.xml");
56 56
		flowPathMap.put("user_select", "flow/user/user_select.xml");
57 57
		flowPathMap.put("user_select_by_name", "flow/user/user_select_by_name.xml");
58
		flowPathMap.put("user_select_by_cond", "flow/user/user_select_by_cond.xml");
59
		flowPathMap.put("user_update_by_cond", "flow/user/user_update_by_cond.xml");
60
		flowPathMap.put("user_update", "flow/user/user_update.xml");
61
		flowPathMap.put("user_disable_with_aggregate", "flow/user/user_disable_with_aggregate.xml");
62
63
		
58 64
		flowPathMap.put("organize_select", "flow/org/organize_select.xml");
59 65
60 66
		Iterator<String> it = flowPathMap.values().iterator();

+ 10 - 10
qb-auth-server/src/main/resources/flow/menu/model/sec_menu.xml

@ -18,16 +18,16 @@
18 18
    <attr id="create_date" type="datetime" name="创建日期"/>
19 19
    <attr id="done_date" type="datetime" name="操作日期"/>
20 20
    <attr id="op_id" type="string" name="操作人员"/>
21
    <attr id="valid_date" type="datetime" name="操作人员"/>
22
    <attr id="expire_date" type="datetime" name="操作人员"/>
23
    <attr id="create_op_id" type="string" name="操作人员"/>
24
    <attr id="create_org_id" type="string" name="操作人员"/>
25
    <attr id="done_code" type="int" name="操作人员"/>
26
    <attr id="org_id" type="string" name="操作人员"/>
27
    <attr id="mgmt_district" type="string" name="操作人员"/>
28
    <attr id="mgmt_county" type="string" name="操作人员"/>
29
    <attr id="region_id" type="string" name="操作人员"/>
30
    <attr id="tenant_code" type="string" name="操作人员"/>
21
	<attr id="valid_date" type="datetime" name="生效日期"  />
22
	<attr id="expire_date" type="datetime" name="失效日期"  />
23
	<attr id="create_op_id" type="string" name="创建人员"  />
24
	<attr id="create_org_id" type="string" name="创建组织"  />
25
    <attr id="done_code" type="int" name="事务编号"/>
26
	<attr id="org_id" type="string" name="操作组织"  />
27
	<attr id="mgmt_district" type="string" name="管理地区"  />
28
	<attr id="mgmt_county" type="string" name="管理国家"  />
29
	<attr id="region_id" type="string" name="区域ID"  />
30
	<attr id="tenant_code" type="string" name="租户编码"  />
31 31
    
32 32
    <behavior id="insertMenu" name="新增菜单信息">
33 33
        <function domain="DB" name="insert">

+ 1 - 0
qb-auth-server/src/main/resources/flow/menu/model/sec_priv_entity.xml

@ -16,6 +16,7 @@
16 16
    <attr id="create_op_id" type="string" name="创建人员"/>
17 17
    <attr id="create_org_id" type="string" name="操作人员"/>
18 18
    <attr id="done_date" type="datetime" name="操作日期"/>
19
    <attr id="done_code" type="int" name="事务编号"/>
19 20
    <attr id="op_id" type="string" name="操作人员"/>
20 21
    <attr id="org_id" type="string" name="操作人员"/>
21 22
    <attr id="mgmt_district" type="string" name="操作人员"/>

+ 12 - 11
qb-auth-server/src/main/resources/flow/org/model/sec_org_user_rel.xml

@ -3,20 +3,21 @@
3 3
	<attr id="org_user_rel_id" type="int" name="角色关联用户标识" />
4 4
	<attr id="user_id" type="int" name="用户标识" />
5 5
	<attr id="organize_id" type="int" name="角色标识" />
6
	<attr id="valid_date" type="datetime" name="生效日期" exists="false" />
7
	<attr id="expire_date" type="datetime" name="失效日期" exists="false" />
6
	<attr id="valid_date" type="datetime" name="生效日期"  />
7
	<attr id="expire_date" type="datetime" name="失效日期"  />
8 8
	<attr id="data_status" type="string" name="数据状态" />
9 9
	<attr id="create_date" type="datetime" name="创建日期" />
10
	<attr id="create_op_id" type="string" name="创建人员" exists="false" />
11
	<attr id="create_org_id" type="string" name="创建组织" exists="false" />
12
	<attr id="done_code" type="datetime" name="事务编号" exists="false" />
13
	<attr id="done_date" type="datetime" name="操作日期" exists="false" />
10
	<attr id="create_op_id" type="string" name="创建人员"  />
11
	<attr id="create_org_id" type="string" name="创建组织"  />
12
	<attr id="done_code" type="int" name="事务编号"  />
13
	<attr id="done_date" type="datetime" name="操作日期"  />
14 14
	<attr id="op_id" type="string" name="操作人员" />
15
	<attr id="org_id" type="string" name="操作组织" exists="false" />
16
	<attr id="mgmt_district" type="string" name="管理地区" exists="false" />
17
	<attr id="mgmt_county" type="string" name="管理国家" exists="false" />
18
	<attr id="region_id" type="string" name="区域ID" exists="false" />
19
	<attr id="tenant_code" type="string" name="租户编码" exists="false" />
15
	<attr id="org_id" type="string" name="操作组织"  />
16
	<attr id="mgmt_district" type="string" name="管理地区"  />
17
	<attr id="mgmt_county" type="string" name="管理国家"  />
18
	<attr id="region_id" type="string" name="区域ID"  />
19
	<attr id="tenant_code" type="string" name="租户编码"  />
20
	
20 21
	<behavior id="insertOrgUserRel" name="新增用户组织信息">
21 22
		<function domain="DB" name="insert">
22 23
			<param value="auth" type="string" />

+ 8 - 1
qb-auth-server/src/main/resources/flow/org/model/sec_organize.xml

@ -17,7 +17,14 @@
17 17
    <attr id="create_op_id" type="string" name="创建人员"/>
18 18
    <attr id="done_date" type="datetime" name="操作日期"/>
19 19
    <attr id="op_id" type="string" name="操作人员"/>
20
20
    <attr id="done_code" type="int" name="事务编号"  />
21
    <attr id="create_org_id" type="string" name="创建组织"  />
22
	<attr id="org_id" type="string" name="操作组织"  />
23
	<attr id="mgmt_district" type="string" name="管理地区"  />
24
	<attr id="mgmt_county" type="string" name="管理国家"  />
25
	<attr id="region_id" type="string" name="区域ID"  />
26
	<attr id="tenant_code" type="string" name="租户编码"  />
27
	
21 28
    <behavior id="insertOrganize" name="新增组织信息">
22 29
        <function domain="DB" name="insert">
23 30
            <param value="auth" type="string"/>

+ 1 - 1
qb-auth-server/src/main/resources/flow/role/model/sec_role_grant.xml

@ -10,7 +10,7 @@
10 10
    <attr id="create_date" type="datetime" name="创建日期"/>
11 11
    <attr id="create_op_id" type="string" name="创建人员"/>
12 12
    <attr id="create_org_id" type="string" name="创建组织"/>
13
    <attr id="done_code" type="datetime"    name="操作编码"/>
13
    <attr id="done_code" type="int"    name="事务编号"/>
14 14
    <attr id="done_date" type="datetime"    name="操作日期"/>
15 15
    <attr id="op_id" type="string" name="操作人员"/>
16 16
    <attr id="org_id" type="string" name="操作组织"/>

+ 9 - 2
qb-auth-server/src/main/resources/flow/user/model/sec_user.xml

@ -19,12 +19,19 @@
19 19
    <attr id="valid_date" type="datetime" name="生效日期"/>
20 20
    <attr id="expire_date" type="datetime" name="失效日期"/>
21 21
    <attr id="data_status" type="string" name="数据状态"/>
22
    <attr id="valid_date" type="datetime" name="生效日期"/>
23 22
    <attr id="create_date" type="datetime" name="创建日期"/>
24 23
    <attr id="create_op_id" type="string" name="创建人员"/>
25 24
    <attr id="done_date" type="datetime"    name="操作日期"/>
26 25
    <attr id="op_id" type="string" name="操作人员"/>
27
26
    <attr id="create_org_id" type="string" name="创建组织"/>
27
    <attr id="done_code" type="int"    name="事务编号"/>
28
    <attr id="org_id" type="string" name="操作组织"/>
29
    <attr id="mgmt_district" type="string" name="管理地区"/>
30
    <attr id="mgmt_county" type="string" name="管理国家"/>
31
    <attr id="region_id" type="string" name="区域ID"/>
32
    <attr id="tenant_code" type="string" name="租户编码"/>
33
    <attr id="susername" type="string" name="susername"/>
34
    
28 35
    <behavior id="insertUser" name="新增用户信息">
29 36
        <function domain="DB" name="insert">
30 37
            <param value="auth" type="string"/>

+ 1 - 1
qb-auth-server/src/main/resources/flow/user/user_insert.xml

@ -8,7 +8,7 @@
8 8
    </declare>
9 9
10 10
    <start id="start" name="开始节点" next="insertUser">
11
        <var key="user" model="sec_user"/>
11
        <var key="user" model="sec_user" attrExists="false"/>
12 12
    </start>
13 13
14 14
    <!--<action id="aggregateUser" name="聚合用户信息" next="insertUser">

+ 32 - 0
qb-auth-server/src/main/resources/flow/user/user_select_by_cond.xml

@ -0,0 +1,32 @@
1
<?xml version="1.0" encoding="UTF-8"?>
2
<logic-flow id="user_select_by_cond"
3
            name="用户查询"
4
            desc="用户查询">
5
    <declare>
6
        <!-- 引入model定义 -->
7
        <import model="sec_user"/>
8
    </declare>
9
10
    <start id="start" name="开始节点" next="selectUserByCond">
11
        <var key="user_cond" model="sec_user" attrExists="false"/>
12
    </start>
13
14
    <action id="selectUserByCond" name="查询用户" next="end">
15
        <input>
16
            <var key="user_cond" />
17
        </input>
18
        <function domain="DB" name="selectByCond">
19
            <param value="auth" type="string"/>
20
            <param value="sec_user" type="string"/>
21
            <param key="user_cond" type="map"/>
22
            <param value="uppercase" type="string"/>
23
        </function>
24
        <output>
25
            <var key="user_info"/>
26
        </output>
27
    </action>
28
29
    <end id="end" name="结束节点">
30
        <var key="user_info"/>
31
    </end>
32
</logic-flow>

+ 0 - 37
qb-auth-server/src/main/resources/flow/user/user_select_by_id.xml

@ -1,37 +0,0 @@
1
<?xml version="1.0" encoding="UTF-8"?>
2
<logic-flow id="user_select_by_id"
3
            name="用户查询"
4
            desc="用户查询">
5
    <declare>
6
        <!-- 引入model定义 -->
7
        <import model="sec_user"/>
8
    </declare>
9
10
    <start id="start" name="开始节点" next="aggregateUser">
11
        <var key="user_id" model="sec_user" attr="user_id"/>
12
    </start>
13
14
    <action id="aggregateUser" name="聚合用户信息" next="selectUser">
15
        <input>
16
            <var key="user_id" />
17
        </input>
18
        <aggregate />
19
        <output>
20
            <var key="user"/>
21
        </output>
22
    </action>
23
24
    <action id="selectUser" name="查询用户" next="end">
25
        <input>
26
            <var key="user" model="sec_user" attrExists="false"/>
27
        </input>
28
        <behavior model="sec_user" id="selectUser"/>
29
        <output>
30
            <var key="user_info"/>
31
        </output>
32
    </action>
33
34
    <end id="end" name="结束节点">
35
        <var key="user_info"/>
36
    </end>
37
</logic-flow>

+ 7 - 4
qb-auth-server/src/test/java/com/ipu/logicflow/server/UserTest.java

@ -55,11 +55,14 @@ public class UserTest {
55 55
    }
56 56
57 57
    @Test
58
    public void testSelectUserById() {
58
    public void testSelectUserByCond() {
59 59
        JMap param = new JsonMap();
60
        param.put("user_id", "308075");
60
        JSONObject user = new JSONObject();
61
//        user.put("user_id", "308075");
62
        user.put("data_status", "0");
63
        param.put("user_cond", user);
61 64
        try{
62
            JMap result = LogicFlowEngine.execute("user_select_by_id", param);
65
            JMap result = LogicFlowEngine.execute("user_select_by_cond", param);
63 66
            System.out.println("执行结果:" + result);
64 67
            Assert.assertTrue(true);
65 68
        }catch (Exception e){
@ -309,7 +312,7 @@ public class UserTest {
309 312
        String[] flows = {
310 313
                "flow/user/user_insert.xml",
311 314
                "flow/user/user_select.xml",
312
                "flow/user/user_select_by_id.xml",
315
                "flow/user/user_select_by_cond.xml",
313 316
                "flow/user/user_select_by_name.xml",
314 317
                "flow/user/user_update_by_cond.xml",
315 318
                "flow/user/user_update.xml",