Your Name před 2 roky
rodič
revize
d90b593421

db/.back_文明创办/文明创办-backup-20221216155916.pdma.json → db/.back_文明创办/文明创办-backup-20221218172610.pdma.json Zobrazit soubor

@@ -4,7 +4,7 @@
4 4
   "avatar": "",
5 5
   "version": "4.1.4",
6 6
   "createdTime": "2022-12-12 09:36:12",
7
-  "updatedTime": "2022-12-16 09:30:29",
7
+  "updatedTime": "2022-12-16 20:29:42",
8 8
   "dbConns": [],
9 9
   "profile": {
10 10
     "default": {
@@ -5080,6 +5080,23 @@
5080 5080
           "domain": "73FD2BAD-2358-4336-B96D-45DC897BD792",
5081 5081
           "id": "3274DF40-5C9F-49E0-8013-A8F8FC5B401A"
5082 5082
         },
5083
+        {
5084
+          "defKey": "type_id",
5085
+          "defName": "点位ID",
5086
+          "comment": "",
5087
+          "type": "",
5088
+          "len": "",
5089
+          "scale": "",
5090
+          "primaryKey": false,
5091
+          "notNull": false,
5092
+          "autoIncrement": false,
5093
+          "defaultValue": "",
5094
+          "hideInGraph": false,
5095
+          "refDict": "",
5096
+          "extProps": {},
5097
+          "domain": "16120F75-6AA7-4483-868D-F07F511BB081",
5098
+          "id": "9E210B7C-B1A2-43DB-A734-11B2FA544C96"
5099
+        },
5083 5100
         {
5084 5101
           "defKey": "name",
5085 5102
           "defName": "名称",
@@ -7021,9 +7038,32 @@
7021 7038
       "id": "507794C4-11E9-4924-AEC5-368BC6E03FD7",
7022 7039
       "env": {
7023 7040
         "base": {
7024
-          "nameSpace": "",
7025
-          "codeRoot": ""
7026
-        }
7041
+          "nameSpace": "com.example.civilizedcity",
7042
+          "codeRoot": "TaCheckItemAn"
7043
+        },
7044
+        "template": {
7045
+          "JavaMybatisPlus": {
7046
+            "Controller": {
7047
+              "suffix": "controller/{{=it.codeRoot}}Controller.java"
7048
+            },
7049
+            "Service": {
7050
+              "suffix": "service/{{=it.codeRoot}}Service.java"
7051
+            },
7052
+            "ServiceImpl": {
7053
+              "suffix": "service/impl/{{=it. codeRoot}}ServiceImpl.java"
7054
+            },
7055
+            "Mapper": {
7056
+              "suffix": "mapper/{{=it.codeRoot}}Mapper.java"
7057
+            },
7058
+            "Mapper.xml": {
7059
+              "suffix": "mapper/{{=it.codeRoot}}Mapper.xml"
7060
+            },
7061
+            "Entity": {
7062
+              "suffix": "entity/{{=it.codeRoot}}.java"
7063
+            }
7064
+          }
7065
+        },
7066
+        "custom": {}
7027 7067
       },
7028 7068
       "defKey": "ta_check_item_an",
7029 7069
       "defName": "项目问题答案",
@@ -7106,7 +7146,7 @@
7106 7146
           "scale": "",
7107 7147
           "primaryKey": true,
7108 7148
           "notNull": true,
7109
-          "autoIncrement": true,
7149
+          "autoIncrement": false,
7110 7150
           "defaultValue": "",
7111 7151
           "hideInGraph": true,
7112 7152
           "domain": "16120F75-6AA7-4483-868D-F07F511BB081",

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

@@ -2,9 +2,9 @@
2 2
   "name": "文明创办",
3 3
   "describe": "文明创办",
4 4
   "avatar": "",
5
-  "version": "4.1.4",
5
+  "version": "4.2.0",
6 6
   "createdTime": "2022-12-12 09:36:12",
7
-  "updatedTime": "2022-12-16 20:29:42",
7
+  "updatedTime": "2022-12-18 17:26:10",
8 8
   "dbConns": [],
9 9
   "profile": {
10 10
     "default": {
@@ -493,7 +493,8 @@
493 493
         "refKey": "extProps",
494 494
         "hideInGraph": true
495 495
       }
496
-    ]
496
+    ],
497
+    "modelType": "modalGroup"
497 498
   },
