Bladeren bron

刷新出入库状态功能优化

fanxw 4 jaren geleden
bovenliggende
commit
2f95b738e6

+ 22 - 7
src/main/java/com/chinaitop/depot/basic/controller/BasicWarehouseController.java

@@ -420,19 +420,34 @@ public class BasicWarehouseController {
420 420
 					String status = ObjectUtils.toString(json_object.get("crk_status"), "");
421 421
 					//业务类型:2代表油罐,1代表仓房
422 422
 					String ywlx = ObjectUtils.toString(json_object.get("ywlx"), "");
423
+					//粮油类型(0:原粮,1:成品粮)
424
+					String lylx = ObjectUtils.toString(json_object.get("lylx"), "");
423 425
 
424 426
 					//修改数据
425 427
 					param = new HashMap<String, Object>();
426 428
 					param.put("wareId", Integer.parseInt(wareId));
427 429
 					param.put("orgId", Integer.parseInt(orgId));
428 430
 					param.put("status", status);
429
-					if ("2".equals(ywlx)) {
430
-						BasicTank bank = new BasicTank();
431
-						bank.setId(wareId);
432
-						bank.setCrkStatus(status);
433
-						basicTankService.updateTankCrkStatus(bank);
434
-					} else if ("1".equals(ywlx)) {
435
-						basicWarehouseService.updateWareStatus(param);
431
+					param.put("lylx", lylx);
432
+					if ("2".equals(ywlx)) {//油罐
433
+						BasicTank banks = basicTankService.findByPrimary(wareId);
434
+						//检查保存的粮油类型是否对应(成品粮或者原粮)
435
+						if (lylx.equals(banks.getLylx()) || "".equals(banks.getLylx()) || null == banks.getLylx()) {
436
+							BasicTank bank = new BasicTank();
437
+							bank.setId(wareId);
438
+							bank.setCrkStatus(status);
439
+							if ("1".equals(status)) {//如果是空仓则把粮油类型置为空
440
+								bank.setLylx("");
441
+							} else {
442
+								bank.setLylx(lylx);
443
+							}
444
+							basicTankService.updateTankCrkStatus(bank);
445
+						}
446
+					} else if ("1".equals(ywlx)) {//粮仓
447
+						BasicWarehouse ware = basicWarehouseService.findByParmaryKey(Integer.parseInt(wareId));
448
+						if (lylx.equals(ware.getLylx()) || "".equals(ware.getLylx()) || null == ware.getLylx()) {
449
+							basicWarehouseService.updateWareStatus(param);
450
+						}
436 451
 					}
437 452
 					logger.info("时间:"+date+",出入库状态回写接口,封仓调用,调用成功!");
438 453
 				}

+ 22 - 7
src/main/java/com/chinaitop/depot/basic/mapper/BasicTankMapper.xml

@@ -30,8 +30,9 @@
30 30
     <result column="tanklib_chart" property="tanklibChart" jdbcType="VARCHAR" />
31 31
     <result column="basic_truck_type" property="basicTruckType" jdbcType="VARCHAR" />
32 32
     <result column="crk_status" property="crkStatus" jdbcType="VARCHAR" />
33
-    <result column="ygdm" property="crkStatus" jdbcType="VARCHAR" />
34
-    <result column="ygajdm" property="crkStatus" jdbcType="VARCHAR" />
33
+    <result column="ygdm" property="ygdm" jdbcType="VARCHAR" />
34
+    <result column="ygajdm" property="ygajdm" jdbcType="VARCHAR" />
35
+    <result column="lylx" property="lylx" jdbcType="VARCHAR" />
35 36
   </resultMap>
36 37
   <sql id="Example_Where_Clause" >
37 38
     <where >
@@ -95,7 +96,7 @@
95 96
     id, storageTank_code, storageTank_name, org_code, tank_capacity, createDate, facilities_type, 
96 97
     heating_type, tank_type, diameter, height, buildDate, check_way, weld_way, tank_apply, 
97 98
     tank_status, library_type, org_id, del_flag, updatetime, bottom_area, design_height, 
98
-    oil_height, insport_height, tank_chart, tanklib_chart, basic_truck_type, crk_status, ygdm, ygajdm
99
+    oil_height, insport_height, tank_chart, tanklib_chart, basic_truck_type, crk_status, ygdm, ygajdm, lylx
99 100
   </sql>
100 101
   <select id="selectByExample" resultMap="BaseResultMap" parameterType="com.chinaitop.depot.basic.model.BasicTankExample" >
101 102
     select
@@ -136,7 +137,7 @@
136 137
       tank_status, library_type, org_id, 
137 138
       del_flag, updatetime, bottom_area, 
138 139
       design_height, oil_height, insport_height, 
139
-      tank_chart, tanklib_chart, basic_truck_type, crk_status, ygdm, ygajdm
140
+      tank_chart, tanklib_chart, basic_truck_type, crk_status, ygdm, ygajdm, lylx
140 141
       )
