Parcourir la source

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

Your Name il y a 2 ans
Parent
révision
04be26ed9a
24 fichiers modifiés avec 869 ajouts et 73 suppressions
  1. 208
    4
      db/.back_文明创办/文明创办-backup-2023129082004.pdma.json
  2. 173
    3
      db/文明创办.pdma.json
  3. 2
    1
      src/main/java/com/example/civilizedcity/common/Constants.java
  4. 48
    0
      src/main/java/com/example/civilizedcity/controller/StatController.java
  5. 62
    55
      src/main/java/com/example/civilizedcity/controller/SysUserController.java
  6. 102
    0
      src/main/java/com/example/civilizedcity/controller/TaCheckStandController.java
  7. 1
    1
      src/main/java/com/example/civilizedcity/entity/SysUserDuty.java
  8. 42
    0
      src/main/java/com/example/civilizedcity/entity/TaCheckStand.java
  9. 1
    1
      src/main/java/com/example/civilizedcity/entity/TaNotice.java
  10. 3
    0
      src/main/java/com/example/civilizedcity/mapper/SysUserDutyMapper.java
  11. 16
    0
      src/main/java/com/example/civilizedcity/mapper/TaCheckStandMapper.java
  12. 7
    1
      src/main/java/com/example/civilizedcity/mapper/TaIssueMapper.java
  13. 7
    1
      src/main/java/com/example/civilizedcity/mapper/TaOrgIssueMapper.java
  14. 13
    0
      src/main/java/com/example/civilizedcity/service/TaCheckStandService.java
  15. 7
    1
      src/main/java/com/example/civilizedcity/service/TaIssueService.java
  16. 28
    4
      src/main/java/com/example/civilizedcity/service/impl/SysUserServiceImpl.java
  17. 16
    0
      src/main/java/com/example/civilizedcity/service/impl/TaCheckStandServiceImpl.java
  18. 61
    0
      src/main/java/com/example/civilizedcity/service/impl/TaIssueServiceImpl.java
  19. 17
    0
      src/main/java/com/example/civilizedcity/vo/StatVo.java
  20. 1
    1
      src/main/resources/application.yml
  21. 20
    0
      src/main/resources/mapper/SysUserDutyMapper.xml
  22. 6
    0
      src/main/resources/mapper/TaCheckStandMapper.xml
  23. 16
    0
      src/main/resources/mapper/TaIssueMapper.xml
  24. 12
    0
      src/main/resources/mapper/TaOrgIssueMapper.xml

db/.back_文明创办/文明创办-backup-2023111150516.pdma.json → db/.back_文明创办/文明创办-backup-2023129082004.pdma.json Voir le fichier

@@ -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-11 15:04:02",
7
+  "updatedTime": "2023-1-29 08:17:44",
8 8
   "dbConns": [],
