2 Комити b18e4cd07c ... ad9f8ced80

Аутор SHA1 Порука Датум
  aihua ad9f8ced80 Merge remote-tracking branch 'origin/master' пре 3 година
  aihua bfa7808b75 内控预警,违规预警 查询 及 编辑相关接口 пре 3 година

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

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

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

@@ -2,7 +2,7 @@
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
 <mapper namespace="com.chinaitop.depot.risk.mapper.ContentPreControlAlarmMapper">
3
 <mapper namespace="com.chinaitop.depot.risk.mapper.ContentPreControlAlarmMapper">
4
     <resultMap id="BaseResultMap" type="com.chinaitop.depot.risk.model.ContentPreControlAlarm">
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
         <result column="car_number" property="carNumber" jdbcType="VARCHAR"/>
6
         <result column="car_number" property="carNumber" jdbcType="VARCHAR"/>
7
         <result column="alarm_type" property="alarmType" jdbcType="VARCHAR"/>
7
         <result column="alarm_type" property="alarmType" jdbcType="VARCHAR"/>
8
         <result column="alarm_content" property="alarmContent" jdbcType="VARCHAR"/>
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
 package com.chinaitop.depot.risk.mapper;
1
 package com.chinaitop.depot.risk.mapper;
2
 
2
 
3
+import com.chinaitop.depot.risk.model.RiskManagement;
3
 import com.chinaitop.depot.risk.model.ViolationWarningAlarm;
4
 import com.chinaitop.depot.risk.model.ViolationWarningAlarm;
4
 
5
 
6
+
7
+import java.util.List;
8
+import java.util.Map;
5
 /**
9
 /**
6
  * 违规预警mapper
10
  * 违规预警mapper
7
  * @author aihua
11
  * @author aihua
8
  */
12
  */
9
 public interface ViolationWarningAlarmMapper {
13
 public interface ViolationWarningAlarmMapper {
14
+
10
     void insert(ViolationWarningAlarm violationWarningAlarm);
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
 <!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
 <mapper namespace="com.chinaitop.depot.risk.mapper.ViolationWarningAlarmMapper">
3
 <mapper namespace="com.chinaitop.depot.risk.mapper.ViolationWarningAlarmMapper">
4
     <resultMap id="BaseResultMap" type="com.chinaitop.depot.risk.model.ViolationWarningAlarm">
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
         <result column="offender" property="offender" jdbcType="VARCHAR"/>
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
         <result column="violation_type" property="violationType" jdbcType="VARCHAR"/>
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
         <result column="org_id" property="orgId" jdbcType="INTEGER"/>
15
         <result column="org_id" property="orgId" jdbcType="INTEGER"/>
16
+        <result column="create_time" property="createTime" jdbcType="VARCHAR"/>
14
     </resultMap>
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
     <insert id="insert">
46
     <insert id="insert">
17
         <selectKey keyProperty="id" resultType="java.lang.Integer" order="BEFORE">
47
         <selectKey keyProperty="id" resultType="java.lang.Integer" order="BEFORE">
18
             select seq_business_agent_tank.nextVal from dual
48
             select seq_business_agent_tank.nextVal from dual
19
         </selectKey>
49
         </selectKey>
20
         INSERT INTO storage_pre_violation
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
         dispose_time, status, org_id, create_time)
53
         dispose_time, status, org_id, create_time)
23
-        VALUES (#{id,jdbcType=VARCHAR},
54
+        VALUES (#{id,jdbcType=INTEGER},
24
         #{alarmPublishTime,jdbcType=VARCHAR},
55
         #{alarmPublishTime,jdbcType=VARCHAR},
25
         #{offender,jdbcType=VARCHAR},
56
         #{offender,jdbcType=VARCHAR},
26
         #{involvingLibraryPoints,jdbcType=VARCHAR},
57
         #{involvingLibraryPoints,jdbcType=VARCHAR},
@@ -34,4 +65,60 @@
34
         #{orgId,jdbcType=INTEGER},
65
         #{orgId,jdbcType=INTEGER},
35
         #{createTime,jdbcType=VARCHAR})
66
         #{createTime,jdbcType=VARCHAR})
36
     </insert>
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
 </mapper>
124
 </mapper>

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

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

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

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