141 142
     values (#{id,jdbcType=VARCHAR}, #{storagetankCode,jdbcType=VARCHAR}, #{storagetankName,jdbcType=VARCHAR}, 
142 143
       #{orgCode,jdbcType=VARCHAR}, #{tankCapacity,jdbcType=DECIMAL}, #{createdate,jdbcType=TIMESTAMP}, 
@@ -147,7 +148,7 @@
147 148
       #{delFlag,jdbcType=INTEGER}, #{updatetime,jdbcType=TIMESTAMP}, #{bottomArea,jdbcType=DECIMAL}, 
148 149
       #{designHeight,jdbcType=DECIMAL}, #{oilHeight,jdbcType=DECIMAL}, #{insportHeight,jdbcType=DECIMAL}, 
149 150
       #{tankChart,jdbcType=VARCHAR}, #{tanklibChart,jdbcType=VARCHAR}, #{basicTruckType,jdbcType=VARCHAR},
150
-      #{crkStatus,jdbcType=VARCHAR},#{ygdm,jdbcType=VARCHAR},#{ygajdm,jdbcType=VARCHAR}
151
+      #{crkStatus,jdbcType=VARCHAR},#{ygdm,jdbcType=VARCHAR},#{ygajdm,jdbcType=VARCHAR}, #{lylx,jdbcType=VARCHAR}
151 152
       )
152 153
   </insert>
153 154
   <insert id="insertSelective" parameterType="com.chinaitop.depot.basic.model.BasicTank" >
@@ -243,6 +244,9 @@
243 244
       <if test="ygajdm != null">
244 245
       	ygajdm,
245 246
       </if>
247
+      <if test="lylx != null">
248
+        lylx,
249
+      </if>
246 250
     </trim>
247 251
     <trim prefix="values (" suffix=")" suffixOverrides="," >
248 252
       <if test="id != null" >
@@ -335,6 +339,9 @@
335 339
       <if test="ygajdm != null">
336 340
         #{ygajdm,jdbcType=VARCHAR},
337 341
       </if>
342
+      <if test="lylx != null">
343
+        #{lylx,jdbcType=VARCHAR},
344
+      </if>
338 345
     </trim>
339 346
   </insert>
340 347
   <select id="countByExample" parameterType="com.chinaitop.depot.basic.model.BasicTankExample" resultType="java.lang.Integer" >
@@ -436,6 +443,9 @@
436 443
       <if test="record.ygajdm != null">
437 444
         ygajdm = #{record.ygajdm,jdbcType=VARCHAR},
438 445
       </if>
446
+      <if test="record.lylx != null">
447
+        lylx = #{record.lylx,jdbcType=VARCHAR},
448
+      </if>
439 449
     </set>
440 450
     <if test="_parameter != null" >
441 451
       <include refid="Update_By_Example_Where_Clause" />
@@ -472,7 +482,8 @@
472 482
       basic_truck_type = #{record.basicTruckType,jdbcType=VARCHAR},
473 483
       crk_status = #{record.crkStatus,jdbcType=VARCHAR},
474 484
       ygdm = #{record.ygdm,jdbcType=VARCHAR},
475
-      ygajdm = #{record.ygajdm,jdbcType=VARCHAR}
485
+      ygajdm = #{record.ygajdm,jdbcType=VARCHAR},
486
+      lylx = #{record.lylx,jdbcType=VARCHAR}
476 487
     <if test="_parameter != null" >
477 488
       <include refid="Update_By_Example_Where_Clause" />
478 489
     </if>
@@ -567,6 +578,9 @@
567 578
       <if test="ygajdm != null">
