瀏覽代碼

质量报警

fanxw 1 年之前
父節點
當前提交
68c69a60e9

+ 24 - 0
src/main/java/com/chinaitop/depot/yjbj/controller/YjbjController.java

@@ -17,6 +17,7 @@ import com.chinaitop.depot.yjbj.model.Jybgcqyj;
17 17
 import com.chinaitop.depot.yjbj.model.StorageAlarmRecordWithBLOBs;
18 18
 import com.chinaitop.depot.yjbj.model.Thprkyj;
19 19
 import com.chinaitop.depot.yjbj.model.Zkycbj;
20
+import com.chinaitop.depot.yjbj.model.Zlbj;
20 21
 import com.chinaitop.depot.yjbj.service.StorageAlarmRecordService;
21 22
 import com.chinaitop.depot.yjbj.service.YjbjService;
22 23
 import com.github.pagehelper.PageHelper;
@@ -177,6 +178,29 @@ public class YjbjController {
177 178
 			return ResponseEntity.failed("查询失败:" + e.getMessage());
178 179
 		}
179 180
 	}
181
+	
182
+	@RequestMapping(value="/getZlbjPageList", produces = MediaType.APPLICATION_JSON_VALUE, method = RequestMethod.GET)
183
+	@ApiOperation(value="查询质量报警列表", notes = "支持分页")
184
+	@ApiImplicitParams({
185
+		@ApiImplicitParam(name = "pageNum", value = "页码", paramType = "query"),
186
+        @ApiImplicitParam(name = "pageSize", value = "每页条数", paramType = "query"),
187
+        @ApiImplicitParam(name = "cfmc", value = "仓房或油罐名称", paramType = "query"),
188
+        @ApiImplicitParam(name = "orgId", value = "库ID", required=true, paramType = "query")
189
+	})
190
+	public ResponseEntity getZlbjPageList(Integer pageNum, Integer pageSize, String cfmc, Integer orgId) {
191
+		PageInfo<Zlbj> pageInfo = null;
192
+		try {
193
+			if (pageNum != null && pageSize != null) {
194
+	            PageHelper.startPage(pageNum, pageSize);
195
+	        }
196
+			List<Zlbj> list = yjbjService.selectZlbj(orgId, cfmc);
197
+			pageInfo = new PageInfo<>(list);
198
+			return ResponseEntity.ok(pageInfo);
199
+		} catch (Exception e) {
200
+			log.error(e.getMessage(), e);
201
+			return ResponseEntity.failed("查询失败:" + e.getMessage());
202
+		}
203
+	}
180 204
 
181 205
 	@RequestMapping(value="/getCljl", produces = MediaType.APPLICATION_JSON_VALUE, method = RequestMethod.GET)
182 206
 	@ApiOperation(value="查询处理记录", notes = "")

+ 8 - 0
src/main/java/com/chinaitop/depot/yjbj/mapper/YjbjMapper.java

@@ -10,6 +10,7 @@ import com.chinaitop.depot.yjbj.model.Jksbgz;
10 10
 import com.chinaitop.depot.yjbj.model.Jybgcqyj;
11 11
 import com.chinaitop.depot.yjbj.model.Thprkyj;
12 12
 import com.chinaitop.depot.yjbj.model.Zkycbj;
13
+import com.chinaitop.depot.yjbj.model.Zlbj;
13 14
 
