Yansen 2 years ago
parent
commit
1c256df219
28 changed files with 1194 additions and 724 deletions
  1. 29
    6
      db/.back_文明创办/文明创办-backup-202323142950.pdma.json
  2. 531
    11
      db/.back_文明创办/文明创办-backup-202323151753.pdma.json
  3. 78
    4
      db/文明创办.pdma.json
  4. 51
    60
      src/main/java/com/example/civilizedcity/common/Constants.java
  5. 1
    1
      src/main/java/com/example/civilizedcity/controller/TaCheckAnswerItemController.java
  6. 1
    1
      src/main/java/com/example/civilizedcity/controller/TaFeedbackController.java
  7. 28
    50
      src/main/java/com/example/civilizedcity/controller/TaIssueApplyController.java
  8. 17
    87
      src/main/java/com/example/civilizedcity/controller/TaIssueController.java
  9. 8
    328
      src/main/java/com/example/civilizedcity/controller/TaIssueProcessController.java
  10. 43
    41
      src/main/java/com/example/civilizedcity/controller/TaOrgIssueController.java
  11. 3
    0
      src/main/java/com/example/civilizedcity/entity/TaFeedback.java
  12. 3
    0
      src/main/java/com/example/civilizedcity/entity/TaIssue.java
  13. 3
    0
      src/main/java/com/example/civilizedcity/entity/TaOrgIssue.java
  14. 5
    1
      src/main/java/com/example/civilizedcity/mapper/TaAttachMapper.java
  15. 1
    1
      src/main/java/com/example/civilizedcity/mapper/TaFeedbackMapper.java
  16. 7
    0
      src/main/java/com/example/civilizedcity/service/TaIssueService.java
  17. 3
    1
      src/main/java/com/example/civilizedcity/service/TaOrgIssueService.java
  18. 1
    7
      src/main/java/com/example/civilizedcity/service/impl/TaAttachServiceImpl.java
  19. 1
    1
      src/main/java/com/example/civilizedcity/service/impl/TaCheckItemServiceImpl.java
  20. 28
    18
      src/main/java/com/example/civilizedcity/service/impl/TaFeedbackServiceImpl.java
  21. 126
    57
      src/main/java/com/example/civilizedcity/service/impl/TaIssueApplyServiceImpl.java
  22. 125
    8
      src/main/java/com/example/civilizedcity/service/impl/TaIssueServiceImpl.java
  23. 15
    15
      src/main/java/com/example/civilizedcity/service/impl/TaMessageServiceImpl.java
  24. 54
    7
      src/main/java/com/example/civilizedcity/service/impl/TaOrgIssueServiceImpl.java
  25. 13
    0
      src/main/resources/mapper/TaAttachMapper.xml
  26. 9
    9
      src/main/resources/mapper/TaFeedbackMapper.xml
  27. 6
    6
      src/main/resources/mapper/TaIssueMapper.xml
  28. 4
    4
      src/main/resources/mapper/TaOrgIssueMapper.xml

db/.back_文明创办/文明创办-backup-2023131183934.pdma.json → db/.back_文明创办/文明创办-backup-202323142950.pdma.json View File

4
   "avatar": "",
4
   "avatar": "",
5
   "version": "4.1.4",
5
   "version": "4.1.4",
6
   "createdTime": "2022-12-12 09:36:12",
6
   "createdTime": "2022-12-12 09:36:12",
7
-  "updatedTime": "2023-1-31 18:39:19",
7
+  "updatedTime": "2023-1-31 18:39:34",
8
   "dbConns": [],
8
   "dbConns": [],
