fanxw 11 mesi fa
parent
commit
f339450605

+ 6 - 3
src/main/java/com/chinaitop/depot/yjbj/controller/StorageTemperaturepointWarningController.java

@@ -39,15 +39,18 @@ public class StorageTemperaturepointWarningController {
39 39
         @ApiImplicitParam(name = "pageSize", value = "每页条数", paramType = "query"),
40 40
         @ApiImplicitParam(name = "cfbm", value = "仓房国标编码", paramType = "query"),
41 41
         @ApiImplicitParam(name = "orgId", value = "库ID", required=true, paramType = "query"),
42
-        @ApiImplicitParam(name = "alarmType", value = "预警类型 1-测温设备故障 2-测温数据上传故障", required=true, paramType = "query")
42
+        @ApiImplicitParam(name = "alarmType", value = "预警类型 1-测温设备故障 2-测温数据上传故障", required=true, paramType = "query"),
43
+        @ApiImplicitParam(name = "approvalStatus", value = "督办状态", paramType = "query"),
44
+        @ApiImplicitParam(name = "yjzt", value = "预警状态", paramType = "query")
43 45
 	})
44
-	public ResponseEntity getCwdgzPageList(Integer pageNum, Integer pageSize, String cfbm, Integer orgId, Integer alarmType) {
46
+	public ResponseEntity getCwdgzPageList(Integer pageNum, Integer pageSize, String cfbm, 
47
+			Integer orgId, Integer alarmType, String approvalStatus, String yjzt) {
45 48
 		PageInfo<Sbyj> pageInfo = null;
46 49
 		try {
47 50
 			if (pageNum != null && pageSize != null) {
48 51
 	            PageHelper.startPage(pageNum, pageSize);
49 52
 	        }
50
-			List<Sbyj> list = storageTemperaturepointWarningService.findByConditions(cfbm, orgId, alarmType);
53
+			List<Sbyj> list = storageTemperaturepointWarningService.findByConditions(cfbm, orgId, alarmType, approvalStatus, yjzt);
51 54
 			pageInfo = new PageInfo<>(list);
52 55
 			return ResponseEntity.ok(pageInfo);
53 56
 		} catch (Exception e) {

+ 32 - 9
src/main/java/com/chinaitop/depot/yjbj/mapper/SbyjMapper.xml

@@ -28,21 +28,38 @@
28 28
     <result column="supervise_status_name" property="superviseStatusName" jdbcType="VARCHAR" />
29 29
     <result column="alarm_type" property="alarmType" jdbcType="INTEGER" />
30 30
     <result column="pzbm" property="pzbm" jdbcType="VARCHAR" />
31
+    <result column="hfzcsj" property="hfzcsj" jdbcType="VARCHAR" />
31 32
     <!-- 业务字段 -->
32 33
     <result column="storehouse_code" property="houseCode" jdbcType="VARCHAR" />
34
+    <result column="clordbzt" property="clordbzt" jdbcType="VARCHAR" />
35
+    <result column="yjzt" property="yjzt" jdbcType="VARCHAR" />
33 36
   </resultMap>
34 37
   <sql id="Base_Column_List" >
35
-    a.id, a.kqbm, a.cfbm, a.ch, a.gzcwdsl, a.bjsj, a.create_time, a.update_time, a.kqdm, a.cwdsl, a.gzbl, a.approval_status, 
36
-    a.approval_status_name, a.data_flag, a.kqmc, a.hwxz, a.hwxzmc, a.org_id, a.org_code, a.duration_days, 
37
-    a.process_status, a.process_status_name, a.supervise_status, a.supervise_status_name, a.alarm_type, 
38
-    a.pzbm
38
+    id, kqbm, cfbm, ch, gzcwdsl, bjsj, create_time, update_time, kqdm, cwdsl, gzbl, approval_status, 
39
+    approval_status_name, data_flag, kqmc, hwxz, hwxzmc, org_id, org_code, duration_days, 
40
+    process_status, process_status_name, supervise_status, supervise_status_name, alarm_type, 
41
+    pzbm, hfzcsj
39 42
   </sql>
40 43
   <select id="selectByExample" resultMap="BaseResultMap" parameterType="map">
41
-    select
42
-    <include refid="Base_Column_List" />
43
-    ,b.storehouse_code
44
-    from storage_temperaturepoint_warning a
45
-    left join basic_storehouse b on b.cfbm=a.cfbm
44
+    select 
45
+ 	    *
46
+	from (
47
+  		select 
48
+		    <include refid="Base_Column_List" />,
49
+		    case approval_status 
50
+		        when '900000' then '待处理'
51
+		        when '900001' then '处理中'
52
+		        when '900002' then '待处理 督办中'
53
+		        when '900003' then '处理中 督办中'
54
+		        when '900004' then '督办中'
55
+		        when '900005' then '二次督办中'
56
+		        when '900006' then '二次督办完成'
57
+		        when '999999' then '处理完成'
58
+		        else ''
59
+		    end clordbzt,
60
+		    case when hfzcsj is not null and approval_status = '999999' then '已解决' else'未解决' end yjzt
61
+		from storage_temperaturepoint_warning
62
+	) a 
46 63
     <where>
47 64
       <if test="obj.dataFlag != null">
48 65
         and a.data_flag = #{obj.dataFlag,jdbcType=VARCHAR}
@@ -56,6 +73,12 @@
56 73
       <if test="obj.orgId != null">
57 74
         and a.org_id = #{obj.orgId,jdbcType=INTEGER}
58 75
       </if>
76
+      <if test="obj.approvalStatus != null">
77
+        and a.approval_status = #{obj.approvalStatus,jdbcType=VARCHAR}
78
+      </if>
79
+      <if test="obj.yjzt != null">
80
+        and a.yjzt = #{obj.yjzt,jdbcType=VARCHAR}
81
+      </if>
59 82
     </where>
60 83
     order by a.bjsj desc
61 84
   </select>

+ 7 - 0
src/main/java/com/chinaitop/depot/yjbj/model/Sbyj.java

@@ -63,5 +63,12 @@ public class Sbyj {
63 63
 
64 64
     private String pzbm;
65 65
 
66
+    @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd", timezone = "GMT+8")
67
+    private Date hfzcsj;
68
+
66 69
     private String houseCode;
70
+
71
+    private String clordbzt;//处理/督办状态
72
+
73
+    private String yjzt;//预警状态
67 74
 }

+ 3 - 1
src/main/java/com/chinaitop/depot/yjbj/service/SbyjService.java

@@ -11,10 +11,12 @@ public interface SbyjService {
11 11
 	 * @param cfbm 仓房国标编码
12 12
 	 * @param orgId 库ID
13 13
 	 * @param alarmType 预警类型 1-测温设备故障 2-测温数据上传故障
14
+	 * @param approvalStatus 督办状态
15
+	 * @param yjzt 预警状态
14 16
 	 * @return
15 17
 	 * @throws Exception
16 18
 	 */
17
-	List<Sbyj> findByConditions(String cfbm, Integer orgId, Integer alarmType) throws Exception;
19
+	List<Sbyj> findByConditions(String cfbm, Integer orgId, Integer alarmType, String approvalStatus, String yjzt) throws Exception;
18 20
 
19 21
 	/**
20 22
 	 * 按主键ID查询一条数据

+ 10 - 1
src/main/java/com/chinaitop/depot/yjbj/service/impl/SbyjServiceImpl.java

@@ -18,7 +18,7 @@ public class SbyjServiceImpl implements SbyjService {
18 18
 	private SbyjMapper sbyjMapper;
19 19
 
20 20
 	@Override
21
-	public List<Sbyj> findByConditions(String cfbm, Integer orgId, Integer alarmType)
21
+	public List<Sbyj> findByConditions(String cfbm, Integer orgId, Integer alarmType, String approvalStatus, String yjzt)
22 22
 			throws Exception {
23 23
 		Sbyj obj = new Sbyj();
24 24
 		obj.setDataFlag("1");//数据类型:1-库区 0-市级
@@ -27,6 +27,15 @@ public class SbyjServiceImpl implements SbyjService {
27 27
 		if (StringUtils.isNotBlank(cfbm)) {
28 28
 			obj.setCfbm(cfbm);
29 29
 		}
30
+		if (StringUtils.isNotBlank(cfbm)) {
31
+			obj.setCfbm(cfbm);
32
+		}
33
+		if (StringUtils.isNotBlank(approvalStatus)) {
34
+			obj.setApprovalStatus(approvalStatus.trim());
35
+		}
36
+		if (StringUtils.isNotBlank(yjzt)) {
37
+			obj.setYjzt(yjzt.trim());
38
+		}
30 39
 		return sbyjMapper.selectByExample(obj);
31 40
 	}
32 41