fanxw 1 år sedan
förälder
incheckning
7631d28f62

+ 12 - 6
src/main/java/com/chinaitop/depot/storage/controller/StorageWarterCheckController.java

@@ -9,7 +9,7 @@ import java.util.Map;
9 9
 import javax.annotation.Resource;
10 10
 import javax.servlet.http.HttpServletRequest;
11 11
 
12
-import org.apache.commons.lang.ObjectUtils;
12
+import org.apache.commons.lang.StringUtils;
13 13
 import org.springframework.http.MediaType;
14 14
 import org.springframework.transaction.annotation.Transactional;
15 15
 import org.springframework.transaction.interceptor.TransactionAspectSupport;
@@ -52,10 +52,11 @@ public class StorageWarterCheckController {
52 52
         @ApiImplicitParam(name = "pageNum", value = "页码", paramType = "query"),
53 53
         @ApiImplicitParam(name = "pageSize", value = "每页条数", paramType = "query"),
54 54
         @ApiImplicitParam(name = "houseId", value = "仓房ID", paramType = "query"),
55
-        @ApiImplicitParam(name = "wareId", value = "货位ID", paramType = "query")
55
+        @ApiImplicitParam(name = "wareId", value = "货位ID", paramType = "query"),
56
+        @ApiImplicitParam(name = "orgId", value = "库ID", paramType = "query"),
57
+        @ApiImplicitParam(name = "dataStatus", value = "数据状态(0:保存,1:提交)", paramType = "query")
56 58
     })