498 499
   "entities": [
499 500
     {

+ 26
- 25
src/main/java/com/example/civilizedcity/controller/TaCheckItemAnController.java Zobrazit soubor

@@ -5,7 +5,9 @@ import com.baomidou.mybatisplus.core.metadata.IPage;
5 5
 import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
6 6
 import com.example.civilizedcity.common.BaseController;
7 7
 import com.example.civilizedcity.common.ResponseBean;
8
+
8 9
 import java.util.List;
10
+
9 11
 import io.swagger.annotations.Api;
10 12
 import io.swagger.annotations.ApiOperation;
11 13
 import io.swagger.annotations.ApiParam;
@@ -14,8 +16,9 @@ import org.springframework.web.bind.annotation.*;
14 16
 import com.example.civilizedcity.entity.TaCheckItemAn;
15 17
 import com.example.civilizedcity.service.TaCheckItemAnService;
16 18
 
17
- /**
19
+/**
18 20
  * 项目问题答案;(ta_check_item_an)表控制层
21
+ *
19 22
  * @author : http://njyunzhi.com
20 23
  * @date : 2022-12-16
21 24
  */
@@ -23,12 +26,12 @@ import com.example.civilizedcity.service.TaCheckItemAnService;
23 26
 @RestController
24 27
 @RequestMapping("/")
25 28
 public class TaCheckItemAnController extends BaseController {
26
-    
29
+
27 30
     @Autowired
28 31
     private TaCheckItemAnService taCheckItemAnService;
29
-    
30
-    /** 
31
-     * 通过ID查询单条数据 
32
+
33
+    /**
34
+     * 通过ID查询单条数据
32 35
      *
33 36
      * @param answerId 主键
34 37
      * @return 实例对象
@@ -38,28 +41,26 @@ public class TaCheckItemAnController extends BaseController {
38 41
     public ResponseBean queryById(@ApiParam("对象ID") @PathVariable String id) throws Exception {
39 42
         return ResponseBean.success(taCheckItemAnService.getById(id));
40 43
     }
41
-    
42
-    /** 
44
+
45
+    /**
43 46
      * 分页查询
44 47
      *
45
-     * @param pageNum 当前页码
46
-     * @param pageSize 每页条数
48
+     * @param quId 问题ID
47 49
      * @return 查询结果
48 50
      */
49 51
     @ApiOperation("分页查询")
50 52
     @GetMapping("/taCheckItemAn")
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<TaCheckItemAn> pg = new Page<>(pageNum, pageSize);
55
-        // QueryWrapper<TaCheckItemAn> queryWrapper = new QueryWrapper<>();
56
-        // queryWrapper.orderByDesc("create_date");
57
-        IPage<TaCheckItemAn> result = taCheckItemAnService.page(pg);
58
-        
53
+    public ResponseBean list(@ApiParam("问题ID") @RequestParam(value = "quId") String quId) throws Exception {
54
+
55
+        QueryWrapper<TaCheckItemAn> queryWrapper = new QueryWrapper<>();
56
+        queryWrapper.eq("qu_id", quId);
57
+        queryWrapper.orderByAsc("sort_no");
58
+        List<TaCheckItemAn> result = taCheckItemAnService.list(queryWrapper);
59
+
59 60
         return ResponseBean.success(result);
60 61
     }
61
-    
62
-    /** 
62
+
63
+    /**
63 64
      * 新增数据
64 65
      *
65 66
      * @param taCheckItemAn 实例对象
@@ -71,8 +72,8 @@ public class TaCheckItemAnController extends BaseController {
71 72
         taCheckItemAnService.save(taCheckItemAn);
72 73
         return ResponseBean.success(taCheckItemAn);
73 74
     }
74
-    
75
-    /** 
75
+
76
+    /**
76 77
      * 更新数据
77 78
      *
78 79
      * @param taCheckItemAn 实例对象
@@ -81,12 +82,12 @@ public class TaCheckItemAnController extends BaseController {
81 82
     @ApiOperation("更新数据")
82 83
     @PutMapping("/taCheckItemAn/{id}")
83 84
     public ResponseBean edit(@ApiParam("对象实体") @RequestBody TaCheckItemAn taCheckItemAn,
84
-                            @ApiParam("对象ID") @PathVariable String id ) throws Exception {
85
+                             @ApiParam("对象ID") @PathVariable String id) throws Exception {
85 86
         taCheckItemAnService.updateById(taCheckItemAn);
86 87
         return ResponseBean.success(taCheckItemAn);
87 88
     }
88
-    
89
-    /** 
89
+
90
+    /**
90 91
      * 通过主键删除数据
91 92
      *
92 93
      * @param answerId 主键
@@ -94,7 +95,7 @@ public class TaCheckItemAnController extends BaseController {
94 95
      */
95 96
     @ApiOperation("通过主键删除数据")
96 97
     @DeleteMapping("/taCheckItemAn/{id}")
97
-    public ResponseBean deleteById(@ApiParam("对象ID") @PathVariable String id){
98
+    public ResponseBean deleteById(@ApiParam("对象ID") @PathVariable String id) {
98 99
         taCheckItemAnService.removeLogicById(id);
99 100
         return ResponseBean.success("success");
100 101
     }

+ 9
- 0
src/main/java/com/example/civilizedcity/controller/TaCheckItemQuController.java Zobrazit soubor

@@ -9,6 +9,7 @@ import com.example.civilizedcity.common.ResponseBean;
9 9
 import java.util.List;
10 10
 
11 11
 import com.example.civilizedcity.common.StringUtils;
12
+import com.example.civilizedcity.entity.TaCheckItemAn;
12 13
 import com.example.civilizedcity.service.TaCheckItemAnService;
13 14
 import io.swagger.annotations.Api;
14 15
 import io.swagger.annotations.ApiOperation;
@@ -66,6 +67,14 @@ public class TaCheckItemQuController extends BaseController {
66 67
         queryWrapper.orderByDesc("sort_no");
67 68
         IPage<TaCheckItemQu> result = taCheckItemQuService.page(pg, queryWrapper);
68 69
 
70
+        List<TaCheckItemQu> quList = result.getRecords();
71
+        if (quList != null && quList.size() > 0) {
72
+            for (TaCheckItemQu item : quList) {
73
+                List<TaCheckItemAn> answerList = taCheckItemAnService.getListByQuId(item.getQuId());
74
+                item.setAnswerList(answerList);
75
+            }
76
+        }
77
+
69 78
         return ResponseBean.success(result);
70 79
     }
71 80
 

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

@@ -68,6 +68,7 @@ public class TdLocTypeController extends BaseController {
68 68
     @ApiOperation("新增数据")
69 69
     @PostMapping("/tdLocType")
70 70
     public ResponseBean add(@ApiParam("对象实体") @RequestBody TdLocType tdLocType) throws Exception {
71
+        tdLocType.setTypeId(null);
71 72
         tdLocTypeService.save(tdLocType);
72 73
         return ResponseBean.success(tdLocType);
73 74
     }

+ 2
- 0
src/main/java/com/example/civilizedcity/entity/TaCheckItemQu.java Zobrazit soubor

@@ -1,5 +1,6 @@
1 1
 package com.example.civilizedcity.entity;
2 2
 
3
+import com.baomidou.mybatisplus.annotation.TableField;
3 4
 import io.swagger.annotations.ApiModel;
4 5
 import io.swagger.annotations.ApiModelProperty;
5 6
 import com.baomidou.mybatisplus.annotation.IdType;
@@ -56,5 +57,6 @@ public class TaCheckItemQu implements Serializable,Cloneable{
56 57
       /**
57 58
        * 答案列表
58 59
        */
60
+      @TableField(exist = false)
59 61
      List<TaCheckItemAn> answerList;
60 62
 }

+ 3
- 1
src/main/java/com/example/civilizedcity/service/TaCheckItemAnService.java Zobrazit soubor

@@ -13,4 +13,6 @@ import java.util.List;
13 13
 public interface TaCheckItemAnService extends IBaseService<TaCheckItemAn> {
14 14
 
15 15
      boolean mergeData(String quId, List<TaCheckItemAn> answerList);
16
- }
16
+
17
+    List<TaCheckItemAn> getListByQuId(String quId);
18
+}

+ 11
- 0
src/main/java/com/example/civilizedcity/service/impl/TaCheckItemAnServiceImpl.java Zobrazit soubor

@@ -1,5 +1,6 @@
1 1
 package com.example.civilizedcity.service.impl;
2 2
 
3
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
3 4
 import com.example.civilizedcity.common.StringUtils;
4 5
 import com.example.civilizedcity.entity.SysRole;
5 6
 import com.example.civilizedcity.entity.SysUserRole;
@@ -33,6 +34,7 @@ public class TaCheckItemAnServiceImpl extends BaseServiceImpl<TaCheckItemAnMappe
33 34
 
34 35
         for (int i = 0; i < answerList.size(); i ++) {
35 36
             TaCheckItemAn item = answerList.get(i);
37
+            item.setQuId(quId);
36 38
             // 重新排序
37 39
             item.setSortNo(i + 1);
38 40
             save(item);
@@ -40,4 +42,13 @@ public class TaCheckItemAnServiceImpl extends BaseServiceImpl<TaCheckItemAnMappe
40 42
 
41 43
         return true;
42 44
     }
45
+
46
+    @Override
47
+    public List<TaCheckItemAn> getListByQuId(String quId) {
48
+        QueryWrapper<TaCheckItemAn> queryWrapper = new QueryWrapper<>();
49
+        queryWrapper.eq("qu_id", quId);
50
+        queryWrapper.orderByAsc("sort_no");
51
+
52
+        return list(queryWrapper);
53
+    }
43 54
 }