9
   "profile": {
9
   "profile": {
10
     "default": {
10
     "default": {
8636
       "id": "78C3BB38-9B37-445B-A311-168B4682FE5E",
8636
       "id": "78C3BB38-9B37-445B-A311-168B4682FE5E",
8637
       "env": {
8637
       "env": {
8638
         "base": {
8638
         "base": {
8639
-          "nameSpace": "",
8640
-          "codeRoot": ""
8641
-        }
8639
+          "nameSpace": "com.example.civilizedcity",
8640
+          "codeRoot": "TsStatData"
8641
+        },
8642
+        "template": {
8643
+          "JavaMybatisPlus": {
8644
+            "Controller": {
8645
+              "suffix": "controller/{{=it.codeRoot}}Controller.java"
8646
+            },
8647
+            "Service": {
8648
+              "suffix": "service/{{=it.codeRoot}}Service.java"
8649
+            },
8650
+            "ServiceImpl": {
8651
+              "suffix": "service/impl/{{=it. codeRoot}}ServiceImpl.java"
8652
+            },
8653
+            "Mapper": {
8654
+              "suffix": "mapper/{{=it.codeRoot}}Mapper.java"
8655
+            },
8656
+            "Mapper.xml": {
8657
+              "suffix": "mapper/{{=it.codeRoot}}Mapper.xml"
8658
+            },
8659
+            "Entity": {
8660
+              "suffix": "entity/{{=it.codeRoot}}.java"
8661
+            }
8662
+          }
8663
+        },
8664
+        "custom": {}
8642
       },
8665
       },
8643
       "defKey": "ts_stat_data",
8666
       "defKey": "ts_stat_data",
8644
       "defName": "常用统计",
8667
       "defName": "常用统计",
8757
           "primaryKey": false,
8780
           "primaryKey": false,
8758
           "notNull": false,
8781
           "notNull": false,
8759
           "autoIncrement": false,
8782
           "autoIncrement": false,
8760
-          "defaultValue": "1",
8783
+          "defaultValue": "",
8761
           "hideInGraph": true,
8784
           "hideInGraph": true,
8762
           "refDict": "",
8785
           "refDict": "",
8763
           "uiHint": "",
8786
           "uiHint": "",
8774
           "primaryKey": false,
8797
           "primaryKey": false,
8775
           "notNull": false,
8798
           "notNull": false,
8776
           "autoIncrement": false,
8799
           "autoIncrement": false,
8777
-          "defaultValue": "",
8800
+          "defaultValue": "0",
8778
           "hideInGraph": true,
8801
           "hideInGraph": true,
8779
           "refDict": "",
8802
           "refDict": "",
8780
           "uiHint": "",
8803
           "uiHint": "",

db/.back_文明创办/文明创办-backup-202318151439.pdma.json → db/.back_文明创办/文明创办-backup-202323151753.pdma.json View File

4
   "avatar": "",
4
   "avatar": "",
5
   "version": "4.1.4",
5
   "version": "4.1.4",
6
   "createdTime": "2022-12-12 09:36:12",
6
   "createdTime": "2022-12-12 09:36:12",
7
-  "updatedTime": "2023-1-8 15:14:32",
7
+  "updatedTime": "2023-2-3 14:29:50",
8
   "dbConns": [],
8
   "dbConns": [],
9
   "profile": {
9
   "profile": {
10
     "default": {
10
     "default": {
1204
           "uiHint": "",
1204
           "uiHint": "",
1205
           "id": "C3E43687-58A1-4E99-AE11-085F9B6688D7"
1205
           "id": "C3E43687-58A1-4E99-AE11-085F9B6688D7"
1206
         },
1206
         },
1207
+        {
1208
+          "defKey": "is_user",
1209
+          "defName": "是否系统用户",
1210
+          "comment": "0市民,1系统用户",
1211
+          "type": "",
1212
+          "len": "",
1213
+          "scale": "",
1214
+          "primaryKey": false,
1215
+          "notNull": false,
1216
+          "autoIncrement": false,
1217
+          "defaultValue": "1",
1218
+          "hideInGraph": false,
1219
+          "refDict": "",
1220
+          "extProps": {},
1221
+          "domain": "6BC8F04B-6CFA-4995-98D3-318F5CDD774E",
1222
+          "id": "D1C0A2CD-89DB-44DF-918F-EA536E39761F"
1223
+        },
1207
         {
1224
         {
1208
           "defKey": "create_user",
1225
           "defKey": "create_user",
1209
           "defName": "创建人",
1226
           "defName": "创建人",
3193
           "id": "CC5551B8-C645-4192-9A06-E5820C6F3357"
3210
           "id": "CC5551B8-C645-4192-9A06-E5820C6F3357"
3194
         },
3211
         },
3195
         {
3212
         {
3196
-          "defKey": "conent",
3213
+          "defKey": "content",
3197
           "defName": "正文",
3214
           "defName": "正文",
3198
           "comment": "",
3215
           "comment": "",
3199
           "type": "TEXT",
3216
           "type": "TEXT",
5639
       "env": {
5656
       "env": {
5640
         "base": {
5657
         "base": {
5641
           "nameSpace": "com.example.civilizedcity",
5658
           "nameSpace": "com.example.civilizedcity",
5642
-          "codeRoot": "TdQuestion"
5659
+          "codeRoot": "TdLocQuestion"
5643
         },
5660
         },
5644
         "template": {
5661
         "template": {
5645
           "JavaMybatisPlus": {
5662
           "JavaMybatisPlus": {
6291
           "domain": "",
6308
           "domain": "",
6292
           "id": "DD228B07-C934-4B55-BFBD-844E4CBC0A75"
6309
           "id": "DD228B07-C934-4B55-BFBD-844E4CBC0A75"
6293
         },
6310
         },
6311
+        {
6312
+          "defKey": "fill_unit",
6313
+          "defName": "填空题单位",
6314
+          "comment": "",
6315
+          "type": "",
6316
+          "len": "",
6317
+          "scale": "",
6318
+          "primaryKey": false,
6319
+          "notNull": false,
6320
+          "autoIncrement": false,
6321
+          "defaultValue": "",
6322
+          "hideInGraph": false,
6323
+          "refDict": "",
6324
+          "extProps": {},
6325
+          "domain": "73FD2BAD-2358-4336-B96D-45DC897BD792",
6326
+          "id": "C81DEB4C-049A-4D1D-B506-21C920AE4286"
6327
+        },
6294
         {
6328
         {
6295
           "defKey": "stand",
6329
           "defKey": "stand",
6296
           "defName": "评分标准",
6330
           "defName": "评分标准",
6904
       "id": "EF3D4E17-6CE0-4944-B1DC-40280B2B689F",
6938
       "id": "EF3D4E17-6CE0-4944-B1DC-40280B2B689F",
6905
       "env": {
6939
       "env": {
6906
         "base": {
6940
         "base": {
6907
-          "nameSpace": "",
6908
-          "codeRoot": ""
6909
-        }
6941
+          "nameSpace": "com.example.civilizedcity",
6942
+          "codeRoot": "TaFeedback"
6943
+        },
6944
+        "template": {
6945
+          "JavaMybatisPlus": {
6946
+            "Controller": {
6947
+              "suffix": "controller/{{=it.codeRoot}}Controller.java"
6948
+            },
6949
+            "Service": {
6950
+              "suffix": "service/{{=it.codeRoot}}Service.java"
6951
+            },
6952
+            "ServiceImpl": {
6953
+              "suffix": "service/impl/{{=it. codeRoot}}ServiceImpl.java"
6954
+            },
6955
+            "Mapper": {
6956
+              "suffix": "mapper/{{=it.codeRoot}}Mapper.java"
6957
+            },
6958
+            "Mapper.xml": {
6959
+              "suffix": "mapper/{{=it.codeRoot}}Mapper.xml"
6960
+            },
6961
+            "Entity": {
6962
+              "suffix": "entity/{{=it.codeRoot}}.java"
6963
+            }
6964
+          }
6965
+        },
6966
+        "custom": {}
6910
       },
6967
       },
6911
       "defKey": "ta_feedback",
6968
       "defKey": "ta_feedback",
6912
       "defName": "反馈表",
6969
       "defName": "反馈表",
6989
           "scale": "",
7046
           "scale": "",
6990
           "primaryKey": true,
7047
           "primaryKey": true,
6991
           "notNull": true,
7048
           "notNull": true,
6992
-          "autoIncrement": true,
7049
+          "autoIncrement": false,
6993
           "defaultValue": "",
7050
           "defaultValue": "",
6994
           "hideInGraph": true,
7051
           "hideInGraph": true,
6995
           "domain": "16120F75-6AA7-4483-868D-F07F511BB081",
7052
           "domain": "16120F75-6AA7-4483-868D-F07F511BB081",
7031
           "domain": "",
7088
           "domain": "",
7032
           "id": "2B36F8F1-9C06-434F-B4D5-0A28D587BA24"
7089
           "id": "2B36F8F1-9C06-434F-B4D5-0A28D587BA24"
7033
         },
7090
         },
7091
+        {
7092
+          "defKey": "location",
7093
+          "defName": "定位",
7094
+          "comment": "",
7095
+          "type": "VARCHAR",
7096
+          "len": 32,
7097
+          "scale": "",
7098
+          "primaryKey": false,
7099
+          "notNull": false,
7100
+          "autoIncrement": false,
7101
+          "defaultValue": "",
7102
+          "hideInGraph": false,
7103
+          "refDict": "",
7104
+          "extProps": {},
7105
+          "id": "2D8D31C7-FD0E-48DB-9538-FCF3B79E93AB"
7106
+        },
7107
+        {
7108
+          "defKey": "addr",
7109
+          "defName": "具体位置",
7110
+          "comment": "",
7111
+          "type": "",
7112
+          "len": "",
7113
+          "scale": "",
7114
+          "primaryKey": false,
7115
+          "notNull": false,
7116
+          "autoIncrement": false,
7117
+          "defaultValue": "",
7118
+          "hideInGraph": false,
7119
+          "domain": "9092C4E0-1A54-4859-ABBB-5B62DBC27573",
7120
+          "refDict": "",
7121
+          "extProps": {},
7122
+          "id": "215DDE0F-97A2-4DBC-99D5-31C8AF2768E9"
7123
+        },
7034
         {
7124
         {
7035
           "defKey": "person_id",
7125
           "defKey": "person_id",
7036
           "defName": "反馈人ID",
7126
           "defName": "反馈人ID",
7085
         {
7175
         {
7086
           "defKey": "verify_status",
7176
           "defKey": "verify_status",
7087
           "defName": "审核状态",
7177
           "defName": "审核状态",
7088
-          "comment": "0未审,1通过,2驳回",
7178
+          "comment": "null未审,pass通过,reject驳回",
7089
           "type": "",
7179
           "type": "",
7090
           "len": "",
7180
           "len": "",
7091
           "scale": "",
7181
           "scale": "",
7092
           "primaryKey": false,
7182
           "primaryKey": false,
7093
           "notNull": false,
7183
           "notNull": false,
7094
           "autoIncrement": false,
7184
           "autoIncrement": false,
7095
-          "defaultValue": "0",
7185
+          "defaultValue": "",
7096
           "hideInGraph": false,
7186
           "hideInGraph": false,
7097
           "refDict": "",
7187
           "refDict": "",
7098
           "extProps": {},
7188
           "extProps": {},
7099
-          "domain": "6BC8F04B-6CFA-4995-98D3-318F5CDD774E",
7189
+          "domain": "73FD2BAD-2358-4336-B96D-45DC897BD792",
7100
           "id": "90567F1C-10F8-4BB2-9F32-B92B7077091B"
7190
           "id": "90567F1C-10F8-4BB2-9F32-B92B7077091B"
7101
         },
7191
         },
7102
         {
7192
         {
7116
           "domain": "9092C4E0-1A54-4859-ABBB-5B62DBC27573",
7206
           "domain": "9092C4E0-1A54-4859-ABBB-5B62DBC27573",
7117
           "id": "2DD06082-1A99-45ED-A4FC-2A09B4674DCB"
7207
           "id": "2DD06082-1A99-45ED-A4FC-2A09B4674DCB"
7118
         },
7208
         },
7209
+        {
7210
+          "defKey": "verify_date",
7211
+          "defName": "审核日期",
7212
+          "comment": "",
7213
+          "type": "",
7214
+          "len": "",
7215
+          "scale": "",
7216
+          "primaryKey": false,
7217
+          "notNull": false,
7218
+          "autoIncrement": false,
7219
+          "defaultValue": "",
7220
+          "hideInGraph": false,
7221
+          "refDict": "",
7222
+          "extProps": {},
7223
+          "domain": "7CFFA0D3-6A93-4DDC-BC10-DF21211064DC",
7224
+          "id": "3F742306-C7EA-4CB8-BF0C-12E62CE0BC4B"
7225
+        },
7119
         {
7226
         {
7120
           "defKey": "issue_id",
7227
           "defKey": "issue_id",
7121
           "defName": "关联问题单",
7228
           "defName": "关联问题单",
7375
           "domain": "",
7482
           "domain": "",
7376
           "id": "EC9AB5F8-E387-4E40-B948-2581DA3E9D4D"
7483
           "id": "EC9AB5F8-E387-4E40-B948-2581DA3E9D4D"
7377
         },
7484
         },
7485
+        {
7486
+          "defKey": "report_issue",
7487
+          "defName": "上报问题",
7488
+          "comment": "",
7489
+          "type": "",
7490
+          "len": "",
7491
+          "scale": "",
7492
+          "primaryKey": false,
7493
+          "notNull": false,
7494
+          "autoIncrement": false,
7495
+          "defaultValue": "0",
7496
+          "hideInGraph": false,
7497
+          "refDict": "",
7498
+          "extProps": {},
7499
+          "domain": "6BC8F04B-6CFA-4995-98D3-318F5CDD774E",
7500
+          "id": "18CF14DD-048B-4743-81D9-0D6428EDBF54"
7501
+        },
7378
         {
7502
         {
7379
           "defKey": "sort_no",
7503
           "defKey": "sort_no",
7380
           "defName": "排序",
7504
           "defName": "排序",
7943
           "id": "649F17F6-D2C1-4AAD-B913-ED39F26E4AF4",
8067
           "id": "649F17F6-D2C1-4AAD-B913-ED39F26E4AF4",
7944
           "uiHint": ""
8068
           "uiHint": ""
7945
         },
8069
         },
8070
+        {
8071
+          "defKey": "process_node",
8072
+          "defName": "流程节点",
8073
+          "comment": "",
8074
+          "type": "",
8075
+          "len": "",
8076
+          "scale": "",
8077
+          "primaryKey": false,
8078
+          "notNull": false,
8079
+          "autoIncrement": false,
8080
+          "defaultValue": "",
8081
+          "hideInGraph": false,
8082
+          "domain": "73FD2BAD-2358-4336-B96D-45DC897BD792",
8083
+          "refDict": "",
8084
+          "extProps": {},
8085
+          "id": "A3EEF4DF-16EC-405B-921C-9F0E41363200"
8086
+        },
7946
         {
8087
         {
7947
           "defKey": "process_status",
8088
           "defKey": "process_status",
7948
           "defName": "业务单状态",
8089
           "defName": "业务单状态",
8332
       ],
8473
       ],
8333
       "correlations": [],
8474
       "correlations": [],
8334
       "indexes": []
8475
       "indexes": []
8476
+    },
8477
+    {
8478
+      "id": "38420D50-01AB-4E31-84D3-20192D26E25F",
8479
+      "env": {
8480
+        "base": {
8481
+          "nameSpace": "com.example.civilizedcity",
8482
+          "codeRoot": "TaCheckStand"
8483
+        },
8484
+        "template": {
8485
+          "JavaMybatisPlus": {
8486
+            "Controller": {
8487
+              "suffix": "controller/{{=it.codeRoot}}Controller.java"
8488
+            },
8489
+            "Service": {
8490
+              "suffix": "service/{{=it.codeRoot}}Service.java"
8491
+            },
8492
+            "ServiceImpl": {
8493
+              "suffix": "service/impl/{{=it. codeRoot}}ServiceImpl.java"
8494
+            },
8495
+            "Mapper": {
8496
+              "suffix": "mapper/{{=it.codeRoot}}Mapper.java"
8497
+            },
8498
+            "Mapper.xml": {
8499
+              "suffix": "mapper/{{=it.codeRoot}}Mapper.xml"
8500
+            },
8501
+            "Entity": {
8502
+              "suffix": "entity/{{=it.codeRoot}}.java"
8503
+            }
8504
+          }
8505
+        },
8506
+        "custom": {}
8507
+      },
8508
+      "defKey": "ta_check_stand",
8509
+      "defName": "测评标准",
8510
+      "comment": "",
8511
+      "properties": {},
8512
+      "nameTemplate": "{defKey}[{defName}]",
8513
+      "headers": [
8514
+        {
8515
+          "refKey": "hideInGraph",
8516
+          "hideInGraph": true
8517
+        },
8518
+        {
8519
+          "refKey": "defKey",
8520
+          "hideInGraph": false
8521
+        },
8522
+        {
8523
+          "refKey": "defName",
8524
+          "hideInGraph": false
8525
+        },
8526
+        {
8527
+          "refKey": "primaryKey",
8528
+          "hideInGraph": false
8529
+        },
8530
+        {
8531
+          "refKey": "notNull",
8532
+          "hideInGraph": true
8533
+        },
8534
+        {
8535
+          "refKey": "autoIncrement",
8536
+          "hideInGraph": true
8537
+        },
8538
+        {
8539
+          "refKey": "domain",
8540
+          "hideInGraph": true
8541
+        },
8542
+        {
8543
+          "refKey": "type",
8544
+          "hideInGraph": false
8545
+        },
8546
+        {
8547
+          "refKey": "len",
8548
+          "hideInGraph": false
8549
+        },
8550
+        {
8551
+          "refKey": "scale",
8552
+          "hideInGraph": false
8553
+        },
8554
+        {
8555
+          "refKey": "comment",
8556
+          "hideInGraph": true
8557
+        },
8558
+        {
8559
+          "refKey": "refDict",
8560
+          "hideInGraph": true
8561
+        },
8562
+        {
8563
+          "refKey": "defaultValue",
8564
+          "hideInGraph": true
8565
+        },
8566
+        {
8567
+          "refKey": "isStandard",
8568
+          "hideInGraph": false
8569
+        },
8570
+        {
8571
+          "refKey": "uiHint",
8572
+          "hideInGraph": true
8573
+        },
8574
+        {
8575
+          "refKey": "extProps",
8576
+          "hideInGraph": true
8577
+        }
8578
+      ],
8579
+      "fields": [
8580
+        {
8581
+          "defKey": "statnd_id",
8582
+          "defName": "标准ID",
8583
+          "comment": "",
8584
+          "type": "",
8585
+          "len": 32,
8586
+          "scale": "",
8587
+          "primaryKey": true,
8588
+          "notNull": true,
8589
+          "autoIncrement": false,
8590
+          "defaultValue": "",
8591
+          "hideInGraph": true,
8592
+          "domain": "16120F75-6AA7-4483-868D-F07F511BB081",
8593
+          "refDict": "",
8594
+          "uiHint": "",
8595
+          "id": "219A66C3-6D3F-4F1E-A572-9E5294556142"
8596
+        },
8597
+        {
8598
+          "defKey": "content",
8599
+          "defName": "测评标准",
8600
+          "comment": "",
8601
+          "type": "TEXT",
8602
+          "len": 0,
8603
+          "scale": "",
8604
+          "primaryKey": false,
8605
+          "notNull": false,
8606
+          "autoIncrement": false,
8607
+          "defaultValue": "",
8608
+          "hideInGraph": false,
8609
+          "refDict": "",
8610
+          "domain": "",
8611
+          "id": "30776463-B5E8-44DB-B5B6-45817A48E59F",
8612
+          "uiHint": ""
8613
+        },
8614
+        {
8615
+          "defKey": "status",
8616
+          "defName": "状态",
8617
+          "comment": "",
8618
+          "domain": "6BC8F04B-6CFA-4995-98D3-318F5CDD774E",
8619
+          "type": "",
8620
+          "len": "",
8621
+          "scale": "",
8622
+          "primaryKey": false,
8623
+          "notNull": false,
8624
+          "autoIncrement": false,
8625
+          "defaultValue": "1",
8626
+          "hideInGraph": true,
8627
+          "refDict": "",
8628
+          "uiHint": "",
8629
+          "id": "20019E0F-5BA3-4E82-B296-5E31564BCAED"
8630
+        },
8631
+        {
8632
+          "defKey": "create_user",
8633
+          "defName": "创建人",
8634
+          "comment": "",
8635
+          "domain": "16120F75-6AA7-4483-868D-F07F511BB081",
8636
+          "type": "",
8637
+          "len": "",
8638
+          "scale": "",
8639
+          "primaryKey": false,
8640
+          "notNull": false,
8641
+          "autoIncrement": false,
8642
+          "defaultValue": "",
8643
+          "hideInGraph": true,
8644
+          "refDict": "",
8645
+          "uiHint": "",
8646
+          "id": "2F888196-3939-4DB3-8C53-CB615790D436"
8647
+        },
8648
+        {
8649
+          "defKey": "create_date",
8650
+          "defName": "创建时间",
8651
+          "comment": "",
8652
+          "domain": "7CFFA0D3-6A93-4DDC-BC10-DF21211064DC",
8653
+          "type": "",
8654
+          "len": "",
8655
+          "scale": "",
8656
+          "primaryKey": false,
8657
+          "notNull": false,
8658
+          "autoIncrement": false,
8659
+          "defaultValue": "CURRENT_TIMESTAMP",
8660
+          "hideInGraph": true,
8661
+          "refDict": "",
8662
+          "uiHint": "",
8663
+          "id": "DED8CFDE-66A8-4460-A94A-2AAA1D169C5D"
8664
+        }
8665
+      ],
8666
+      "correlations": [],
8667
+      "indexes": []
8668
+    },
8669
+    {
8670
+      "id": "78C3BB38-9B37-445B-A311-168B4682FE5E",
8671
+      "env": {
8672
+        "base": {
8673
+          "nameSpace": "com.example.civilizedcity",
8674
+          "codeRoot": "TsStatData"
8675
+        },
8676
+        "template": {
8677
+          "JavaMybatisPlus": {
8678
+            "Controller": {
8679
+              "suffix": "controller/{{=it.codeRoot}}Controller.java"
8680
+            },
8681
+            "Service": {
8682
+              "suffix": "service/{{=it.codeRoot}}Service.java"
8683
+            },
8684
+            "ServiceImpl": {
8685
+              "suffix": "service/impl/{{=it. codeRoot}}ServiceImpl.java"
8686
+            },
8687
+            "Mapper": {
8688
+              "suffix": "mapper/{{=it.codeRoot}}Mapper.java"
8689
+            },
8690
+            "Mapper.xml": {
8691
+              "suffix": "mapper/{{=it.codeRoot}}Mapper.xml"
8692
+            },
8693
+            "Entity": {
8694
+              "suffix": "entity/{{=it.codeRoot}}.java"
8695
+            }
8696
+          }
8697
+        },
8698
+        "custom": {}
8699
+      },
8700
+      "defKey": "ts_stat_data",
8701
+      "defName": "常用统计",
8702
+      "comment": "",
8703
+      "properties": {},
8704
+      "nameTemplate": "{defKey}[{defName}]",
8705
+      "headers": [
8706
+        {
8707
+          "refKey": "hideInGraph",
8708
+          "hideInGraph": true
8709
+        },
8710
+        {
8711
+          "refKey": "defKey",
8712
+          "hideInGraph": false
8713
+        },
8714
+        {
8715
+          "refKey": "defName",
8716
+          "hideInGraph": false
8717
+        },
8718
+        {
8719
+          "refKey": "primaryKey",
8720
+          "hideInGraph": false
8721
+        },
8722
+        {
8723
+          "refKey": "notNull",
8724
+          "hideInGraph": true
8725
+        },
8726
+        {
8727
+          "refKey": "autoIncrement",
8728
+          "hideInGraph": true
8729
+        },
8730
+        {
8731
+          "refKey": "domain",
8732
+          "hideInGraph": true
8733
+        },
8734
+        {
8735
+          "refKey": "type",
8736
+          "hideInGraph": false
8737
+        },
8738
+        {
8739
+          "refKey": "len",
8740
+          "hideInGraph": false
8741
+        },
8742
+        {
8743
+          "refKey": "scale",
8744
+          "hideInGraph": false
8745
+        },
8746
+        {
8747
+          "refKey": "comment",
8748
+          "hideInGraph": true
8749
+        },
8750
+        {
8751
+          "refKey": "refDict",
8752
+          "hideInGraph": true
8753
+        },
8754
+        {
8755
+          "refKey": "defaultValue",
8756
+          "hideInGraph": true
8757
+        },
8758
+        {
8759
+          "refKey": "isStandard",
8760
+          "hideInGraph": false
8761
+        },
8762
+        {
8763
+          "refKey": "uiHint",
8764
+          "hideInGraph": true
8765
+        },
8766
+        {
8767
+          "refKey": "extProps",
8768
+          "hideInGraph": true
8769
+        }
8770
+      ],
8771
+      "fields": [
8772
+        {
8773
+          "defKey": "stat_no",
8774
+          "defName": "序号",
8775
+          "comment": "",
8776
+          "type": "",
8777
+          "len": "",
8778
+          "scale": "",
8779
+          "primaryKey": true,
8780
+          "notNull": true,
8781
+          "autoIncrement": true,
8782
+          "defaultValue": "",
8783
+          "hideInGraph": true,
8784
+          "domain": "6BC8F04B-6CFA-4995-98D3-318F5CDD774E",
8785
+          "refDict": "",
8786
+          "uiHint": "",
8787
+          "id": "E7763878-4C25-476F-8C26-56BF7E0A9F35"
8788
+        },
8789
+        {
8790
+          "defKey": "stat_type",
8791
+          "defName": "统计类型",
8792
+          "comment": "",
8793
+          "type": "",
8794
+          "len": "",
8795
+          "scale": "",
8796
+          "primaryKey": false,
8797
+          "notNull": false,
8798
+          "autoIncrement": false,
8799
+          "defaultValue": "",
8800
+          "hideInGraph": false,
8801
+          "refDict": "",
8802
+          "domain": "73FD2BAD-2358-4336-B96D-45DC897BD792",
8803
+          "id": "49707BF9-E174-4ABA-8527-2C6A0996FE43",
8804
+          "uiHint": ""
8805
+        },
8806
+        {
8807
+          "defKey": "name",
8808
+          "defName": "指标名称",
8809
+          "comment": "",
8810
+          "domain": "73FD2BAD-2358-4336-B96D-45DC897BD792",
8811
+          "type": "",
8812
+          "len": "",
8813
+          "scale": "",
8814
+          "primaryKey": false,
8815
+          "notNull": false,
8816
+          "autoIncrement": false,
8817
+          "defaultValue": "",
8818
+          "hideInGraph": true,
8819
+          "refDict": "",
8820
+          "uiHint": "",
8821
+          "id": "22B03E6C-E6FD-4D4F-855B-87E5F8EF79BF"
8822
+        },
8823
+        {
8824
+          "defKey": "value",
8825
+          "defName": "统计值",
8826
+          "comment": "",
8827
+          "domain": "6BC8F04B-6CFA-4995-98D3-318F5CDD774E",
8828
+          "type": "",
8829
+          "len": "",
8830
+          "scale": "",
8831
+          "primaryKey": false,
8832
+          "notNull": false,
8833
+          "autoIncrement": false,
8834
+          "defaultValue": "0",
8835
+          "hideInGraph": true,
8836
+          "refDict": "",
8837
+          "uiHint": "",
8838
+          "id": "5DC510CC-D45C-42D4-AEED-5AD9130E0D88"
8839
+        }
8840
+      ],
8841
+      "correlations": [],
8842
+      "indexes": []
8335
     }
8843
     }
8336
   ],
8844
   ],
8337
   "views": [],
8845
   "views": [],
8760
         "B20E272F-91EB-4BAC-AAD6-AF99D517E44D",
9268
         "B20E272F-91EB-4BAC-AAD6-AF99D517E44D",
8761
         "EF3D4E17-6CE0-4944-B1DC-40280B2B689F",
9269
         "EF3D4E17-6CE0-4944-B1DC-40280B2B689F",
8762
         "5BEE62BD-F04C-49E8-A65A-32A11B093E7B",
9270
         "5BEE62BD-F04C-49E8-A65A-32A11B093E7B",
8763
-        "430EE745-314D-48CE-A20B-ED2C4D79BC92"
9271
+        "430EE745-314D-48CE-A20B-ED2C4D79BC92",
9272
+        "38420D50-01AB-4E31-84D3-20192D26E25F"
8764
       ],
9273
       ],
8765
       "refViews": [],
9274
       "refViews": [],
8766
       "refDiagrams": [],
9275
       "refDiagrams": [],
8767
       "refDicts": [],
9276
       "refDicts": [],
8768
       "id": "96B34919-1A2F-4E7A-87B9-0330F40F7DF2"
9277
       "id": "96B34919-1A2F-4E7A-87B9-0330F40F7DF2"
9278
+    },
9279
+    {
9280
+      "defKey": "stat",
9281
+      "defName": "查询统计",
9282
+      "refEntities": [
9283
+        "78C3BB38-9B37-445B-A311-168B4682FE5E"
9284
+      ],
9285
+      "refViews": [],
9286
+      "refDiagrams": [],
9287
+      "refDicts": [],
9288
+      "id": "49C90869-CA44-48D0-A675-ECCB8853A412"
8769
     }
9289
     }
8770
   ],
9290
   ],
8771
   "dataTypeMapping": {
9291
   "dataTypeMapping": {

+ 78
- 4
db/文明创办.pdma.json View File

4
   "avatar": "",
4
   "avatar": "",
5
   "version": "4.1.4",
5
   "version": "4.1.4",
6
   "createdTime": "2022-12-12 09:36:12",
6
   "createdTime": "2022-12-12 09:36:12",
7
-  "updatedTime": "2023-1-31 18:39:34",
7
+  "updatedTime": "2023-2-3 15:17:53",
8
   "dbConns": [],
8
   "dbConns": [],
9
   "profile": {
9
   "profile": {
10
     "default": {
10
     "default": {
3640
           "notes": {},
3640
           "notes": {},
3641
           "id": "67B51317-2D33-4118-81AA-50D179CDF9E8"
3641
           "id": "67B51317-2D33-4118-81AA-50D179CDF9E8"
3642
         },
3642
         },
3643
+        {
3644
+          "defKey": "end_date",
3645
+          "defName": "办结日期",
3646
+          "comment": "",
3647
+          "type": "",
3648
+          "len": "",
3649
+          "scale": "",
3650
+          "primaryKey": false,
3651
+          "notNull": false,
3652
+          "autoIncrement": false,
3653
+          "defaultValue": "",
3654
+          "hideInGraph": false,
3655
+          "refDict": "",
3656
+          "extProps": {},
3657
+          "domain": "7CFFA0D3-6A93-4DDC-BC10-DF21211064DC",
3658
+          "id": "82C054A9-86DD-4905-B241-92C1467C68A4"
3659
+        },
3643
         {
3660
         {
3644
           "defKey": "org_id",
3661
           "defKey": "org_id",
3645
           "defName": "责任单位",
3662
           "defName": "责任单位",
7206
           "domain": "9092C4E0-1A54-4859-ABBB-5B62DBC27573",
7223
           "domain": "9092C4E0-1A54-4859-ABBB-5B62DBC27573",
7207
           "id": "2DD06082-1A99-45ED-A4FC-2A09B4674DCB"
7224
           "id": "2DD06082-1A99-45ED-A4FC-2A09B4674DCB"
7208
         },
7225
         },
7226
+        {
7227
+          "defKey": "verify_date",
7228
+          "defName": "审核日期",
7229
+          "comment": "",
7230
+          "type": "",
7231
+          "len": "",
7232
+          "scale": "",
7233
+          "primaryKey": false,
7234
+          "notNull": false,
7235
+          "autoIncrement": false,
7236
+          "defaultValue": "",
7237
+          "hideInGraph": false,
7238
+          "refDict": "",
7239
+          "extProps": {},
7240
+          "domain": "7CFFA0D3-6A93-4DDC-BC10-DF21211064DC",
7241
+          "id": "3F742306-C7EA-4CB8-BF0C-12E62CE0BC4B"
7242
+        },
7209
         {
7243
         {
7210
           "defKey": "issue_id",
7244
           "defKey": "issue_id",
7211
           "defName": "关联问题单",
7245
           "defName": "关联问题单",
8050
           "id": "649F17F6-D2C1-4AAD-B913-ED39F26E4AF4",
8084
           "id": "649F17F6-D2C1-4AAD-B913-ED39F26E4AF4",
8051
           "uiHint": ""
8085
           "uiHint": ""
8052
         },
8086
         },
8087
+        {
8088
+          "defKey": "process_node",
8089
+          "defName": "流程节点",
8090
+          "comment": "",
8091
+          "type": "",
8092
+          "len": "",
8093
+          "scale": "",
8094
+          "primaryKey": false,
8095
+          "notNull": false,
8096
+          "autoIncrement": false,
8097
+          "defaultValue": "",
8098
+          "hideInGraph": false,
8099
+          "domain": "73FD2BAD-2358-4336-B96D-45DC897BD792",
8100
+          "refDict": "",
8101
+          "extProps": {},
8102
+          "id": "A3EEF4DF-16EC-405B-921C-9F0E41363200"
8103
+        },
8053
         {
8104
         {
8054
           "defKey": "process_status",
8105
           "defKey": "process_status",
8055
           "defName": "业务单状态",
8106
           "defName": "业务单状态",
8636
       "id": "78C3BB38-9B37-445B-A311-168B4682FE5E",
8687
       "id": "78C3BB38-9B37-445B-A311-168B4682FE5E",
8637
       "env": {
8688
       "env": {
8638
         "base": {
8689
         "base": {
8639
-          "nameSpace": "",
8640
-          "codeRoot": ""
8641
-        }
8690
+          "nameSpace": "com.example.civilizedcity",
8691
+          "codeRoot": "TsStatData"
8692
+        },
8693
+        "template": {
8694
+          "JavaMybatisPlus": {
8695
+            "Controller": {
8696
+              "suffix": "controller/{{=it.codeRoot}}Controller.java"
8697
+            },
8698
+            "Service": {
8699
+              "suffix": "service/{{=it.codeRoot}}Service.java"
8700
+            },
8701
+            "ServiceImpl": {
8702
+              "suffix": "service/impl/{{=it. codeRoot}}ServiceImpl.java"
8703
+            },
8704
+            "Mapper": {
8705
+              "suffix": "mapper/{{=it.codeRoot}}Mapper.java"
8706
+            },
8707
+            "Mapper.xml": {
8708
+              "suffix": "mapper/{{=it.codeRoot}}Mapper.xml"
8709
+            },
8710
+            "Entity": {
8711
+              "suffix": "entity/{{=it.codeRoot}}.java"
8712
+            }
8713
+          }
8714
+        },
8715
+        "custom": {}
8642
       },
8716
       },
8643
       "defKey": "ts_stat_data",
8717
       "defKey": "ts_stat_data",
8644
       "defName": "常用统计",
8718
       "defName": "常用统计",

+ 51
- 60
src/main/java/com/example/civilizedcity/common/Constants.java View File

8
     public final static int STATUS_READY = 0;
8
     public final static int STATUS_READY = 0;
9
     public final static int STATUS_NORMAL = 1;
9
     public final static int STATUS_NORMAL = 1;
10
 
10
 
11
-    // 操作员身份
11
+    /**
12
+     * 人员身份
13
+     */
12
     // 督察员
14
     // 督察员
13
     public final static String DUTY_INSPECTOR = "inspector";
15
     public final static String DUTY_INSPECTOR = "inspector";
14
     // 管理员
16
     // 管理员
22
     // 市民
24
     // 市民
23
     public final static String DUTY_CITIZEN = "citizen";
25
     public final static String DUTY_CITIZEN = "citizen";
24
 
26
 
27
+
28
+    /**
29
+     * 资源类型
30
+     */
25
     // 问题单
31
     // 问题单
26
-    public final static String ATTACH_SOURCE_ISSUE = "issue";
32
+    public final static String SOURCE_ISSUE = "issue";
27
     // 市民上报
33
     // 市民上报
28
-    public final static String ATTACH_SOURCE_FEEDBACK = "feedback";
34
+    public final static String SOURCE_FEEDBACK = "feedback";
35
+    // 督察员上报
36
+    public final static String SOURCE_INSPECTOR = "inspector";
29
     // 单位问题单
37
     // 单位问题单
30
-    public final static String ATTACH_SOURCE_ORG_ISSUE = "org-issue";
38
+    public final static String SOURCE_ORG_ISSUE = "org-issue";
31
     // 测评答案
39
     // 测评答案
32
-    public final static String ATTACH_SOURCE_CHECK_ANSWER = "check-answer";
33
-
34
-    // 督察员上报
35
-    public final static String ISSUE_SOURCE_INSPECTOR = "inspector";
36
-    // 市民上报
37
-    public final static String ISSUE_SOURCE_FEEDBACK = "feedback";
40
+    public final static String SOURCE_CHECK_ANSWER = "check-answer";
38
     // 模拟测评
41
     // 模拟测评
39
-    public final static String ISSUE_SOURCE_CHECK = "check";
40
-
41
-    // 提交审核
42
-//    public final static String APPLY_VERIFY = "verify";
43
-    public final static String APPLY_STATUS_PASS = "pass"; // 通过
44
-    public final static String APPLY_STATUS_REJECT = "reject"; // 驳回
45
-    public final static String APPLY_DELAY = "delay"; // 延期申请
46
-    public final static String APPLY_REJECT = "reject"; // 驳回申请
47
-    public final static String APPLY_VERIFY = "verify"; // 审核申请
48
-    public final static String APPLY_END = "end"; // 办结申请
49
-
50
-    // 待处理
51
-    public final static String PROCESS_STATUS_READY = "ready";
52
-    // 通过
53
-    public final static String PROCESS_STATUS_PASS = "pass";
54
-    // 未通过
55
-    public final static String PROCESS_STATUS_REJECT = "reject";
56
-    // 逾期
57
-    public final static String PROCESS_STATUS_EXPIRED = "expired";
58
-
59
-
60
-    // 流程起始: 待交办
61
-    public final static String PROCESS_START = "start";
62
-    // 流程: 被打回 - 市民提交 - 算办结
63
-//    public final static String PROCESS_REJECT = "reject";
64
-
42
+    public final static String SOURCE_CHECK = "check";
65
     // 审核
43
     // 审核
66
-    public final static String PROCESS_VERIFY = "verify";
44
+    public final static String SOURCE_APPLY = "apply";
45
+
46
+    /**
47
+     * 流程节点
48
+     */
49
+    // 待交办
50
+    public final static String PROCESS_START = "00";
67
     // 交办
51
     // 交办
68
-    public final static String PROCESS_ASSIGNED = "assigned";
52
+    public final static String PROCESS_ASSIGNED = "01";
53
+    // 办结
54
+    public final static String PROCESS_END = "02";
55
+    // 驳回申请
56
+    public final static String PROCESS_APPLY_REJECT = "0101";
69
     // 延期申请
57
     // 延期申请
70
-    public final static String PROCESS_ORG_DELAY_APPLY = "org_delay-apply";
71
-    // 延期审核
72
-    public final static String PROCESS_DELAY_VERIFY = "delay-verify";
73
-    // 单位交办
74
-    public final static String PROCESS_ORG_ASSIGNED = "org_assigned";
58
+    public final static String PROCESS_APPLY_DELAY = "0102";
75
     // 单位审核
59
     // 单位审核
76
-    public final static String PROCESS_ORG_VERIFY = "org_verify";
60
+    public final static String PROCESS_APPLY_VERIFY = "0103";
77
     // 办结申请
61
     // 办结申请
78
-    public final static String PROCESS_ORG_FINISH_APPLY = "org_finish-apply";
79
-    // 办结审核
80
-    public final static String PROCESS_FINISH_VERIFY = "finish-verify";
62
+    public final static String PROCESS_APPLY_END = "0104";
81
 
63
 
64
+    /**
65
+     * 审核结果
66
+     */
67
+    // 未审核
68
+    public final static String APPLY_READY = "ready";
69
+    // 审核通过
70
+    public final static String APPLY_PASS = "pass";
71
+    // 审核驳回
72
+    public final static String APPLY_REJECT = "reject";
82
 
73
 
83
-    // 流程结束: 已办结
84
-    public final static String PROCESS_END = "end";
85
-
86
-    // 问题单
87
-    public final static String MESSAGE_TARGET_ISSUE = "issue";
88
-    // 申请流程
89
-    public final static String MESSAGE_TARGET_APPLY = "apply";
90
-
74
+    /**
75
+     * 调查问卷
76
+     */
77
+    // 实地调查
78
+    public final static String CHECK_OF_LOC = "loc";
91
     // 调查问卷
79
     // 调查问卷
92
-    public final static String CHECK_OF_LOC = "loc"; // 实地调查
93
-    public final static String CHECK_OF_SURVEY = "survey"; // 调查问卷
80
+    public final static String CHECK_OF_SURVEY = "survey";
94
 
81
 
95
-    // 题型
96
-    public final static String QU_OF_FILL = "fill"; // 填空题
97
-    public final static String QU_OF_RADIO = "radio"; // 选择题
82
+    /**
83
+     * 问题题型
84
+     */
85
+    // 填空题
86
+    public final static String QU_OF_FILL = "fill";
87
+    // 选择题
88
+    public final static String QU_OF_RADIO = "radio";
98
 }
89
 }

+ 1
- 1
src/main/java/com/example/civilizedcity/controller/TaCheckAnswerItemController.java View File

66
 
66
 
67
         if (null != result && result.size() > 0) {
67
         if (null != result && result.size() > 0) {
68
             for(TaCheckAnswerItem item : result) {
68
             for(TaCheckAnswerItem item : result) {
69
-                List<TaAttach> attachList = taAttachService.getListBy(Constants.ATTACH_SOURCE_CHECK_ANSWER, item.getItemId());
69
+                List<TaAttach> attachList = taAttachService.getListBy(Constants.SOURCE_CHECK_ANSWER, item.getItemId());
70
                 item.setAttachList(attachList);
70
                 item.setAttachList(attachList);
71
             }
71
             }
72
         }
72
         }

+ 1
- 1
src/main/java/com/example/civilizedcity/controller/TaFeedbackController.java View File

47
     @GetMapping("/taFeedback/{id}")
47
     @GetMapping("/taFeedback/{id}")
48
     public ResponseBean queryById(@ApiParam("对象ID") @PathVariable String id) throws Exception {
48
     public ResponseBean queryById(@ApiParam("对象ID") @PathVariable String id) throws Exception {
49
         TaFeedback taFeedback = taFeedbackService.getById(id);
49
         TaFeedback taFeedback = taFeedbackService.getById(id);
50
-        List<TaAttach> attachList = taAttachService.getListBy(Constants.ATTACH_SOURCE_FEEDBACK, taFeedback.getFeedbackId());
50
+        List<TaAttach> attachList = taAttachService.getListBy(Constants.SOURCE_FEEDBACK, taFeedback.getFeedbackId());
51
         taFeedback.setAttachList(attachList);
51
         taFeedback.setAttachList(attachList);
52
         return ResponseBean.success(taFeedback);
52
         return ResponseBean.success(taFeedback);
53
     }
53
     }

+ 28
- 50
src/main/java/com/example/civilizedcity/controller/TaIssueApplyController.java View File

7
 import com.example.civilizedcity.common.Constants;
7
 import com.example.civilizedcity.common.Constants;
8
 import com.example.civilizedcity.common.ResponseBean;
8
 import com.example.civilizedcity.common.ResponseBean;
9
 
9
 
10
-import java.time.LocalDateTime;
11
-import java.util.List;
12
-
13
 import com.example.civilizedcity.common.StringUtils;
10
 import com.example.civilizedcity.common.StringUtils;
14
 import com.example.civilizedcity.entity.SysUser;
11
 import com.example.civilizedcity.entity.SysUser;
15
-import com.example.civilizedcity.event.MessagEvent;
16
-import com.example.civilizedcity.service.SysUserDutyService;
17
 import com.example.civilizedcity.service.TaIssueService;
12
 import com.example.civilizedcity.service.TaIssueService;
13
+import com.example.civilizedcity.service.TaOrgIssueService;
18
 import io.swagger.annotations.Api;
14
 import io.swagger.annotations.Api;
19
 import io.swagger.annotations.ApiOperation;
15
 import io.swagger.annotations.ApiOperation;
20
 import io.swagger.annotations.ApiParam;
16
 import io.swagger.annotations.ApiParam;
42
     private TaIssueService taIssueService;
38
     private TaIssueService taIssueService;
43
 
39
 
44
     @Autowired
40
     @Autowired
45
-    private SysUserDutyService sysUserDutyService;
41
+    private TaOrgIssueService taOrgIssueService;
46
 
42
 
47
     @Autowired
43
     @Autowired
48
     ApplicationEventPublisher applicationEventPublisher;
44
     ApplicationEventPublisher applicationEventPublisher;
50
     /**
46
     /**
51
      * 通过ID查询单条数据
47
      * 通过ID查询单条数据
52
      *
48
      *
53
-     * @param applyId 主键
49
+     * @param id 主键
54
      * @return 实例对象
50
      * @return 实例对象
55
      */
51
      */
56
     @ApiOperation("通过ID查询单条数据")
52
     @ApiOperation("通过ID查询单条数据")
61
     /**
57
     /**
62
      * 通过ISSUE_ID查询单条数据
58
      * 通过ISSUE_ID查询单条数据
63
      *
59
      *
64
-     * @param applyId 主键
60
+     * @param issueId 问题单ID
61
+     * @param applyType 申请类型
65
      * @return 实例对象
62
      * @return 实例对象
66
      */
63
      */
67
     @ApiOperation("通过ISSUE_ID查询单条数据")
64
     @ApiOperation("通过ISSUE_ID查询单条数据")
120
     @ApiOperation("申请流程")
117
     @ApiOperation("申请流程")
121
     @PostMapping("/taIssueApply")
118
     @PostMapping("/taIssueApply")
122
     public ResponseBean add(@ApiParam("对象实体") @RequestBody TaIssueApply taIssueApply) throws Exception {
119
     public ResponseBean add(@ApiParam("对象实体") @RequestBody TaIssueApply taIssueApply) throws Exception {
123
-        taIssueApplyService.createNewApply(taIssueApply, currentUser());
120
+        if (null == taIssueApply.getIssueId()) {
121
+            throw new Exception("校验问题单出错");
122
+        }
123
+
124
+        SysUser sysUser = currentUser();
125
+        if (null == taOrgIssueService.getByIssueAndOrg(taIssueApply.getIssueId(), sysUser.getOrgId())) {
126
+            throw new Exception("未找到交办单位问题单");
127
+        }
128
+
129
+        taIssueApplyService.createNewApply(taIssueApply, sysUser);
124
         return ResponseBean.success(taIssueApply);
130
         return ResponseBean.success(taIssueApply);
125
     }
131
     }
126
 
132
 
141
         }
147
         }
142
 
148
 
143
         // 如果是审核驳回
149
         // 如果是审核驳回
144
-        if (StringUtils.isEmpty(taIssueApply.getVerifyDesc()) && Constants.APPLY_STATUS_REJECT.equals(taIssueApply.getVerifyStatus())) {
150
+        if (StringUtils.isEmpty(taIssueApply.getVerifyDesc()) && Constants.APPLY_REJECT.equals(taIssueApply.getVerifyStatus())) {
145
             return ResponseBean.error("请填写驳回理由");
151
             return ResponseBean.error("请填写驳回理由");
146
         }
152
         }
147
 
153
 
149
         taIssueApply.setApplyId(id);
155
         taIssueApply.setApplyId(id);
150
         taIssueApplyService.verify(taIssueApply, sysUser, origin);
156
         taIssueApplyService.verify(taIssueApply, sysUser, origin);
151
 
157
 
152
-        origin.setVerifyStatus(taIssueApply.getVerifyStatus());
153
-        origin.setVerifyDesc(taIssueApply.getVerifyDesc());
154
-        origin.setVerifyOrg(sysUser.getOrgId());
155
-        origin.setVerifyUser(sysUser.getUserId());
156
-        origin.setVerifyUserName(sysUser.getName());
157
-        origin.setVerifyDate(LocalDateTime.now());
158
-
159
-        taIssueApplyService.updateById(origin);
160
-
161
-        //
162
-        taIssueService.updateApply(taIssueApply.getIssueId(), null, null);
163
-
164
-        // 如果是销单申请
165
-        if (Constants.APPLY_END.equals(origin.getApplyType())) {
166
-            if (Constants.APPLY_STATUS_PASS.equals(taIssueApply.getVerifyStatus())) {
167
-                // 如果通过
168
-                taIssueService.updateEnd(sysUser, taIssueApply.getOrgId(), taIssueApply.getIssueId());
169
-            }
170
-        }
171
-
172
-//        if (Constants.APPLY_VERIFY.equals(origin.getApplyType())) {
173
-//            int validateStatus = Constants.APPLY_STATUS_REJECT.equals(taIssueApply.getVerifyStatus()) ? Constants.VERIFY_REJECT : Constants.VERIFY_PASS;
174
-//            taIssueService.updateValidateStatus(taIssueApply.getIssueId(), validateStatus);
175
-//        }
176
-
177
-
178
-        applicationEventPublisher.publishEvent(new MessagEvent(this, origin));
179
-
180
         return ResponseBean.success(origin);
158
         return ResponseBean.success(origin);
181
     }
159
     }
182
 
160
 
183
-    /**
184
-     * 通过主键删除数据
185
-     *
186
-     * @param applyId 主键
187
-     * @return 是否成功
188
-     */
189
-    @ApiOperation("通过主键删除数据")
190
-    @DeleteMapping("/taIssueApply/{id}")
191
-    public ResponseBean deleteById(@ApiParam("对象ID") @PathVariable Integer id) {
192
-        taIssueApplyService.removeLogicById(id);
193
-        return ResponseBean.success("success");
194
-    }
161
+//    /**
162
+//     * 通过主键删除数据
163
+//     *
164
+//     * @param id 主键
165
+//     * @return 是否成功
166
+//     */
167
+//    @ApiOperation("通过主键删除数据")
168
+//    @DeleteMapping("/taIssueApply/{id}")
169
+//    public ResponseBean deleteById(@ApiParam("对象ID") @PathVariable Integer id) {
170
+//        taIssueApplyService.removeLogicById(id);
171
+//        return ResponseBean.success("success");
172
+//    }
195
 }
173
 }

+ 17
- 87
src/main/java/com/example/civilizedcity/controller/TaIssueController.java View File

2
 
2
 
3
 import cn.dev33.satoken.annotation.SaCheckPermission;
3
 import cn.dev33.satoken.annotation.SaCheckPermission;
4
 import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
4
 import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
5
+import com.baomidou.mybatisplus.core.enums.SqlLike;
5
 import com.baomidou.mybatisplus.core.metadata.IPage;
6
 import com.baomidou.mybatisplus.core.metadata.IPage;
6
 import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
7
 import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
7
 import com.example.civilizedcity.common.*;
8
 import com.example.civilizedcity.common.*;
51
     /**
52
     /**
52
      * 通过ID查询单条数据
53
      * 通过ID查询单条数据
53
      *
54
      *
54
-     * @param issueId 主键
55
+     * @param id 主键
55
      * @return 实例对象
56
      * @return 实例对象
56
      */
57
      */
57
     @ApiOperation("通过ID查询单条数据")
58
     @ApiOperation("通过ID查询单条数据")
59
     public ResponseBean queryById(@ApiParam("对象ID") @PathVariable Integer id) throws Exception {
60
     public ResponseBean queryById(@ApiParam("对象ID") @PathVariable Integer id) throws Exception {
60
 
61
 
61
         TaIssue taIssue = taIssueService.getById(id);
62
         TaIssue taIssue = taIssueService.getById(id);
62
-        List<TaAttach> attachList = taAttachService.getListBy(Constants.ATTACH_SOURCE_ISSUE, taIssue.getIssueId().toString());
63
+        List<TaAttach> attachList = taAttachService.getListBy(Constants.SOURCE_ISSUE, taIssue.getIssueId().toString());
63
         taIssue.setAttachList(attachList);
64
         taIssue.setAttachList(attachList);
64
 
65
 
65
         return ResponseBean.success(taIssue);
66
         return ResponseBean.success(taIssue);
89
             return ResponseBean.error("暂无权限查询数据");
90
             return ResponseBean.error("暂无权限查询数据");
90
         }
91
         }
91
 
92
 
92
-//        Boolean mine = true;
93
-//        Integer validateStatus = null;
94
-//        if (isRooter) {
95
-//            mine = false;
96
-//        } else if (dutyList.contains(Constants.DUTY_INSPECTOR)) {
97
-//            mine = true;
98
-//        } else if (dutyList.contains(Constants.DUTY_MANAGER)) {
99
-//            mine = false;
100
-//            validateStatus = 0;
101
-//        } else {
102
-//            return ResponseBean.error("暂无权限查询数据");
103
-//        }
104
-
105
         IPage<TaIssue> pg = new Page<>(pageNum, pageSize);
93
         IPage<TaIssue> pg = new Page<>(pageNum, pageSize);
106
         QueryWrapper<TaIssue> queryWrapper = new QueryWrapper<>();
94
         QueryWrapper<TaIssue> queryWrapper = new QueryWrapper<>();
107
 
95
 
108
         if (Constants.PROCESS_START.equals(bizStatus)) {
96
         if (Constants.PROCESS_START.equals(bizStatus)) {
109
             // 待交办
97
             // 待交办
110
-            queryWrapper.eq("process_node", bizStatus);
98
+            queryWrapper.likeRight("process_node", bizStatus);
111
         } else if (Constants.PROCESS_ASSIGNED.equals(bizStatus)) {
99
         } else if (Constants.PROCESS_ASSIGNED.equals(bizStatus)) {
112
             // 已交办
100
             // 已交办
113
-            queryWrapper.eq("process_node", bizStatus);
101
+            queryWrapper.likeRight("process_node", bizStatus);
114
         } else if (Constants.PROCESS_END.equals(bizStatus)) {
102
         } else if (Constants.PROCESS_END.equals(bizStatus)) {
115
             // 已办结
103
             // 已办结
116
             queryWrapper.eq("process_node", bizStatus);
104
             queryWrapper.eq("process_node", bizStatus);
120
             queryWrapper.le("expire_date", DateUtils.today());
108
             queryWrapper.le("expire_date", DateUtils.today());
121
         } else if ("reject".equals(bizStatus)) {
109
         } else if ("reject".equals(bizStatus)) {
122
             // 已打回
110
             // 已打回
123
-            queryWrapper.ne("process_node", Constants.PROCESS_END);
124
-            queryWrapper.eq("process_status", Constants.PROCESS_STATUS_REJECT);
111
+            queryWrapper.eq("process_node", Constants.PROCESS_APPLY_REJECT);
112
+            queryWrapper.eq("process_status", Constants.APPLY_PASS);
125
         }
113
         }
126
 
114
 
127
         // 督察员
115
         // 督察员
132
 
120
 
133
         queryWrapper.eq(StringUtils.isNotEmpty(locId), "loc_id", locId);
121
         queryWrapper.eq(StringUtils.isNotEmpty(locId), "loc_id", locId);
134
         queryWrapper.eq(StringUtils.isNotEmpty(orgId), "org_id", orgId);
122
         queryWrapper.eq(StringUtils.isNotEmpty(orgId), "org_id", orgId);
135
-        queryWrapper.eq(Constants.ISSUE_SOURCE_FEEDBACK.equals(sourceType), "source_type", "feedback");
136
-        queryWrapper.ne(Constants.ISSUE_SOURCE_INSPECTOR.equals(sourceType), "source_type", "feedback");
123
+        queryWrapper.eq(Constants.SOURCE_FEEDBACK.equals(sourceType), "source_type", Constants.SOURCE_FEEDBACK);
124
+        queryWrapper.ne(!Constants.SOURCE_FEEDBACK.equals(sourceType), "source_type", Constants.SOURCE_FEEDBACK);
137
         queryWrapper.gt("status", Constants.STATUS_DELETE);
125
         queryWrapper.gt("status", Constants.STATUS_DELETE);
138
         queryWrapper.orderByDesc("create_date");
126
         queryWrapper.orderByDesc("create_date");
139
         IPage<TaIssue> result = taIssueService.page(pg, queryWrapper);
127
         IPage<TaIssue> result = taIssueService.page(pg, queryWrapper);
150
     @ApiOperation("新增数据")
138
     @ApiOperation("新增数据")
151
     @PostMapping("/taIssue")
139
     @PostMapping("/taIssue")
152
     public ResponseBean add(@ApiParam("对象实体") @RequestBody TaIssue taIssue) throws Exception {
140
     public ResponseBean add(@ApiParam("对象实体") @RequestBody TaIssue taIssue) throws Exception {
153
-        SysUser user = currentUser();
141
+        // 督察员上报专用
154
 
142
 
155
-        taIssue.setIssueId(null);
156
-        taIssue.setOrgId(null); // 暂时没有责任单位
157
-        taIssue.setProcessNode(Constants.PROCESS_START);
158
-        taIssue.setProcessStatus(Constants.PROCESS_STATUS_READY);
159
-        taIssue.setProcessNum(1);
160
-        taIssue.setSourceType(Constants.ISSUE_SOURCE_INSPECTOR);
161
-        taIssue.setStatus(Constants.STATUS_NORMAL);
162
-        taIssue.setCreateUser(user.getUserId());
163
-        taIssue.setUserName(user.getName());
164
-        taIssue.setCreateDate(LocalDateTime.now());
165
-        taIssueService.save(taIssue);
166
-
167
-        // 保存文件
168
-        List<TaAttach> attachList = taIssue.getAttachList();
169
-        if (null != attachList && attachList.size() > 0) {
170
-            for (TaAttach item : attachList) {
171
-                item.setAttachId(null);
172
-                item.setOwnerType(Constants.ATTACH_SOURCE_ISSUE);
173
-                item.setOwnerId(taIssue.getIssueId().toString());
174
-                item.setStatus(Constants.STATUS_NORMAL);
175
-                item.setCreateDate(LocalDateTime.now());
176
-            }
143
+        if (null == taIssue.getAttachList() || taIssue.getAttachList().size() == 0) {
144
+            return ResponseBean.error("请上传照片");
177
         }
145
         }
178
 
146
 
179
-        taAttachService.saveBatch(attachList);
180
-
181
-        // 流程开始
182
-        TaIssueProcess process = new TaIssueProcess();
183
-        process.setIssueId(taIssue.getIssueId());
184
-        process.setOrgId(user.getOrgId());
185
-        process.setProcessNode(Constants.PROCESS_START);
186
-        process.setProcessStatus(Constants.PROCESS_STATUS_READY);
187
-        process.setStatus(Constants.STATUS_NORMAL);
188
-        process.setCreateUser(user.getUserId());
189
-        process.setUserName(user.getName());
190
-        process.setCreateDate(LocalDateTime.now());
191
-        taIssueProcessService.save(process);
192
-
147
+        SysUser user = currentUser();
148
+        taIssueService.createNew(taIssue, user);
193
         return ResponseBean.success(taIssue);
149
         return ResponseBean.success(taIssue);
194
     }
150
     }
195
 
151
 
214
             return ResponseBean.error("拍照或者视频没有上传");
170
             return ResponseBean.error("拍照或者视频没有上传");
215
         }
171
         }