9 9
   "profile": {
10 10
     "default": {
@@ -3193,7 +3193,7 @@
3193 3193
           "id": "CC5551B8-C645-4192-9A06-E5820C6F3357"
3194 3194
         },
3195 3195
         {
3196
-          "defKey": "conent",
3196
+          "defKey": "content",
3197 3197
           "defName": "正文",
3198 3198
           "comment": "",
3199 3199
           "type": "TEXT",
@@ -6293,7 +6293,7 @@
6293 6293
         },
6294 6294
         {
6295 6295
           "defKey": "fill_unit",
6296
-          "defName": "填空单位",
6296
+          "defName": "填空单位",
6297 6297
           "comment": "",
6298 6298
           "type": "",
6299 6299
           "len": "",
@@ -8366,6 +8366,209 @@
8366 8366
       ],
8367 8367
       "correlations": [],
8368 8368
       "indexes": []
8369
+    },
8370
+    {
8371
+      "id": "38420D50-01AB-4E31-84D3-20192D26E25F",
8372
+      "env": {
8373
+        "base": {
8374
+          "nameSpace": "",
8375
+          "codeRoot": ""
8376
+        }
8377
+      },
8378
+      "defKey": "ta_check_stand",
8379
+      "defName": "测评标准",
8380
+      "comment": "",
8381
+      "properties": {},
8382
+      "nameTemplate": "{defKey}[{defName}]",
8383
+      "headers": [
8384
+        {
8385
+          "refKey": "hideInGraph",
8386
+          "hideInGraph": true
8387
+        },
8388
+        {
8389
+          "refKey": "defKey",
8390
+          "hideInGraph": false
8391
+        },
8392
+        {
8393
+          "refKey": "defName",
8394
+          "hideInGraph": false
8395
+        },
8396
+        {
8397
+          "refKey": "primaryKey",
8398
+          "hideInGraph": false
8399
+        },
8400
+        {
8401
+          "refKey": "notNull",
8402
+          "hideInGraph": true
8403
+        },
8404
+        {
8405
+          "refKey": "autoIncrement",
8406
+          "hideInGraph": true
8407
+        },
8408
+        {
8409
+          "refKey": "domain",
8410
+          "hideInGraph": true
8411
+        },
8412
+        {
8413
+          "refKey": "type",
8414
+          "hideInGraph": false
8415
+        },
8416
+        {
8417
+          "refKey": "len",
8418
+          "hideInGraph": false
8419
+        },
8420
+        {
8421
+          "refKey": "scale",
8422
+          "hideInGraph": false
8423
+        },
8424
+        {
8425
+          "refKey": "comment",
8426
+          "hideInGraph": true
8427
+        },
8428
+        {
8429
+          "refKey": "refDict",
8430
+          "hideInGraph": true
8431
+        },
8432
+        {
8433
+          "refKey": "defaultValue",
8434
+          "hideInGraph": true
8435
+        },
8436
+        {
8437
+          "refKey": "isStandard",
8438
+          "hideInGraph": false
8439
+        },
8440
+        {
8441
+          "refKey": "uiHint",
8442
+          "hideInGraph": true
8443
+        },
8444
+        {
8445
+          "refKey": "extProps",
8446
+          "hideInGraph": true
8447
+        }
8448
+      ],
8449
+      "fields": [
8450
+        {
8451
+          "defKey": "id",
8452
+          "defName": "ID",
8453
+          "comment": "",
8454
+          "type": "",
8455
+          "len": 32,
8456
+          "scale": "",
8457
+          "primaryKey": true,
8458
+          "notNull": true,
8459
+          "autoIncrement": false,
8460
+          "defaultValue": "",
8461
+          "hideInGraph": true,
8462
+          "domain": "16120F75-6AA7-4483-868D-F07F511BB081",
8463
+          "refDict": "",
8464
+          "uiHint": "",
8465
+          "id": "219A66C3-6D3F-4F1E-A572-9E5294556142"
8466
+        },
8467
+        {
8468
+          "defKey": "org_id",
8469
+          "defName": "机构ID",
8470
+          "comment": "",
8471
+          "type": "",
8472
+          "len": "",
8473
+          "scale": "",
8474
+          "primaryKey": false,
8475
+          "notNull": false,
8476
+          "autoIncrement": false,
8477
+          "defaultValue": "",
8478
+          "hideInGraph": false,
8479
+          "refDict": "",
8480
+          "domain": "16120F75-6AA7-4483-868D-F07F511BB081",
8481
+          "id": "30776463-B5E8-44DB-B5B6-45817A48E59F",
8482
+          "uiHint": ""
8483
+        },
8484
+        {
8485
+          "defKey": "status",
8486
+          "defName": "状态",
8487
+          "comment": "",
8488
+          "domain": "6BC8F04B-6CFA-4995-98D3-318F5CDD774E",
8489
+          "type": "",
8490
+          "len": "",
8491
+          "scale": "",
8492
+          "primaryKey": false,
8493
+          "notNull": false,
8494
+          "autoIncrement": false,
8495
+          "defaultValue": "1",
8496
+          "hideInGraph": true,
8497
+          "refDict": "",
8498
+          "uiHint": "",
8499
+          "id": "20019E0F-5BA3-4E82-B296-5E31564BCAED"
8500
+        },
8501
+        {
8502
+          "defKey": "create_user",
8503
+          "defName": "创建人",
8504
+          "comment": "",
8505
+          "domain": "16120F75-6AA7-4483-868D-F07F511BB081",
8506
+          "type": "",
8507
+          "len": "",
8508
+          "scale": "",
8509
+          "primaryKey": false,
8510
+          "notNull": false,
8511
+          "autoIncrement": false,
8512
+          "defaultValue": "",
8513
+          "hideInGraph": true,
8514
+          "refDict": "",
8515
+          "uiHint": "",
8516
+          "id": "2F888196-3939-4DB3-8C53-CB615790D436"
8517
+        },
8518
+        {
8519
+          "defKey": "create_date",
8520
+          "defName": "创建时间",
8521
+          "comment": "",
8522
+          "domain": "7CFFA0D3-6A93-4DDC-BC10-DF21211064DC",
8523
+          "type": "",
8524
+          "len": "",
8525
+          "scale": "",
8526
+          "primaryKey": false,
8527
+          "notNull": false,
8528
+          "autoIncrement": false,
8529
+          "defaultValue": "CURRENT_TIMESTAMP",
8530
+          "hideInGraph": true,
8531
+          "refDict": "",
8532
+          "uiHint": "",
8533
+          "id": "DED8CFDE-66A8-4460-A94A-2AAA1D169C5D"
8534
+        },
8535
+        {
8536
+          "defKey": "update_user",
8537
+          "defName": "更新人",
8538
+          "comment": "",
8539
+          "domain": "16120F75-6AA7-4483-868D-F07F511BB081",
8540
+          "type": "",
8541
+          "len": 32,
8542
+          "scale": "",
8543
+          "primaryKey": false,
8544
+          "notNull": false,
8545
+          "autoIncrement": false,
8546
+          "defaultValue": "",
8547
+          "hideInGraph": true,
8548
+          "refDict": "",
8549
+          "uiHint": "",
8550
+          "id": "06EC3E88-DE3F-43F9-A155-D2454F4D8C4E"
8551
+        },
8552
+        {
8553
+          "defKey": "update_date",
8554
+          "defName": "更新时间",
8555
+          "comment": "",
8556
+          "domain": "7CFFA0D3-6A93-4DDC-BC10-DF21211064DC",
8557
+          "type": "",
8558
+          "len": "",
8559
+          "scale": "",
8560
+          "primaryKey": false,
8561
+          "notNull": false,
8562
+          "autoIncrement": false,
8563
+          "defaultValue": "",
8564
+          "hideInGraph": true,
8565
+          "refDict": "",
8566
+          "uiHint": "",
8567
+          "id": "4C2C2D21-B0E0-4279-AD8B-F7359B17B7AB"
8568
+        }
8569
+      ],
8570
+      "correlations": [],
8571
+      "indexes": []
8369 8572
     }
8370 8573
   ],
8371 8574
   "views": [],
@@ -8794,7 +8997,8 @@
8794 8997
         "B20E272F-91EB-4BAC-AAD6-AF99D517E44D",
8795 8998
         "EF3D4E17-6CE0-4944-B1DC-40280B2B689F",
8796 8999
         "5BEE62BD-F04C-49E8-A65A-32A11B093E7B",
8797
-        "430EE745-314D-48CE-A20B-ED2C4D79BC92"
9000
+        "430EE745-314D-48CE-A20B-ED2C4D79BC92",
9001
+        "38420D50-01AB-4E31-84D3-20192D26E25F"
8798 9002
       ],
8799 9003
       "refViews": [],
8800 9004
       "refDiagrams": [],

+ 173
- 3
db/文明创办.pdma.json Voir le fichier

@@ -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-11 15:05:16",
7
+  "updatedTime": "2023-1-29 08:20:04",
8 8
   "dbConns": [],
