1821349743@qq.com
2023-04-28 790762dd9e9f6721d37773cfb4567dcf2f700ee1
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
package com.product.org.admin.test;
 
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
 
import com.google.common.collect.Maps;
import com.product.common.utils.HttpTest;
import com.product.core.transfer.Transactional;
import com.product.org.admin.config.CmnConst;
 
 
/**
* Copyright © 2020 LX-BASE
* @Title: LX-BASE-SERVER
* @Project: base-server-org-admin
* @Date:  2020年6月12日
* @Author: Mr.Xu
* @Description:数据策略测试管理
 */
public class SystemDataPermissionTest extends HttpTest{
    public static void main(String[] args) {
//                addDataPermission();
//            updateDataPermission();
//        deleteDataPermission();
//        listDataPermission();
//        findDataPermissionList();
//        findDataPermission();
//        findMudulesAndFunctions();
//        updateDataPermissionBasic();
        updateDataPermissionDetail();
    }
    
    public static void  listDataPermission() {
        Map<String, Object> m=new HashMap<String, Object>();
        m.put("~table~", CmnConst.PRODUCT_SYS_DATA_STRATEGY_MASTER);
        m.put("url/api", "/api/data/permission/list-data-permission/v1");
        m.put(CmnConst.PAGESIZE, 10);
        m.put(CmnConst.CPAGE, 1);
        m.put("org_level_uuid", "bc59b464-094f-4e6c-9a4a-1c1ac8671584");
        testPost(m);
    }
    public static void  findDataPermissionList() {
        Map<String, Object> m=new HashMap<String, Object>();
        m.put("~table~", CmnConst.PRODUCT_SYS_DATA_STRATEGY_MASTER);
        m.put("url/api", "/api/data/permission/find-data-permission_list/v1");
        m.put("org_level_uuid", "111ce77a-0d23-4516-b416-471840eb135d");
        m.put("date", "product_sys_data_strategy_post_onbehalf");
 
        testPost(m);
    }
 
    public static void  findDataPermission() {
        Map<String, Object> m=new HashMap<String, Object>();
        m.put("~table~", CmnConst.PRODUCT_SYS_DATA_STRATEGY_MASTER);
        m.put("url/api", "/api/data/permission/find-data-permission/v1");
        m.put("org_level_uuid", "111ce77a-0d23-4516-b416-471840eb135d");
        
        testPost(m);
    }
    
