Yansen 2 年前
父节点
当前提交
3d42949427

db/.back_文明创办/文明创办-backup-2023323142510.pdma.json → db/.back_文明创办/文明创办-backup-202358163328.pdma.json 查看文件

2
   "name": "文明创办",
2
   "name": "文明创办",
3
   "describe": "文明创办",
3
   "describe": "文明创办",
4
   "avatar": "",
4
   "avatar": "",
5
-  "version": "4.1.4",
5
+  "version": "4.1.1",
6
   "createdTime": "2022-12-12 09:36:12",
6
   "createdTime": "2022-12-12 09:36:12",
7
-  "updatedTime": "2023-3-23 14:24:15",
7
+  "updatedTime": "2023-4-15 13:47:43",
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",
498
+    "menuWidth": "250px"
497
   },
499
   },
498
   "entities": [
500
   "entities": [
499
     {
501
     {
3911
           "refDict": "",
3913
           "refDict": "",
3912
           "uiHint": "",
3914
           "uiHint": "",
3913
           "id": "7FF626A4-AF1C-4CF5-B356-D46DB6D534B3"
3915
           "id": "7FF626A4-AF1C-4CF5-B356-D46DB6D534B3"
3916
+        },
3917
+        {
3918
+          "defKey": "copy_from",
3919
+          "defName": "复制来源",
3920
+          "comment": "",
3921
+          "type": "",
3922
+          "len": "",
3923
+          "scale": "",
3924
+          "primaryKey": false,
3925
+          "notNull": false,
3926
+          "autoIncrement": false,
3927
+          "defaultValue": "",
3928
+          "hideInGraph": false,
3929
+          "refDict": "",
3930
+          "extProps": {},
3931
+          "domain": "16120F75-6AA7-4483-868D-F07F511BB081",
3932
+          "id": "1F85BFC4-DBF4-4BA5-9BD8-DC9C2BFA1646"
3914
         }
3933
         }
3915
       ],
3934
       ],
3916
       "correlations": [],
3935
       "correlations": [],
6477
           "extProps": {},
6496
           "extProps": {},
6478
           "domain": "6BC8F04B-6CFA-4995-98D3-318F5CDD774E",
6497
           "domain": "6BC8F04B-6CFA-4995-98D3-318F5CDD774E",
6479
           "id": "A8365D64-DE0A-4F0E-9427-83DFF0ED66C6"
6498
           "id": "A8365D64-DE0A-4F0E-9427-83DFF0ED66C6"
6499
+        },
6500
+        {
6501
+          "defKey": "copy_from",
6502
+          "defName": "拷贝来源",
6503
+          "comment": "",
6504
+          "type": "",
6505
+          "len": "",
6506
+          "scale": "",
6507
+          "primaryKey": false,
6508
+          "notNull": false,
6509
+          "autoIncrement": false,
6510
+          "defaultValue": "",
6511
+          "hideInGraph": false,
6512
+          "domain": "16120F75-6AA7-4483-868D-F07F511BB081",
6513
+          "refDict": "",
6514
+          "extProps": {},
6515
+          "id": "E2BA367C-D262-43FB-A729-D26D6453D20C"
6480
         }
6516
         }
6481
       ],
6517
       ],
6482
       "correlations": [],
6518
       "correlations": [],
7702
           "refDict": "",
7738
           "refDict": "",
7703
           "extProps": {},
7739
           "extProps": {},
7704
           "id": "90218D19-7731-4AFE-8883-74944A66D6C8"
7740
           "id": "90218D19-7731-4AFE-8883-74944A66D6C8"
7741
+        },
7742
+        {
7743
+          "defKey": "copy_from",
7744
+          "defName": "拷贝来源",
7745
+          "comment": "",
7746
+          "type": "",
7747
+          "len": "",
7748
+          "scale": "",
7749
+          "primaryKey": false,
7750
+          "notNull": false,
7751
+          "autoIncrement": false,
7752
+          "defaultValue": "",
7753
+          "hideInGraph": false,
7754
+          "domain": "16120F75-6AA7-4483-868D-F07F511BB081",
7755
+          "refDict": "",
7756
+          "extProps": {},
7757
+          "id": "C0B26905-831F-4891-9B83-F84E4D111C44"
7705
         }
7758
         }
7706
       ],
7759
       ],
7707
       "correlations": [],
7760
       "correlations": [],

+ 36
- 2
db/文明创办.pdma.json 查看文件

2
   "name": "文明创办",
2
   "name": "文明创办",
3
   "describe": "文明创办",
3
   "describe": "文明创办",
4
   "avatar": "",
4
   "avatar": "",
