Просмотр исходного кода

Merge branch 'master' of http://git.ycjcjy.com/civilized_city/service

Your Name 2 лет назад
Родитель
Сommit
0dda10f5d3
49 измененных файлов: 2631 добавлений и 107 удалений
  1. 252
    27
      db/.back_文明创办/文明创办-backup-2023131183934.pdma.json
  2. 8
    0
      db/job_stat_issue_daily.sql
  3. 8
    0
      db/job_stat_issue_monthly.sql
  4. 28
    0
      db/pro_stat_issue.sql
  5. 1032
    0
      db/sequence.sql
  6. 270
    11
      db/文明创办.pdma.json
  7. 17
    0
      src/main/java/com/example/civilizedcity/common/BaseController.java
  8. 4
    2
      src/main/java/com/example/civilizedcity/common/Constants.java
  9. 4
    0
      src/main/java/com/example/civilizedcity/config/WxMaUitl.java
  10. 43
    5
      src/main/java/com/example/civilizedcity/controller/StatController.java
  11. 17
    1
      src/main/java/com/example/civilizedcity/controller/SysOrgController.java
  12. 1
    0
      src/main/java/com/example/civilizedcity/controller/SysUserController.java
  13. 149
    0
      src/main/java/com/example/civilizedcity/controller/TaFeedbackController.java
  14. 20
    4
      src/main/java/com/example/civilizedcity/controller/TaIssueApplyController.java
  15. 16
    22
      src/main/java/com/example/civilizedcity/controller/TaIssueController.java
  16. 4
    1
      src/main/java/com/example/civilizedcity/controller/TaIssueProcessController.java
  17. 3
    1
      src/main/java/com/example/civilizedcity/controller/TdQuestionController.java
  18. 5
    3
      src/main/java/com/example/civilizedcity/controller/WxMaController.java
  19. 3
    0
      src/main/java/com/example/civilizedcity/entity/SysUser.java
  20. 76
    0
      src/main/java/com/example/civilizedcity/entity/TaFeedback.java
  21. 39
    0
      src/main/java/com/example/civilizedcity/entity/TsStatData.java
  22. 7
    2
      src/main/java/com/example/civilizedcity/mapper/SysUserMapper.java
  23. 31
    0
      src/main/java/com/example/civilizedcity/mapper/TaFeedbackMapper.java
  24. 1
    0
      src/main/java/com/example/civilizedcity/mapper/TaIssueApplyMapper.java
  25. 12
    3
      src/main/java/com/example/civilizedcity/mapper/TaIssueMapper.java
  26. 3
    2
      src/main/java/com/example/civilizedcity/mapper/TaOrgIssueMapper.java
  27. 25
    0
      src/main/java/com/example/civilizedcity/mapper/TsStatDataMapper.java
  28. 6
    1
      src/main/java/com/example/civilizedcity/service/SysLoginService.java
  29. 20
    0
      src/main/java/com/example/civilizedcity/service/TaFeedbackService.java
  30. 1
    1
      src/main/java/com/example/civilizedcity/service/TaIssueApplyService.java
  31. 5
    3
      src/main/java/com/example/civilizedcity/service/TaIssueService.java
  32. 1
    1
      src/main/java/com/example/civilizedcity/service/TaOrgIssueService.java
  33. 24
    0
      src/main/java/com/example/civilizedcity/service/TsStatDataService.java
  34. 58
    0
      src/main/java/com/example/civilizedcity/service/impl/SysLoginServiceImpl.java
  35. 1
    1
      src/main/java/com/example/civilizedcity/service/impl/SysResourceServiceImpl.java
  36. 1
    1
      src/main/java/com/example/civilizedcity/service/impl/SysRoleServiceImpl.java
  37. 1
    0
      src/main/java/com/example/civilizedcity/service/impl/SysUserDutyServiceImpl.java
  38. 133
    0
      src/main/java/com/example/civilizedcity/service/impl/TaFeedbackServiceImpl.java
  39. 2
    4
      src/main/java/com/example/civilizedcity/service/impl/TaIssueApplyServiceImpl.java
  40. 38
    4
      src/main/java/com/example/civilizedcity/service/impl/TaIssueServiceImpl.java
  41. 2
    2
      src/main/java/com/example/civilizedcity/service/impl/TaOrgIssueServiceImpl.java
  42. 71
    0
      src/main/java/com/example/civilizedcity/service/impl/TsStatDataServiceImpl.java
  43. 17
    0
      src/main/resources/application.yml
  44. 19
    1
      src/main/resources/mapper/SysUserMapper.xml
  45. 54
    0
      src/main/resources/mapper/TaFeedbackMapper.xml
  46. 3
    0
      src/main/resources/mapper/TaIssueApplyMapper.xml
  47. 39
    2
      src/main/resources/mapper/TaIssueMapper.xml
  48. 8
    2
      src/main/resources/mapper/TaOrgIssueMapper.xml
  49. 49
    0
      src/main/resources/mapper/TsStatDataMapper.xml

db/.back_文明创办/文明创办-backup-2023129082004.pdma.json → db/.back_文明创办/文明创办-backup-2023131183934.pdma.json Просмотреть файл

@@ -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-29 08:17:44",
7
+  "updatedTime": "2023-1-31 18:39:19",
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": "创建人",
@@ -6921,9 +6938,32 @@
6921 6938
       "id": "EF3D4E17-6CE0-4944-B1DC-40280B2B689F",
6922 6939
       "env": {
6923 6940
         "base": {
6924
-          "nameSpace": "",
6925
-          "codeRoot": ""
6926
-        }
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": {}
6927 6967
       },
6928 6968
       "defKey": "ta_feedback",
6929 6969
       "defName": "反馈表",
@@ -7006,7 +7046,7 @@
7006 7046
           "scale": "",
7007 7047
           "primaryKey": true,
7008 7048
           "notNull": true,
7009
-          "autoIncrement": true,
7049
+          "autoIncrement": false,
7010 7050
           "defaultValue": "",
7011 7051
           "hideInGraph": true,
7012 7052
           "domain": "16120F75-6AA7-4483-868D-F07F511BB081",
@@ -7048,6 +7088,39 @@
7048 7088
           "domain": "",
7049 7089
           "id": "2B36F8F1-9C06-434F-B4D5-0A28D587BA24"
7050 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
+        },
7051 7124
         {
7052 7125
           "defKey": "person_id",
7053 7126
           "defName": "反馈人ID",
@@ -7102,18 +7175,18 @@
7102 7175
         {
7103 7176
           "defKey": "verify_status",
7104 7177
           "defName": "审核状态",
7105
-          "comment": "0未审,1通过,2驳回",
7178
+          "comment": "null未审,pass通过,reject驳回",
7106 7179
           "type": "",
7107 7180
           "len": "",
7108 7181
           "scale": "",
7109 7182
           "primaryKey": false,
7110 7183
           "notNull": false,
7111 7184
           "autoIncrement": false,
7112
-          "defaultValue": "0",
7185
+          "defaultValue": "",
7113 7186
           "hideInGraph": false,
7114 7187
           "refDict": "",
7115 7188
           "extProps": {},
7116
-          "domain": "6BC8F04B-6CFA-4995-98D3-318F5CDD774E",
7189
+          "domain": "73FD2BAD-2358-4336-B96D-45DC897BD792",
7117 7190
           "id": "90567F1C-10F8-4BB2-9F32-B92B7077091B"
7118 7191
         },
7119 7192
         {
@@ -8371,9 +8444,32 @@
8371 8444
       "id": "38420D50-01AB-4E31-84D3-20192D26E25F",
8372 8445
       "env": {
8373 8446
         "base": {
8374
-          "nameSpace": "",
8375
-          "codeRoot": ""
8376
-        }
8447
+          "nameSpace": "com.example.civilizedcity",
8448
+          "codeRoot": "TaCheckStand"
8449
+        },
8450
+        "template": {
8451
+          "JavaMybatisPlus": {
8452
+            "Controller": {
8453
+              "suffix": "controller/{{=it.codeRoot}}Controller.java"
8454
+            },
8455
+            "Service": {
8456
+              "suffix": "service/{{=it.codeRoot}}Service.java"
8457
+            },
8458
+            "ServiceImpl": {
8459
+              "suffix": "service/impl/{{=it. codeRoot}}ServiceImpl.java"
8460
+            },
8461
+            "Mapper": {
8462
+              "suffix": "mapper/{{=it.codeRoot}}Mapper.java"
8463
+            },
8464
+            "Mapper.xml": {
8465
+              "suffix": "mapper/{{=it.codeRoot}}Mapper.xml"
8466
+            },
8467
+            "Entity": {
8468
+              "suffix": "entity/{{=it.codeRoot}}.java"
8469
+            }
8470
+          }
8471
+        },
8472
+        "custom": {}
8377 8473
       },
8378 8474
       "defKey": "ta_check_stand",
8379 8475
       "defName": "测评标准",
@@ -8448,8 +8544,8 @@
8448 8544
       ],
8449 8545
       "fields": [
8450 8546
         {
8451
-          "defKey": "id",
8452
-          "defName": "ID",
8547
+          "defKey": "statnd_id",
8548
+          "defName": "标准ID",
8453 8549
           "comment": "",
8454 8550
           "type": "",
8455 8551
           "len": 32,
@@ -8465,11 +8561,11 @@
8465 8561
           "id": "219A66C3-6D3F-4F1E-A572-9E5294556142"
8466 8562
         },
8467 8563
         {
8468
-          "defKey": "org_id",
8469
-          "defName": "机构ID",
8564
+          "defKey": "content",
8565
+          "defName": "测评标准",
8470 8566
           "comment": "",
8471
-          "type": "",
8472
-          "len": "",
8567
+          "type": "TEXT",
8568
+          "len": 0,
8473 8569
           "scale": "",
8474 8570
           "primaryKey": false,
8475 8571
           "notNull": false,
@@ -8477,7 +8573,7 @@
8477 8573
           "defaultValue": "",
8478 8574
           "hideInGraph": false,
8479 8575
           "refDict": "",
8480
-          "domain": "16120F75-6AA7-4483-868D-F07F511BB081",
8576
+          "domain": "",
8481 8577
           "id": "30776463-B5E8-44DB-B5B6-45817A48E59F",
8482 8578
           "uiHint": ""
8483 8579
         },
@@ -8531,29 +8627,147 @@
8531 8627
           "refDict": "",
8532 8628
           "uiHint": "",
8533 8629
           "id": "DED8CFDE-66A8-4460-A94A-2AAA1D169C5D"
8630
+        }
8631
+      ],
8632
+      "correlations": [],
8633
+      "indexes": []
8634
+    },
8635
+    {
8636
+      "id": "78C3BB38-9B37-445B-A311-168B4682FE5E",
8637
+      "env": {
8638
+        "base": {
8639
+          "nameSpace": "",
8640
+          "codeRoot": ""
8641
+        }
8642
+      },
8643
+      "defKey": "ts_stat_data",
8644
+      "defName": "常用统计",
8645
+      "comment": "",
8646
+      "properties": {},
8647
+      "nameTemplate": "{defKey}[{defName}]",
8648
+      "headers": [
8649
+        {
8650
+          "refKey": "hideInGraph",
8651
+          "hideInGraph": true
8534 8652
         },
8535 8653
         {
8536
-          "defKey": "update_user",
8537
-          "defName": "更新人",
8654
+          "refKey": "defKey",
8655
+          "hideInGraph": false
8656
+        },
8657
+        {
8658
+          "refKey": "defName",
8659
+          "hideInGraph": false
8660
+        },
8661
+        {
8662
+          "refKey": "primaryKey",
8663
+          "hideInGraph": false
8664
+        },
8665
+        {
8666
+          "refKey": "notNull",
8667
+          "hideInGraph": true
8668
+        },
8669
+        {
8670
+          "refKey": "autoIncrement",
8671
+          "hideInGraph": true
8672
+        },
8673
+        {
8674
+          "refKey": "domain",
8675
+          "hideInGraph": true
8676
+        },
8677
+        {
8678
+          "refKey": "type",
8679
+          "hideInGraph": false
8680
+        },
8681
+        {
8682
+          "refKey": "len",
8683
+          "hideInGraph": false
8684
+        },
8685
+        {
8686
+          "refKey": "scale",
8687
+          "hideInGraph": false
8688
+        },
8689
+        {
8690
+          "refKey": "comment",
8691
+          "hideInGraph": true
8692
+        },
8693
+        {
8694
+          "refKey": "refDict",
8695
+          "hideInGraph": true
8696
+        },
8697
+        {
8698
+          "refKey": "defaultValue",
8699
+          "hideInGraph": true
8700
+        },
8701
+        {
8702
+          "refKey": "isStandard",
8703
+          "hideInGraph": false
8704
+        },
8705
+        {
8706
+          "refKey": "uiHint",
8707
+          "hideInGraph": true
8708
+        },
8709
+        {
8710
+          "refKey": "extProps",
8711
+          "hideInGraph": true
8712
+        }
8713
+      ],
8714
+      "fields": [
8715
+        {
8716
+          "defKey": "stat_no",
8717
+          "defName": "序号",
8538 8718
           "comment": "",
8539
-          "domain": "16120F75-6AA7-4483-868D-F07F511BB081",
8540 8719
           "type": "",
8541
-          "len": 32,
8720
+          "len": "",
8721
+          "scale": "",
8722
+          "primaryKey": true,
8723
+          "notNull": true,
8724
+          "autoIncrement": true,
8725
+          "defaultValue": "",
8726
+          "hideInGraph": true,
8727
+          "domain": "6BC8F04B-6CFA-4995-98D3-318F5CDD774E",
8728
+          "refDict": "",
8729
+          "uiHint": "",
8730
+          "id": "E7763878-4C25-476F-8C26-56BF7E0A9F35"
8731
+        },
8732
+        {
8733
+          "defKey": "stat_type",
8734
+          "defName": "统计类型",
8735
+          "comment": "",
8736
+          "type": "",
8737
+          "len": "",
8542 8738
           "scale": "",
8543 8739
           "primaryKey": false,
8544 8740
           "notNull": false,
8545 8741
           "autoIncrement": false,
8546 8742
           "defaultValue": "",
8743
+          "hideInGraph": false,
8744
+          "refDict": "",
8745
+          "domain": "73FD2BAD-2358-4336-B96D-45DC897BD792",
8746
+          "id": "49707BF9-E174-4ABA-8527-2C6A0996FE43",
8747
+          "uiHint": ""
8748
+        },
8749
+        {
8750
+          "defKey": "name",
8751
+          "defName": "指标名称",
8752
+          "comment": "",
8753
+          "domain": "73FD2BAD-2358-4336-B96D-45DC897BD792",
8754
+          "type": "",
8755
+          "len": "",
8756
+          "scale": "",
8757
+          "primaryKey": false,
8758
+          "notNull": false,
8759
+          "autoIncrement": false,
8760
+          "defaultValue": "1",
8547 8761
           "hideInGraph": true,
8548 8762
           "refDict": "",
8549 8763
           "uiHint": "",
8550
-          "id": "06EC3E88-DE3F-43F9-A155-D2454F4D8C4E"
8764
+          "id": "22B03E6C-E6FD-4D4F-855B-87E5F8EF79BF"
8551 8765
         },
8552 8766
         {
8553
-          "defKey": "update_date",
8554
-          "defName": "更新时间",
8767
+          "defKey": "value",
8768
+          "defName": "统计值",
8555 8769
           "comment": "",
8556
-          "domain": "7CFFA0D3-6A93-4DDC-BC10-DF21211064DC",
8770
+          "domain": "6BC8F04B-6CFA-4995-98D3-318F5CDD774E",
8557 8771
           "type": "",
8558 8772
           "len": "",
8559 8773
           "scale": "",
@@ -8564,7 +8778,7 @@
8564 8778
           "hideInGraph": true,
8565 8779
           "refDict": "",
8566 8780
           "uiHint": "",
8567
-          "id": "4C2C2D21-B0E0-4279-AD8B-F7359B17B7AB"
8781
+          "id": "5DC510CC-D45C-42D4-AEED-5AD9130E0D88"
8568 8782
         }
8569 8783
       ],
8570 8784
       "correlations": [],
@@ -9004,6 +9218,17 @@
9004 9218
       "refDiagrams": [],
9005 9219
       "refDicts": [],
9006 9220
       "id": "96B34919-1A2F-4E7A-87B9-0330F40F7DF2"
9221
+    },
9222
+    {
9223
+      "defKey": "stat",
9224
+      "defName": "查询统计",
9225
+      "refEntities": [
9226
+        "78C3BB38-9B37-445B-A311-168B4682FE5E"
9227
+      ],
9228
+      "refViews": [],
9229
+      "refDiagrams": [],
9230
+      "refDicts": [],
9231
+      "id": "49C90869-CA44-48D0-A675-ECCB8853A412"
9007 9232
     }