568 579
         ygajdm = #{ygajdm,jdbcType=VARCHAR},
569 580
       </if>
581
+      <if test="lylx != null">
582
+        lylx = #{lylx,jdbcType=VARCHAR},
583
+      </if>
570 584
     </set>
571 585
     where id = #{id,jdbcType=VARCHAR}
572 586
   </update>
@@ -600,7 +614,8 @@
600 614
       basic_truck_type = #{basicTruckType,jdbcType=VARCHAR},
601 615
       crk_status = #{crkStatus,jdbcType=VARCHAR},
602 616
       ygdm = #{ygdm,jdbcType=VARCHAR},
603
-      ygajdm = #{ygajdm,jdbcType=VARCHAR}
617
+      ygajdm = #{ygajdm,jdbcType=VARCHAR},
618
+      lylx = #{lylx,jdbcType=VARCHAR}
604 619
     where id = #{id,jdbcType=VARCHAR}
605 620
   </update>
606 621
 

+ 20 - 5
src/main/java/com/chinaitop/depot/basic/mapper/BasicWarehouseMapper.xml

@@ -29,6 +29,7 @@
29 29
     <result column="contact_number" jdbcType="VARCHAR" property="contactNumber" />
30 30
     <result column="crk_status" jdbcType="VARCHAR" property="crkStatus" />
31 31
     <result column="hwdm" jdbcType="VARCHAR" property="hwdm" />
32
+    <result column="lylx" jdbcType="VARCHAR" property="lylx" />
32 33
   </resultMap>
33 34
   <sql id="Example_Where_Clause">
34 35
     <where>
@@ -92,7 +93,7 @@
92 93
     warehouse_id, depot_id, depot_name, storehouse_id, warehouse_code, warehouse_name, 
93 94
     warehouse_use_time, warehouse_status, store_way, warehouse_capacity, dutystoreman, 
94 95
     remark, ware_img, createname, updatename, createdate, updatedate, del_flag, org_id, 
95
-    library_type, hwbm, length, width, heigth, contact_number, crk_status, hwdm
96
+    library_type, hwbm, length, width, heigth, contact_number, crk_status, hwdm, lylx
96 97
   </sql>
97 98
   <select id="selectByExample" parameterType="com.chinaitop.depot.basic.model.BasicWarehouseExample" resultMap="BaseResultMap">
98 99
     select
@@ -136,7 +137,7 @@
136 137
       createdate, updatedate, del_flag, 
137 138
       org_id, library_type, 
138 139
       hwbm, length, width, 
139
-      heigth, contact_number, crk_status, hwdm
140
+      heigth, contact_number, crk_status, hwdm, lylx
140 141
       )
141 142
     values (#{warehouseId,jdbcType=INTEGER}, #{depotId,jdbcType=INTEGER}, #{depotName,jdbcType=VARCHAR}, 
142 143
       #{storehouseId,jdbcType=INTEGER}, #{warehouseCode,jdbcType=VARCHAR}, #{warehouseName,jdbcType=VARCHAR}, 
@@ -147,7 +148,7 @@
147 148
       #{orgId,jdbcType=INTEGER}, #{libraryType,jdbcType=VARCHAR}, 
148 149
       #{hwbm,jdbcType=VARCHAR}, #{length,jdbcType=DECIMAL}, #{width,jdbcType=DECIMAL}, 
149 150
       #{heigth,jdbcType=DECIMAL}, #{contactNumber,jdbcType=VARCHAR}, #{crkStatus,jdbcType=VARCHAR}, 
150
-      #{hwdm,jdbcType=VARCHAR}
151
+      #{hwdm,jdbcType=VARCHAR}, #{lylx,jdbcType=VARCHAR}
151 152
       )
152 153
   </insert>
153 154
   <insert id="insertSelective" parameterType="com.chinaitop.depot.basic.model.BasicWarehouse">
@@ -237,6 +238,9 @@
237 238
       <if test="hwdm != null">
238 239
         hwdm,
239 240
       </if>
241
+      <if test="lylx != null">
242
+        lylx,
243
+      </if>
240 244
     </trim>
241 245
     <trim prefix="values (" suffix=")" suffixOverrides=",">
242 246
       <if test="warehouseId != null">
@@ -320,6 +324,9 @@
320 324
       <if test="hwdm != null">