5
-  "version": "4.1.1",
5
+  "version": "4.1.4",
6
   "createdTime": "2022-12-12 09:36:12",
6
   "createdTime": "2022-12-12 09:36:12",
7
-  "updatedTime": "2023-4-15 13:47:43",
7
+  "updatedTime": "2023-5-8 16:33:28",
8
   "dbConns": [],
8
   "dbConns": [],
9
   "profile": {
9
   "profile": {
10
     "default": {
10
     "default": {
4937
           "domain": "",
4937
           "domain": "",
4938
           "id": "52C74C06-CC1C-416E-B913-78B500CE30A2"
4938
           "id": "52C74C06-CC1C-416E-B913-78B500CE30A2"
4939
         },
4939
         },
4940
+        {
4941
+          "defKey": "loc_num",
4942
+          "defName": "实地测评份数",
4943
+          "comment": "",
4944
+          "type": "",
4945
+          "len": "",
4946
+          "scale": "",
4947
+          "primaryKey": false,
4948
+          "notNull": false,
4949
+          "autoIncrement": false,
4950
+          "defaultValue": "",
4951
+          "hideInGraph": false,
4952
+          "refDict": "",
4953
+          "extProps": {},
4954
+          "domain": "6BC8F04B-6CFA-4995-98D3-318F5CDD774E",
4955
+          "id": "FC14EB4B-E1C2-411A-A051-0D3C15002B61"
4956
+        },
4957
+        {
4958
+          "defKey": "survey_num",
4959
+          "defName": "调查问卷份数",
4960
+          "comment": "",
4961
+          "type": "",
4962
+          "len": "",
4963
+          "scale": "",
4964
+          "primaryKey": false,
4965
+          "notNull": false,
4966
+          "autoIncrement": false,
4967
+          "defaultValue": "",
4968
+          "hideInGraph": false,
4969
+          "refDict": "",
4970
+          "extProps": {},
4971
+          "domain": "6BC8F04B-6CFA-4995-98D3-318F5CDD774E",
4972
+          "id": "DAA70103-78D7-46A9-98F8-87963984C229"
4973
+        },
4940
         {
4974
         {
4941
           "defKey": "status",
4975
           "defKey": "status",
4942
           "defName": "状态",
4976
           "defName": "状态",

+ 1
- 1
pom.xml 查看文件

10
     </parent>
10
     </parent>
11
     <groupId>com.example</groupId>
11
     <groupId>com.example</groupId>
12
     <artifactId>civilizedCity</artifactId>
12
     <artifactId>civilizedCity</artifactId>
13
-    <version>0.0.16</version>
13
+    <version>0.0.17</version>
14
     <name>civilizedCity</name>
14
     <name>civilizedCity</name>
15
     <description>civilizedCity</description>
15
     <description>civilizedCity</description>
16
     <properties>
16
     <properties>

+ 6
- 0
src/main/java/com/example/civilizedcity/entity/TaCheck.java 查看文件

39
        /** 调查问卷得分 */
39
        /** 调查问卷得分 */
40
        @ApiModelProperty(name = "调查问卷得分",notes = "")
40
        @ApiModelProperty(name = "调查问卷得分",notes = "")
41
        private Double surveyScore ;
41
        private Double surveyScore ;
42
+     /** 实地测评得分 */
43
+     @ApiModelProperty(name = "实地测评份数",notes = "")
44
+     private Integer locNum ;
45
+     /** 调查问卷得分 */
46
+     @ApiModelProperty(name = "调查问卷份数",notes = "")
47
+     private Integer surveyNum ;
42
      /** 实地测评得分占比 */
48
      /** 实地测评得分占比 */
43
      @ApiModelProperty(name = "实地测评得分占比",notes = "")
49
      @ApiModelProperty(name = "实地测评得分占比",notes = "")
44
      private Double locScorePercent ;
50
      private Double locScorePercent ;

+ 1
- 1
src/main/java/com/example/civilizedcity/mapper/TaCheckItemMapper.java 查看文件

28
 
28
 
29
     long copyItems(@Param("oldCheckId") String oldCheckId, @Param("newCheckId") String newCheckId);
29
     long copyItems(@Param("oldCheckId") String oldCheckId, @Param("newCheckId") String newCheckId);
30
 
30
 
31
-    double sumScore(@Param("checkId") String checkId, @Param("itemType") String itemType);
31
+    Double sumScore(@Param("checkId") String checkId, @Param("itemType") String itemType);
32
 
32
 
33
     double sumEvlScore(@Param("itemId") String itemId);
33
     double sumEvlScore(@Param("itemId") String itemId);
34
 
34
 

+ 5
- 3
src/main/java/com/example/civilizedcity/mapper/TaCheckMapper.java 查看文件

3
 import com.baomidou.mybatisplus.core.mapper.BaseMapper;
3
 import com.baomidou.mybatisplus.core.mapper.BaseMapper;
4
 import org.apache.ibatis.annotations.Mapper;
4
 import org.apache.ibatis.annotations.Mapper;
5
 import com.example.civilizedcity.entity.TaCheck;
5
 import com.example.civilizedcity.entity.TaCheck;
6
+import org.apache.ibatis.annotations.Param;
6
 
7
 
7
- /**
8
+/**
8
  * 模拟测评;(ta_mock_check)表数据库访问层
9
  * 模拟测评;(ta_mock_check)表数据库访问层
9
  * @author : http://njyunzhi.com
10
  * @author : http://njyunzhi.com
10
  * @date : 2022-12-12
11
  * @date : 2022-12-12
11
  */
12
  */
12
 @Mapper
13
 @Mapper
13
 public interface TaCheckMapper extends BaseMapper<TaCheck>{
14
 public interface TaCheckMapper extends BaseMapper<TaCheck>{
14
-    
15
-}
15
+
16
+     int updateScore(@Param("checkId") String checkId);
17
+ }

+ 18
- 10
src/main/java/com/example/civilizedcity/service/impl/TaCheckServiceImpl.java 查看文件

39
 
39
 
40
         taCheckItemMapper.calcScore(taCheck.getCheckId());
40
         taCheckItemMapper.calcScore(taCheck.getCheckId());
41
 
41
 
42
-        // 调查问卷分数
43
-        double surveyScore = taCheckItemMapper.sumScore(taCheck.getCheckId(), Constants.CHECK_OF_SURVEY);
44
-
45
-        // 计算点位分数
46
-        double locScore = taCheckItemMapper.sumScore(taCheck.getCheckId(), Constants.CHECK_OF_LOC);
47
-
48
-        taCheck.setLocScore(locScore);
49
-        taCheck.setSurveyScore(surveyScore);
50
-
51
-        updateById(taCheck);
42
+        baseMapper.updateScore(taCheck.getCheckId());
43
+
44
+//        // 调查问卷分数
45
+//        Double surveyScore = taCheckItemMapper.sumScore(taCheck.getCheckId(), Constants.CHECK_OF_SURVEY);
46
+//        if (surveyScore == null) {
47
+//            surveyScore = 0.0;
48
+//        }
49
+//
50
+//        // 计算点位分数
51
+//        Double locScore = taCheckItemMapper.sumScore(taCheck.getCheckId(), Constants.CHECK_OF_LOC);
52
+//        if (locScore == null) {
53
+//            locScore = 0.0;
54
+//        }
55
+//
56
+//        taCheck.setLocScore(locScore);
57
+//        taCheck.setSurveyScore(surveyScore);
58
+//
59
+//        updateById(taCheck);
52
 
60
 
53
         return taCheck;
61
         return taCheck;
54
     }
62
     }

+ 34
- 1
src/main/resources/mapper/TaCheckMapper.xml 查看文件

2
 <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
2
 <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
3
 
3
 
4
 <mapper namespace="com.example.civilizedcity.mapper.TaCheckMapper">
4
 <mapper namespace="com.example.civilizedcity.mapper.TaCheckMapper">
5
-    
5
+
6
+    <update id="updateScore">
7
+        UPDATE ta_check t
8
+            INNER JOIN (
9
+                SELECT
10
+                a.check_id,
11
+                sum( a.score ) AS score,
12
+                count( 1 ) AS num
13
+                FROM
14
+                ta_check_item a
15
+                WHERE
16
+                a.check_id = #{checkId}
17
+                AND a.item_type = 'loc'
18
+                AND a.`status` = 1
19
+            ) m ON m.check_id = t.check_id
20
+            INNER JOIN (
21
+                SELECT
22
+                a.check_id,
23
+                sum( a.score ) AS score,
24
+                count( 1 ) AS num
25
+                FROM
26
+                ta_check_item a
27
+                WHERE
28
+                a.check_id = #{checkId}
29
+                AND a.item_type = 'survey'
30
+                AND a.`status` = 1
31
+            ) n ON n.check_id = t.check_id
32
+            SET t.loc_score = m.score,
33
+                t.loc_num = m.num,
34
+                t.survey_score = n.score,
35
+                t.survey_num = n.num
36
+        WHERE
37
+            t.check_id = #{checkId}
38
+    </update>
6
 </mapper>
39
 </mapper>