Your Name 2 vuotta sitten
vanhempi
commit
913c06ea26
22 muutettua tiedostoa jossa 933 lisäystä ja 92 poistoa
  1. 6
    6
      db/.back_文明创办/文明创办-backup-20221225170314.pdma.json
  2. 6
    6
      db/.back_文明创办/文明创办-backup-20221226214926.pdma.json
  3. 51
    10
      db/.back_文明创办/文明创办-backup-20221226221940.pdma.json
  4. 42
    8
      db/文明创办.pdma.json
  5. 15
    0
      pom.xml
  6. 47
    0
      src/main/java/com/example/civilizedcity/common/Constants.java
  7. 166
    0
      src/main/java/com/example/civilizedcity/common/OSSUtils.java
  8. 40
    0
      src/main/java/com/example/civilizedcity/config/AliyunConfig.java
  9. 32
    0
      src/main/java/com/example/civilizedcity/controller/CommController.java
  10. 4
    0
      src/main/java/com/example/civilizedcity/controller/SysUserController.java
  11. 54
    0
      src/main/java/com/example/civilizedcity/controller/TaIssueController.java
  12. 343
    21
      src/main/java/com/example/civilizedcity/controller/TaIssueProcessController.java
  13. 4
    4
      src/main/java/com/example/civilizedcity/entity/TaAttach.java
  14. 11
    1
      src/main/java/com/example/civilizedcity/entity/TaIssue.java
  15. 40
    34
      src/main/java/com/example/civilizedcity/entity/TaIssueProcess.java
  16. 2
    1
      src/main/java/com/example/civilizedcity/mapper/SysUserDutyMapper.java
  17. 3
    1
      src/main/java/com/example/civilizedcity/mapper/SysUserRoleMapper.java
  18. 6
    0
      src/main/java/com/example/civilizedcity/service/SysUserService.java
  19. 25
    0
      src/main/java/com/example/civilizedcity/service/impl/StpInterfaceImpl.java
  20. 14
    0
      src/main/java/com/example/civilizedcity/service/impl/SysUserServiceImpl.java
  21. 14
    0
      src/main/resources/application.yml
  22. 8
    0
      src/main/resources/mapper/SysUserRoleMapper.xml

db/.back_文明创办/文明创办-backup-20221216202942.pdma.json → db/.back_文明创办/文明创办-backup-20221225170314.pdma.json Näytä tiedosto

2
   "name": "文明创办",
2
   "name": "文明创办",
3
   "describe": "文明创办",
3
   "describe": "文明创办",
4
   "avatar": "",
4
   "avatar": "",
5
-  "version": "4.1.4",
5
+  "version": "4.2.0",
6
   "createdTime": "2022-12-12 09:36:12",
6
   "createdTime": "2022-12-12 09:36:12",
7
-  "updatedTime": "2022-12-16 20:29:13",
7
+  "updatedTime": "2022-12-25 17:03:12",
8
   "dbConns": [],
8
   "dbConns": [],