9 9
   "profile": {
10 10
     "default": {
@@ -3194,7 +3194,7 @@
3194 3194
           "id": "CC5551B8-C645-4192-9A06-E5820C6F3357"
3195 3195
         },
3196 3196
         {
3197
-          "defKey": "conent",
3197
+          "defKey": "content",
3198 3198
           "defName": "正文",
3199 3199
           "comment": "",
3200 3200
           "type": "TEXT",
@@ -8367,6 +8367,175 @@
8367 8367
       ],
8368 8368
       "correlations": [],
8369 8369
       "indexes": []
8370
+    },
8371
+    {
8372
+      "id": "38420D50-01AB-4E31-84D3-20192D26E25F",
8373
+      "env": {
8374
+        "base": {
8375
+          "nameSpace": "",
8376
+          "codeRoot": ""
8377
+        }
8378
+      },
8379
+      "defKey": "ta_check_stand",
8380
+      "defName": "测评标准",
8381
+      "comment": "",
8382
+      "properties": {},
8383
+      "nameTemplate": "{defKey}[{defName}]",
8384
+      "headers": [
8385
+        {
8386
+          "refKey": "hideInGraph",
8387
+          "hideInGraph": true
8388
+        },
8389
+        {
8390
+          "refKey": "defKey",
8391
+          "hideInGraph": false
8392
+        },
8393
+        {
8394
+          "refKey": "defName",
8395
+          "hideInGraph": false
8396
+        },
8397
+        {
8398
+          "refKey": "primaryKey",
8399
+          "hideInGraph": false
8400
+        },
8401
+        {
8402
+          "refKey": "notNull",
8403
+          "hideInGraph": true
8404
+        },
8405
+        {
8406
+          "refKey": "autoIncrement",
8407
+          "hideInGraph": true
8408
+        },
8409
+        {
8410
+          "refKey": "domain",
8411
+          "hideInGraph": true
8412
+        },
8413
+        {
8414
+          "refKey": "type",
8415
+          "hideInGraph": false
8416
+        },
8417
+        {
8418
+          "refKey": "len",
8419
+          "hideInGraph": false
8420
+        },
8421
+        {
8422
+          "refKey": "scale",
8423
+          "hideInGraph": false
8424
+        },
8425
+        {
8426
+          "refKey": "comment",
8427
+          "hideInGraph": true
8428
+        },
8429
+        {
8430
+          "refKey": "refDict",
8431
+          "hideInGraph": true
8432
+        },
8433
+        {
8434
+          "refKey": "defaultValue",
8435
+          "hideInGraph": true
8436
+        },
8437
+        {
8438
+          "refKey": "isStandard",
8439
+          "hideInGraph": false
8440
+        },
8441
+        {
8442
+          "refKey": "uiHint",
8443
+          "hideInGraph": true
8444
+        },
8445
+        {
8446
+          "refKey": "extProps",
8447
+          "hideInGraph": true
8448
+        }
8449
+      ],
8450
+      "fields": [
8451
+        {
8452
+          "defKey": "statnd_id",
8453
+          "defName": "标准ID",
8454
+          "comment": "",
8455
+          "type": "",
8456
+          "len": 32,
8457
+          "scale": "",
8458
+          "primaryKey": true,
8459
+          "notNull": true,
8460
+          "autoIncrement": false,
8461
+          "defaultValue": "",
8462
+          "hideInGraph": true,
8463
+          "domain": "16120F75-6AA7-4483-868D-F07F511BB081",
8464
+          "refDict": "",
8465
+          "uiHint": "",
8466
+          "id": "219A66C3-6D3F-4F1E-A572-9E5294556142"
8467
+        },
8468
+        {
8469
+          "defKey": "content",
8470
+          "defName": "测评标准",
8471
+          "comment": "",
8472
+          "type": "TEXT",
8473
+          "len": 0,
8474
+          "scale": "",
8475
+          "primaryKey": false,
8476
+          "notNull": false,
8477
+          "autoIncrement": false,
8478
+          "defaultValue": "",
8479
+          "hideInGraph": false,
8480
+          "refDict": "",
8481
+          "domain": "",
8482
+          "id": "30776463-B5E8-44DB-B5B6-45817A48E59F",
8483
+          "uiHint": ""
8484
+        },
8485
+        {
8486
+          "defKey": "status",
8487
+          "defName": "状态",
8488
+          "comment": "",
8489
+          "domain": "6BC8F04B-6CFA-4995-98D3-318F5CDD774E",
8490
+          "type": "",
8491
+          "len": "",
8492
+          "scale": "",
8493
+          "primaryKey": false,
8494
+          "notNull": false,
8495
+          "autoIncrement": false,
8496
+          "defaultValue": "1",
8497
+          "hideInGraph": true,
8498
+          "refDict": "",
8499
+          "uiHint": "",
8500
+          "id": "20019E0F-5BA3-4E82-B296-5E31564BCAED"
8501
+        },
8502
+        {
8503
+          "defKey": "create_user",
8504
+          "defName": "创建人",
8505
+          "comment": "",
8506
+          "domain": "16120F75-6AA7-4483-868D-F07F511BB081",
8507
+          "type": "",
8508
+          "len": "",
8509
+          "scale": "",
8510
+          "primaryKey": false,
8511
+          "notNull": false,
8512
+          "autoIncrement": false,
8513
+          "defaultValue": "",
8514
+          "hideInGraph": true,
8515
+          "refDict": "",
8516
+          "uiHint": "",
8517
+          "id": "2F888196-3939-4DB3-8C53-CB615790D436"
8518
+        },
8519
+        {
8520
+          "defKey": "create_date",
8521
+          "defName": "创建时间",
8522
+          "comment": "",
8523
+          "domain": "7CFFA0D3-6A93-4DDC-BC10-DF21211064DC",
8524
+          "type": "",
8525
+          "len": "",
8526
+          "scale": "",
8527
+          "primaryKey": false,
8528
+          "notNull": false,
8529
+          "autoIncrement": false,
8530
+          "defaultValue": "CURRENT_TIMESTAMP",
8531
+          "hideInGraph": true,
8532
+          "refDict": "",
8533
+          "uiHint": "",
8534
+          "id": "DED8CFDE-66A8-4460-A94A-2AAA1D169C5D"
8535
+        }
8536
+      ],
8537
+      "correlations": [],
8538
+      "indexes": []
8370 8539
     }
8371 8540
   ],
8372 8541
   "views": [],
@@ -8795,7 +8964,8 @@
8795 8964
         "B20E272F-91EB-4BAC-AAD6-AF99D517E44D",
8796 8965
         "EF3D4E17-6CE0-4944-B1DC-40280B2B689F",
8797 8966
         "5BEE62BD-F04C-49E8-A65A-32A11B093E7B",
8798
-        "430EE745-314D-48CE-A20B-ED2C4D79BC92"
8967
+        "430EE745-314D-48CE-A20B-ED2C4D79BC92",
8968
+        "38420D50-01AB-4E31-84D3-20192D26E25F"
8799 8969
       ],
8800 8970
       "refViews": [],
8801 8971
       "refDiagrams": [],

+ 2
- 1
src/main/java/com/example/civilizedcity/common/Constants.java Voir le fichier