216
 
172
 
217
-        // 清空负状态
218
-        if (Constants.PROCESS_STATUS_REJECT.equals(origin.getProcessStatus())) {
219
-            taIssue.setProcessStatus(Constants.PROCESS_STATUS_READY);
220
-        }
221
-
222
-        taIssue.setIssueId(id);
223
-        taIssueService.updateById(taIssue);
224
-
225
-        // 保存文件
226
-        List<Integer> idList = new ArrayList<>();
227
-        for (TaAttach item : attachList) {
228
-            item.setOwnerType(Constants.ATTACH_SOURCE_ISSUE);
229
-            item.setOwnerId(taIssue.getIssueId().toString());
230
-            item.setStatus(Constants.STATUS_NORMAL);
231
-            item.setCreateDate(LocalDateTime.now());
232
-
233
-            if (null == item.getAttachId()) {
234
-                taAttachService.save(item);
235
-            } else {
236
-                taAttachService.updateById(item);
237
-            }
238
-            idList.add(item.getAttachId());
239
-        }
240
-
241
-        // 删除部分文件
242
-        taAttachService.deleteNotIn(idList, Constants.ATTACH_SOURCE_ISSUE, id.toString());
243
-
244
-        return ResponseBean.success(taIssue);
173
+        taIssueService.updateIssue(taIssue, origin);
174
+        return ResponseBean.success(origin);
245
     }