14 15
 public interface YjbjMapper {
15 16
 
@@ -54,4 +55,11 @@ public interface YjbjMapper {
54 55
 	 * @return
55 56
 	 */
56 57
 	List<Chbj> selectChbj(@Param("obj") Chbj obj);
58
+
59
+	/**
60
+	 * 质量报警数据查询
61
+	 * @param obj
62
+	 * @return
63
+	 */
64
+	List<Zlbj> selectZlbj(@Param("obj") Zlbj obj);
57 65
 }

+ 16 - 0
src/main/java/com/chinaitop/depot/yjbj/mapper/YjbjMapper.xml

@@ -93,4 +93,20 @@
93 93
     </where>
94 94
     order by bjsj desc
95 95
   </select>
96
+  <!-- 质量报警数据查询 -->
97
+  <select id="selectZlbj" resultType="com.chinaitop.depot.yjbj.model.Zlbj" parameterType="map">
98
+    select 
99
+  		id,cfmc,hwmc, pzmc, lyxzmc, decode(0, crklx, '入库质检', '出库质检') crklx, 
100
+  		yjxx, bjsj, approval_status_name approvalStatusName, org_id orgId
101
+	from storage_quality_alarm 
102
+    <where>
103
+      <if test="obj.cfmc != null">
104
+        and cfmc like #{obj.cfmc,jdbcType=VARCHAR}
105
+      </if>
106
+      <if test="obj.orgId != null">
107
+        and org_id = #{obj.orgId,jdbcType=INTEGER}
108
+      </if>
109
+    </where>
110
+    order by bjsj desc
111
+  </select>
96 112
 </mapper>

+ 23 - 0
src/main/java/com/chinaitop/depot/yjbj/model/Zlbj.java

@@ -0,0 +1,23 @@
1
+package com.chinaitop.depot.yjbj.model;
2
+
3
+import java.util.Date;
4
+
5
+import com.fasterxml.jackson.annotation.JsonFormat;
6
+
7
+import lombok.Data;
8
+
9
+@Data
10
+public class Zlbj {
11
+
12
+	private String id;//主键ID
13
+	private String cfmc;//仓房名称
14
+	private String hwmc;//货位名称
15
+	private String pzmc;//品种名称
16
+	private String lyxzmc;//粮油性质名称
17
+	private String crklx;//出入库类型
18
+	private String yjxx;//预警信息
19
+	@JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
20
+	private Date bjsj;//报警时间
21
+	private String approvalStatusName;//处理状态名称
22
+	private Integer orgId;//库ID
23
+}

+ 10 - 0
src/main/java/com/chinaitop/depot/yjbj/service/YjbjService.java

@@ -8,6 +8,7 @@ import com.chinaitop.depot.yjbj.model.Jksbgz;
8 8
 import com.chinaitop.depot.yjbj.model.Jybgcqyj;
9 9
 import com.chinaitop.depot.yjbj.model.Thprkyj;
10 10
 import com.chinaitop.depot.yjbj.model.Zkycbj;
11
+import com.chinaitop.depot.yjbj.model.Zlbj;
11 12
 
12 13
 public interface YjbjService {
13 14
 
@@ -64,4 +65,13 @@ public interface YjbjService {
64 65
 	 * @throws Exception
65 66
 	 */
66 67
 	List<Chbj> selectChbj(Integer orgId, String cforyg) throws Exception;
68
+
69
+	/**
70
+	 * 质量报警数据查询
71
+	 * @param orgId
72
+	 * @param cfmc
73
+	 * @return
74
+	 * @throws Exception
75
+	 */
76
+	List<Zlbj> selectZlbj(Integer orgId, String cfmc) throws Exception;
67 77
 }

+ 12 - 1
src/main/java/com/chinaitop/depot/yjbj/service/impl/YjbjServiceImpl.java

@@ -14,6 +14,7 @@ import com.chinaitop.depot.yjbj.model.Jksbgz;
14 14
 import com.chinaitop.depot.yjbj.model.Jybgcqyj;
15 15
 import com.chinaitop.depot.yjbj.model.Thprkyj;
16 16
 import com.chinaitop.depot.yjbj.model.Zkycbj;
17
+import com.chinaitop.depot.yjbj.model.Zlbj;
17 18
 import com.chinaitop.depot.yjbj.service.YjbjService;
18 19
 
19 20
 @Service
@@ -77,9 +78,19 @@ public class YjbjServiceImpl implements YjbjService {
77 78
 		Chbj obj = new Chbj();
78 79
 		obj.setOrgId(orgId);
79 80
 		if (StringUtils.isNotBlank(cforyg)) {
80
-			obj.setCforyg("%"+cforyg+"%");
81
+			obj.setCforyg(cforyg);
81 82
 		}
82 83
 		return yjbjMapper.selectChbj(obj);
83 84
 	}
84 85
 
86
+	@Override
87
+	public List<Zlbj> selectZlbj(Integer orgId, String cfmc) throws Exception {
88
+		Zlbj obj = new Zlbj();
89
+		obj.setOrgId(orgId);
90
+		if (StringUtils.isNotBlank(cfmc)) {
91
+			obj.setCfmc("%"+cfmc+"%");
92
+		}
93
+		return yjbjMapper.selectZlbj(obj);
94
+	}
95
+
85 96
 }