@@ -57,7 +57,8 @@ public class Constants {
57 57
 
58 58
     // 流程起始: 待交办
59 59
     public final static String PROCESS_START = "start";
60
-    public final static String PROCESS_RESTART = "restart";
60
+    // 流程: 被打回 - 市民提交
61
+    public final static String PROCESS_REJECT = "reject";
61 62
 
62 63
     // 审核
63 64
     public final static String PROCESS_VERIFY = "verify";

+ 48
- 0
src/main/java/com/example/civilizedcity/controller/StatController.java Voir le fichier

@@ -0,0 +1,48 @@
1
+package com.example.civilizedcity.controller;
2
+
3
+import com.example.civilizedcity.common.BaseController;
4
+import com.example.civilizedcity.common.ResponseBean;
5
+import com.example.civilizedcity.entity.SysUser;
6
+import com.example.civilizedcity.entity.TaPerson;
7
+import com.example.civilizedcity.service.TaIssueService;
8
+import com.example.civilizedcity.vo.StatVo;
9
+import io.swagger.annotations.ApiOperation;
10
+import io.swagger.annotations.ApiParam;
11
+import org.springframework.beans.factory.annotation.Autowired;
12
+import org.springframework.web.bind.annotation.GetMapping;
13
+import org.springframework.web.bind.annotation.RequestParam;
14
+import org.springframework.web.bind.annotation.RestController;
15
+
16
+import java.util.List;
17
+
18
+/**
19
+ * 查询统计
20
+ */
21
+@RestController
22
+public class StatController extends BaseController {
23
+
24
+    @Autowired
25
+    TaIssueService taIssueService;
26
+
27
+    @ApiOperation("小程序首页查询统计")
28
+    @GetMapping("/ma/index-stat")
29
+    public ResponseBean getMaIndex(@ApiParam("身份") @RequestParam(value = "duty", required = false) String duty) throws Exception {
30
+        SysUser user = null;
31
+        TaPerson person = null;
32
+
33
+        try {
34
+            user = currentUser();
35
+        } catch (Exception e) {
36
+            //
37
+        }
38
+        try {
39
+            person = currentPerson();
40
+        } catch (Exception e) {
41
+            //
42
+        }
43
+
44
+        List<StatVo> result = taIssueService.statMaIndex(user, duty);
45
+
46
+        return ResponseBean.success(result);
47
+    }
48
+}

+ 62
- 55
src/main/java/com/example/civilizedcity/controller/SysUserController.java Voir le fichier

@@ -16,6 +16,7 @@ import com.example.civilizedcity.entity.SysResource;
16 16
 import com.example.civilizedcity.entity.SysRole;
17 17
 import com.example.civilizedcity.service.SysResourceService;
18 18
 import com.example.civilizedcity.service.SysRoleService;
19
+import com.example.civilizedcity.service.SysUserDutyService;
19 20
 import io.swagger.annotations.Api;
20 21
 import io.swagger.annotations.ApiOperation;
21 22
 import io.swagger.annotations.ApiParam;
@@ -24,8 +25,9 @@ import org.springframework.web.bind.annotation.*;
24 25
 import com.example.civilizedcity.entity.SysUser;
25 26
 import com.example.civilizedcity.service.SysUserService;
26 27
 
27
- /**
28
+/**
28 29
  * 用户表;(sys_user)表控制层
30
+ *
29 31
  * @author : http://njyunzhi.com
30 32
  * @date : 2022-12-12
31 33
  */
@@ -35,13 +37,16 @@ import com.example.civilizedcity.service.SysUserService;
35 37
 public class SysUserController extends BaseController {
36 38
 
37 39
     @Autowired
38
-     SysRoleService sysRoleService;
40
+    SysRoleService sysRoleService;
39 41
 
40 42
     @Autowired
41
-     SysResourceService sysResourceService;
43
+    SysResourceService sysResourceService;
42 44
 
43
-    /** 
44
-     * 通过ID查询单条数据 
45
+    @Autowired
46
+    SysUserDutyService sysUserDutyService;
47
+
48
+    /**
49
+     * 通过ID查询单条数据
45 50
      *
46 51
      * @param userId 主键
47 52
      * @return 实例对象
@@ -57,33 +62,35 @@ public class SysUserController extends BaseController {
57 62
         return ResponseBean.success(getPermissions(sysUser));
58 63
     }
59 64
 
60
-     /**
61
-      * 查询当前人员
62
-      *
63
-      * @param
64
-      * @return 实例对象
65
-      */
66
-     @ApiOperation("查询当前人员")
67
-     @GetMapping("/sysUser/current")
68
-     public ResponseBean current() throws Exception {
69
-         SysUser sysUser = currentUser();
70
-         return ResponseBean.success(getPermissions(sysUser));
71
-     }
72
-
73
-     private SysUser getPermissions(SysUser sysUser) {
74
-         List<SysRole> rolesList = sysRoleService.getByUser(sysUser.getUserId());
75
-         List<SysResource> resourcesList = sysResourceService.getByUser(sysUser.getUserId());
76
-
77
-         sysUser.setRolesList(rolesList);
78
-         sysUser.setResourcesList(resourcesList);
79
-
80
-         return sysUser;
81
-     }
82
-    
83
-    /** 
65
+    /**
66
+     * 查询当前人员
67
+     *
68
+     * @param
69
+     * @return 实例对象
70
+     */
71
+    @ApiOperation("查询当前人员")
72
+    @GetMapping("/sysUser/current")
73
+    public ResponseBean current() throws Exception {
74
+        SysUser sysUser = currentUser();
75
+        return ResponseBean.success(getPermissions(sysUser));
76
+    }
77
+
78
+    private SysUser getPermissions(SysUser sysUser) {
79
+        List<SysRole> rolesList = sysRoleService.getByUser(sysUser.getUserId());
80
+        List<SysResource> resourcesList = sysResourceService.getByUser(sysUser.getUserId());
81
+        List<String> dutyList = sysUserDutyService.getListByUser(sysUser.getUserId());
82
+
83
+        sysUser.setRolesList(rolesList);
84
+        sysUser.setResourcesList(resourcesList);
85
+        sysUser.setDutyList(dutyList);
86
+
87
+        return sysUser;
88
+    }
89
+
90
+    /**
84 91
      * 分页查询
85 92
      *
86
-     * @param pageNum 当前页码
93
+     * @param pageNum  当前页码
87 94
      * @param pageSize 每页条数
88 95
      * @return 查询结果
89 96
      */
@@ -94,7 +101,7 @@ public class SysUserController extends BaseController {
94 101
                              @ApiParam("姓名") @RequestParam(value = "name", required = false) String name,
95 102
                              @ApiParam("机构") @RequestParam(value = "orgId", required = false) String orgId,
96 103
                              @ApiParam("手机号") @RequestParam(value = "phone", required = false) String phone) throws Exception {
97
-        
104
+
98 105
         IPage<SysUser> pg = new Page<>(pageNum, pageSize);
99 106
         QueryWrapper<SysUser> queryWrapper = new QueryWrapper<>();
100 107
         queryWrapper.like(!StringUtils.isEmpty(name), "name", name);
@@ -104,11 +111,11 @@ public class SysUserController extends BaseController {
104 111
         queryWrapper.ne("user_id", Constants.ROOT_ID);
105 112
         queryWrapper.orderByDesc("create_date");
106 113
         IPage<SysUser> result = sysUserService.page(pg, queryWrapper);
107
-        
114
+
108 115
         return ResponseBean.success(result);
109 116
     }
110
-    
111
-    /** 
117
+
118
+    /**
112 119
      * 新增数据
113 120
      *
114 121
      * @param sysUser 实例对象
@@ -125,24 +132,24 @@ public class SysUserController extends BaseController {
125 132
         return ResponseBean.success(sysUser);
126 133
     }
127 134
 
128
-     /**
129
-      * 更新数据
130
-      *
131
-      * @param id 实例ID
132
-      * @return 实例对象
133
-      */
134
-     @ApiOperation("更新数据")
135
-     @PutMapping("/sysUser/{id}/status")
136
-     public ResponseBean edit(@ApiParam("对象ID") @PathVariable String id,
137
-                              @ApiParam("页码") @RequestParam(value = "status") Integer status) throws Exception {
138
-
139
-         SysUser sysUser = sysUserService.getById(id);
140
-         sysUser.setStatus(status);
141
-
142
-         sysUserService.updateById(sysUser);
143
-         return ResponseBean.success(sysUser);
144
-     }
145
-    
135
+    /**
136
+     * 更新数据
137
+     *
138
+     * @param id 实例ID
139
+     * @return 实例对象
140
+     */
141
+    @ApiOperation("更新数据")
142
+    @PutMapping("/sysUser/{id}/status")
143
+    public ResponseBean edit(@ApiParam("对象ID") @PathVariable String id,
144
+                             @ApiParam("页码") @RequestParam(value = "status") Integer status) throws Exception {
145
+
146
+        SysUser sysUser = sysUserService.getById(id);
147
+        sysUser.setStatus(status);
148
+
149
+        sysUserService.updateById(sysUser);
150
+        return ResponseBean.success(sysUser);
151
+    }
152
+
146 153
 //    /**
147 154
 //     * 更新数据
148 155
 //     *
@@ -156,8 +163,8 @@ public class SysUserController extends BaseController {
156 163
 //        sysUserService.updateById(sysUser);
157 164
 //        return ResponseBean.success(sysUser);
158 165
 //    }
159
-    
160
-    /** 
166
+
167
+    /**
161 168
      * 通过主键删除数据
162 169
      *
163 170
      * @param userId 主键
@@ -165,7 +172,7 @@ public class SysUserController extends BaseController {
165 172
      */
166 173
     @ApiOperation("通过主键删除数据")
167 174
     @DeleteMapping("/sysUser/{id}")
168
-    public ResponseBean deleteById(@ApiParam("对象ID") @PathVariable String id){
175
+    public ResponseBean deleteById(@ApiParam("对象ID") @PathVariable String id) {
169 176
         sysUserService.removeLogicById(id);
170 177
         return ResponseBean.success("success");
171 178
     }

+ 102
- 0
src/main/java/com/example/civilizedcity/controller/TaCheckStandController.java Voir le fichier

@@ -0,0 +1,102 @@
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.ResponseBean;
8
+import java.util.List;
9
+import io.swagger.annotations.Api;
10
+import io.swagger.annotations.ApiOperation;
11
+import io.swagger.annotations.ApiParam;
12
+import org.springframework.beans.factory.annotation.Autowired;
13
+import org.springframework.web.bind.annotation.*;
14
+import com.example.civilizedcity.entity.TaCheckStand;
15
+import com.example.civilizedcity.service.TaCheckStandService;
16
+
17
+ /**
18
+ * 测评标准;(ta_check_stand)表控制层
19
+ * @author : http://njyunzhi.com
20
+ * @date : 2023-1-29
21
+ */
22
+@Api(tags = "测评标准对象功能接口")
23
+@RestController
24
+@RequestMapping("/")
25
+public class TaCheckStandController extends BaseController {
26
+    
27
+    @Autowired
28
+    private TaCheckStandService taCheckStandService;
29
+    
30
+    /** 
31
+     * 通过ID查询单条数据 
32
+     *
33
+     * @param statndId 主键
34
+     * @return 实例对象
35
+     */
36
+    @ApiOperation("通过ID查询单条数据")
37
+    @GetMapping("/taCheckStand/{id}")
38
+    public ResponseBean queryById(@ApiParam("对象ID") @PathVariable String id) throws Exception {
39
+        return ResponseBean.success(taCheckStandService.getById(id));
40
+    }
41
+    
42
+//    /**
43
+//     * 分页查询
44
+//     *
45
+//     * @param pageNum 当前页码
46
+//     * @param pageSize 每页条数
47
+//     * @return 查询结果
48
+//     */
49
+//    @ApiOperation("分页查询")
50
+//    @GetMapping("/taCheckStand")
51
+//    public ResponseBean list(@ApiParam("页码") @RequestParam(value ="pageNum",defaultValue = "1") Integer pageNum,
52
+//                            @ApiParam("单页数据量") @RequestParam(value ="pageSize",defaultValue = "10") Integer pageSize) throws Exception {
53
+//
54
+//        IPage<TaCheckStand> pg = new Page<>(pageNum, pageSize);
55
+//        // QueryWrapper<TaCheckStand> queryWrapper = new QueryWrapper<>();
56
+//        // queryWrapper.orderByDesc("create_date");
57
+//        IPage<TaCheckStand> result = taCheckStandService.page(pg);
58
+//
59
+//        return ResponseBean.success(result);
60
+//    }
61
+//
62
+//    /**
63
+//     * 新增数据
64
+//     *
65
+//     * @param taCheckStand 实例对象
66
+//     * @return 实例对象
67
+//     */
68
+//    @ApiOperation("新增数据")
69
+//    @PostMapping("/taCheckStand")
70
+//    public ResponseBean add(@ApiParam("对象实体") @RequestBody TaCheckStand taCheckStand) throws Exception {
71
+//        taCheckStandService.save(taCheckStand);
72
+//        return ResponseBean.success(taCheckStand);
73
+//    }
74
+    
75
+    /** 
76
+     * 更新数据
77
+     *
78
+     * @param taCheckStand 实例对象
79
+     * @return 实例对象
80
+     */
81
+    @ApiOperation("更新数据")
82
+    @PutMapping("/taCheckStand/{id}")
83
+    public ResponseBean edit(@ApiParam("对象实体") @RequestBody TaCheckStand taCheckStand,
84
+                            @ApiParam("对象ID") @PathVariable String id ) throws Exception {
85
+        taCheckStand.setStatndId(id);
86
+        taCheckStandService.updateById(taCheckStand);
87
+        return ResponseBean.success(taCheckStand);
88
+    }
89
+//
90
+//    /**
91
+//     * 通过主键删除数据
92
+//     *
93
+//     * @param statndId 主键
94
+//     * @return 是否成功
95
+//     */
96
+//    @ApiOperation("通过主键删除数据")
97
+//    @DeleteMapping("/taCheckStand/{id}")
98
+//    public ResponseBean deleteById(@ApiParam("对象ID") @PathVariable String id){
99
+//        taCheckStandService.removeLogicById(id);
100
+//        return ResponseBean.success("success");
101
+//    }
102
+}

+ 1
- 1
src/main/java/com/example/civilizedcity/entity/SysUserDuty.java Voir le fichier

@@ -25,7 +25,7 @@ public class SysUserDuty implements Serializable,Cloneable{
25 25
      /** 用户ID */
26 26
      @ApiModelProperty(name = "ID",notes = "")
27 27
      @TableId(value = "id", type = IdType.AUTO)
28
-     private String id ;
28
+     private Integer id ;
29 29
     /** 用户ID */
30 30
     @ApiModelProperty(name = "用户ID",notes = "")
31 31
     private String userId ;

+ 42
- 0
src/main/java/com/example/civilizedcity/entity/TaCheckStand.java Voir le fichier

@@ -0,0 +1,42 @@
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-29
18
+ */
19
+@Data
20
+@EqualsAndHashCode(callSuper = false)
21
+@Accessors(chain = true)
22
+@ApiModel(value = "测评标准",description = "")
23
+@TableName("ta_check_stand")
24
+public class TaCheckStand implements Serializable,Cloneable{
25
+    /** 标准ID */
26
+    @ApiModelProperty(name = "标准ID",notes = "")
27
+    @TableId(value = "statnd_id", type = IdType.ASSIGN_UUID)
28
+    private String statndId ;
29
+    /** 测评标准 */
30
+    @ApiModelProperty(name = "测评标准",notes = "")
31
+    private String content ;
32
+    /** 状态 */
33
+    @ApiModelProperty(name = "状态",notes = "")
34
+    private Integer status ;
35
+    /** 创建人 */
36
+    @ApiModelProperty(name = "创建人",notes = "")
37
+    private String createUser ;
38
+    /** 创建时间 */
39
+    @ApiModelProperty(name = "创建时间",notes = "")
40
+    private LocalDateTime createDate ;
41
+
42
+}

+ 1
- 1
src/main/java/com/example/civilizedcity/entity/TaNotice.java Voir le fichier

@@ -32,7 +32,7 @@ public class TaNotice implements Serializable,Cloneable{
32 32
     private String title ;
33 33
     /** 正文 */
34 34
     @ApiModelProperty(name = "正文",notes = "")
35
-    private String conent ;
35
+    private String content ;
36 36
     /** 缩略图 */
37 37
     @ApiModelProperty(name = "缩略图",notes = "")
38 38
     private String thumb ;

+ 3
- 0
src/main/java/com/example/civilizedcity/mapper/SysUserDutyMapper.java Voir le fichier

@@ -17,4 +17,7 @@ public interface SysUserDutyMapper  extends BaseMapper<SysUserDuty>{
17 17
 
18 18
      List<String> getListByUser(@Param("userId") String userId);
19 19
 
20
+    SysUserDuty getByUserAndDuty(@Param("userId") String userId, @Param("duty") String duty);
21
+
22
+    int deleteNotIn(@Param("userId") String userId, @Param("idList") List<Integer> idList);
20 23
 }

+ 16
- 0
src/main/java/com/example/civilizedcity/mapper/TaCheckStandMapper.java Voir le fichier

@@ -0,0 +1,16 @@
1
+package com.example.civilizedcity.mapper;
2
+
3
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
4
+import org.apache.ibatis.annotations.Mapper;
5
+import org.apache.ibatis.annotations.Param;
6
+import com.example.civilizedcity.entity.TaCheckStand;
7
+
8
+ /**
9
+ * 测评标准;(ta_check_stand)表数据库访问层
10
+ * @author : http://njyunzhi.com
11
+ * @date : 2023-1-29
12
+ */
13
+@Mapper
14
+public interface TaCheckStandMapper  extends BaseMapper<TaCheckStand>{
15
+    
16
+}

+ 7
- 1
src/main/java/com/example/civilizedcity/mapper/TaIssueMapper.java Voir le fichier

@@ -2,11 +2,14 @@ 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 6
 import org.apache.ibatis.annotations.Mapper;
6 7
 import org.apache.ibatis.annotations.Param;
7 8
 import com.example.civilizedcity.entity.TaIssue;
8 9
 
9
- /**
10
+import java.util.Map;
11
+
12
+/**
10 13
  * 问题表;(ta_issue)表数据库访问层
11 14
  * @author : http://njyunzhi.com
12 15
  * @date : 2022-12-12
@@ -23,4 +26,7 @@ public interface TaIssueMapper  extends BaseMapper<TaIssue>{
23 26
                      @Param("applyId") Integer applyId);
24 27
 
25 28
      int updateValidateStatus(@Param("issueId") Integer issueId, @Param("validateStatus") int validateStatus);
29
+
30
+     @MapKey("id")
31
+     Map<String, Object> statMaIndex(@Param("userId") String userId);
26 32
  }

+ 7
- 1
src/main/java/com/example/civilizedcity/mapper/TaOrgIssueMapper.java Voir le fichier

@@ -3,11 +3,14 @@ package com.example.civilizedcity.mapper;
3 3
 import com.baomidou.mybatisplus.core.mapper.BaseMapper;
4 4
 import com.baomidou.mybatisplus.core.metadata.IPage;
5 5
 import com.example.civilizedcity.entity.TaIssue;
6
+import org.apache.ibatis.annotations.MapKey;
6 7
 import org.apache.ibatis.annotations.Mapper;
7 8
 import org.apache.ibatis.annotations.Param;
8 9
 import com.example.civilizedcity.entity.TaOrgIssue;
9 10
 
10
- /**
11
+import java.util.Map;
12
+
13
+/**
11 14
  * 单位问题单;(ta_org_issue)表数据库访问层
12 15
  * @author : http://njyunzhi.com
13 16
  * @date : 2022-12-28
@@ -23,4 +26,7 @@ public interface TaOrgIssueMapper  extends BaseMapper<TaOrgIssue>{
23 26
      );
24 27
 
25 28
      TaOrgIssue getByIssueAndOrg(@Param("issueId") Integer issueId, @Param("orgId") String orgId);
29
+
30
+     @MapKey("id")
31
+     Map<String, Object> statMaIndex(@Param("orgId") String orgId);
26 32
  }

+ 13
- 0
src/main/java/com/example/civilizedcity/service/TaCheckStandService.java Voir le fichier

@@ -0,0 +1,13 @@
1
+package com.example.civilizedcity.service;
2
+
3
+import com.baomidou.mybatisplus.extension.service.IService;
4
+import com.example.civilizedcity.entity.TaCheckStand;
5
+
6
+ /**
7
+ * 测评标准;(ta_check_stand)表服务接口
8
+ * @author : http://njyunzhi.com
9
+ * @date : 2023-1-29
10
+ */
11
+public interface TaCheckStandService extends IBaseService<TaCheckStand> {
12
+    
13
+}

+ 7
- 1
src/main/java/com/example/civilizedcity/service/TaIssueService.java Voir le fichier

@@ -2,9 +2,13 @@ package com.example.civilizedcity.service;
2 2
 
3 3
 import com.baomidou.mybatisplus.core.metadata.IPage;
4 4
 import com.baomidou.mybatisplus.extension.service.IService;
5
+import com.example.civilizedcity.entity.SysUser;
5 6
 import com.example.civilizedcity.entity.TaIssue;
7
+import com.example.civilizedcity.vo.StatVo;
6 8
 
7
- /**
9
+import java.util.List;
10
+
11
+/**
8 12
  * 问题表;(ta_issue)表服务接口
9 13
  * @author : http://njyunzhi.com
10 14
  * @date : 2022-12-12
@@ -16,4 +20,6 @@ public interface TaIssueService extends IBaseService<TaIssue> {
16 20
      void updateValidateStatus(Integer issueId, int validateStatus);
17 21
 
18 22
      void updateApply(Integer issueId, String applyType, Integer applyId);
23
+
24
+     List<StatVo> statMaIndex(SysUser user, String duty);
19 25
  }

+ 28
- 4
src/main/java/com/example/civilizedcity/service/impl/SysUserServiceImpl.java Voir le fichier

@@ -3,9 +3,7 @@ package com.example.civilizedcity.service.impl;
3 3
 import com.example.civilizedcity.common.Constants;
4 4
 import com.example.civilizedcity.common.EncryptUtils;
5 5
 import com.example.civilizedcity.common.StringUtils;
6
-import com.example.civilizedcity.entity.SysLogin;
7
-import com.example.civilizedcity.entity.SysRole;
8
-import com.example.civilizedcity.entity.SysUserRole;
6
+import com.example.civilizedcity.entity.*;
9 7
 import com.example.civilizedcity.mapper.SysLoginMapper;
10 8
 import com.example.civilizedcity.mapper.SysUserDutyMapper;
11 9
 import com.example.civilizedcity.mapper.SysUserRoleMapper;
@@ -13,7 +11,6 @@ import com.example.civilizedcity.vo.ChangePassword;
13 11
 import com.example.civilizedcity.vo.LoginParam;
14 12
 import org.springframework.beans.factory.annotation.Autowired;
15 13
 import org.springframework.stereotype.Service;
16
-import com.example.civilizedcity.entity.SysUser;
17 14
 import com.example.civilizedcity.mapper.SysUserMapper;
18 15
 import com.example.civilizedcity.service.SysUserService;
19 16
 
@@ -148,6 +145,33 @@ public class SysUserServiceImpl extends BaseServiceImpl<SysUserMapper, SysUser>
148 145
             sysUserRoleMapper.deleteNotIn(sysUser.getUserId(), idList);
149 146
         }
150 147
 
148
+        // 身份表
149
+        List<String> dutyList = sysUser.getDutyList();
150
+        if (null == dutyList || dutyList.size() == 0) {
151
+            sysUserDutyMapper.deleteByMap(new HashMap<String, Object>() {{
152
+                put("user_id", sysUser.getUserId());
153
+            }});
154
+        } else {
155
+            List<Integer> idList = new ArrayList<>();
156
+            for (String duty : dutyList) {
157
+                SysUserDuty item = new SysUserDuty();
158
+                item.setUserId(sysUser.getUserId());
159
+                item.setDuty(duty);
160
+
161
+                SysUserDuty exists = sysUserDutyMapper.getByUserAndDuty(sysUser.getUserId(), duty);
162
+                if (null != exists) {
163
+                    item.setId(exists.getId());
164
+                } else {
165
+                    sysUserDutyMapper.insert(item);
166
+                }
167
+
168
+                idList.add(item.getId());
169
+            }
170
+
171
+            // 去除垃圾数据
172
+            sysUserDutyMapper.deleteNotIn(sysUser.getUserId(), idList);
173
+        }
174
+
151 175
         return true;
152 176
     }
153 177
 

+ 16
- 0
src/main/java/com/example/civilizedcity/service/impl/TaCheckStandServiceImpl.java Voir le fichier

@@ -0,0 +1,16 @@
1
+package com.example.civilizedcity.service.impl;
2
+
3
+import org.springframework.beans.factory.annotation.Autowired;
4
+import org.springframework.stereotype.Service;
5
+import com.example.civilizedcity.entity.TaCheckStand;
6
+import com.example.civilizedcity.mapper.TaCheckStandMapper;
7
+import com.example.civilizedcity.service.TaCheckStandService;
8
+ /**
9
+ * 测评标准;(ta_check_stand)表服务实现类
10
+ * @author : http://www.chiner.pro
11
+ * @date : 2023-1-29
12
+ */
13
+@Service
14
+public class TaCheckStandServiceImpl extends BaseServiceImpl<TaCheckStandMapper, TaCheckStand> implements TaCheckStandService {
15
+    
16
+}

+ 61
- 0
src/main/java/com/example/civilizedcity/service/impl/TaIssueServiceImpl.java Voir le fichier

@@ -1,12 +1,21 @@
1 1
 package com.example.civilizedcity.service.impl;
2 2
 
3 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.SysUser;
7
+import com.example.civilizedcity.mapper.TaOrgIssueMapper;
8
+import com.example.civilizedcity.vo.StatVo;
4 9
 import org.springframework.beans.factory.annotation.Autowired;
5 10
 import org.springframework.stereotype.Service;
6 11
 import com.example.civilizedcity.entity.TaIssue;
7 12
 import com.example.civilizedcity.mapper.TaIssueMapper;
8 13
 import com.example.civilizedcity.service.TaIssueService;
9 14
 
15
+import java.util.ArrayList;
16
+import java.util.List;
17
+import java.util.Map;
18
+
10 19
 /**
11 20
  * 问题表;(ta_issue)表服务实现类
12 21
  *
@@ -16,6 +25,9 @@ import com.example.civilizedcity.service.TaIssueService;
16 25
 @Service
17 26
 public class TaIssueServiceImpl extends BaseServiceImpl<TaIssueMapper, TaIssue> implements TaIssueService {
18 27
 
28
+    @Autowired
29
+    TaOrgIssueMapper taOrgIssueMapper;
30
+
19 31
     @Override
20 32
     public IPage<TaIssue> getPageBy(IPage<TaIssue> pg, String orgId) {
21 33
         if (null == orgId) {
@@ -35,4 +47,53 @@ public class TaIssueServiceImpl extends BaseServiceImpl<TaIssueMapper, TaIssue>
35 47
     public void updateApply(Integer issueId, String applyType, Integer applyId) {
36 48
         baseMapper.updateApply(issueId, applyType, applyId);
37 49
     }
50
+
51
+    @Override
52
+    public List<StatVo> statMaIndex(SysUser user, String duty) {
53
+        List<StatVo> result = new ArrayList<>();
54
+
55
+        // 督察员
56
+        if (Constants.DUTY_INSPECTOR.equals(duty)) {
57
+            Map<String, Object> res = baseMapper.statMaIndex(user.getUserId());
58
+            result.add(new StatVo().setName("已上报").setValue(getStatValueBy(res.get("published_num"), 0)));
59
+            result.add(new StatVo().setName("已交办").setValue(getStatValueBy(res.get("assigned_num"), 0)));
60
+            result.add(new StatVo().setName("未交办").setValue(getStatValueBy(res.get("unassigned_num"), 0)));
61
+        }
62
+
63
+        // 管理员
64
+        else if (Constants.DUTY_MANAGER.equals(duty)) {
65
+            Map<String, Object> res = baseMapper.statMaIndex(null);
66
+            result.add(new StatVo().setName("未处理").setValue(getStatValueBy(res.get("unassigned_num"), 0)));
67
+            result.add(new StatVo().setName("已交办").setValue(getStatValueBy(res.get("assigned_num"), 0)));
68
+            result.add(new StatVo().setName("已办结").setValue(getStatValueBy(res.get("end_num"), 0)));
69
+        }
70
+
71
+        // 单位人员 或者 单位管理员
72
+        else if (Constants.DUTY_ORG_USER.equals(duty) || Constants.DUTY_ORG_MANAGER.equals(duty)) {
73
+            Map<String, Object> res = taOrgIssueMapper.statMaIndex(user.getOrgId());
74
+            result.add(new StatVo().setName("处理中").setValue(getStatValueBy(res.get("doing_num"), 0)));
75
+            result.add(new StatVo().setName("已办结").setValue(getStatValueBy(res.get("end_num"), 0)));
76
+            result.add(new StatVo().setName("已逾期").setValue(getStatValueBy(res.get("delay_num"), 0)));
77
+        }
78
+
79
+        // 查询人员
80
+        else if (Constants.DUTY_QUERY_PERSON.equals(duty)) {
81
+            Map<String, Object> res = baseMapper.statMaIndex(null);
82
+            result.add(new StatVo().setName("未处理").setValue(getStatValueBy(res.get("unassigned_num"), 0)));
83
+            result.add(new StatVo().setName("处理中").setValue(getStatValueBy(res.get("assigned_num"), 0)));
84
+            result.add(new StatVo().setName("已办结").setValue(getStatValueBy(res.get("end_num"), 0)));
85
+        }
86
+
87
+        // 市民
88
+        else {
89
+
90
+        }
91
+
92
+        return result;
93
+    }
94
+
95
+    Integer getStatValueBy(Object v, Integer def) {
96
+        if (null == v) return def;
97
+        return Integer.valueOf(v.toString());
98
+    }
38 99
 }

+ 17
- 0
src/main/java/com/example/civilizedcity/vo/StatVo.java Voir le fichier

@@ -0,0 +1,17 @@
1
+package com.example.civilizedcity.vo;
2
+
3
+import io.swagger.annotations.ApiModel;
4
+import io.swagger.annotations.ApiModelProperty;
5
+import lombok.Data;
6
+import lombok.experimental.Accessors;
7
+
8
+@Data
9
+@Accessors(chain = true)
10
+@ApiModel("统计参数")
11
+public class StatVo {
12
+    @ApiModelProperty("统计指标")
13
+    String name;
14
+
15
+    @ApiModelProperty("统计结果")
16
+    Object value;
17
+}

+ 1
- 1
src/main/resources/application.yml Voir le fichier

@@ -5,7 +5,7 @@ server:
5 5
 
6 6
 spring:
7 7
   datasource:
8
-    url: jdbc:mysql://110.40.183.156:3306/civilizedcity?serverTimezone=Asia/Shanghai&useUnicode=true&characterEncoding=utf8&useSSL=false&allowPublicKeyRetrieval=true&autoReconnect=true
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 11
   mvc:

+ 20
- 0
src/main/resources/mapper/SysUserDutyMapper.xml Voir le fichier

@@ -2,6 +2,17 @@
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.SysUserDutyMapper">
5
+    <delete id="deleteNotIn">
6
+        DELETE t
7
+        FROM
8
+            sys_user_duty t
9
+        WHERE
10
+            t.user_id = #{userId}
11
+        AND t.id NOT IN
12
+        <foreach item="item" collection="idList" separator="," open="(" close=")" index="">
13
+            #{item}
14
+        </foreach>
15
+    </delete>
5 16
 
6 17
     <select id="getListByUser" resultType="java.lang.String">
7 18
         SELECT
@@ -11,4 +22,13 @@
11 22
         WHERE
12 23
             t.user_id = #{userId}
13 24
     </select>
25
+    <select id="getByUserAndDuty" resultType="com.example.civilizedcity.entity.SysUserDuty">
26
+        SELECT
27
+            t.*
28
+        FROM
29
+            sys_user_duty t
30
+        WHERE
31
+            t.user_id = #{userId}
32
+            AND t.duty = #{duty}
33
+    </select>
14 34
 </mapper>

+ 6
- 0
src/main/resources/mapper/TaCheckStandMapper.xml Voir le fichier

@@ -0,0 +1,6 @@
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.TaCheckStandMapper">
5
+    
6
+</mapper>

+ 16
- 0
src/main/resources/mapper/TaIssueMapper.xml Voir le fichier

@@ -45,4 +45,20 @@
45 45
         ORDER BY
46 46
             t.create_date DESC
47 47
     </select>
48
+    <select id="statMaIndex" resultType="java.util.Map">
49
+        SELECT
50
+            UUID_SHORT() as id,
51
+            count(*) as published_num,
52
+            sum(IF(t.process_node = 'start', 1, 0)) as unassigned_num,
53
+            sum(IF(t.process_node = 'assigned', 1, 0)) as assigned_num,
54
+            sum(IF(t.process_node = 'reject', 1, 0)) as reject_num,
55
+            sum(IF(t.process_node = 'end', 1, 0)) as end_num
56
+        FROM
57
+            ta_issue t
58
+        WHERE 1 = 1
59
+          <if test="null != userId and userId != ''">
60
+              AND t.create_user = #{userId}
61
+          </if>
62
+          AND t.`status` > - 1
63
+    </select>
48 64
 </mapper>

+ 12
- 0
src/main/resources/mapper/TaOrgIssueMapper.xml Voir le fichier

@@ -46,4 +46,16 @@
46 46
           AND t.org_id = #{orgId}
47 47
           AND t.`status` = 1
48 48
     </select>
49
+    <select id="statMaIndex" resultType="java.util.Map">
50
+        select
51
+            UUID_SHORT() as id,
52
+            SUM(IF(TO_DAYS(now()) > TO_DAYS(s.expire_date), 1, 0)) as delay_num,
53
+            SUM(s.process_node == 'end', 1, 0) as end_num,
54
+            SUM(s.process_node != 'end', 1, 0) as doing_num
55
+        from ta_org_issue t
56
+                 INNER JOIN ta_issue s on t.issue_id = s.issue_id
57
+        where t.org_id = #{orgId}
58
+          and t.`status` &gt; -1
59
+          and s.`status` &gt; -1
60
+    </select>
49 61
 </mapper>