9008 9233
   ],
9009 9234
   "dataTypeMapping": {

+ 8
- 0
db/job_stat_issue_daily.sql Просмотреть файл

@@ -0,0 +1,8 @@
1
+DROP EVENT IF EXISTS `job_stat_issue_daily`;
2
+delimiter ;;
3
+CREATE EVENT `job_stat_issue_daily`
4
+ON SCHEDULE
5
+EVERY '1' DAY STARTS '2023-02-01 01:00:00'
6
+DO CALL pro_stat_issue('issue_daily', DATE_SUB(CURDATE(), INTERVAL 1 DAY), DATE_SUB(CURDATE(), INTERVAL 1 DAY))
7
+;;
8
+delimiter ;

+ 8
- 0
db/job_stat_issue_monthly.sql Просмотреть файл

@@ -0,0 +1,8 @@
1
+DROP EVENT IF EXISTS `job_stat_issue_monthly`;
2
+delimiter ;;
3
+CREATE EVENT `job_stat_issue_monthly`
4
+ON SCHEDULE
5
+EVERY '1' MONTH STARTS '2023-02-01 01:00:00'
6
+DO CALL pro_stat_issue('issue_monthly', DATE_ADD(LAST_DAY(DATE_SUB(NOW(), INTERVAL 2 MONTH)), INTERVAL 1 DAY), LAST_DAY(DATE_SUB(NOW(), INTERVAL 1 MONTH)))
7
+;;
8
+delimiter ;

+ 28
- 0
db/pro_stat_issue.sql Просмотреть файл

@@ -0,0 +1,28 @@
1
+DROP PROCEDURE IF EXISTS `pro_stat_issue`;
2
+delimiter ;;
3
+CREATE PROCEDURE `pro_stat_issue`(IN `ls_type` varchar(32),IN `ls_start` varchar(20),IN `ls_end` varchar(20))
4
+BEGIN
5
+	DECLARE ls_stat_name VARCHAR(20);
6
+	
7
+	IF ls_type = 'issue_daily' OR ls_type = 'issue_monthly' THEN
8
+		SET ls_stat_name = ls_start;
9
+		IF ls_type = 'issue_monthly' THEN
10
+			SET ls_stat_name = SUBSTR(ls_start FROM 1 FOR 7);
11
+		END IF;
12
+	
13
+		# 先清除数据
14
+		DELETE t FROM ts_stat_data t WHERE t.stat_type = ls_type AND t.`name` = ls_stat_name;
15
+		
16
+		# 再统计数据
17
+		INSERT INTO ts_stat_data (stat_type, `name`, `value`)
18
+		SELECT ls_type, ls_stat_name, COUNT(*)
19
+		FROM ta_issue t
20
+		WHERE t.`status` > -1
21
+		AND TO_DAYS(t.create_date) >= TO_DAYS(ls_start)
22
+		AND TO_DAYS(t.create_date) <= TO_DAYS(ls_end);
23
+		
24
+	END IF;	
25
+	
26
+END
27
+;;
28
+delimiter ;

+ 1032
- 0
db/sequence.sql
Разница между файлами не показана из-за своего большого размера
Просмотреть файл


+ 270
- 11
db/文明创办.pdma.json Просмотреть файл

@@ -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-29 08:20:04",
7
+  "updatedTime": "2023-1-31 18:39:34",
8 8
   "dbConns": [],
9 9
   "profile": {
10 10
     "default": {
@@ -1205,6 +1205,23 @@
1205 1205
           "uiHint": "",
1206 1206
           "id": "C3E43687-58A1-4E99-AE11-085F9B6688D7"
1207 1207
         },
1208
+        {
1209
+          "defKey": "is_user",
1210
+          "defName": "是否系统用户",
1211
+          "comment": "0市民,1系统用户",
1212
+          "type": "",
1213
+          "len": "",
1214
+          "scale": "",
1215
+          "primaryKey": false,
1216
+          "notNull": false,
1217
+          "autoIncrement": false,
1218
+          "defaultValue": "1",
1219
+          "hideInGraph": false,
1220
+          "refDict": "",
1221
+          "extProps": {},
1222
+          "domain": "6BC8F04B-6CFA-4995-98D3-318F5CDD774E",
1223
+          "id": "D1C0A2CD-89DB-44DF-918F-EA536E39761F"
1224
+        },
1208 1225
         {
1209 1226
           "defKey": "create_user",
1210 1227
           "defName": "创建人",
@@ -6922,9 +6939,32 @@
6922 6939
       "id": "EF3D4E17-6CE0-4944-B1DC-40280B2B689F",
6923 6940
       "env": {
6924 6941
         "base": {
6925
-          "nameSpace": "",
6926
-          "codeRoot": ""
6927
-        }
6942
+          "nameSpace": "com.example.civilizedcity",
6943
+          "codeRoot": "TaFeedback"
6944
+        },
6945
+        "template": {
6946
+          "JavaMybatisPlus": {
6947
+            "Controller": {
6948
+              "suffix": "controller/{{=it.codeRoot}}Controller.java"
6949
+            },
6950
+            "Service": {
6951
+              "suffix": "service/{{=it.codeRoot}}Service.java"
6952
+            },
6953
+            "ServiceImpl": {
6954
+              "suffix": "service/impl/{{=it. codeRoot}}ServiceImpl.java"
6955
+            },
6956
+            "Mapper": {
6957
+              "suffix": "mapper/{{=it.codeRoot}}Mapper.java"
6958
+            },
6959
+            "Mapper.xml": {
6960
+              "suffix": "mapper/{{=it.codeRoot}}Mapper.xml"
6961
+            },
6962
+            "Entity": {
6963
+              "suffix": "entity/{{=it.codeRoot}}.java"
6964
+            }
6965
+          }
6966
+        },
6967
+        "custom": {}
6928 6968
       },
6929 6969
       "defKey": "ta_feedback",
6930 6970
       "defName": "反馈表",
@@ -7007,7 +7047,7 @@
7007 7047
           "scale": "",
7008 7048
           "primaryKey": true,
7009 7049
           "notNull": true,
7010
-          "autoIncrement": true,
7050
+          "autoIncrement": false,
7011 7051
           "defaultValue": "",
7012 7052
           "hideInGraph": true,
7013 7053
           "domain": "16120F75-6AA7-4483-868D-F07F511BB081",
@@ -7049,6 +7089,39 @@
7049 7089
           "domain": "",
7050 7090
           "id": "2B36F8F1-9C06-434F-B4D5-0A28D587BA24"
7051 7091
         },
7092
+        {
7093
+          "defKey": "location",
7094
+          "defName": "定位",
7095
+          "comment": "",
7096
+          "type": "VARCHAR",
7097
+          "len": 32,
7098
+          "scale": "",
7099
+          "primaryKey": false,
7100
+          "notNull": false,
7101
+          "autoIncrement": false,
7102
+          "defaultValue": "",
7103
+          "hideInGraph": false,
7104
+          "refDict": "",
7105
+          "extProps": {},
7106
+          "id": "2D8D31C7-FD0E-48DB-9538-FCF3B79E93AB"
7107
+        },
7108
+        {
7109
+          "defKey": "addr",
7110
+          "defName": "具体位置",
7111
+          "comment": "",
7112
+          "type": "",
7113
+          "len": "",
7114
+          "scale": "",
7115
+          "primaryKey": false,
7116
+          "notNull": false,
7117
+          "autoIncrement": false,
7118
+          "defaultValue": "",
7119
+          "hideInGraph": false,
7120
+          "domain": "9092C4E0-1A54-4859-ABBB-5B62DBC27573",
7121
+          "refDict": "",
7122
+          "extProps": {},
7123
+          "id": "215DDE0F-97A2-4DBC-99D5-31C8AF2768E9"
7124
+        },
7052 7125
         {
7053 7126
           "defKey": "person_id",
7054 7127
           "defName": "反馈人ID",
@@ -7103,18 +7176,18 @@
7103 7176
         {
7104 7177
           "defKey": "verify_status",
7105 7178
           "defName": "审核状态",
7106
-          "comment": "0未审,1通过,2驳回",
7179
+          "comment": "null未审,pass通过,reject驳回",
7107 7180
           "type": "",
7108 7181
           "len": "",
7109 7182
           "scale": "",
7110 7183
           "primaryKey": false,
7111 7184
           "notNull": false,
7112 7185
           "autoIncrement": false,
7113
-          "defaultValue": "0",
7186
+          "defaultValue": "",
7114 7187
           "hideInGraph": false,
7115 7188
           "refDict": "",
7116 7189
           "extProps": {},
7117
-          "domain": "6BC8F04B-6CFA-4995-98D3-318F5CDD774E",
7190
+          "domain": "73FD2BAD-2358-4336-B96D-45DC897BD792",
7118 7191
           "id": "90567F1C-10F8-4BB2-9F32-B92B7077091B"
7119 7192
         },
7120 7193
         {
@@ -8372,9 +8445,32 @@
8372 8445
       "id": "38420D50-01AB-4E31-84D3-20192D26E25F",
8373 8446
       "env": {
8374 8447
         "base": {
8375
-          "nameSpace": "",
8376
-          "codeRoot": ""
8377
-        }
8448
+          "nameSpace": "com.example.civilizedcity",
8449
+          "codeRoot": "TaCheckStand"
8450
+        },
8451
+        "template": {
8452
+          "JavaMybatisPlus": {
8453
+            "Controller": {
8454
+              "suffix": "controller/{{=it.codeRoot}}Controller.java"
8455
+            },
8456
+            "Service": {
8457
+              "suffix": "service/{{=it.codeRoot}}Service.java"
8458
+            },
8459
+            "ServiceImpl": {
8460
+              "suffix": "service/impl/{{=it. codeRoot}}ServiceImpl.java"
8461
+            },
8462
+            "Mapper": {
8463
+              "suffix": "mapper/{{=it.codeRoot}}Mapper.java"
8464
+            },
8465
+            "Mapper.xml": {
8466
+              "suffix": "mapper/{{=it.codeRoot}}Mapper.xml"
8467
+            },
8468
+            "Entity": {
8469
+              "suffix": "entity/{{=it.codeRoot}}.java"
8470
+            }
8471
+          }
8472
+        },
8473
+        "custom": {}
8378 8474
       },
8379 8475
       "defKey": "ta_check_stand",
8380 8476
       "defName": "测评标准",
@@ -8536,6 +8632,158 @@
8536 8632
       ],
8537 8633
       "correlations": [],
8538 8634
       "indexes": []
8635
+    },
8636
+    {
8637
+      "id": "78C3BB38-9B37-445B-A311-168B4682FE5E",
8638
+      "env": {
8639
+        "base": {
8640
+          "nameSpace": "",
8641
+          "codeRoot": ""
8642
+        }
8643
+      },
8644
+      "defKey": "ts_stat_data",
8645
+      "defName": "常用统计",
8646
+      "comment": "",
8647
+      "properties": {},
8648
+      "nameTemplate": "{defKey}[{defName}]",
8649
+      "headers": [
8650
+        {
8651
+          "refKey": "hideInGraph",
8652
+          "hideInGraph": true
8653
+        },
8654
+        {
8655
+          "refKey": "defKey",
8656
+          "hideInGraph": false
8657
+        },
8658
+        {
8659
+          "refKey": "defName",
8660
+          "hideInGraph": false
8661
+        },
8662
+        {
8663
+          "refKey": "primaryKey",
8664
+          "hideInGraph": false
8665
+        },
8666
+        {
8667
+          "refKey": "notNull",
8668
+          "hideInGraph": true
8669
+        },
8670
+        {
8671
+          "refKey": "autoIncrement",
8672
+          "hideInGraph": true
8673
+        },
8674
+        {
8675
+          "refKey": "domain",
8676
+          "hideInGraph": true
8677
+        },
8678
+        {
8679
+          "refKey": "type",
8680
+          "hideInGraph": false
8681
+        },
8682
+        {
8683
+          "refKey": "len",
8684
+          "hideInGraph": false
8685
+        },
8686
+        {
8687
+          "refKey": "scale",
8688
+          "hideInGraph": false
8689
+        },
8690
+        {
8691
+          "refKey": "comment",
8692
+          "hideInGraph": true
8693
+        },
8694
+        {
8695
+          "refKey": "refDict",
8696
+          "hideInGraph": true
8697
+        },
8698
+        {
8699
+          "refKey": "defaultValue",
8700
+          "hideInGraph": true
8701
+        },
8702
+        {
8703
+          "refKey": "isStandard",
8704
+          "hideInGraph": false
8705
+        },
8706
+        {
8707
+          "refKey": "uiHint",
8708
+          "hideInGraph": true
8709
+        },
8710
+        {
8711
+          "refKey": "extProps",
8712
+          "hideInGraph": true
8713
+        }
8714
+      ],
8715
+      "fields": [
8716
+        {
8717
+          "defKey": "stat_no",
8718
+          "defName": "序号",
8719
+          "comment": "",
8720
+          "type": "",
8721
+          "len": "",
8722
+          "scale": "",
8723
+          "primaryKey": true,
8724
+          "notNull": true,
8725
+          "autoIncrement": true,
8726
+          "defaultValue": "",
8727
+          "hideInGraph": true,
8728
+          "domain": "6BC8F04B-6CFA-4995-98D3-318F5CDD774E",
8729
+          "refDict": "",
8730
+          "uiHint": "",
8731
+          "id": "E7763878-4C25-476F-8C26-56BF7E0A9F35"
8732
+        },
8733
+        {
8734
+          "defKey": "stat_type",
8735
+          "defName": "统计类型",
8736
+          "comment": "",
8737
+          "type": "",
8738
+          "len": "",
8739
+          "scale": "",
8740
+          "primaryKey": false,
8741
+          "notNull": false,
8742
+          "autoIncrement": false,
8743
+          "defaultValue": "",
8744
+          "hideInGraph": false,
8745
+          "refDict": "",
8746
+          "domain": "73FD2BAD-2358-4336-B96D-45DC897BD792",
8747
+          "id": "49707BF9-E174-4ABA-8527-2C6A0996FE43",
8748
+          "uiHint": ""
8749
+        },
8750
+        {
8751
+          "defKey": "name",
8752
+          "defName": "指标名称",
8753
+          "comment": "",
8754
+          "domain": "73FD2BAD-2358-4336-B96D-45DC897BD792",
8755
+          "type": "",
8756
+          "len": "",
8757
+          "scale": "",
8758
+          "primaryKey": false,
8759
+          "notNull": false,
8760
+          "autoIncrement": false,
8761
+          "defaultValue": "",
8762
+          "hideInGraph": true,
8763
+          "refDict": "",
8764
+          "uiHint": "",
8765
+          "id": "22B03E6C-E6FD-4D4F-855B-87E5F8EF79BF"
8766
+        },
8767
+        {
8768
+          "defKey": "value",
8769
+          "defName": "统计值",
8770
+          "comment": "",
8771
+          "domain": "6BC8F04B-6CFA-4995-98D3-318F5CDD774E",
8772
+          "type": "",
8773
+          "len": "",
8774
+          "scale": "",
8775
+          "primaryKey": false,
8776
+          "notNull": false,
8777
+          "autoIncrement": false,
8778
+          "defaultValue": "0",
8779
+          "hideInGraph": true,
8780
+          "refDict": "",
8781
+          "uiHint": "",
8782
+          "id": "5DC510CC-D45C-42D4-AEED-5AD9130E0D88"
8783
+        }
8784
+      ],
8785
+      "correlations": [],
8786
+      "indexes": []
8539 8787
     }