321 325
         #{hwdm,jdbcType=VARCHAR},
322 326
       </if>
327
+      <if test="lylx != null">
328
+        #{lylx,jdbcType=VARCHAR},
329
+      </if>
323 330
     </trim>
324 331
   </insert>
325 332
   <select id="countByExample" parameterType="com.chinaitop.depot.basic.model.BasicWarehouseExample" resultType="java.lang.Integer">
@@ -412,6 +419,9 @@
412 419
       <if test="record.hwdm != null">
413 420
         hwdm = #{record.hwdm,jdbcType=VARCHAR},
414 421
       </if>
422
+      <if test="record.lylx != null">
423
+        lylx = #{record.lylx,jdbcType=VARCHAR},
424
+      </if>
415 425
     </set>
416 426
     <if test="_parameter != null">
417 427
       <include refid="Update_By_Example_Where_Clause" />
@@ -445,7 +455,8 @@
445 455
       heigth = #{record.heigth,jdbcType=DECIMAL},
446 456
       contact_number = #{record.contactNumber,jdbcType=VARCHAR},
447 457
       crk_status = #{record.crkStatus,jdbcType=VARCHAR},
448
-      hwdm = #{record.hwdm,jdbcType=VARCHAR}
458
+      hwdm = #{record.hwdm,jdbcType=VARCHAR},
459
+      lylx = #{record.lylx,jdbcType=VARCHAR}
449 460
     <if test="_parameter != null">
450 461
       <include refid="Update_By_Example_Where_Clause" />
451 462
     </if>
@@ -531,6 +542,9 @@
531 542
       <if test="hwdm != null">
532 543
         hwdm = #{hwdm,jdbcType=VARCHAR},
533 544
       </if>
545
+      <if test="lylx != null">
546
+        lylx = #{lylx,jdbcType=VARCHAR},
547
+      </if>
534 548
     </set>
535 549
     where warehouse_id = #{warehouseId,jdbcType=INTEGER}
536 550
   </update>
@@ -561,7 +575,8 @@
561 575
       heigth = #{heigth,jdbcType=DECIMAL},
562 576
       contact_number = #{contactNumber,jdbcType=VARCHAR},
563 577
       crk_status = #{crkStatus,jdbcType=VARCHAR},
564
-      hwdm = #{hwdm,jdbcType=VARCHAR}
578
+      hwdm = #{hwdm,jdbcType=VARCHAR},
579
+      lylx = #{lylx,jdbcType=VARCHAR}
565 580
     where warehouse_id = #{warehouseId,jdbcType=INTEGER}
566 581
   </update>
567 582
 

+ 18 - 0
src/main/java/com/chinaitop/depot/basic/model/BasicTank.java

@@ -68,6 +68,8 @@ public class BasicTank {
68 68
 
69 69
     private String ygajdm;
70 70
 
71
+    private String lylx;
72
+
71 73
     /**
72 74
      * 油罐id
73 75
      * @return id 油罐id
@@ -539,4 +541,20 @@ public class BasicTank {
539 541
 	public void setYgajdm(String ygajdm) {
540 542
 		this.ygajdm = ygajdm;
541 543
 	}
544
+
545
+	/**
546
+	 * 粮油类型(0:原粮,1:成品粮)
547
+	 * @return 粮油类型
548
+	 */
549
+	public String getLylx() {
550
+		return lylx;
551
+	}
552
+
553
+	/**
554
+	 * 粮油类型(0:原粮,1:成品粮)
555
+	 * @param lylx 粮油类型
556
+	 */
557
+	public void setLylx(String lylx) {
558
+		this.lylx = lylx == null ? null : lylx.trim();
559
+	}
542 560
 }

+ 18 - 0
src/main/java/com/chinaitop/depot/basic/model/BasicWarehouse.java

@@ -59,6 +59,8 @@ public class BasicWarehouse {
59 59
     private String crkStatus;
60 60
     
61 61
     private String hwdm;
62
+    
63
+    private String lylx;
62 64
 
63 65
     /**
64 66
      * null
@@ -499,4 +501,20 @@ public class BasicWarehouse {
499 501
 	public void setHwdm(String hwdm) {
500 502
 		this.hwdm = hwdm;
501 503
 	}
504
+
505
+	/**
506
+	 * 粮油类型(0:原粮,1:成品粮)
507
+	 * @return 粮油类型
508
+	 */
509
+	public String getLylx() {
510
+		return lylx;
511
+	}
512
+
513
+	/**
514
+	 * 粮油类型(0:原粮,1:成品粮)
515
+	 * @param lylx 粮油类型
516
+	 */
517
+	public void setLylx(String lylx) {
518
+		this.lylx = lylx == null ? null : lylx.trim();
519
+	}
502 520
 }

