Procházet zdrojové kódy

Merge branch 'dev-2.2.0' of depot-qinghai/depot-storage-qinghai into dev

fanxw před 1 rokem
rodič
revize
0b9f847b97

+ 24 - 0
src/main/java/com/chinaitop/depot/warningAndAlarm/common/StatusUtils.java

@@ -0,0 +1,24 @@
1
+package com.chinaitop.depot.warningAndAlarm.common;
2
+
3
+public class StatusUtils {
4
+
5
+	/**
6
+     * 数据处理状态:未处理
7
+     */
8
+    public static final String STATUS_0 = "0";
9
+
10
+    /**
11
+     * 数据处理状态:已处理
12
+     */
13
+    public static final String STATUS_1 = "1";
14
+
15
+    /**
16
+     * 轮换报警预警类型:轮换预警
17
+     */
18
+    public static final String LHYJBJ_TYPE_0 = "0";
19
+
20
+    /**
21
+     * 轮换报警预警类型:应轮未轮报警
22
+     */
23
+    public static final String LHYJBJ_TYPE_1 = "1";
24
+}

+ 11 - 0
src/main/java/com/chinaitop/depot/warningAndAlarm/controller/TimedTaskController.java

@@ -43,4 +43,15 @@ public class TimedTaskController {
43
 			log.error(e.getMessage(), e);
43
 			log.error(e.getMessage(), e);
44
 		}
44
 		}
45
 	}
45
 	}
46
+
47
+	@Scheduled(cron = "0 0 2 * * ?")
48
+	@RequestMapping(value="/checkJkqyj", method = RequestMethod.GET)
49
+	@ApiOperation(value="检测架空期预警数据", notes = "定时任务检测,每天凌晨2点执行")
50
+	public void checkJkqyj() {
51
+		try {
52
+			timeTaskService.insertJkqyj();
53
+		} catch (Exception e) {
54
+			log.error(e.getMessage(), e);
55
+		}
56
+	}
46
 }
57
 }

+ 66 - 0
src/main/java/com/chinaitop/depot/warningAndAlarm/controller/YjBjController.java

@@ -12,6 +12,7 @@ import org.springframework.web.bind.annotation.RestController;
12
 
12
 
13
 import com.alibaba.fastjson.JSONObject;
13
 import com.alibaba.fastjson.JSONObject;
14
 import com.chinaitop.depot.unissoft.model.ResponseEntity;
14
 import com.chinaitop.depot.unissoft.model.ResponseEntity;
15
+import com.chinaitop.depot.warningAndAlarm.model.StorageJkqWarning;
15
 import com.chinaitop.depot.warningAndAlarm.model.StorageRotationWarning;
16
 import com.chinaitop.depot.warningAndAlarm.model.StorageRotationWarning;
16
 import com.chinaitop.depot.warningAndAlarm.model.StorageRotationWarningWithBLOBs;
17
 import com.chinaitop.depot.warningAndAlarm.model.StorageRotationWarningWithBLOBs;
17
 import com.chinaitop.depot.warningAndAlarm.service.YjbjService;
18
 import com.chinaitop.depot.warningAndAlarm.service.YjbjService;
@@ -120,4 +121,69 @@ public class YjBjController {
120
 		}
121
 		}
121
 		return ResponseEntity.ok();
122
 		return ResponseEntity.ok();
122
 	}
123
 	}
124
+
125
+	@RequestMapping(value="/getJkqPageInfoList", method = RequestMethod.GET)
126
+	@ApiOperation(value="架空期预警列表", notes = "支持分页")
127
+	@ApiImplicitParams({
128
+		@ApiImplicitParam(name = "pageNum", value = "页码", paramType = "query"),
129
+        @ApiImplicitParam(name = "pageSize", value = "每页条数", paramType = "query"),
130
+        @ApiImplicitParam(name = "orgId", value = "库ID", paramType = "query"),
131
+        @ApiImplicitParam(name = "ch", value = "仓房ID", paramType = "query"),
132
+        @ApiImplicitParam(name = "hwh", value = "货位ID", paramType = "query"),
133
+        @ApiImplicitParam(name = "jhwh", value = "计划文号", paramType = "query"),
134
+        @ApiImplicitParam(name = "lhnd", value = "轮换年度", paramType = "query")
135
+	})
136
+	public ResponseEntity<PageInfo<StorageJkqWarning>> getJkqPageInfoList(Integer pageNum, Integer pageSize, Integer orgId, 
137
+			Integer ch, Integer hwh, String jhwh, String lhnd) {
138
+		PageInfo<StorageJkqWarning> pageInfo = null;
139
+		try {
140
+			if (pageNum != null && pageSize != null) {
141
+	            PageHelper.startPage(pageNum, pageSize);
142
+	        }
143
+			List<StorageJkqWarning> list = yjbjService.queryJkqyjList(orgId, ch, hwh, jhwh, lhnd);
144
+			pageInfo = new PageInfo<>(list);
145
+		} catch (Exception e) {
146
+			log.error(e.getMessage(), e);
147
+		}
148
+		return ResponseEntity.ok(pageInfo);
149
+	}
150
+
151
+	@RequestMapping(value = "queryByIdJkq", produces = MediaType.APPLICATION_JSON_VALUE, method = RequestMethod.GET)
152
+    @ApiOperation(value = "根据id加载架空期数据", notes = "根据id加载架空期数据")
153
+    @ApiImplicitParams({
154
+            @ApiImplicitParam(name = "id", value = "主键id", paramType = "query"),
155
+    })
156
+    public ResponseEntity<StorageJkqWarning> queryByIdJkq(String id) {
157
+        try {
158
+            if (id == null) {
159
+                return ResponseEntity.failed("数据ID不能为空!");
160
+            }
161
+            return ResponseEntity.ok(yjbjService.queryByIdJkq(id));
162
+        } catch (Exception e) {
163
+            e.printStackTrace();
164
+            return ResponseEntity.failed(e.getMessage());
165
+        }
166
+    }
167
+
168
+	@RequestMapping(value="/editJkqyj", method = RequestMethod.GET)
169
+	@ApiOperation(value="架空期预警数据更新", notes = "")
170
+	@ApiImplicitParams({
171
+        @ApiImplicitParam(name = "jkqyjJson", value = "数据对象", paramType = "form")
172
+	})
173
+	public ResponseEntity editJkqyj(String jkqyjJson) {
174
+		try {
175
+			if (StringUtils.isNotBlank(jkqyjJson)) {
176
+				StorageJkqWarning storageJkqWarning = JSONObject.parseObject(jkqyjJson, StorageJkqWarning.class);
177
+                if (storageJkqWarning.getId() == null) {
178
+                    return ResponseEntity.failed("数据ID不能为空!");
179
+                }
180
+
181
+                yjbjService.updateDate(storageJkqWarning);
182
+            }
183
+		} catch (Exception e) {
184
+			log.error(e.getMessage(), e);
185
+			return ResponseEntity.ok(e.getMessage(), jkqyjJson);
186
+		}
187
+		return ResponseEntity.ok();
188
+	}
123
 }
189
 }

+ 36 - 0
src/main/java/com/chinaitop/depot/warningAndAlarm/mapper/StorageJkqWarningMapper.java

@@ -0,0 +1,36 @@
1
+package com.chinaitop.depot.warningAndAlarm.mapper;
2
+
3
+import com.chinaitop.depot.warningAndAlarm.model.StorageJkqWarning;
4
+import com.chinaitop.depot.warningAndAlarm.model.StorageJkqWarningExample;
5
+import java.util.List;
6
+import org.apache.ibatis.annotations.Param;
7
+
8
+public interface StorageJkqWarningMapper {
9
+    int countByExample(StorageJkqWarningExample example);
10
+
11
+    int deleteByExample(StorageJkqWarningExample example);
12
+
13
+    int deleteByPrimaryKey(String id);
14
+
15
+    int insert(StorageJkqWarning record);
16
+
17
+    int insertSelective(StorageJkqWarning record);
18
+
19
+    List<StorageJkqWarning> selectByExampleWithBLOBs(StorageJkqWarningExample example);
20
+
21
+    List<StorageJkqWarning> selectByExample(StorageJkqWarningExample example);
22
+
23
+    StorageJkqWarning selectByPrimaryKey(String id);
24
+
25
+    int updateByExampleSelective(@Param("record") StorageJkqWarning record, @Param("example") StorageJkqWarningExample example);
26
+
27
+    int updateByExampleWithBLOBs(@Param("record") StorageJkqWarning record, @Param("example") StorageJkqWarningExample example);
28
+
29
+    int updateByExample(@Param("record") StorageJkqWarning record, @Param("example") StorageJkqWarningExample example);
30
+
31
+    int updateByPrimaryKeySelective(StorageJkqWarning record);
32
+
33
+    int updateByPrimaryKeyWithBLOBs(StorageJkqWarning record);
34
+
35
+    int updateByPrimaryKey(StorageJkqWarning record);
36
+}