175
     }
246
 
176
 
247
     /**
177
     /**
248
      * 通过主键删除数据
178
      * 通过主键删除数据
249
      *
179
      *
250
-     * @param issueId 主键
180
+     * @param id 主键
251
      * @return 是否成功
181
      * @return 是否成功
252
      */
182
      */
253
     @SaCheckPermission("manager")
183
     @SaCheckPermission("manager")

+ 8
- 328
src/main/java/com/example/civilizedcity/controller/TaIssueProcessController.java View File

6
 import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
6
 import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
7
 import com.example.civilizedcity.common.*;
7
 import com.example.civilizedcity.common.*;
8
 
8
 
9
-import java.time.LocalDateTime;
10
-import java.util.List;
11
-
12
 import com.example.civilizedcity.entity.SysUser;
9
 import com.example.civilizedcity.entity.SysUser;
13
 import com.example.civilizedcity.entity.TaIssue;
10
 import com.example.civilizedcity.entity.TaIssue;
14
-import com.example.civilizedcity.event.MessagEvent;
15
 import com.example.civilizedcity.service.TaIssueService;
11
 import com.example.civilizedcity.service.TaIssueService;
16
 import com.example.civilizedcity.service.TaOrgIssueService;
12
 import com.example.civilizedcity.service.TaOrgIssueService;
17
 import io.swagger.annotations.Api;
13
 import io.swagger.annotations.Api;
18
 import io.swagger.annotations.ApiOperation;
14
 import io.swagger.annotations.ApiOperation;
19
 import io.swagger.annotations.ApiParam;
15
 import io.swagger.annotations.ApiParam;
20
 import org.springframework.beans.factory.annotation.Autowired;
16
 import org.springframework.beans.factory.annotation.Autowired;
21
-import org.springframework.context.ApplicationEventPublisher;
22
 import org.springframework.web.bind.annotation.*;
17
 import org.springframework.web.bind.annotation.*;
23
 import com.example.civilizedcity.entity.TaIssueProcess;
18
 import com.example.civilizedcity.entity.TaIssueProcess;
24
 import com.example.civilizedcity.service.TaIssueProcessService;
19
 import com.example.civilizedcity.service.TaIssueProcessService;
43
     @Autowired
38
     @Autowired
44
     private TaOrgIssueService taOrgIssueService;
39
     private TaOrgIssueService taOrgIssueService;
45
 
40
 
46
-    @Autowired
47
-    ApplicationEventPublisher applicationEventPublisher;
48
-
49
     /**
41
     /**
50
      * 通过ID查询单条数据
42
      * 通过ID查询单条数据
51
      *
43
      *
52
-     * @param processId 主键
44
+     * @param id 主键
53
      * @return 实例对象
45
      * @return 实例对象
54
      */
46
      */
55
     @ApiOperation("通过ID查询单条数据")
47
     @ApiOperation("通过ID查询单条数据")
98
         return taIssue;
90
         return taIssue;
99
     }
91
     }
100
 
92
 
101
-    private void updateUser(TaIssueProcess taIssueProcess, SysUser sysUser) {
102
-        taIssueProcess.setOrgId(sysUser.getOrgId());
103
-        taIssueProcess.setCreateUser(sysUser.getUserId());
104
-        taIssueProcess.setUserName(sysUser.getName());
105
-        taIssueProcess.setStatus(Constants.STATUS_NORMAL);
106
-        taIssueProcess.setCreateDate(LocalDateTime.now());
107
-    }
108
-
109
-    private void updateIssue(TaIssue taIssue, TaIssueProcess taIssueProcess) {
110
-        taIssue.setProcessNode(taIssueProcess.getProcessNode());
111
-        taIssue.setProcessStatus(taIssueProcess.getProcessStatus());
112
-        taIssueService.updateById(taIssue);
113
-    }
114
-
115
-//    /**
116
-//     * 审核
117
-//     *
118
-//     * @param taIssueProcess 实例对象
119
-//     * @return 实例对象
120
-//     */
121
-//    @SaCheckPermission("manager")
122
-//    @ApiOperation("审核")
123
-//    @PostMapping("/taIssueProcess/verify")
124
-//    public ResponseBean verify(@ApiParam("对象实体") @RequestBody TaIssueProcess taIssueProcess) throws Exception {
125
-//        TaIssue taIssue = checkIssue(taIssueProcess);
126
-//
127
-//        if (StringUtils.isEmpty(taIssueProcess.getProcessStatus())) {
128
-//            return ResponseBean.error("请设置审批是否通过");
129
-//        }
130
-//
131
-//        if (Constants.PROCESS_STATUS_REJECT.equals(taIssueProcess.getProcessStatus())) {
132
-//            // 审核未通过
133
-//            if (StringUtils.isEmpty(taIssueProcess.getProcessResult())) {
134
-//                return ResponseBean.error("请填写未通过原因");
135
-//            }
136
-//        }
137
-//
138
-//        updateUser(taIssueProcess, currentUser());
139
-//        taIssueProcess.setProcessNode(Constants.PROCESS_VERIFY);
140
-//        taIssueProcessService.save(taIssueProcess);
141
-//
142
-//        updateIssue(taIssue, taIssueProcess);
143
-//
144
-//        return ResponseBean.success(taIssueProcess);
145
-//    }
146
-
147
     /**
93
     /**
148
      * 交办
94
      * 交办
149
      *
95
      *
156
     public ResponseBean assigned(@ApiParam("对象实体") @RequestBody TaIssueProcess taIssueProcess) throws Exception {
102
     public ResponseBean assigned(@ApiParam("对象实体") @RequestBody TaIssueProcess taIssueProcess) throws Exception {
157
         TaIssue taIssue = checkIssue(taIssueProcess);
103
         TaIssue taIssue = checkIssue(taIssueProcess);
158
 
104
 
159
-        if (StringUtils.isEmpty(taIssueProcess.getOrgId())) {
105
+        if (StringUtils.isEmpty(taIssueProcess.getNextOrg())) {
160
             return ResponseBean.error("请指定交办单位");
106
             return ResponseBean.error("请指定交办单位");
161
-        } else {
162
-            taIssue.setOrgId(taIssueProcess.getOrgId());
163
         }
107
         }
164
         if (StringUtils.isEmpty(taIssueProcess.getExpireDate())) {
108
         if (StringUtils.isEmpty(taIssueProcess.getExpireDate())) {
165
             return ResponseBean.error("请设置截止日期");
109
             return ResponseBean.error("请设置截止日期");
167
             if (DateUtils.isAfter(taIssueProcess.getExpireDate() + " 23:59:59")) {
111
             if (DateUtils.isAfter(taIssueProcess.getExpireDate() + " 23:59:59")) {
168
                 return ResponseBean.error("请设置有效的截止日期");
112
                 return ResponseBean.error("请设置有效的截止日期");
169
             }
113
             }
170
-
171
-            taIssue.setExpireDate(taIssueProcess.getExpireDate());
172
         }
114
         }
173
 
115
 
174
         SysUser sysUser = currentUser();
116
         SysUser sysUser = currentUser();
175
-
176
-        updateUser(taIssueProcess, sysUser);
177
-        taIssueProcess.setProcessNode(Constants.PROCESS_ASSIGNED);
178
-        taIssueProcess.setProcessStatus(Constants.PROCESS_STATUS_READY);
179
-        taIssueProcessService.save(taIssueProcess);
180
-
181
-        updateIssue(taIssue, taIssueProcess);
182
-
183
-        taOrgIssueService.createNewIssue(taIssue, sysUser);
184
-
117
+        taOrgIssueService.createNewIssue(taIssue, taIssueProcess, sysUser);
185
         return ResponseBean.success(taIssueProcess);
118
         return ResponseBean.success(taIssueProcess);
186
     }
119
     }
187
 
120
 
188
     /**
121
     /**
189
-     * 驳回
122
+     * 管理员驳回问题单
190
      *
123
      *
191
      * @param taIssueProcess 实例对象
124
      * @param taIssueProcess 实例对象
192
      * @return 实例对象
125
      * @return 实例对象
193
      */
126
      */
194
-    @SaCheckPermission("org_user")
195
-    @ApiOperation("驳回")
127
+    @SaCheckPermission("manager")
128
+    @ApiOperation("管理员驳回问题单")
196
     @PostMapping("/taIssueProcess/reject")
129
     @PostMapping("/taIssueProcess/reject")
197
     public ResponseBean reject(@ApiParam("对象实体") @RequestBody TaIssueProcess taIssueProcess) throws Exception {
130
     public ResponseBean reject(@ApiParam("对象实体") @RequestBody TaIssueProcess taIssueProcess) throws Exception {
198
         TaIssue taIssue = checkIssue(taIssueProcess);
131
         TaIssue taIssue = checkIssue(taIssueProcess);
201
             return ResponseBean.error("请填写未驳回原因");
134
             return ResponseBean.error("请填写未驳回原因");
202
         }
135
         }
203
 
136
 
