diff --git a/doc/数据权限控制/gen_tree.py b/doc/数据权限控制/gen_tree.py new file mode 100644 index 00000000..ad709e0a --- /dev/null +++ b/doc/数据权限控制/gen_tree.py @@ -0,0 +1,64 @@ +import csv +import io + +# Read file +with open(r'D:\EnforcementCodeProject\CodeV2\EnforcementCode-2.0\doc\数据权限控制\原始数据.csv', 'r', encoding='utf-8') as f: + content = f.read() + +# Parse paths from CSV, store vir_id and vir_zone for each path endpoint +path_info = {} # path -> (vir_id, vir_zone) +reader = csv.reader(io.StringIO(content)) +for row in reader: + if len(row) >= 8: + path = row[6].strip() + vir_id = row[0].strip() + vir_zone = row[4].strip() + if path and path.startswith('深圳市'): + path_info[path] = (vir_id, vir_zone) + +# Build tree - store children as ordered dict +tree = {} +for path in sorted(path_info.keys()): + parts = path.split('/') + node = tree + for part in parts: + if part not in node: + node[part] = {} + node = node[part] + +# Build a lookup: full_path -> (vir_id, vir_zone) for each node +# We need to map each node in the tree to its path to find info +node_info = {} # tuple of path parts -> (vir_id, vir_zone) +for path, info in path_info.items(): + parts = tuple(path.split('/')) + node_info[parts] = info + +# Generate ASCII tree +lines = [] + +def render_tree(node, prefix='', is_root=True, path_parts=()): + keys = sorted(node.keys()) + for i, key in enumerate(keys): + is_last_item = (i == len(keys) - 1) + current_path = path_parts + (key,) + # Get info suffix + info = node_info.get(current_path) + suffix = f'({info[0]})({info[1]})' if info else '' + + if is_root: + lines.append(key + suffix) + render_tree(node[key], '', False, current_path) + else: + connector = '└── ' if is_last_item else '├── ' + lines.append(prefix + connector + key + suffix) + extension = ' ' if is_last_item else '│ ' + render_tree(node[key], prefix + extension, False, current_path) + +render_tree(tree) + +# Write output +output = '# 树型执法单位\n\n```\n' + '\n'.join(lines) + '\n```\n' +with open(r'D:\EnforcementCodeProject\CodeV2\EnforcementCode-2.0\doc\数据权限控制\树型执法单位.md', 'w', encoding='utf-8') as f: + f.write(output) + +print(f'Done! Total paths: {len(path_info)}, Total lines: {len(lines)}') diff --git a/doc/数据权限控制/run.bat b/doc/数据权限控制/run.bat new file mode 100644 index 00000000..5099557d --- /dev/null +++ b/doc/数据权限控制/run.bat @@ -0,0 +1,2 @@ +@echo off +python "D:\EnforcementCodeProject\CodeV2\EnforcementCode-2.0\doc\数据权限控制\gen_tree.py" diff --git a/doc/部署说明/img.png b/doc/部署说明/img.png new file mode 100644 index 00000000..adcff0de Binary files /dev/null and b/doc/部署说明/img.png differ diff --git a/doc/部署说明/img_1.png b/doc/部署说明/img_1.png new file mode 100644 index 00000000..513a62ad Binary files /dev/null and b/doc/部署说明/img_1.png differ diff --git a/doc/部署说明/img_2.png b/doc/部署说明/img_2.png new file mode 100644 index 00000000..513a62ad Binary files /dev/null and b/doc/部署说明/img_2.png differ diff --git a/zdxt-modules/zdxt-enforcement-code-common/src/main/java/org/dromara/Main.java b/zdxt-modules/zdxt-enforcement-code-common/src/main/java/org/dromara/Main.java new file mode 100644 index 00000000..7a72da2c --- /dev/null +++ b/zdxt-modules/zdxt-enforcement-code-common/src/main/java/org/dromara/Main.java @@ -0,0 +1,17 @@ +package org.dromara; + +//TIP To Run code, press or +// click the icon in the gutter. +public class Main { + public static void main(String[] args) { + //TIP Press with your caret at the highlighted text + // to see how IntelliJ IDEA suggests fixing it. + System.out.printf("Hello and welcome!"); + + for (int i = 1; i <= 5; i++) { + //TIP Press to start debugging your code. We have set one breakpoint + // for you, but you can always add more by pressing . + System.out.println("i = " + i); + } + } +} \ No newline at end of file