+ 465 - 0
src/main/java/com/chinaitop/depot/warningAndAlarm/mapper/StorageJkqWarningMapper.xml

@@ -0,0 +1,465 @@
1
+<?xml version="1.0" encoding="UTF-8"?>
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.warningAndAlarm.mapper.StorageJkqWarningMapper">
4
+  <resultMap id="BaseResultMap" type="com.chinaitop.depot.warningAndAlarm.model.StorageJkqWarning">
5
+    <id column="id" jdbcType="VARCHAR" property="id" />
6
+    <result column="org_id" jdbcType="INTEGER" property="orgId" />
7
+    <result column="ch" jdbcType="INTEGER" property="ch" />
8
+    <result column="hwh" jdbcType="INTEGER" property="hwh" />
9
+    <result column="jhwh" jdbcType="VARCHAR" property="jhwh" />
10
+    <result column="lhnd" jdbcType="VARCHAR" property="lhnd" />
11
+    <result column="jkqzt" jdbcType="VARCHAR" property="jkqzt" />
12
+    <result column="jkqjzr" jdbcType="VARCHAR" property="jkqjzr" />
13
+    <result column="jzrqylrsl" jdbcType="DECIMAL" property="jzrqylrsl" />
14
+    <result column="jzrqsylrsl" jdbcType="DECIMAL" property="jzrqsylrsl" />
15
+    <result column="yjrq" jdbcType="VARCHAR" property="yjrq" />
16
+    <result column="clzt" jdbcType="VARCHAR" property="clzt" />
17
+    <result column="clr" jdbcType="VARCHAR" property="clr" />
18
+    <result column="clsj" jdbcType="TIMESTAMP" property="clsj" />
19
+    <result column="scsj" jdbcType="TIMESTAMP" property="scsj" />
20
+    <result column="updatetime" jdbcType="TIMESTAMP" property="updatetime" />
21
+  </resultMap>
22
+  <resultMap extends="BaseResultMap" id="ResultMapWithBLOBs" type="com.chinaitop.depot.warningAndAlarm.model.StorageJkqWarning">
23
+    <result column="clyj" jdbcType="LONGVARCHAR" property="clyj" />
24
+  </resultMap>
25
+  <sql id="Example_Where_Clause">
26
+    <where>
27
+      <foreach collection="oredCriteria" item="criteria" separator="or">
28
+        <if test="criteria.valid">
29
+          <trim prefix="(" prefixOverrides="and" suffix=")">
30
+            <foreach collection="criteria.criteria" item="criterion">
31
+              <choose>
32
+                <when test="criterion.noValue">
33
+                  and ${criterion.condition}
34
+                </when>
35
+                <when test="criterion.singleValue">
36
+                  and ${criterion.condition} #{criterion.value}
37
+                </when>
38
+                <when test="criterion.betweenValue">
39
+                  and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
40
+                </when>
41
+                <when test="criterion.listValue">
42
+                  and ${criterion.condition}
43
+                  <foreach close=")" collection="criterion.value" item="listItem" open="(" separator=",">
44
+                    #{listItem}
45
+                  </foreach>
46
+                </when>
47
+              </choose>
48
+            </foreach>
49
+          </trim>
50
+        </if>
51
+      </foreach>
52
+    </where>
53
+  </sql>
54
+  <sql id="Update_By_Example_Where_Clause">
55
+    <where>
56
+      <foreach collection="example.oredCriteria" item="criteria" separator="or">
57
+        <if test="criteria.valid">
58
+          <trim prefix="(" prefixOverrides="and" suffix=")">
59
+            <foreach collection="criteria.criteria" item="criterion">
60
+              <choose>
61
+                <when test="criterion.noValue">
62
+                  and ${criterion.condition}
63
+                </when>
64
+                <when test="criterion.singleValue">
65
+                  and ${criterion.condition} #{criterion.value}
66
+                </when>
67
+                <when test="criterion.betweenValue">
68
+                  and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
69
+                </when>
70
+                <when test="criterion.listValue">
71
+                  and ${criterion.condition}
72
+                  <foreach close=")" collection="criterion.value" item="listItem" open="(" separator=",">
73
+                    #{listItem}
74
+                  </foreach>
75
+                </when>
76
+              </choose>
77
+            </foreach>
78
+          </trim>
79
+        </if>
80
+      </foreach>
81
+    </where>
82
+  </sql>
83
+  <sql id="Base_Column_List">
84
+    id, org_id, ch, hwh, jhwh, lhnd, jkqzt, jkqjzr, jzrqylrsl, jzrqsylrsl, yjrq, clzt, 
85
+    clr, clsj, scsj, updatetime
86
+  </sql>
87
+  <sql id="Blob_Column_List">
88
+    clyj
89
+  </sql>
90
+  <select id="selectByExampleWithBLOBs" parameterType="com.chinaitop.depot.warningAndAlarm.model.StorageJkqWarningExample" resultMap="ResultMapWithBLOBs">
91
+    select
92
+    <if test="distinct">
93
+      distinct
94
+    </if>
95
+    <include refid="Base_Column_List" />
96
+    ,
97
+    <include refid="Blob_Column_List" />
98
+    from storage_jkq_warning
99
+    <if test="_parameter != null">
100
+      <include refid="Example_Where_Clause" />
101
+    </if>
102
+    <if test="orderByClause != null">
103
+      order by ${orderByClause}
104
+    </if>
105
+  </select>
106
+  <select id="selectByExample" parameterType="com.chinaitop.depot.warningAndAlarm.model.StorageJkqWarningExample" resultMap="BaseResultMap">
107
+    select
108
+    <if test="distinct">
109
+      distinct
110
+    </if>
111
+    <include refid="Base_Column_List" />
112
+    from storage_jkq_warning
113
+    <if test="_parameter != null">
114
+      <include refid="Example_Where_Clause" />
115
+    </if>
116
+    <if test="orderByClause != null">
117
+      order by ${orderByClause}
118
+    </if>
119
+  </select>
120
+  <select id="selectByPrimaryKey" parameterType="java.lang.String" resultMap="ResultMapWithBLOBs">
121
+    select 
122
+    <include refid="Base_Column_List" />
123
+    ,
124
+    <include refid="Blob_Column_List" />
125
+    from storage_jkq_warning
126
+    where id = #{id,jdbcType=VARCHAR}
127
+  </select>
128
+  <delete id="deleteByPrimaryKey" parameterType="java.lang.String">
129
+    delete from storage_jkq_warning
130
+    where id = #{id,jdbcType=VARCHAR}
131
+  </delete>
132
+  <delete id="deleteByExample" parameterType="com.chinaitop.depot.warningAndAlarm.model.StorageJkqWarningExample">
133
+    delete from storage_jkq_warning
134
+    <if test="_parameter != null">
135
+      <include refid="Example_Where_Clause" />
136
+    </if>
137
+  </delete>
138
+  <insert id="insert" parameterType="com.chinaitop.depot.warningAndAlarm.model.StorageJkqWarning">
139
+    insert into storage_jkq_warning (id, org_id, ch, 
140
+      hwh, jhwh, lhnd, jkqzt, 
141
+      jkqjzr, jzrqylrsl, jzrqsylrsl, 
142
+      yjrq, clzt, clr, clsj, 
143
+      scsj, updatetime, clyj
144
+      )
145
+    values (#{id,jdbcType=VARCHAR}, #{orgId,jdbcType=INTEGER}, #{ch,jdbcType=INTEGER}, 
146
+      #{hwh,jdbcType=INTEGER}, #{jhwh,jdbcType=VARCHAR}, #{lhnd,jdbcType=VARCHAR}, #{jkqzt,jdbcType=VARCHAR}, 
147
+      #{jkqjzr,jdbcType=VARCHAR}, #{jzrqylrsl,jdbcType=DECIMAL}, #{jzrqsylrsl,jdbcType=DECIMAL}, 
148
+      #{yjrq,jdbcType=VARCHAR}, #{clzt,jdbcType=VARCHAR}, #{clr,jdbcType=VARCHAR}, #{clsj,jdbcType=TIMESTAMP}, 
149
+      #{scsj,jdbcType=TIMESTAMP}, #{updatetime,jdbcType=TIMESTAMP}, #{clyj,jdbcType=LONGVARCHAR}
150
+      )
151
+  </insert>
152
+  <insert id="insertSelective" parameterType="com.chinaitop.depot.warningAndAlarm.model.StorageJkqWarning">
153
+    insert into storage_jkq_warning
154
+    <trim prefix="(" suffix=")" suffixOverrides=",">
155
+      <if test="id != null">
156
+        id,
157
+      </if>
158
+      <if test="orgId != null">
159
+        org_id,
160
+      </if>
161
+      <if test="ch != null">
162
+        ch,
163
+      </if>
164
+      <if test="hwh != null">
165
+        hwh,
166
+      </if>
167
+      <if test="jhwh != null">
168
+        jhwh,
169
+      </if>
170
+      <if test="lhnd != null">
171
+        lhnd,
172
+      </if>
173
+      <if test="jkqzt != null">
174
+        jkqzt,
175
+      </if>
176
+      <if test="jkqjzr != null">
177
+        jkqjzr,
178
+      </if>
179
+      <if test="jzrqylrsl != null">
180
+        jzrqylrsl,
181
+      </if>
182
+      <if test="jzrqsylrsl != null">
183
+        jzrqsylrsl,
184
+      </if>
185
+      <if test="yjrq != null">
186
+        yjrq,
187
+      </if>
188
+      <if test="clzt != null">
189
+        clzt,
190
+      </if>
191
+      <if test="clr != null">
192
+        clr,
193
+      </if>
194
+      <if test="clsj != null">
195
+        clsj,
196
+      </if>
197
+      <if test="scsj != null">
198
+        scsj,
199
+      </if>
200
+      <if test="updatetime != null">
201
+        updatetime,
202
+      </if>
203
+      <if test="clyj != null">
204
+        clyj,
205
+      </if>
206
+    </trim>
207
+    <trim prefix="values (" suffix=")" suffixOverrides=",">
208
+      <if test="id != null">
209
+        #{id,jdbcType=VARCHAR},
210
+      </if>
211
+      <if test="orgId != null">
212
+        #{orgId,jdbcType=INTEGER},
213
+      </if>
214
+      <if test="ch != null">
215
+        #{ch,jdbcType=INTEGER},
216
+      </if>
217
+      <if test="hwh != null">
218
+        #{hwh,jdbcType=INTEGER},
219
+      </if>
220
+      <if test="jhwh != null">
221
+        #{jhwh,jdbcType=VARCHAR},
222
+      </if>
223
+      <if test="lhnd != null">
224
+        #{lhnd,jdbcType=VARCHAR},
225
+      </if>
226
+      <if test="jkqzt != null">
227
+        #{jkqzt,jdbcType=VARCHAR},
228
+      </if>
229
+      <if test="jkqjzr != null">
230
+        #{jkqjzr,jdbcType=VARCHAR},
231
+      </if>
232
+      <if test="jzrqylrsl != null">
233
+        #{jzrqylrsl,jdbcType=DECIMAL},
234
+      </if>
235
+      <if test="jzrqsylrsl != null">
236
+        #{jzrqsylrsl,jdbcType=DECIMAL},
237
+      </if>
238
+      <if test="yjrq != null">
239
+        #{yjrq,jdbcType=VARCHAR},
240
+      </if>
241
+      <if test="clzt != null">
242
+        #{clzt,jdbcType=VARCHAR},
243
+      </if>
244
+      <if test="clr != null">
245
+        #{clr,jdbcType=VARCHAR},
246
+      </if>
247
+      <if test="clsj != null">
248
+        #{clsj,jdbcType=TIMESTAMP},
249
+      </if>
250
+      <if test="scsj != null">
251
+        #{scsj,jdbcType=TIMESTAMP},
252
+      </if>
253
+      <if test="updatetime != null">
254
+        #{updatetime,jdbcType=TIMESTAMP},
255
+      </if>
256
+      <if test="clyj != null">
257
+        #{clyj,jdbcType=LONGVARCHAR},
258
+      </if>
259
+    </trim>
260
+  </insert>
261
+  <select id="countByExample" parameterType="com.chinaitop.depot.warningAndAlarm.model.StorageJkqWarningExample" resultType="java.lang.Integer">
262
+    select count(*) from storage_jkq_warning
263
+    <if test="_parameter != null">
264
+      <include refid="Example_Where_Clause" />
265
+    </if>
266
+  </select>
267
+  <update id="updateByExampleSelective" parameterType="map">
268
+    update storage_jkq_warning
269
+    <set>
270
+      <if test="record.id != null">
271
+        id = #{record.id,jdbcType=VARCHAR},
272
+      </if>
273
+      <if test="record.orgId != null">
274
+        org_id = #{record.orgId,jdbcType=INTEGER},
275
+      </if>
276
+      <if test="record.ch != null">
277
+        ch = #{record.ch,jdbcType=INTEGER},
278
+      </if>
279
+      <if test="record.hwh != null">
280
+        hwh = #{record.hwh,jdbcType=INTEGER},
281
+      </if>
282
+      <if test="record.jhwh != null">
283
+        jhwh = #{record.jhwh,jdbcType=VARCHAR},
284
+      </if>
285
+      <if test="record.lhnd != null">
286
+        lhnd = #{record.lhnd,jdbcType=VARCHAR},
287
+      </if>
288
+      <if test="record.jkqzt != null">
289
+        jkqzt = #{record.jkqzt,jdbcType=VARCHAR},
290
+      </if>
291
+      <if test="record.jkqjzr != null">
292
+        jkqjzr = #{record.jkqjzr,jdbcType=VARCHAR},
293
+      </if>
294
+      <if test="record.jzrqylrsl != null">
295
+        jzrqylrsl = #{record.jzrqylrsl,jdbcType=DECIMAL},
296
+      </if>
297
+      <if test="record.jzrqsylrsl != null">
298
+        jzrqsylrsl = #{record.jzrqsylrsl,jdbcType=DECIMAL},
299
+      </if>
300
+      <if test="record.yjrq != null">
301
+        yjrq = #{record.yjrq,jdbcType=VARCHAR},
302
+      </if>
303
+      <if test="record.clzt != null">
304
+        clzt = #{record.clzt,jdbcType=VARCHAR},
305
+      </if>
306
+      <if test="record.clr != null">
307
+        clr = #{record.clr,jdbcType=VARCHAR},
308
+      </if>
309
+      <if test="record.clsj != null">
310
+        clsj = #{record.clsj,jdbcType=TIMESTAMP},
311
+      </if>
312
+      <if test="record.scsj != null">
313
+        scsj = #{record.scsj,jdbcType=TIMESTAMP},
314
+      </if>
315
+      <if test="record.updatetime != null">
316
+        updatetime = #{record.updatetime,jdbcType=TIMESTAMP},
317
+      </if>
318
+      <if test="record.clyj != null">
319
+        clyj = #{record.clyj,jdbcType=LONGVARCHAR},
320
+      </if>
321
+    </set>
322
+    <if test="_parameter != null">
323
+      <include refid="Update_By_Example_Where_Clause" />
324
+    </if>
325
+  </update>
326
+  <update id="updateByExampleWithBLOBs" parameterType="map">
327
+    update storage_jkq_warning
328
+    set id = #{record.id,jdbcType=VARCHAR},
329
+      org_id = #{record.orgId,jdbcType=INTEGER},
330
+      ch = #{record.ch,jdbcType=INTEGER},
331
+      hwh = #{record.hwh,jdbcType=INTEGER},
332
+      jhwh = #{record.jhwh,jdbcType=VARCHAR},
333
+      lhnd = #{record.lhnd,jdbcType=VARCHAR},
334
+      jkqzt = #{record.jkqzt,jdbcType=VARCHAR},
335
+      jkqjzr = #{record.jkqjzr,jdbcType=VARCHAR},
336
+      jzrqylrsl = #{record.jzrqylrsl,jdbcType=DECIMAL},
337
+      jzrqsylrsl = #{record.jzrqsylrsl,jdbcType=DECIMAL},
338
+      yjrq = #{record.yjrq,jdbcType=VARCHAR},
339
+      clzt = #{record.clzt,jdbcType=VARCHAR},
340
+      clr = #{record.clr,jdbcType=VARCHAR},
341
+      clsj = #{record.clsj,jdbcType=TIMESTAMP},
342
+      scsj = #{record.scsj,jdbcType=TIMESTAMP},
343
+      updatetime = #{record.updatetime,jdbcType=TIMESTAMP},
344
+      clyj = #{record.clyj,jdbcType=LONGVARCHAR}
345
+    <if test="_parameter != null">
346
+      <include refid="Update_By_Example_Where_Clause" />
347
+    </if>
348
+  </update>
349
+  <update id="updateByExample" parameterType="map">
350
+    update storage_jkq_warning
351
+    set id = #{record.id,jdbcType=VARCHAR},
352
+      org_id = #{record.orgId,jdbcType=INTEGER},
353
+      ch = #{record.ch,jdbcType=INTEGER},
354
+      hwh = #{record.hwh,jdbcType=INTEGER},
355
+      jhwh = #{record.jhwh,jdbcType=VARCHAR},
356
+      lhnd = #{record.lhnd,jdbcType=VARCHAR},
357
+      jkqzt = #{record.jkqzt,jdbcType=VARCHAR},
358
+      jkqjzr = #{record.jkqjzr,jdbcType=VARCHAR},
359
+      jzrqylrsl = #{record.jzrqylrsl,jdbcType=DECIMAL},
360
+      jzrqsylrsl = #{record.jzrqsylrsl,jdbcType=DECIMAL},
361
+      yjrq = #{record.yjrq,jdbcType=VARCHAR},
362
+      clzt = #{record.clzt,jdbcType=VARCHAR},
363
+      clr = #{record.clr,jdbcType=VARCHAR},
364
+      clsj = #{record.clsj,jdbcType=TIMESTAMP},
365
+      scsj = #{record.scsj,jdbcType=TIMESTAMP},
366
+      updatetime = #{record.updatetime,jdbcType=TIMESTAMP}
367
+    <if test="_parameter != null">
368
+      <include refid="Update_By_Example_Where_Clause" />
369
+    </if>
370
+  </update>
371
+  <update id="updateByPrimaryKeySelective" parameterType="com.chinaitop.depot.warningAndAlarm.model.StorageJkqWarning">
372
+    update storage_jkq_warning
373
+    <set>
374
+      <if test="orgId != null">
375
+        org_id = #{orgId,jdbcType=INTEGER},
376
+      </if>
377
+      <if test="ch != null">
378
+        ch = #{ch,jdbcType=INTEGER},
379
+      </if>
380
+      <if test="hwh != null">
381
+        hwh = #{hwh,jdbcType=INTEGER},
382
+      </if>
383
+      <if test="jhwh != null">
384
+        jhwh = #{jhwh,jdbcType=VARCHAR},
385
+      </if>
386
+      <if test="lhnd != null">
387
+        lhnd = #{lhnd,jdbcType=VARCHAR},
388
+      </if>
389
+      <if test="jkqzt != null">
390
+        jkqzt = #{jkqzt,jdbcType=VARCHAR},
391
+      </if>
392
+      <if test="jkqjzr != null">
393
+        jkqjzr = #{jkqjzr,jdbcType=VARCHAR},
394
+      </if>
395
+      <if test="jzrqylrsl != null">
396
+        jzrqylrsl = #{jzrqylrsl,jdbcType=DECIMAL},
397
+      </if>
398
+      <if test="jzrqsylrsl != null">
399
+        jzrqsylrsl = #{jzrqsylrsl,jdbcType=DECIMAL},
400
+      </if>
401
+      <if test="yjrq != null">
402
+        yjrq = #{yjrq,jdbcType=VARCHAR},
403
+      </if>
404
+      <if test="clzt != null">
405
+        clzt = #{clzt,jdbcType=VARCHAR},
406
+      </if>
407
+      <if test="clr != null">
408
+        clr = #{clr,jdbcType=VARCHAR},
409
+      </if>
410
+      <if test="clsj != null">
411
+        clsj = #{clsj,jdbcType=TIMESTAMP},
412
+      </if>
413
+      <if test="scsj != null">
414
+        scsj = #{scsj,jdbcType=TIMESTAMP},
415
+      </if>
416
+      <if test="updatetime != null">
417
+        updatetime = #{updatetime,jdbcType=TIMESTAMP},
418
+      </if>
419
+      <if test="clyj != null">
420
+        clyj = #{clyj,jdbcType=LONGVARCHAR},
421
+      </if>
422
+    </set>
423
+    where id = #{id,jdbcType=VARCHAR}
424
+  </update>
425
+  <update id="updateByPrimaryKeyWithBLOBs" parameterType="com.chinaitop.depot.warningAndAlarm.model.StorageJkqWarning">
426
+    update storage_jkq_warning
427
+    set org_id = #{orgId,jdbcType=INTEGER},
428
+      ch = #{ch,jdbcType=INTEGER},
429
+      hwh = #{hwh,jdbcType=INTEGER},
430
+      jhwh = #{jhwh,jdbcType=VARCHAR},
431
+      lhnd = #{lhnd,jdbcType=VARCHAR},
432
+      jkqzt = #{jkqzt,jdbcType=VARCHAR},
433
+      jkqjzr = #{jkqjzr,jdbcType=VARCHAR},
434
+      jzrqylrsl = #{jzrqylrsl,jdbcType=DECIMAL},
435
+      jzrqsylrsl = #{jzrqsylrsl,jdbcType=DECIMAL},
436
+      yjrq = #{yjrq,jdbcType=VARCHAR},
437
+      clzt = #{clzt,jdbcType=VARCHAR},
438
+      clr = #{clr,jdbcType=VARCHAR},
439
+      clsj = #{clsj,jdbcType=TIMESTAMP},
440
+      scsj = #{scsj,jdbcType=TIMESTAMP},
441
+      updatetime = #{updatetime,jdbcType=TIMESTAMP},
442
+      clyj = #{clyj,jdbcType=LONGVARCHAR}
443
+    where id = #{id,jdbcType=VARCHAR}
444
+  </update>
445
+  <update id="updateByPrimaryKey" parameterType="com.chinaitop.depot.warningAndAlarm.model.StorageJkqWarning">
446
+    update storage_jkq_warning
447
+    set org_id = #{orgId,jdbcType=INTEGER},
448
+      ch = #{ch,jdbcType=INTEGER},
449
+      hwh = #{hwh,jdbcType=INTEGER},
450
+      jhwh = #{jhwh,jdbcType=VARCHAR},
451
+      lhnd = #{lhnd,jdbcType=VARCHAR},
452
+      jkqzt = #{jkqzt,jdbcType=VARCHAR},
453
+      jkqjzr = #{jkqjzr,jdbcType=VARCHAR},
454
+      jzrqylrsl = #{jzrqylrsl,jdbcType=DECIMAL},
455
+      jzrqsylrsl = #{jzrqsylrsl,jdbcType=DECIMAL},
456
+      yjrq = #{yjrq,jdbcType=VARCHAR},
457
+      clzt = #{clzt,jdbcType=VARCHAR},
458
+      clr = #{clr,jdbcType=VARCHAR},
459
+      clsj = #{clsj,jdbcType=TIMESTAMP},
460
+      scsj = #{scsj,jdbcType=TIMESTAMP},
461
+      updatetime = #{updatetime,jdbcType=TIMESTAMP}
462
+    where id = #{id,jdbcType=VARCHAR}
463
+  </update>
464
+  
465
+</mapper>