8540 8788
   ],
8541 8789
   "views": [],
@@ -8971,6 +9219,17 @@
8971 9219
       "refDiagrams": [],
8972 9220
       "refDicts": [],
8973 9221
       "id": "96B34919-1A2F-4E7A-87B9-0330F40F7DF2"
9222
+    },
9223
+    {
9224
+      "defKey": "stat",
9225
+      "defName": "查询统计",
9226
+      "refEntities": [
9227
+        "78C3BB38-9B37-445B-A311-168B4682FE5E"
9228
+      ],
9229
+      "refViews": [],
9230
+      "refDiagrams": [],
9231
+      "refDicts": [],
9232
+      "id": "49C90869-CA44-48D0-A675-ECCB8853A412"
8974 9233
     }
8975 9234
   ],
8976 9235
   "dataTypeMapping": {

+ 17
- 0
src/main/java/com/example/civilizedcity/common/BaseController.java Просмотреть файл

@@ -3,6 +3,7 @@ package com.example.civilizedcity.common;
3 3
 import cn.dev33.satoken.stp.StpUtil;
4 4
 import com.example.civilizedcity.entity.SysUser;
5 5
 import com.example.civilizedcity.entity.TaPerson;
6
+import com.example.civilizedcity.service.SysUserDutyService;
6 7
 import com.example.civilizedcity.service.SysUserService;
7 8
 import com.example.civilizedcity.service.TaPersonService;
8 9
 import org.springframework.beans.factory.annotation.Autowired;
@@ -10,6 +11,7 @@ import org.springframework.stereotype.Component;
10 11
 
11 12
 import javax.annotation.Resource;
12 13
 import javax.servlet.http.HttpServletRequest;
14
+import java.util.List;
13 15
 
14 16
 @Component
15 17
 public class BaseController {
@@ -23,6 +25,9 @@ public class BaseController {
23 25
     @Autowired
24 26
     protected TaPersonService taPersonService;
25 27
 
28
+    @Autowired
29
+    protected SysUserDutyService sysUserDutyService;
30
+
26 31
     public SysUser currentUser() throws Exception {
27 32
         String loginId = StpUtil.getLoginIdAsString();
28 33
         if (StringUtils.isEmpty(loginId)) {
@@ -52,4 +57,16 @@ public class BaseController {
52 57
 
53 58
         return taPerson;
54 59
     }
60
+
61
+    public boolean isManager(SysUser sysUser) throws Exception {
62
+        if (Constants.ROOT_ORG.equals(sysUser.getOrgId())) return true;
63
+
64
+        List<String> dutyList = sysUserDutyService.getListByUser(sysUser.getUserId());
65
+        sysUser.setDutyList(dutyList);  // 添加了一点副作用
66
+        if (null != dutyList && (dutyList.contains(Constants.DUTY_MANAGER) || dutyList.contains(Constants.DUTY_QUERY_PERSON))) {
67
+            return true;
68
+        }
69
+
70
+        return false;
71
+    }
55 72
 }

+ 4
- 2
src/main/java/com/example/civilizedcity/common/Constants.java Просмотреть файл

@@ -24,6 +24,8 @@ public class Constants {
24 24
 
25 25
     // 问题单
26 26
     public final static String ATTACH_SOURCE_ISSUE = "issue";
27
+    // 市民上报
28
+    public final static String ATTACH_SOURCE_FEEDBACK = "feedback";
27 29
     // 单位问题单
28 30
     public final static String ATTACH_SOURCE_ORG_ISSUE = "org-issue";
29 31
     // 测评答案
@@ -57,8 +59,8 @@ public class Constants {
57 59
 
58 60
     // 流程起始: 待交办
59 61
     public final static String PROCESS_START = "start";
60
-    // 流程: 被打回 - 市民提交
61
-    public final static String PROCESS_REJECT = "reject";
62
+    // 流程: 被打回 - 市民提交 - 算办结
63
+//    public final static String PROCESS_REJECT = "reject";
62 64
 
63 65
     // 审核
64 66
     public final static String PROCESS_VERIFY = "verify";

+ 4
- 0
src/main/java/com/example/civilizedcity/config/WxMaUitl.java Просмотреть файл

@@ -41,6 +41,10 @@ public class WxMaUitl {
41 41
         return service.getUserService().getPhoneNoInfo(param.getSessionKey(), param.getEncryptedData(), param.getIv());
42 42
     }
43 43
 
44
+    public WxMaPhoneNumberInfo getPhoneNoInfo(String code) throws WxErrorException {
45
+        return service.getUserService().getNewPhoneNoInfo(code);
46
+    }
47
+
44 48
     @Data
45 49
     public static class AuthParam {
46 50
         String signature;

+ 43
- 5
src/main/java/com/example/civilizedcity/controller/StatController.java Просмотреть файл

@@ -5,7 +5,9 @@ import com.example.civilizedcity.common.ResponseBean;
5 5
 import com.example.civilizedcity.entity.SysUser;
6 6
 import com.example.civilizedcity.entity.TaPerson;
7 7
 import com.example.civilizedcity.service.TaIssueService;
8
+import com.example.civilizedcity.service.TsStatDataService;
8 9
 import com.example.civilizedcity.vo.StatVo;
10
+import io.swagger.annotations.Api;
9 11
 import io.swagger.annotations.ApiOperation;
10 12
 import io.swagger.annotations.ApiParam;
11 13
 import org.springframework.beans.factory.annotation.Autowired;
@@ -14,16 +16,21 @@ import org.springframework.web.bind.annotation.RequestParam;
14 16
 import org.springframework.web.bind.annotation.RestController;
15 17
 
16 18
 import java.util.List;
19
+import java.util.Map;
17 20
 
18 21
 /**
19 22
  * 查询统计
20 23
  */
24
+@Api(tags = "常用统计对象功能接口")
21 25
 @RestController
22 26
 public class StatController extends BaseController {
23 27
 
24 28
     @Autowired
25 29
     TaIssueService taIssueService;
26 30
 
31
+    @Autowired
32
+    TsStatDataService tsStatDataService;
33
+
27 34
     @ApiOperation("小程序首页查询统计")
28 35
     @GetMapping("/ma/index-stat")
29 36
     public ResponseBean getMaIndex(@ApiParam("身份") @RequestParam(value = "duty", required = false) String duty) throws Exception {
@@ -35,14 +42,45 @@ public class StatController extends BaseController {
35 42
         } catch (Exception e) {
36 43
             //
37 44
         }
38
-        try {
39
-            person = currentPerson();
40
-        } catch (Exception e) {
41
-            //
45
+
46
+        person = currentPerson();
47
+        if (null == person) {
48
+            return ResponseBean.error("请在小程序端操作");
42 49
         }
43 50
 
44
-        List<StatVo> result = taIssueService.statMaIndex(user, duty);
51
+        List<StatVo> result = taIssueService.statMaIndex(user, person, duty);
52
+
53
+        return ResponseBean.success(result);
54
+    }
55
+
56
+    @ApiOperation("管理端首页统计")
57
+    @GetMapping("/stat/admin/index-banner")
58
+    public ResponseBean statAdminIndexBanner() throws Exception {
59
+        Map<String, Object> result = tsStatDataService.statAdminIndexBanner();
60
+        return ResponseBean.success(result);
61
+    }
62
+
63
+    @ApiOperation("问题单数量查询统计")
64
+    @GetMapping("/stat/issue")
65
+    public ResponseBean statIssueData(@ApiParam("统计类型") @RequestParam String statType,
66
+                                      @ApiParam("开始日期") @RequestParam String startDate,
67
+                                      @ApiParam("结束日期") @RequestParam String endDate,
68
+                                      @ApiParam("统计条数") @RequestParam Integer num) throws Exception {
69
+        List<StatVo> result = tsStatDataService.statIssue(statType, startDate, endDate, num);
70
+        return ResponseBean.success(result);
71
+    }
72
+
73
+    @ApiOperation("单位交办统计")
74
+    @GetMapping("/stat/issue/org")
75
+    public ResponseBean statIssueOrg(@ApiParam("单位ID") @RequestParam String orgId) throws Exception {
76
+        List<StatVo> result = tsStatDataService.statIssueOrg(orgId);
77
+        return ResponseBean.success(result);
78
+    }
45 79
 
80
+    @ApiOperation("问题分类统计")
81
+    @GetMapping("/stat/issue/type")
82
+    public ResponseBean statIssueType() throws Exception {
83
+        List<StatVo> result = tsStatDataService.statIssueType();
46 84
         return ResponseBean.success(result);
47 85
     }
48 86
 }

+ 17
- 1
src/main/java/com/example/civilizedcity/controller/SysOrgController.java Просмотреть файл

@@ -12,6 +12,7 @@ import java.util.List;
12 12
 
13 13
 import com.example.civilizedcity.common.StringUtils;
14 14
 import com.example.civilizedcity.entity.SysRole;
15
+import com.example.civilizedcity.entity.SysUser;
15 16
 import io.swagger.annotations.Api;
16 17
 import io.swagger.annotations.ApiOperation;
17 18
 import io.swagger.annotations.ApiParam;
@@ -145,7 +146,22 @@ public class SysOrgController extends BaseController {
145 146
      */
146 147
     @ApiOperation("通过主键删除数据")
147 148
     @DeleteMapping("/sysOrg/{id}")
148
-    public ResponseBean deleteById(@ApiParam("对象ID") @PathVariable String id) {
149
+    public ResponseBean deleteById(@ApiParam("对象ID") @PathVariable String id) throws Exception {
150
+        SysUser sysUser = currentUser();
151
+
152
+        if (Constants.ROOT_ID.equals(id)) {
153
+            return ResponseBean.error("系统机构, 禁止删除");
154
+        }
155
+
156
+        long count = sysOrgService.countBy("org_p_id", id, true);
157
+        if (count > 0) {
158
+            return ResponseBean.error("请先删除子级单位");
159
+        }
160
+
161
+        if (!Constants.ROOT_ORG.equals(sysUser.getOrgId())) {
162
+            return ResponseBean.error("暂无权限");
163
+        }
164
+
149 165
         sysOrgService.removeLogicById(id);
150 166
         return ResponseBean.success("success");
151 167
     }

+ 1
- 0
src/main/java/com/example/civilizedcity/controller/SysUserController.java Просмотреть файл

@@ -107,6 +107,7 @@ public class SysUserController extends BaseController {
107 107
         queryWrapper.like(!StringUtils.isEmpty(name), "name", name);
108 108
         queryWrapper.eq(!StringUtils.isEmpty(orgId), "org_id", orgId);
109 109
         queryWrapper.like(!StringUtils.isEmpty(phone), "phone", phone);
110
+        queryWrapper.eq("is_user", 1);
110 111
         queryWrapper.gt("status", Constants.STATUS_DELETE);
111 112
         queryWrapper.ne("user_id", Constants.ROOT_ID);
112 113
         queryWrapper.orderByDesc("create_date");

+ 149
- 0
src/main/java/com/example/civilizedcity/controller/TaFeedbackController.java Просмотреть файл

@@ -0,0 +1,149 @@
1
+package com.example.civilizedcity.controller;
2
+
3
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
4
+import com.baomidou.mybatisplus.core.metadata.IPage;
5
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
6
+import com.example.civilizedcity.common.BaseController;
7
+import com.example.civilizedcity.common.Constants;
8
+import com.example.civilizedcity.common.ResponseBean;
9
+import java.util.List;
10
+
11
+import com.example.civilizedcity.common.StringUtils;
12
+import com.example.civilizedcity.entity.TaAttach;
13
+import com.example.civilizedcity.entity.TaIssue;
14
+import com.example.civilizedcity.entity.TaPerson;
15
+import com.example.civilizedcity.service.TaAttachService;
16
+import io.swagger.annotations.Api;
17
+import io.swagger.annotations.ApiOperation;
18
+import io.swagger.annotations.ApiParam;
19
+import org.springframework.beans.factory.annotation.Autowired;
20
+import org.springframework.web.bind.annotation.*;
21
+import com.example.civilizedcity.entity.TaFeedback;
22
+import com.example.civilizedcity.service.TaFeedbackService;
23
+
24
+ /**
25
+ * 反馈表;(ta_feedback)表控制层
26
+ * @author : http://njyunzhi.com
27
+ * @date : 2023-1-30
28
+ */
29
+@Api(tags = "反馈表对象功能接口")
30
+@RestController
31
+@RequestMapping("/")
32
+public class TaFeedbackController extends BaseController {
33
+    
34
+    @Autowired
35
+    private TaFeedbackService taFeedbackService;
36
+
37
+    @Autowired
38
+    private TaAttachService taAttachService;
39
+    
40
+    /** 
41
+     * 通过ID查询单条数据 
42
+     *
43
+     * @param id 主键
44
+     * @return 实例对象
45
+     */
46
+    @ApiOperation("通过ID查询单条数据")
47
+    @GetMapping("/taFeedback/{id}")
48
+    public ResponseBean queryById(@ApiParam("对象ID") @PathVariable String id) throws Exception {
49
+        TaFeedback taFeedback = taFeedbackService.getById(id);
50
+        List<TaAttach> attachList = taAttachService.getListBy(Constants.ATTACH_SOURCE_FEEDBACK, taFeedback.getFeedbackId());
51
+        taFeedback.setAttachList(attachList);
52
+        return ResponseBean.success(taFeedback);
53
+    }
54
+    
55
+    /** 
56
+     * 分页查询
57
+     *
58
+     * @param pageNum 当前页码
59
+     * @param pageSize 每页条数
60
+     * @return 查询结果
61
+     */
62
+    @ApiOperation("分页查询")
63
+    @GetMapping("/taFeedback")
64
+    public ResponseBean list(@ApiParam("页码") @RequestParam(value ="pageNum",defaultValue = "1") Integer pageNum,
65
+                             @ApiParam("单页数据量") @RequestParam(value ="pageSize",defaultValue = "10") Integer pageSize,
66
+                             @ApiParam("我的") @RequestParam(value ="isMine", defaultValue = "false") Boolean isMine,
67
+                             @ApiParam("问题单状态") @RequestParam(value = "bizStatus", required = false) String bizStatus) throws Exception {
68
+
69
+        TaPerson taPerson = currentPerson();
70
+        if (null == taPerson && isMine) {
71
+            return ResponseBean.error("请在小程序中操作");
72
+        }
73
+
74
+        String personId = isMine ? taPerson.getPersonId() : null;
75
+        
76
+        IPage<TaIssue> pg = new Page<>(pageNum, pageSize);
77
+        IPage<TaIssue> result = taFeedbackService.getPageBy(pg, personId, bizStatus);
78
+        
79
+        return ResponseBean.success(result);
80
+    }
81
+    
82
+    /** 
83
+     * 新增数据
84
+     *
85
+     * @param taFeedback 实例对象
86
+     * @return 实例对象
87
+     */
88
+    @ApiOperation("新增数据")
89
+    @PostMapping("/taFeedback")
90
+    public ResponseBean add(@ApiParam("对象实体") @RequestBody TaFeedback taFeedback) throws Exception {
91
+
92
+        if (StringUtils.isEmpty(taFeedback.getContent())) {
93
+            return ResponseBean.error("请填写反馈内容");
94
+        }
95
+        if (StringUtils.isEmpty(taFeedback.getAddr())) {
96
+            return ResponseBean.error("请填写具体位置");
97
+        }
98
+
99
+        if (null == taFeedback.getAttachList() || taFeedback.getAttachList().size() == 0) {
100
+            return ResponseBean.error("请上传照片");
101
+        }
102
+
103
+        TaPerson taPerson = currentPerson();
104
+
105
+        taFeedbackService.createNew(taFeedback, taPerson);
106
+        return ResponseBean.success(taFeedback);
107
+    }
108
+    
109
+//    /**
110
+//     * 更新数据
111
+//     *
112
+//     * @param taFeedback 实例对象
113
+//     * @return 实例对象
114
+//     */
115
+//    @ApiOperation("更新数据")
116
+//    @PutMapping("/taFeedback/{id}")
117
+//    public ResponseBean edit(@ApiParam("对象实体") @RequestBody TaFeedback taFeedback,
118
+//                            @ApiParam("对象ID") @PathVariable String id ) throws Exception {
119
+//        taFeedbackService.updateById(taFeedback);
120
+//        return ResponseBean.success(taFeedback);
121
+//    }
122
+    
123
+    /** 
124
+     * 通过主键删除数据
125
+     *
126
+     * @param feedbackId 主键
127
+     * @return 是否成功
128
+     */
129
+    @ApiOperation("通过主键删除数据")
130
+    @DeleteMapping("/taFeedback/{id}")
131
+    public ResponseBean deleteById(@ApiParam("对象ID") @PathVariable String id) throws Exception {
132
+        TaPerson taPerson = currentPerson();
133
+        if (null == taPerson) {
134
+            return ResponseBean.error("请在小程序中操作");
135
+        }
136
+
137
+        TaFeedback taFeedback = taFeedbackService.getById(id);
138
+        if (null == taFeedback || taFeedback.getStatus() == Constants.STATUS_DELETE) {
139
+            return ResponseBean.error("未找到相关数据");
140
+        }
141
+
142
+        if (!taPerson.getPersonId().equals(taFeedback.getPersonId())) {
143
+            return ResponseBean.error("暂无权限");
144
+        }
145
+
146
+        taFeedbackService.removeLogicById(id);
147
+        return ResponseBean.success("success");
148
+    }
149
+}

+ 20
- 4
src/main/java/com/example/civilizedcity/controller/TaIssueApplyController.java Просмотреть файл

@@ -13,6 +13,7 @@ import java.util.List;
13 13
 import com.example.civilizedcity.common.StringUtils;
14 14
 import com.example.civilizedcity.entity.SysUser;
15 15
 import com.example.civilizedcity.event.MessagEvent;
16
+import com.example.civilizedcity.service.SysUserDutyService;
16 17
 import com.example.civilizedcity.service.TaIssueService;
17 18
 import io.swagger.annotations.Api;
18 19
 import io.swagger.annotations.ApiOperation;
@@ -40,6 +41,9 @@ public class TaIssueApplyController extends BaseController {
40 41
     @Autowired
41 42
     private TaIssueService taIssueService;
42 43
 
44
+    @Autowired
45
+    private SysUserDutyService sysUserDutyService;
46
+
43 47
     @Autowired
44 48
     ApplicationEventPublisher applicationEventPublisher;
45 49
 
@@ -66,11 +70,14 @@ public class TaIssueApplyController extends BaseController {
66 70
                                        @ApiParam("申请类型") @RequestParam("applyType") String applyType) throws Exception {
67 71
 
68 72
         SysUser sysUser = currentUser();
73
+        boolean isManager = isManager(sysUser);
69 74
 
70 75
         QueryWrapper<TaIssueApply> queryWrapper = new QueryWrapper<>();
71 76
         queryWrapper.eq("issue_id", issueId);
72 77
         queryWrapper.eq("apply_type", applyType);
73
-        queryWrapper.eq("org_id", sysUser.getOrgId());
78
+        if (!isManager) {
79
+            queryWrapper.eq("org_id", sysUser.getOrgId());
80
+        }
74 81
         queryWrapper.gt("status", Constants.STATUS_DELETE);
75 82
         queryWrapper.orderByDesc("create_date");
76 83
         queryWrapper.last("limit 1");
@@ -91,14 +98,15 @@ public class TaIssueApplyController extends BaseController {
91 98
     @GetMapping("/taIssueApply")
92 99
     public ResponseBean list(@ApiParam("页码") @RequestParam(value = "pageNum", defaultValue = "1") Integer pageNum,
93 100
                              @ApiParam("单页数据量") @RequestParam(value = "pageSize", defaultValue = "10") Integer pageSize,
101
+                             @ApiParam("问题单ID") @RequestParam(value = "issueId", required = false) Integer issueId,
94 102
                              @ApiParam("申请类型") @RequestParam(value = "applyType", required = false) String applyType,
95 103
                              @ApiParam("问题单来源") @RequestParam(value = "sourceType", required = false) String sourceType) throws Exception {
96 104
 
97 105
         SysUser sysUser = currentUser();
98
-        String orgId = Constants.ROOT_ORG.equals(sysUser.getOrgId()) ? null : sysUser.getOrgId();
106
+        String orgId = isManager(sysUser) ? null : sysUser.getOrgId();
99 107
 
100 108
         IPage<TaIssueApply> pg = new Page<>(pageNum, pageSize);
101
-        IPage<TaIssueApply> result = taIssueApplyService.getPageBy(pg, applyType, orgId, sourceType);
109
+        IPage<TaIssueApply> result = taIssueApplyService.getPageBy(pg, issueId, applyType, orgId, sourceType);
102 110
 
103 111
         return ResponseBean.success(result);
104 112
     }
@@ -150,9 +158,17 @@ public class TaIssueApplyController extends BaseController {
150 158
 
151 159
         taIssueApplyService.updateById(origin);
152 160
 
153
-        // 清空当前申请 - 表示申请流程已走完
161
+        //
154 162
         taIssueService.updateApply(taIssueApply.getIssueId(), null, null);
155 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
+
156 172
 //        if (Constants.APPLY_VERIFY.equals(origin.getApplyType())) {
157 173
 //            int validateStatus = Constants.APPLY_STATUS_REJECT.equals(taIssueApply.getVerifyStatus()) ? Constants.VERIFY_REJECT : Constants.VERIFY_PASS;
158 174
 //            taIssueService.updateValidateStatus(taIssueApply.getIssueId(), validateStatus);

+ 16
- 22
src/main/java/com/example/civilizedcity/controller/TaIssueController.java Просмотреть файл

@@ -89,22 +89,21 @@ public class TaIssueController extends BaseController {
89 89
             return ResponseBean.error("暂无权限查询数据");
90 90
         }
91 91
 
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 = true;
100
-            validateStatus = 0;
101
-        } else {
102
-            return ResponseBean.error("暂无权限查询数据");
103
-        }
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 104
 
105 105
         IPage<TaIssue> pg = new Page<>(pageNum, pageSize);
106 106
         QueryWrapper<TaIssue> queryWrapper = new QueryWrapper<>();
107
-//        queryWrapper.eq("org_id", orgId);
108 107
 
109 108
         if (Constants.PROCESS_START.equals(bizStatus)) {
110 109
             // 待交办
@@ -125,15 +124,10 @@ public class TaIssueController extends BaseController {
125 124
             queryWrapper.eq("process_status", Constants.PROCESS_STATUS_REJECT);
126 125
         }
127 126
 
128
-        // 既是督察员又是管理员
129
-        if (!isRooter) {
130
-            if (dutyList.contains(Constants.DUTY_MANAGER)) {
131
-                // 管理员
132
-                queryWrapper.nested(q -> q.eq("create_user", sysUser.getUserId()).or().gt("validate_status", 0));
133
-            } else if (dutyList.contains(Constants.DUTY_INSPECTOR)) {
134
-                // 督察员
135
-                queryWrapper.eq("create_user", sysUser.getUserId());
136
-            }
127
+        // 督察员
128
+        if (dutyList.contains(Constants.DUTY_INSPECTOR) && !dutyList.contains(Constants.DUTY_MANAGER)) {
129
+            // 督察员
130
+            queryWrapper.eq("create_user", sysUser.getUserId());
137 131
         }
138 132
 
139 133
         queryWrapper.eq(StringUtils.isNotEmpty(locId), "loc_id", locId);

+ 4
- 1
src/main/java/com/example/civilizedcity/controller/TaIssueProcessController.java Просмотреть файл

@@ -74,6 +74,7 @@ public class TaIssueProcessController extends BaseController {
74 74
         IPage<TaIssueProcess> pg = new Page<>(pageNum, pageSize);
75 75
         QueryWrapper<TaIssueProcess> queryWrapper = new QueryWrapper<>();
76 76
         queryWrapper.eq("issue_id", issueId);
77
+        queryWrapper.gt("status", Constants.STATUS_DELETE);
77 78
         queryWrapper.orderByDesc("create_date");
78 79
         IPage<TaIssueProcess> result = taIssueProcessService.page(pg, queryWrapper);
79 80
 
@@ -157,6 +158,8 @@ public class TaIssueProcessController extends BaseController {
157 158
 
158 159
         if (StringUtils.isEmpty(taIssueProcess.getOrgId())) {
159 160
             return ResponseBean.error("请指定交办单位");
161
+        } else {
162
+            taIssue.setOrgId(taIssueProcess.getOrgId());
160 163
         }
161 164
         if (StringUtils.isEmpty(taIssueProcess.getExpireDate())) {
162 165
             return ResponseBean.error("请设置截止日期");
@@ -177,7 +180,7 @@ public class TaIssueProcessController extends BaseController {
177 180
 
178 181
         updateIssue(taIssue, taIssueProcess);
179 182
 
180
-        taOrgIssueService.createNewIssue(taIssue, taIssueProcess, sysUser);
183
+        taOrgIssueService.createNewIssue(taIssue, sysUser);
181 184
 
182 185
         return ResponseBean.success(taIssueProcess);
183 186
     }

+ 3
- 1
src/main/java/com/example/civilizedcity/controller/TdQuestionController.java Просмотреть файл

@@ -60,11 +60,13 @@ public class TdQuestionController extends BaseController {
60 60
     @GetMapping("/tdQuestion")
61 61
     public ResponseBean list(@ApiParam("页码") @RequestParam(value = "pageNum", defaultValue = "1") Integer pageNum,
62 62
                              @ApiParam("单页数据量") @RequestParam(value = "pageSize", defaultValue = "10") Integer pageSize,
63
-                             @ApiParam("标题") @RequestParam(value = "title", required = false) String title) throws Exception {
63
+                             @ApiParam("标题") @RequestParam(value = "title", required = false) String title,
64
+                             @ApiParam("问题类型") @RequestParam(value = "quType", required = false) String quType) throws Exception {
64 65
 
65 66
         IPage<TdQuestion> pg = new Page<>(pageNum, pageSize);
66 67
         QueryWrapper<TdQuestion> queryWrapper = new QueryWrapper<>();
67 68
         queryWrapper.like(!StringUtils.isEmpty(title), "title", title);
69
+        queryWrapper.eq(!StringUtils.isEmpty(quType), "qu_type", quType);
68 70
         queryWrapper.gt("status", Constants.STATUS_DELETE);
69 71
         queryWrapper.orderByDesc("create_date");
70 72
         IPage<TdQuestion> result = tdQuestionService.page(pg, queryWrapper);

+ 5
- 3
src/main/java/com/example/civilizedcity/controller/WxMaController.java Просмотреть файл

@@ -172,10 +172,10 @@ public class WxMaController extends BaseController {
172 172
 
173 173
     @ApiOperation(value="授权手机", notes = "授权手机", httpMethod = "PUT", response = TaPerson.class)
174 174
     @PutMapping("/auth-phone")
175
-    public ResponseBean updateUserPhone(@ApiParam("授权手机的参数") @RequestBody WxMaUitl.AuthParam param) throws Exception {
175
+    public ResponseBean updateUserPhone(@ApiParam("授权手机的Code") @RequestParam String code) throws Exception {
176 176
 
177 177
         // 解密
178
-        WxMaPhoneNumberInfo phoneNoInfo = wxMaUitl.getPhoneNoInfo(param);
178
+        WxMaPhoneNumberInfo phoneNoInfo = wxMaUitl.getPhoneNoInfo(code);
179 179
 
180 180
         TaPerson taPerson = currentPerson();
181 181
         if (null == taPerson) {
@@ -185,7 +185,9 @@ public class WxMaController extends BaseController {
185 185
         taPerson.setPhone(phoneNoInfo.getPhoneNumber());
186 186
         taPersonService.updateById(taPerson);
187 187
 
188
-        return ResponseBean.success(taPerson);
188
+        Map<String, Object> res = sysLoginService.loginByPerson(taPerson);
189
+
190
+        return ResponseBean.success(res);
189 191
     }
190 192
 
191 193
     @PostMapping("/change-password")

+ 3
- 0
src/main/java/com/example/civilizedcity/entity/SysUser.java Просмотреть файл

@@ -45,6 +45,9 @@ public class SysUser implements Serializable,Cloneable{
45 45
     /** 机构ID */
46 46
     @ApiModelProperty(name = "机构ID",notes = "")
47 47
     private String orgId ;
48
+     /** 是否系统用户 */
49
+     @ApiModelProperty(name = "是否系统用户",notes = "")
50
+     private Boolean isUser ;
48 51
     /** 状态 */
49 52
     @ApiModelProperty(name = "状态",notes = "")
50 53
     private Integer status ;

+ 76
- 0
src/main/java/com/example/civilizedcity/entity/TaFeedback.java Просмотреть файл

@@ -0,0 +1,76 @@
1
+package com.example.civilizedcity.entity;
2
+
3
+import com.baomidou.mybatisplus.annotation.TableField;
4
+import io.swagger.annotations.ApiModel;
5
+import io.swagger.annotations.ApiModelProperty;
6
+import com.baomidou.mybatisplus.annotation.IdType;
7
+import com.baomidou.mybatisplus.annotation.TableName;
8
+import com.baomidou.mybatisplus.annotation.TableId;
9
+import java.io.Serializable;
10
+import java.time.LocalDateTime;
11
+import java.util.List;
12
+
13
+import lombok.Data;
14
+import lombok.EqualsAndHashCode;
15
+import lombok.experimental.Accessors;
16
+
17
+ /**
18
+ * 反馈表;
19
+ * @author : http://www.chiner.pro
20
+ * @date : 2023-1-30
21
+ */
22
+@Data
23
+@EqualsAndHashCode(callSuper = false)
24
+@Accessors(chain = true)
25
+@ApiModel(value = "反馈表",description = "")
26
+@TableName("ta_feedback")
27
+public class TaFeedback implements Serializable,Cloneable{
28
+    /** 反馈ID */
29
+    @ApiModelProperty(name = "反馈ID",notes = "")
30
+    @TableId(value = "feedback_id", type = IdType.ASSIGN_UUID)
31
+    private String feedbackId ;
32
+    /** 反馈标题 */
33
+    @ApiModelProperty(name = "反馈标题",notes = "")
34
+    private String title ;
35
+    /** 详情 */
36
+    @ApiModelProperty(name = "详情",notes = "")
37
+    private String content ;
38
+    /** 定位 */
39
+    @ApiModelProperty(name = "定位",notes = "")
40
+    private String location ;
41
+    /** 具体位置 */
42
+    @ApiModelProperty(name = "具体位置",notes = "")
43
+    private String addr ;
44
+    /** 反馈人ID */
45
+    @ApiModelProperty(name = "反馈人ID",notes = "")
46
+    private String personId ;
47
+    /** 反馈人姓名 */
48
+    @ApiModelProperty(name = "反馈人姓名",notes = "")
49
+    private String name ;
50
+    /** 联系电话 */
51
+    @ApiModelProperty(name = "联系电话",notes = "")
52
+    private String phone ;
53
+    /** 审核状态;0未审,1通过,2驳回 */
54
+    @ApiModelProperty(name = "审核状态",notes = "null未审,pass通过,reject驳回")
55
+    private String verifyStatus ;
56
+    /** 审核意见 */
57
+    @ApiModelProperty(name = "审核意见",notes = "")
58
+    private String verifyDesc ;
59
+    /** 关联问题单 */
60
+    @ApiModelProperty(name = "关联问题单",notes = "")
61
+    private String issueId ;
62
+    /** 机构ID */
63
+    @ApiModelProperty(name = "机构ID",notes = "")
64
+    private String orgId ;
65
+    /** 状态 */
66
+    @ApiModelProperty(name = "状态",notes = "")
67
+    private Integer status ;
68
+    /** 创建时间 */
69
+    @ApiModelProperty(name = "创建时间",notes = "")
70
+    private LocalDateTime createDate ;
71
+
72
+
73
+     @TableField(exist = false)
74
+     @ApiModelProperty(name = "文件列表",notes = "")
75
+     private List<TaAttach> attachList;
76
+}

+ 39
- 0
src/main/java/com/example/civilizedcity/entity/TsStatData.java Просмотреть файл

@@ -0,0 +1,39 @@
1
+package com.example.civilizedcity.entity;
2
+
3
+import io.swagger.annotations.ApiModel;
4
+import io.swagger.annotations.ApiModelProperty;
5
+import com.baomidou.mybatisplus.annotation.IdType;
6
+import com.baomidou.mybatisplus.annotation.TableName;
7
+import com.baomidou.mybatisplus.annotation.TableId;
8
+import java.io.Serializable;
9
+import java.time.LocalDateTime;
10
+import lombok.Data;
11
+import lombok.EqualsAndHashCode;
12
+import lombok.experimental.Accessors;
13
+
14
+ /**
15
+ * 常用统计;
16
+ * @author : http://www.chiner.pro
17
+ * @date : 2023-1-31
18
+ */
19
+@Data
20
+@EqualsAndHashCode(callSuper = false)
21
+@Accessors(chain = true)
22
+@ApiModel(value = "常用统计",description = "")
23
+@TableName("ts_stat_data")
24
+public class TsStatData implements Serializable,Cloneable{
25
+    /** 序号 */
26
+    @ApiModelProperty(name = "序号",notes = "")
27
+    @TableId(value = "stat_no", type = IdType.ASSIGN_UUID)
28
+    private Integer statNo ;
29
+    /** 统计类型 */
30
+    @ApiModelProperty(name = "统计类型",notes = "")
31
+    private String statType ;
32
+    /** 指标名称 */
33
+    @ApiModelProperty(name = "指标名称",notes = "")
34
+    private String name ;
35
+    /** 统计值 */
36
+    @ApiModelProperty(name = "统计值",notes = "")
37
+    private Integer value ;
38
+
39
+}

+ 7
- 2
src/main/java/com/example/civilizedcity/mapper/SysUserMapper.java Просмотреть файл

@@ -5,11 +5,16 @@ import org.apache.ibatis.annotations.Mapper;
5 5
 import org.apache.ibatis.annotations.Param;
6 6
 import com.example.civilizedcity.entity.SysUser;
7 7
 
8
- /**
8
+import java.util.List;
9
+
10
+/**
9 11
  * 用户表;(sys_user)表数据库访问层
10 12
  * @author : http://njyunzhi.com
11 13
  * @date : 2022-12-12
12 14
  */
13 15
 @Mapper
14 16
 public interface SysUserMapper  extends BaseMapper<SysUser>{
15
- }
17
+     List<SysUser> getListByPhone(@Param("phone") String phone);
18
+
19
+    long countAll(@Param("rootId") String rootId);
20
+}

+ 31
- 0
src/main/java/com/example/civilizedcity/mapper/TaFeedbackMapper.java Просмотреть файл

@@ -0,0 +1,31 @@
1
+package com.example.civilizedcity.mapper;
2
+
3
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
4
+import com.baomidou.mybatisplus.core.metadata.IPage;
5
+import com.example.civilizedcity.entity.TaIssue;
6
+import org.apache.ibatis.annotations.MapKey;
7
+import org.apache.ibatis.annotations.Mapper;
8
+import org.apache.ibatis.annotations.Param;
9
+import com.example.civilizedcity.entity.TaFeedback;
10
+
11
+import java.util.List;
12
+import java.util.Map;
13
+
14
+/**
15
+ * 反馈表;(ta_feedback)表数据库访问层
16
+ *
17
+ * @author : http://njyunzhi.com
18
+ * @date : 2023-1-30
19
+ */
20
+@Mapper
21
+public interface TaFeedbackMapper extends BaseMapper<TaFeedback> {
22
+
23
+    long countByVerifyStatus(@Param("personId") String personId, @Param("verifyStatus") String verifyStatus);
24
+
25
+    Map<String, Object> statMaIndex(@Param("personId") String personId);
26
+
27
+    IPage<TaIssue> getPageBy(IPage<TaIssue> pg,
28
+                             @Param("personId") String personId,
29
+                             @Param("processList") List<String> processList,
30
+                             @Param("verifyStatus") String verifyStatus);
31
+}

+ 1
- 0
src/main/java/com/example/civilizedcity/mapper/TaIssueApplyMapper.java Просмотреть файл

@@ -15,6 +15,7 @@ import com.example.civilizedcity.entity.TaIssueApply;
15 15
 public interface TaIssueApplyMapper  extends BaseMapper<TaIssueApply>{
16 16
 
17 17
      IPage<TaIssueApply> getPageBy(IPage<TaIssueApply> pg,
18
+                                   @Param("issueId") Integer issueId,
18 19
                                    @Param("applyType") String applyType,
19 20
                                    @Param("orgId") String orgId,
20 21
                                    @Param("sourceType") String sourceType);

+ 12
- 3
src/main/java/com/example/civilizedcity/mapper/TaIssueMapper.java Просмотреть файл

@@ -2,11 +2,12 @@ package com.example.civilizedcity.mapper;
2 2
 
3 3
 import com.baomidou.mybatisplus.core.mapper.BaseMapper;
4 4
 import com.baomidou.mybatisplus.core.metadata.IPage;
5
-import org.apache.ibatis.annotations.MapKey;
5
+import com.example.civilizedcity.vo.StatVo;
6 6
 import org.apache.ibatis.annotations.Mapper;
7 7
 import org.apache.ibatis.annotations.Param;
8 8
 import com.example.civilizedcity.entity.TaIssue;
9 9
 
10
+import java.util.List;
10 11
 import java.util.Map;
11 12
 
12 13
 /**
@@ -27,6 +28,14 @@ public interface TaIssueMapper  extends BaseMapper<TaIssue>{
27 28
 
28 29
      int updateValidateStatus(@Param("issueId") Integer issueId, @Param("validateStatus") int validateStatus);
29 30
 
30
-     @MapKey("id")
31 31
      Map<String, Object> statMaIndex(@Param("userId") String userId);
32
- }
32
+
33
+     Map<String, Object> statIssueOrg(@Param("orgId") String orgId);
34
+
35
+     List<StatVo> statIssueType();
36
+
37
+    int updateProcess(@Param("issueId") Integer issueId,
38
+                      @Param("userId") String userId,
39
+                      @Param("processNode") String processNode,
40
+                      @Param("processStatus") String processStatus);
41
+}

+ 3
- 2
src/main/java/com/example/civilizedcity/mapper/TaOrgIssueMapper.java Просмотреть файл

@@ -27,6 +27,7 @@ public interface TaOrgIssueMapper  extends BaseMapper<TaOrgIssue>{
27 27
 
28 28
      TaOrgIssue getByIssueAndOrg(@Param("issueId") Integer issueId, @Param("orgId") String orgId);
29 29
 
30
-     @MapKey("id")
31 30
      Map<String, Object> statMaIndex(@Param("orgId") String orgId);
32
- }
31
+
32
+    int updateProcess(@Param("issueId") Integer issueId,@Param("orgId") String orgId,@Param("processStatus") String processStatus);
33
+}

+ 25
- 0
src/main/java/com/example/civilizedcity/mapper/TsStatDataMapper.java Просмотреть файл

@@ -0,0 +1,25 @@
1
+package com.example.civilizedcity.mapper;
2
+
3
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
4
+import com.example.civilizedcity.vo.StatVo;
5
+import org.apache.ibatis.annotations.Mapper;
6
+import org.apache.ibatis.annotations.Param;
7
+import com.example.civilizedcity.entity.TsStatData;
8
+
9
+import java.util.List;
10
+
11
+/**
12
+ * 常用统计;(ts_stat_data)表数据库访问层
13
+ * @author : http://njyunzhi.com
14
+ * @date : 2023-1-31
15
+ */
16
+@Mapper
17
+public interface TsStatDataMapper  extends BaseMapper<TsStatData>{
18
+    List<StatVo> statIssueDaily(@Param("startDate") String startDate,
19
+                                @Param("endDate") String endDate,
20
+                                @Param("num") Integer num);
21
+
22
+    List<StatVo> statIssueMonthly(@Param("startDate") String startDate,
23
+                                  @Param("endDate") String endDate,
24
+                                  @Param("num") Integer num);
25
+}

+ 6
- 1
src/main/java/com/example/civilizedcity/service/SysLoginService.java Просмотреть файл

@@ -3,8 +3,11 @@ package com.example.civilizedcity.service;
3 3
 import com.baomidou.mybatisplus.extension.service.IService;
4 4
 import com.example.civilizedcity.entity.SysLogin;
5 5
 import com.example.civilizedcity.entity.SysUser;
6
+import com.example.civilizedcity.entity.TaPerson;
6 7
 import com.example.civilizedcity.vo.WxChangePwd;
7 8
 
9
+import java.util.Map;
10
+
8 11
 /**
9 12
  * 系统账户表;(sys_login)表服务接口
10 13
  * @author : http://njyunzhi.com
@@ -13,4 +16,6 @@ import com.example.civilizedcity.vo.WxChangePwd;
13 16
 public interface SysLoginService extends IBaseService<SysLogin> {
14 17
 
15 18
      boolean changePassword(SysUser user, WxChangePwd wxChangePwd);
16
- }
19
+
20
+    Map<String, Object> loginByPerson(TaPerson taPerson);
21
+}

+ 20
- 0
src/main/java/com/example/civilizedcity/service/TaFeedbackService.java Просмотреть файл

@@ -0,0 +1,20 @@
1
+package com.example.civilizedcity.service;
2
+
3
+import com.baomidou.mybatisplus.core.metadata.IPage;
4
+import com.baomidou.mybatisplus.extension.service.IService;
5
+import com.example.civilizedcity.entity.TaFeedback;
6
+import com.example.civilizedcity.entity.TaIssue;
7
+import com.example.civilizedcity.entity.TaPerson;
8
+
9
+/**
10
+ * 反馈表;(ta_feedback)表服务接口
11
+ *
12
+ * @author : http://njyunzhi.com
13
+ * @date : 2023-1-30
14
+ */
15
+public interface TaFeedbackService extends IBaseService<TaFeedback> {
16
+
17
+    void createNew(TaFeedback taFeedback, TaPerson taPerson) throws Exception;
18
+
19
+    IPage<TaIssue> getPageBy(IPage<TaIssue> pg, String personId, String bizStatus);
20
+}

+ 1
- 1
src/main/java/com/example/civilizedcity/service/TaIssueApplyService.java Просмотреть файл

@@ -14,5 +14,5 @@ public interface TaIssueApplyService extends IBaseService<TaIssueApply> {
14 14
 
15 15
      void createNewApply(TaIssueApply taIssueApply, SysUser sysUser) throws Exception;
16 16
 
17
-     IPage<TaIssueApply> getPageBy(IPage<TaIssueApply> pg, String applyType, String orgId, String sourceType);
17
+     IPage<TaIssueApply> getPageBy(IPage<TaIssueApply> pg, Integer issueId, String applyType, String orgId, String sourceType);
18 18
  }

+ 5
- 3
src/main/java/com/example/civilizedcity/service/TaIssueService.java Просмотреть файл

@@ -1,9 +1,9 @@
1 1
 package com.example.civilizedcity.service;
2 2
 
3 3
 import com.baomidou.mybatisplus.core.metadata.IPage;
4
-import com.baomidou.mybatisplus.extension.service.IService;
5 4
 import com.example.civilizedcity.entity.SysUser;
6 5
 import com.example.civilizedcity.entity.TaIssue;
6
+import com.example.civilizedcity.entity.TaPerson;
7 7
 import com.example.civilizedcity.vo.StatVo;
8 8
 
9 9
 import java.util.List;
@@ -21,5 +21,7 @@ public interface TaIssueService extends IBaseService<TaIssue> {
21 21
 
22 22
      void updateApply(Integer issueId, String applyType, Integer applyId);
23 23
 
24
-     List<StatVo> statMaIndex(SysUser user, String duty);
25
- }
24
+     List<StatVo> statMaIndex(SysUser user, TaPerson person, String duty);
25
+
26
+    void updateEnd(SysUser sysUser, String orgId, Integer issueId);
27
+}

+ 1
- 1
src/main/java/com/example/civilizedcity/service/TaOrgIssueService.java Просмотреть файл

@@ -15,5 +15,5 @@ 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, TaIssueProcess taIssueProcess, SysUser sysUser);
18
+     void createNewIssue(TaIssue taIssue, SysUser sysUser);
19 19
  }

+ 24
- 0
src/main/java/com/example/civilizedcity/service/TsStatDataService.java Просмотреть файл

@@ -0,0 +1,24 @@
1
+package com.example.civilizedcity.service;
2
+
3
+import com.baomidou.mybatisplus.extension.service.IService;
4
+import com.example.civilizedcity.entity.TsStatData;
5
+import com.example.civilizedcity.vo.StatVo;
6
+
7
+import java.util.List;
8
+import java.util.Map;
9
+
10
+/**
11
+ * 常用统计;(ts_stat_data)表服务接口
12
+ * @author : http://njyunzhi.com
13
+ * @date : 2023-1-31
14
+ */
15
+public interface TsStatDataService extends IBaseService<TsStatData> {
16
+
17
+     List<StatVo> statIssue(String statType, String startDate, String endDate, Integer num);
18
+
19
+    List<StatVo> statIssueOrg(String orgId);
20
+
21
+    List<StatVo> statIssueType();
22
+
23
+    Map<String, Object> statAdminIndexBanner();
24
+}

+ 58
- 0
src/main/java/com/example/civilizedcity/service/impl/SysLoginServiceImpl.java Просмотреть файл

@@ -1,7 +1,12 @@
1 1
 package com.example.civilizedcity.service.impl;
2 2
 
3
+import cn.dev33.satoken.stp.StpUtil;
4
+import com.example.civilizedcity.common.Constants;
3 5
 import com.example.civilizedcity.common.EncryptUtils;
4 6
 import com.example.civilizedcity.entity.SysUser;
7
+import com.example.civilizedcity.entity.TaPerson;
8
+import com.example.civilizedcity.mapper.SysUserDutyMapper;
9
+import com.example.civilizedcity.mapper.SysUserMapper;
5 10
 import com.example.civilizedcity.vo.WxChangePwd;
6 11
 import org.springframework.beans.factory.annotation.Autowired;
7 12
 import org.springframework.stereotype.Service;
@@ -9,6 +14,12 @@ import com.example.civilizedcity.entity.SysLogin;
9 14
 import com.example.civilizedcity.mapper.SysLoginMapper;
10 15
 import com.example.civilizedcity.service.SysLoginService;
11 16
 
17
+import java.time.LocalDateTime;
18
+import java.util.ArrayList;
19
+import java.util.HashMap;
20
+import java.util.List;
21
+import java.util.Map;
22
+
12 23
 /**
13 24
  * 系统账户表;(sys_login)表服务实现类
14 25
  *
@@ -18,6 +29,12 @@ import com.example.civilizedcity.service.SysLoginService;
18 29
 @Service
19 30
 public class SysLoginServiceImpl extends BaseServiceImpl<SysLoginMapper, SysLogin> implements SysLoginService {
20 31
 
32
+    @Autowired
33
+    SysUserMapper sysUserMapper;
34
+
35
+    @Autowired
36
+    SysUserDutyMapper sysUserDutyMapper;
37
+
21 38
     @Override
22 39
     public boolean changePassword(SysUser user, WxChangePwd wxChangePwd) {
23 40
 
@@ -26,4 +43,45 @@ public class SysLoginServiceImpl extends BaseServiceImpl<SysLoginMapper, SysLogi
26 43
 
27 44
         return false;
28 45
     }
46
+
47
+    @Override
48
+    public Map<String, Object> loginByPerson(TaPerson taPerson) {
49
+        Map<String, Object> res = new HashMap<>();
50
+        SysUser user = null;
51
+
52
+                List<SysUser> sysUserList = sysUserMapper.getListByPhone(taPerson.getPhone());
53
+        if (null == sysUserList || sysUserList.size() < 1) {
54
+            user = new SysUser();
55
+            user.setPhone(taPerson.getPhone());
56
+            user.setIsUser(false);
57
+            user.setOrgId(taPerson.getPersonId()); // 机构ID 使用用户ID , 目前没有使用到
58
+            user.setStatus(Constants.STATUS_NORMAL);
59
+            user.setCreateDate(LocalDateTime.now());
60
+            sysUserMapper.insert(user);
61
+
62
+            if (null == sysUserList) {
63
+                sysUserList = new ArrayList<>();
64
+            }
65
+
66
+            sysUserList.add(user);
67
+        } else {
68
+            if (sysUserList.size() == 1) {
69
+                user = sysUserList.get(0);
70
+            } else {
71
+                user = sysUserList.stream().filter(x -> x.getIsUser()).findFirst().get();
72
+            }
73
+        }
74
+
75
+        // 获取人员身份
76
+        List<String> dutyList = sysUserDutyMapper.getListByUser(user.getUserId());
77
+        user.setDutyList(dutyList);
78
+
79
+        // 登录新用户
80
+        StpUtil.login(user.getUserId(), "miniapp");
81
+        res.put("user", user);
82
+        res.put("person", taPerson);
83
+        res.put("token", StpUtil.getTokenValue());
84
+
85
+        return res;
86
+    }
29 87
 }

+ 1
- 1
src/main/java/com/example/civilizedcity/service/impl/SysResourceServiceImpl.java Просмотреть файл

@@ -20,7 +20,7 @@ public class SysResourceServiceImpl extends BaseServiceImpl<SysResourceMapper, S
20 20
 
21 21
     @Override
22 22
     public List<SysResource> getByUser(String userId) {
23
-        if (userId == Constants.ROOT_ID) {
23
+        if (Constants.ROOT_ID.equals(userId)) {
24 24
             QueryWrapper<SysResource> queryWrapper = new QueryWrapper<>();
25 25
             queryWrapper.gt("status", Constants.STATUS_DELETE);
26 26
             return list(queryWrapper);

+ 1
- 1
src/main/java/com/example/civilizedcity/service/impl/SysRoleServiceImpl.java Просмотреть файл

@@ -21,7 +21,7 @@ public class SysRoleServiceImpl extends BaseServiceImpl<SysRoleMapper, SysRole>
21 21
 
22 22
     @Override
23 23
     public List<SysRole> getByUser(String userId) {
24
-        if (userId == Constants.ROOT_ID) {
24
+        if (Constants.ROOT_ID.equals(userId)) {
25 25
             QueryWrapper<SysRole> queryWrapper = new QueryWrapper<>();
26 26
             queryWrapper.gt("status", Constants.STATUS_DELETE);
27 27
             return list(queryWrapper);

+ 1
- 0
src/main/java/com/example/civilizedcity/service/impl/SysUserDutyServiceImpl.java Просмотреть файл

@@ -1,5 +1,6 @@
1 1
 package com.example.civilizedcity.service.impl;
2 2
 
3
+import com.example.civilizedcity.common.Constants;
3 4
 import org.springframework.beans.factory.annotation.Autowired;
4 5
 import org.springframework.stereotype.Service;
5 6
 import com.example.civilizedcity.entity.SysUserDuty;

+ 133
- 0
src/main/java/com/example/civilizedcity/service/impl/TaFeedbackServiceImpl.java Просмотреть файл

@@ -0,0 +1,133 @@
1
+package com.example.civilizedcity.service.impl;
2
+
3
+import com.baomidou.mybatisplus.core.metadata.IPage;
4
+import com.example.civilizedcity.common.Constants;
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;
12
+import org.springframework.beans.factory.annotation.Autowired;
13
+import org.springframework.stereotype.Service;
14
+import com.example.civilizedcity.entity.TaFeedback;
15
+import com.example.civilizedcity.mapper.TaFeedbackMapper;
16
+import com.example.civilizedcity.service.TaFeedbackService;
17
+import org.springframework.transaction.annotation.Transactional;
18
+
19
+import java.time.LocalDateTime;
20
+import java.util.ArrayList;
21
+import java.util.List;
22
+
23
+/**
24
+ * 反馈表;(ta_feedback)表服务实现类
25
+ *
26
+ * @author : http://www.chiner.pro
27
+ * @date : 2023-1-30
28
+ */
29
+@Service
30
+public class TaFeedbackServiceImpl extends BaseServiceImpl<TaFeedbackMapper, TaFeedback> implements TaFeedbackService {
31
+
32
+    @Autowired
33
+    TaPersonMapper taPersonMapper;
34
+
35
+    @Autowired
36
+    TaIssueMapper taIssueMapper;
37
+
38
+    @Autowired
39
+    TaAttachMapper taAttachMapper;
40
+
41
+    @Transactional(rollbackFor = Exception.class)
42
+    @Override
43
+    public void createNew(TaFeedback taFeedback, TaPerson taPerson) throws Exception {
44
+
45
+        // 准备 TaFeedback 数据
46
+        taFeedback.setFeedbackId(StringUtils.uuid());
47
+
48
+        if (StringUtils.isEmpty(taFeedback.getName())) {
49
+            taFeedback.setName(taPerson.getName());
50
+        } else {
51
+            if (StringUtils.isEmpty(taPerson.getName())) {
52
+                taPerson.setName(taFeedback.getName());
53
+                taPersonMapper.updateById(taPerson);
54
+            }
55
+        }
56
+
57
+        if (StringUtils.isEmpty(taFeedback.getPhone())) {
58
+            taFeedback.setPhone(taPerson.getPhone());
59
+        }
60
+
61
+        taFeedback.setPersonId(taPerson.getPersonId());
62
+        taFeedback.setStatus(Constants.STATUS_NORMAL);
63
+        taFeedback.setCreateDate(LocalDateTime.now());
64
+
65
+        // 准备 TaIssue 数据
66
+        TaIssue taIssue = new TaIssue();
67
+        taIssue.setTitle(taFeedback.getTitle());
68
+        taIssue.setLocation(taFeedback.getLocation());
69
+        taIssue.setAddr(taFeedback.getAddr());
70
+        taIssue.setContent(taFeedback.getContent());
71
+
72
+        taIssue.setOrgId(null); // 暂时没有责任单位
73
+        taIssue.setProcessNode(Constants.PROCESS_START);
74
+        taIssue.setProcessStatus(Constants.PROCESS_STATUS_READY);
75
+        taIssue.setProcessNum(1);
76
+        taIssue.setSourceType(Constants.ISSUE_SOURCE_FEEDBACK);
77
+        taIssue.setStatus(Constants.STATUS_NORMAL);
78
+        taIssue.setCreateUser(taFeedback.getPersonId());
79
+        taIssue.setUserName(taFeedback.getName());
80
+        taIssue.setCreateDate(LocalDateTime.now());
81
+        taIssueMapper.insert(taIssue);
82
+        // 保存文件
83
+        List<TaAttach> attachList = taFeedback.getAttachList();
84
+        if (null != attachList && attachList.size() > 0) {
85
+            for (TaAttach item : attachList) {
86
+                item.setAttachId(null);
87
+                item.setOwnerType(Constants.ATTACH_SOURCE_ISSUE);
88
+                item.setOwnerId(taIssue.getIssueId().toString());
89
+                item.setStatus(Constants.STATUS_NORMAL);
90
+                item.setCreateDate(LocalDateTime.now());
91
+                taAttachMapper.insert(item);
92
+            }
93
+        }
94
+
95
+        taFeedback.setIssueId(taIssue.getIssueId().toString());
96
+        save(taFeedback);
97
+        // 保存文件
98
+        if (null != attachList && attachList.size() > 0) {
99
+            for (TaAttach item : attachList) {
100
+                item.setAttachId(null);
101
+                item.setOwnerType(Constants.ATTACH_SOURCE_FEEDBACK);
102
+                item.setOwnerId(taFeedback.getFeedbackId());
103
+                taAttachMapper.insert(item);
104
+            }
105
+        }
106
+
107
+    }
108
+
109
+    @Override
110
+    public IPage<TaIssue> getPageBy(IPage<TaIssue> pg, String personId, String bizStatus) {
111
+
112
+        List<String> processList = new ArrayList<>();
113
+        String verifyStatus = null;
114
+
115
+        // 未处理
116
+        if (Constants.PROCESS_START.equals(bizStatus)) {
117
+            processList.add(Constants.PROCESS_START);
118
+        }
119
+
120
+        // 已处理, 包含处理中以及已完成的
121
+        if (Constants.PROCESS_ASSIGNED.equals(bizStatus)) {
122
+            processList.add(Constants.PROCESS_ASSIGNED);
123
+            processList.add(Constants.PROCESS_END);
124
+        }
125
+
126
+        // 已打回
127
+        if (Constants.APPLY_STATUS_REJECT.equals(bizStatus)) {
128
+            verifyStatus = Constants.APPLY_STATUS_REJECT;
129
+        }
130
+
131
+        return baseMapper.getPageBy(pg, personId, processList, verifyStatus);
132
+    }
133
+}

+ 2
- 4
src/main/java/com/example/civilizedcity/service/impl/TaIssueApplyServiceImpl.java Просмотреть файл

@@ -49,8 +49,6 @@ public class TaIssueApplyServiceImpl extends BaseServiceImpl<TaIssueApplyMapper,
49 49
                 throw new Exception("未找到交办单位问题单");
50 50
             }
51 51
 
52
-            // 标记在申请中
53
-            taOrgIssue.setResult(taIssueApply.getApplyType());
54 52
             taOrgIssueMapper.updateById(taOrgIssue);
55 53
         }
56 54
 
@@ -73,7 +71,7 @@ public class TaIssueApplyServiceImpl extends BaseServiceImpl<TaIssueApplyMapper,
73 71
     }
74 72
 
75 73
     @Override
76
-    public IPage<TaIssueApply> getPageBy(IPage<TaIssueApply> pg, String applyType, String orgId, String sourceType) {
77
-        return baseMapper.getPageBy(pg, applyType, orgId, sourceType);
74
+    public IPage<TaIssueApply> getPageBy(IPage<TaIssueApply> pg, Integer issueId, String applyType, String orgId, String sourceType) {
75
+        return baseMapper.getPageBy(pg, issueId, applyType, orgId, sourceType);
78 76
     }
79 77
 }

+ 38
- 4
src/main/java/com/example/civilizedcity/service/impl/TaIssueServiceImpl.java Просмотреть файл

@@ -2,8 +2,11 @@ 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.common.StringUtils;
6 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;
7 10
 import com.example.civilizedcity.mapper.TaOrgIssueMapper;
8 11
 import com.example.civilizedcity.vo.StatVo;
9 12
 import org.springframework.beans.factory.annotation.Autowired;
@@ -12,6 +15,7 @@ import com.example.civilizedcity.entity.TaIssue;
12 15
 import com.example.civilizedcity.mapper.TaIssueMapper;
13 16
 import com.example.civilizedcity.service.TaIssueService;
14 17
 
18
+import java.time.LocalDateTime;
15 19
 import java.util.ArrayList;
16 20
 import java.util.List;
17 21
 import java.util.Map;
@@ -28,6 +32,12 @@ public class TaIssueServiceImpl extends BaseServiceImpl<TaIssueMapper, TaIssue>
28 32
     @Autowired
29 33
     TaOrgIssueMapper taOrgIssueMapper;
30 34
 
35
+    @Autowired
36
+    TaFeedbackMapper taFeedbackMapper;
37
+
38
+    @Autowired
39
+    TaIssueProcessMapper taIssueProcessMapper;
40
+
31 41
     @Override
32 42
     public IPage<TaIssue> getPageBy(IPage<TaIssue> pg, String orgId) {
33 43
         if (null == orgId) {
@@ -49,7 +59,7 @@ public class TaIssueServiceImpl extends BaseServiceImpl<TaIssueMapper, TaIssue>
49 59
     }
50 60
 
51 61
     @Override
52
-    public List<StatVo> statMaIndex(SysUser user, String duty) {
62
+    public List<StatVo> statMaIndex(SysUser user, TaPerson person, String duty) {
53 63
         List<StatVo> result = new ArrayList<>();
54 64
 
55 65
         // 督察员
@@ -63,7 +73,7 @@ public class TaIssueServiceImpl extends BaseServiceImpl<TaIssueMapper, TaIssue>
63 73
         // 管理员
64 74
         else if (Constants.DUTY_MANAGER.equals(duty)) {
65 75
             Map<String, Object> res = baseMapper.statMaIndex(null);
66
-            result.add(new StatVo().setName("未处理").setValue(getStatValueBy(res.get("unassigned_num"), 0)));
76
+            result.add(new StatVo().setName("待交办").setValue(getStatValueBy(res.get("unassigned_num"), 0)));
67 77
             result.add(new StatVo().setName("已交办").setValue(getStatValueBy(res.get("assigned_num"), 0)));
68 78
             result.add(new StatVo().setName("已办结").setValue(getStatValueBy(res.get("end_num"), 0)));
69 79
         }
@@ -86,12 +96,36 @@ public class TaIssueServiceImpl extends BaseServiceImpl<TaIssueMapper, TaIssue>
86 96
 
87 97
         // 市民
88 98
         else {
89
-
99
+            Map<String, Object> res = taFeedbackMapper.statMaIndex(person.getPersonId());
100
+            result.add(new StatVo().setName("未处理").setValue(getStatValueBy(res.get("unassigned_num"), 0)));
101
+            result.add(new StatVo().setName("已处理").setValue(getStatValueBy(res.get("assigned_num"), 0) + getStatValueBy(res.get("end_num"), 0)));
102
+            result.add(new StatVo().setName("已打回").setValue(getStatValueBy(res.get("reject_num"), 0)));
90 103
         }
91 104
 
92 105
         return result;
93 106
     }
94 107
 
108
+    @Override
109
+    public void updateEnd(SysUser sysUser, String orgId, Integer issueId) {
110
+        // 问题单完成
111
+        baseMapper.updateProcess(issueId, sysUser.getUserId(), Constants.PROCESS_END, Constants.PROCESS_END);
112
+
113
+        // 机构问题单完成
114
+        taOrgIssueMapper.updateProcess(issueId, orgId, Constants.PROCESS_END);
115
+
116
+        // 流程完成
117
+        TaIssueProcess taIssueProcess = new TaIssueProcess();
118
+        taIssueProcess.setIssueId(issueId);
119
+        taIssueProcess.setOrgId(orgId);
120
+        taIssueProcess.setProcessNode(Constants.PROCESS_END);
121
+        taIssueProcess.setProcessStatus(Constants.PROCESS_END);
122
+        taIssueProcess.setCreateUser(sysUser.getUserId());
123
+        taIssueProcess.setCreateDate(LocalDateTime.now());
124
+        taIssueProcess.setStatus(Constants.STATUS_NORMAL);
125
+        taIssueProcessMapper.insert(taIssueProcess);
126
+
127
+    }
128
+
95 129
     Integer getStatValueBy(Object v, Integer def) {
96 130
         if (null == v) return def;
97 131
         return Integer.valueOf(v.toString());

+ 2
- 2
src/main/java/com/example/civilizedcity/service/impl/TaOrgIssueServiceImpl.java Просмотреть файл

@@ -40,10 +40,10 @@ public class TaOrgIssueServiceImpl extends BaseServiceImpl<TaOrgIssueMapper, TaO
40 40
     }
41 41
 
42 42
     @Override
43
-    public void createNewIssue(TaIssue taIssue, TaIssueProcess taIssueProcess, SysUser sysUser) {
43
+    public void createNewIssue(TaIssue taIssue, SysUser sysUser) {
44 44
         TaOrgIssue taOrgIssue = new TaOrgIssue();
45 45
         taOrgIssue.setIssueId(taIssue.getIssueId());
46
-        taOrgIssue.setOrgId(taIssueProcess.getOrgId());
46
+        taOrgIssue.setOrgId(taIssue.getOrgId());
47 47
         taOrgIssue.setProcessStatus(Constants.PROCESS_START);
48 48
         taOrgIssue.setStatus(Constants.STATUS_NORMAL);
49 49
         taOrgIssue.setCreateDate(LocalDateTime.now());

+ 71
- 0
src/main/java/com/example/civilizedcity/service/impl/TsStatDataServiceImpl.java Просмотреть файл

@@ -0,0 +1,71 @@
1
+package com.example.civilizedcity.service.impl;
2
+
3
+import com.example.civilizedcity.common.Constants;
4
+import com.example.civilizedcity.mapper.SysUserMapper;
5
+import com.example.civilizedcity.mapper.TaIssueMapper;
6
+import com.example.civilizedcity.vo.StatVo;
7
+import org.springframework.beans.factory.annotation.Autowired;
8
+import org.springframework.stereotype.Service;
9
+import com.example.civilizedcity.entity.TsStatData;
10
+import com.example.civilizedcity.mapper.TsStatDataMapper;
11
+import com.example.civilizedcity.service.TsStatDataService;
12
+
13
+import java.util.ArrayList;
14
+import java.util.List;
15
+import java.util.Map;
16
+
17
+/**
18
+ * 常用统计;(ts_stat_data)表服务实现类
19
+ *
20
+ * @author : http://www.chiner.pro
21
+ * @date : 2023-1-31
22
+ */
23
+@Service
24
+public class TsStatDataServiceImpl extends BaseServiceImpl<TsStatDataMapper, TsStatData> implements TsStatDataService {
25
+
26
+    @Autowired
27
+    TaIssueMapper taIssueMapper;
28
+
29
+    @Autowired
30
+    SysUserMapper sysUserMapper;
31
+
32
+    @Override
33
+    public List<StatVo> statIssue(String statType, String startDate, String endDate, Integer num) {
34
+
35
+        if (statType.contains("daily")) {
36
+            return baseMapper.statIssueDaily(startDate, endDate, num);
37
+        }
38
+
39
+        if (statType.contains("monthly")) {
40
+            return baseMapper.statIssueMonthly(startDate, endDate, num);
41
+        }
42
+
43
+        return null;
44
+    }
45
+
46
+    @Override
47
+    public List<StatVo> statIssueOrg(String orgId) {
48
+        Map<String, Object> map = taIssueMapper.statIssueOrg(orgId);
49
+        List<StatVo> res = new ArrayList<>();
50
+        res.add(new StatVo().setName("已完结").setValue(map.get("endNum")));
51
+        res.add(new StatVo().setName("处理中").setValue(map.get("assignedNum")));
52
+        res.add(new StatVo().setName("已逾期").setValue(map.get("expireNum")));
53
+        return res;
54
+    }
55
+
56
+    @Override
57
+    public List<StatVo> statIssueType() {
58
+        return taIssueMapper.statIssueType();
59
+    }
60
+
61
+    @Override
62
+    public Map<String, Object> statAdminIndexBanner() {
63
+        // 总用户数
64
+        long userNum = sysUserMapper.countAll(Constants.ROOT_ID);
65
+        // 问题单统计
66
+        Map<String, Object> result = taIssueMapper.statMaIndex(null);
67
+        result.put("user_num", userNum);
68
+
69
+        return result;
70
+    }
71
+}

+ 17
- 0
src/main/resources/application.yml Просмотреть файл

@@ -8,6 +8,22 @@ spring:
8 8
     url: jdbc:mysql://110.40.183.156:3306/civilizedcity?serverTimezone=Asia/Shanghai&useUnicode=true&characterEncoding=utf8&useSSL=false&allowPublicKeyRetrieval=true
9 9
     username: civilizedcity
10 10
     password: civilizedcity@ABCD1234
11
+    hikari:
12
+      # 最小空闲连接数
13
+      minimum-idle: 10
14
+      # 空闲连接存活最大时间, 默认 600000 - 10分钟
15
+      idle-timeout: 120000 # 2min
16
+      # 最大连接池数, 默认 10
17
+      maximum-pool-size: 30
18
+      # 连接池最长生命 0 无限期, 1800000 - 30分钟
19
+      max-lifetime: 180000 # 3min
20
+      # 连接超时 默认 30000 - 30秒
21
+      connection-timeout: 30000
22
+      connection-test-query: SELECT 1
23
+      # 连接活性检测 6000 - 1 分钟
24
+      keepalive-time: 6000
25
+
26
+
11 27
   mvc:
12 28
     pathmatch:
13 29
       matching-strategy: ANT_PATH_MATCHER
@@ -33,6 +49,7 @@ yz:
33 49
       - "/**/signin"
34 50
       - "/ma/captcha"
35 51
       - "/ma/change-password"
52
+      - "/ma/auth-phone"
36 53
 
37 54
 wx:
38 55
   miniapp:

+ 19
- 1
src/main/resources/mapper/SysUserMapper.xml Просмотреть файл

@@ -2,5 +2,23 @@
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.SysUserMapper">
5
-    
5
+
6
+    <select id="getListByPhone" resultType="com.example.civilizedcity.entity.SysUser">
7
+        SELECT
8
+            *
9
+        FROM
10
+            sys_user t
11
+        WHERE
12
+            t.phone = #{phone}
13
+          AND t.`status` &gt; -1
14
+    </select>
15
+    <select id="countAll" resultType="java.lang.Long">
16
+        SELECT
17
+            count( * )
18
+        FROM
19
+            sys_user t
20
+        WHERE
21
+            t.user_id != #{rootId}
22
+	        AND t.`status` &gt; -1
23
+    </select>
6 24
 </mapper>

+ 54
- 0
src/main/resources/mapper/TaFeedbackMapper.xml Просмотреть файл

@@ -0,0 +1,54 @@
1
+<?xml version="1.0" encoding="UTF-8"?>
2
+<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
3
+
4
+<mapper namespace="com.example.civilizedcity.mapper.TaFeedbackMapper">
5
+
6
+    <select id="countByVerifyStatus" resultType="java.lang.Long">
7
+        SELECT
8
+            count( * )
9
+        FROM
10
+            ta_feedback t
11
+        WHERE
12
+            t.person_id = #{personId}
13
+          AND t.verify_status = #{verifyStatus}
14
+          AND t.`status` &gt; -1
15
+    </select>
16
+    <select id="statMaIndex" resultType="java.util.Map">
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
22
+        FROM
23
+            ta_feedback t
24
+                JOIN ta_issue s ON t.issue_id = s.issue_id
25
+        WHERE
26
+            t.person_id = #{personId}
27
+          AND t.`status` &gt; -1
28
+    </select>
29
+    <select id="getPageBy" resultType="com.example.civilizedcity.entity.TaIssue">
30
+        SELECT
31
+            s.*
32
+        FROM
33
+            ta_feedback t
34
+                INNER JOIN ta_issue s ON t.issue_id = s.issue_id
35
+        WHERE
36
+            1 = 1
37
+          <if test="null != personId and personId != ''">
38
+              AND t.person_id = #{personId}
39
+          </if>
40
+          <if test="processList != null">
41
+              AND s.process_node IN
42
+              <foreach item="item" collection="processList" separator="," open="(" close=")">
43
+                  #{item}
44
+              </foreach>
45
+          </if>
46
+        <if test="null != verifyStatus and verifyStatus != ''">
47
+          AND t.verify_status = #{verifyStatus}
48
+        </if>
49
+          AND t.`status` &gt; -1
50
+          AND s.`status` &gt; -1
51
+        ORDER BY
52
+            t.create_date DESC
53
+    </select>
54
+</mapper>

+ 3
- 0
src/main/resources/mapper/TaIssueApplyMapper.xml Просмотреть файл

@@ -13,6 +13,9 @@
13 13
                 INNER JOIN ta_issue s ON t.issue_id = s.issue_id
14 14
         WHERE
15 15
             t.`status` &gt; -1
16
+        <if test="issueId != null">
17
+            AND t.issue_id = #{issueId}
18
+        </if>
16 19
         <if test="applyType != null and applyType != ''">
17 20
             AND t.apply_type = #{applyType}
18 21
         </if>

+ 39
- 2
src/main/resources/mapper/TaIssueMapper.xml Просмотреть файл

@@ -15,6 +15,15 @@
15 15
         WHERE
16 16
             t.issue_id = #{issueId}
17 17
     </update>
18
+    <update id="updateProcess">
19
+        UPDATE ta_issue t
20
+        SET t.process_node = #{processNode},
21
+            t.process_status = #{processStatus},
22
+            t.update_user = #{userId},
23
+            t.update_date = now( )
24
+        WHERE
25
+            t.issue_id = #{issueId}
26
+    </update>
18 27
 
19 28
     <select id="getPageBy" resultType="com.example.civilizedcity.entity.TaIssue">
20 29
         SELECT
@@ -47,11 +56,9 @@
47 56
     </select>
48 57
     <select id="statMaIndex" resultType="java.util.Map">
49 58
         SELECT
50
-            UUID_SHORT() as id,
51 59
             count(*) as published_num,
52 60
             sum(IF(t.process_node = 'start', 1, 0)) as unassigned_num,
53 61
             sum(IF(t.process_node = 'assigned', 1, 0)) as assigned_num,
54
-            sum(IF(t.process_node = 'reject', 1, 0)) as reject_num,
55 62
             sum(IF(t.process_node = 'end', 1, 0)) as end_num
56 63
         FROM
57 64
             ta_issue t
@@ -61,4 +68,34 @@
61 68
           </if>
62 69
           AND t.`status` > - 1
63 70
     </select>
71
+    <select id="statIssueOrg" resultType="java.util.Map">
72
+        SELECT
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
77
+        FROM
78
+            ta_issue t
79
+        WHERE
80
+            t.org_id = #{orgId}
81
+            AND t.`status` &gt; -1
82
+    </select>
83
+    <select id="statIssueType" resultType="com.example.civilizedcity.vo.StatVo">
84
+        SELECT
85
+            *
86
+        FROM
87
+            (
88
+                SELECT
89
+                    t.`name`,
90
+                    sum( IF ( s.issue_id IS NULL, 0, 1 ) ) AS `value`
91
+                FROM
92
+                    td_issue_type t
93
+                        LEFT JOIN ta_issue s ON s.type_id = t.type_id
94
+                        AND s.`status` &gt; - 1
95
+                GROUP BY
96
+                    t.type_id
97
+            ) a
98
+        ORDER BY
99
+            a.`value` DESC
100
+    </select>
64 101
 </mapper>

+ 8
- 2
src/main/resources/mapper/TaOrgIssueMapper.xml Просмотреть файл

@@ -2,6 +2,13 @@
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.TaOrgIssueMapper">
5
+    <update id="updateProcess">
6
+        UPDATE ta_org_issue t
7
+        SET t.process_status = #{processStatus}
8
+        WHERE
9
+            t.org_id = #{orgId}
10
+          AND t.issue_id = #{issueId}
11
+    </update>
5 12
 
6 13
     <select id="getIssuePageBy" resultType="com.example.civilizedcity.entity.TaIssue">
7 14
         SELECT
@@ -48,12 +55,11 @@
48 55
     </select>
49 56
     <select id="statMaIndex" resultType="java.util.Map">
50 57
         select
51
-            UUID_SHORT() as id,
52 58
             SUM(IF(TO_DAYS(now()) > TO_DAYS(s.expire_date), 1, 0)) as delay_num,
53 59
             SUM(s.process_node == 'end', 1, 0) as end_num,
54 60
             SUM(s.process_node != 'end', 1, 0) as doing_num
55 61
         from ta_org_issue t
56
-                 INNER JOIN ta_issue s on t.issue_id = s.issue_id
62
+                 INNER JOIN ta_issue s on t.issue_id = s.issue_id AND t.org_id = s.org_id
57 63
         where t.org_id = #{orgId}
58 64
           and t.`status` &gt; -1
59 65
           and s.`status` &gt; -1

+ 49
- 0
src/main/resources/mapper/TsStatDataMapper.xml Просмотреть файл

@@ -0,0 +1,49 @@
1
+<?xml version="1.0" encoding="UTF-8"?>
2
+<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
3
+
4
+<mapper namespace="com.example.civilizedcity.mapper.TsStatDataMapper">
5
+
6
+    <select id="statIssueDaily" resultType="com.example.civilizedcity.vo.StatVo">
7
+        SELECT
8
+            a.`name`,
9
+            IFNULL( b.`value`, 0 ) as `value`
10
+        FROM
11
+            ( SELECT DATE_ADD( #{startDate}, INTERVAL t.rownum DAY ) AS `name` FROM sequence t WHERE t.rownum &lt; #{num} ) a
12
+        LEFT JOIN (
13
+            SELECT
14
+            t.`name`,
15
+            t.`value`
16
+            FROM
17
+            ts_stat_data t
18
+            WHERE
19
+            t.stat_type = 'issue_daily'
20
+            AND t.`name` &gt;= #{startDate}
21
+            AND t.`name` &lt;= #{endDate}
22
+        ) b ON a.`name` = b.`name`
23
+        ORDER BY
24
+            a.`name` ASC
25
+    </select>
26
+    <select id="statIssueMonthly" resultType="com.example.civilizedcity.vo.StatVo">
27
+        SELECT
28
+            a.`name`,
29
+            IFNULL( b.`value`, 0 ) as `value`
30
+        FROM (
31
+            SELECT DATE_FORMAT( DATE_ADD( CONCAT( #{startDate}, '-01' ), INTERVAL t.rownum MONTH ), '%Y-%m' ) AS `name`
32
+            FROM sequence t
33
+            WHERE t.rownum &lt; #{num}
34
+        ) a
35
+        LEFT JOIN (
36
+            SELECT
37
+                t.`name`,
38
+                t.`value`
39
+            FROM
40
+                ts_stat_data t
41
+            WHERE
42
+                t.stat_type = 'issue_monthly'
43
+              AND t.`name` &gt;= #{startDate}
44
+              AND t.`name` &lt;= #{endDate}
45
+        ) b ON a.`name` = b.`name`
46
+        ORDER BY
47
+            a.`name` ASC
48
+    </select>
49
+</mapper>