|
|
@@ -2,6 +2,7 @@ package com.chinaitop.depot.unissoft.webservice;
|
|
2
|
2
|
|
|
3
|
3
|
import java.util.HashMap;
|
|
4
|
4
|
import java.util.Iterator;
|
|
|
5
|
+import java.util.List;
|
|
5
|
6
|
import java.util.Map;
|
|
6
|
7
|
|
|
7
|
8
|
import javax.annotation.Resource;
|
|
|
@@ -12,6 +13,8 @@ import org.springframework.stereotype.Service;
|
|
12
|
13
|
import com.alibaba.fastjson.JSONArray;
|
|
13
|
14
|
import com.alibaba.fastjson.JSONObject;
|
|
14
|
15
|
import com.chinaitop.depot.basic.mapper.BasicWarehouseMapper;
|
|
|
16
|
+import com.chinaitop.depot.basic.model.BasicWarehouse;
|
|
|
17
|
+import com.chinaitop.utils.ParameterUtil;
|
|
15
|
18
|
|
|
16
|
19
|
@Service
|
|
17
|
20
|
public class BasicWarehouseWebServiceImpl implements BasicWarehouseWebService {
|
|
|
@@ -39,19 +42,46 @@ public class BasicWarehouseWebServiceImpl implements BasicWarehouseWebService {
|
|
39
|
42
|
continue;
|
|
40
|
43
|
}
|
|
41
|
44
|
|
|
42
|
|
- //货位ID
|
|
|
45
|
+ //货位ID(云南没有油罐的业务,不用判断是否是油罐)
|
|
43
|
46
|
String wareId = ObjectUtils.toString(json_object.get("hwId"), "");
|
|
44
|
47
|
//单位ID
|
|
45
|
48
|
String orgId = ObjectUtils.toString(json_object.get("org_Id"), "");
|
|
46
|
49
|
//货位状态值1空仓,2入库中,3封仓,4出库中,9其它
|
|
47
|
50
|
String status = ObjectUtils.toString(json_object.get("status"), "");
|
|
|
51
|
+ //业务时间
|
|
|
52
|
+ String ywsj = ObjectUtils.toString(json_object.get("cjsj"), "");
|
|
48
|
53
|
|
|
49
|
54
|
//修改数据
|
|
50
|
55
|
Map<String, Object> param = new HashMap<String, Object>();
|
|
51
|
56
|
param.put("wareId", Integer.parseInt(wareId));
|
|
52
|
57
|
param.put("orgId", Integer.parseInt(orgId));
|
|
53
|
58
|
param.put("status", status);
|
|
54
|
|
- warehouseMapper.updateWareStatus(param);
|
|
|
59
|
+ param.put("ywsj", ywsj);
|
|
|
60
|
+
|
|
|
61
|
+ /**
|
|
|
62
|
+ * 1、查询当前仓房货位有没有封仓;
|
|
|
63
|
+ * 2、如果封仓了,并且封仓时间在业务时间之前:那么就不回写当前传过来的状态,这个数据是在封仓前产生的
|
|
|
64
|
+ * 3、如果封仓了,并且封仓时间在业务时间之后:那么就回写当前传过来的状态,这个数据是在封仓后产生的
|
|
|
65
|
+ */
|
|
|
66
|
+ //查询当前货位状态
|
|
|
67
|
+ BasicWarehouse warehouse = warehouseMapper.selectByPrimaryKey(Integer.parseInt(wareId));
|
|
|
68
|
+ if (null != warehouse && "3".equals(warehouse.getCrkStatus())) {
|
|
|
69
|
+ //查询封仓时间
|
|
|
70
|
+ List<Map<String, String>> map = warehouseMapper.queryFcdate(param);
|
|
|
71
|
+ if (null != map && map.size() > 0) {
|
|
|
72
|
+ String fcsj = map.get(0).get("filling_time")+" 00:00:00";
|
|
|
73
|
+ //判断封仓时间在不在业务时间之前
|
|
|
74
|
+ if (ParameterUtil.string2datetime(fcsj).after(ParameterUtil.string2datetime(ywsj))) {
|
|
|
75
|
+ continue;
|
|
|
76
|
+ } else {
|
|
|
77
|
+ //回写状态
|
|
|
78
|
+ warehouseMapper.updateWareStatus(param);
|
|
|
79
|
+ }
|
|
|
80
|
+ }
|
|
|
81
|
+ } else {
|
|
|
82
|
+ //回写状态
|
|
|
83
|
+ warehouseMapper.updateWareStatus(param);
|
|
|
84
|
+ }
|
|
55
|
85
|
}
|
|
56
|
86
|
}
|
|
57
|
87
|
result.put("success", "true");
|
|
|
@@ -60,7 +90,8 @@ public class BasicWarehouseWebServiceImpl implements BasicWarehouseWebService {
|
|
60
|
90
|
e.printStackTrace();
|
|
61
|
91
|
result.put("success", "false");
|
|
62
|
92
|
result.put("msg", "上传失败");
|
|
63
|
|
- } finally {
|
|
|
93
|
+ }
|
|
|
94
|
+ finally {
|
|
64
|
95
|
JSONArray jsonArray = new JSONArray();
|
|
65
|
96
|
jsonArray.add(result);
|
|
66
|
97
|
return jsonArray.toString();
|