+ 13 - 0
src/main/java/com/chinaitop/depot/warningAndAlarm/mapper/TimedTaskMapper.java

@@ -1,7 +1,9 @@
1
 package com.chinaitop.depot.warningAndAlarm.mapper;
1
 package com.chinaitop.depot.warningAndAlarm.mapper;
2
 
2
 
3
 import java.util.List;
3
 import java.util.List;
4
+import java.util.Map;
4
 
5
 
6
+import com.chinaitop.depot.warningAndAlarm.model.StorageJkqWarning;
5
 import com.chinaitop.depot.warningAndAlarm.model.StorageRotationWarningWithBLOBs;
7
 import com.chinaitop.depot.warningAndAlarm.model.StorageRotationWarningWithBLOBs;
6
 
8
 
7
 public interface TimedTaskMapper {
9
 public interface TimedTaskMapper {
@@ -15,4 +17,15 @@ public interface TimedTaskMapper {
15
 	 * 检查轮换预警的数据
17
 	 * 检查轮换预警的数据
16
 	 */
18
 	 */
17
 	List<StorageRotationWarningWithBLOBs> selectLhyj();
19
 	List<StorageRotationWarningWithBLOBs> selectLhyj();
20
+
21
+	/**
22
+	 * 检查架空期预警的前置数据
23
+	 */
24
+	List<StorageJkqWarning> selectJkqjyqzsj();
25
+
26
+	/**
27
+     * 查询架空期预警的其它数据
28
+     * @return
29
+     */
30
+	StorageJkqWarning selectJkqjyqtsj(Map<String, String> map);
18
 }
31
 }

+ 40 - 0
src/main/java/com/chinaitop/depot/warningAndAlarm/mapper/TimedTaskMapper.xml

@@ -58,4 +58,44 @@
58
     WHERE 1=1 
58
     WHERE 1=1 
59
     and DATE_FORMAT(NOW(), '%Y-%m-%d') >= DATE_FORMAT(datas.bjrq, '%Y-%m-%d')
59
     and DATE_FORMAT(NOW(), '%Y-%m-%d') >= DATE_FORMAT(datas.bjrq, '%Y-%m-%d')
60
   </select>
60
   </select>
61
+
62
+  <select id="selectJkqjyqzsj" resultType="com.chinaitop.depot.warningAndAlarm.model.StorageJkqWarning">
63
+     SELECT 
64
+       REPLACE(UUID(), '-', '') id,
65
+       a.plan_year lhnd,
66
+       tzdxx.chID ch,
67
+       tzdxx.hwID hwh,
68
+       a.plan_number jhwh,
69
+       tzdxx.UnitID org_id,
70
+       tzdxx.jzrqylrsl,
71
+       tzdxx.jzrqsylrsl,
72
+       a.start_date startDate,
73
+       a.end_date endDate
74
+       FROM province_all.biz_rp_issuance a 
75
+     LEFT JOIN (
76
+       SELECT 
77
+         tzdcb.UnitID,tzdzb.jhdID, tzdcb.chID, tzdcb.hwID, SUM(tzdcb.count) jzrqylrsl, SUM(tzdcb.sysl) jzrqsylrsl
78
+       from crk_qh.data_crkyw_tzdxx_default tzdzb
79
+       LEFT JOIN crk_qh.data_crkyw_tzdxx_flt_001 tzdcb on tzdcb.MainDataID=tzdzb.DataID
80
+       INNER JOIN business_rp_inbound rkjh on rkjh.rp_report_id=tzdzb.jhdID
81
+       GROUP BY tzdzb.jhdID, tzdcb.hwID
82
+     ) tzdxx ON tzdxx.jhdID=a.rp_report_id
83
+     WHERE 1=1 
84
+     AND DATE_FORMAT(CURDATE(), "%Y-%m-%d") BETWEEN a.start_date AND a.end_date
85
+    </select>
86
+
87
+    <select id="selectJkqjyqtsj" resultType="com.chinaitop.depot.warningAndAlarm.model.StorageJkqWarning" parameterType="java.util.Map">
88
+      SELECT 
89
+        CASE WHEN CURDATE() > LAST_DAY(DATE_ADD(m1.rq, INTERVAL 4 MONTH)) THEN '1' ELSE '0' END jkqzt,
90
+        LAST_DAY(DATE_ADD(m1.rq, INTERVAL 4 MONTH)) jkqjzr,
91
+        LAST_DAY(DATE_ADD(m1.rq, INTERVAL 4 MONTH)) - INTERVAL 15 DAY yjrq
92
+      from crk_qh.data_kcgl_fcbgz_default m1 
93
+      INNER JOIN crk_qh.data_crkyw_ckcmz_default m2 ON m1.DataID = m2.DataID
94
+      INNER JOIN crk_qh.data_crkyw_ckrmdj_default m3 ON m3.bizno = m2.bizno 
95
+      WHERE 1=1 
96
+      AND m1.hwh=#{hwh,jdbcType=VARCHAR}
97
+      AND DATE_FORMAT(m1.rq, "%Y-%m-%d") BETWEEN #{startDate,jdbcType=VARCHAR} AND #{EndDate,jdbcType=VARCHAR}
98
+      ORDER BY m1.rq ASC
99
+      LIMIT 1
100
+    </select>
61
 </mapper>
101
 </mapper>

+ 354 - 0
src/main/java/com/chinaitop/depot/warningAndAlarm/model/StorageJkqWarning.java

@@ -0,0 +1,354 @@
1
+package com.chinaitop.depot.warningAndAlarm.model;
2
+
3
+import java.math.BigDecimal;
4
+import java.util.Date;
5
+
6
+import com.fasterxml.jackson.annotation.JsonFormat;
7
+
8
+public class StorageJkqWarning {
9
+    private String id;
10
+
11
+    private Integer orgId;
12
+
13
+    private Integer ch;
14
+
15
+    private Integer hwh;
16
+
17
+    private String jhwh;
18
+
19
+    private String lhnd;
20
+
21
+    private String jkqzt;
22
+
23
+    private String jkqjzr;
24
+
25
+    private BigDecimal jzrqylrsl;
26
+
27
+    private BigDecimal jzrqsylrsl;
28
+
29
+    private String yjrq;
30
+
31
+    private String clzt;
32
+
33
+    private String clr;
34
+
35
+    @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
36
+    private Date clsj;
37
+
38
+    @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
39
+    private Date scsj;
40
+
41
+    @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
42
+    private Date updatetime;
43
+
44
+    private String clyj;
45
+
46
+    private String startDate;
47
+
48
+    private String endDate;
49
+
50
+    /**
51
+     * 唯一主键uuid
52
+     * @return id 唯一主键uuid
53
+     */
54
+    public String getId() {
55
+        return id;
56
+    }
57
+
58
+    /**
59
+     * 唯一主键uuid
60
+     * @param id 唯一主键uuid
61
+     */
62
+    public void setId(String id) {
63
+        this.id = id == null ? null : id.trim();
64
+    }
65
+
66
+    /**
67
+     * 库ID
68
+     * @return org_id 库ID
69
+     */
70
+    public Integer getOrgId() {
71
+        return orgId;
72
+    }
73
+
74
+    /**
75
+     * 库ID
76
+     * @param orgId 库ID
77
+     */
78
+    public void setOrgId(Integer orgId) {
79
+        this.orgId = orgId;
80
+    }
81
+
82
+    /**
83
+     * 仓房ID
84
+     * @return ch 仓房ID
85
+     */
86
+    public Integer getCh() {
87
+        return ch;
88
+    }
89
+
90
+    /**
91
+     * 仓房ID
92
+     * @param ch 仓房ID
93
+     */
94
+    public void setCh(Integer ch) {
95
+        this.ch = ch;
96
+    }
97
+
98
+    /**
99
+     * 货位ID
100
+     * @return hwh 货位ID
101
+     */
102
+    public Integer getHwh() {
103
+        return hwh;
104
+    }
105
+
106
+    /**
107
+     * 货位ID
108
+     * @param hwh 货位ID
109
+     */
110
+    public void setHwh(Integer hwh) {
111
+        this.hwh = hwh;
112
+    }
113
+
114
+    /**
115
+     * 计划文号
116
+     * @return jhwh 计划文号
117
+     */
118
+    public String getJhwh() {
119
+        return jhwh;
120
+    }
121
+
122
+    /**
123
+     * 计划文号
124
+     * @param jhwh 计划文号
125
+     */
126
+    public void setJhwh(String jhwh) {
127
+        this.jhwh = jhwh == null ? null : jhwh.trim();
128
+    }
129
+
130
+    /**
131
+     * 轮换年度
132
+     * @return lhnd 轮换年度
133
+     */
134
+    public String getLhnd() {
135
+        return lhnd;
136
+    }
137
+
138
+    /**
139
+     * 轮换年度
140
+     * @param lhnd 轮换年度
141
+     */
142
+    public void setLhnd(String lhnd) {
143
+        this.lhnd = lhnd == null ? null : lhnd.trim();
144
+    }
145
+
146
+    /**
147
+     * 架空期状态(0:正常,1:延期)
148
+     * @return jkqzt 架空期状态(0:正常,1:延期)
149
+     */
150
+    public String getJkqzt() {
151
+        return jkqzt;
152
+    }
153
+
154
+    /**
155
+     * 架空期状态(0:正常,1:延期)
156
+     * @param jkqzt 架空期状态(0:正常,1:延期)
157
+     */
158
+    public void setJkqzt(String jkqzt) {
159
+        this.jkqzt = jkqzt == null ? null : jkqzt.trim();
160
+    }
161
+
162
+    /**
163
+     * 架空期截止日
164
+     * @return jkqjzr 架空期截止日
165
+     */
166
+    public String getJkqjzr() {
167
+        return jkqjzr;
168
+    }
169
+
170
+    /**
171
+     * 架空期截止日
172
+     * @param jkqjzr 架空期截止日
173
+     */
174
+    public void setJkqjzr(String jkqjzr) {
175
+        this.jkqjzr = jkqjzr == null ? null : jkqjzr.trim();
176
+    }
177
+
178
+    /**
179
+     * 截止日前应轮入数量
180
+     * @return jzrqylrsl 截止日前应轮入数量
181
+     */
182
+    public BigDecimal getJzrqylrsl() {
183
+        return jzrqylrsl;
184
+    }
185
+
186
+    /**
187
+     * 截止日前应轮入数量
188
+     * @param jzrqylrsl 截止日前应轮入数量
189
+     */
190
+    public void setJzrqylrsl(BigDecimal jzrqylrsl) {
191
+        this.jzrqylrsl = jzrqylrsl;
192
+    }
193
+
194
+    /**
195
+     * 截止日前剩余轮入数量
196
+     * @return jzrqsylrsl 截止日前剩余轮入数量
197
+     */
198
+    public BigDecimal getJzrqsylrsl() {
199
+        return jzrqsylrsl;
200
+    }
201
+
202
+    /**
203
+     * 截止日前剩余轮入数量
204
+     * @param jzrqsylrsl 截止日前剩余轮入数量
205
+     */
206
+    public void setJzrqsylrsl(BigDecimal jzrqsylrsl) {
207
+        this.jzrqsylrsl = jzrqsylrsl;
208
+    }
209
+
210
+    /**
211
+     * 预警日期
212
+     * @return yjrq 预警日期
213
+     */
214
+    public String getYjrq() {
215
+        return yjrq;
216
+    }
217
+
218
+    /**
219
+     * 预警日期
220
+     * @param yjrq 预警日期
221
+     */
222
+    public void setYjrq(String yjrq) {
223
+        this.yjrq = yjrq == null ? null : yjrq.trim();
224
+    }
225
+
226
+    /**
227
+     * 处理状态(0:未处理,1:已处理)
228
+     * @return clzt 处理状态(0:未处理,1:已处理)
229
+     */
230
+    public String getClzt() {
231
+        return clzt;
232
+    }
233
+
234
+    /**
235
+     * 处理状态(0:未处理,1:已处理)
236
+     * @param clzt 处理状态(0:未处理,1:已处理)
237
+     */
238
+    public void setClzt(String clzt) {
239
+        this.clzt = clzt == null ? null : clzt.trim();
240
+    }
241
+
242
+    /**
243
+     * 处理人
244
+     * @return clr 处理人
245
+     */
246
+    public String getClr() {
247
+        return clr;
248
+    }
249
+
250
+    /**
251
+     * 处理人
252
+     * @param clr 处理人
253
+     */
254
+    public void setClr(String clr) {
255
+        this.clr = clr == null ? null : clr.trim();
256
+    }
257
+
258
+    /**
259
+     * 处理时间
260
+     * @return clsj 处理时间
261
+     */
262
+    public Date getClsj() {
263
+        return clsj;
264
+    }
265
+
266
+    /**
267
+     * 处理时间
268
+     * @param clsj 处理时间
269
+     */
270
+    public void setClsj(Date clsj) {
271
+        this.clsj = clsj;
272
+    }
273
+
274
+    /**
275
+     * 数据生成时间
276
+     * @return scsj 数据生成时间
277
+     */
278
+    public Date getScsj() {
279
+        return scsj;
280
+    }
281
+
282
+    /**
283
+     * 数据生成时间
284
+     * @param scsj 数据生成时间
285
+     */
286
+    public void setScsj(Date scsj) {
287
+        this.scsj = scsj;
288
+    }
289
+
290
+    /**
291
+     * 最后修改时间
292
+     * @return updatetime 最后修改时间
293
+     */
294
+    public Date getUpdatetime() {
295
+        return updatetime;
296
+    }
297
+
298
+    /**
299
+     * 最后修改时间
300
+     * @param updatetime 最后修改时间
301
+     */
302
+    public void setUpdatetime(Date updatetime) {
303
+        this.updatetime = updatetime;
304
+    }
305
+
306
+    /**
307
+     * 处理意见
308
+     * @return clyj 处理意见
309
+     */
310
+    public String getClyj() {
311
+        return clyj;
312
+    }
313
+
314
+    /**
315
+     * 处理意见
316
+     * @param clyj 处理意见
317
+     */
318
+    public void setClyj(String clyj) {
319
+        this.clyj = clyj == null ? null : clyj.trim();
320
+    }
321
+
322
+    /**
323
+     * 计划开始执行时间
324
+     * @return
325
+     */
326
+	public String getStartDate() {
327
+		return startDate;
328
+	}
329
+
330
+	/**
331
+	 * 计划开始执行时间
332
+	 * @param startDate
333
+	 */
334
+	public void setStartDate(String startDate) {
335
+		this.startDate = startDate;
336
+	}
337
+
338
+	/**
339
+	 * 计划结束执行时间
340
+	 * @return
341
+	 */
342
+	public String getEndDate() {
343
+		return endDate;
344
+	}
345
+
346
+	/**
347
+	 * 计划结束执行时间
348
+	 * @param endDate
349
+	 */
350
+	public void setEndDate(String endDate) {
351
+		this.endDate = endDate;
352
+	}
353
+    
354
+}

Diff nebyl zobrazen, protože je příliš veliký
+ 1260 - 0
src/main/java/com/chinaitop/depot/warningAndAlarm/model/StorageJkqWarningExample.java


+ 7 - 1
src/main/java/com/chinaitop/depot/warningAndAlarm/service/TimedTaskService.java

@@ -11,5 +11,11 @@ public interface TimedTaskService {
11
 	/**
11
 	/**
12
 	 * 检测达到轮换预警的数据并保存
12
 	 * 检测达到轮换预警的数据并保存
13
 	 */
13
 	 */
14
-	void insertLhyj();
14
+	void insertLhyj() throws Exception;
15
+
16
+	/**
17
+	 * 检测架空期预警的数据并保存
18
+	 * @throws Exception
19
+	 */
20
+	void insertJkqyj() throws Exception;
15
 }
21
 }

