Your Name 2 years ago
parent
commit
d90b593421

db/.back_文明创办/文明创办-backup-20221216155916.pdma.json → db/.back_文明创办/文明创办-backup-20221218172610.pdma.json View File

4
   "avatar": "",
4
   "avatar": "",
5
   "version": "4.1.4",
5
   "version": "4.1.4",
6
   "createdTime": "2022-12-12 09:36:12",
6
   "createdTime": "2022-12-12 09:36:12",
7
-  "updatedTime": "2022-12-16 09:30:29",
7
+  "updatedTime": "2022-12-16 20:29:42",
8
   "dbConns": [],
8
   "dbConns": [],
9
   "profile": {
9
   "profile": {
10
     "default": {
10
     "default": {
5080
           "domain": "73FD2BAD-2358-4336-B96D-45DC897BD792",
5080
           "domain": "73FD2BAD-2358-4336-B96D-45DC897BD792",
5081
           "id": "3274DF40-5C9F-49E0-8013-A8F8FC5B401A"
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
           "defKey": "name",
5101
           "defKey": "name",
5085
           "defName": "名称",
5102
           "defName": "名称",
7021
       "id": "507794C4-11E9-4924-AEC5-368BC6E03FD7",
7038
       "id": "507794C4-11E9-4924-AEC5-368BC6E03FD7",
7022
       "env": {
7039
       "env": {
7023
         "base": {
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
       "defKey": "ta_check_item_an",
7068
       "defKey": "ta_check_item_an",
7029
       "defName": "项目问题答案",
7069
       "defName": "项目问题答案",
7106
           "scale": "",
7146
           "scale": "",
7107
           "primaryKey": true,
7147
           "primaryKey": true,
7108
           "notNull": true,
7148
           "notNull": true,
7109
-          "autoIncrement": true,
7149
+          "autoIncrement": false,
7110
           "defaultValue": "",
7150
           "defaultValue": "",
7111
           "hideInGraph": true,
7151
           "hideInGraph": true,
7112
           "domain": "16120F75-6AA7-4483-868D-F07F511BB081",
7152
           "domain": "16120F75-6AA7-4483-868D-F07F511BB081",

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

2
   "name": "文明创办",
2
   "name": "文明创办",
3
   "describe": "文明创办",
3
   "describe": "文明创办",
4
   "avatar": "",
4
   "avatar": "",
5
-  "version": "4.1.4",
5
+  "version": "4.2.0",
6
   "createdTime": "2022-12-12 09:36:12",
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
   "dbConns": [],
8
   "dbConns": [],
9
   "profile": {
9
   "profile": {
10
     "default": {
10
     "default": {
493
         "refKey": "extProps",
493
         "refKey": "extProps",
494
         "hideInGraph": true
494
         "hideInGraph": true
495
       }
495
       }
496
-    ]
496
+    ],
497
+    "modelType": "modalGroup"
497
   },
498
   },
498
   "entities": [
499
   "entities": [
499
     {
500
     {

+ 26
- 25
src/main/java/com/example/civilizedcity/controller/TaCheckItemAnController.java View File

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

+ 9
- 0
src/main/java/com/example/civilizedcity/controller/TaCheckItemQuController.java View File

9
 import java.util.List;
9
 import java.util.List;
10
 
10
 
11
 import com.example.civilizedcity.common.StringUtils;
11
 import com.example.civilizedcity.common.StringUtils;
12
+import com.example.civilizedcity.entity.TaCheckItemAn;
12
 import com.example.civilizedcity.service.TaCheckItemAnService;
13
 import com.example.civilizedcity.service.TaCheckItemAnService;
13
 import io.swagger.annotations.Api;
14
 import io.swagger.annotations.Api;
14
 import io.swagger.annotations.ApiOperation;
15
 import io.swagger.annotations.ApiOperation;
66
         queryWrapper.orderByDesc("sort_no");
67
         queryWrapper.orderByDesc("sort_no");
67
         IPage<TaCheckItemQu> result = taCheckItemQuService.page(pg, queryWrapper);
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
         return ResponseBean.success(result);
78
         return ResponseBean.success(result);
70
     }
79
     }
71
 
80
 

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

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

+ 2
- 0
src/main/java/com/example/civilizedcity/entity/TaCheckItemQu.java View File

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

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

13
 public interface TaCheckItemAnService extends IBaseService<TaCheckItemAn> {
13
 public interface TaCheckItemAnService extends IBaseService<TaCheckItemAn> {
14
 
14
 
15
      boolean mergeData(String quId, List<TaCheckItemAn> answerList);
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 View File

1
 package com.example.civilizedcity.service.impl;
1
 package com.example.civilizedcity.service.impl;
2
 
2
 
3
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
3
 import com.example.civilizedcity.common.StringUtils;
4
 import com.example.civilizedcity.common.StringUtils;
4
 import com.example.civilizedcity.entity.SysRole;
5
 import com.example.civilizedcity.entity.SysRole;
5
 import com.example.civilizedcity.entity.SysUserRole;
6
 import com.example.civilizedcity.entity.SysUserRole;
33
 
34
 
34
         for (int i = 0; i < answerList.size(); i ++) {
35
         for (int i = 0; i < answerList.size(); i ++) {
35
             TaCheckItemAn item = answerList.get(i);
36
             TaCheckItemAn item = answerList.get(i);
37
+            item.setQuId(quId);
36
             // 重新排序
38
             // 重新排序
37
             item.setSortNo(i + 1);
39
             item.setSortNo(i + 1);
38
             save(item);
40
             save(item);
40
 
42
 
41
         return true;
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
 }