57
-	public PageInfo<StorageWaterCheck> getList(HttpServletRequest request, 
58
-			Integer pageNum, Integer pageSize, Integer houseId, Integer wareId) {
59
+	public PageInfo<StorageWaterCheck> getList(Integer pageNum, Integer pageSize, Integer houseId, Integer wareId, Integer orgId, String dataStatus) {
59 60
 		
60 61
 		List<StorageWaterCheck> list = null;
61 62
 		PageInfo<StorageWaterCheck> pageInfo = null;
@@ -71,8 +72,13 @@ public class StorageWarterCheckController {
71 72
 			criteria.andWareIdEqualTo(wareId);
72 73
 		}
73 74
 
74
-		int org_id = Integer.parseInt(ObjectUtils.toString(request.getSession().getAttribute("orgId"), "0"));
75
-		criteria.andOrgIdEqualTo(org_id);
75
+		if (null != orgId) {
76
+			criteria.andOrgIdEqualTo(orgId);
77
+		}
78
+
79
+		if (StringUtils.isNotBlank(dataStatus)) {
80
+			criteria.andDataStatusEqualTo(dataStatus);
81
+		}
76 82
 
77 83
 		if (null != pageNum && null != pageSize) {
78 84
 			PageHelper.startPage(pageNum, pageSize);

+ 20 - 5
src/main/java/com/chinaitop/depot/storage/mapper/StorageWaterCheckMapper.xml

@@ -12,6 +12,7 @@
12 12
     <result column="remark" property="remark" jdbcType="VARCHAR" />
13 13
     <result column="input_time" property="inputTime" jdbcType="TIMESTAMP" />
14 14
     <result column="edit_time" property="editTime" jdbcType="TIMESTAMP" />
15
+    <result column="data_status" property="dataStatus" jdbcType="VARCHAR" />
15 16
   </resultMap>
16 17
   <sql id="Example_Where_Clause" >
17 18
     <where >
@@ -72,7 +73,7 @@
72 73
     </where>
73 74
   </sql>
74 75
   <sql id="Base_Column_List" >
75
-    id, org_id, house_id, ware_id, lspz, hy_date, hy_person, remark, input_time, edit_time
76
+    id, org_id, house_id, ware_id, lspz, hy_date, hy_person, remark, input_time, edit_time, data_status
76 77
   </sql>
77 78
   <select id="selectByExample" resultMap="BaseResultMap" parameterType="com.chinaitop.depot.storage.model.StorageWaterCheckExample" >
78 79
     select
@@ -108,11 +109,11 @@
108 109
     insert into storage_water_check (id, org_id, house_id, 
109 110
       ware_id, lspz, hy_date, 
110 111
       hy_person, remark, input_time, 
111
-      edit_time)
112
+      edit_time, data_status)
112 113
     values (#{id,jdbcType=VARCHAR}, #{orgId,jdbcType=INTEGER}, #{houseId,jdbcType=INTEGER}, 
113 114
       #{wareId,jdbcType=INTEGER}, #{lspz,jdbcType=INTEGER}, #{hyDate,jdbcType=TIMESTAMP}, 
114 115
       #{hyPerson,jdbcType=VARCHAR}, #{remark,jdbcType=VARCHAR}, #{inputTime,jdbcType=TIMESTAMP}, 
115
-      #{editTime,jdbcType=TIMESTAMP})
116
+      #{editTime,jdbcType=TIMESTAMP},#{dataStatus,jdbcType=VARCHAR})
116 117
   </insert>
117 118
   <insert id="insertSelective" parameterType="com.chinaitop.depot.storage.model.StorageWaterCheck" >
118 119
     insert into storage_water_check
@@ -147,6 +148,9 @@
147 148
       <if test="editTime != null" >
148 149
         edit_time,
149 150
       </if>
151
+      <if test="dataStatus != null">
152
+        data_status,
153
+      </if>
150 154
     </trim>
151 155
     <trim prefix="values (" suffix=")" suffixOverrides="," >
152 156
       <if test="id != null" >
@@ -179,6 +183,9 @@
179 183
       <if test="editTime != null" >
180 184
         #{editTime,jdbcType=TIMESTAMP},
181 185
       </if>
186
+      <if test="dataStatus != null">
187
+        #{dataStatus,jdbcType=VARCHAR},
188
+      </if>
182 189
     </trim>
183 190
   </insert>
184 191
   <select id="countByExample" parameterType="com.chinaitop.depot.storage.model.StorageWaterCheckExample" resultType="java.lang.Integer" >
@@ -220,6 +227,9 @@
220 227
       <if test="record.editTime != null" >
221 228
         edit_time = #{record.editTime,jdbcType=TIMESTAMP},
222 229
       </if>
230
+      <if test="record.dataStatus != null" >
231
+        data_status = #{record.dataStatus,jdbcType=VARCHAR},
232
+      </if>
223 233
     </set>
224 234
     <if test="_parameter != null" >
225 235
       <include refid="Update_By_Example_Where_Clause" />
@@ -236,7 +246,8 @@
236 246
       hy_person = #{record.hyPerson,jdbcType=VARCHAR},
237 247
       remark = #{record.remark,jdbcType=VARCHAR},
238 248
       input_time = #{record.inputTime,jdbcType=TIMESTAMP},
239
-      edit_time = #{record.editTime,jdbcType=TIMESTAMP}
249
+      edit_time = #{record.editTime,jdbcType=TIMESTAMP},
250
+      data_status = #{record.dataStatus,jdbcType=VARCHAR}
240 251
     <if test="_parameter != null" >
241 252
       <include refid="Update_By_Example_Where_Clause" />
242 253
     </if>
@@ -271,6 +282,9 @@
271 282
       <if test="editTime != null" >
272 283
         edit_time = #{editTime,jdbcType=TIMESTAMP},
273 284
       </if>
285
+      <if test="dataStatus != null" >
286
+        data_status = #{dataStatus,jdbcType=VARCHAR},
287
+      </if>
274 288
     </set>
275 289
     where id = #{id,jdbcType=VARCHAR}
276 290
   </update>
@@ -284,7 +298,8 @@
284 298
       hy_person = #{hyPerson,jdbcType=VARCHAR},
285 299
       remark = #{remark,jdbcType=VARCHAR},
286 300
       input_time = #{inputTime,jdbcType=TIMESTAMP},
287
-      edit_time = #{editTime,jdbcType=TIMESTAMP}
301
+      edit_time = #{editTime,jdbcType=TIMESTAMP},
302
+      data_status = #{dataStatus,jdbcType=VARCHAR}
288 303
     where id = #{id,jdbcType=VARCHAR}
289 304
   </update>
290 305
 </mapper>

+ 9 - 2
src/main/java/com/chinaitop/depot/storage/model/StorageQualitycheck.java

@@ -8,14 +8,21 @@ import java.util.Date;
8 8
 import java.util.List;
9 9
 
10 10
 public class StorageQualitycheck {
11
-	
11
+
12 12
 	private Integer processState;
13
-	
14 13
 
14
+	/**
15
+	 * '1:已扦样但化验待处理,2:化验已保存,3:化验已提交'
16
+	 * @return
17
+	 */
15 18
     public Integer getProcessState() {
16 19
 		return processState;
17 20
 	}
18 21
 
22
+    /**
23
+     * '1:已扦样但化验待处理,2:化验已保存,3:化验已提交'
24
+     * @param processState
25
+     */
19 26
 	public void setProcessState(Integer processState) {
20 27
 		this.processState = processState;
21 28
 	}

+ 58 - 40
src/main/java/com/chinaitop/depot/storage/model/StorageWaterCheck.java

@@ -23,170 +23,188 @@ public class StorageWaterCheck {
23 23
 
24 24
     private Date editTime;
25 25
 
26
+    private String dataStatus;
27
+
26 28
     private String redAlert;//红色警报
27 29
 
28 30
     private String blueAlert;//绿色警报
29 31
 
30 32
     /**
31
-     * null
32
-     * @return id null
33
+     * 主键唯一ID
34
+     * @return id 主键唯一ID
33 35
      */
34 36
     public String getId() {
35 37
         return id;
36 38
     }
37 39
 
38 40
     /**
39
-     * null
40
-     * @param id null
41
+     * 主键唯一ID
42
+     * @param id 主键唯一ID
41 43
      */
42 44
     public void setId(String id) {
43 45
         this.id = id == null ? null : id.trim();
44 46
     }
45 47
 
46 48
     /**
47
-     * null
48
-     * @return org_id null
49
+     * 库ID
50
+     * @return org_id 库ID
49 51
      */
50 52
     public Integer getOrgId() {
51 53
         return orgId;
52 54
     }
53 55
 
54 56
     /**
55
-     * null
56
-     * @param orgId null
57
+     * 库ID
58
+     * @param orgId 库ID
57 59
      */
58 60
     public void setOrgId(Integer orgId) {
59 61
         this.orgId = orgId;
60 62
     }
61 63
 
62 64
     /**
63
-     * null
64
-     * @return house_id null
65
+     * 仓房ID
66
+     * @return house_id 仓房ID
65 67
      */
66 68
     public Integer getHouseId() {
67 69
         return houseId;
68 70
     }
69 71
 
70 72
     /**
71
-     * null
72
-     * @param houseId null
73
+     * 仓房ID
74
+     * @param houseId 仓房ID
73 75
      */
74 76
     public void setHouseId(Integer houseId) {
75 77
         this.houseId = houseId;
76 78
     }
77 79
 
78 80
     /**
79
-     * null
80
-     * @return ware_id null
81
+     * 货位ID
82
+     * @return ware_id 货位ID
81 83
      */
82 84
     public Integer getWareId() {
83 85
         return wareId;
84 86
     }
85 87
 
86 88
     /**
87
-     * null
88
-     * @param wareId null
89
+     * 货位ID
90
+     * @param wareId 货位ID
89 91
      */
90 92
     public void setWareId(Integer wareId) {
91 93
         this.wareId = wareId;
92 94
     }
93 95
 
94 96
     /**
95
-     * null
96
-     * @return lspz null
97
+     * 粮食品种ID
98
+     * @return lspz 粮食品种ID
97 99
      */
98 100
     public Integer getLspz() {
99 101
         return lspz;
100 102
     }
101 103
 
102 104
     /**
103
-     * null
104
-     * @param lspz null
105
+     * 粮食品种ID
106
+     * @param lspz 粮食品种ID
105 107
      */
106 108
     public void setLspz(Integer lspz) {
107 109
         this.lspz = lspz;
108 110
     }
109 111
 
110 112
     /**
111
-     * null
112
-     * @return hy_date null
113
+     * 化验时间
114
+     * @return hy_date 化验时间
113 115
      */
114 116
     public Date getHyDate() {
115 117
         return hyDate;
116 118
     }
117 119
 
118 120
     /**
119
-     * null
120
-     * @param hyDate null
121
+     * 化验时间
122
+     * @param hyDate 化验时间
121 123
      */
122 124
     public void setHyDate(Date hyDate) {
123 125
         this.hyDate = hyDate;
124 126
     }
125 127
 
126 128
     /**
127
-     * null
128
-     * @return hy_person null
129
+     * 化验人
130
+     * @return hy_person 化验人
129 131
      */
130 132
     public String getHyPerson() {
131 133
         return hyPerson;
132 134
     }
133 135
 
134 136
     /**
135
-     * null
136
-     * @param hyPerson null
137
+     * 化验人
138
+     * @param hyPerson 化验人
137 139
      */
138 140
     public void setHyPerson(String hyPerson) {
139 141
         this.hyPerson = hyPerson == null ? null : hyPerson.trim();
140 142
     }
141 143
 
142 144
     /**
143
-     * null
144
-     * @return remark null
145
+     * 备注
146
+     * @return remark 备注
145 147
      */
146 148
     public String getRemark() {
147 149
         return remark;
148 150
     }
149 151
 
150 152
     /**
151
-     * null
152
-     * @param remark null
153
+     * 备注
154
+     * @param remark 备注
153 155
      */
154 156
     public void setRemark(String remark) {
155 157
         this.remark = remark == null ? null : remark.trim();
156 158
     }
157 159
 
158 160
     /**
159
-     * null
160
-     * @return input_time null
161
+     * 数据生成时间
162
+     * @return input_time 数据生成时间
161 163
      */
162 164
     public Date getInputTime() {
163 165
         return inputTime;
164 166
     }
165 167
 
166 168
     /**
167
-     * null
168
-     * @param inputTime null
169
+     * 数据生成时间
170
+     * @param inputTime 数据生成时间
169 171
      */
170 172
     public void setInputTime(Date inputTime) {
171 173
         this.inputTime = inputTime;
172 174
     }
173 175
 
174 176
     /**
175
-     * null
176
-     * @return edit_time null
177
+     * 最后修改时间
178
+     * @return edit_time 最后修改时间
177 179
      */
178 180
     public Date getEditTime() {
179 181
         return editTime;
180 182
     }
181 183
 
182 184
     /**
183
-     * null
184
-     * @param editTime null
185
+     * 最后修改时间
186
+     * @param editTime 最后修改时间
185 187
      */
186 188
     public void setEditTime(Date editTime) {
187 189
         this.editTime = editTime;
188 190
     }
189 191
 
192
+    /**
193
+     * 数据状态(0:保存,1:提交)
194
+     * @return
195
+     */
196
+    public String getDataStatus() {
197
+		return dataStatus;
198
+	}
199
+
200
+    /**
201
+     * 数据状态(0:保存,1:提交)
202
+     * @param dataStatus
203
+     */
204
+	public void setDataStatus(String dataStatus) {
205
+		this.dataStatus = dataStatus;
206
+	}
207
+
190 208
 	public String getRedAlert() {
191 209
 		return redAlert;
192 210
 	}

+ 5 - 0
src/main/java/com/chinaitop/depot/storage/model/StorageWaterCheckExample.java

@@ -746,6 +746,11 @@ public class StorageWaterCheckExample {
746 746
             addCriterion("edit_time not between", value1, value2, "editTime");
747 747
             return (Criteria) this;
748 748
         }
749
+
750
+        public Criteria andDataStatusEqualTo(String value) {
751
+            addCriterion("data_status =", value, "dataStatus");
752
+            return (Criteria) this;
753
+        }
749 754
     }
750 755
 
751 756
     /**

+ 3 - 3
src/main/java/com/chinaitop/depot/storage/service/impl/StorageQualitycheckServiceImpl.java

@@ -405,7 +405,7 @@ public class StorageQualitycheckServiceImpl implements StorageQualitycheckServic
405 405
 
406 406
 	@Override
407 407
 	public void pushQualitycheckLsdj_crk(StorageQualitycheck qualitycheck, String ws_path) throws Exception {
408
-		if ("0".equals(qualitycheck.getTypeUpdate())) {//只有粮食自检才走这里
408
+		if ("0".equals(qualitycheck.getTypeUpdate()) && qualitycheck.getProcessState() == 3) {//只有粮食自检,并且是已提交的数据才走这里
409 409
 			String crk_yjd_url = qualitycheckMapper.findConditionCrkYjdUrl(qualitycheck.getOrgId().toString());
410 410
 			if (StringUtils.isNotBlank(crk_yjd_url)) {
411 411
 				//拼接完整URL
@@ -450,7 +450,7 @@ public class StorageQualitycheckServiceImpl implements StorageQualitycheckServic
450 450
         	criteria.andOrgIdEqualTo(orgId);
451 451
         }
452 452
 
453
-        //1扦样化验待处理 2化验已处理
453
+        //1扦样化验待处理 2化验已处理,3:化验已保存
454 454
         if (null != processState) {
455 455
         	criteria.andProcessStateEqualTo(processState);
456 456
         }
@@ -511,7 +511,7 @@ public class StorageQualitycheckServiceImpl implements StorageQualitycheckServic
511 511
 
512 512
 		Map<String, Object> resultMap = new HashMap<>();
513 513
 		if (StringUtils.isNotBlank(fcsj)) {
514
-			List<StorageQualitycheck> list = getList(houseId, wareId, checkType, null, null, null, 2, "0" , fcsj);
514
+			List<StorageQualitycheck> list = getList(houseId, wareId, checkType, null, null, null, 3, "0" , fcsj);
515 515
 			if (null != list && list.size() > 0) {
516 516
 				resultMap.put("status", "200");
517 517
 				resultMap.put("msg", list);