+ 30 - 2
src/main/java/com/chinaitop/depot/warningAndAlarm/service/YjbjService.java

@@ -2,6 +2,7 @@ package com.chinaitop.depot.warningAndAlarm.service;
2
 
2
 
3
 import java.util.List;
3
 import java.util.List;
4
 
4
 
5
+import com.chinaitop.depot.warningAndAlarm.model.StorageJkqWarning;
5
 import com.chinaitop.depot.warningAndAlarm.model.StorageRotationWarning;
6
 import com.chinaitop.depot.warningAndAlarm.model.StorageRotationWarning;
6
 import com.chinaitop.depot.warningAndAlarm.model.StorageRotationWarningWithBLOBs;
7
 import com.chinaitop.depot.warningAndAlarm.model.StorageRotationWarningWithBLOBs;
7
 
8
 
@@ -37,10 +38,37 @@ public interface YjbjService {
37
 	public void updateDate(StorageRotationWarningWithBLOBs storageRotationWarningWithBLOBs) throws Exception;
38
 	public void updateDate(StorageRotationWarningWithBLOBs storageRotationWarningWithBLOBs) throws Exception;
38
 
39
 
39
 	/**
40
 	/**
40
-	 * 按主键ID查询一条数据
41
-	 * @param id
41
+	 * 按主键ID查询一条轮换预警报警数据
42
+	 * @param id 主键唯一ID
42
 	 * @return
43
 	 * @return
43
 	 * @throws Exception 
44
 	 * @throws Exception 
44
 	 */
45
 	 */
45
 	public StorageRotationWarningWithBLOBs queryById(String id) throws Exception;
46
 	public StorageRotationWarningWithBLOBs queryById(String id) throws Exception;
47
+
48
+	/**
49
+	 * 查询架空期预警列表数据
50
+	 * @param orgId 库ID
51
+	 * @param ch 仓房ID
52
+	 * @param hwh 货位ID
53
+	 * @param jhwh 计划文号
54
+	 * @param lhnd 轮换年度
55
+	 * @return
56
+	 * @throws Exception
57
+	 */
58
+	public List<StorageJkqWarning> queryJkqyjList(Integer orgId, Integer ch, Integer hwh, String jhwh, String lhnd) throws Exception;
59
+
60
+	/**
61
+	 * 按主键ID查询一条架空期预警数据
62
+	 * @param id 主键唯一ID
63
+	 * @return
64
+	 * @throws Exception
65
+	 */
66
+	public StorageJkqWarning queryByIdJkq(String id) throws Exception;
67
+
68
+	/**
69
+	 * 更新架空期预警数据的处理结果信息
70
+	 * @param storageJkqWarning
71
+	 * @throws Exception
72
+	 */
73
+	public void updateDate(StorageJkqWarning storageJkqWarning) throws Exception;
46
 }