    public static void  addDataPermission() {
        Map<String, Object> m=new HashMap<String, Object>();
        m.put("~table~", "product_sys_data_strategy_master");
        m.put("url/api", "/api/data/permission/add-data-permission/v1");
        
        m.put("org_level_uuid", "111ce77a-0d23-4516-b416-471840eb135d");
        m.put("effective_start_date", "2020-06-12 15:26:09");
        m.put("effective_end_date", "2029-06-12 15:26:12");
        
        m.put("product_sys_data_strategy_post_onbehalf_is_used", 1);
        m.put("product_sys_data_strategy_same_post_grade_is_used", 1);
        m.put("product_sys_data_strategy_specified_post_toorg_is_used", 1);
        m.put("product_sys_data_strategy_specified_staff_toorg_is_used", 1);
        m.put("product_sys_data_strategy_specified_staff_topost_is_used",1);
        m.put("product_sys_data_strategy_specified_staff_tostaffs_is_used", 1);
        m.put("product_sys_data_strategy_subordinate_is_used", 0);
        
        m.put("product_sys_data_strategy_post_onbehalf_properties", "004");
        m.put("product_sys_data_strategy_same_post_grade_properties", "003");
        m.put("product_sys_data_strategy_specified_post_toorg_properties", "005");
        m.put("product_sys_data_strategy_specified_staff_toorg_properties", "008");
        m.put("product_sys_data_strategy_specified_staff_topost_properties","007");
        m.put("product_sys_data_strategy_specified_staff_tostaffs_properties", "006");
        m.put("product_sys_data_strategy_subordinate_properties", "002");
        
        List<Map<String, Object>> post_onbehalf_list=new ArrayList<Map<String,Object>>();
        m.put(CmnConst.PRODUCT_SYS_DATA_STRATEGY_POST_ONBEHALF, post_onbehalf_list);
         for (int i = 0; i < 3; i++) {
            Map<String, Object> post_onbehalf_map=new HashMap<String, Object>();
            post_onbehalf_map.put("~table~", CmnConst.PRODUCT_SYS_DATA_STRATEGY_POST_ONBEHALF);
            post_onbehalf_map.put("post_uuid", "岗位uuida");
            post_onbehalf_map.put("onbehalf_post_uuid", "岗位uuida~~~"+i);
            post_onbehalf_map.put("function_uuids", "功能uuid 集合~~~~~~"+i);
            post_onbehalf_map.put("exclude_staff_uuids", "排除人员~~~~"+i);
//            post_onbehalf_map.put("status", 1);
            post_onbehalf_list.add(post_onbehalf_map);
        }
 
         List<Map<String, Object>> same_post_grade_list=new ArrayList<Map<String,Object>>();
        m.put(CmnConst.PRODUCT_SYS_DATA_STRATEGY_SAME_POST_GRADE, same_post_grade_list);
         /*for (int i = 0; i < 5; i++) {
            Map<String, Object> same_post_grade_map=new HashMap<String, Object>();
            same_post_grade_map.put("~table~", CmnConst.PRODUCT_SYS_DATA_STRATEGY_SAME_POST_GRADE);
            same_post_grade_map.put("post_uuid", "岗位uuida"+i);
            same_post_grade_map.put("high_grade_switch", 1);
            same_post_grade_map.put("function_uuids", "功能uuid 集合~~~~~~"+i);
            same_post_grade_map.put("exclude_staff_uuids", "排除人员~~~~"+i);
            same_post_grade_map.put("status", 1);
            same_post_grade_list.add(same_post_grade_map);
        }*/
         
         List<Map<String, Object>> specified_post_toorg_list=new ArrayList<Map<String,Object>>();
        m.put(CmnConst.PRODUCT_SYS_DATA_STRATEGY_SPECIFIED_POST_TOORG, specified_post_toorg_list);
         /*for (int i = 0; i < 3; i++) {
            Map<String, Object> specified_post_toorg_map=new HashMap<String, Object>();
            specified_post_toorg_map.put("~table~", CmnConst.PRODUCT_SYS_DATA_STRATEGY_SPECIFIED_POST_TOORG);
            specified_post_toorg_map.put("post_uuid", "岗位uuida"+i);
            specified_post_toorg_map.put("org_level_uuids", "公司uuid~~    "+i);
            specified_post_toorg_map.put("function_uuids", "功能uuid 集合~~~~~~"+i);
            specified_post_toorg_map.put("exclude_staff_uuids", "排除人员~~~~"+i);
            specified_post_toorg_map.put("status", 1);
            specified_post_toorg_list.add(specified_post_toorg_map);
        }*/
         
         List<Map<String, Object>> specified_staff_toorg_list=new ArrayList<Map<String,Object>>();
        m.put(CmnConst.PRODUCT_SYS_DATA_STRATEGY_SPECIFIED_STAFF_TOORG, specified_staff_toorg_list);
         /*for (int i = 0; i < 2; i++) {
            Map<String, Object> specified_staff_toorg_map=new HashMap<String, Object>();
            specified_staff_toorg_map.put("~table~", CmnConst.PRODUCT_SYS_DATA_STRATEGY_SPECIFIED_STAFF_TOORG);
            specified_staff_toorg_map.put("staff_uuid", "staff  uuida"+i);
            specified_staff_toorg_map.put("org_level_uuids", "组织机构uuid~~"+i);
            specified_staff_toorg_map.put("function_uuids", "功能uuid 集合~~~~~~"+i);
            specified_staff_toorg_map.put("exclude_staff_uuids", "排除人员~~~~"+i);
            specified_staff_toorg_map.put("status", 1);
            specified_staff_toorg_list.add(specified_staff_toorg_map);
        }*/
         
         List<Map<String, Object>> specified_staff_topost_list=new ArrayList<Map<String,Object>>();
        m.put(CmnConst.PRODUCT_SYS_DATA_STRATEGY_SPECIFIED_STAFF_TOPOST, specified_staff_topost_list);
         /*for (int i = 0; i < 7; i++) {
            Map<String, Object> specified_staff_topost_map=new HashMap<String, Object>();
            specified_staff_topost_map.put("~table~", CmnConst.PRODUCT_SYS_DATA_STRATEGY_SPECIFIED_STAFF_TOPOST);
            specified_staff_topost_map.put("staff_uuid", "员工uuid"+i);
            specified_staff_topost_map.put("specified_post_uuids", "指定岗位~~"+i);
            specified_staff_topost_map.put("function_uuids", "功能uuid 集合~~~~~~"+i);
            specified_staff_topost_map.put("status", 1);
            specified_staff_topost_list.add(specified_staff_topost_map);
        }*/
         
         List<Map<String, Object>> specified_staff_tostaffs_list=new ArrayList<Map<String,Object>>();
        m.put(CmnConst.PRODUCT_SYS_DATA_STRATEGY_SPECIFIED_STAFF_TOSTAFFS, specified_staff_tostaffs_list);
         /*for (int i = 0; i < 6; i++) {
            Map<String, Object> specified_staff_tostaffs_map=new HashMap<String, Object>();
            specified_staff_tostaffs_map.put("~table~", CmnConst.PRODUCT_SYS_DATA_STRATEGY_SPECIFIED_STAFF_TOSTAFFS);
            specified_staff_tostaffs_map.put("staff_uuid", "员工uuida"+i);
            specified_staff_tostaffs_map.put("to_staff_uuids", "指定员工~~~~"+i);
            specified_staff_tostaffs_map.put("function_uuids", "功能uuid 集合~~~~~~"+i);
            specified_staff_tostaffs_map.put("status", 1);
            specified_staff_tostaffs_list.add(specified_staff_tostaffs_map);
        }*/
         
         List<Map<String, Object>> subordinate_list=new ArrayList<Map<String,Object>>();
        m.put(CmnConst.PRODUCT_SYS_DATA_STRATEGY_SUBORDINATE, subordinate_list);
         /*for (int i = 0; i < 6; i++) {
            Map<String, Object> subordinate_map=new HashMap<String, Object>();
            subordinate_map.put("~table~", CmnConst.PRODUCT_SYS_DATA_STRATEGY_SUBORDINATE);
            subordinate_map.put("exclude_function_uuids", "岗位uuida"+i);
//            subordinate_map.put("status", 1);
            subordinate_list.add(subordinate_map);
        }*/
        testPost(m);
    }
    @Transactional
    public static void  updateDataPermission() {
        Map<String, Object> m=new HashMap<String, Object>();
        m.put("~table~", "product_sys_data_strategy_master");
        m.put("date", "product_sys_data_strategy_subordinate");
        m.put("url/api", "/api/data/permission/update-data-permission/v1");
        
        m.put("org_level_uuid", "111ce77a-0d23-4516-b416-471840eb135d");
        m.put("property_uuid", "003");
        m.put("effective_start_date", "2020-06-12 15:26:09");
        m.put("effective_end_date", "2029-06-12 15:26:12");
        //PRODUCT_SYS_data_strategy_post_onbehalf_*/
        m.put("product_sys_data_strategy_post_onbehalf_is_used", 1);
        
        m.put("product_sys_data_strategy_post_onbehalf_properties", "004");
        m.put("product_sys_data_strategy_post_onbehalf_parent_uuid", "ce3146a7-eaa9-457e-9e6e-62ed2a9e9b65");
        
        List<Map<String, Object>> post_onbehalf_list=new ArrayList<Map<String,Object>>();
        m.put(CmnConst.PRODUCT_SYS_DATA_STRATEGY_POST_ONBEHALF, post_onbehalf_list);
         for (int i = 0; i < 1; i++) {
            Map<String, Object> post_onbehalf_map=new HashMap<String, Object>();
            post_onbehalf_map.put("~table~", "product_sys_data_strategy_post_onbehalf");/*CmnConst.PRODUCT_SYS_DATA_STRATEGY_POST_ONBEHALF*/
            post_onbehalf_map.put("post_uuid", "岗位uuida");
            post_onbehalf_map.put("uuid", "2d49e565-4441-400d-a157-77dae59e316b");
            post_onbehalf_map.put("onbehalf_post_uuid", "岗位uuida~~up~"+i);
            post_onbehalf_map.put("function_uuids", "asd");
            post_onbehalf_map.put("exclude_staff_uuids", "排除人员~~~~"+i);
            post_onbehalf_list.add(post_onbehalf_map);
        }
        testPost(m);
    }
    
    
    public static void  deleteDataPermission() {
        Map<String, Object> m=new HashMap<String, Object>();
        m.put("~table~", CmnConst.PRODUCT_SYS_DATA_STRATEGY_MASTER);
        m.put("url/api", "/api/data/permission/delete-data-permission/v1");
        m.put("org_level_uuid", "bc411def-e0e5-4ea2-ae58-e4bec8ac247e");
        
        testPost(m);
    }
    public static void  findMudulesAndFunctions() {
        Map<String, Object> m = Maps.newHashMap();
        m.put("url/api", "/api/data/permission/list-module-functions/v1");
        m.put("~table~", "product_sys_modules");
        testPost(m);
    }
 
 
    @Transactional
    public static void  updateDataPermissionBasic() {
        Map<String, Object> m=new HashMap<String, Object>();
        m.put("~table~", "product_sys_data_strategy_master");
//        m.put("date", .PRODUCT_SYS_data_strategy_subordinate");
        m.put("url/api", "/api/data/permission/update-data-permission_basics/v1");
 
        m.put("org_level_uuid", "111ce77a-0d23-4516-b416-471840eb135d");
        m.put("property_uuid", "003");
        m.put("effective_start_date", "2020-06-12 15:26:09");
        m.put("effective_end_date", "2029-06-12 15:26:12");
        /*PRODUCT_SYS_data_strategy_post_onbehalf_*/
        m.put("product_sys_data_strategy_post_onbehalf_is_used", 1);
 
        m.put("product_sys_data_strategy_post_onbehalf_properties", "004");
        m.put("uuid", "cdc89347-ae13-433a-9745-1eccfd5168e8");
 
//        List<Map<String, Object>> post_onbehalf_list=new ArrayList<Map<String,Object>>();
//        m.put(CmnConst.PRODUCT_SYS_DATA_STRATEGY_POST_ONBEHALF, post_onbehalf_list);
//        for (int i = 0; i < 1; i++) {
//            Map<String, Object> post_onbehalf_map=new HashMap<String, Object>();
//            post_onbehalf_map.put("~table~", .PRODUCT_SYS_data_strategy_post_onbehalf");/*CmnConst.PRODUCT_SYS_DATA_STRATEGY_POST_ONBEHALF*/
//            post_onbehalf_map.put("post_uuid", "岗位uuida");
//            post_onbehalf_map.put("uuid", "2d49e565-4441-400d-a157-77dae59e316b");
//            post_onbehalf_map.put("onbehalf_post_uuid", "岗位uuida~~up~"+i);
//            post_onbehalf_map.put("function_uuids", "asd");
//            post_onbehalf_map.put("exclude_staff_uuids", "排除人员~~~~"+i);
//            post_onbehalf_list.add(post_onbehalf_map);
//        }
        testPost(m);
    }
 
 
    @Transactional
    public static void  updateDataPermissionDetail() {
        Map<String, Object> m=new HashMap<String, Object>();
        m.put("~table~", "product_sys_data_strategy_same_post_grade");
//        m.put("date", .PRODUCT_SYS_data_strategy_subordinate");
        m.put("url/api", "/api/data/permission/update-data-permission_details/v1");
 
//        m.put("org_level_uuid", "111ce77a-0d23-4516-b416-471840eb135d");
//        m.put("property_uuid", "003");
//        m.put("effective_start_date", "2020-06-12 15:26:09");
//        m.put("effective_end_date", "2029-06-12 15:26:12");
//        /.PRODUCT_SYS_data_strategy_post_onbehalf_*/
//        m.put(.PRODUCT_SYS_data_strategy_post_onbehalf_is_used", 1);
//
//        m.put(.PRODUCT_SYS_data_strategy_post_onbehalf_properties", "004");
//        m.put("uuid", "cdc89347-ae13-433a-9745-1eccfd5168e8");
 
        List<Map<String, Object>> post_onbehalf_list=new ArrayList<Map<String,Object>>();
        m.put("product_sys_data_strategy_same_post_grade", post_onbehalf_list);
        for (int i = 0; i < 1; i++) {
            Map<String, Object> post_onbehalf_map=new HashMap<String, Object>();
            post_onbehalf_map.put("post_uuid", "e4dcca65-6a3a-4ae4-ac05-94aadb2b5ee7");
            post_onbehalf_map.put("uuid", "28754267-5ee9-432b-80db-1a5896fa8783");
            post_onbehalf_map.put("same_post_id", 68);
            post_onbehalf_map.put("strategy_uuid", "204ea596-50c7-41de-8215-77811bcade7a");
            post_onbehalf_map.put("high_grade_switch", 1);
//            post_onbehalf_map.put("created_by", "");
//            post_onbehalf_map.put("created_utc_datetime", "");
//            post_onbehalf_map.put("updated_by", "");
//            post_onbehalf_map.put("updated_utc_datetime", "");
//            post_onbehalf_map.put("onbehalf_post_uuid", "修改测试1111111111111");
            post_onbehalf_map.put("function_uuids", "81c4c5ae-5643-4bdb-942e-9d07743f148a,70700ecb-52e1-4314-94df-eea4df912f02,f6cd5dea-279b-44c4-8348-2708236bce20");
            post_onbehalf_map.put("exclude_staff_uuids", "456");
            post_onbehalf_map.put("status", 1);
            post_onbehalf_list.add(post_onbehalf_map);
        }
        testPost(m);
    }
}