Yansen před 2 roky
rodič
revize
1c256df219
28 změnil soubory, kde provedl 1194 přidání a 724 odebrání
  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 Zobrazit soubor

@@ -4,7 +4,7 @@
4 4
   "avatar": "",
5 5
   "version": "4.1.4",
6 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 8
   "dbConns": [],
9 9
   "profile": {
10 10
     "default": {
@@ -8636,9 +8636,32 @@
8636 8636
       "id": "78C3BB38-9B37-445B-A311-168B4682FE5E",
8637 8637
       "env": {
8638 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 8666
       "defKey": "ts_stat_data",
8644 8667
       "defName": "常用统计",
@@ -8757,7 +8780,7 @@
8757 8780
           "primaryKey": false,
8758 8781
           "notNull": false,
8759 8782
           "autoIncrement": false,
8760
-          "defaultValue": "1",
8783
+          "defaultValue": "",
8761 8784
           "hideInGraph": true,
8762 8785
           "refDict": "",
8763 8786
           "uiHint": "",
@@ -8774,7 +8797,7 @@
8774 8797
           "primaryKey": false,
8775 8798
           "notNull": false,
8776 8799
           "autoIncrement": false,
8777
-          "defaultValue": "",
8800
+          "defaultValue": "0",
8778 8801
           "hideInGraph": true,
8779 8802
           "refDict": "",
8780 8803
           "uiHint": "",

db/.back_文明创办/文明创办-backup-202318151439.pdma.json → db/.back_文明创办/文明创办-backup-202323151753.pdma.json Zobrazit soubor

@@ -4,7 +4,7 @@
4 4
   "avatar": "",
5 5
   "version": "4.1.4",
6 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 8
   "dbConns": [],
9 9
   "profile": {
10 10
     "default": {
@@ -1204,6 +1204,23 @@
1204 1204
           "uiHint": "",
1205 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 1225
           "defKey": "create_user",
1209 1226
           "defName": "创建人",
@@ -3193,7 +3210,7 @@
3193 3210
           "id": "CC5551B8-C645-4192-9A06-E5820C6F3357"
3194 3211
         },
3195 3212
         {
3196
-          "defKey": "conent",
3213
+          "defKey": "content",
3197 3214
           "defName": "正文",
3198 3215
           "comment": "",
3199 3216
           "type": "TEXT",
@@ -5639,7 +5656,7 @@
5639 5656
       "env": {
5640 5657
         "base": {
5641 5658
           "nameSpace": "com.example.civilizedcity",
5642
-          "codeRoot": "TdQuestion"
5659
+          "codeRoot": "TdLocQuestion"
5643 5660
         },
5644 5661
         "template": {
5645 5662
           "JavaMybatisPlus": {
@@ -6291,6 +6308,23 @@
6291 6308
           "domain": "",
6292 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 6329
           "defKey": "stand",
6296 6330
           "defName": "评分标准",
@@ -6904,9 +6938,32 @@
6904 6938
       "id": "EF3D4E17-6CE0-4944-B1DC-40280B2B689F",
6905 6939
       "env": {
6906 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 6968
       "defKey": "ta_feedback",
6912 6969
       "defName": "反馈表",
@@ -6989,7 +7046,7 @@
6989 7046
           "scale": "",
6990 7047
           "primaryKey": true,
6991 7048
           "notNull": true,
6992
-          "autoIncrement": true,
7049
+          "autoIncrement": false,
6993 7050
           "defaultValue": "",
6994 7051
           "hideInGraph": true,
6995 7052
           "domain": "16120F75-6AA7-4483-868D-F07F511BB081",
@@ -7031,6 +7088,39 @@
7031 7088
           "domain": "",
7032 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 7125
           "defKey": "person_id",
7036 7126
           "defName": "反馈人ID",
@@ -7085,18 +7175,18 @@
7085 7175
         {
7086 7176
           "defKey": "verify_status",
7087 7177
           "defName": "审核状态",
7088
-          "comment": "0未审,1通过,2驳回",
7178
+          "comment": "null未审,pass通过,reject驳回",
7089 7179
           "type": "",
7090 7180
           "len": "",
7091 7181
           "scale": "",
7092 7182
           "primaryKey": false,
7093 7183
           "notNull": false,
7094 7184
           "autoIncrement": false,
7095
-          "defaultValue": "0",
7185
+          "defaultValue": "",
7096 7186
           "hideInGraph": false,
7097 7187
           "refDict": "",
7098 7188
           "extProps": {},
7099
-          "domain": "6BC8F04B-6CFA-4995-98D3-318F5CDD774E",
7189
+          "domain": "73FD2BAD-2358-4336-B96D-45DC897BD792",
7100 7190
           "id": "90567F1C-10F8-4BB2-9F32-B92B7077091B"
7101 7191
         },
7102 7192
         {
@@ -7116,6 +7206,23 @@
7116 7206
           "domain": "9092C4E0-1A54-4859-ABBB-5B62DBC27573",
7117 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 7227
           "defKey": "issue_id",
7121 7228
           "defName": "关联问题单",
@@ -7375,6 +7482,23 @@
7375 7482
           "domain": "",
7376 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 7503
           "defKey": "sort_no",
7380 7504
           "defName": "排序",
@@ -7943,6 +8067,23 @@
7943 8067
           "id": "649F17F6-D2C1-4AAD-B913-ED39F26E4AF4",
7944 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 8088
           "defKey": "process_status",
7948 8089
           "defName": "业务单状态",
@@ -8332,6 +8473,373 @@
8332 8473
       ],
8333 8474
       "correlations": [],
8334 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 8845
   "views": [],
@@ -8760,12 +9268,24 @@
8760 9268
         "B20E272F-91EB-4BAC-AAD6-AF99D517E44D",
8761 9269
         "EF3D4E17-6CE0-4944-B1DC-40280B2B689F",
8762 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 9274
       "refViews": [],
8766 9275
       "refDiagrams": [],
8767 9276
       "refDicts": [],
8768 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 9291
   "dataTypeMapping": {

+ 78
- 4
db/文明创办.pdma.json Zobrazit soubor

@@ -4,7 +4,7 @@
4 4
   "avatar": "",
5 5
   "version": "4.1.4",
6 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 8
   "dbConns": [],
9 9
   "profile": {
10 10
     "default": {
@@ -3640,6 +3640,23 @@
3640 3640
           "notes": {},
3641 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 3661
           "defKey": "org_id",
3645 3662
           "defName": "责任单位",
@@ -7206,6 +7223,23 @@
7206 7223
           "domain": "9092C4E0-1A54-4859-ABBB-5B62DBC27573",
7207 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 7244
           "defKey": "issue_id",
7211 7245
           "defName": "关联问题单",
@@ -8050,6 +8084,23 @@
8050 8084
           "id": "649F17F6-D2C1-4AAD-B913-ED39F26E4AF4",
8051 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 8105
           "defKey": "process_status",
8055 8106
           "defName": "业务单状态",
@@ -8636,9 +8687,32 @@
8636 8687
       "id": "78C3BB38-9B37-445B-A311-168B4682FE5E",
8637 8688
       "env": {
8638 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 8717
       "defKey": "ts_stat_data",
8644 8718
       "defName": "常用统计",

+ 51
- 60
src/main/java/com/example/civilizedcity/common/Constants.java Zobrazit soubor

@@ -8,7 +8,9 @@ public class Constants {
8 8
     public final static int STATUS_READY = 0;
9 9
     public final static int STATUS_NORMAL = 1;
10 10
 
11
-    // 操作员身份
11
+    /**
12
+     * 人员身份
13
+     */
12 14
     // 督察员
13 15
     public final static String DUTY_INSPECTOR = "inspector";
14 16
     // 管理员
@@ -22,77 +24,66 @@ public class Constants {
22 24
     // 市民
23 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 Zobrazit soubor

@@ -66,7 +66,7 @@ public class TaCheckAnswerItemController extends BaseController {
66 66
 
67 67
         if (null != result && result.size() > 0) {
68 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 70
                 item.setAttachList(attachList);
71 71
             }
72 72
         }

+ 1
- 1
src/main/java/com/example/civilizedcity/controller/TaFeedbackController.java Zobrazit soubor

@@ -47,7 +47,7 @@ public class TaFeedbackController extends BaseController {
47 47
     @GetMapping("/taFeedback/{id}")
48 48
     public ResponseBean queryById(@ApiParam("对象ID") @PathVariable String id) throws Exception {
49 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 51
         taFeedback.setAttachList(attachList);
52 52
         return ResponseBean.success(taFeedback);
53 53
     }

+ 28
- 50
src/main/java/com/example/civilizedcity/controller/TaIssueApplyController.java Zobrazit soubor

@@ -7,14 +7,10 @@ import com.example.civilizedcity.common.BaseController;
7 7
 import com.example.civilizedcity.common.Constants;
8 8
 import com.example.civilizedcity.common.ResponseBean;
9 9
 
10
-import java.time.LocalDateTime;
11
-import java.util.List;
12
-
13 10
 import com.example.civilizedcity.common.StringUtils;
14 11
 import com.example.civilizedcity.entity.SysUser;
15
-import com.example.civilizedcity.event.MessagEvent;
16
-import com.example.civilizedcity.service.SysUserDutyService;
17 12
 import com.example.civilizedcity.service.TaIssueService;
13
+import com.example.civilizedcity.service.TaOrgIssueService;
18 14
 import io.swagger.annotations.Api;
19 15
 import io.swagger.annotations.ApiOperation;
20 16
 import io.swagger.annotations.ApiParam;
@@ -42,7 +38,7 @@ public class TaIssueApplyController extends BaseController {
42 38
     private TaIssueService taIssueService;
43 39
 
44 40
     @Autowired
45
-    private SysUserDutyService sysUserDutyService;
41
+    private TaOrgIssueService taOrgIssueService;
46 42
 
47 43
     @Autowired
48 44
     ApplicationEventPublisher applicationEventPublisher;
@@ -50,7 +46,7 @@ public class TaIssueApplyController extends BaseController {
50 46
     /**
51 47
      * 通过ID查询单条数据
52 48
      *
53
-     * @param applyId 主键
49
+     * @param id 主键
54 50
      * @return 实例对象
55 51
      */
56 52
     @ApiOperation("通过ID查询单条数据")
@@ -61,7 +57,8 @@ public class TaIssueApplyController extends BaseController {
61 57
     /**
62 58
      * 通过ISSUE_ID查询单条数据
63 59
      *
64
-     * @param applyId 主键
60
+     * @param issueId 问题单ID
61
+     * @param applyType 申请类型
65 62
      * @return 实例对象
66 63
      */
67 64
     @ApiOperation("通过ISSUE_ID查询单条数据")
@@ -120,7 +117,16 @@ public class TaIssueApplyController extends BaseController {
120 117
     @ApiOperation("申请流程")
121 118
     @PostMapping("/taIssueApply")
122 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 130
         return ResponseBean.success(taIssueApply);
125 131
     }
126 132
 
@@ -141,7 +147,7 @@ public class TaIssueApplyController extends BaseController {
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 151
             return ResponseBean.error("请填写驳回理由");
146 152
         }
147 153
 
@@ -149,47 +155,19 @@ public class TaIssueApplyController extends BaseController {
149 155
         taIssueApply.setApplyId(id);
150 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 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 Zobrazit soubor

@@ -2,6 +2,7 @@ package com.example.civilizedcity.controller;
2 2
 
3 3
 import cn.dev33.satoken.annotation.SaCheckPermission;
4 4
 import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
5
+import com.baomidou.mybatisplus.core.enums.SqlLike;
5 6
 import com.baomidou.mybatisplus.core.metadata.IPage;
6 7
 import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
7 8
 import com.example.civilizedcity.common.*;
@@ -51,7 +52,7 @@ public class TaIssueController extends BaseController {
51 52
     /**
52 53
      * 通过ID查询单条数据
53 54
      *
54
-     * @param issueId 主键
55
+     * @param id 主键
55 56
      * @return 实例对象
56 57
      */
57 58
     @ApiOperation("通过ID查询单条数据")
@@ -59,7 +60,7 @@ public class TaIssueController extends BaseController {
59 60
     public ResponseBean queryById(@ApiParam("对象ID") @PathVariable Integer id) throws Exception {
60 61
 
61 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 64
         taIssue.setAttachList(attachList);
64 65
 
65 66
         return ResponseBean.success(taIssue);
@@ -89,28 +90,15 @@ public class TaIssueController extends BaseController {
89 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 93
         IPage<TaIssue> pg = new Page<>(pageNum, pageSize);
106 94
         QueryWrapper<TaIssue> queryWrapper = new QueryWrapper<>();
107 95
 
108 96
         if (Constants.PROCESS_START.equals(bizStatus)) {
109 97
             // 待交办
110
-            queryWrapper.eq("process_node", bizStatus);
98
+            queryWrapper.likeRight("process_node", bizStatus);
111 99
         } else if (Constants.PROCESS_ASSIGNED.equals(bizStatus)) {
112 100
             // 已交办
113
-            queryWrapper.eq("process_node", bizStatus);
101
+            queryWrapper.likeRight("process_node", bizStatus);
114 102
         } else if (Constants.PROCESS_END.equals(bizStatus)) {
115 103
             // 已办结
116 104
             queryWrapper.eq("process_node", bizStatus);
@@ -120,8 +108,8 @@ public class TaIssueController extends BaseController {
120 108
             queryWrapper.le("expire_date", DateUtils.today());
121 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,8 +120,8 @@ public class TaIssueController extends BaseController {
132 120
 
133 121
         queryWrapper.eq(StringUtils.isNotEmpty(locId), "loc_id", locId);
134 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 125
         queryWrapper.gt("status", Constants.STATUS_DELETE);
138 126
         queryWrapper.orderByDesc("create_date");
139 127
         IPage<TaIssue> result = taIssueService.page(pg, queryWrapper);
@@ -150,46 +138,14 @@ public class TaIssueController extends BaseController {
150 138
     @ApiOperation("新增数据")
151 139
     @PostMapping("/taIssue")
152 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 149
         return ResponseBean.success(taIssue);
194 150
     }
195 151
 
@@ -214,40 +170,14 @@ public class TaIssueController extends BaseController {
214 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 181
      * @return 是否成功
252 182
      */
253 183
     @SaCheckPermission("manager")

+ 8
- 328
src/main/java/com/example/civilizedcity/controller/TaIssueProcessController.java Zobrazit soubor

@@ -6,19 +6,14 @@ import com.baomidou.mybatisplus.core.metadata.IPage;
6 6
 import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
7 7
 import com.example.civilizedcity.common.*;
8 8
 
9
-import java.time.LocalDateTime;
10
-import java.util.List;
11
-
12 9
 import com.example.civilizedcity.entity.SysUser;
13 10
 import com.example.civilizedcity.entity.TaIssue;
14
-import com.example.civilizedcity.event.MessagEvent;
15 11
 import com.example.civilizedcity.service.TaIssueService;
16 12
 import com.example.civilizedcity.service.TaOrgIssueService;
17 13
 import io.swagger.annotations.Api;
18 14
 import io.swagger.annotations.ApiOperation;
19 15
 import io.swagger.annotations.ApiParam;
20 16
 import org.springframework.beans.factory.annotation.Autowired;
21
-import org.springframework.context.ApplicationEventPublisher;
22 17
 import org.springframework.web.bind.annotation.*;
23 18
 import com.example.civilizedcity.entity.TaIssueProcess;
24 19
 import com.example.civilizedcity.service.TaIssueProcessService;
@@ -43,13 +38,10 @@ public class TaIssueProcessController extends BaseController {
43 38
     @Autowired
44 39
     private TaOrgIssueService taOrgIssueService;
45 40
 
46
-    @Autowired
47
-    ApplicationEventPublisher applicationEventPublisher;
48
-
49 41
     /**
50 42
      * 通过ID查询单条数据
51 43
      *
52
-     * @param processId 主键
44
+     * @param id 主键
53 45
      * @return 实例对象
54 46
      */
55 47
     @ApiOperation("通过ID查询单条数据")
@@ -98,52 +90,6 @@ public class TaIssueProcessController extends BaseController {
98 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,10 +102,8 @@ public class TaIssueProcessController extends BaseController {
156 102
     public ResponseBean assigned(@ApiParam("对象实体") @RequestBody TaIssueProcess taIssueProcess) throws Exception {
157 103
         TaIssue taIssue = checkIssue(taIssueProcess);
158 104
 
159
-        if (StringUtils.isEmpty(taIssueProcess.getOrgId())) {
105
+        if (StringUtils.isEmpty(taIssueProcess.getNextOrg())) {
160 106
             return ResponseBean.error("请指定交办单位");
161
-        } else {
162
-            taIssue.setOrgId(taIssueProcess.getOrgId());
163 107
         }
164 108
         if (StringUtils.isEmpty(taIssueProcess.getExpireDate())) {
165 109
             return ResponseBean.error("请设置截止日期");
@@ -167,32 +111,21 @@ public class TaIssueProcessController extends BaseController {
167 111
             if (DateUtils.isAfter(taIssueProcess.getExpireDate() + " 23:59:59")) {
168 112
                 return ResponseBean.error("请设置有效的截止日期");
169 113
             }
170
-
171
-            taIssue.setExpireDate(taIssueProcess.getExpireDate());
172 114
         }
173 115
 
174 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 118
         return ResponseBean.success(taIssueProcess);
186 119
     }
187 120
 
188 121
     /**
189
-     * 驳回
122
+     * 管理员驳回问题单
190 123
      *
191 124
      * @param taIssueProcess 实例对象
192 125
      * @return 实例对象
193 126
      */
194
-    @SaCheckPermission("org_user")
195
-    @ApiOperation("驳回")
127
+    @SaCheckPermission("manager")
128
+    @ApiOperation("管理员驳回问题单")
196 129
     @PostMapping("/taIssueProcess/reject")
197 130
     public ResponseBean reject(@ApiParam("对象实体") @RequestBody TaIssueProcess taIssueProcess) throws Exception {
198 131
         TaIssue taIssue = checkIssue(taIssueProcess);
@@ -201,261 +134,8 @@ public class TaIssueProcessController extends BaseController {
201 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 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 Zobrazit soubor

@@ -39,7 +39,7 @@ public class TaOrgIssueController extends BaseController {
39 39
     /** 
40 40
      * 通过ID查询单条数据 
41 41
      *
42
-     * @param orgIssueId 主键
42
+     * @param id 主键
43 43
      * @return 实例对象
44 44
      */
45 45
     @ApiOperation("通过ID查询单条数据")
@@ -63,7 +63,7 @@ public class TaOrgIssueController extends BaseController {
63 63
 
64 64
          TaOrgIssue taOrgIssue = taOrgIssueService.getOne(queryWrapper);
65 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 67
              taOrgIssue.setAttachList(attachList);
68 68
          }
69 69
 
@@ -91,43 +91,45 @@ public class TaOrgIssueController extends BaseController {
91 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 Zobrazit soubor

@@ -56,6 +56,9 @@ public class TaFeedback implements Serializable,Cloneable{
56 56
     /** 审核意见 */
57 57
     @ApiModelProperty(name = "审核意见",notes = "")
58 58
     private String verifyDesc ;
59
+     /** 审核日期 */
60
+     @ApiModelProperty(name = "审核日期",notes = "")
61
+     private LocalDateTime verifyDate ;
59 62
     /** 关联问题单 */
60 63
     @ApiModelProperty(name = "关联问题单",notes = "")
61 64
     private String issueId ;

+ 3
- 0
src/main/java/com/example/civilizedcity/entity/TaIssue.java Zobrazit soubor

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

+ 3
- 0
src/main/java/com/example/civilizedcity/entity/TaOrgIssue.java Zobrazit soubor

@@ -35,6 +35,9 @@ public class TaOrgIssue implements Serializable,Cloneable{
35 35
     /** 机构ID */
36 36
     @ApiModelProperty(name = "机构ID",notes = "")
37 37
     private String orgId ;
38
+     /** 流程节点 */
39
+     @ApiModelProperty(name = "流程节点",notes = "")
40
+     private String processNode ;
38 41
     /** 业务单状态 */
39 42
     @ApiModelProperty(name = "业务单状态",notes = "")
40 43
     private String processStatus ;

+ 5
- 1
src/main/java/com/example/civilizedcity/mapper/TaAttachMapper.java Zobrazit soubor

@@ -16,4 +16,8 @@ import java.util.List;
16 16
 public interface TaAttachMapper  extends BaseMapper<TaAttach>{
17 17
 
18 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 Zobrazit soubor

@@ -27,5 +27,5 @@ public interface TaFeedbackMapper extends BaseMapper<TaFeedback> {
27 27
     IPage<TaIssue> getPageBy(IPage<TaIssue> pg,
28 28
                              @Param("personId") String personId,
29 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 Zobrazit soubor

@@ -3,6 +3,7 @@ package com.example.civilizedcity.service;
3 3
 import com.baomidou.mybatisplus.core.metadata.IPage;
4 4
 import com.example.civilizedcity.entity.SysUser;
5 5
 import com.example.civilizedcity.entity.TaIssue;
6
+import com.example.civilizedcity.entity.TaIssueProcess;
6 7
 import com.example.civilizedcity.entity.TaPerson;
7 8
 import com.example.civilizedcity.vo.StatVo;
8 9
 
@@ -24,4 +25,10 @@ public interface TaIssueService extends IBaseService<TaIssue> {
24 25
      List<StatVo> statMaIndex(SysUser user, TaPerson person, String duty);
25 26
 
26 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 Zobrazit soubor

@@ -15,5 +15,7 @@ public interface TaOrgIssueService extends IBaseService<TaOrgIssue> {
15 15
 
16 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 Zobrazit soubor

@@ -25,12 +25,6 @@ public class TaAttachServiceImpl extends BaseServiceImpl<TaAttachMapper, TaAttac
25 25
 
26 26
     @Override
27 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 Zobrazit soubor

@@ -174,7 +174,7 @@ public class TaCheckItemServiceImpl extends BaseServiceImpl<TaCheckItemMapper, T
174 174
             // 保存附件
175 175
             if (null != item.getAttachList()) {
176 176
                 for (TaAttach taAttach : item.getAttachList()) {
177
-                    taAttach.setOwnerType(Constants.ATTACH_SOURCE_CHECK_ANSWER);
177
+                    taAttach.setOwnerType(Constants.SOURCE_CHECK_ANSWER);
178 178
                     taAttach.setOwnerId(item.getItemId());
179 179
                     taAttach.setStatus(Constants.STATUS_NORMAL);
180 180
                     taAttach.setCreateUser(taCheckAnswer.getCreateUser());

+ 28
- 18
src/main/java/com/example/civilizedcity/service/impl/TaFeedbackServiceImpl.java Zobrazit soubor

@@ -3,16 +3,10 @@ package com.example.civilizedcity.service.impl;
3 3
 import com.baomidou.mybatisplus.core.metadata.IPage;
4 4
 import com.example.civilizedcity.common.Constants;
5 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 8
 import org.springframework.beans.factory.annotation.Autowired;
13 9
 import org.springframework.stereotype.Service;
14
-import com.example.civilizedcity.entity.TaFeedback;
15
-import com.example.civilizedcity.mapper.TaFeedbackMapper;
16 10
 import com.example.civilizedcity.service.TaFeedbackService;
17 11
 import org.springframework.transaction.annotation.Transactional;
18 12
 
@@ -38,6 +32,9 @@ public class TaFeedbackServiceImpl extends BaseServiceImpl<TaFeedbackMapper, TaF
38 32
     @Autowired
39 33
     TaAttachMapper taAttachMapper;
40 34
 
35
+    @Autowired
36
+    TaIssueProcessMapper taIssueProcessMapper;
37
+
41 38
     @Transactional(rollbackFor = Exception.class)
42 39
     @Override
43 40
     public void createNew(TaFeedback taFeedback, TaPerson taPerson) throws Exception {
@@ -71,20 +68,21 @@ public class TaFeedbackServiceImpl extends BaseServiceImpl<TaFeedbackMapper, TaF
71 68
 
72 69
         taIssue.setOrgId(null); // 暂时没有责任单位
73 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 74
         taIssue.setStatus(Constants.STATUS_NORMAL);
78 75
         taIssue.setCreateUser(taFeedback.getPersonId());
79
-        taIssue.setUserName(taFeedback.getName());
76
+        taIssue.setUserName(StringUtils.isEmpty(taFeedback.getName()) ? "市民" : taFeedback.getName());
80 77
         taIssue.setCreateDate(LocalDateTime.now());
81 78
         taIssueMapper.insert(taIssue);
79
+
82 80
         // 保存文件
83 81
         List<TaAttach> attachList = taFeedback.getAttachList();
84 82
         if (null != attachList && attachList.size() > 0) {
85 83
             for (TaAttach item : attachList) {
86 84
                 item.setAttachId(null);
87
-                item.setOwnerType(Constants.ATTACH_SOURCE_ISSUE);
85
+                item.setOwnerType(Constants.SOURCE_ISSUE);
88 86
                 item.setOwnerId(taIssue.getIssueId().toString());
89 87
                 item.setStatus(Constants.STATUS_NORMAL);
90 88
                 item.setCreateDate(LocalDateTime.now());
@@ -98,19 +96,30 @@ public class TaFeedbackServiceImpl extends BaseServiceImpl<TaFeedbackMapper, TaF
98 96
         if (null != attachList && attachList.size() > 0) {
99 97
             for (TaAttach item : attachList) {
100 98
                 item.setAttachId(null);
101
-                item.setOwnerType(Constants.ATTACH_SOURCE_FEEDBACK);
99
+                item.setOwnerType(Constants.SOURCE_FEEDBACK);
102 100
                 item.setOwnerId(taFeedback.getFeedbackId());
103 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 118
     @Override
110 119
     public IPage<TaIssue> getPageBy(IPage<TaIssue> pg, String personId, String bizStatus) {
111 120
 
112 121
         List<String> processList = new ArrayList<>();
113
-        String verifyStatus = null;
122
+        String processStatus = null;
114 123
 
115 124
         // 未处理
116 125
         if (Constants.PROCESS_START.equals(bizStatus)) {
@@ -124,10 +133,11 @@ public class TaFeedbackServiceImpl extends BaseServiceImpl<TaFeedbackMapper, TaF
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 Zobrazit soubor

@@ -4,17 +4,12 @@ import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
4 4
 import com.baomidou.mybatisplus.core.metadata.IPage;
5 5
 import com.example.civilizedcity.common.Constants;
6 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 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 10
 import org.springframework.beans.factory.annotation.Autowired;
14 11
 import org.springframework.context.ApplicationEventPublisher;
15 12
 import org.springframework.stereotype.Service;
16
-import com.example.civilizedcity.entity.TaIssueApply;
17
-import com.example.civilizedcity.mapper.TaIssueApplyMapper;
18 13
 import com.example.civilizedcity.service.TaIssueApplyService;
19 14
 import org.springframework.transaction.annotation.Transactional;
20 15
 
@@ -35,40 +30,50 @@ public class TaIssueApplyServiceImpl extends BaseServiceImpl<TaIssueApplyMapper,
35 30
     @Autowired
36 31
     TaOrgIssueMapper taOrgIssueMapper;
37 32
 
33
+    @Autowired
34
+    TaIssueProcessMapper taIssueProcessMapper;
35
+
36
+    @Autowired
37
+    TaFeedbackMapper taFeedbackMapper;
38
+
38 39
     @Autowired
39 40
     ApplicationEventPublisher applicationEventPublisher;
40 41
 
42
+    @Transactional(rollbackFor = Exception.class)
41 43
     @Override
42 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 46
         taIssueApply.setApplyId(null);
59 47
         taIssueApply.setCreateUser(sysUser.getUserId());
60 48
         taIssueApply.setCreateUserName(sysUser.getName());
61 49
         taIssueApply.setOrgId(sysUser.getOrgId());
62 50
         taIssueApply.setCreateDate(LocalDateTime.now());
63
-
64 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 78
         applicationEventPublisher.publishEvent(new MessagEvent(this, taIssueApply));
74 79
     }
@@ -81,69 +86,133 @@ public class TaIssueApplyServiceImpl extends BaseServiceImpl<TaIssueApplyMapper,
81 86
     @Transactional(rollbackFor = Exception.class)
82 87
     @Override
83 88
     public void verify(TaIssueApply taIssueApply, SysUser sysUser, TaIssueApply origin) throws Exception {
84
-        // 更新审核信息
89
+        // 1. 更新审核信息
85 90
         origin.setVerifyStatus(taIssueApply.getVerifyStatus());
86 91
         origin.setVerifyDesc(taIssueApply.getVerifyDesc());
87 92
         origin.setVerifyOrg(sysUser.getOrgId());
88 93
         origin.setVerifyUser(sysUser.getUserId());
89 94
         origin.setVerifyUserName(sysUser.getName());
90 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 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 120
                 break;
99
-            case Constants.APPLY_REJECT:
121
+            case Constants.PROCESS_APPLY_REJECT:
100 122
                 // 问题单驳回
101
-                verifyReject();
123
+                verifyReject(origin, taIssue, taOrgIssue);
102 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 128
                 break;
107
-            case Constants.APPLY_END:
129
+            case Constants.PROCESS_APPLY_END:
108 130
                 // 销单申请
131
+                verifyEnd(origin, taIssue, taOrgIssue);
109 132
                 break;
110 133
             default:
111 134
                 // 其他
112 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 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 Zobrazit soubor

@@ -2,18 +2,15 @@ package com.example.civilizedcity.service.impl;
2 2
 
3 3
 import com.baomidou.mybatisplus.core.metadata.IPage;
4 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 8
 import com.example.civilizedcity.vo.StatVo;
12 9
 import org.springframework.beans.factory.annotation.Autowired;
10
+import org.springframework.context.ApplicationEventPublisher;
13 11
 import org.springframework.stereotype.Service;
14
-import com.example.civilizedcity.entity.TaIssue;
15
-import com.example.civilizedcity.mapper.TaIssueMapper;
16 12
 import com.example.civilizedcity.service.TaIssueService;
13
+import org.springframework.transaction.annotation.Transactional;
17 14
 
18 15
 import java.time.LocalDateTime;
19 16
 import java.util.ArrayList;
@@ -39,6 +36,12 @@ public class TaIssueServiceImpl extends BaseServiceImpl<TaIssueMapper, TaIssue>
39 36
     @Autowired
40 37
     TaIssueProcessMapper taIssueProcessMapper;
41 38
 
39
+    @Autowired
40
+    TaAttachMapper taAttachMapper;
41
+
42
+    @Autowired
43
+    ApplicationEventPublisher applicationEventPublisher;
44
+
42 45
     @Override
43 46
     public IPage<TaIssue> getPageBy(IPage<TaIssue> pg, String orgId) {
44 47
         if (null == orgId) {
@@ -130,6 +133,120 @@ public class TaIssueServiceImpl extends BaseServiceImpl<TaIssueMapper, TaIssue>
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 250
     Integer getStatValueBy(Object v, Integer def) {
134 251
         if (null == v) return def;
135 252
         return Integer.valueOf(v.toString());

+ 15
- 15
src/main/java/com/example/civilizedcity/service/impl/TaMessageServiceImpl.java Zobrazit soubor

@@ -31,20 +31,20 @@ public class TaMessageServiceImpl extends BaseServiceImpl<TaMessageMapper, TaMes
31 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 35
             taMessage.setMsgType("issue-reject");
36 36
             taMessage.setTitle("问题单被驳回");
37
-            taMessage.setTargetType(Constants.MESSAGE_TARGET_ISSUE);
37
+            taMessage.setTargetType(Constants.SOURCE_ISSUE);
38 38
             taMessage.setTargetId(taIssue.getIssueId().toString());
39 39
             taMessage.setStatus(Constants.STATUS_NORMAL);
40 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 49
                 taMessage.setOrgId(Constants.ROOT_ORG);
50 50
                 taMessage.setReceiveUser(taIssue.getCreateUser());
@@ -60,7 +60,7 @@ public class TaMessageServiceImpl extends BaseServiceImpl<TaMessageMapper, TaMes
60 60
     public void sendMessage(TaIssueApply taIssueApply) {
61 61
         boolean isApply = null == taIssueApply.getVerifyDate();
62 62
         TaMessage taMessage = new TaMessage();
63
-        taMessage.setTargetType(Constants.MESSAGE_TARGET_APPLY);
63
+        taMessage.setTargetType(Constants.SOURCE_APPLY);
64 64
         taMessage.setTargetId(taIssueApply.getApplyId().toString());
65 65
         taMessage.setStatus(Constants.STATUS_NORMAL);
66 66
         taMessage.setCreateDate(LocalDateTime.now());
@@ -69,25 +69,25 @@ public class TaMessageServiceImpl extends BaseServiceImpl<TaMessageMapper, TaMes
69 69
             taMessage.setMsgType("apply-" + taIssueApply.getApplyType());
70 70
 
71 71
             switch (taIssueApply.getApplyType()) {
72
-                case Constants.APPLY_DELAY:
72
+                case Constants.PROCESS_APPLY_DELAY:
73 73
                     taMessage.setTitle("延期申请");
74 74
                     taMessage.setContent("延期至: " + taIssueApply.getContent());
75 75
                     taMessage.setReceiveUser(null);
76 76
                     taMessage.setOrgId(Constants.ROOT_ORG);
77 77
                     break;
78
-                case Constants.APPLY_REJECT:
78
+                case Constants.PROCESS_APPLY_REJECT:
79 79
                     taMessage.setTitle("驳回申请");
80 80
                     taMessage.setContent(null);
81 81
                     taMessage.setReceiveUser(null);
82 82
                     taMessage.setOrgId(Constants.ROOT_ORG);
83 83
                     break;
84
-                case Constants.APPLY_VERIFY:
84
+                case Constants.PROCESS_APPLY_VERIFY:
85 85
                     taMessage.setTitle("审核申请");
86 86
                     taMessage.setContent(null);
87 87
                     taMessage.setReceiveUser(null);
88 88
                     taMessage.setOrgId(taIssueApply.getOrgId());
89 89
                     break;
90
-                case Constants.APPLY_END:
90
+                case Constants.PROCESS_APPLY_END:
91 91
                     taMessage.setTitle("消单申请");
92 92
                     taMessage.setContent(null);
93 93
                     taMessage.setReceiveUser(null);
@@ -101,21 +101,21 @@ public class TaMessageServiceImpl extends BaseServiceImpl<TaMessageMapper, TaMes
101 101
             }
102 102
         } else {
103 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 105
             taMessage.setReceiveUser(null);
106 106
             taMessage.setOrgId(taIssueApply.getOrgId());
107 107
 
108 108
             switch (taIssueApply.getApplyType()) {
109
-                case Constants.APPLY_DELAY:
109
+                case Constants.PROCESS_APPLY_DELAY:
110 110
                     taMessage.setTitle("延期审核");
111 111
                     break;
112
-                case Constants.APPLY_REJECT:
112
+                case Constants.PROCESS_APPLY_REJECT:
113 113
                     taMessage.setTitle("驳回审核");
114 114
                     break;
115
-                case Constants.APPLY_VERIFY:
115
+                case Constants.PROCESS_APPLY_VERIFY:
116 116
                     taMessage.setTitle("问题单审核");
117 117
                     break;
118
-                case Constants.APPLY_END:
118
+                case Constants.PROCESS_APPLY_END:
119 119
                     taMessage.setTitle("办结审核");
120 120
                     break;
121 121
                 default:

+ 54
- 7
src/main/java/com/example/civilizedcity/service/impl/TaOrgIssueServiceImpl.java Zobrazit soubor

@@ -3,13 +3,15 @@ package com.example.civilizedcity.service.impl;
3 3
 import com.baomidou.mybatisplus.core.metadata.IPage;
4 4
 import com.example.civilizedcity.common.Constants;
5 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 11
 import org.springframework.stereotype.Service;
10
-import com.example.civilizedcity.entity.TaOrgIssue;
11 12
 import com.example.civilizedcity.mapper.TaOrgIssueMapper;
12 13
 import com.example.civilizedcity.service.TaOrgIssueService;
14
+import org.springframework.transaction.annotation.Transactional;
13 15
 
14 16
 import java.time.LocalDateTime;
15 17
 
@@ -22,6 +24,15 @@ import java.time.LocalDateTime;
22 24
 @Service
23 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 36
     @Override
26 37
     public IPage<TaIssue> getIssuePageBy(IPage<TaIssue> pg, String orgId, String sourceType, String bizStatus) {
27 38
 
@@ -39,16 +50,52 @@ public class TaOrgIssueServiceImpl extends BaseServiceImpl<TaOrgIssueMapper, TaO
39 50
         return baseMapper.getIssuePageBy(pg, orgId, sourceType, processNode, isExpire);
40 51
     }
41 52
 
53
+    @Transactional(rollbackFor = Exception.class)
42 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 77
         TaOrgIssue taOrgIssue = new TaOrgIssue();
45 78
         taOrgIssue.setIssueId(taIssue.getIssueId());
46 79
         taOrgIssue.setOrgId(taIssue.getOrgId());
47
-        taOrgIssue.setProcessStatus(Constants.PROCESS_START);
80
+        taOrgIssue.setProcessNode(Constants.PROCESS_START);
81
+        taOrgIssue.setProcessStatus(Constants.APPLY_READY); // 状态是未审核
48 82
         taOrgIssue.setStatus(Constants.STATUS_NORMAL);
49 83
         taOrgIssue.setCreateDate(LocalDateTime.now());
50 84
         taOrgIssue.setCreateUser(sysUser.getUserId());
51
-
52 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 Zobrazit soubor

@@ -2,6 +2,19 @@
2 2
 <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
3 3
 
4 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 19
     <select id="getListBy" resultType="com.example.civilizedcity.entity.TaAttach">
7 20
         SELECT

+ 9
- 9
src/main/resources/mapper/TaFeedbackMapper.xml Zobrazit soubor

@@ -15,10 +15,10 @@
15 15
     </select>
16 16
     <select id="statMaIndex" resultType="java.util.Map">
17 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 22
         FROM
23 23
             ta_feedback t
24 24
                 JOIN ta_issue s ON t.issue_id = s.issue_id
@@ -38,13 +38,13 @@
38 38
               AND t.person_id = #{personId}
39 39
           </if>
40 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 44
               </foreach>
45 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 48
         </if>
49 49
           AND t.`status` &gt; -1
50 50
           AND s.`status` &gt; -1

+ 6
- 6
src/main/resources/mapper/TaIssueMapper.xml Zobrazit soubor

@@ -57,9 +57,9 @@
57 57
     <select id="statMaIndex" resultType="java.util.Map">
58 58
         SELECT
59 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 63
         FROM
64 64
             ta_issue t
65 65
         WHERE 1 = 1
@@ -71,9 +71,9 @@
71 71
     <select id="statIssueOrg" resultType="java.util.Map">
72 72
         SELECT
73 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 77
         FROM
78 78
             ta_issue t
79 79
         WHERE

+ 4
- 4
src/main/resources/mapper/TaOrgIssueMapper.xml Zobrazit soubor

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