74
 }

+ 95 - 8
src/main/java/com/chinaitop/depot/warningAndAlarm/service/impl/TimedTaskServiceImpl.java

@@ -1,14 +1,20 @@
1
 package com.chinaitop.depot.warningAndAlarm.service.impl;
1
 package com.chinaitop.depot.warningAndAlarm.service.impl;
2
 
2
 
3
 import java.util.Date;
3
 import java.util.Date;
4
+import java.util.HashMap;
4
 import java.util.List;
5
 import java.util.List;
6
+import java.util.Map;
5
 
7
 
6
 import javax.annotation.Resource;
8
 import javax.annotation.Resource;
7
 
9
 
8
 import org.springframework.stereotype.Service;
10
 import org.springframework.stereotype.Service;
9
 
11
 
12
+import com.chinaitop.depot.warningAndAlarm.common.StatusUtils;
13
+import com.chinaitop.depot.warningAndAlarm.mapper.StorageJkqWarningMapper;
10
 import com.chinaitop.depot.warningAndAlarm.mapper.StorageRotationWarningMapper;
14
 import com.chinaitop.depot.warningAndAlarm.mapper.StorageRotationWarningMapper;
11
 import com.chinaitop.depot.warningAndAlarm.mapper.TimedTaskMapper;
15
 import com.chinaitop.depot.warningAndAlarm.mapper.TimedTaskMapper;
