Kaynağa Gözat

feat:去掉多余字段

aihua 3 yıl önce
ebeveyn
işleme
03fe98f2be

+ 1 - 3
src/main/java/com/chinaitop/depot/risk/controller/ContentPreControlAlarmController.java

@@ -58,8 +58,6 @@ public class ContentPreControlAlarmController {
58 58
             queryMap.put("endDate", endDate);
59 59
         }
60 60
         queryMap.put("orgId", orgId);
61
-        List<ContentPreControlAlarm> list = contentPreControlAlarmService.selectListPage(queryMap);
62
-        PageInfo<ContentPreControlAlarm> pageInfo = new PageInfo<>(list);
63
-        return ResponseEntity.ok(pageInfo);
61
+        return ResponseEntity.ok(new PageInfo<>(contentPreControlAlarmService.selectListPage(queryMap)));
64 62
     }
65 63
 }

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

@@ -8,6 +8,7 @@
8 8
         <result column="alarm_content" property="alarmContent" jdbcType="VARCHAR"/>
9 9
         <result column="alarm_time" property="alarmTime" jdbcType="VARCHAR"/>
10 10
         <result column="org_id" property="orgId" jdbcType="INTEGER"/>
11
+        <result column="create_time" property="createTime" jdbcType="VARCHAR"/>
11 12
     </resultMap>
12 13
 
13 14
     <insert id="insert">
@@ -26,5 +27,20 @@
26 27
     </insert>
27 28
 
28 29
     <select id="selectPage" resultMap="BaseResultMap">
30
+        SELECT id,
31
+               car_number,
32
+               alarm_type,
33
+               alarm_content,
34
+               alarm_time,
35
+               org_id,
36
+               create_time
37
+        FROM storage_pre_alarm
38
+        where org_id = #{orgId}
39
+        <if test="startDate != null and endDate != null" >
40
+            and alarm_time BETWEEN #{startDate} AND #{endDate}
41
+        </if>
42
+        <if test="startDate != null and endDate != null" >
43
+            and alarm_time &lt;= #{endDate}
44
+        </if>
29 45
     </select>
30 46
 </mapper>

+ 3 - 0
src/main/java/com/chinaitop/depot/risk/model/ContentPreControlAlarm.java

@@ -34,5 +34,8 @@ public class ContentPreControlAlarm {
34 34
      */
35 35
     private Integer orgId;
36 36
 
37
+    /**
38
+     * 创建时间
39
+     */
37 40
     private String createTime;
38 41
 }

+ 0 - 4
src/main/java/com/chinaitop/depot/risk/request/dto/ViolationWarningAlarmDto.java

@@ -17,10 +17,6 @@ public class ViolationWarningAlarmDto {
17 17
      */
18 18
     private String alarmPublishTime;
19 19
     /**
20
-     * 违规主题类型
21
-     */
22
-    private String violationSubjectType;
23
-    /**
24 20
      * 违规行为人
25 21
      */
26 22
     private String offender;

+ 1 - 1
src/main/java/com/chinaitop/depot/risk/service/impl/ContentPreControlAndViolationWarningAlarmServiceImpl.java

@@ -37,7 +37,7 @@ public class ContentPreControlAndViolationWarningAlarmServiceImpl implements Con
37 37
                 .build())).ifPresent(contentPreControlAlarmMapper::insert);
38 38
         Optional.ofNullable(alarmReq).flatMap(req -> Optional.ofNullable(req.getViolationWarningAlarm()).map(violationAlarm -> ViolationWarningAlarm.builder()
39 39
                 .alarmPublishTime(violationAlarm.getAlarmPublishTime())
40
-                .violationSubjectType(violationAlarm.getViolationSubjectType())
40
+                .violationSubjectType("单位")
41 41
                 .offender(violationAlarm.getOffender())
42 42
                 .violationType(violationAlarm.getViolationType())
43 43
                 .involvingLibraryPoints(violationAlarm.getInvolvingLibraryPoints())