204
-        updateUser(taIssueProcess, currentUser());
205
-        taIssueProcess.setProcessNode(Constants.PROCESS_START);
206
-        taIssueProcess.setProcessStatus(Constants.PROCESS_STATUS_REJECT);
207
-        taIssueProcessService.save(taIssueProcess);
208
-
209
-        updateIssue(taIssue, taIssueProcess);
210
-
211
-        // 发送消息
212
-        applicationEventPublisher.publishEvent(new MessagEvent(this, taIssue));
213
-        return ResponseBean.success(taIssueProcess);
214
-    }
215
-
216
-    /**
217
-     * 单位驳回
218
-     *
219
-     * @param taIssueProcess 实例对象
220
-     * @return 实例对象
221
-     */
222
-    @SaCheckPermission("org_user")
223
-    @ApiOperation("单位驳回")
224
-    @PostMapping("/taIssueProcess/org/reject")
225
-    public ResponseBean orgReject(@ApiParam("对象实体") @RequestBody TaIssueProcess taIssueProcess) throws Exception {
226
-        TaIssue taIssue = checkIssue(taIssueProcess);
227
-
228
-        TaIssueProcess prevProcess = taIssueProcessService.getById(taIssueProcess.getPrevProcess());
229
-        if (null == prevProcess) {
230
-            return ResponseBean.error("未找到上级流程");
231
-        }
232
-
233
-        if (StringUtils.isEmpty(taIssueProcess.getProcessResult())) {
234
-            return ResponseBean.error("请填写未驳回原因");
235
-        }
236
-
237
-        updateUser(taIssueProcess, currentUser());
238
-        taIssueProcess.setNextOrg(prevProcess.getOrgId());
239
-        taIssueProcess.setProcessNode(Constants.PROCESS_ASSIGNED);
240
-        taIssueProcess.setProcessStatus(Constants.PROCESS_STATUS_REJECT);
241
-        taIssueProcessService.save(taIssueProcess);
242
-
243
-        updateIssue(taIssue, taIssueProcess);
244
-
245
-        return ResponseBean.success(taIssueProcess);
246
-    }
247
-
248
-    /**
249
-     * 延期申请
250
-     *
251
-     * @param taIssueProcess 实例对象
252
-     * @return 实例对象
253
-     */
254
-    @SaCheckPermission("org_user")
255
-    @ApiOperation("延期申请")
256
-    @PostMapping("/taIssueProcess/org/delay/apply")
257
-    public ResponseBean delayApply(@ApiParam("对象实体") @RequestBody TaIssueProcess taIssueProcess) throws Exception {
258
-        TaIssue taIssue = checkIssue(taIssueProcess);
259
-
260
-        if (StringUtils.isEmpty(taIssueProcess.getExpireDate())) {
261
-            return ResponseBean.error("请设置延期日期");
262
-        } else {
263
-            if (DateUtils.isAfter(taIssueProcess.getExpireDate() + " 23:59:59")) {
264
-                return ResponseBean.error("请设置有效的延期日期");
265
-            }
266
-        }
267
-
268
-        TaIssueProcess prevProcess = taIssueProcessService.getById(taIssueProcess.getPrevProcess());
269
-        if (null == prevProcess) {
270
-            return ResponseBean.error("未找到上级流程");
271
-        }
272
-
273
-        updateUser(taIssueProcess, currentUser());
274
-        taIssueProcess.setNextOrg(prevProcess.getOrgId());
275
-        taIssueProcess.setProcessNode(Constants.PROCESS_ORG_DELAY_APPLY);
276
-        taIssueProcess.setProcessStatus(Constants.PROCESS_STATUS_READY);
277
-        taIssueProcessService.save(taIssueProcess);
278
-
279
-        updateIssue(taIssue, taIssueProcess);
280
-
281
-        return ResponseBean.success(taIssueProcess);
282
-    }
283
-
284
-    /**
285
-     * 延期审核
286
-     *
287
-     * @param taIssueProcess 实例对象
288
-     * @return 实例对象
289
-     */
290
-    @SaCheckPermission("manager")
291
-    @ApiOperation("延期审核")
292
-    @PostMapping("/taIssueProcess/delay/verify")
293
-    public ResponseBean delayVerify(@ApiParam("对象实体") @RequestBody TaIssueProcess taIssueProcess) throws Exception {
294
-        TaIssue taIssue = checkIssue(taIssueProcess);
295
-
296
-        TaIssueProcess prevProcess = taIssueProcessService.getById(taIssueProcess.getPrevProcess());
297
-        if (null == prevProcess) {
298
-            return ResponseBean.error("未找到上级流程");
299
-        }
300
-
301
-        if (!Constants.PROCESS_ORG_DELAY_APPLY.equals(prevProcess.getProcessNode())) {
302
-            return ResponseBean.error("上级流程验证不正确");
303
-        }
304
-
305
-        if (Constants.PROCESS_STATUS_REJECT.equals(taIssueProcess.getProcessStatus())) {
306
-            // 审核未通过
307
-            if (StringUtils.isEmpty(taIssueProcess.getProcessResult())) {
308
-                return ResponseBean.error("请填写未通过原因");
309
-            }
310
-        } else {
311
-            taIssue.setExpireDate(prevProcess.getExpireDate());
312
-        }
313
-
314
-        updateUser(taIssueProcess, currentUser());
315
-        taIssueProcess.setNextOrg(prevProcess.getOrgId());
316
-        taIssueProcess.setProcessNode(Constants.PROCESS_DELAY_VERIFY);
317
-        taIssueProcessService.save(taIssueProcess);
318
-
319
-        updateIssue(taIssue, taIssueProcess);
320
-
137
+        // 管理员驳回问题单
138
+        taIssueService.reject(taIssue, taIssueProcess, currentUser());
321
         return ResponseBean.success(taIssueProcess);
139
         return ResponseBean.success(taIssueProcess);
322
     }
140
     }
323
-
324
-    /**
325
-     * 单位交办
326
-     *
327
-     * @param taIssueProcess 实例对象
328
-     * @return 实例对象
329
-     */
330
-    @SaCheckPermission("org_user")
331
-    @ApiOperation("单位交办")
332
-    @PostMapping("/taIssueProcess/org/assigned")
333
-    public ResponseBean orgAssigned(@ApiParam("对象实体") @RequestBody TaIssueProcess taIssueProcess) throws Exception {
334
-        TaIssue taIssue = checkIssue(taIssueProcess);
335
-
336
-        updateUser(taIssueProcess, currentUser());
337
-        taIssueProcess.setProcessNode(Constants.PROCESS_ORG_ASSIGNED);
338
-        taIssueProcess.setProcessStatus(Constants.PROCESS_STATUS_READY);
339
-        taIssueProcessService.save(taIssueProcess);
340
-
341
-        updateIssue(taIssue, taIssueProcess);
342
-
343
-        return ResponseBean.success(taIssueProcess);
344
-    }
345
-
346
-    /**
347
-     * 单位审核
348
-     *
349
-     * @param taIssueProcess 实例对象
350
-     * @return 实例对象
351
-     */
352
-    @SaCheckPermission("org_manager")
353
-    @ApiOperation("单位审核")
354
-    @PostMapping("/taIssueProcess/org/verify")
355
-    public ResponseBean orgVerify(@ApiParam("对象实体") @RequestBody TaIssueProcess taIssueProcess) throws Exception {
356
-        TaIssue taIssue = checkIssue(taIssueProcess);
357
-
358
-        if (StringUtils.isEmpty(taIssueProcess.getProcessStatus())) {
359
-            return ResponseBean.error("请设置审批是否通过");
360
-        }
361
-
362
-        if (Constants.PROCESS_STATUS_REJECT.equals(taIssueProcess.getProcessStatus())) {
363
-            // 审核未通过
364
-            if (StringUtils.isEmpty(taIssueProcess.getProcessResult())) {
365
-                return ResponseBean.error("请填写未通过原因");
366
-            }
367
-        }
368
-
369
-        updateUser(taIssueProcess, currentUser());
370
-        taIssueProcess.setProcessNode(Constants.PROCESS_ORG_VERIFY);
371
-        taIssueProcessService.save(taIssueProcess);
372
-
373
-        updateIssue(taIssue, taIssueProcess);
374
-
375
-        return ResponseBean.success(taIssueProcess);
376
-    }
377
-
378
-    /**
379
-     * 办结申请
380
-     *
381
-     * @param taIssueProcess 实例对象
382
-     * @return 实例对象
383
-     */
384
-    @SaCheckPermission("org_user")
385
-    @ApiOperation("办结申请")
386
-    @PostMapping("/taIssueProcess/org/finish/apply")
387
-    public ResponseBean finishApply(@ApiParam("对象实体") @RequestBody TaIssueProcess taIssueProcess) throws Exception {
388
-        TaIssue taIssue = checkIssue(taIssueProcess);
389
-
390
-        updateUser(taIssueProcess, currentUser());
391
-        taIssueProcess.setNextOrg(Constants.ROOT_ORG);
392
-        taIssueProcess.setProcessNode(Constants.PROCESS_ORG_FINISH_APPLY);
393
-        taIssueProcess.setProcessStatus(Constants.PROCESS_STATUS_READY);
394
-        taIssueProcessService.save(taIssueProcess);
395
-
396
-        updateIssue(taIssue, taIssueProcess);
397
-
398
-        return ResponseBean.success(taIssueProcess);
399
-    }
400
-
401
-
402
-    /**
403
-     * 办结审核
404
-     *
405
-     * @param taIssueProcess 实例对象
406
-     * @return 实例对象
407
-     */
408
-    @SaCheckPermission("manager")
409
-    @ApiOperation("办结审核")
410
-    @PostMapping("/taIssueProcess/finish/verify")
411
-    public ResponseBean finishVerify(@ApiParam("对象实体") @RequestBody TaIssueProcess taIssueProcess) throws Exception {
412
-        TaIssue taIssue = checkIssue(taIssueProcess);
413
-
414
-        TaIssueProcess prevProcess = taIssueProcessService.getById(taIssueProcess.getPrevProcess());
415
-        if (null == prevProcess) {
416
-            return ResponseBean.error("未找到上级流程");
417
-        }
418
-
419
-        if (!Constants.PROCESS_ORG_FINISH_APPLY.equals(prevProcess.getProcessNode())) {
420
-            return ResponseBean.error("上级流程验证不正确");
421
-        }
422
-
423
-        if (StringUtils.isEmpty(taIssueProcess.getProcessStatus())) {
424
-            return ResponseBean.error("请设置审批是否通过");
425
-        }
426
-
427
-        if (Constants.PROCESS_STATUS_REJECT.equals(taIssueProcess.getProcessStatus())) {
428
-            // 审核未通过
429
-            if (StringUtils.isEmpty(taIssueProcess.getProcessResult())) {
430
-                return ResponseBean.error("请填写未通过原因");
431
-            }
432
-            taIssueProcess.setNextOrg(prevProcess.getOrgId());
433
-            taIssueProcess.setProcessNode(Constants.PROCESS_FINISH_VERIFY);
434
-        } else {
435
-            // 审核通过, 说明整个流程结束
436
-            taIssue.setProcessNode(Constants.PROCESS_END);
437
-            taIssue.setProcessStatus(Constants.PROCESS_STATUS_PASS);
438
-        }
439
-
440
-        updateUser(taIssueProcess, currentUser());
441
-        taIssueProcessService.save(taIssueProcess);
442
-
443
-        taIssue.setOrgId(taIssueProcess.getOrgId());
444
-        taIssueService.updateById(taIssue);
445
-
446
-        return ResponseBean.success(taIssueProcess);
447
-    }
448
-
449
-    /**
450
-     * 通过主键删除数据
451
-     *
452
-     * @param processId 主键
453
-     * @return 是否成功
454
-     */
455
-    @ApiOperation("通过主键删除数据")
456
-    @DeleteMapping("/taIssueProcess/{id}")
457
-    public ResponseBean deleteById(@ApiParam("对象ID") @PathVariable Integer id) {
458
-        taIssueProcessService.removeLogicById(id);
459
-        return ResponseBean.success("success");
460
-    }
461
 }
141
 }

+ 43
- 41
src/main/java/com/example/civilizedcity/controller/TaOrgIssueController.java View File

39
     /** 
39
     /** 
40
      * 通过ID查询单条数据 
40
      * 通过ID查询单条数据 
41
      *
41
      *
42
-     * @param orgIssueId 主键
42
+     * @param id 主键
43
      * @return 实例对象
43
      * @return 实例对象
44
      */
44
      */
45
     @ApiOperation("通过ID查询单条数据")
45
     @ApiOperation("通过ID查询单条数据")
63
 
63
 
64
          TaOrgIssue taOrgIssue = taOrgIssueService.getOne(queryWrapper);
64
          TaOrgIssue taOrgIssue = taOrgIssueService.getOne(queryWrapper);
65
          if (null != taOrgIssue) {
65
          if (null != taOrgIssue) {
66
-             List<TaAttach> attachList = taAttachService.getListBy(Constants.ATTACH_SOURCE_ORG_ISSUE, taOrgIssue.getOrgIssueId().toString());
66
+             List<TaAttach> attachList = taAttachService.getListBy(Constants.SOURCE_ORG_ISSUE, taOrgIssue.getOrgIssueId().toString());
67
              taOrgIssue.setAttachList(attachList);
67
              taOrgIssue.setAttachList(attachList);
68
          }
68
          }
69
 
69
 
91
         return ResponseBean.success(result);
91
         return ResponseBean.success(result);
92
     }
92
     }
93
     
93
     
94
-    /** 
95
-     * 新增数据
96
-     *
97
-     * @param taOrgIssue 实例对象
98
-     * @return 实例对象
99
-     */
100
-    @ApiOperation("新增数据")
101
-    @PostMapping("/taOrgIssue")
102
-    public ResponseBean add(@ApiParam("对象实体") @RequestBody TaOrgIssue taOrgIssue) throws Exception {
103
-        taOrgIssueService.save(taOrgIssue);
104
-        return ResponseBean.success(taOrgIssue);
105
-    }
106
-    
107
-    /** 
108
-     * 更新数据
109
-     *
110
-     * @param taOrgIssue 实例对象
111
-     * @return 实例对象
112
-     */
113
-    @ApiOperation("更新数据")
114
-    @PutMapping("/taOrgIssue/{id}")
115
-    public ResponseBean edit(@ApiParam("对象实体") @RequestBody TaOrgIssue taOrgIssue,
116
-                            @ApiParam("对象ID") @PathVariable Integer id ) throws Exception {
117
-        taOrgIssueService.updateById(taOrgIssue);
118
-        return ResponseBean.success(taOrgIssue);
119
-    }
120
-    
121
-    /** 
122
-     * 通过主键删除数据
123
-     *
124
-     * @param orgIssueId 主键
125
-     * @return 是否成功
126
-     */
127
-    @ApiOperation("通过主键删除数据")
128
-    @DeleteMapping("/taOrgIssue/{id}")
129
-    public ResponseBean deleteById(@ApiParam("对象ID") @PathVariable Integer id){
130
-        taOrgIssueService.removeLogicById(id);
131
-        return ResponseBean.success("success");
132
-    }
94
+//    /**
95
+//     * 新增数据
96
+//     *
97
+//     * @param taOrgIssue 实例对象
98
+//     * @return 实例对象
99
+//     */
100
+//    @ApiOperation("新增数据")
101
+//    @PostMapping("/taOrgIssue")
102
+//    public ResponseBean add(@ApiParam("对象实体") @RequestBody TaOrgIssue taOrgIssue) throws Exception {
103
+//        taOrgIssueService.save(taOrgIssue);
104
+//        return ResponseBean.success(taOrgIssue);
105
+//    }
106
+//
107
+//    /**
108
+//     * 更新数据
109
+//     *
110
+//     * @param taOrgIssue 实例对象
111
+//     * @return 实例对象
112
+//     */
113
+//    @ApiOperation("更新数据")
114
+//    @PutMapping("/taOrgIssue/{id}")
115
+//    public ResponseBean edit(@ApiParam("对象实体") @RequestBody TaOrgIssue taOrgIssue,
116
+//                            @ApiParam("对象ID") @PathVariable Integer id ) throws Exception {
117
+//        taOrgIssue.setOrgIssueId(id);
118
+//
119
+//        taOrgIssueService.updateById(taOrgIssue);
120
+//        return ResponseBean.success(taOrgIssue);
121
+//    }
122
+//
123
+//    /**
124
+//     * 通过主键删除数据
125
+//     *
126
+//     * @param id 主键
127
+//     * @return 是否成功
128
+//     */
129
+//    @ApiOperation("通过主键删除数据")
130
+//    @DeleteMapping("/taOrgIssue/{id}")
131
+//    public ResponseBean deleteById(@ApiParam("对象ID") @PathVariable Integer id){
132
+//        taOrgIssueService.removeLogicById(id);
133
+//        return ResponseBean.success("success");
134
+//    }
133
 }
135
 }

+ 3
- 0
src/main/java/com/example/civilizedcity/entity/TaFeedback.java View File

56
     /** 审核意见 */
56
     /** 审核意见 */
57
     @ApiModelProperty(name = "审核意见",notes = "")
57
     @ApiModelProperty(name = "审核意见",notes = "")
58
     private String verifyDesc ;
58
     private String verifyDesc ;
59
+     /** 审核日期 */
60
+     @ApiModelProperty(name = "审核日期",notes = "")
61
+     private LocalDateTime verifyDate ;
59
     /** 关联问题单 */
62
     /** 关联问题单 */
60
     @ApiModelProperty(name = "关联问题单",notes = "")
63
     @ApiModelProperty(name = "关联问题单",notes = "")
61
     private String issueId ;
64
     private String issueId ;

+ 3
- 0
src/main/java/com/example/civilizedcity/entity/TaIssue.java View File

63
        /** 截止时间;YYYY-MM-DD */
63
        /** 截止时间;YYYY-MM-DD */
64
        @ApiModelProperty(name = "截止时间",notes = "YYYY-MM-DD")
64
        @ApiModelProperty(name = "截止时间",notes = "YYYY-MM-DD")
65
        private String expireDate ;
65
        private String expireDate ;
66
+     /** 办结时间 */
67
+     @ApiModelProperty(name = "办结时间",notes = "")
68
+     private LocalDateTime endDate ;
66
       /** 交办次数 */
69
       /** 交办次数 */
67
       @ApiModelProperty(name = "交办次数",notes = "")
70
       @ApiModelProperty(name = "交办次数",notes = "")
68
       private Integer processNum ;
71
       private Integer processNum ;

+ 3
- 0
src/main/java/com/example/civilizedcity/entity/TaOrgIssue.java View File

35
     /** 机构ID */
35
     /** 机构ID */
36
     @ApiModelProperty(name = "机构ID",notes = "")
36
     @ApiModelProperty(name = "机构ID",notes = "")
37
     private String orgId ;
37
     private String orgId ;
38
+     /** 流程节点 */
39
+     @ApiModelProperty(name = "流程节点",notes = "")
40
+     private String processNode ;
38
     /** 业务单状态 */
41
     /** 业务单状态 */
39
     @ApiModelProperty(name = "业务单状态",notes = "")
42
     @ApiModelProperty(name = "业务单状态",notes = "")
40
     private String processStatus ;
43
     private String processStatus ;

+ 5
- 1
src/main/java/com/example/civilizedcity/mapper/TaAttachMapper.java View File

16
 public interface TaAttachMapper  extends BaseMapper<TaAttach>{
16
 public interface TaAttachMapper  extends BaseMapper<TaAttach>{
17
 
17
 
18
      List<TaAttach> getListBy(@Param("ownerType") String ownerType,@Param("ownerId") String ownerId);
18
      List<TaAttach> getListBy(@Param("ownerType") String ownerType,@Param("ownerId") String ownerId);
19
- }
19
+
20
+    long deleteNotIn(@Param("idList") List<Integer> idList,
21
+                     @Param("ownerType") String ownerType,
22
+                     @Param("ownerId") String ownerId);
23
+}

+ 1
- 1
src/main/java/com/example/civilizedcity/mapper/TaFeedbackMapper.java View File

27
     IPage<TaIssue> getPageBy(IPage<TaIssue> pg,
27
     IPage<TaIssue> getPageBy(IPage<TaIssue> pg,
28
                              @Param("personId") String personId,
28
                              @Param("personId") String personId,
29
                              @Param("processList") List<String> processList,
29
                              @Param("processList") List<String> processList,
30
-                             @Param("verifyStatus") String verifyStatus);
30
+                             @Param("processStatus") String processStatus);
31
 }
31
 }

+ 7
- 0
src/main/java/com/example/civilizedcity/service/TaIssueService.java View File

3
 import com.baomidou.mybatisplus.core.metadata.IPage;
3
 import com.baomidou.mybatisplus.core.metadata.IPage;
4
 import com.example.civilizedcity.entity.SysUser;
4
 import com.example.civilizedcity.entity.SysUser;
5
 import com.example.civilizedcity.entity.TaIssue;
5
 import com.example.civilizedcity.entity.TaIssue;
6
+import com.example.civilizedcity.entity.TaIssueProcess;
6
 import com.example.civilizedcity.entity.TaPerson;