9
   "profile": {
9
   "profile": {
10
     "default": {
10
     "default": {
4041
           "id": "692C2381-564C-4BEB-A9C7-DFEEB53A6C4E"
4041
           "id": "692C2381-564C-4BEB-A9C7-DFEEB53A6C4E"
4042
         },
4042
         },
4043
         {
4043
         {
4044
-          "defKey": "attach_type",
4045
-          "defName": "件类型",
4044
+          "defKey": "file_type",
4045
+          "defName": "件类型",
4046
           "comment": "",
4046
           "comment": "",
4047
           "type": "",
4047
           "type": "",
4048
           "len": "",
4048
           "len": "",
4059
         },
4059
         },
4060
         {
4060
         {
4061
           "defKey": "name",
4061
           "defKey": "name",
4062
-          "defName": "件名称",
4062
+          "defName": "件名称",
4063
           "comment": "",
4063
           "comment": "",
4064
           "type": "",
4064
           "type": "",
4065
           "len": "",
4065
           "len": "",
4076
         },
4076
         },
4077
         {
4077
         {
4078
           "defKey": "url",
4078
           "defKey": "url",
4079
-          "defName": "件地址",
4079
+          "defName": "件地址",
4080
           "comment": "",
4080
           "comment": "",
4081
           "type": "",
4081
           "type": "",
4082
           "len": "",
4082
           "len": "",

db/.back_文明创办/文明创办-backup-20221218172610.pdma.json → db/.back_文明创办/文明创办-backup-20221226214926.pdma.json Näytä tiedosto

2
   "name": "文明创办",
2
   "name": "文明创办",
3
   "describe": "文明创办",
3
   "describe": "文明创办",
4
   "avatar": "",
4
   "avatar": "",
5
-  "version": "4.1.4",
5
+  "version": "4.2.0",
6
   "createdTime": "2022-12-12 09:36:12",
6
   "createdTime": "2022-12-12 09:36:12",
7
-  "updatedTime": "2022-12-16 20:29:42",
7
+  "updatedTime": "2022-12-25 17:03:14",
8
   "dbConns": [],
8
   "dbConns": [],
9
   "profile": {
9
   "profile": {
10
     "default": {
10
     "default": {
4041
           "id": "692C2381-564C-4BEB-A9C7-DFEEB53A6C4E"
4041
           "id": "692C2381-564C-4BEB-A9C7-DFEEB53A6C4E"
4042
         },
4042
         },
4043
         {
4043
         {
4044
-          "defKey": "attach_type",
4045
-          "defName": "件类型",
4044
+          "defKey": "file_type",
4045
+          "defName": "件类型",
4046
           "comment": "",
4046
           "comment": "",
4047
           "type": "",
4047
           "type": "",
4048
           "len": "",
4048
           "len": "",
4059
         },
4059
         },
4060
         {
4060
         {
4061
           "defKey": "name",
4061
           "defKey": "name",
4062
-          "defName": "件名称",
4062
+          "defName": "件名称",
4063
           "comment": "",
4063
           "comment": "",
4064
           "type": "",
4064
           "type": "",
4065
           "len": "",
4065
           "len": "",
4076
         },
4076
         },
4077
         {
4077
         {
4078
           "defKey": "url",
4078
           "defKey": "url",
4079
-          "defName": "件地址",
4079
+          "defName": "件地址",
4080
           "comment": "",
4080
           "comment": "",
4081
           "type": "",
4081
           "type": "",
4082
           "len": "",
4082
           "len": "",

db/.back_文明创办/文明创办-backup-20221216202913.pdma.json → db/.back_文明创办/文明创办-backup-20221226221940.pdma.json Näytä tiedosto

2
   "name": "文明创办",
2
   "name": "文明创办",
3
   "describe": "文明创办",
3
   "describe": "文明创办",
4
   "avatar": "",
4
   "avatar": "",
5
-  "version": "4.1.4",
5
+  "version": "4.2.0",
6
   "createdTime": "2022-12-12 09:36:12",
6
   "createdTime": "2022-12-12 09:36:12",
7
-  "updatedTime": "2022-12-16 15:59:16",
7
+  "updatedTime": "2022-12-26 21:49:26",
8
   "dbConns": [],
8
   "dbConns": [],
9
   "profile": {
9
   "profile": {
10
     "default": {
10
     "default": {
3588
           "domain": "6BC8F04B-6CFA-4995-98D3-318F5CDD774E",
3588
           "domain": "6BC8F04B-6CFA-4995-98D3-318F5CDD774E",
3589
           "id": "0C4AEF3B-E3BB-4C7F-9943-F579E6A3CEEE"
3589
           "id": "0C4AEF3B-E3BB-4C7F-9943-F579E6A3CEEE"
3590
         },
3590
         },
3591
+        {
3592
+          "defKey": "expire_date",
3593
+          "defName": "截止时间",
3594
+          "comment": "YYYY-MM-DD",
3595
+          "type": "",
3596
+          "len": "",
3597
+          "scale": "",
3598
+          "primaryKey": false,
3599
+          "notNull": false,
3600
+          "autoIncrement": false,
3601
+          "defaultValue": "",
3602
+          "hideInGraph": false,
3603
+          "domain": "73FD2BAD-2358-4336-B96D-45DC897BD792",
3604
+          "refDict": "",
3605
+          "extProps": {},
3606
+          "notes": {},
3607
+          "id": "67B51317-2D33-4118-81AA-50D179CDF9E8"
3608
+        },
3591
         {
3609
         {
3592
           "defKey": "org_id",
3610
           "defKey": "org_id",
3593
           "defName": "当前处理单位",
3611
           "defName": "当前处理单位",
4041
           "id": "692C2381-564C-4BEB-A9C7-DFEEB53A6C4E"
4059
           "id": "692C2381-564C-4BEB-A9C7-DFEEB53A6C4E"
4042
         },
4060
         },
4043
         {
4061
         {
4044
-          "defKey": "attach_type",
4045
-          "defName": "件类型",
4062
+          "defKey": "file_type",
4063
+          "defName": "件类型",
4046
           "comment": "",
4064
           "comment": "",
4047
           "type": "",
4065
           "type": "",
4048
           "len": "",
4066
           "len": "",
4059
         },
4077
         },
4060
         {
4078
         {
4061
           "defKey": "name",
4079
           "defKey": "name",
4062
-          "defName": "件名称",
4080
+          "defName": "件名称",
4063
           "comment": "",
4081
           "comment": "",
4064
           "type": "",
4082
           "type": "",
4065
           "len": "",
4083
           "len": "",
4076
         },
4094
         },
4077
         {
4095
         {
4078
           "defKey": "url",
4096
           "defKey": "url",
4079
-          "defName": "件地址",
4097
+          "defName": "件地址",
4080
           "comment": "",
4098
           "comment": "",
4081
           "type": "",
4099
           "type": "",
4082
           "len": "",
4100
           "len": "",
7038
       "id": "507794C4-11E9-4924-AEC5-368BC6E03FD7",
7056
       "id": "507794C4-11E9-4924-AEC5-368BC6E03FD7",
7039
       "env": {
7057
       "env": {
7040
         "base": {
7058
         "base": {
7041
-          "nameSpace": "",
7042
-          "codeRoot": ""
7043
-        }
7059
+          "nameSpace": "com.example.civilizedcity",
7060
+          "codeRoot": "TaCheckItemAn"
7061
+        },
7062
+        "template": {
7063
+          "JavaMybatisPlus": {
7064
+            "Controller": {
7065
+              "suffix": "controller/{{=it.codeRoot}}Controller.java"
7066
+            },
7067
+            "Service": {
7068
+              "suffix": "service/{{=it.codeRoot}}Service.java"
7069
+            },
7070
+            "ServiceImpl": {
7071
+              "suffix": "service/impl/{{=it. codeRoot}}ServiceImpl.java"
7072
+            },
7073
+            "Mapper": {
7074
+              "suffix": "mapper/{{=it.codeRoot}}Mapper.java"
7075
+            },
7076
+            "Mapper.xml": {
7077
+              "suffix": "mapper/{{=it.codeRoot}}Mapper.xml"
7078
+            },
7079
+            "Entity": {
7080
+              "suffix": "entity/{{=it.codeRoot}}.java"
7081
+            }
7082
+          }
7083
+        },
7084
+        "custom": {}
7044
       },
7085
       },
7045
       "defKey": "ta_check_item_an",
7086
       "defKey": "ta_check_item_an",
7046
       "defName": "项目问题答案",
7087
       "defName": "项目问题答案",
7123
           "scale": "",
7164
           "scale": "",
7124
           "primaryKey": true,
7165
           "primaryKey": true,
7125
           "notNull": true,
7166
           "notNull": true,
7126
-          "autoIncrement": true,
7167
+          "autoIncrement": false,
7127
           "defaultValue": "",
7168
           "defaultValue": "",
7128
           "hideInGraph": true,
7169
           "hideInGraph": true,
7129
           "domain": "16120F75-6AA7-4483-868D-F07F511BB081",
7170
           "domain": "16120F75-6AA7-4483-868D-F07F511BB081",

+ 42
- 8
db/文明创办.pdma.json Näytä tiedosto

4
   "avatar": "",
4
   "avatar": "",
5
   "version": "4.2.0",
5
   "version": "4.2.0",
6
   "createdTime": "2022-12-12 09:36:12",
6
   "createdTime": "2022-12-12 09:36:12",
7
-  "updatedTime": "2022-12-18 17:26:10",
7
+  "updatedTime": "2022-12-26 22:19:40",
8
   "dbConns": [],
8
   "dbConns": [],
9
   "profile": {
9
   "profile": {
10
     "default": {
10
     "default": {
493
         "refKey": "extProps",
493
         "refKey": "extProps",
494
         "hideInGraph": true
494
         "hideInGraph": true
495
       }
495
       }
496
-    ],
497
-    "modelType": "modalGroup"
496
+    ]
498
   },
497
   },
499
   "entities": [
498
   "entities": [
500
     {
499
     {
3589
           "domain": "6BC8F04B-6CFA-4995-98D3-318F5CDD774E",
3588
           "domain": "6BC8F04B-6CFA-4995-98D3-318F5CDD774E",
3590
           "id": "0C4AEF3B-E3BB-4C7F-9943-F579E6A3CEEE"
3589
           "id": "0C4AEF3B-E3BB-4C7F-9943-F579E6A3CEEE"
3591
         },
3590
         },
3591
+        {
3592
+          "defKey": "expire_date",
3593
+          "defName": "截止时间",
3594
+          "comment": "YYYY-MM-DD",
3595
+          "type": "",
3596
+          "len": "",
3597
+          "scale": "",
3598
+          "primaryKey": false,
3599
+          "notNull": false,
3600
+          "autoIncrement": false,
3601
+          "defaultValue": "",
3602
+          "hideInGraph": false,
3603
+          "domain": "73FD2BAD-2358-4336-B96D-45DC897BD792",
3604
+          "refDict": "",
3605
+          "extProps": {},
3606
+          "notes": {},
3607
+          "id": "67B51317-2D33-4118-81AA-50D179CDF9E8"
3608
+        },
3592
         {
3609
         {
3593
           "defKey": "org_id",
3610
           "defKey": "org_id",
3594
           "defName": "当前处理单位",
3611
           "defName": "当前处理单位",
4042
           "id": "692C2381-564C-4BEB-A9C7-DFEEB53A6C4E"
4059
           "id": "692C2381-564C-4BEB-A9C7-DFEEB53A6C4E"
4043
         },
4060
         },
4044
         {
4061
         {
4045
-          "defKey": "attach_type",
4046
-          "defName": "件类型",
4062
+          "defKey": "file_type",
4063
+          "defName": "件类型",
4047
           "comment": "",
4064
           "comment": "",
4048
           "type": "",
4065
           "type": "",
4049
           "len": "",
4066
           "len": "",
4060
         },
4077
         },
4061
         {
4078
         {
4062
           "defKey": "name",
4079
           "defKey": "name",
4063
-          "defName": "件名称",
4080
+          "defName": "件名称",
4064
           "comment": "",
4081
           "comment": "",
4065
           "type": "",
4082
           "type": "",
4066
           "len": "",
4083
           "len": "",
4077
         },
4094
         },
4078
         {
4095
         {
4079
           "defKey": "url",
4096
           "defKey": "url",
4080
-          "defName": "件地址",
4097
+          "defName": "件地址",
4081
           "comment": "",
4098
           "comment": "",
4082
           "type": "",
4099
           "type": "",
4083
           "len": "",
4100
           "len": "",
4318
           "domain": "6BC8F04B-6CFA-4995-98D3-318F5CDD774E",
4335
           "domain": "6BC8F04B-6CFA-4995-98D3-318F5CDD774E",
4319
           "id": "AFC8B3AA-0A3C-483A-9CDA-556CDC9D2ABE"
4336
           "id": "AFC8B3AA-0A3C-483A-9CDA-556CDC9D2ABE"
4320
         },
4337
         },
4338
+        {
4339
+          "defKey": "prev_process",
4340
+          "defName": "上个流程ID",
4341
+          "comment": "",
4342
+          "type": "",
4343
+          "len": "",
4344
+          "scale": "",
4345
+          "primaryKey": false,
4346
+          "notNull": false,
4347
+          "autoIncrement": false,
4348
+          "defaultValue": "",
4349
+          "hideInGraph": false,
4350
+          "refDict": "",
4351
+          "extProps": {},
4352
+          "domain": "9092C4E0-1A54-4859-ABBB-5B62DBC27573",
4353
+          "id": "C7F06F89-4FA3-48D2-A861-B008B8C81251"
4354
+        },
4321
         {
4355
         {
4322
           "defKey": "org_id",
4356
           "defKey": "org_id",
4323
           "defName": "处理机构",
4357
           "defName": "处理机构",
4331
           "defaultValue": "",
4365
           "defaultValue": "",
4332
           "hideInGraph": false,
4366
           "hideInGraph": false,
4333
           "refDict": "",
4367
           "refDict": "",
4334
-          "domain": "16120F75-6AA7-4483-868D-F07F511BB081",
4368
+          "domain": "6BC8F04B-6CFA-4995-98D3-318F5CDD774E",
4335
           "id": "DACC10C6-21E8-4483-9C65-DFC7EB3B960A",
4369
           "id": "DACC10C6-21E8-4483-9C65-DFC7EB3B960A",
4336
           "uiHint": ""
4370
           "uiHint": ""
4337
         },
4371
         },

+ 15
- 0
pom.xml Näytä tiedosto

44
         </dependency>
44
         </dependency>
45
 
45
 
46
 
46
 
47
+        <!--oss start-->
48
+        <dependency>
49
+            <groupId>com.aliyun.oss</groupId>
50
+            <artifactId>aliyun-sdk-oss</artifactId>
51
+            <version>2.8.3</version>
52
+        </dependency>
53
+        <!--oss end-->
54
+
55
+        <dependency>
56
+            <groupId>com.aliyun</groupId>
57
+            <artifactId>aliyun-java-sdk-core</artifactId>
58
+            <version>[4.4.9,5.0.0)</version>
59
+        </dependency>
60
+
61
+
47
         <!-- Sa-Token 权限认证, 在线文档:http://sa-token.dev33.cn/ -->
62
         <!-- Sa-Token 权限认证, 在线文档:http://sa-token.dev33.cn/ -->
48
         <dependency>
63
         <dependency>
49
             <groupId>cn.dev33</groupId>
64
             <groupId>cn.dev33</groupId>

+ 47
- 0
src/main/java/com/example/civilizedcity/common/Constants.java Näytä tiedosto

2
 
2
 
3
 public class Constants {
3
 public class Constants {
4
     public final static String ROOT_ID = "1";    // 超级管理员ID
4
     public final static String ROOT_ID = "1";    // 超级管理员ID
5
+    public final static String ROOT_ORG = "1";  // 平台机构
5
 
6
 
6
     public final static int STATUS_DELETE = -1;
7
     public final static int STATUS_DELETE = -1;
7
     public final static int STATUS_READY = 0;
8
     public final static int STATUS_READY = 0;
10
 
11
 
11
     public final static String CHECK_ITEM_LOC = "loc";  // 实例调研
12
     public final static String CHECK_ITEM_LOC = "loc";  // 实例调研
12
     public final static String CHECK_ITEM_SURVEY = "survey";  // 问卷调研
13
     public final static String CHECK_ITEM_SURVEY = "survey";  // 问卷调研
14
+
15
+    // 问题单
16
+    public final static String ATTACH_SOURCE_ISSUE = "issue";
17
+
18
+    // 督察员上报
19
+    public final static String ISSUE_SOURCE_INSPECTOR = "inspector";
20
+    // 市民上报
21
+    public final static String ISSUE_SOURCE_FEEDBACK = "feedback";
22
+    // 模拟测评
23
+    public final static String ISSUE_SOURCE_CHECK = "check";
24
+
25
+
26
+    // 待处理
27
+    public final static String PROCESS_STATUS_READY = "ready";
28
+    // 通过
29
+    public final static String PROCESS_STATUS_PASS = "pass";
30
+    // 未通过
31
+    public final static String PROCESS_STATUS_REJECT = "reject";
32
+    // 逾期
33
+    public final static String PROCESS_STATUS_EXPIRED = "expired";
34
+
35
+
36
+    // 流程起始: 待交办
37
+    public final static String PROCESS_START = "start";
38
+    public final static String PROCESS_RESTART = "restart";
39
+
40
+    // 审核
41
+    public final static String PROCESS_VERIFY = "verify";
42
+    // 交办
43
+    public final static String PROCESS_ASSIGNED = "assigned";
44
+    // 延期申请
45
+    public final static String PROCESS_ORG_DELAY_APPLY = "org_delay-apply";
46
+    // 延期审核
47
+    public final static String PROCESS_DELAY_VERIFY = "delay-verify";
48
+    // 单位交办
49
+    public final static String PROCESS_ORG_ASSIGNED = "org_assigned";
50
+    // 单位审核
51
+    public final static String PROCESS_ORG_VERIFY = "org_verify";
52
+    // 办结申请
53
+    public final static String PROCESS_ORG_FINISH_APPLY = "org_finish-apply";
54
+    // 办结审核
55
+    public final static String PROCESS_FINISH_VERIFY = "finish-verify";
56
+
57
+
58
+    // 流程结束: 已办结
59
+    public final static String PROCESS_END = "end";
13
 }
60
 }

+ 166
- 0
src/main/java/com/example/civilizedcity/common/OSSUtils.java Näytä tiedosto

1
+package com.example.civilizedcity.common;
2
+
3
+import com.aliyun.oss.OSSClient;
4
+import com.aliyuncs.DefaultAcsClient;
5
+import com.aliyuncs.auth.sts.AssumeRoleRequest;
6
+import com.aliyuncs.auth.sts.AssumeRoleResponse;
7
+import com.aliyuncs.exceptions.ClientException;
8
+import com.aliyuncs.http.MethodType;
9
+import com.aliyuncs.profile.DefaultProfile;
10
+import com.aliyuncs.profile.IClientProfile;
11
+import com.example.civilizedcity.config.AliyunConfig;
12
+import lombok.extern.slf4j.Slf4j;
13
+import org.springframework.beans.factory.annotation.Autowired;
14
+import org.springframework.stereotype.Component;
15
+import org.springframework.web.multipart.MultipartFile;
16
+
17
+import java.io.*;
18
+import java.time.LocalDateTime;
19
+import java.time.format.DateTimeFormatter;
20
+import java.util.Base64;
21
+import java.util.HashMap;
22
+import java.util.Map;
23
+
24
+@Slf4j
25
+@Component
26
+public class OSSUtils {
27
+
28
+    private final static String STS_ENDPOINT = "sts.aliyuncs.com";
29
+
30
+    @Autowired
31
+    AliyunConfig aliyunConfig;
32
+
33
+    private String getMonth() {
34
+        return DateTimeFormatter.ofPattern("yyyyMM").format(LocalDateTime.now());
35
+    }
36
+
37
+    private String getUploadPath(String[] toDirs) {
38
+        String path = toDirs.length > 0 ? toDirs[0] : "/";
39
+        if (!path.endsWith("/")) {
40
+            path += "/";
41
+        }
42
+
43
+        return path + getMonth() + "/";
44
+    }
45
+
46
+    /**
47
+     * 上传 base64
48
+     * @param base64Str
49
+     * @param toDirs
50
+     * @return
51
+     * @throws IOException
52
+     */
53
+    public String putObject(String base64Str, String ...toDirs) throws IOException {
54
+        int index = base64Str.indexOf("base64,");
55
+
56
+        if (index > -1) {
57
+            index += 7;
58
+        } else {
59
+            index = 0;
60
+        }
61
+
62
+        String dataStr = base64Str.substring(index);
63
+        byte[] data = Base64.getDecoder().decode(dataStr);
64
+        ByteArrayInputStream inputStream = new ByteArrayInputStream(data);
65
+        String toDir = getUploadPath(toDirs);
66
+        String nwFName = toDir + System.currentTimeMillis() + ".png";
67
+        nwFName = StringUtils.trim(nwFName,"/");
68
+        return putFile(nwFName, inputStream);
69
+    }
70
+
71
+    /**
72
+     * 上传文件
73
+     * @param mf 上传的文件
74
+     * @param toDirs 上传到的目录
75
+     * @return
76
+     */
77
+    public String putObject(MultipartFile mf, String ... toDirs) throws IOException {
78
+        String fName = formatFileName(mf.getOriginalFilename());
79
+        String preFix = String.valueOf(System.currentTimeMillis());
80
+        String toDir = getUploadPath(toDirs);
81
+        String nwFName = toDir + preFix + "-" + fName;
82
+        nwFName = StringUtils.trim(nwFName,"/");
83
+
84
+        return putFile(nwFName, new ByteArrayInputStream(mf.getBytes()));
85
+    }
86
+
87
+    public String putObject(File f, String ... toDirs) throws FileNotFoundException {
88
+        String fName = formatFileName(f.getName());
89
+        String preFix = String.valueOf(System.currentTimeMillis());
90
+        String toDir = getUploadPath(toDirs);
91
+        String nwFName = toDir + preFix + "-" + fName;
92
+        nwFName = StringUtils.trim(nwFName,"/");
93
+
94
+        InputStream inputStream = new FileInputStream(f);
95
+        return putFile(nwFName, inputStream);
96
+    }
97
+
98
+    public String putObject(InputStream inputStream, String fName, String ... toDirs) {
99
+        String toDir = getUploadPath(toDirs);
100
+        String nwFName = toDir + fName;
101
+        nwFName = StringUtils.trim(nwFName,"/");
102
+        return putFile(nwFName, inputStream);
103
+    }
104
+
105
+    private String formatFileName(String fName) {
106
+        return StringUtils.ifNull(fName, StringUtils.random(16) + ".png");
107
+    }
108
+
109
+    private String putFile(String fname, InputStream input) {
110
+        OSSClient ossClient = new OSSClient(aliyunConfig.getOss().getEndpoint(), aliyunConfig.getAccessKeyId(), aliyunConfig.getAccessKeySecret());
111
+        ossClient.putObject(aliyunConfig.getOss().getBucketName(), fname, input);
112
+        ossClient.shutdown();
113
+
114
+        // String url = ossClient.generatePresignedUrl(AliOSSUtils.oss.getBucketName(), fname, expiration).toString();
115
+
116
+        String preURL = aliyunConfig.getOss().getBucketURL();
117
+        if (!preURL.endsWith("/")) {
118
+            preURL += "/";
119
+        }
120
+
121
+        return preURL + fname.replaceAll("\\ ", "%20").replaceAll("\\'", "%27");
122
+    }
123
+
124
+    /**
125
+     * 获取上传凭证
126
+     * @return
127
+     * @throws Exception
128
+     */
129
+    public Map<String, Object> getSTSAKToken() throws Exception {
130
+        AliyunConfig.Oss oss = aliyunConfig.getOss();
131
+
132
+        try {
133
+            // 添加endpoint(直接使用STS endpoint,无需添加region ID)
134
+            DefaultProfile.addEndpoint("", "Sts", STS_ENDPOINT);
135
+            // 构造default profile(参数留空,无需添加region ID)
136
+            IClientProfile profile = DefaultProfile.getProfile("", oss.getAccessKeyId(), oss.getAccessKeySecret());
137
+
138
+            // 用profile构造client
139
+            DefaultAcsClient client = new DefaultAcsClient(profile);
140
+            final AssumeRoleRequest request = new AssumeRoleRequest();
141
+            request.setSysMethod(MethodType.POST);
142
+            request.setRoleArn(oss.getArn());
143
+            request.setRoleSessionName(oss.getRoleSessionName());
144
+            request.setPolicy(null); // 若policy为空,则用户将获得该角色下所有权限
145
+            request.setDurationSeconds(30 * 60L); // 设置凭证有效时间 1800 秒 = 30 分钟
146
+            final AssumeRoleResponse response = client.getAcsResponse(request);
147
+
148
+            AssumeRoleResponse.Credentials credentials = response.getCredentials();
149
+
150
+            Map<String, Object> res = new HashMap<>();
151
+            res.put("stsToken", credentials.getSecurityToken());
152
+            res.put("accessKeySecret", credentials.getAccessKeySecret());
153
+            res.put("accessKeyId", credentials.getAccessKeyId());
154
+            res.put("expiration", credentials.getExpiration());
155
+
156
+            return res;
157
+        } catch (ClientException e) {
158
+            e.printStackTrace();
159
+            log.error("Error code: " + e.getErrCode());
160
+            log.error("Error message: " + e.getErrMsg());
161
+            log.error("RequestId: " + e.getRequestId());
162
+            throw new Exception(e.getMessage());
163
+        }
164
+    }
165
+
166
+}

+ 40
- 0
src/main/java/com/example/civilizedcity/config/AliyunConfig.java Näytä tiedosto

1
+package com.example.civilizedcity.config;
2
+
3
+import lombok.Data;
4
+import org.springframework.boot.context.properties.ConfigurationProperties;
5
+import org.springframework.stereotype.Component;
6
+
7
+@Data
8
+@Component
9
+@ConfigurationProperties(prefix = "aliyun")
10
+public class AliyunConfig {
11
+    private String accessKeyId;
12
+    private String accessKeySecret;
13
+
14
+    private Oss oss;
15
+
16
+//    private Sms sms;
17
+
18
+    @Data
19
+    public  static class Oss {
20
+        private String roleSessionName;
21
+        private String accessKeyId;
22
+        private String accessKeySecret;
23
+        private String arn;
24
+        private String region;
25
+        private String endpoint;
26
+        private String bucketName;
27
+        private String bucketURL;
28
+    }
29
+
30
+//    @Data
31
+//    public static class Sms {
32
+//        private Captcha captcha;
33
+//    }
34
+//
35
+//    @Data
36
+//    public static class Captcha {
37
+//        private String code;
38
+//        private String sign;
39
+//    }
40
+}

+ 32
- 0
src/main/java/com/example/civilizedcity/controller/CommController.java Näytä tiedosto

2
 
2
 
3
 
3
 
4
 import com.example.civilizedcity.common.BaseController;
4
 import com.example.civilizedcity.common.BaseController;
5
+import com.example.civilizedcity.common.OSSUtils;
5
 import com.example.civilizedcity.common.ResponseBean;
6
 import com.example.civilizedcity.common.ResponseBean;
6
 import io.swagger.annotations.Api;
7
 import io.swagger.annotations.Api;
7
 import io.swagger.annotations.ApiOperation;
8
 import io.swagger.annotations.ApiOperation;
8
 import io.swagger.annotations.ApiParam;
9
 import io.swagger.annotations.ApiParam;
10
+import org.springframework.beans.factory.annotation.Autowired;
9
 import org.springframework.web.bind.annotation.*;
11
 import org.springframework.web.bind.annotation.*;
12
+import org.springframework.web.multipart.MultipartFile;
13
+
14
+import java.io.IOException;
15
+import java.util.HashMap;
16
+import java.util.Map;
10
 
17
 
11
 @Api(tags ="通用")
18
 @Api(tags ="通用")
12
 @RestController
19
 @RestController
13
 @RequestMapping("/")
20
 @RequestMapping("/")
14
 public class CommController extends BaseController {
21
 public class CommController extends BaseController {
15
 
22
 
23
+    @Autowired
24
+    OSSUtils ossUtils;
25
+
16
     @GetMapping("/ma/captcha")
26
     @GetMapping("/ma/captcha")
17
     @ApiOperation(value="获取验证码", notes = "获取验证码", httpMethod = "GET", response = ResponseBean.class)
27
     @ApiOperation(value="获取验证码", notes = "获取验证码", httpMethod = "GET", response = ResponseBean.class)
18
     public ResponseBean getCaptcha(@ApiParam("手机号码") @RequestParam("phone") String phone) throws Exception {
28
     public ResponseBean getCaptcha(@ApiParam("手机号码") @RequestParam("phone") String phone) throws Exception {
19
 
29
 
20
         return ResponseBean.success("success");
30
         return ResponseBean.success("success");
21
     }
31
     }
32
+
33
+    /**
34
+     * 文件
35
+     * @param multipartFile
36
+     * @return
37
+     */
38
+    @ApiOperation(value = "文件上传", notes = "文件上传")
39
+    @PostMapping("/{client}/file")
40
+    public ResponseBean uploadImage(@ApiParam("客户端") @PathVariable String client,
41
+                                    @ApiParam("文件") @RequestParam("file") MultipartFile multipartFile,
42
+                                    @ApiParam("文件类型") @RequestParam(value = "fileType", defaultValue = "image") String fileType) {
43
+        try {
44
+            String url = ossUtils.putObject(multipartFile);
45
+
46
+            Map<String, Object> resp = new HashMap<>();
47
+            resp.put("url", url);
48
+            resp.put("fileType", fileType);
49
+            return ResponseBean.success(resp);
50
+        } catch (IOException e) {
51
+            return ResponseBean.error("上传图片失败: " + e.getMessage(), ResponseBean.ERROR_UNAVAILABLE);
52
+        }
53
+    }
22
 }
54
 }

+ 4
- 0
src/main/java/com/example/civilizedcity/controller/SysUserController.java Näytä tiedosto

117
     @ApiOperation("新增数据")
117
     @ApiOperation("新增数据")
118
     @PostMapping("/sysUser")
118
     @PostMapping("/sysUser")
119
     public ResponseBean add(@ApiParam("对象实体") @RequestBody SysUser sysUser) throws Exception {
119
     public ResponseBean add(@ApiParam("对象实体") @RequestBody SysUser sysUser) throws Exception {
120
+        if (null == sysUser.getOrgId()) {
121
+            sysUser.setOrgId(currentUser().getOrgId());
122
+        }
123
+
120
         sysUserService.mergeData(sysUser);
124
         sysUserService.mergeData(sysUser);
121
         return ResponseBean.success(sysUser);
125
         return ResponseBean.success(sysUser);
122
     }
126
     }

+ 54
- 0
src/main/java/com/example/civilizedcity/controller/TaIssueController.java Näytä tiedosto

4
 import com.baomidou.mybatisplus.core.metadata.IPage;
4
 import com.baomidou.mybatisplus.core.metadata.IPage;
5
 import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
5
 import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
6
 import com.example.civilizedcity.common.BaseController;
6
 import com.example.civilizedcity.common.BaseController;
7
+import com.example.civilizedcity.common.Constants;
7
 import com.example.civilizedcity.common.ResponseBean;
8
 import com.example.civilizedcity.common.ResponseBean;
9
+
10
+import java.time.LocalDateTime;
8
 import java.util.List;
11
 import java.util.List;
12
+
13
+import com.example.civilizedcity.entity.SysUser;
14
+import com.example.civilizedcity.entity.TaAttach;
15
+import com.example.civilizedcity.entity.TaIssueProcess;
16
+import com.example.civilizedcity.service.TaAttachService;
17
+import com.example.civilizedcity.service.TaIssueProcessService;
9
 import io.swagger.annotations.Api;
18
 import io.swagger.annotations.Api;
10
 import io.swagger.annotations.ApiOperation;
19
 import io.swagger.annotations.ApiOperation;
11
 import io.swagger.annotations.ApiParam;
20
 import io.swagger.annotations.ApiParam;
26
     
35
     
27
     @Autowired
36
     @Autowired
28
     private TaIssueService taIssueService;
37
     private TaIssueService taIssueService;
38
+
39
+    @Autowired
40
+    private TaAttachService taAttachService;
41
+
42
+    @Autowired
43
+    private TaIssueProcessService taIssueProcessService;
29
     
44
     
30
     /** 
45
     /** 
31
      * 通过ID查询单条数据 
46
      * 通过ID查询单条数据 
68
     @ApiOperation("新增数据")
83
     @ApiOperation("新增数据")
69
     @PostMapping("/taIssue")
84
     @PostMapping("/taIssue")
70
     public ResponseBean add(@ApiParam("对象实体") @RequestBody TaIssue taIssue) throws Exception {
85
     public ResponseBean add(@ApiParam("对象实体") @RequestBody TaIssue taIssue) throws Exception {
86
+        SysUser user = currentUser();
87
+
88
+        taIssue.setIssueId(null);
89
+        taIssue.setProcessNode(Constants.PROCESS_START);
90
+        taIssue.setProcessStatus(Constants.PROCESS_STATUS_READY);
91
+        taIssue.setProcessNum(1);
92
+        taIssue.setOrgId(user.getOrgId());
93
+        taIssue.setSourceType(Constants.ISSUE_SOURCE_INSPECTOR);
94
+        taIssue.setStatus(Constants.STATUS_NORMAL);
95
+        taIssue.setCreatePerson(user.getUserId());
96
+        taIssue.setPersonName(user.getName());
97
+        taIssue.setCreateDate(LocalDateTime.now());
71
         taIssueService.save(taIssue);
98
         taIssueService.save(taIssue);
99
+
100
+        // 保存文件
101
+        List<TaAttach> attachList = taIssue.getAttachList();
102
+        if (null != attachList && attachList.size() > 0) {
103
+            for (TaAttach item : attachList) {
104
+                item.setAttachId(null);
105
+                item.setOwnerType(Constants.ATTACH_SOURCE_ISSUE);
106
+                item.setOwnerId(taIssue.getIssueId().toString());
107
+                item.setStatus(Constants.STATUS_NORMAL);
108
+                item.setCreateDate(LocalDateTime.now());
109
+            }
110
+        }
111
+
112
+        taAttachService.saveBatch(attachList);
113
+
114
+        // 保存处理节点
115
+        TaIssueProcess process = new TaIssueProcess();
116
+        process.setIssueId(taIssue.getIssueId());
117
+        process.setOrgId(user.getOrgId());
118
+        process.setProcessNode(Constants.PROCESS_START);
119
+        process.setProcessStatus(Constants.PROCESS_STATUS_READY);
120
+        process.setStatus(Constants.STATUS_NORMAL);
121
+        process.setCreateUser(user.getUserId());
122
+        process.setUserName(user.getName());
123
+        process.setCreateDate(LocalDateTime.now());
124
+        taIssueProcessService.save(process);
125
+
72
         return ResponseBean.success(taIssue);
126
         return ResponseBean.success(taIssue);
73
     }
127
     }
74
     
128
     

+ 343
- 21
src/main/java/com/example/civilizedcity/controller/TaIssueProcessController.java Näytä tiedosto

1
 package com.example.civilizedcity.controller;
1
 package com.example.civilizedcity.controller;
2
 
2
 
3
+import cn.dev33.satoken.annotation.SaCheckPermission;
3
 import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
4
 import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
4
 import com.baomidou.mybatisplus.core.metadata.IPage;
5
 import com.baomidou.mybatisplus.core.metadata.IPage;
5
 import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
6
 import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
6
-import com.example.civilizedcity.common.BaseController;
7
-import com.example.civilizedcity.common.ResponseBean;
7
+import com.example.civilizedcity.common.*;
8
+
9
+import java.time.LocalDateTime;
8
 import java.util.List;
10
 import java.util.List;
11
+
12
+import com.example.civilizedcity.entity.SysUser;
13
+import com.example.civilizedcity.entity.TaIssue;
14
+import com.example.civilizedcity.service.TaIssueService;
9
 import io.swagger.annotations.Api;
15
 import io.swagger.annotations.Api;
10
 import io.swagger.annotations.ApiOperation;
16
 import io.swagger.annotations.ApiOperation;
11
 import io.swagger.annotations.ApiParam;
17
 import io.swagger.annotations.ApiParam;
26
     
32
     
27
     @Autowired
33
     @Autowired
28
     private TaIssueProcessService taIssueProcessService;
34
     private TaIssueProcessService taIssueProcessService;
35
+
36
+    @Autowired
37
+    private TaIssueService taIssueService;
29
     
38
     
30
     /** 
39
     /** 
31
      * 通过ID查询单条数据 
40
      * 通过ID查询单条数据 
58
         
67
         
59
         return ResponseBean.success(result);
68
         return ResponseBean.success(result);
60
     }
69
     }
61
-    
62
-    /** 
63
-     * 新增数据
64
-     *
65
-     * @param taIssueProcess 实例对象
66
-     * @return 实例对象
67
-     */
68
-    @ApiOperation("新增数据")
69
-    @PostMapping("/taIssueProcess")
70
-    public ResponseBean add(@ApiParam("对象实体") @RequestBody TaIssueProcess taIssueProcess) throws Exception {
71
-        taIssueProcessService.save(taIssueProcess);
72
-        return ResponseBean.success(taIssueProcess);
70
+
71
+    private TaIssue checkIssue(TaIssueProcess taIssueProcess) throws Exception {
72
+        if (null == taIssueProcess.getIssueId()) {
73
+            throw new Exception("找不到对应问题");
74
+        }
75
+
76
+        TaIssue taIssue = taIssueService.getById(taIssueProcess.getIssueId());
77
+        if (null == taIssue || taIssue.getStatus() == Constants.STATUS_DELETE) {
78
+            throw new Exception("找不到对应问题");
79
+        }
80
+
81
+        if (null == taIssueProcess.getPrevProcess()) {
82
+            throw new Exception("未找到上级流程");
83
+        }
84
+
85
+        if (Constants.PROCESS_END.equals(taIssue.getProcessNode())) {
86
+            throw new Exception("当前问题已办结");
87
+        }
88
+
89
+        if (Constants.ISSUE_SOURCE_CHECK.equals(taIssue.getSourceType())) {
90
+            throw new Exception("模拟测评问题不需要审核");
91
+        }
92
+
93
+        return taIssue;
94
+    }
95
+
96
+    private void updateUser(TaIssueProcess taIssueProcess, SysUser sysUser) {
97
+        taIssueProcess.setOrgId(sysUser.getOrgId());
98
+        taIssueProcess.setCreateUser(sysUser.getUserId());
99
+        taIssueProcess.setUserName(sysUser.getName());
100
+        taIssueProcess.setStatus(Constants.STATUS_NORMAL);
101
+        taIssueProcess.setCreateDate(LocalDateTime.now());
102
+    }
103
+
104
+    private void updateIssue(TaIssue taIssue, TaIssueProcess taIssueProcess) {
105
+        taIssue.setProcessNode(taIssueProcess.getProcessNode());
106
+        taIssue.setProcessStatus(taIssueProcess.getProcessNode());
107
+        taIssue.setOrgId(taIssueProcess.getOrgId());
108
+        taIssueService.updateById(taIssue);
73
     }
109
     }
74
     
110
     
75
-    /** 
76
-     * 更新数据
111
+    /**
112
+     * 审核
77
      *
113
      *
78
      * @param taIssueProcess 实例对象
114
      * @param taIssueProcess 实例对象
79
      * @return 实例对象
115
      * @return 实例对象
80
      */
116
      */
81
-    @ApiOperation("更新数据")
82
-    @PutMapping("/taIssueProcess/{id}")
83
-    public ResponseBean edit(@ApiParam("对象实体") @RequestBody TaIssueProcess taIssueProcess,
84
-                            @ApiParam("对象ID") @PathVariable Integer id ) throws Exception {
85
-        taIssueProcessService.updateById(taIssueProcess);
117
+    @SaCheckPermission("manager")
118
+    @ApiOperation("审核")
119
+    @PostMapping("/taIssueProcess/verify")
120
+    public ResponseBean verify(@ApiParam("对象实体") @RequestBody TaIssueProcess taIssueProcess) throws Exception {
121
+        TaIssue taIssue = checkIssue(taIssueProcess);
122
+
123
+        if (StringUtils.isEmpty(taIssueProcess.getProcessStatus())) {
124
+            return ResponseBean.error("请设置审批是否通过");
125
+        }
126
+
127
+        if (Constants.PROCESS_STATUS_REJECT.equals(taIssueProcess.getProcessStatus())) {
128
+            // 审核未通过
129
+            if (StringUtils.isEmpty(taIssueProcess.getProcessResult())) {
130
+                return ResponseBean.error("请填写未通过原因");
131
+            }
132
+        }
133
+
134
+        updateUser(taIssueProcess, currentUser());
135
+        taIssueProcess.setProcessNode(Constants.PROCESS_VERIFY);
136
+        taIssueProcessService.save(taIssueProcess);
137
+
138
+        updateIssue(taIssue, taIssueProcess);
139
+
86
         return ResponseBean.success(taIssueProcess);
140
         return ResponseBean.success(taIssueProcess);
87
     }
141
     }
142
+
143
+     /**
144
+      * 交办
145
+      *
146
+      * @param taIssueProcess 实例对象
147
+      * @return 实例对象
148
+      */
149
+     @SaCheckPermission("manager")
150
+     @ApiOperation("交办")
151
+     @PostMapping("/taIssueProcess/assigned")
152
+     public ResponseBean assigned(@ApiParam("对象实体") @RequestBody TaIssueProcess taIssueProcess) throws Exception {
153
+         TaIssue taIssue = checkIssue(taIssueProcess);
154
+
155
+         if (StringUtils.isEmpty(taIssueProcess.getNextOrg())) {
156
+             return ResponseBean.error("请指定责任单位");
157
+         }
158
+         if (StringUtils.isEmpty(taIssueProcess.getExpireDate())) {
159
+             return ResponseBean.error("请设置截止日期");
160
+         } else {
161
+             if (DateUtils.isAfter(taIssueProcess.getExpireDate() + " 23:59:59")) {
162
+                 return ResponseBean.error("请设置有效的截止日期");
163
+             }
164
+
165
+             taIssue.setExpireDate(taIssueProcess.getExpireDate());
166
+         }
167
+
168
+         updateUser(taIssueProcess, currentUser());
169
+         taIssueProcess.setProcessNode(Constants.PROCESS_ASSIGNED);
170
+         taIssueProcess.setProcessStatus(Constants.PROCESS_STATUS_READY);
171
+         taIssueProcessService.save(taIssueProcess);
172
+
173
+         updateIssue(taIssue, taIssueProcess);
174
+
175
+         return ResponseBean.success(taIssueProcess);
176
+     }
177
+
178
+     /**
179
+      * 单位驳回
180
+      *
181
+      * @param taIssueProcess 实例对象
182
+      * @return 实例对象
183
+      */
184
+     @SaCheckPermission("org_user")
185
+     @ApiOperation("单位驳回")
186
+     @PostMapping("/taIssueProcess/org/reject")
187
+     public ResponseBean reject(@ApiParam("对象实体") @RequestBody TaIssueProcess taIssueProcess) throws Exception {
188
+         TaIssue taIssue = checkIssue(taIssueProcess);
189
+
190
+         TaIssueProcess prevProcess = taIssueProcessService.getById(taIssueProcess.getPrevProcess());
191
+         if (null == prevProcess) {
192
+             return ResponseBean.error("未找到上级流程");
193
+         }
194
+
195
+         if (StringUtils.isEmpty(taIssueProcess.getProcessResult())) {
196
+             return ResponseBean.error("请填写未驳回原因");
197
+         }
198
+
199
+         updateUser(taIssueProcess, currentUser());
200
+         taIssueProcess.setNextOrg(prevProcess.getOrgId());
201
+         taIssueProcess.setProcessNode(Constants.PROCESS_ASSIGNED);
202
+         taIssueProcess.setProcessStatus(Constants.PROCESS_STATUS_REJECT);
203
+         taIssueProcessService.save(taIssueProcess);
204
+
205
+         updateIssue(taIssue, taIssueProcess);
206
+
207
+         return ResponseBean.success(taIssueProcess);
208
+     }
209
+
210
+     /**
211
+      * 延期申请
212
+      *
213
+      * @param taIssueProcess 实例对象
214
+      * @return 实例对象
215
+      */
216
+     @SaCheckPermission("org_user")
217
+     @ApiOperation("延期申请")
218
+     @PostMapping("/taIssueProcess/org/delay/apply")
219
+     public ResponseBean delayApply(@ApiParam("对象实体") @RequestBody TaIssueProcess taIssueProcess) throws Exception {
220
+         TaIssue taIssue = checkIssue(taIssueProcess);
221
+
222
+         if (StringUtils.isEmpty(taIssueProcess.getExpireDate())) {
223
+             return ResponseBean.error("请设置延期日期");
224
+         } else {
225
+             if (DateUtils.isAfter(taIssueProcess.getExpireDate() + " 23:59:59")) {
226
+                 return ResponseBean.error("请设置有效的延期日期");
227
+             }
228
+         }
229
+
230
+         TaIssueProcess prevProcess = taIssueProcessService.getById(taIssueProcess.getPrevProcess());
231
+         if (null == prevProcess) {
232
+             return ResponseBean.error("未找到上级流程");
233
+         }
234
+
235
+         updateUser(taIssueProcess, currentUser());
236
+         taIssueProcess.setNextOrg(prevProcess.getOrgId());
237
+         taIssueProcess.setProcessNode(Constants.PROCESS_ORG_DELAY_APPLY);
238
+         taIssueProcess.setProcessStatus(Constants.PROCESS_STATUS_READY);
239
+         taIssueProcessService.save(taIssueProcess);
240
+
241
+         updateIssue(taIssue, taIssueProcess);
242
+
243
+         return ResponseBean.success(taIssueProcess);
244
+     }
245
+
246
+     /**
247
+      * 延期审核
248
+      *
249
+      * @param taIssueProcess 实例对象
250
+      * @return 实例对象
251
+      */
252
+     @SaCheckPermission("manager")
253
+     @ApiOperation("延期审核")
254
+     @PostMapping("/taIssueProcess/delay/verify")
255
+     public ResponseBean delayVerify(@ApiParam("对象实体") @RequestBody TaIssueProcess taIssueProcess) throws Exception {
256
+         TaIssue taIssue = checkIssue(taIssueProcess);
257
+
258
+         TaIssueProcess prevProcess = taIssueProcessService.getById(taIssueProcess.getPrevProcess());
259
+         if (null == prevProcess) {
260
+             return ResponseBean.error("未找到上级流程");
261
+         }
262
+
263
+         if (!Constants.PROCESS_ORG_DELAY_APPLY.equals(prevProcess.getProcessNode())) {
264
+             return ResponseBean.error("上级流程验证不正确");
265
+         }
266
+
267
+         if (Constants.PROCESS_STATUS_REJECT.equals(taIssueProcess.getProcessStatus())) {
268
+             // 审核未通过
269
+             if (StringUtils.isEmpty(taIssueProcess.getProcessResult())) {
270
+                 return ResponseBean.error("请填写未通过原因");
271
+             }
272
+         } else {
273
+             taIssue.setExpireDate(prevProcess.getExpireDate());
274
+         }
275
+
276
+         updateUser(taIssueProcess, currentUser());
277
+         taIssueProcess.setNextOrg(prevProcess.getOrgId());
278
+         taIssueProcess.setProcessNode(Constants.PROCESS_DELAY_VERIFY);
279
+         taIssueProcessService.save(taIssueProcess);
280
+
281
+         updateIssue(taIssue, taIssueProcess);
282
+
283
+         return ResponseBean.success(taIssueProcess);
284
+     }
285
+
286
+     /**
287
+      * 单位交办
288
+      *
289
+      * @param taIssueProcess 实例对象
290
+      * @return 实例对象
291
+      */
292
+     @SaCheckPermission("org_user")
293
+     @ApiOperation("单位交办")
294
+     @PostMapping("/taIssueProcess/org/assigned")
295
+     public ResponseBean orgAssigned(@ApiParam("对象实体") @RequestBody TaIssueProcess taIssueProcess) throws Exception {
296
+         TaIssue taIssue = checkIssue(taIssueProcess);
297
+
298
+         updateUser(taIssueProcess, currentUser());
299
+         taIssueProcess.setProcessNode(Constants.PROCESS_ORG_ASSIGNED);
300
+         taIssueProcess.setProcessStatus(Constants.PROCESS_STATUS_READY);
301
+         taIssueProcessService.save(taIssueProcess);
302
+
303
+         updateIssue(taIssue, taIssueProcess);
304
+
305
+         return ResponseBean.success(taIssueProcess);
306
+     }
307
+
308
+     /**
309
+      * 单位审核
310
+      *
311
+      * @param taIssueProcess 实例对象
312
+      * @return 实例对象
313
+      */
314
+     @SaCheckPermission("org_manager")
315
+     @ApiOperation("单位审核")
316
+     @PostMapping("/taIssueProcess/org/verify")
317
+     public ResponseBean orgVerify(@ApiParam("对象实体") @RequestBody TaIssueProcess taIssueProcess) throws Exception {
318
+         TaIssue taIssue = checkIssue(taIssueProcess);
319
+
320
+         if (StringUtils.isEmpty(taIssueProcess.getProcessStatus())) {
321
+             return ResponseBean.error("请设置审批是否通过");
322
+         }
323
+
324
+         if (Constants.PROCESS_STATUS_REJECT.equals(taIssueProcess.getProcessStatus())) {
325
+             // 审核未通过
326
+             if (StringUtils.isEmpty(taIssueProcess.getProcessResult())) {
327
+                 return ResponseBean.error("请填写未通过原因");
328
+             }
329
+         }
330
+
331
+         updateUser(taIssueProcess, currentUser());
332
+         taIssueProcess.setProcessNode(Constants.PROCESS_ORG_VERIFY);
333
+         taIssueProcessService.save(taIssueProcess);
334
+
335
+         updateIssue(taIssue, taIssueProcess);
336
+
337
+         return ResponseBean.success(taIssueProcess);
338
+     }
339
+
340
+     /**
341
+      * 办结申请
342
+      *
343
+      * @param taIssueProcess 实例对象
344
+      * @return 实例对象
345
+      */
346
+     @SaCheckPermission("org_user")
347
+     @ApiOperation("办结申请")
348
+     @PostMapping("/taIssueProcess/org/finish/apply")
349
+     public ResponseBean finishApply(@ApiParam("对象实体") @RequestBody TaIssueProcess taIssueProcess) throws Exception {
350
+         TaIssue taIssue = checkIssue(taIssueProcess);
351
+
352
+         updateUser(taIssueProcess, currentUser());
353
+         taIssueProcess.setNextOrg(Constants.ROOT_ORG);
354
+         taIssueProcess.setProcessNode(Constants.PROCESS_ORG_FINISH_APPLY);
355
+         taIssueProcess.setProcessStatus(Constants.PROCESS_STATUS_READY);
356
+         taIssueProcessService.save(taIssueProcess);
357
+
358
+         updateIssue(taIssue, taIssueProcess);
359
+
360
+         return ResponseBean.success(taIssueProcess);
361
+     }
362
+
363
+
364
+     /**
365
+      * 办结审核
366
+      *
367
+      * @param taIssueProcess 实例对象
368
+      * @return 实例对象
369
+      */
370
+     @SaCheckPermission("manager")
371
+     @ApiOperation("办结审核")
372
+     @PostMapping("/taIssueProcess/finish/verify")
373
+     public ResponseBean finishVerify(@ApiParam("对象实体") @RequestBody TaIssueProcess taIssueProcess) throws Exception {
374
+         TaIssue taIssue = checkIssue(taIssueProcess);
375
+
376
+         TaIssueProcess prevProcess = taIssueProcessService.getById(taIssueProcess.getPrevProcess());
377
+         if (null == prevProcess) {
378
+             return ResponseBean.error("未找到上级流程");
379
+         }
380
+
381
+         if (!Constants.PROCESS_ORG_FINISH_APPLY.equals(prevProcess.getProcessNode())) {
382
+             return ResponseBean.error("上级流程验证不正确");
383
+         }
384
+
385
+         if (StringUtils.isEmpty(taIssueProcess.getProcessStatus())) {
386
+             return ResponseBean.error("请设置审批是否通过");
387
+         }
388
+
389
+         if (Constants.PROCESS_STATUS_REJECT.equals(taIssueProcess.getProcessStatus())) {
390
+             // 审核未通过
391
+             if (StringUtils.isEmpty(taIssueProcess.getProcessResult())) {
392
+                 return ResponseBean.error("请填写未通过原因");
393
+             }
394
+             taIssueProcess.setNextOrg(prevProcess.getOrgId());
395
+             taIssueProcess.setProcessNode(Constants.PROCESS_FINISH_VERIFY);
396
+         } else {
397
+             // 审核通过, 说明整个流程结束
398
+             taIssue.setProcessNode(Constants.PROCESS_END);
399
+             taIssue.setProcessStatus(Constants.PROCESS_STATUS_PASS);
400
+         }
401
+
402
+         updateUser(taIssueProcess, currentUser());
403
+         taIssueProcessService.save(taIssueProcess);
404
+
405
+         taIssue.setOrgId(taIssueProcess.getOrgId());
406
+         taIssueService.updateById(taIssue);
407
+
408
+         return ResponseBean.success(taIssueProcess);
409
+     }
88
     
410
     
89
     /** 
411
     /** 
90
      * 通过主键删除数据
412
      * 通过主键删除数据

+ 4
- 4
src/main/java/com/example/civilizedcity/entity/TaAttach.java Näytä tiedosto

25
 public class TaAttach implements Serializable,Cloneable{
25
 public class TaAttach implements Serializable,Cloneable{
26
     /** 附件ID */
26
     /** 附件ID */
27
     @ApiModelProperty(name = "附件ID",notes = "")
27
     @ApiModelProperty(name = "附件ID",notes = "")
28
-    @TableId(value = "attach_id", type = IdType.INPUT)
28
+    @TableId(value = "attach_id", type = IdType.AUTO)
29
     private Integer attachId ;
29
     private Integer attachId ;
30
-    /** 件类型 */
31
-    @ApiModelProperty(name = "件类型",notes = "")
32
-    private String attachType ;
30
+    /** 件类型 */
31
+    @ApiModelProperty(name = "件类型",notes = "")
32
+    private String fileType ;
33
     /** 附件名称 */
33
     /** 附件名称 */
34
     @ApiModelProperty(name = "附件名称",notes = "")
34
     @ApiModelProperty(name = "附件名称",notes = "")
35
     private String name ;
35
     private String name ;

+ 11
- 1
src/main/java/com/example/civilizedcity/entity/TaIssue.java Näytä tiedosto

1
 package com.example.civilizedcity.entity;
1
 package com.example.civilizedcity.entity;
2
 
2
 
3
+import com.baomidou.mybatisplus.annotation.TableField;
3
 import io.swagger.annotations.ApiModel;
4
 import io.swagger.annotations.ApiModel;
4
 import io.swagger.annotations.ApiModelProperty;
5
 import io.swagger.annotations.ApiModelProperty;
5
 import com.baomidou.mybatisplus.annotation.IdType;
6
 import com.baomidou.mybatisplus.annotation.IdType;
8
 import java.io.Serializable;
9
 import java.io.Serializable;
9
 import java.time.LocalDateTime;
10
 import java.time.LocalDateTime;
10
 import java.util.Date;
11
 import java.util.Date;
12
+import java.util.List;
13
+
11
 import lombok.Data;
14
 import lombok.Data;
12
 import lombok.EqualsAndHashCode;
15
 import lombok.EqualsAndHashCode;
13
 import lombok.experimental.Accessors;
16
 import lombok.experimental.Accessors;
25
 public class TaIssue implements Serializable,Cloneable{
28
 public class TaIssue implements Serializable,Cloneable{
26
       /** 问题ID */
29
       /** 问题ID */
27
       @ApiModelProperty(name = "问题ID",notes = "")
30
       @ApiModelProperty(name = "问题ID",notes = "")
28
-      @TableId(value = "issue_id", type = IdType.INPUT)
31
+      @TableId(value = "issue_id", type = IdType.AUTO)
29
       private Integer issueId ;
32
       private Integer issueId ;
30
       /** 标题 */
33
       /** 标题 */
31
       @ApiModelProperty(name = "标题",notes = "")
34
       @ApiModelProperty(name = "标题",notes = "")
54
       /** 处理状态 */
57
       /** 处理状态 */
55
       @ApiModelProperty(name = "处理状态",notes = "")
58
       @ApiModelProperty(name = "处理状态",notes = "")
56
       private String processStatus ;
59
       private String processStatus ;
60
+       /** 截止时间;YYYY-MM-DD */
61
+       @ApiModelProperty(name = "截止时间",notes = "YYYY-MM-DD")
62
+       private String expireDate ;
57
       /** 交办次数 */
63
       /** 交办次数 */
58
       @ApiModelProperty(name = "交办次数",notes = "")
64
       @ApiModelProperty(name = "交办次数",notes = "")
59
       private Integer processNum ;
65
       private Integer processNum ;
88
       @ApiModelProperty(name = "更新时间",notes = "")
94
       @ApiModelProperty(name = "更新时间",notes = "")
89
       private LocalDateTime updateDate ;
95
       private LocalDateTime updateDate ;
90
 
96
 
97
+
98
+      @TableField(exist = false)
99
+       @ApiModelProperty(name = "文件列表",notes = "")
100
+      private List<TaAttach> attachList;
91
 }
101
 }

+ 40
- 34
src/main/java/com/example/civilizedcity/entity/TaIssueProcess.java Näytä tiedosto

23
 @ApiModel(value = "问题处理",description = "")
23
 @ApiModel(value = "问题处理",description = "")
24
 @TableName("ta_issue_process")
24
 @TableName("ta_issue_process")
25
 public class TaIssueProcess implements Serializable,Cloneable{
25
 public class TaIssueProcess implements Serializable,Cloneable{
26
-     /** 过程ID */
27
-     @ApiModelProperty(name = "过程ID",notes = "")
28
-     @TableId(value = "process_id", type = IdType.INPUT)
29
-     private Integer processId ;
30
-     /** 问题ID */
31
-     @ApiModelProperty(name = "问题ID",notes = "")
32
-     private Integer issueId ;
33
-     /** 处理机构 */
34
-     @ApiModelProperty(name = "处理机构",notes = "")
35
-     private String orgId ;
36
-     /** 指定机构 */
37
-     @ApiModelProperty(name = "指定机构",notes = "")
38
-     private String nextOrg ;
39
-     /** 流程节点 */
40
-     @ApiModelProperty(name = "流程节点",notes = "")
41
-     private String processNode ;
42
-     /** 处理结果 */
43
-     @ApiModelProperty(name = "处理结果",notes = "")
44
-     private String processStatus ;
45
-     /** 结果说明 */
46
-     @ApiModelProperty(name = "结果说明",notes = "")
47
-     private String processResult ;
48
-     /** 状态 */
49
-     @ApiModelProperty(name = "状态",notes = "")
50
-     private Integer status ;
51
-     /** 处理人 */
52
-     @ApiModelProperty(name = "处理人",notes = "")
53
-     private String createUser ;
54
-     /** 处理人名称 */
55
-     @ApiModelProperty(name = "处理人名称",notes = "")
56
-     private String userName ;
57
-     /** 创建时间 */
58
-     @ApiModelProperty(name = "创建时间",notes = "")
59
-     private LocalDateTime createDate ;
26
+      /** 过程ID */
27
+      @ApiModelProperty(name = "过程ID",notes = "")
28
+      @TableId(value = "process_id", type = IdType.AUTO)
29
+      private Integer processId ;
30
+      /** 问题ID */
31
+      @ApiModelProperty(name = "问题ID",notes = "")
32
+      private Integer issueId ;
33
+       /** 上个流程ID */
34
+       @ApiModelProperty(name = "上个流程ID",notes = "")
35
+       private String prevProcess ;
36
+      /** 处理机构 */
37
+      @ApiModelProperty(name = "处理机构",notes = "")
38
+      private String orgId ;
39
+      /** 指定机构 */
40
+      @ApiModelProperty(name = "指定机构",notes = "")
41
+      private String nextOrg ;
42
+      /** 截止时间;YYYY-MM-DD */
43
+      @ApiModelProperty(name = "截止时间",notes = "YYYY-MM-DD")
44
+      private String expireDate ;
45
+      /** 流程节点 */
46
+      @ApiModelProperty(name = "流程节点",notes = "")
47
+      private String processNode ;
48
+      /** 处理结果 */
49
+      @ApiModelProperty(name = "处理结果",notes = "")
50
+      private String processStatus ;
51
+      /** 结果说明 */
52
+      @ApiModelProperty(name = "结果说明",notes = "")
53
+      private String processResult ;
54
+      /** 状态 */
55
+      @ApiModelProperty(name = "状态",notes = "")
56
+      private Integer status ;
57
+      /** 处理人 */
58
+      @ApiModelProperty(name = "处理人",notes = "")
59
+      private String createUser ;
60
+      /** 处理人名称 */
61
+      @ApiModelProperty(name = "处理人名称",notes = "")
62
+      private String userName ;
63
+      /** 创建时间 */
64
+      @ApiModelProperty(name = "创建时间",notes = "")
65
+      private LocalDateTime createDate ;
60
 
66
 
61
 }
67
 }

+ 2
- 1
src/main/java/com/example/civilizedcity/mapper/SysUserDutyMapper.java Näytä tiedosto

16
 public interface SysUserDutyMapper  extends BaseMapper<SysUserDuty>{
16
 public interface SysUserDutyMapper  extends BaseMapper<SysUserDuty>{
17
 
17
 
18
      List<String> getListByUser(@Param("userId") String userId);
18
      List<String> getListByUser(@Param("userId") String userId);
19
- }
19
+
20
+}

+ 3
- 1
src/main/java/com/example/civilizedcity/mapper/SysUserRoleMapper.java Näytä tiedosto

18
      SysUserRole getByUserAndRole(@Param("userId") String userId, @Param("roleId") String roleId);
18
      SysUserRole getByUserAndRole(@Param("userId") String userId, @Param("roleId") String roleId);
19
 
19
 
20
      int deleteNotIn(@Param("userId") String userId, @Param("idList") List<Integer> idList);
20
      int deleteNotIn(@Param("userId") String userId, @Param("idList") List<Integer> idList);
21
- }
21
+
22
+    List<String> getRoleList(@Param("userId") String userId);
23
+}

+ 6
- 0
src/main/java/com/example/civilizedcity/service/SysUserService.java Näytä tiedosto

4
 import com.example.civilizedcity.vo.ChangePassword;
4
 import com.example.civilizedcity.vo.ChangePassword;
5
 import com.example.civilizedcity.vo.LoginParam;
5
 import com.example.civilizedcity.vo.LoginParam;
6
 
6
 
7
+import java.util.List;
8
+
7
 /**
9
 /**
8
  * 用户表;(sys_user)表服务接口
10
  * 用户表;(sys_user)表服务接口
9
  *
11
  *
17
     boolean changePassword(SysUser user, ChangePassword param) throws Exception;
19
     boolean changePassword(SysUser user, ChangePassword param) throws Exception;
18
 
20
 
19
     boolean mergeData(SysUser sysUser) throws Exception;
21
     boolean mergeData(SysUser sysUser) throws Exception;
22
+
23
+    List<String> getRoleList(String userId);
24
+
25
+    List<String> getPermissionList(String userId);
20
 }
26
 }

+ 25
- 0
src/main/java/com/example/civilizedcity/service/impl/StpInterfaceImpl.java Näytä tiedosto

1
+package com.example.civilizedcity.service.impl;
2
+
3
+import cn.dev33.satoken.stp.StpInterface;
4
+import com.example.civilizedcity.service.SysUserService;
5
+import org.springframework.beans.factory.annotation.Autowired;
6
+import org.springframework.stereotype.Component;
7
+
8
+import java.util.List;
9
+
10
+@Component
11
+public class StpInterfaceImpl implements StpInterface {
12
+
13
+    @Autowired
14
+    SysUserService sysUserService;
15
+
16
+    @Override
17
+    public List<String> getPermissionList(Object loginId, String loginType) {
18
+        return sysUserService.getPermissionList(loginId.toString());
19
+    }
20
+
21
+    @Override
22
+    public List<String> getRoleList(Object loginId, String loginType) {
23
+        return sysUserService.getRoleList(loginId.toString());
24
+    }
25
+}

+ 14
- 0
src/main/java/com/example/civilizedcity/service/impl/SysUserServiceImpl.java Näytä tiedosto

7
 import com.example.civilizedcity.entity.SysRole;
7
 import com.example.civilizedcity.entity.SysRole;
8
 import com.example.civilizedcity.entity.SysUserRole;
8
 import com.example.civilizedcity.entity.SysUserRole;
9
 import com.example.civilizedcity.mapper.SysLoginMapper;
9
 import com.example.civilizedcity.mapper.SysLoginMapper;
10
+import com.example.civilizedcity.mapper.SysUserDutyMapper;
10
 import com.example.civilizedcity.mapper.SysUserRoleMapper;
11
 import com.example.civilizedcity.mapper.SysUserRoleMapper;
11
 import com.example.civilizedcity.vo.ChangePassword;
12
 import com.example.civilizedcity.vo.ChangePassword;
12
 import com.example.civilizedcity.vo.LoginParam;
13
 import com.example.civilizedcity.vo.LoginParam;
36
     @Autowired
37
     @Autowired
37
     SysUserRoleMapper sysUserRoleMapper;
38
     SysUserRoleMapper sysUserRoleMapper;
38
 
39
 
40
+    @Autowired
41
+    SysUserDutyMapper sysUserDutyMapper;
42
+
39
     @Override
43
     @Override
40
     public SysUser login(LoginParam loginParm) throws Exception {
44
     public SysUser login(LoginParam loginParm) throws Exception {
41
         SysLogin sysLogin = sysLoginMapper.getByAccount(loginParm.getAccount());
45
         SysLogin sysLogin = sysLoginMapper.getByAccount(loginParm.getAccount());
147
         return true;
151
         return true;
148
     }
152
     }
149
 
153
 
154
+    @Override
155
+    public List<String> getRoleList(String userId) {
156
+        return sysUserRoleMapper.getRoleList(userId);
157
+    }
158
+
159
+    @Override
160
+    public List<String> getPermissionList(String userId) {
161
+        return sysUserDutyMapper.getListByUser(userId);
162
+    }
163
+
150
     boolean checkPassword(String src, String targ, String salt) {
164
     boolean checkPassword(String src, String targ, String salt) {
151
         String newPass = EncryptUtils.md5(src, salt);
165
         String newPass = EncryptUtils.md5(src, salt);
152
         return targ.equals(newPass);
166
         return targ.equals(newPass);

+ 14
- 0
src/main/resources/application.yml Näytä tiedosto

38
     token:
38
     token:
39
     aesKey:
39
     aesKey:
40
 
40
 
41
+###
42
+aliyun:
43
+  accessKeyId: LTAI5tGjnZY6k799BHxhmqcm
44
+  accessKeySecret: eU1DmULbgHe2dnIg3P93634PO2vEh5
45
+  oss:
46
+    roleSessionName: shigongli
47
+    accessKeyId: LTAI4G9zCefU1m7sKmmBnzTc
48
+    accessKeySecret: Vaax5O7wTL0KZdSgd8L9cGBf8AgUqJ
49
+    arn: acs:ram::1636896505560465:role/ramosssts
50
+    region: oss-cn-shanghai
51
+    endpoint: oss-accelerate.aliyuncs.com
52
+    bucketName: yz-shigongli
53
+    bucketURL: https://yz-shigongli.oss-accelerate.aliyuncs.com
54
+
41
 
55
 
42
 sa-token:
56
 sa-token:
43
   # jwt秘钥
57
   # jwt秘钥

+ 8
- 0
src/main/resources/mapper/SysUserRoleMapper.xml Näytä tiedosto

23
             t.user_id = #{userId}
23
             t.user_id = #{userId}
24
           AND t.role_id = #{roleId}
24
           AND t.role_id = #{roleId}
25
     </select>
25
     </select>
26
+    <select id="getRoleList" resultType="java.lang.String">
27
+        SELECT
28
+            t.role_id
29
+        FROM
30
+            sys_user_role t
31
+        WHERE
32
+            t.user_id = #{userId}
33
+    </select>
26
 </mapper>
34
 </mapper>