+ 12 - 1
src/main/java/com/chinaitop/depot/basic/service/impl/BasicWarehouseServiceImpl.java

@@ -1,6 +1,7 @@
1 1
 package com.chinaitop.depot.basic.service.impl;
2 2
 
3 3
 import java.util.ArrayList;
4
+import java.util.Date;
4 5
 import java.util.HashMap;
5 6
 import java.util.List;
6 7
 import java.util.Map;
@@ -137,7 +138,17 @@ public class BasicWarehouseServiceImpl implements BasicWarehouseService {
137 138
 
138 139
 	@Override
139 140
 	public void updateWareStatus(Map<String, Object> param) {
140
-		mapper.updateWareStatus(param);
141
+		String status = param.get("status").toString();
142
+		BasicWarehouse ware = new BasicWarehouse();
143
+		ware.setWarehouseId(Integer.parseInt(param.get("wareId").toString()));
144
+		ware.setCrkStatus(status);
145
+		ware.setUpdatetime(new Date());
146
+		if ("1".equals(status)) {//如果是空仓,将粮油类型设置为空
147
+			ware.setLylx("");
148
+		} else {
149
+			ware.setLylx(param.get("lylx").toString());
150
+		}
151
+		mapper.updateByPrimaryKeySelective(ware);
141 152
 	}
142 153
 
143 154
 	@Override

+ 105 - 64
src/main/java/com/chinaitop/depot/unissoft/webservice/BasicWarehouseWebServiceImpl.java

@@ -23,6 +23,7 @@ import com.chinaitop.depot.basic.model.BasicStorehouse;
23 23
 import com.chinaitop.depot.basic.model.BasicTank;
24 24
 import com.chinaitop.depot.basic.model.BasicTankHw;
25 25
 import com.chinaitop.depot.basic.model.BasicWarehouse;
26
+import com.chinaitop.depot.basic.service.BasicWarehouseService;
26 27
 import com.chinaitop.utils.ParameterUtil;
27 28
 
28 29
 @Service
@@ -35,7 +36,10 @@ public class BasicWarehouseWebServiceImpl implements BasicWarehouseWebService {
35 36
 	
36 37
 	@Resource
37 38
 	private BasicWarehouseMapper warehouseMapper;
38
-	
39
+
40
+	@Resource
41
+	private BasicWarehouseService basicWarehouseService;
42
+
39 43
 	@Resource
40 44
 	private BasicTankMapper tankMapper;
41 45
 
@@ -90,77 +94,59 @@ public class BasicWarehouseWebServiceImpl implements BasicWarehouseWebService {
90 94
 					 */
91 95
 					
92 96
 					//如果仓房ID跟货位ID一样那么说明这个数据是属于油罐的,否则就是仓房下的货位
93
-					if (houseId.equals(wareId)) {//油罐数据
97
+					BasicStorehouse storeh = storehouseMapper.selectByPrimaryKey(Integer.parseInt(houseId));
98
+					if ("1".equals(storeh.getDatatype())) {//油罐数据
94 99
 						BasicTank basicTank = tankMapper.selectByPrimaryKey(wareId);
95
-						param.put("houseCode", basicTank.getStoragetankCode());
96
-						param.remove("wareId");
97
-						//param.put("wareId", null);
98
-						if (null != basicTank && "3".equals(basicTank.getCrkStatus())) {
99
-							//查询封仓时间
100
-							List<Map<String, Object>> lqk_map = warehouseMapper.queryFenCangData(param);
101
-							if (null != lqk_map && lqk_map.size() > 0) {
102
-								String fcsj = lqk_map.get(0).get("accept_date")+"";
103
-								//判断封仓时间在不在业务时间之前
104
-								if (ParameterUtil.string2datetime(fcsj).after(ParameterUtil.string2datetime(ywsj))) {
105
-									continue;
106
-								} else {
107
-									//回写油罐的出入库状态
108
-									basicTank.setCrkStatus(status);
109
-									basicTank.setUpdatetime(new Date());
110
-									tankMapper.updateByPrimaryKey(basicTank);
111
-									BasicTankHw tankHw = new BasicTankHw();
112
-									tankHw.setId(Integer.parseInt(wareId));
113
-									tankHw.setCrkStatus(status);
114
-									tankHw.setZhgxsj(new Date());
115
-									tankHwMapper.updateByPrimaryKeySelective(tankHw);
100
+						//当前油罐只要不是放着成品油那就允许修改
101
+						//粮油类型(0:原粮,1:成品粮)
102
+						if (null == basicTank.getLylx() || "".equals(basicTank.getLylx()) || "0".equals(basicTank.getLylx())) {
103
+							param.put("houseCode", basicTank.getStoragetankCode());
104
+							param.remove("wareId");
105
+							//param.put("wareId", null);
106
+							if (null != basicTank && "3".equals(basicTank.getCrkStatus())) {
107
+								//查询封仓时间
108
+								List<Map<String, Object>> lqk_map = warehouseMapper.queryFenCangData(param);
109
+								if (null != lqk_map && lqk_map.size() > 0) {
110
+									String fcsj = lqk_map.get(0).get("accept_date")+"";
111
+									//判断封仓时间在不在业务时间之前
112
+									if (ParameterUtil.string2datetime(fcsj).after(ParameterUtil.string2datetime(ywsj))) {
113
+										continue;
114
+									} else {
115
+										//回写油罐的出入库状态
116
+										this.updateTankCrkStatus(param, basicTank);
117
+									}
116 118
 								}
119
+							} else {
120
+								//回写油罐的出入库状态
121
+								this.updateTankCrkStatus(param, basicTank);
117 122
 							}
118
-						} else {
119
-							//回写油罐的出入库状态
120
-							basicTank.setCrkStatus(status);
121
-							basicTank.setUpdatetime(new Date());
122
-							tankMapper.updateByPrimaryKey(basicTank);
123
-							BasicTankHw tankHw = new BasicTankHw();
124
-							tankHw.setId(Integer.parseInt(wareId));
125
-							tankHw.setCrkStatus(status);
126
-							tankHw.setZhgxsj(new Date());
127
-							tankHwMapper.updateByPrimaryKeySelective(tankHw);
128
-							//如果是出库,则把对应的粮情卡设置为归档
129
-							if ("4".equals(status)) {
130
-								Map<String, Object> lqkmap = new HashMap<String, Object>();
131
-								lqkmap.put("storehouseId", wareId);
132
-								lqkmap.put("orgId", orgId);
133
-								warehouseMapper.updateLqkGd(lqkmap);
134
-							}
123
+							
135 124
 						}
136 125
 					} else {//粮食仓房下的货位
137 126
 						//查询当前货位状态
138 127
 						BasicWarehouse warehouse = warehouseMapper.selectByPrimaryKey(Integer.parseInt(wareId));
139
-						
140
-						if (null != warehouse && "3".equals(warehouse.getCrkStatus())) {
141
-							param.put("wareCode", warehouse.getWarehouseCode());
142
-							BasicStorehouse basicStorehouse = storehouseMapper.selectByPrimaryKey(warehouse.getStorehouseId());
143
-							param.put("houseCode", basicStorehouse.getStorehouseCode());
144
-							//查询封仓时间
145
-							List<Map<String, Object>> lqk_map = warehouseMapper.queryFenCangData(param);
146
-							if (null != lqk_map && lqk_map.size() > 0) {
147
-								String fcsj = lqk_map.get(0).get("accept_date")+"";
148
-								//判断封仓时间在不在业务时间之前
149
-								if (ParameterUtil.string2datetime(fcsj).after(ParameterUtil.string2datetime(ywsj))) {
150
-									continue;
151
-								} else {
152
-									//回写状态
153
-									warehouseMapper.updateWareStatus(param);
128
+						//当前粮仓只要不是放着成品油那就允许修改
129
+						//粮油类型(0:原粮,1:成品粮)
130
+						if (null == warehouse.getLylx() || "".equals(warehouse.getLylx()) || "0".equals(warehouse.getLylx())) {
131
+							if (null != warehouse && "3".equals(warehouse.getCrkStatus())) {
132
+								param.put("wareCode", warehouse.getWarehouseCode());
133
+								//BasicStorehouse basicStorehouse = storehouseMapper.selectByPrimaryKey(warehouse.getStorehouseId());
134
+								param.put("houseCode", storeh.getStorehouseCode());
135
+								//查询封仓时间
136
+								List<Map<String, Object>> lqk_map = warehouseMapper.queryFenCangData(param);
137
+								if (null != lqk_map && lqk_map.size() > 0) {
138
+									String fcsj = lqk_map.get(0).get("accept_date")+"";
139
+									//判断封仓时间在不在业务时间之前
140
+									if (ParameterUtil.string2datetime(fcsj).after(ParameterUtil.string2datetime(ywsj))) {
141
+										continue;
142
+									} else {
143
+										//回写状态
144
+										this.updateWareCrkStatus(param);
145
+									}
154 146
 								}
155
-							}
156
-						} else {
157
-							//回写状态
158
-							warehouseMapper.updateWareStatus(param);
159
-							if ("4".equals(status)) {
160
-								Map<String, Object> lqkmap = new HashMap<String, Object>();
161
-								lqkmap.put("wareId", wareId);
162
-								lqkmap.put("orgId", orgId);
163
-								warehouseMapper.updateLqkGd(lqkmap);
147
+							} else {
148
+								//回写状态
149
+								this.updateWareCrkStatus(param);
164 150
 							}
165 151
 						}
166 152
 					}
@@ -182,4 +168,59 @@ public class BasicWarehouseWebServiceImpl implements BasicWarehouseWebService {
182 168
 		}
183 169
 	}
184 170
 
171
+	/**
172
+	 * 原粮修改出入库状态
173
+	 * @param param
174
+	 */
175
+	private void updateWareCrkStatus(Map<String, Object> param) {
176
+		String status = param.get("status").toString();
177
+		BasicWarehouse ware = new BasicWarehouse();
178
+		ware.setWarehouseId(Integer.parseInt(param.get("wareId").toString()));
179
+		ware.setCrkStatus(status);
180
+		if ("1".equals(status)) {//空仓
181
+			ware.setLylx("");
182
+		} else {
183
+			ware.setLylx("0");
184
+		}
185
+		ware.setUpdatetime(new Date());
186
+		warehouseMapper.updateByPrimaryKeySelective(ware);
187
+
188
+		if ("4".equals(status) || "1".equals(status)) {
189
+			Map<String, Object> lqkmap = new HashMap<String, Object>();
190
+			lqkmap.put("wareId", param.get("wareId"));
191
+			lqkmap.put("orgId", param.get("orgId"));
192
+			warehouseMapper.updateLqkGd(lqkmap);
193
+		}
194
+	}
195
+
196
+	/**
197
+	 * 修改油罐的出入库状态
198
+	 * @param param
199
+	 * @param basicTank 
200
+	 */
201
+	private void updateTankCrkStatus(Map<String, Object> param, BasicTank basicTank) {
202
+		String status = param.get("status").toString();
203
+		Integer wareId = Integer.parseInt(basicTank.getId());
204
+		basicTank.setCrkStatus(status);
205
+		basicTank.setUpdatetime(new Date());
206
+		if ("1".equals(status)) {//空仓
207
+			basicTank.setLylx("");
208
+		} else {//入库
209
+			basicTank.setLylx("0");
210
+		}
211
+		tankMapper.updateByPrimaryKey(basicTank);
212
+		BasicTankHw tankHw = new BasicTankHw();
213
+		tankHw.setId(wareId);
214
+		tankHw.setCrkStatus(status);
215
+		tankHw.setZhgxsj(new Date());
216
+		tankHwMapper.updateByPrimaryKeySelective(tankHw);
217
+		//如果是出库,则把对应的粮情卡设置为归档
218
+		if ("4".equals(status) || "1".equals(status)) {//出库或者空仓
219
+			Map<String, Object> lqkmap = new HashMap<String, Object>();
220
+			lqkmap.put("storehouseId", wareId);
221
+			lqkmap.put("orgId", param.get("orgId"));
222
+			warehouseMapper.updateLqkGd(lqkmap);
223
+		}
224
+	}
225
+
185 226
 }