7
 import com.example.civilizedcity.entity.TaPerson;
7
 import com.example.civilizedcity.vo.StatVo;
8
 import com.example.civilizedcity.vo.StatVo;
8
 
9
 
24
      List<StatVo> statMaIndex(SysUser user, TaPerson person, String duty);
25
      List<StatVo> statMaIndex(SysUser user, TaPerson person, String duty);
25
 
26
 
26
     void updateEnd(SysUser sysUser, String orgId, Integer issueId);
27
     void updateEnd(SysUser sysUser, String orgId, Integer issueId);
28
+
29
+    void createNew(TaIssue taIssue, SysUser user) throws Exception;
30
+
31
+    void updateIssue(TaIssue taIssue, TaIssue origin) throws Exception;
32
+
33
+    void reject(TaIssue taIssue, TaIssueProcess taIssueProcess, SysUser user) throws Exception;
27
 }
34
 }

+ 3
- 1
src/main/java/com/example/civilizedcity/service/TaOrgIssueService.java View File

15
 
15
 
16
      IPage<TaIssue> getIssuePageBy(IPage<TaIssue> pg, String orgId, String sourceType, String bizStatus);
16
      IPage<TaIssue> getIssuePageBy(IPage<TaIssue> pg, String orgId, String sourceType, String bizStatus);
17
 
17
 
18
-     void createNewIssue(TaIssue taIssue, SysUser sysUser);
18
+     void createNewIssue(TaIssue taIssue, TaIssueProcess taIssueProcess, SysUser sysUser) throws Exception;
19
+
20
+     TaOrgIssue getByIssueAndOrg(Integer issueId, String orgId);
19
  }
21
  }

+ 1
- 7
src/main/java/com/example/civilizedcity/service/impl/TaAttachServiceImpl.java View File

25
 
25
 
26
     @Override
26
     @Override
27
     public boolean deleteNotIn(List<Integer> idList, String ownerType, String ownerId) {
27
     public boolean deleteNotIn(List<Integer> idList, String ownerType, String ownerId) {
28
-
29
-        QueryWrapper<TaAttach> queryWrapper = new QueryWrapper<>();
30
-        queryWrapper.eq("owner_type", ownerType);
31
-        queryWrapper.eq("owner_id", ownerId);
32
-        queryWrapper.notIn("attach_id", idList);
33
-
34
-        return remove(queryWrapper);
28
+        return baseMapper.deleteNotIn(idList, ownerType, ownerId) > 0;
35
     }
29
     }
36
 }
30
 }

+ 1
- 1
src/main/java/com/example/civilizedcity/service/impl/TaCheckItemServiceImpl.java View File

174
             // 保存附件
174
             // 保存附件
