2 İşlemeler b18e4cd07c ... ad9f8ced80

Yazar SHA1 Mesaj Tarih
  aihua ad9f8ced80 Merge remote-tracking branch 'origin/master' 3 yıl önce
  aihua bfa7808b75 内控预警,违规预警 查询 及 编辑相关接口 3 yıl önce

+ 9 - 1
src/main/java/com/chinaitop/depot/risk/controller/ViolationWarningAlarmController.java

@@ -47,7 +47,7 @@ public class ViolationWarningAlarmController {
47 47
             @ApiImplicitParam(name = "startDate", value = "开始日期", paramType = "query"),
48 48
             @ApiImplicitParam(name = "endDate", value = "结束日期", paramType = "query")
49 49
     })
50
-    public ResponseEntity<PageInfo<ViolationWarningAlarm>> listPage(Integer pageNum, Integer pageSize, Integer orgId, String startDate, String endDate){
50
+    public ResponseEntity<PageInfo<ViolationWarningAlarm>> listPage(Integer pageNum, Integer pageSize, Integer orgId,String violationType, String startDate, String endDate){
51 51
 
52 52
         if (orgId == null) {
53 53
             return ResponseEntity.failed("组织机构ID不能为空!");
@@ -62,6 +62,9 @@ public class ViolationWarningAlarmController {
62 62
         if (StringUtils.isNotBlank(endDate)) {
63 63
             queryMap.put("endDate", endDate);
64 64
         }
65
+        if (StringUtils.isNotBlank(violationType)) {
66
+            queryMap.put("violationType", violationType);
67
+        }
65 68
         queryMap.put("orgId", orgId);
66 69
         return ResponseEntity.ok(new PageInfo<>(violationWarningAlarmService.selectListPage(queryMap)));
67 70
     }
@@ -94,6 +97,11 @@ public class ViolationWarningAlarmController {
94 97
                 if (violationWarningAlarm.getId() == null) {
95 98
                     return ResponseEntity.failed("更新数据ID不能为空!");
96 99
                 }
100
+                if(StringUtils.isNotBlank(violationWarningAlarm.getDisposer())
101
+                  || StringUtils.isNotBlank(violationWarningAlarm.getDisposeContent())
102
+                  || StringUtils.isNotBlank(violationWarningAlarm.getDisposeTime())){
103
+                    violationWarningAlarm.setCurrentStatus(1);
104
+                }
97 105
                 violationWarningAlarmService.updateDate(violationWarningAlarm);
98 106
             }
99 107
         } catch (Exception e) {

+ 1 - 1
src/main/java/com/chinaitop/depot/risk/mapper/ContentPreControlAlarmMapper.xml

@@ -2,7 +2,7 @@
2 2
 <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
3 3
 <mapper namespace="com.chinaitop.depot.risk.mapper.ContentPreControlAlarmMapper">
4 4
     <resultMap id="BaseResultMap" type="com.chinaitop.depot.risk.model.ContentPreControlAlarm">
5
-        <id column="id" property="id" jdbcType="VARCHAR"/>
5
+        <id column="id" property="id" jdbcType="INTEGER"/>
6 6
         <result column="car_number" property="carNumber" jdbcType="VARCHAR"/>
7 7
         <result column="alarm_type" property="alarmType" jdbcType="VARCHAR"/>
8 8
         <result column="alarm_content" property="alarmContent" jdbcType="VARCHAR"/>

+ 11 - 0
src/main/java/com/chinaitop/depot/risk/mapper/ViolationWarningAlarmMapper.java

@@ -1,11 +1,22 @@
1 1
 package com.chinaitop.depot.risk.mapper;
2 2
 
3
+import com.chinaitop.depot.risk.model.RiskManagement;
3 4
 import com.chinaitop.depot.risk.model.ViolationWarningAlarm;
4 5
 
6
+
7
+import java.util.List;
8
+import java.util.Map;
5 9
 /**
6 10
  * 违规预警mapper
7 11
  * @author aihua
8 12
  */
9 13
 public interface ViolationWarningAlarmMapper {
14
+
10 15
     void insert(ViolationWarningAlarm violationWarningAlarm);
16
+
17
+    List<ViolationWarningAlarm> selectListPage(Map<String, Object> queryMap);
18
+
19
+    ViolationWarningAlarm selectById(Integer id);
20
+
21
+    void updateById(ViolationWarningAlarm riskManagement);
11 22
 }

+ 95 - 8
src/main/java/com/chinaitop/depot/risk/mapper/ViolationWarningAlarmMapper.xml

@@ -2,25 +2,56 @@
2 2
 <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
3 3
 <mapper namespace="com.chinaitop.depot.risk.mapper.ViolationWarningAlarmMapper">
4 4
     <resultMap id="BaseResultMap" type="com.chinaitop.depot.risk.model.ViolationWarningAlarm">
5
-        <id column="id" property="id" jdbcType="VARCHAR"/>
6
-        <result column="alarm_publish_time" property="alarmPublishTime" jdbcType="VARCHAR"/>
7
-        <result column="violation_subject_type" property="violationSubjectType" jdbcType="VARCHAR"/>
5
+        <id column="id" property="id" jdbcType="INTEGER"/>
6
+        <result column="publish_time" property="alarmPublishTime" jdbcType="VARCHAR"/>
8 7
         <result column="offender" property="offender" jdbcType="VARCHAR"/>
9
-        <result column="involving_library_points" property="involvingLibraryPoints" jdbcType="VARCHAR"/>
8
+        <result column="library_point_name" property="involvingLibraryPoints" jdbcType="VARCHAR"/>
10 9
         <result column="violation_type" property="violationType" jdbcType="VARCHAR"/>
11
-        <result column="violation_detail" property="violationDetail" jdbcType="VARCHAR"/>
12
-        <result column="current_status" property="currentStatus" jdbcType="INTEGER"/>
10
+        <result column="detail" property="violationDetail" jdbcType="VARCHAR"/>
11
+        <result column="disposer" property="disposer" jdbcType="VARCHAR"/>
12
+        <result column="dispose_content" property="disposeContent" jdbcType="VARCHAR"/>
13
+        <result column="subject_type" property="violationSubjectType" jdbcType="VARCHAR"/>
14
+        <result column="status" property="currentStatus" jdbcType="INTEGER"/>
13 15
         <result column="org_id" property="orgId" jdbcType="INTEGER"/>
16
+        <result column="create_time" property="createTime" jdbcType="VARCHAR"/>
14 17
     </resultMap>
15 18
 
19
+
20
+    <select id="selectListPage" resultType="com.chinaitop.depot.risk.model.ViolationWarningAlarm">
21
+        select
22
+        id,
23
+        publish_time as alarmPublishTime,
24
+        offender as offender,
25
+        library_point_name as involvingLibraryPoints,
26
+        violation_type as violationType,
27
+        detail as violationDetail,
28
+        disposer as disposer,
29
+        dispose_content as disposeContent,
30
+        subject_type as violationSubjectType,
31
+        status as currentStatus,
32
+        org_id as orgId,
33
+        create_time as createTime
34
+        from
35
+        storage_pre_violation
36
+        where
37
+        org_id = #{orgId}
38
+        <if test="startDate != null and endDate != null" >
39
+            and publish_time BETWEEN #{startDate} AND #{endDate}
40
+        </if>
41
+        <if test="violationType != null" >
42
+            and violation_type = #{violationType}
43
+        </if>
44
+    </select>
45
+
16 46
     <insert id="insert">
17 47
         <selectKey keyProperty="id" resultType="java.lang.Integer" order="BEFORE">
18 48
             select seq_business_agent_tank.nextVal from dual
19 49
         </selectKey>
20 50
         INSERT INTO storage_pre_violation
21
-        (id, publish_time, offender, library_point_name, "type", detail, disposer, dispose_content, subject_type,
51
+        (id, publish_time, offender, library_point_name, violation_type, detail, disposer,
52
+        dispose_content, subject_type,
22 53
         dispose_time, status, org_id, create_time)
23
-        VALUES (#{id,jdbcType=VARCHAR},
54
+        VALUES (#{id,jdbcType=INTEGER},
24 55
         #{alarmPublishTime,jdbcType=VARCHAR},
25 56
         #{offender,jdbcType=VARCHAR},
26 57
         #{involvingLibraryPoints,jdbcType=VARCHAR},
@@ -34,4 +65,60 @@
34 65
         #{orgId,jdbcType=INTEGER},
35 66
         #{createTime,jdbcType=VARCHAR})
36 67
     </insert>
68
+
69
+
70
+    <select id="selectById" resultMap="BaseResultMap">
71
+        select
72
+        id,
73
+        publish_time,
74
+        offender ,
75
+        library_point_name ,
76
+        violation_type ,
77
+        detail ,
78
+        disposer ,
79
+        dispose_content,
80
+        subject_type ,
81
+        status ,
82
+        org_id ,
83
+        create_time
84
+        from
85
+           storage_pre_violation
86
+        where id = #{id,jdbcType=INTEGER}
87
+    </select>
88
+
89
+
90
+    <update id="updateById">
91
+        UPDATE storage_pre_violation
92
+        <set>
93
+            <if test="alarmPublishTime != null">
94
+                publish_time = #{alarmPublishTime,jdbcType=VARCHAR},
95
+            </if>
96
+            <if test="offender != null">
97
+                offender = #{offender,jdbcType=VARCHAR},
98
+            </if>
99
+            <if test="involvingLibraryPoints != null">
100
+                library_point_name = #{involvingLibraryPoints,jdbcType=VARCHAR},
101
+            </if>
102
+            <if test="violationType != null">
103
+                "type" = #{violationType,jdbcType=VARCHAR},
104
+            </if>
105
+            <if test="violationDetail != null">
106
+                detail = #{violationDetail,jdbcType=INTEGER},
107
+            </if>
108
+            <if test="disposer != null">
109
+                disposer = #{disposer,jdbcType=VARCHAR},
110
+            </if>
111
+            <if test="disposeContent != null">
112
+                dispose_content = #{disposeContent,jdbcType=VARCHAR},
113
+            </if>
114
+            <if test="violationSubjectType != null">
115
+                subject_type = #{violationSubjectType,jdbcType=VARCHAR},
116
+            </if>
117
+            <if test="currentStatus != null">
118
+                status = #{currentStatus,jdbcType=VARCHAR},
119
+            </if>
120
+        </set>
121
+        where id = #{id,jdbcType=INTEGER}
122
+    </update>
123
+
37 124
 </mapper>

+ 5 - 1
src/main/java/com/chinaitop/depot/risk/model/ContentPreControlAlarm.java

@@ -1,7 +1,9 @@
1 1
 package com.chinaitop.depot.risk.model;
2 2
 
3
+import lombok.AllArgsConstructor;
3 4
 import lombok.Builder;
4 5
 import lombok.Data;
6
+import lombok.NoArgsConstructor;
5 7
 
6 8
 /**
7 9
  * 内容预控告警 model
@@ -10,8 +12,10 @@ import lombok.Data;
10 12
  */
11 13
 @Data
12 14
 @Builder
15
+@NoArgsConstructor
16
+@AllArgsConstructor
13 17
 public class ContentPreControlAlarm {
14
-    private String id;
18
+    private Integer id;
15 19
     /**
16 20
      * 入库车牌号
17 21
      */

+ 6 - 2
src/main/java/com/chinaitop/depot/risk/model/ViolationWarningAlarm.java

@@ -1,7 +1,9 @@
1 1
 package com.chinaitop.depot.risk.model;
2 2
 
3
+import lombok.AllArgsConstructor;
3 4
 import lombok.Builder;
4 5
 import lombok.Data;
6
+import lombok.NoArgsConstructor;
5 7
 
6 8
 /**
7 9
  * 违规预警
@@ -10,17 +12,19 @@ import lombok.Data;
10 12
  */
11 13
 @Data
12 14
 @Builder
15
+@NoArgsConstructor
16
+@AllArgsConstructor
13 17
 public class ViolationWarningAlarm {
14 18
     /**
15 19
      * 主键ID
16 20
      */
17
-    private String id;
21
+    private Integer id;
18 22
     /**
19 23
      * 违规发布时间
20 24
      */
21 25
     private String alarmPublishTime;
22 26
     /**
23
-     * 违规主题类型
27
+     * 违规主题类型 当前默认是 单位
24 28
      */
25 29
     private String violationSubjectType;
26 30
     /**

+ 8 - 3
src/main/java/com/chinaitop/depot/risk/service/impl/ViolationWarningAlarmServiceImpl.java

@@ -1,7 +1,9 @@
1 1
 package com.chinaitop.depot.risk.service.impl;
2 2
 
3
+import com.chinaitop.depot.risk.mapper.ViolationWarningAlarmMapper;
3 4
 import com.chinaitop.depot.risk.model.ViolationWarningAlarm;
4 5
 import com.chinaitop.depot.risk.service.ViolationWarningAlarmService;
6
+import lombok.RequiredArgsConstructor;
5 7
 import org.springframework.stereotype.Service;
6 8
 
7 9
 import java.util.List;
@@ -14,19 +16,22 @@ import java.util.Map;
14 16
  * @date 2022-04-19 17:46
15 17
  */
16 18
 @Service
19
+@RequiredArgsConstructor
17 20
 public class ViolationWarningAlarmServiceImpl implements ViolationWarningAlarmService {
21
+
22
+    private final ViolationWarningAlarmMapper violationWarningAlarmMapper;
18 23
     @Override
19 24
     public List<ViolationWarningAlarm> selectListPage(Map<String, Object> queryMap) {
20
-        return null;
25
+        return  violationWarningAlarmMapper.selectListPage(queryMap);
21 26
     }
22 27
 
23 28
     @Override
24 29
     public ViolationWarningAlarm queryById(Integer id) {
25
-        return null;
30
+        return  violationWarningAlarmMapper.selectById(id);
26 31
     }
27 32
 
28 33
     @Override
29 34
     public void updateDate(ViolationWarningAlarm violationWarningAlarm) {
30
-
35
+        violationWarningAlarmMapper.updateById(violationWarningAlarm);
31 36
     }
32 37
 }