wangxx 4 months ago
commit
1b8c87c227
7 changed files with 967 additions and 0 deletions
  1. 56 0
      .gitignore
  2. 20 0
      LICENSE
  3. 95 0
      README.md
  4. 324 0
      approval-workflow-example.md
  5. 319 0
      pom.xml
  6. 67 0
      ry.bat
  7. 86 0
      ry.sh

+ 56 - 0
.gitignore

@@ -0,0 +1,56 @@
1
+######################################################################
2
+# Build Tools
3
+
4
+.gradle
5
+/build/
6
+!gradle/wrapper/gradle-wrapper.jar
7
+
8
+target/
9
+!.mvn/wrapper/maven-wrapper.jar
10
+
11
+######################################################################
12
+# IDE
13
+
14
+### STS ###
15
+.apt_generated
16
+.classpath
17
+.factorypath
18
+.project
19
+.settings
20
+.springBeans
21
+
22
+### IntelliJ IDEA ###
23
+.idea
24
+*.iws
25
+*.iml
26
+*.ipr
27
+
28
+### JRebel ###
29
+rebel.xml
30
+
31
+### NetBeans ###
32
+nbproject/private/
33
+build/*
34
+nbbuild/
35
+dist/
36
+nbdist/
37
+.nb-gradle/
38
+
39
+######################################################################
40
+# Others
41
+*.log
42
+*.xml.versionsBackup
43
+*.swp
44
+
45
+# Node.js files
46
+node_modules/
47
+package-lock.json
48
+
49
+# Documentation and test files
50
+CLAUDE.md
51
+*.curl
52
+nul
53
+
54
+!*/build/*.java
55
+!*/build/*.html
56
+!*/build/*.xml

+ 20 - 0
LICENSE

@@ -0,0 +1,20 @@
1
+The MIT License (MIT)
2
+
3
+Copyright (c) 2018 RuoYi
4
+
5
+Permission is hereby granted, free of charge, to any person obtaining a copy of
6
+this software and associated documentation files (the "Software"), to deal in
7
+the Software without restriction, including without limitation the rights to
8
+use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
9
+the Software, and to permit persons to whom the Software is furnished to do so,
10
+subject to the following conditions:
11
+
12
+The above copyright notice and this permission notice shall be included in all
13
+copies or substantial portions of the Software.
14
+
15
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
17
+FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
18
+COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
19
+IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
20
+CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

File diff suppressed because it is too large
+ 95 - 0
README.md


+ 324 - 0
approval-workflow-example.md

@@ -0,0 +1,324 @@
1
+# 审批流框架使用示例
2
+
3
+## 概述
4
+
5
+本框架实现了一个简单而灵活的审批流系统,支持以下几种审批流程:
6
+
7
+1. **个人级别**: 无需审批,发送待办通知,点击确认知悉后归档
8
+2. **科级**: 科长选择整改班组 → 班组长填写整改详情 → 科长审批 → 质检科审批 → 归档
9
+3. **班组级**: 科长提交 → 班组长填写整改详情 → 科长审批 → 归档  
10
+4. **查获上报**: 根据提交人角色选择不同流程
11
+   - 安检员提交: 班组长审批 → 归档
12
+   - 班组长提交: 科长审批 → 归档
13
+
14
+## API 使用示例
15
+
16
+### 1. 启动个人级别审批流程
17
+
18
+```java
19
+@PostMapping("/check/personal")
20
+public AjaxResult submitPersonalCheck(@RequestBody PersonalCheckDTO checkData) {
21
+    Map<String, Object> params = new HashMap<>();
22
+    params.put("businessType", "SECURITY_CHECK");
23
+    params.put("businessId", checkData.getId());
24
+    params.put("title", "个人级别安检问题");
25
+    
26
+    // 目标通知用户ID列表
27
+    List<Long> targetUserIds = Arrays.asList(checkData.getTargetUserIds());
28
+    params.put("targetUserIds", targetUserIds);
29
+    
30
+    // 表单数据
31
+    Map<String, Object> formData = new HashMap<>();
32
+    formData.put("checkLevel", "PERSONAL");
33
+    formData.put("description", checkData.getDescription());
34
+    params.put("formData", formData);
35
+    
36
+    // 业务数据
37
+    Map<String, Object> businessData = new HashMap<>();
38
+    businessData.put("checkType", checkData.getCheckType());
39
+    businessData.put("location", checkData.getLocation());
40
+    params.put("businessData", businessData);
41
+    
42
+    return approvalController.startPersonalLevelProcess(params);
43
+}
44
+```
45
+
46
+### 2. 启动科级审批流程
47
+
48
+```java
49
+@PostMapping("/check/section")
50
+public AjaxResult submitSectionCheck(@RequestBody SectionCheckDTO checkData) {
51
+    Map<String, Object> params = new HashMap<>();
52
+    params.put("businessType", "SECURITY_CHECK");
53
+    params.put("businessId", checkData.getId());
54
+    params.put("title", "科级安检问题处理");
55
+    
56
+    // 表单数据
57
+    Map<String, Object> formData = new HashMap<>();
58
+    formData.put("checkLevel", "SECTION");
59
+    formData.put("description", checkData.getDescription());
60
+    formData.put("severity", checkData.getSeverity());
61
+    params.put("formData", formData);
62
+    
63
+    // 业务数据  
64
+    Map<String, Object> businessData = new HashMap<>();
65
+    businessData.put("checkType", checkData.getCheckType());
66
+    businessData.put("targetDeptId", checkData.getTargetDeptId());
67
+    params.put("businessData", businessData);
68
+    
69
+    return approvalController.startSectionLevelProcess(params);
70
+}
71
+```
72
+
73
+### 3. 启动查获上报审批流程
74
+
75
+```java
76
+@PostMapping("/seizure/report")
77
+public AjaxResult submitSeizureReport(@RequestBody SeizureReportDTO reportData) {
78
+    Map<String, Object> params = new HashMap<>();
79
+    params.put("businessType", "SEIZURE_REPORT");
80
+    params.put("businessId", reportData.getId());
81
+    params.put("title", "查获物品上报");
82
+    
83
+    // 根据当前用户角色确定提交人角色
84
+    String submitterRole = getCurrentUserRole(); // "GROUP_LEADER" 或其他
85
+    params.put("submitterRole", submitterRole);
86
+    
87
+    // 表单数据
88
+    Map<String, Object> formData = new HashMap<>();
89
+    formData.put("itemType", reportData.getItemType());
90
+    formData.put("quantity", reportData.getQuantity());
91
+    formData.put("location", reportData.getLocation());
92
+    params.put("formData", formData);
93
+    
94
+    // 业务数据
95
+    Map<String, Object> businessData = new HashMap<>();
96
+    businessData.put("seizureTime", reportData.getSeizureTime());
97
+    businessData.put("passengerInfo", reportData.getPassengerInfo());
98
+    params.put("businessData", businessData);
99
+    
100
+    return approvalController.startSeizureReportProcess(params);
101
+}
102
+```
103
+
104
+### 4. 审批任务(同意)
105
+
106
+```java
107
+@PutMapping("/approval/approve/{taskId}")
108
+public AjaxResult approveTask(@PathVariable Long taskId, @RequestBody ApprovalDTO approvalData) {
109
+    Map<String, Object> params = new HashMap<>();
110
+    params.put("comment", approvalData.getComment());
111
+    
112
+    // 如果是科长节点,需要选择整改班组
113
+    if ("SECTION_LEADER".equals(approvalData.getNodeType())) {
114
+        Map<String, Object> formData = new HashMap<>();
115
+        formData.put("targetGroupId", approvalData.getTargetGroupId());
116
+        formData.put("rectificationRequirement", approvalData.getRectificationRequirement());
117
+        params.put("formData", formData);
118
+    }
119
+    
120
+    // 如果是班组长整改节点,需要填写整改详情
121
+    if ("GROUP_LEADER_RECTIFY".equals(approvalData.getNodeType())) {
122
+        Map<String, Object> formData = new HashMap<>();
123
+        formData.put("rectificationDetail", approvalData.getRectificationDetail());
124
+        formData.put("rectificationTime", approvalData.getRectificationTime());
125
+        formData.put("rectificationResult", approvalData.getRectificationResult());
126
+        params.put("formData", formData);
127
+    }
128
+    
129
+    return approvalController.approveTask(taskId, params);
130
+}
131
+```
132
+
133
+### 5. 驳回任务
134
+
135
+```java
136
+@PutMapping("/approval/reject/{taskId}")
137
+public AjaxResult rejectTask(@PathVariable Long taskId, @RequestBody RejectDTO rejectData) {
138
+    Map<String, Object> params = new HashMap<>();
139
+    params.put("comment", rejectData.getRejectReason());
140
+    
141
+    return approvalController.rejectTask(taskId, params);
142
+}
143
+```
144
+
145
+### 6. 获取待办任务列表
146
+
147
+```java
148
+@GetMapping("/approval/tasks/pending")
149
+public TableDataInfo getPendingTasks() {
150
+    return approvalController.getPendingTasks();
151
+}
152
+```
153
+
154
+### 7. 获取已办任务列表
155
+
156
+```java
157
+@GetMapping("/approval/tasks/completed")
158
+public TableDataInfo getCompletedTasks() {
159
+    return approvalController.getCompletedTasks();
160
+}
161
+```
162
+
163
+### 8. 获取我发起的审批实例
164
+
165
+```java
166
+@GetMapping("/approval/instances/submitted")
167
+public TableDataInfo getSubmittedInstances(@RequestParam(required = false) String status) {
168
+    return approvalController.getSubmittedInstances(status);
169
+}
170
+```
171
+
172
+## 前端集成示例
173
+
174
+### 1. 待办任务列表页面
175
+
176
+```javascript
177
+// 获取待办任务
178
+function loadPendingTasks() {
179
+    $.get('/system/approval/tasks/pending', function(res) {
180
+        if (res.code === 200) {
181
+            renderTaskList(res.rows);
182
+        }
183
+    });
184
+}
185
+
186
+// 审批任务
187
+function approveTask(taskId, comment, formData) {
188
+    const params = {
189
+        comment: comment,
190
+        formData: formData
191
+    };
192
+    
193
+    $.ajax({
194
+        url: `/system/approval/approve/${taskId}`,
195
+        type: 'PUT',
196
+        contentType: 'application/json',
197
+        data: JSON.stringify(params),
198
+        success: function(res) {
199
+            if (res.code === 200) {
200
+                $.modal.msgSuccess("审批成功");
201
+                loadPendingTasks();
202
+            } else {
203
+                $.modal.msgError(res.msg);
204
+            }
205
+        }
206
+    });
207
+}
208
+
209
+// 驳回任务
210
+function rejectTask(taskId, reason) {
211
+    const params = {
212
+        comment: reason
213
+    };
214
+    
215
+    $.ajax({
216
+        url: `/system/approval/reject/${taskId}`,
217
+        type: 'PUT', 
218
+        contentType: 'application/json',
219
+        data: JSON.stringify(params),
220
+        success: function(res) {
221
+            if (res.code === 200) {
222
+                $.modal.msgSuccess("驳回成功");
223
+                loadPendingTasks();
224
+            } else {
225
+                $.modal.msgError(res.msg);
226
+            }
227
+        }
228
+    });
229
+}
230
+```
231
+
232
+### 2. 个人级别检查提交
233
+
234
+```javascript
235
+function submitPersonalCheck(checkData) {
236
+    const params = {
237
+        businessType: 'SECURITY_CHECK',
238
+        businessId: checkData.id,
239
+        title: '个人级别安检问题',
240
+        targetUserIds: checkData.targetUserIds,
241
+        formData: {
242
+            checkLevel: 'PERSONAL',
243
+            description: checkData.description
244
+        },
245
+        businessData: {
246
+            checkType: checkData.checkType,
247
+            location: checkData.location
248
+        }
249
+    };
250
+    
251
+    $.post('/system/approval/start/personal', params, function(res) {
252
+        if (res.code === 200) {
253
+            $.modal.msgSuccess("提交成功,已发送通知");
254
+        } else {
255
+            $.modal.msgError(res.msg);
256
+        }
257
+    });
258
+}
259
+```
260
+
261
+## 数据库初始化
262
+
263
+在使用审批流框架前,需要执行以下SQL脚本初始化数据库:
264
+
265
+```sql
266
+-- 执行审批流数据库脚本
267
+source sql/approval_workflow.sql
268
+```
269
+
270
+## 权限配置
271
+
272
+需要在系统中配置以下权限:
273
+
274
+```sql
275
+-- 审批流相关权限
276
+INSERT INTO sys_menu (menu_name, parent_id, order_num, path, component, is_frame, is_cache, menu_type, visible, status, perms, icon, create_by, create_time, update_by, update_time, remark) VALUES
277
+('审批管理', 1, 8, 'approval', NULL, 1, 0, 'M', '0', '0', NULL, 'documentation', 'admin', sysdate(), '', NULL, '审批流程管理目录'),
278
+('待办任务', 2000, 1, 'pending', 'approval/pending/index', 1, 0, 'C', '0', '0', 'system:approval:query', '#', 'admin', sysdate(), '', NULL, '待办任务菜单'),
279
+('已办任务', 2000, 2, 'completed', 'approval/completed/index', 1, 0, 'C', '0', '0', 'system:approval:query', '#', 'admin', sysdate(), '', NULL, '已办任务菜单'),
280
+('我的申请', 2000, 3, 'submitted', 'approval/submitted/index', 1, 0, 'C', '0', '0', 'system:approval:query', '#', 'admin', sysdate(), '', NULL, '我的申请菜单');
281
+
282
+-- 审批流权限
283
+INSERT INTO sys_menu (menu_name, parent_id, order_num, path, component, is_frame, is_cache, menu_type, visible, status, perms, icon, create_by, create_time, update_by, update_time, remark) VALUES
284
+('审批', '', 1, '', '', 1, 0, 'F', '0', '0', 'system:approval:approve', '#', 'admin', sysdate(), '', NULL, ''),
285
+('驳回', '', 2, '', '', 1, 0, 'F', '0', '0', 'system:approval:reject', '#', 'admin', sysdate(), '', NULL, ''),
286
+('取消', '', 3, '', '', 1, 0, 'F', '0', '0', 'system:approval:cancel', '#', 'admin', sysdate(), '', NULL, ''),
287
+('启动流程', '', 4, '', '', 1, 0, 'F', '0', '0', 'system:approval:start', '#', 'admin', sysdate(), '', NULL, '');
288
+```
289
+
290
+## 角色配置
291
+
292
+确保系统中存在以下角色:
293
+
294
+```sql
295
+-- 班组长角色
296
+INSERT INTO sys_role (role_name, role_key, role_sort, data_scope, status, del_flag, create_by, create_time, remark) 
297
+VALUES ('班组长', 'group_leader', 3, '4', '0', '0', 'admin', sysdate(), '班组长角色');
298
+
299
+-- 科长角色  
300
+INSERT INTO sys_role (role_name, role_key, role_sort, data_scope, status, del_flag, create_by, create_time, remark)
301
+VALUES ('科长', 'section_leader', 2, '3', '0', '0', 'admin', sysdate(), '科长角色');
302
+
303
+-- 质检员角色
304
+INSERT INTO sys_role (role_name, role_key, role_sort, data_scope, status, del_flag, create_by, create_time, remark)
305
+VALUES ('质检员', 'quality_inspector', 4, '4', '0', '0', 'admin', sysdate(), '质检员角色');
306
+```
307
+
308
+## 注意事项
309
+
310
+1. **审批人配置**: 确保各部门的班组长、科长角色配置正确
311
+2. **业务数据**: 根据实际业务需求调整 businessData 的数据结构
312
+3. **超时处理**: 系统会自动标记超时任务,建议定期清理
313
+4. **权限控制**: 确保只有相关人员才能审批对应的任务
314
+5. **数据备份**: 审批历史数据建议定期备份
315
+
316
+## 扩展开发
317
+
318
+如需扩展新的审批流程类型:
319
+
320
+1. 在数据库中添加新的流程定义和节点定义
321
+2. 在 `ApprovalConstants` 中添加相应常量
322
+3. 在 `IApprovalEngineService` 中添加新的方法
323
+4. 在 `ApprovalController` 中添加对应的接口
324
+5. 根据需要扩展 `IApprovalUserService` 的审批人获取逻辑

+ 319 - 0
pom.xml

@@ -0,0 +1,319 @@
1
+<?xml version="1.0" encoding="UTF-8"?>
2
+<project xmlns="http://maven.apache.org/POM/4.0.0"
3
+         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
4
+         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
5
+	<modelVersion>4.0.0</modelVersion>
6
+
7
+    <groupId>com.sundot.airport</groupId>
8
+    <artifactId>airport</artifactId>
9
+    <version>3.9.0</version>
10
+
11
+    <name>airport</name>
12
+    <description>安检分级质控系统</description>
13
+
14
+    <properties>
15
+        <airport.version>3.9.0</airport.version>
16
+        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
17
+        <project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
18
+        <java.version>1.8</java.version>
19
+        <maven-jar-plugin.version>3.1.1</maven-jar-plugin.version>
20
+        <spring-boot.version>2.5.15</spring-boot.version>
21
+        <druid.version>1.2.23</druid.version>
22
+        <bitwalker.version>1.21</bitwalker.version>
23
+        <swagger.version>3.0.0</swagger.version>
24
+        <kaptcha.version>2.3.3</kaptcha.version>
25
+        <pagehelper.boot.version>1.4.7</pagehelper.boot.version>
26
+        <fastjson2.version>2.0.57</fastjson2.version>
27
+        <fastjson.version>1.2.83</fastjson.version>
28
+        <oshi.version>6.8.2</oshi.version>
29
+        <commons.io.version>2.19.0</commons.io.version>
30
+        <poi.version>4.1.2</poi.version>
31
+        <velocity.version>2.3</velocity.version>
32
+        <jwt.version>0.9.1</jwt.version>
33
+        <!-- override dependency version -->
34
+        <tomcat.version>9.0.106</tomcat.version>
35
+        <logback.version>1.2.13</logback.version>
36
+        <spring-security.version>5.7.12</spring-security.version>
37
+        <spring-framework.version>5.3.39</spring-framework.version>
38
+    </properties>
39
+
40
+    <!-- 依赖声明 -->
41
+    <dependencyManagement>
42
+        <dependencies>
43
+
44
+            <!-- 覆盖SpringFramework的依赖配置-->
45
+            <dependency>
46
+                <groupId>org.springframework</groupId>
47
+                <artifactId>spring-framework-bom</artifactId>
48
+                <version>${spring-framework.version}</version>
49
+                <type>pom</type>
50
+                <scope>import</scope>
51
+            </dependency>
52
+
53
+            <!-- 覆盖SpringSecurity的依赖配置-->
54
+            <dependency>
55
+                <groupId>org.springframework.security</groupId>
56
+                <artifactId>spring-security-bom</artifactId>
57
+                <version>${spring-security.version}</version>
58
+                <type>pom</type>
59
+                <scope>import</scope>
60
+            </dependency>
61
+
62
+            <!-- SpringBoot的依赖配置-->
63
+            <dependency>
64
+                <groupId>org.springframework.boot</groupId>
65
+                <artifactId>spring-boot-dependencies</artifactId>
66
+                <version>${spring-boot.version}</version>
67
+                <type>pom</type>
68
+                <scope>import</scope>
69
+            </dependency>
70
+
71
+            <!-- 覆盖logback的依赖配置-->
72
+            <dependency>
73
+                <groupId>ch.qos.logback</groupId>
74
+                <artifactId>logback-core</artifactId>
75
+                <version>${logback.version}</version>
76
+            </dependency>
77
+
78
+            <dependency>
79
+                <groupId>ch.qos.logback</groupId>
80
+                <artifactId>logback-classic</artifactId>
81
+                <version>${logback.version}</version>
82
+            </dependency>
83
+
84
+            <!-- 覆盖tomcat的依赖配置-->
85
+            <dependency>
86
+                <groupId>org.apache.tomcat.embed</groupId>
87
+                <artifactId>tomcat-embed-core</artifactId>
88
+                <version>${tomcat.version}</version>
89
+            </dependency>
90
+
91
+            <dependency>
92
+                <groupId>org.apache.tomcat.embed</groupId>
93
+                <artifactId>tomcat-embed-el</artifactId>
94
+                <version>${tomcat.version}</version>
95
+            </dependency>
96
+
97
+            <dependency>
98
+                <groupId>org.apache.tomcat.embed</groupId>
99
+                <artifactId>tomcat-embed-websocket</artifactId>
100
+                <version>${tomcat.version}</version>
101
+            </dependency>
102
+
103
+            <!-- 阿里数据库连接池 -->
104
+            <dependency>
105
+                <groupId>com.alibaba</groupId>
106
+                <artifactId>druid-spring-boot-starter</artifactId>
107
+                <version>${druid.version}</version>
108
+            </dependency>
109
+
110
+            <!-- 解析客户端操作系统、浏览器等 -->
111
+            <dependency>
112
+                <groupId>eu.bitwalker</groupId>
113
+                <artifactId>UserAgentUtils</artifactId>
114
+                <version>${bitwalker.version}</version>
115
+            </dependency>
116
+
117
+            <!-- pagehelper 分页插件 -->
118
+            <dependency>
119
+                <groupId>com.github.pagehelper</groupId>
120
+                <artifactId>pagehelper-spring-boot-starter</artifactId>
121
+                <version>${pagehelper.boot.version}</version>
122
+            </dependency>
123
+
124
+            <!-- 获取系统信息 -->
125
+            <dependency>
126
+                <groupId>com.github.oshi</groupId>
127
+                <artifactId>oshi-core</artifactId>
128
+                <version>${oshi.version}</version>
129
+            </dependency>
130
+
131
+            <!-- Swagger3依赖 -->
132
+            <dependency>
133
+                <groupId>io.springfox</groupId>
134
+                <artifactId>springfox-boot-starter</artifactId>
135
+                <version>${swagger.version}</version>
136
+                <exclusions>
137
+                    <exclusion>
138
+                        <groupId>io.swagger</groupId>
139
+                        <artifactId>swagger-models</artifactId>
140
+                    </exclusion>
141
+                </exclusions>
142
+            </dependency>
143
+
144
+            <!-- io常用工具类 -->
145
+            <dependency>
146
+                <groupId>commons-io</groupId>
147
+                <artifactId>commons-io</artifactId>
148
+                <version>${commons.io.version}</version>
149
+            </dependency>
150
+
151
+            <!-- excel工具 -->
152
+            <dependency>
153
+                <groupId>org.apache.poi</groupId>
154
+                <artifactId>poi-ooxml</artifactId>
155
+                <version>${poi.version}</version>
156
+            </dependency>
157
+
158
+            <!-- velocity代码生成使用模板 -->
159
+            <dependency>
160
+                <groupId>org.apache.velocity</groupId>
161
+                <artifactId>velocity-engine-core</artifactId>
162
+                <version>${velocity.version}</version>
163
+            </dependency>
164
+
165
+            <!-- 阿里JSON解析器 -->
166
+            <dependency>
167
+                <groupId>com.alibaba.fastjson2</groupId>
168
+                <artifactId>fastjson2</artifactId>
169
+                <version>${fastjson2.version}</version>
170
+            </dependency>
171
+            <dependency>
172
+                <groupId>com.alibaba</groupId>
173
+                <artifactId>fastjson</artifactId>
174
+                <version>${fastjson.version}</version>
175
+            </dependency>
176
+
177
+            <!-- Token生成与解析-->
178
+            <dependency>
179
+                <groupId>io.jsonwebtoken</groupId>
180
+                <artifactId>jjwt</artifactId>
181
+                <version>${jwt.version}</version>
182
+            </dependency>
183
+
184
+            <!-- 验证码 -->
185
+            <dependency>
186
+                <groupId>pro.fessional</groupId>
187
+                <artifactId>kaptcha</artifactId>
188
+                <version>${kaptcha.version}</version>
189
+            </dependency>
190
+
191
+            <!-- 定时任务-->
192
+            <dependency>
193
+                <groupId>com.sundot.airport</groupId>
194
+                <artifactId>airport-quartz</artifactId>
195
+                <version>${airport.version}</version>
196
+            </dependency>
197
+
198
+            <!-- 代码生成-->
199
+            <dependency>
200
+                <groupId>com.sundot.airport</groupId>
201
+                <artifactId>airport-generator</artifactId>
202
+                <version>${airport.version}</version>
203
+            </dependency>
204
+
205
+            <!-- 核心模块-->
206
+            <dependency>
207
+                <groupId>com.sundot.airport</groupId>
208
+                <artifactId>airport-framework</artifactId>
209
+                <version>${airport.version}</version>
210
+            </dependency>
211
+
212
+            <!-- 系统模块-->
213
+            <dependency>
214
+                <groupId>com.sundot.airport</groupId>
215
+                <artifactId>airport-system</artifactId>
216
+                <version>${airport.version}</version>
217
+            </dependency>
218
+
219
+            <!-- 系统模块-->
220
+            <dependency>
221
+                <groupId>com.sundot.airport</groupId>
222
+                <artifactId>airport-exam</artifactId>
223
+                <version>${airport.version}</version>
224
+            </dependency>
225
+
226
+
227
+            <!-- 考勤模块-->
228
+            <dependency>
229
+                <groupId>com.sundot.airport</groupId>
230
+                <artifactId>airport-attendance</artifactId>
231
+                <version>${airport.version}</version>
232
+            </dependency>
233
+
234
+            <!-- 通用工具-->
235
+            <dependency>
236
+                <groupId>com.sundot.airport</groupId>
237
+                <artifactId>airport-common</artifactId>
238
+                <version>${airport.version}</version>
239
+            </dependency>
240
+
241
+            <!-- 查获物品管理模块-->
242
+            <dependency>
243
+                <groupId>com.sundot.airport</groupId>
244
+                <artifactId>airport-item</artifactId>
245
+                <version>${airport.version}</version>
246
+            </dependency>
247
+
248
+            <!-- 巡检管理模块-->
249
+            <dependency>
250
+                <groupId>com.sundot.airport</groupId>
251
+                <artifactId>airport-check</artifactId>
252
+                <version>${airport.version}</version>
253
+            </dependency>
254
+
255
+            <dependency>
256
+                <groupId>org.projectlombok</groupId>
257
+                <artifactId>lombok</artifactId>
258
+                <scope>provided</scope>
259
+                <version>1.18.30</version>
260
+            </dependency>
261
+
262
+        </dependencies>
263
+    </dependencyManagement>
264
+
265
+    <modules>
266
+        <module>airport-admin</module>
267
+        <module>airport-framework</module>
268
+        <module>airport-system</module>
269
+        <module>airport-quartz</module>
270
+        <module>airport-generator</module>
271
+        <module>airport-common</module>
272
+        <module>airport-item</module>
273
+        <module>airport-exam</module>
274
+        <module>airport-check</module>
275
+        <module>airport-attendance</module>
276
+    </modules>
277
+    <packaging>pom</packaging>
278
+
279
+    <build>
280
+        <plugins>
281
+            <plugin>
282
+                <groupId>org.apache.maven.plugins</groupId>
283
+                <artifactId>maven-compiler-plugin</artifactId>
284
+                <version>3.1</version>
285
+                <configuration>
286
+                    <source>${java.version}</source>
287
+                    <target>${java.version}</target>
288
+                    <encoding>${project.build.sourceEncoding}</encoding>
289
+                </configuration>
290
+            </plugin>
291
+        </plugins>
292
+    </build>
293
+
294
+    <repositories>
295
+        <repository>
296
+            <id>public</id>
297
+            <name>aliyun nexus</name>
298
+            <url>https://maven.aliyun.com/repository/public</url>
299
+            <releases>
300
+                <enabled>true</enabled>
301
+            </releases>
302
+        </repository>
303
+    </repositories>
304
+
305
+    <pluginRepositories>
306
+        <pluginRepository>
307
+            <id>public</id>
308
+            <name>aliyun nexus</name>
309
+            <url>https://maven.aliyun.com/repository/public</url>
310
+            <releases>
311
+                <enabled>true</enabled>
312
+            </releases>
313
+            <snapshots>
314
+                <enabled>false</enabled>
315
+            </snapshots>
316
+        </pluginRepository>
317
+    </pluginRepositories>
318
+
319
+</project>

+ 67 - 0
ry.bat

@@ -0,0 +1,67 @@
1
+@echo off
2
+
3
+rem jar平级目录
4
+set AppName=airport-admin.jar
5
+
6
+rem JVM参数
7
+set JVM_OPTS="-Dname=%AppName%  -Duser.timezone=Asia/Shanghai -Xms512m -Xmx1024m -XX:MetaspaceSize=128m -XX:MaxMetaspaceSize=512m -XX:+HeapDumpOnOutOfMemoryError -XX:+PrintGCDateStamps  -XX:+PrintGCDetails -XX:NewRatio=1 -XX:SurvivorRatio=30 -XX:+UseParallelGC -XX:+UseParallelOldGC"
8
+
9
+
10
+ECHO.
11
+	ECHO.  [1] 启动%AppName%
12
+	ECHO.  [2] 关闭%AppName%
13
+	ECHO.  [3] 重启%AppName%
14
+	ECHO.  [4] 启动状态 %AppName%
15
+	ECHO.  [5] 退 出
16
+ECHO.
17
+
18
+ECHO.请输入选择项目的序号:
19
+set /p ID=
20
+	IF "%id%"=="1" GOTO start
21
+	IF "%id%"=="2" GOTO stop
22
+	IF "%id%"=="3" GOTO restart
23
+	IF "%id%"=="4" GOTO status
24
+	IF "%id%"=="5" EXIT
25
+PAUSE
26
+:start
27
+    for /f "usebackq tokens=1-2" %%a in (`jps -l ^| findstr %AppName%`) do (
28
+		set pid=%%a
29
+		set image_name=%%b
30
+	)
31
+	if  defined pid (
32
+		echo %%is running
33
+		PAUSE
34
+	)
35
+
36
+start javaw %JVM_OPTS% -jar %AppName%
37
+
38
+echo  starting……
39
+echo  Start %AppName% success...
40
+goto:eof
41
+
42
+rem 函数stop通过jps命令查找pid并结束进程
43
+:stop
44
+	for /f "usebackq tokens=1-2" %%a in (`jps -l ^| findstr %AppName%`) do (
45
+		set pid=%%a
46
+		set image_name=%%b
47
+	)
48
+	if not defined pid (echo process %AppName% does not exists) else (
49
+		echo prepare to kill %image_name%
50
+		echo start kill %pid% ...
51
+		rem 根据进程ID,kill进程
52
+		taskkill /f /pid %pid%
53
+	)
54
+goto:eof
55
+:restart
56
+	call :stop
57
+    call :start
58
+goto:eof
59
+:status
60
+	for /f "usebackq tokens=1-2" %%a in (`jps -l ^| findstr %AppName%`) do (
61
+		set pid=%%a
62
+		set image_name=%%b
63
+	)
64
+	if not defined pid (echo process %AppName% is dead ) else (
65
+		echo %image_name% is running
66
+	)
67
+goto:eof

+ 86 - 0
ry.sh

@@ -0,0 +1,86 @@
1
+#!/bin/sh
2
+# ./ry.sh start 启动 stop 停止 restart 重启 status 状态
3
+AppName=airport-admin.jar
4
+
5
+# JVM参数
6
+JVM_OPTS="-Dname=$AppName  -Duser.timezone=Asia/Shanghai -Xms512m -Xmx1024m -XX:MetaspaceSize=128m -XX:MaxMetaspaceSize=512m -XX:+HeapDumpOnOutOfMemoryError -XX:+PrintGCDateStamps  -XX:+PrintGCDetails -XX:NewRatio=1 -XX:SurvivorRatio=30 -XX:+UseParallelGC -XX:+UseParallelOldGC"
7
+APP_HOME=`pwd`
8
+LOG_PATH=$APP_HOME/logs/$AppName.log
9
+
10
+if [ "$1" = "" ];
11
+then
12
+    echo -e "\033[0;31m 未输入操作名 \033[0m  \033[0;34m {start|stop|restart|status} \033[0m"
13
+    exit 1
14
+fi
15
+
16
+if [ "$AppName" = "" ];
17
+then
18
+    echo -e "\033[0;31m 未输入应用名 \033[0m"
19
+    exit 1
20
+fi
21
+
22
+function start()
23
+{
24
+    PID=`ps -ef |grep java|grep $AppName|grep -v grep|awk '{print $2}'`
25
+
26
+	if [ x"$PID" != x"" ]; then
27
+	    echo "$AppName is running..."
28
+	else
29
+		nohup java $JVM_OPTS -jar $AppName > /dev/null 2>&1 &
30
+		echo "Start $AppName success..."
31
+	fi
32
+}
33
+
34
+function stop()
35
+{
36
+    echo "Stop $AppName"
37
+
38
+	PID=""
39
+	query(){
40
+		PID=`ps -ef |grep java|grep $AppName|grep -v grep|awk '{print $2}'`
41
+	}
42
+
43
+	query
44
+	if [ x"$PID" != x"" ]; then
45
+		kill -TERM $PID
46
+		echo "$AppName (pid:$PID) exiting..."
47
+		while [ x"$PID" != x"" ]
48
+		do
49
+			sleep 1
50
+			query
51
+		done
52
+		echo "$AppName exited."
53
+	else
54
+		echo "$AppName already stopped."
55
+	fi
56
+}
57
+
58
+function restart()
59
+{
60
+    stop
61
+    sleep 2
62
+    start
63
+}
64
+
65
+function status()
66
+{
67
+    PID=`ps -ef |grep java|grep $AppName|grep -v grep|wc -l`
68
+    if [ $PID != 0 ];then
69
+        echo "$AppName is running..."
70
+    else
71
+        echo "$AppName is not running..."
72
+    fi
73
+}
74
+
75
+case $1 in
76
+    start)
77
+    start;;
78
+    stop)
79
+    stop;;
80
+    restart)
81
+    restart;;
82
+    status)
83
+    status;;
84
+    *)
85
+
86
+esac