175
             if (null != item.getAttachList()) {
175
             if (null != item.getAttachList()) {
176
                 for (TaAttach taAttach : item.getAttachList()) {
176
                 for (TaAttach taAttach : item.getAttachList()) {
177
-                    taAttach.setOwnerType(Constants.ATTACH_SOURCE_CHECK_ANSWER);
177
+                    taAttach.setOwnerType(Constants.SOURCE_CHECK_ANSWER);
178
                     taAttach.setOwnerId(item.getItemId());
178
                     taAttach.setOwnerId(item.getItemId());
179
                     taAttach.setStatus(Constants.STATUS_NORMAL);
179
                     taAttach.setStatus(Constants.STATUS_NORMAL);
180
                     taAttach.setCreateUser(taCheckAnswer.getCreateUser());
180
                     taAttach.setCreateUser(taCheckAnswer.getCreateUser());

+ 28
- 18
src/main/java/com/example/civilizedcity/service/impl/TaFeedbackServiceImpl.java View File

3
 import com.baomidou.mybatisplus.core.metadata.IPage;
3
 import com.baomidou.mybatisplus.core.metadata.IPage;
4
 import com.example.civilizedcity.common.Constants;
4
 import com.example.civilizedcity.common.Constants;
5
 import com.example.civilizedcity.common.StringUtils;
5
 import com.example.civilizedcity.common.StringUtils;
6
-import com.example.civilizedcity.entity.TaAttach;
7
-import com.example.civilizedcity.entity.TaIssue;
8
-import com.example.civilizedcity.entity.TaPerson;
9
-import com.example.civilizedcity.mapper.TaAttachMapper;
10
-import com.example.civilizedcity.mapper.TaIssueMapper;
11
-import com.example.civilizedcity.mapper.TaPersonMapper;
6
+import com.example.civilizedcity.entity.*;
7
+import com.example.civilizedcity.mapper.*;
12
 import org.springframework.beans.factory.annotation.Autowired;
8
 import org.springframework.beans.factory.annotation.Autowired;
13
 import org.springframework.stereotype.Service;
9
 import org.springframework.stereotype.Service;
14
-import com.example.civilizedcity.entity.TaFeedback;
15
-import com.example.civilizedcity.mapper.TaFeedbackMapper;
16
 import com.example.civilizedcity.service.TaFeedbackService;
10
 import com.example.civilizedcity.service.TaFeedbackService;
17
 import org.springframework.transaction.annotation.Transactional;
11
 import org.springframework.transaction.annotation.Transactional;
18
 
12
 
38
     @Autowired
32
     @Autowired
39
     TaAttachMapper taAttachMapper;
33
     TaAttachMapper taAttachMapper;
40
 
34
 
35
+    @Autowired
36
+    TaIssueProcessMapper taIssueProcessMapper;
37
+
41
     @Transactional(rollbackFor = Exception.class)
38
     @Transactional(rollbackFor = Exception.class)
42
     @Override
39
     @Override
43
     public void createNew(TaFeedback taFeedback, TaPerson taPerson) throws Exception {
40
     public void createNew(TaFeedback taFeedback, TaPerson taPerson) throws Exception {
71
 
68
 
72
         taIssue.setOrgId(null); // 暂时没有责任单位
69
         taIssue.setOrgId(null); // 暂时没有责任单位
73
         taIssue.setProcessNode(Constants.PROCESS_START);
70
         taIssue.setProcessNode(Constants.PROCESS_START);
74
-        taIssue.setProcessStatus(Constants.PROCESS_STATUS_READY);
75
-        taIssue.setProcessNum(1);
76
-        taIssue.setSourceType(Constants.ISSUE_SOURCE_FEEDBACK);
71
+        taIssue.setProcessStatus(Constants.APPLY_READY); // 需要审核
72
+        taIssue.setProcessNum(0);
73
+        taIssue.setSourceType(Constants.SOURCE_FEEDBACK);
77
         taIssue.setStatus(Constants.STATUS_NORMAL);
74
         taIssue.setStatus(Constants.STATUS_NORMAL);
78
         taIssue.setCreateUser(taFeedback.getPersonId());
75
         taIssue.setCreateUser(taFeedback.getPersonId());
79
-        taIssue.setUserName(taFeedback.getName());
76
+        taIssue.setUserName(StringUtils.isEmpty(taFeedback.getName()) ? "市民" : taFeedback.getName());
80
         taIssue.setCreateDate(LocalDateTime.now());
77
         taIssue.setCreateDate(LocalDateTime.now());
81
         taIssueMapper.insert(taIssue);
78
         taIssueMapper.insert(taIssue);
79
+
82
         // 保存文件
80
         // 保存文件
83
         List<TaAttach> attachList = taFeedback.getAttachList();
81
         List<TaAttach> attachList = taFeedback.getAttachList();
84
         if (null != attachList && attachList.size() > 0) {
82
         if (null != attachList && attachList.size() > 0) {
85
             for (TaAttach item : attachList) {
83
             for (TaAttach item : attachList) {
86
                 item.setAttachId(null);
84
                 item.setAttachId(null);
87
-                item.setOwnerType(Constants.ATTACH_SOURCE_ISSUE);
85
+                item.setOwnerType(Constants.SOURCE_ISSUE);
88
                 item.setOwnerId(taIssue.getIssueId().toString());
86
                 item.setOwnerId(taIssue.getIssueId().toString());
89
                 item.setStatus(Constants.STATUS_NORMAL);
87
                 item.setStatus(Constants.STATUS_NORMAL);
90
                 item.setCreateDate(LocalDateTime.now());
88
                 item.setCreateDate(LocalDateTime.now());
98
         if (null != attachList && attachList.size() > 0) {
96
         if (null != attachList && attachList.size() > 0) {
99
             for (TaAttach item : attachList) {
97
             for (TaAttach item : attachList) {
100
                 item.setAttachId(null);
98
                 item.setAttachId(null);
101
-                item.setOwnerType(Constants.ATTACH_SOURCE_FEEDBACK);
99
+                item.setOwnerType(Constants.SOURCE_FEEDBACK);
102
                 item.setOwnerId(taFeedback.getFeedbackId());
100
                 item.setOwnerId(taFeedback.getFeedbackId());
103
                 taAttachMapper.insert(item);
101
                 taAttachMapper.insert(item);
104
             }
102
             }
105
         }
103
         }
106
 
104
 
105
+        // 流程节点
106
+        TaIssueProcess process = new TaIssueProcess();
107
+        process.setIssueId(taIssue.getIssueId());
108
+        process.setOrgId(null); // 市民没有 org
109
+        process.setProcessNode(Constants.PROCESS_START);
110
+        process.setProcessStatus(Constants.APPLY_READY);
111
+        process.setStatus(Constants.STATUS_NORMAL);
112
+        process.setCreateUser(taPerson.getPersonId());
113
+        process.setUserName(StringUtils.isEmpty(taFeedback.getName()) ? "市民" : taPerson.getName());
114
+        process.setCreateDate(LocalDateTime.now());
115
+        taIssueProcessMapper.insert(process);
107
     }
116
     }
108
 
117
 
109
     @Override
118
     @Override
110
     public IPage<TaIssue> getPageBy(IPage<TaIssue> pg, String personId, String bizStatus) {
119
     public IPage<TaIssue> getPageBy(IPage<TaIssue> pg, String personId, String bizStatus) {
111
 
120
 
112
         List<String> processList = new ArrayList<>();
121
         List<String> processList = new ArrayList<>();
113
-        String verifyStatus = null;
122
+        String processStatus = null;
114
 
123
 
115
         // 未处理
124
         // 未处理
116
         if (Constants.PROCESS_START.equals(bizStatus)) {
125
         if (Constants.PROCESS_START.equals(bizStatus)) {
124
         }
133
         }
125
 
134
 
126
         // 已打回
135
         // 已打回
127
-        if (Constants.APPLY_STATUS_REJECT.equals(bizStatus)) {
128
-            verifyStatus = Constants.APPLY_STATUS_REJECT;
136
+        if (Constants.APPLY_REJECT.equals(bizStatus)) {
137
+            processList.add(Constants.PROCESS_END);
138
+            processStatus = Constants.APPLY_REJECT;
129
         }
139
         }
130
 
140
 
131
-        return baseMapper.getPageBy(pg, personId, processList, verifyStatus);
141
+        return baseMapper.getPageBy(pg, personId, processList, processStatus);
132
     }
142
     }
133
 }
143
 }

+ 126
- 57
src/main/java/com/example/civilizedcity/service/impl/TaIssueApplyServiceImpl.java View File

4
 import com.baomidou.mybatisplus.core.metadata.IPage;
4
 import com.baomidou.mybatisplus.core.metadata.IPage;
5
 import com.example.civilizedcity.common.Constants;
5
 import com.example.civilizedcity.common.Constants;
6
 import com.example.civilizedcity.common.ResponseBean;
6
 import com.example.civilizedcity.common.ResponseBean;
7
-import com.example.civilizedcity.entity.SysUser;
8
-import com.example.civilizedcity.entity.TaIssue;
9
-import com.example.civilizedcity.entity.TaOrgIssue;
7
+import com.example.civilizedcity.entity.*;
10
 import com.example.civilizedcity.event.MessagEvent;
8
 import com.example.civilizedcity.event.MessagEvent;
11
-import com.example.civilizedcity.mapper.TaIssueMapper;
12
-import com.example.civilizedcity.mapper.TaOrgIssueMapper;
9
+import com.example.civilizedcity.mapper.*;
13
 import org.springframework.beans.factory.annotation.Autowired;
10
 import org.springframework.beans.factory.annotation.Autowired;
14
 import org.springframework.context.ApplicationEventPublisher;
11
 import org.springframework.context.ApplicationEventPublisher;
15
 import org.springframework.stereotype.Service;
12
 import org.springframework.stereotype.Service;
16
-import com.example.civilizedcity.entity.TaIssueApply;
17
-import com.example.civilizedcity.mapper.TaIssueApplyMapper;
18
 import com.example.civilizedcity.service.TaIssueApplyService;
13
 import com.example.civilizedcity.service.TaIssueApplyService;
19
 import org.springframework.transaction.annotation.Transactional;
14
 import org.springframework.transaction.annotation.Transactional;
20
 
15
 
35
     @Autowired
30
     @Autowired
36
     TaOrgIssueMapper taOrgIssueMapper;
31
     TaOrgIssueMapper taOrgIssueMapper;
37
 
32
 
33
+    @Autowired
34
+    TaIssueProcessMapper taIssueProcessMapper;
35
+
36
+    @Autowired
37
+    TaFeedbackMapper taFeedbackMapper;
38
+
38
     @Autowired
39
     @Autowired
39
     ApplicationEventPublisher applicationEventPublisher;
40
     ApplicationEventPublisher applicationEventPublisher;
40
 
41
 
42
+    @Transactional(rollbackFor = Exception.class)
41
     @Override
43
     @Override
42
     public void createNewApply(TaIssueApply taIssueApply, SysUser sysUser) throws Exception {
44
     public void createNewApply(TaIssueApply taIssueApply, SysUser sysUser) throws Exception {
43
-
44
-        if (null == taIssueApply.getIssueId()) {
45
-            throw new Exception("校验问题单出错");
46
-        }
47
-
48
-        if (!Constants.ROOT_ORG.equals(sysUser.getOrgId())) {
49
-            // 如果是责任单位打的申请
50
-            TaOrgIssue taOrgIssue = taOrgIssueMapper.getByIssueAndOrg(taIssueApply.getIssueId(), sysUser.getOrgId());
51
-            if (null == taOrgIssue) {
52
-                throw new Exception("未找到交办单位问题单");
53
-            }
54
-
55
-            taOrgIssueMapper.updateById(taOrgIssue);
56
-        }
57
-
45
+        // 1. 先生成申请记录
58
         taIssueApply.setApplyId(null);
46
         taIssueApply.setApplyId(null);
59
         taIssueApply.setCreateUser(sysUser.getUserId());
47
         taIssueApply.setCreateUser(sysUser.getUserId());
60
         taIssueApply.setCreateUserName(sysUser.getName());
48
         taIssueApply.setCreateUserName(sysUser.getName());
61
         taIssueApply.setOrgId(sysUser.getOrgId());
49
         taIssueApply.setOrgId(sysUser.getOrgId());
62
         taIssueApply.setCreateDate(LocalDateTime.now());
50
         taIssueApply.setCreateDate(LocalDateTime.now());
63
-
64
         save(taIssueApply);
51
         save(taIssueApply);
65
 
52
 
66
-        taIssueMapper.updateApply(taIssueApply.getIssueId(), taIssueApply.getApplyType(), taIssueApply.getApplyId());
67
-
68
-
69
-//        if (Constants.APPLY_VERIFY.equals(taIssueApply.getApplyType())) {
70
-//            taIssueMapper.updateValidateStatus(taIssueApply.getIssueId(), Constants.VERIFY_SUBMIT);
71
-//        }
53
+        // 2. 更新主记录
54
+        TaIssue taIssue = taIssueMapper.selectById(taIssueApply.getIssueId());
55
+        taIssue.setProcessNode(taIssueApply.getApplyType());
56
+        taIssue.setProcessStatus(Constants.APPLY_READY);
57
+        taIssue.setApplyType(taIssueApply.getApplyType());
58
+        taIssue.setApplyId(taIssueApply.getApplyId());
59
+        taIssueMapper.updateById(taIssue);
60
+
61
+        // 3. 更新单位记录
62
+        TaOrgIssue taOrgIssue = taOrgIssueMapper.getByIssueAndOrg(taIssueApply.getIssueId(), taIssueApply.getOrgId());
63
+        taOrgIssue.setProcessNode(taIssue.getProcessNode());
64
+        taOrgIssue.setProcessStatus(taIssue.getProcessStatus());
65
+        taOrgIssueMapper.updateById(taOrgIssue);
66
+
67
+        // 4. 生成流程节点
68
+        TaIssueProcess taIssueProcess = new TaIssueProcess();
69
+        taIssueProcess.setIssueId(taIssue.getIssueId());
70
+        taIssueProcess.setOrgId(taIssueApply.getOrgId());
71
+        taIssueProcess.setProcessNode(taIssue.getProcessNode());
72
+        taIssueProcess.setProcessStatus(taIssue.getProcessStatus());
73
+        taIssueProcess.setCreateUser(sysUser.getUserId());
74
+        taIssueProcess.setCreateDate(LocalDateTime.now());
75
+        taIssueProcess.setStatus(Constants.STATUS_NORMAL);
76
+        taIssueProcessMapper.insert(taIssueProcess);
72
 
77
 
73
         applicationEventPublisher.publishEvent(new MessagEvent(this, taIssueApply));
78
         applicationEventPublisher.publishEvent(new MessagEvent(this, taIssueApply));
74
     }
79
     }
81
     @Transactional(rollbackFor = Exception.class)
86
     @Transactional(rollbackFor = Exception.class)
82
     @Override
87
     @Override
83
     public void verify(TaIssueApply taIssueApply, SysUser sysUser, TaIssueApply origin) throws Exception {
88
     public void verify(TaIssueApply taIssueApply, SysUser sysUser, TaIssueApply origin) throws Exception {
84
-        // 更新审核信息
89
+        // 1. 更新审核信息
85
         origin.setVerifyStatus(taIssueApply.getVerifyStatus());
90
         origin.setVerifyStatus(taIssueApply.getVerifyStatus());
86
         origin.setVerifyDesc(taIssueApply.getVerifyDesc());
91
         origin.setVerifyDesc(taIssueApply.getVerifyDesc());
87
         origin.setVerifyOrg(sysUser.getOrgId());
92
         origin.setVerifyOrg(sysUser.getOrgId());
88
         origin.setVerifyUser(sysUser.getUserId());
93
         origin.setVerifyUser(sysUser.getUserId());
89
         origin.setVerifyUserName(sysUser.getName());
94
         origin.setVerifyUserName(sysUser.getName());
90
         origin.setVerifyDate(LocalDateTime.now());
95
         origin.setVerifyDate(LocalDateTime.now());
91
-        updateById(origin);
92
-
93
-        // 再判断审核类型
96
+        updateById(origin); // 至此 origin 里面是最新的信息
97
+
98
+        // 2. 生成流程记录
99
+        TaIssueProcess taIssueProcess = new TaIssueProcess();
100
+        taIssueProcess.setIssueId(origin.getIssueId());
101
+        taIssueProcess.setOrgId(origin.getOrgId());
102
+        taIssueProcess.setProcessNode(origin.getApplyType());
103
+        taIssueProcess.setProcessStatus(origin.getVerifyStatus());
104
+        taIssueProcess.setProcessResult(origin.getVerifyDesc());
105
+        taIssueProcess.setCreateUser(sysUser.getUserId());
106
+        taIssueProcess.setCreateDate(LocalDateTime.now());
107
+        taIssueProcess.setStatus(Constants.STATUS_NORMAL);
108
+        taIssueProcessMapper.insert(taIssueProcess);
109
+
110
+        // 3. 更新单位问题表
111
+        TaOrgIssue taOrgIssue = taOrgIssueMapper.getByIssueAndOrg(origin.getIssueId(), origin.getOrgId());
112
+        taOrgIssue.setProcessStatus(origin.getVerifyStatus());
113
+
114
+        // 4. 更正问题主表
115
+        TaIssue taIssue = taIssueMapper.selectById(taIssueApply.getIssueId());
94
         switch (origin.getApplyType()) {
116
         switch (origin.getApplyType()) {
95
-            case Constants.APPLY_VERIFY:
117
+            case Constants.PROCESS_APPLY_VERIFY:
96
                 // 问题单审核
118
                 // 问题单审核
97
-                verifyIssue();
119
+                verifyIssue(origin, taIssue, taOrgIssue);
98
                 break;
120
                 break;
99
-            case Constants.APPLY_REJECT:
121
+            case Constants.PROCESS_APPLY_REJECT:
100
                 // 问题单驳回
122
                 // 问题单驳回
101
-                verifyReject();
123
+                verifyReject(origin, taIssue, taOrgIssue);
102
                 break;
124
                 break;
103
-            case Constants.APPLY_DELAY:
125
+            case Constants.PROCESS_APPLY_DELAY:
104
                 // 延期申请
126
                 // 延期申请
105
-                verifyDelay(taIssueApply, origin);
127
+                verifyDelay(origin, taIssue, taOrgIssue);
106
                 break;
128
                 break;
107
-            case Constants.APPLY_END:
129
+            case Constants.PROCESS_APPLY_END:
108
                 // 销单申请
130
                 // 销单申请
131
+                verifyEnd(origin, taIssue, taOrgIssue);
109
                 break;
132
                 break;
110
             default:
133
             default:
111
                 // 其他
134
                 // 其他
112
                 break;
135
                 break;
113
         }
136
         }
114
 
137
 
138
+        taIssue.setUpdateDate(LocalDateTime.now());
139
+        taIssue.setUpdateUser(sysUser.getUserId());
140
+
141
+        taIssueMapper.updateById(taIssue);
142
+        taOrgIssueMapper.updateById(taOrgIssue);
143
+
144
+//        // 如果是用户随手拍
145
+//        if (Constants.SOURCE_FEEDBACK.equals(taIssue.getSourceType())) {
146
+//            // 如果是销单了
147
+//            if (taIssue.getProcessNode().equals(Constants.PROCESS_END)) {
148
+//            }
149
+//        }
150
+
151
+        applicationEventPublisher.publishEvent(new MessagEvent(this, origin));
115
     }
152
     }
116
 
153
 
117
     // 问题单审核
154
     // 问题单审核
118
-    public void verifyIssue() throws Exception {
119
-        // TODO;
155
+    public void verifyIssue(TaIssueApply taIssueApply, TaIssue taIssue, TaOrgIssue taOrgIssue) throws Exception {
156
+        taIssue.setProcessStatus(taIssueApply.getVerifyStatus());
157
+        //
158
+        taOrgIssue.setProcessStatus(taIssue.getProcessStatus());
120
     }
159
     }
121
 
160
 
122
     // 驳回审核
161
     // 驳回审核
123
-    public void verifyReject() throws Exception {
124
-        // TODO;
162
+    public void verifyReject(TaIssueApply taIssueApply, TaIssue taIssue, TaOrgIssue taOrgIssue) throws Exception {
163
+        if (Constants.APPLY_REJECT.equals(taIssueApply.getVerifyStatus())) {
164
+            // 如果审核不通过
165
+            taIssue.setProcessStatus(Constants.APPLY_REJECT);
166
+            taIssue.setProcessNum(taIssue.getProcessNum() + 1); // 交办次数 + 1
167
+
168
+            // 单位相当于重新开始
169
+            taOrgIssue.setProcessNode(Constants.PROCESS_START);
170
+            taOrgIssue.setProcessStatus(taIssue.getProcessStatus()); // 但是状态是审核不通过
171
+        } else {
172
+            taIssue.setProcessNode(Constants.PROCESS_START); // 问题单重新开始
173
+            taIssue.setProcessStatus(Constants.APPLY_PASS);
174
+//            taIssue.setProcessNum(0); // 交办次数清零
175
+            taIssue.setOrgId(null); // 没有交办单位
176
+            taIssue.setExpireDate(null); // 截止时间也没了
177
+            taIssue.setApplyId(null);
178
+            taIssue.setApplyType(null);
179
+
180
+            // 单位相当于结单了
181
+            taOrgIssue.setProcessNode(Constants.PROCESS_END);
182
+            taOrgIssue.setProcessStatus(Constants.APPLY_PASS);
183
+        }
125
     }
184
     }
126
 
185
 
127
     // 延期审核
186
     // 延期审核
128
-    public void verifyDelay(TaIssueApply taIssueApply, TaIssueApply origin) throws Exception {
129
-        if (Constants.APPLY_STATUS_REJECT.equals(taIssueApply.getVerifyStatus())) {
187
+    public void verifyDelay(TaIssueApply taIssueApply, TaIssue taIssue, TaOrgIssue taOrgIssue) throws Exception {
188
+        if (Constants.APPLY_REJECT.equals(taIssueApply.getVerifyStatus())) {
130
             // 如果审核不通过
189
             // 如果审核不通过
131
-            // TODO;
190
+            taIssue.setProcessStatus(Constants.APPLY_REJECT);
191
+            taOrgIssue.setProcessStatus(taIssue.getProcessStatus());
132
         } else {
192
         } else {
133
-            // 问题单截止日期更新为申请的截止日期
134
-            // 问题单的申请关联清空
135
-            UpdateWrapper<TaIssue> updateWrapper = new UpdateWrapper<>();
136
-            updateWrapper.set("expire_date", taIssueApply.getContent());
137
-            updateWrapper.set("apply_type", null);
138
-            updateWrapper.set("apply_id", null);
139
-            updateWrapper.eq("issue_id", origin.getIssueId());
193
+            taIssue.setProcessStatus(Constants.APPLY_PASS);
194
+            taIssue.setExpireDate(taIssueApply.getContent()); // 更新延期日期
140
 
195
 
196
+            taOrgIssue.setProcessStatus(taIssue.getProcessStatus());
141
         }
197
         }
142
     }
198
     }
143
 
199
 
144
-    // 问题单审核
145
-    public void verifyIssue() throws Exception {
146
-        // TODO;
200
+    // 销单审核
201
+    public void verifyEnd(TaIssueApply taIssueApply, TaIssue taIssue, TaOrgIssue taOrgIssue) throws Exception {
202
+        if (Constants.APPLY_REJECT.equals(taIssueApply.getVerifyStatus())) {
203
+            // 如果审核不通过
204
+            taIssue.setProcessStatus(Constants.APPLY_REJECT);
205
+            taOrgIssue.setProcessStatus(taIssue.getProcessStatus());
206
+        } else {
207
+            taIssue.setProcessNode(Constants.PROCESS_END);
208
+            taIssue.setProcessStatus(Constants.APPLY_PASS);
209
+            taIssue.setEndDate(LocalDateTime.now());
210
+            taIssue.setApplyId(null);
211
+            taIssue.setApplyType(null);
212
+
213
+            taOrgIssue.setProcessNode(Constants.PROCESS_END);
214
+            taOrgIssue.setProcessStatus(Constants.APPLY_PASS);
215
+        }
147
     }
216
     }
148
 
217
 
149
 
218
 

+ 125
- 8
src/main/java/com/example/civilizedcity/service/impl/TaIssueServiceImpl.java View File

2
 
2
 
3
 import com.baomidou.mybatisplus.core.metadata.IPage;
3
 import com.baomidou.mybatisplus.core.metadata.IPage;
4
 import com.example.civilizedcity.common.Constants;
4
 import com.example.civilizedcity.common.Constants;
5
-import com.example.civilizedcity.entity.SysUser;
6
-import com.example.civilizedcity.entity.TaIssueProcess;
7
-import com.example.civilizedcity.entity.TaPerson;
8
-import com.example.civilizedcity.mapper.TaFeedbackMapper;
9
-import com.example.civilizedcity.mapper.TaIssueProcessMapper;
10
-import com.example.civilizedcity.mapper.TaOrgIssueMapper;
5
+import com.example.civilizedcity.entity.*;
6
+import com.example.civilizedcity.event.MessagEvent;
7
+import com.example.civilizedcity.mapper.*;
11
 import com.example.civilizedcity.vo.StatVo;
8
 import com.example.civilizedcity.vo.StatVo;
12
 import org.springframework.beans.factory.annotation.Autowired;
9
 import org.springframework.beans.factory.annotation.Autowired;
10
+import org.springframework.context.ApplicationEventPublisher;
13
 import org.springframework.stereotype.Service;
11
 import org.springframework.stereotype.Service;
14
-import com.example.civilizedcity.entity.TaIssue;
15
-import com.example.civilizedcity.mapper.TaIssueMapper;
16
 import com.example.civilizedcity.service.TaIssueService;
12
 import com.example.civilizedcity.service.TaIssueService;
13
+import org.springframework.transaction.annotation.Transactional;
17
 
14
 
18
 import java.time.LocalDateTime;
15
 import java.time.LocalDateTime;
19
 import java.util.ArrayList;
16
 import java.util.ArrayList;
39
     @Autowired
36
     @Autowired
40
     TaIssueProcessMapper taIssueProcessMapper;
37
     TaIssueProcessMapper taIssueProcessMapper;
41
 
38
 
39
+    @Autowired
40
+    TaAttachMapper taAttachMapper;
41
+
42
+    @Autowired
43
+    ApplicationEventPublisher applicationEventPublisher;
44
+
42
     @Override
45
     @Override
43
     public IPage<TaIssue> getPageBy(IPage<TaIssue> pg, String orgId) {
46
     public IPage<TaIssue> getPageBy(IPage<TaIssue> pg, String orgId) {
44
         if (null == orgId) {
47
         if (null == orgId) {
130
 
133
 
131
     }
134
     }
132
 
135
 
136
+    @Transactional(rollbackFor = Exception.class)
137
+    @Override
138
+    public void createNew(TaIssue taIssue, SysUser user) throws Exception {
139
+        taIssue.setIssueId(null);
140
+        taIssue.setOrgId(null); // 暂时没有责任单位
141
+        taIssue.setProcessNode(Constants.PROCESS_START);
142
+        taIssue.setProcessStatus(Constants.APPLY_READY); // 督察员上报需要审核
143
+        taIssue.setProcessNum(0);   // 交办次数
144
+        taIssue.setSourceType(Constants.SOURCE_INSPECTOR);
145
+        taIssue.setStatus(Constants.STATUS_NORMAL);
146
+        taIssue.setCreateUser(user.getUserId());
147
+        taIssue.setUserName(user.getName());
148
+        taIssue.setCreateDate(LocalDateTime.now());
149
+        save(taIssue);
150
+
151
+        // 保存文件
152
+        List<TaAttach> attachList = taIssue.getAttachList();
153
+        if (null != attachList && attachList.size() > 0) {
154
+            for (TaAttach item : attachList) {
155
+                item.setAttachId(null);
156
+                item.setOwnerType(Constants.SOURCE_ISSUE);
157
+                item.setOwnerId(taIssue.getIssueId().toString());
158
+                item.setStatus(Constants.STATUS_NORMAL);
159
+                item.setCreateDate(LocalDateTime.now());
160
+                taAttachMapper.insert(item);
161
+            }
162
+        }
163
+
164
+        // 流程开始
165
+        TaIssueProcess process = new TaIssueProcess();
166
+        process.setIssueId(taIssue.getIssueId());
167
+        process.setOrgId(user.getOrgId());
168
+        process.setProcessNode(taIssue.getProcessNode());
169
+        process.setProcessStatus(taIssue.getProcessStatus());
170
+        process.setStatus(Constants.STATUS_NORMAL);
171
+        process.setCreateUser(user.getUserId());
172
+        process.setUserName(user.getName());
173
+        process.setCreateDate(LocalDateTime.now());
174
+        taIssueProcessMapper.insert(process);
175
+    }
176
+
177
+    @Transactional(rollbackFor = Exception.class)
178
+    @Override
179
+    public void updateIssue(TaIssue taIssue, TaIssue origin) throws Exception {
180
+        // 更新的时候只允许非业务流程字段
181
+        origin.setTitle(taIssue.getTitle());
182
+        origin.setTypeId(taIssue.getTypeId());
183
+        origin.setTypeName(taIssue.getTypeName());
184
+        origin.setLocId(taIssue.getLocId());
185
+        origin.setLocName(taIssue.getLocName());
186
+        origin.setLocation(taIssue.getLocation());
187
+        origin.setAddr(taIssue.getAddr());
188
+        origin.setContent(taIssue.getContent());
189
+        updateById(origin);
190
+
191
+        // 保存文件
192
+        List<TaAttach> attachList = taIssue.getAttachList();
193
+        List<Integer> idList = new ArrayList<>();
194
+        for (TaAttach item : attachList) {
195
+            item.setOwnerType(Constants.SOURCE_ISSUE);
196
+            item.setOwnerId(taIssue.getIssueId().toString());
197
+            item.setStatus(Constants.STATUS_NORMAL);
198
+            item.setCreateDate(LocalDateTime.now());
199
+
200
+            if (null == item.getAttachId()) {
201
+                taAttachMapper.insert(item);
202
+            } else {
203
+                taAttachMapper.updateById(item);
204
+            }
205
+            idList.add(item.getAttachId());
206
+        }
207
+
208
+        // 删除部分文件
209
+        taAttachMapper.deleteNotIn(idList, Constants.SOURCE_ISSUE, origin.getIssueId().toString());
210
+        origin.setAttachList(attachList);
211
+    }
212
+
213
+    @Transactional(rollbackFor = Exception.class)
214
+    @Override
215
+    public void reject(TaIssue taIssue, TaIssueProcess taIssueProcess, SysUser user) throws Exception {
216
+        // 问题单
217
+        if (Constants.SOURCE_FEEDBACK.equals(taIssue.getSourceType())) {
218
+            // 如果问题单是市民提的
219
+            taIssue.setProcessNode(Constants.PROCESS_END);
220
+            TaFeedback taFeedback = taFeedbackMapper.selectById(taIssue.getSourceTarget());
221
+            if (null == taFeedback) {
222
+                throw new Exception("未找到市民随手拍记录");
223
+            }
224
+
225
+            taFeedback.setVerifyStatus(Constants.APPLY_REJECT);
226
+            taFeedback.setVerifyDesc(taIssueProcess.getProcessResult());
227
+            taFeedback.setVerifyDate(LocalDateTime.now());
228
+            taFeedbackMapper.updateById(taFeedback);
229
+        } else {
230
+            taIssue.setProcessNode(Constants.PROCESS_START);
231
+        }
232
+        taIssue.setProcessStatus(Constants.APPLY_REJECT); // 驳回
233
+        taIssue.setUpdateUser(user.getUserId());
234
+        taIssue.setUpdateDate(LocalDateTime.now());
235
+        baseMapper.updateById(taIssue);
236
+
237
+        // 流程记录
238
+        taIssueProcess.setProcessId(null);
239
+        taIssueProcess.setProcessNode(taIssue.getProcessNode());
240
+        taIssueProcess.setProcessStatus(taIssue.getProcessStatus());
241
+        taIssueProcess.setCreateUser(user.getUserId());
242
+        taIssueProcess.setUserName(user.getName());
243
+        taIssueProcess.setCreateDate(LocalDateTime.now());
244
+        taIssueProcessMapper.insert(taIssueProcess);
245
+
246
+        // 发送消息
247
+        applicationEventPublisher.publishEvent(new MessagEvent(this, taIssue));
248
+    }
249
+
133
     Integer getStatValueBy(Object v, Integer def) {
250
     Integer getStatValueBy(Object v, Integer def) {
134
         if (null == v) return def;
251
         if (null == v) return def;
135
         return Integer.valueOf(v.toString());
252
         return Integer.valueOf(v.toString());

+ 15
- 15
src/main/java/com/example/civilizedcity/service/impl/TaMessageServiceImpl.java View File

31
         TaMessage taMessage = new TaMessage();
31
         TaMessage taMessage = new TaMessage();
32
 
32
 
33
         // 问题单驳回
33
         // 问题单驳回
34
-        if (Constants.PROCESS_START.equals(taIssue.getProcessNode()) && Constants.PROCESS_STATUS_REJECT.equals(taIssue.getProcessStatus())) {
34
+        if (Constants.APPLY_REJECT.equals(taIssue.getProcessStatus())) {
35
             taMessage.setMsgType("issue-reject");
35
             taMessage.setMsgType("issue-reject");
36
             taMessage.setTitle("问题单被驳回");
36
             taMessage.setTitle("问题单被驳回");
37
-            taMessage.setTargetType(Constants.MESSAGE_TARGET_ISSUE);
37
+            taMessage.setTargetType(Constants.SOURCE_ISSUE);
38
             taMessage.setTargetId(taIssue.getIssueId().toString());
38
             taMessage.setTargetId(taIssue.getIssueId().toString());
39
             taMessage.setStatus(Constants.STATUS_NORMAL);
39
             taMessage.setStatus(Constants.STATUS_NORMAL);
40
             taMessage.setCreateDate(LocalDateTime.now());
40
             taMessage.setCreateDate(LocalDateTime.now());
41
 
41
 
42
-            if (Constants.ISSUE_SOURCE_FEEDBACK.equals(taIssue.getSourceType())) {
42
+            if (Constants.SOURCE_FEEDBACK.equals(taIssue.getSourceType())) {
43
                 // 如果是市民上报
43
                 // 如果是市民上报
44
-                // TODO
44
+                // 不发消息
45
             }
45
             }
46
 
46
 
47
-            if (Constants.ISSUE_SOURCE_INSPECTOR.equals(taIssue.getSourceType())) {
47
+            if (Constants.SOURCE_INSPECTOR.equals(taIssue.getSourceType())) {
48
                 // 如果是督察员上报
48
                 // 如果是督察员上报
49
                 taMessage.setOrgId(Constants.ROOT_ORG);
49
                 taMessage.setOrgId(Constants.ROOT_ORG);
50
                 taMessage.setReceiveUser(taIssue.getCreateUser());
50
                 taMessage.setReceiveUser(taIssue.getCreateUser());
60
     public void sendMessage(TaIssueApply taIssueApply) {
60
     public void sendMessage(TaIssueApply taIssueApply) {
61
         boolean isApply = null == taIssueApply.getVerifyDate();
61
         boolean isApply = null == taIssueApply.getVerifyDate();
62
         TaMessage taMessage = new TaMessage();
62
         TaMessage taMessage = new TaMessage();
63
-        taMessage.setTargetType(Constants.MESSAGE_TARGET_APPLY);
63
+        taMessage.setTargetType(Constants.SOURCE_APPLY);
64
         taMessage.setTargetId(taIssueApply.getApplyId().toString());
64
         taMessage.setTargetId(taIssueApply.getApplyId().toString());
65
         taMessage.setStatus(Constants.STATUS_NORMAL);
65
         taMessage.setStatus(Constants.STATUS_NORMAL);
66
         taMessage.setCreateDate(LocalDateTime.now());
66
         taMessage.setCreateDate(LocalDateTime.now());
69
             taMessage.setMsgType("apply-" + taIssueApply.getApplyType());
69
             taMessage.setMsgType("apply-" + taIssueApply.getApplyType());
70
 
70
 
71
             switch (taIssueApply.getApplyType()) {
71
             switch (taIssueApply.getApplyType()) {
72
-                case Constants.APPLY_DELAY:
72
+                case Constants.PROCESS_APPLY_DELAY:
73
                     taMessage.setTitle("延期申请");
73
                     taMessage.setTitle("延期申请");
74
                     taMessage.setContent("延期至: " + taIssueApply.getContent());
74
                     taMessage.setContent("延期至: " + taIssueApply.getContent());
75
                     taMessage.setReceiveUser(null);
75
                     taMessage.setReceiveUser(null);
76
                     taMessage.setOrgId(Constants.ROOT_ORG);
76
                     taMessage.setOrgId(Constants.ROOT_ORG);
77
                     break;
77
                     break;
78
-                case Constants.APPLY_REJECT:
78
+                case Constants.PROCESS_APPLY_REJECT:
79
                     taMessage.setTitle("驳回申请");
79
                     taMessage.setTitle("驳回申请");
80
                     taMessage.setContent(null);
80
                     taMessage.setContent(null);
81
                     taMessage.setReceiveUser(null);
81
                     taMessage.setReceiveUser(null);
82
                     taMessage.setOrgId(Constants.ROOT_ORG);
82
                     taMessage.setOrgId(Constants.ROOT_ORG);
83
                     break;
83
                     break;
84
-                case Constants.APPLY_VERIFY:
84
+                case Constants.PROCESS_APPLY_VERIFY:
85
                     taMessage.setTitle("审核申请");
85
                     taMessage.setTitle("审核申请");
86
                     taMessage.setContent(null);
86
                     taMessage.setContent(null);
87
                     taMessage.setReceiveUser(null);
87
                     taMessage.setReceiveUser(null);
88
                     taMessage.setOrgId(taIssueApply.getOrgId());
88
                     taMessage.setOrgId(taIssueApply.getOrgId());
89
                     break;
89
                     break;
90
-                case Constants.APPLY_END:
90
+                case Constants.PROCESS_APPLY_END:
91
                     taMessage.setTitle("消单申请");
91
                     taMessage.setTitle("消单申请");
92
                     taMessage.setContent(null);
92
                     taMessage.setContent(null);
93
                     taMessage.setReceiveUser(null);
93
                     taMessage.setReceiveUser(null);
101
             }
101
             }
102
         } else {
102
         } else {
103
             taMessage.setMsgType("verify-" + taIssueApply.getApplyType());
103
             taMessage.setMsgType("verify-" + taIssueApply.getApplyType());
104
-            taMessage.setContent("审核结果: " + (Constants.APPLY_STATUS_PASS.equals(taIssueApply.getVerifyStatus()) ? "通过" : "不通过"));
104
+            taMessage.setContent("审核结果: " + (Constants.APPLY_PASS.equals(taIssueApply.getVerifyStatus()) ? "通过" : "不通过"));
105
             taMessage.setReceiveUser(null);
105
             taMessage.setReceiveUser(null);
106
             taMessage.setOrgId(taIssueApply.getOrgId());
106
             taMessage.setOrgId(taIssueApply.getOrgId());
107
 
107
 
108
             switch (taIssueApply.getApplyType()) {
108
             switch (taIssueApply.getApplyType()) {
109
-                case Constants.APPLY_DELAY:
109
+                case Constants.PROCESS_APPLY_DELAY:
110
                     taMessage.setTitle("延期审核");
110
                     taMessage.setTitle("延期审核");
111
                     break;
111
                     break;
112
-                case Constants.APPLY_REJECT:
112
+                case Constants.PROCESS_APPLY_REJECT:
113
                     taMessage.setTitle("驳回审核");
113
                     taMessage.setTitle("驳回审核");
114
                     break;
114
                     break;
115
-                case Constants.APPLY_VERIFY:
115
+                case Constants.PROCESS_APPLY_VERIFY:
116
                     taMessage.setTitle("问题单审核");
116
                     taMessage.setTitle("问题单审核");
117
                     break;
117
                     break;
118
-                case Constants.APPLY_END:
118
+                case Constants.PROCESS_APPLY_END:
119
                     taMessage.setTitle("办结审核");
119
                     taMessage.setTitle("办结审核");
120
                     break;
120
                     break;
121
                 default:
121
                 default:

+ 54
- 7
src/main/java/com/example/civilizedcity/service/impl/TaOrgIssueServiceImpl.java View File

3
 import com.baomidou.mybatisplus.core.metadata.IPage;
3
 import com.baomidou.mybatisplus.core.metadata.IPage;
4
 import com.example.civilizedcity.common.Constants;
4
 import com.example.civilizedcity.common.Constants;
5
 import com.example.civilizedcity.common.StringUtils;
5
 import com.example.civilizedcity.common.StringUtils;
6
-import com.example.civilizedcity.entity.SysUser;
7
-import com.example.civilizedcity.entity.TaIssue;
8
-import com.example.civilizedcity.entity.TaIssueProcess;
6
+import com.example.civilizedcity.entity.*;
7
+import com.example.civilizedcity.mapper.TaFeedbackMapper;
8
+import com.example.civilizedcity.mapper.TaIssueMapper;
9
+import com.example.civilizedcity.mapper.TaIssueProcessMapper;
10
+import org.springframework.beans.factory.annotation.Autowired;
9
 import org.springframework.stereotype.Service;
11
 import org.springframework.stereotype.Service;
10
-import com.example.civilizedcity.entity.TaOrgIssue;
11
 import com.example.civilizedcity.mapper.TaOrgIssueMapper;
12
 import com.example.civilizedcity.mapper.TaOrgIssueMapper;
12
 import com.example.civilizedcity.service.TaOrgIssueService;
13
 import com.example.civilizedcity.service.TaOrgIssueService;
14
+import org.springframework.transaction.annotation.Transactional;
13
 
15
 
14
 import java.time.LocalDateTime;
16
 import java.time.LocalDateTime;
15
 
17
 
22
 @Service
24
 @Service
23
 public class TaOrgIssueServiceImpl extends BaseServiceImpl<TaOrgIssueMapper, TaOrgIssue> implements TaOrgIssueService {
25
 public class TaOrgIssueServiceImpl extends BaseServiceImpl<TaOrgIssueMapper, TaOrgIssue> implements TaOrgIssueService {
24
 
26
 
27
+    @Autowired
28
+    TaIssueMapper taIssueMapper;
29
+
30
+    @Autowired
31
+    TaIssueProcessMapper taIssueProcessMapper;
32
+
33
+    @Autowired
34
+    TaFeedbackMapper taFeedbackMapper;
35
+
25
     @Override
36
     @Override
26
     public IPage<TaIssue> getIssuePageBy(IPage<TaIssue> pg, String orgId, String sourceType, String bizStatus) {
37
     public IPage<TaIssue> getIssuePageBy(IPage<TaIssue> pg, String orgId, String sourceType, String bizStatus) {
27
 
38
 
39
         return baseMapper.getIssuePageBy(pg, orgId, sourceType, processNode, isExpire);
50
         return baseMapper.getIssuePageBy(pg, orgId, sourceType, processNode, isExpire);
40
     }
51
     }
41
 
52
 
53
+    @Transactional(rollbackFor = Exception.class)
42
     @Override
54
     @Override
43
-    public void createNewIssue(TaIssue taIssue, SysUser sysUser) {
55
+    public void createNewIssue(TaIssue taIssue, TaIssueProcess taIssueProcess, SysUser sysUser) throws Exception {
56
+        if (Constants.SOURCE_FEEDBACK.equals(taIssue.getSourceType())) {
57
+            // 如果是市民提的问题单
58
+            TaFeedback taFeedback = taFeedbackMapper.selectById(taIssue.getSourceTarget());
59
+            if (null == taFeedback) {
60
+                throw new Exception("未找到市民随手拍记录");
61
+            }
62
+
63
+            taFeedback.setVerifyDate(LocalDateTime.now());
64
+            taFeedback.setVerifyStatus(Constants.APPLY_PASS);
65
+            taFeedbackMapper.updateById(taFeedback);
66
+        }
67
+
68
+        // 1. 先修改主记录信息
69
+        taIssue.setProcessNode(Constants.PROCESS_ASSIGNED);
70
+        taIssue.setProcessStatus(Constants.APPLY_PASS);
71
+        taIssue.setOrgId(taIssueProcess.getNextOrg());
72
+        taIssue.setExpireDate(taIssueProcess.getExpireDate());
73
+        taIssue.setProcessNum(taIssue.getProcessNum() + 1); // 交办次数
74
+        taIssueMapper.updateById(taIssue);
75
+
76
+        // 2. 新增机构问题单
44
         TaOrgIssue taOrgIssue = new TaOrgIssue();
77
         TaOrgIssue taOrgIssue = new TaOrgIssue();
45
         taOrgIssue.setIssueId(taIssue.getIssueId());
78
         taOrgIssue.setIssueId(taIssue.getIssueId());
46
         taOrgIssue.setOrgId(taIssue.getOrgId());
79
         taOrgIssue.setOrgId(taIssue.getOrgId());
47
-        taOrgIssue.setProcessStatus(Constants.PROCESS_START);
80
+        taOrgIssue.setProcessNode(Constants.PROCESS_START);
81
+        taOrgIssue.setProcessStatus(Constants.APPLY_READY); // 状态是未审核
48
         taOrgIssue.setStatus(Constants.STATUS_NORMAL);
82
         taOrgIssue.setStatus(Constants.STATUS_NORMAL);
49
         taOrgIssue.setCreateDate(LocalDateTime.now());
83
         taOrgIssue.setCreateDate(LocalDateTime.now());
50
         taOrgIssue.setCreateUser(sysUser.getUserId());
84
         taOrgIssue.setCreateUser(sysUser.getUserId());
51
-
52
         save(taOrgIssue);
85
         save(taOrgIssue);
86
+
87
+        // 3. 保存流程节点记录
88
+        taIssueProcess.setProcessId(null);
89
+        taIssueProcess.setProcessNode(Constants.PROCESS_ASSIGNED);
90
+        taIssueProcess.setProcessStatus(Constants.APPLY_PASS);
91
+        taIssueProcess.setCreateUser(sysUser.getUserId());
92
+        taIssueProcess.setCreateDate(LocalDateTime.now());
93
+        taIssueProcess.setStatus(Constants.STATUS_NORMAL);
94
+        taIssueProcessMapper.insert(taIssueProcess);
95
+    }
96
+
97
+    @Override
98
+    public TaOrgIssue getByIssueAndOrg(Integer issueId, String orgId) {
99
+        return baseMapper.getByIssueAndOrg(issueId, orgId);
53
     }
100
     }
54
 }
101
 }

+ 13
- 0
src/main/resources/mapper/TaAttachMapper.xml View File

2
 <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
2
 <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
3
 
3
 
4
 <mapper namespace="com.example.civilizedcity.mapper.TaAttachMapper">
4
 <mapper namespace="com.example.civilizedcity.mapper.TaAttachMapper">
5
+    <delete id="deleteNotIn">
6
+        DELETE
7
+            t
8
+        FROM
9
+            ta_attach
10
+        WHERE
11
+            t.owner_type = #{ownerType}
12
+          AND t.owner_id = #{ownerId}
13
+          AND t.id NOT IN
14
+        <foreach item="item" collection="idList" separator="," open="(" close=")" index="">
15
+            #{item}
16
+        </foreach>
17
+    </delete>
5
 
18
 
6
     <select id="getListBy" resultType="com.example.civilizedcity.entity.TaAttach">
19
     <select id="getListBy" resultType="com.example.civilizedcity.entity.TaAttach">
7
         SELECT
20
         SELECT

+ 9
- 9
src/main/resources/mapper/TaFeedbackMapper.xml View File

15
     </select>
15
     </select>
16
     <select id="statMaIndex" resultType="java.util.Map">
16
     <select id="statMaIndex" resultType="java.util.Map">
17
         SELECT
17
         SELECT
18
-            sum(IF(s.process_node = 'start', 1, 0)) as unassigned_num,
19
-            sum(IF(s.process_node = 'assigned', 1, 0)) as assigned_num,
20
-            sum(IF(s.process_node = 'end', 1, 0)) as end_num,
21
-            sum(IF(t.verify_status = 'reject', 1, 0)) as reject_num
18
+            sum(IF(s.process_node = '01', 1, 0)) as unassigned_num,
19
+            sum(IF(s.process_node LIKE '02%', 1, 0)) as assigned_num,
20
+            sum(IF(s.process_node = '03', 1, 0)) as end_num,
21
+            sum(IF(t.verify_status = 'reject' AND s.process_node = '03', 1, 0)) as reject_num
22
         FROM
22
         FROM
23
             ta_feedback t
23
             ta_feedback t
24
                 JOIN ta_issue s ON t.issue_id = s.issue_id
24
                 JOIN ta_issue s ON t.issue_id = s.issue_id
38
               AND t.person_id = #{personId}
38
               AND t.person_id = #{personId}
39
           </if>
39
           </if>
40
           <if test="processList != null">
40
           <if test="processList != null">
41
-              AND s.process_node IN
42
-              <foreach item="item" collection="processList" separator="," open="(" close=")">
43
-                  #{item}
41
+              AND
42
+              <foreach item="item" collection="processList" separator=" OR " open="(" close=")">
43
+                  s.process_node LIKE CONCAT(#{item}, '%')
44
               </foreach>
44
               </foreach>
45
           </if>
45
           </if>
46
-        <if test="null != verifyStatus and verifyStatus != ''">
47
-          AND t.verify_status = #{verifyStatus}
46
+        <if test="null != processStatus and processStatus != ''">
47
+          AND s.process_status = #{processStatus}
48
         </if>
48
         </if>
49
           AND t.`status` &gt; -1
49
           AND t.`status` &gt; -1
50
           AND s.`status` &gt; -1
50
           AND s.`status` &gt; -1

+ 6
- 6
src/main/resources/mapper/TaIssueMapper.xml View File

57
     <select id="statMaIndex" resultType="java.util.Map">
57
     <select id="statMaIndex" resultType="java.util.Map">
58
         SELECT
58
         SELECT
59
             count(*) as published_num,
59
             count(*) as published_num,
60
-            sum(IF(t.process_node = 'start', 1, 0)) as unassigned_num,
61
-            sum(IF(t.process_node = 'assigned', 1, 0)) as assigned_num,
62
-            sum(IF(t.process_node = 'end', 1, 0)) as end_num
60
+            sum(IF(t.process_node = '01', 1, 0)) as unassigned_num,
61
+            sum(IF(t.process_node LIKE '02%', 1, 0)) as assigned_num,
62
+            sum(IF(t.process_node = '03', 1, 0)) as end_num
63
         FROM
63
         FROM
64
             ta_issue t
64
             ta_issue t
65
         WHERE 1 = 1
65
         WHERE 1 = 1
71
     <select id="statIssueOrg" resultType="java.util.Map">
71
     <select id="statIssueOrg" resultType="java.util.Map">
72
         SELECT
72
         SELECT
73
             UUID_SHORT( ) AS id,
73
             UUID_SHORT( ) AS id,
74
-            IFNULL( SUM( IF ( t.process_node = 'end', t.process_num, 0 ) ), 0 ) AS endNum,
75
-            IFNULL( SUM( IF ( t.process_node = 'assigned', t.process_num, 0 ) ), 0 ) AS assignedNum,
76
-            IFNULL( SUM( IF ( t.expire_date &lt;= NOW( ), t.process_num, 0 ) ), 0 ) AS expireNum
74
+            IFNULL( SUM( IF ( t.process_node = '03', t.process_num, 0 ) ), 0 ) AS endNum,
75
+            IFNULL( SUM( IF ( t.process_node LIKE '02%', t.process_num, 0 ) ), 0 ) AS assignedNum,
76
+            IFNULL( SUM( IF ( t.expire_date &lt;= NOW( ) AND t.process_node != '03', t.process_num, 0 ) ), 0 ) AS expireNum
77
         FROM
77
         FROM
78
             ta_issue t
78
             ta_issue t
79
         WHERE
79
         WHERE

+ 4
- 4
src/main/resources/mapper/TaOrgIssueMapper.xml View File

33
               AND t.source_type in ('check', 'inspector')
33
               AND t.source_type in ('check', 'inspector')
34
           </if>
34
           </if>
35
           <if test="processNode != null and processNode != ''">
35
           <if test="processNode != null and processNode != ''">
36
-            AND t.process_node = #{processNode}
36
+            AND t.process_node LIKE CONCAT(#{processNode}, '%')
37
           </if>
37
           </if>
38
           <if test="isExpire != null and isExpire">
38
           <if test="isExpire != null and isExpire">
39
-            AND t.process_node != 'end'
39
+            AND t.process_node != '03'
40
             AND t.expire_date &lt;= now( )
40
             AND t.expire_date &lt;= now( )
41
           </if>
41
           </if>
42
             AND t.`status` &gt; -1
42
             AND t.`status` &gt; -1
56
     <select id="statMaIndex" resultType="java.util.Map">
56
     <select id="statMaIndex" resultType="java.util.Map">
57
         select
57
         select
58
             SUM(IF(TO_DAYS(now()) > TO_DAYS(s.expire_date), 1, 0)) as delay_num,
58
             SUM(IF(TO_DAYS(now()) > TO_DAYS(s.expire_date), 1, 0)) as delay_num,
59
-            SUM(s.process_node == 'end', 1, 0) as end_num,
60
-            SUM(s.process_node != 'end', 1, 0) as doing_num
59
+            SUM(s.process_node = '03', 1, 0) as end_num,
60
+            SUM(s.process_node != '03', 1, 0) as doing_num
61
         from ta_org_issue t
61
         from ta_org_issue t
62
                  INNER JOIN ta_issue s on t.issue_id = s.issue_id AND t.org_id = s.org_id
62
                  INNER JOIN ta_issue s on t.issue_id = s.issue_id AND t.org_id = s.org_id
63
         where t.org_id = #{orgId}
63
         where t.org_id = #{orgId}