16
+import com.chinaitop.depot.warningAndAlarm.model.StorageJkqWarning;
17
+import com.chinaitop.depot.warningAndAlarm.model.StorageJkqWarningExample;
12
 import com.chinaitop.depot.warningAndAlarm.model.StorageRotationWarning;
18
 import com.chinaitop.depot.warningAndAlarm.model.StorageRotationWarning;
13
 import com.chinaitop.depot.warningAndAlarm.model.StorageRotationWarningExample;
19
 import com.chinaitop.depot.warningAndAlarm.model.StorageRotationWarningExample;
14
 import com.chinaitop.depot.warningAndAlarm.model.StorageRotationWarningExample.Criteria;
20
 import com.chinaitop.depot.warningAndAlarm.model.StorageRotationWarningExample.Criteria;
@@ -24,20 +30,23 @@ public class TimedTaskServiceImpl implements TimedTaskService {
24
 	@Resource
30
 	@Resource
25
 	private StorageRotationWarningMapper storageRotationWarningMapper;
31
 	private StorageRotationWarningMapper storageRotationWarningMapper;
26
 
32
 
33
+	@Resource
34
+	private StorageJkqWarningMapper storageJkqWarningMapper;
35
+
27
 	@Override
36
 	@Override
28
 	public void insertYlwl() throws Exception {
37
 	public void insertYlwl() throws Exception {
29
 
38
 
30
 		List<StorageRotationWarningWithBLOBs> list = timedTaskMapper.selectYlwl();
39
 		List<StorageRotationWarningWithBLOBs> list = timedTaskMapper.selectYlwl();
31
-		
40
+
32
 		if (null != list && list.size() > 0) {
41
 		if (null != list && list.size() > 0) {
33
 			StorageRotationWarningWithBLOBs s = null;
42
 			StorageRotationWarningWithBLOBs s = null;
34
 			for (int i = 0; i < list.size(); i++) {
43
 			for (int i = 0; i < list.size(); i++) {
35
 				s = list.get(i);
44
 				s = list.get(i);
36
-				boolean k = checkData(s, "1");
45
+				boolean k = checkDataLhyjbj(s, "1");
37
 				if (!k) {//如果有了,那就不在增加了,否则就重复报警了
46
 				if (!k) {//如果有了,那就不在增加了,否则就重复报警了
38
 					Date date = new Date();
47
 					Date date = new Date();
39
 					s.setScsj(date);
48
 					s.setScsj(date);
40
-					s.setClzt("0");
49
+					s.setClzt(StatusUtils.STATUS_0);
41
 					s.setUpdatetime(date);
50
 					s.setUpdatetime(date);
42
 					storageRotationWarningMapper.insert(s);
51
 					storageRotationWarningMapper.insert(s);
43
 				}
52
 				}
@@ -51,7 +60,7 @@ public class TimedTaskServiceImpl implements TimedTaskService {
51
 	 * @param bjlx 报警类型(0:轮换预警,1:应轮未轮)
60
 	 * @param bjlx 报警类型(0:轮换预警,1:应轮未轮)
52
 	 * @return
61
 	 * @return
53
 	 */
62
 	 */
54
-	private boolean checkData(StorageRotationWarningWithBLOBs rotationWarning, String bjlx) {
63
+	private boolean checkDataLhyjbj(StorageRotationWarningWithBLOBs rotationWarning, String bjlx) {
55
 		boolean b = false;
64
 		boolean b = false;
56
 		StorageRotationWarningExample example = new StorageRotationWarningExample();
65
 		StorageRotationWarningExample example = new StorageRotationWarningExample();
57
 		Criteria criteria = example.createCriteria();
66
 		Criteria criteria = example.createCriteria();
@@ -67,19 +76,19 @@ public class TimedTaskServiceImpl implements TimedTaskService {
67
 	}
76
 	}
68
 
77
 
69
 	@Override
78
 	@Override
70
-	public void insertLhyj() {
79
+	public void insertLhyj() throws Exception {
71
 
80
 
72
 		List<StorageRotationWarningWithBLOBs> list = timedTaskMapper.selectLhyj();
81
 		List<StorageRotationWarningWithBLOBs> list = timedTaskMapper.selectLhyj();
73
-		
82
+
74
 		if (null != list && list.size() > 0) {
83
 		if (null != list && list.size() > 0) {
75
 			StorageRotationWarningWithBLOBs s = null;
84
 			StorageRotationWarningWithBLOBs s = null;
76
 			for (int i = 0; i < list.size(); i++) {
85
 			for (int i = 0; i < list.size(); i++) {
77
 				s = list.get(i);
86
 				s = list.get(i);
78
-				boolean k = checkData(s, "0");
87
+				boolean k = checkDataLhyjbj(s, "0");
79
 				if (!k) {//如果有了,那就不在增加了,否则就重复报警了
88
 				if (!k) {//如果有了,那就不在增加了,否则就重复报警了
80
 					Date date = new Date();
89
 					Date date = new Date();
81
 					s.setScsj(date);
90
 					s.setScsj(date);
82
-					s.setClzt("0");
91
+					s.setClzt(StatusUtils.STATUS_0);
83
 					s.setUpdatetime(date);
92
 					s.setUpdatetime(date);
84
 					storageRotationWarningMapper.insert(s);
93
 					storageRotationWarningMapper.insert(s);
85
 				}
94
 				}
@@ -87,4 +96,82 @@ public class TimedTaskServiceImpl implements TimedTaskService {
87
 		}
96
 		}
88
 	}
97
 	}
89
 
98
 
99
+	@Override
100
+	public void insertJkqyj() throws Exception {
101
+
102
+		List<StorageJkqWarning> list = timedTaskMapper.selectJkqjyqzsj();
103
+
104
+		if (null != list && list.size() > 0) {
105
+			StorageJkqWarning s = null;
106
+			for (int i = 0; i < list.size(); i++) {
107
+				s = list.get(i);
108
+				
109
+				//查询架空期截止日期、架空期状态、报警日期
110
+				s = selectJkqjyqtsj(s);
111
+
112
+				boolean k = checkDataJkqyj(s);
113
+				Date date = new Date();
114
+				if (!k) {//如果有了,那就不在增加了,否则就重复报警了
115
+					s.setScsj(date);
116
+					s.setClzt(StatusUtils.STATUS_0);
117
+					s.setUpdatetime(date);
118
+					storageJkqWarningMapper.insert(s);
119
+				} else {
120
+					s.setUpdatetime(date);
121
+					storageJkqWarningMapper.updateByPrimaryKey(s);
122
+				}
123
+			}
124
+		}
125
+	}
126
+
127
+	/**
128
+	 * 查询架空期截止日期、架空期状态、报警日期
129
+	 * @param s
130
+	 * @return
131
+	 */
132
+	private StorageJkqWarning selectJkqjyqtsj(StorageJkqWarning s) {
133
+		
134
+		//组装查询条件
135
+		Map<String, String> map = new HashMap<>();
136
+		map.put("hwh", s.getHwh().toString());
137
+		map.put("startDate", s.getStartDate());
138
+		map.put("endDate", s.getEndDate());
139
+
140
+		//查询
141
+		StorageJkqWarning sj = timedTaskMapper.selectJkqjyqtsj(map);
142
+
143
+		if (null != sj) {
144
+			s.setJkqjzr(sj.getJkqjzr());
145
+			s.setJkqzt(sj.getJkqzt());
146
+			s.setYjrq(sj.getYjrq());
147
+		}
148
+
149
+		return s;
150
+	}
151
+
152
+	/**
153
+	 * 校验架空期数据是否已经存在
154
+	 * 查询条件:仓房、货位、计划文号、轮换年度
155
+	 * @param storageJkqWarning
156
+	 * @return
157
+	 */
158
+	public boolean checkDataJkqyj(StorageJkqWarning storageJkqWarning) {
159
+
160
+		boolean b = false;
161
+
162
+		StorageJkqWarningExample example = new StorageJkqWarningExample();
163
+		StorageJkqWarningExample.Criteria criteria = example.createCriteria();
164
+
165
+		criteria.andHwhEqualTo(storageJkqWarning.getHwh());
166
+		criteria.andChEqualTo(storageJkqWarning.getCh());
167
+		criteria.andJhwhEqualTo(storageJkqWarning.getJhwh());
168
+		criteria.andLhndEqualTo(storageJkqWarning.getLhnd());
169
+
170
+		List<StorageJkqWarning> list = storageJkqWarningMapper.selectByExample(example);
171
+		if (null != list && list.size() > 0) {
172
+			b = true;
173
+		}
174
+
175
+		return b;
176
+	}
90
 }
177
 }

+ 52 - 3
src/main/java/com/chinaitop/depot/warningAndAlarm/service/impl/YjbjServiceImpl.java

@@ -7,7 +7,11 @@ import javax.annotation.Resource;
7
 
7
 
8
 import org.springframework.stereotype.Service;
8
 import org.springframework.stereotype.Service;
9
 
9
 
10
+import com.chinaitop.depot.warningAndAlarm.common.StatusUtils;
11
+import com.chinaitop.depot.warningAndAlarm.mapper.StorageJkqWarningMapper;
10
 import com.chinaitop.depot.warningAndAlarm.mapper.StorageRotationWarningMapper;
12
 import com.chinaitop.depot.warningAndAlarm.mapper.StorageRotationWarningMapper;
13
+import com.chinaitop.depot.warningAndAlarm.model.StorageJkqWarning;
14
+import com.chinaitop.depot.warningAndAlarm.model.StorageJkqWarningExample;
11
 import com.chinaitop.depot.warningAndAlarm.model.StorageRotationWarning;
15
 import com.chinaitop.depot.warningAndAlarm.model.StorageRotationWarning;
12
 import com.chinaitop.depot.warningAndAlarm.model.StorageRotationWarningExample;
16
 import com.chinaitop.depot.warningAndAlarm.model.StorageRotationWarningExample;
13
 import com.chinaitop.depot.warningAndAlarm.model.StorageRotationWarningExample.Criteria;
17
 import com.chinaitop.depot.warningAndAlarm.model.StorageRotationWarningExample.Criteria;
@@ -20,6 +24,9 @@ public class YjbjServiceImpl implements YjbjService {
20
 	@Resource
24
 	@Resource
21
 	private StorageRotationWarningMapper storageRotationWarningMapper;
25
 	private StorageRotationWarningMapper storageRotationWarningMapper;
22
 
26
 
27
+	@Resource
28
+	private StorageJkqWarningMapper storageJkqWarningMapper;
29
+
23
 	@Override
30
 	@Override
24
 	public List<StorageRotationWarning> queryLhyjList(Integer orgId, Integer ch, Integer hwh, Integer lspz)
31
 	public List<StorageRotationWarning> queryLhyjList(Integer orgId, Integer ch, Integer hwh, Integer lspz)
25
 			throws Exception {
32
 			throws Exception {
@@ -40,7 +47,7 @@ public class YjbjServiceImpl implements YjbjService {
40
 			criteria.andLspzEqualTo(lspz);  //粮食品种ID
47
 			criteria.andLspzEqualTo(lspz);  //粮食品种ID
41
 		}
48
 		}
42
 
49
 
43
-		criteria.andBjlxEqualTo("0"); //查询轮换预警的数据
50
+		criteria.andBjlxEqualTo(StatusUtils.LHYJBJ_TYPE_0); //查询轮换预警的数据
44
 
51
 
45
 		example.setOrderByClause("scsj desc"); //按照数据的生成时间倒序排序
52
 		example.setOrderByClause("scsj desc"); //按照数据的生成时间倒序排序
46
 
53
 
@@ -69,7 +76,7 @@ public class YjbjServiceImpl implements YjbjService {
69
 			criteria.andLspzEqualTo(lspz);  //粮食品种ID
76
 			criteria.andLspzEqualTo(lspz);  //粮食品种ID
70
 		}
77
 		}
71
 
78
 
72
-		criteria.andBjlxEqualTo("1"); //查询应轮未轮报警的数据
79
+		criteria.andBjlxEqualTo(StatusUtils.LHYJBJ_TYPE_1); //查询应轮未轮报警的数据
73
 
80
 
74
 		example.setOrderByClause("scsj desc"); //按照数据的生成时间倒序排序
81
 		example.setOrderByClause("scsj desc"); //按照数据的生成时间倒序排序
75
 
82
 
@@ -81,7 +88,7 @@ public class YjbjServiceImpl implements YjbjService {
81
 	@Override
88
 	@Override
82
 	public void updateDate(StorageRotationWarningWithBLOBs storageRotationWarningWithBLOBs) throws Exception {
89
 	public void updateDate(StorageRotationWarningWithBLOBs storageRotationWarningWithBLOBs) throws Exception {
83
 		storageRotationWarningWithBLOBs.setUpdatetime(new Date());
90
 		storageRotationWarningWithBLOBs.setUpdatetime(new Date());
84
-		storageRotationWarningWithBLOBs.setClzt("1"); //设置为已处理
91
+		storageRotationWarningWithBLOBs.setClzt(StatusUtils.STATUS_1); //设置为已处理
85
 		storageRotationWarningMapper.updateByPrimaryKeyWithBLOBs(storageRotationWarningWithBLOBs);
92
 		storageRotationWarningMapper.updateByPrimaryKeyWithBLOBs(storageRotationWarningWithBLOBs);
86
 	}
93
 	}
87
 
94
 
@@ -90,4 +97,46 @@ public class YjbjServiceImpl implements YjbjService {
90
 		return storageRotationWarningMapper.selectByPrimaryKey(id);
97
 		return storageRotationWarningMapper.selectByPrimaryKey(id);
91
 	}
98
 	}
92
 
99
 
100
+	@Override
101
+	public List<StorageJkqWarning> queryJkqyjList(Integer orgId, Integer ch, Integer hwh, String jhwh, String lhnd)
102
+			throws Exception {
103
+
104
+		StorageJkqWarningExample example = new StorageJkqWarningExample();
105
+		StorageJkqWarningExample.Criteria criteria = example.createCriteria();
106
+
107
+		if (null != orgId) {
108
+			criteria.andOrgIdEqualTo(orgId);
109
+		}
110
+		if (null != ch) {
111
+			criteria.andChEqualTo(ch);
112
+		}
113
+		if (null != hwh) {
114
+			criteria.andHwhEqualTo(hwh);
115
+		}
116
+		if (null != jhwh) {
117
+			criteria.andJhwhEqualTo(jhwh);
118
+		}
119
+		if (null != lhnd) {
120
+			criteria.andLhndEqualTo(lhnd);
121
+		}
122
+
123
+		example.setOrderByClause("scsj desc");
124
+
125
+		List<StorageJkqWarning> list = storageJkqWarningMapper.selectByExample(example);
126
+
127
+		return list;
128
+	}
129
+
130
+	@Override
131
+	public StorageJkqWarning queryByIdJkq(String id) throws Exception {
132
+		return storageJkqWarningMapper.selectByPrimaryKey(id);
133
+	}
134
+
135
+	@Override
136
+	public void updateDate(StorageJkqWarning storageJkqWarning) throws Exception {
137
+		storageJkqWarning.setUpdatetime(new Date());
138
+		storageJkqWarning.setClzt(StatusUtils.STATUS_1); //设置为已处理
139
+		storageJkqWarningMapper.updateByPrimaryKeyWithBLOBs(storageJkqWarning);
140
+	}
141
+
93
 }
142
 }