|
|
@@ -38,93 +38,94 @@ public class AgentTemperatureServiceImpl implements agentTemperatureService {
|
|
38
|
38
|
*/
|
|
39
|
39
|
@Override
|
|
40
|
40
|
public List<Map<String, Object>> getAgentTemperatureList(List<Map<String, Object>> dataList,Map<String, Object> map) {
|
|
41
|
|
- List<String> houseCode = new ArrayList<>();
|
|
42
|
|
- String depotId = "";
|
|
43
|
|
- String updatetime = "";
|
|
44
|
|
- Integer idNum = 0;
|
|
45
|
|
- List<Map<String, Object>> AllList = new ArrayList<Map<String, Object>>();
|
|
46
|
|
- String houseIds = "";
|
|
47
|
|
- for (int i = 0; i <= dataList.size(); i++) {
|
|
48
|
|
- //如果是最后一次循环则直接查询数据,不往下走
|
|
49
|
|
- if(i == dataList.size()){
|
|
50
|
|
- map.put("depotId",depotId);
|
|
51
|
|
- map.put("updatetime",updatetime);
|
|
52
|
|
- map.put("houseCode",houseCode);
|
|
53
|
|
- List<Map<String, Object>> testList = businessAgentTemperatureMapper.getTestDataList(map);
|
|
54
|
|
- Map<String, Object> modelMap = new HashMap<String, Object>();
|
|
55
|
|
- if(ParameterUtil.isnotnull(testList) && testList.size() != 0){
|
|
56
|
|
- for (Map<String, Object> testData:testList) {
|
|
57
|
|
- modelMap = testData;
|
|
58
|
|
- modelMap.put("agentOrgId",dataList.get(i-1).get("agentOrgId"));
|
|
59
|
|
- modelMap.put("agentStoreOrgId",dataList.get(i-1).get("agentStoreOrgId"));
|
|
60
|
|
- modelMap.put("agentName",dataList.get(i-1).get("agentName"));
|
|
61
|
|
- modelMap.put("agentDepotName",dataList.get(i-1).get("agentDepotName"));
|
|
62
|
|
- modelMap.put("designCapacity",dataList.get(i-1).get("designCapacity"));
|
|
63
|
|
- modelMap.put("storehouseName",dataList.get(i-1).get("storehouseName"));
|
|
64
|
|
- modelMap.put("storehouseId",dataList.get(i-1).get("storehouseId"));
|
|
65
|
|
- modelMap.put("keeper",dataList.get(i-1).get("keeper"));
|
|
66
|
|
- AllList.add(modelMap);
|
|
67
|
|
- if(AllList.size() == 100){
|
|
68
|
|
- break;
|
|
69
|
|
- }
|
|
70
|
|
- }
|
|
71
|
|
- }
|
|
72
|
|
- break;
|
|
73
|
|
- }
|
|
74
|
|
- houseIds += dataList.get(i).get("storehouseId") + ",";
|
|
75
|
|
- if(idNum == 0){//判断算是否是一个库的仓房编号
|
|
76
|
|
- depotId = dataList.get(i).get("agentOrgId").toString();
|
|
77
|
|
- updatetime = dataList.get(i).get("updatetime").toString();
|
|
78
|
|
- houseCode.add(dataList.get(i).get("storehouseCode").toString());
|
|
79
|
|
- idNum++;
|
|
80
|
|
- }else if(ParameterUtil.isequal(depotId,dataList.get(i).get("agentOrgId").toString())){//如果是一个库的则组成字符串
|
|
81
|
|
- houseCode.add(dataList.get(i).get("storehouseCode").toString());
|
|
82
|
|
- }else{//不是一个库的还原idNum值,以便下回循环,然后把这个库的100条温度数据查出来加入list集合,继续循环查下一个库
|
|
83
|
|
- idNum = 0;
|
|
84
|
|
- map.put("depotId",depotId);
|
|
85
|
|
- map.put("updatetime",updatetime);
|
|
86
|
|
- map.put("houseCode",houseCode);
|
|
87
|
|
- List<Map<String, Object>> testList = businessAgentTemperatureMapper.getTestDataList(map);
|
|
88
|
|
- Map<String, Object> modelMap = new HashMap<String, Object>();
|
|
89
|
|
- if(ParameterUtil.isnotnull(testList) && testList.size() != 0){
|
|
90
|
|
- for (Map<String, Object> testData:testList) {
|
|
91
|
|
- modelMap = testData;
|
|
92
|
|
- modelMap.put("agentOrgId",dataList.get(i-1).get("agentOrgId"));
|
|
93
|
|
- modelMap.put("agentStoreOrgId",dataList.get(i-1).get("agentStoreOrgId"));
|
|
94
|
|
- modelMap.put("agentName",dataList.get(i-1).get("agentName"));
|
|
95
|
|
- modelMap.put("agentDepotName",dataList.get(i-1).get("agentDepotName"));
|
|
96
|
|
- modelMap.put("designCapacity",dataList.get(i-1).get("designCapacity"));
|
|
97
|
|
- modelMap.put("storehouseName",dataList.get(i-1).get("storehouseName"));
|
|
98
|
|
- modelMap.put("storehouseId",dataList.get(i-1).get("storehouseId"));
|
|
99
|
|
- modelMap.put("keeper",dataList.get(i-1).get("keeper"));
|
|
100
|
|
- AllList.add(modelMap);
|
|
101
|
|
- if(AllList.size() == 100){
|
|
102
|
|
- break;
|
|
103
|
|
- }
|
|
104
|
|
- }
|
|
105
|
|
- }
|
|
106
|
|
- }
|
|
107
|
|
- if(AllList.size() == 100){
|
|
108
|
|
- break;
|
|
109
|
|
- }
|
|
110
|
|
- }
|
|
111
|
|
-
|
|
112
|
|
- String url = "http://localhost:9026/agile/kcsw/getDateByHouseIds";
|
|
113
|
|
- Map<String, Object> dataMap = new HashMap<String, Object>();
|
|
114
|
|
- dataMap.put("houseIds",houseIds.substring(0,houseIds.length()-1));
|
|
115
|
|
- String strResult = HTTPUtils.doPost(url,dataMap);
|
|
116
|
|
- JSONArray json = JSONArray.parseArray(strResult);
|
|
117
|
|
- if(ParameterUtil.isnotnull(json) && json.size() != 0){
|
|
118
|
|
- for (int i = 0; i < AllList.size(); i++) {
|
|
119
|
|
- for (int j = 0; j < json.size(); j++) {
|
|
120
|
|
- JSONObject job = json.getJSONObject(j);
|
|
121
|
|
- if(ParameterUtil.isequal(AllList.get(i).get("storehouseId").toString(),job.get("ch").toString())){
|
|
122
|
|
- AllList.get(i).put("lspz",Integer.parseInt(job.get("pz").toString()));
|
|
123
|
|
- }
|
|
124
|
|
- }
|
|
125
|
|
- }
|
|
126
|
|
- }
|
|
127
|
|
- return AllList;
|
|
|
41
|
+// List<String> houseCode = new ArrayList<>();
|
|
|
42
|
+// String depotId = "";
|
|
|
43
|
+// String updatetime = "";
|
|
|
44
|
+// Integer idNum = 0;
|
|
|
45
|
+// List<Map<String, Object>> AllList = new ArrayList<Map<String, Object>>();
|
|
|
46
|
+// String houseIds = "";
|
|
|
47
|
+// for (int i = 0; i <= dataList.size(); i++) {
|
|
|
48
|
+// //如果是最后一次循环则直接查询数据,不往下走
|
|
|
49
|
+// if(i == dataList.size()){
|
|
|
50
|
+// map.put("depotId",depotId);
|
|
|
51
|
+// map.put("updatetime",updatetime);
|
|
|
52
|
+// map.put("houseCode",houseCode);
|
|
|
53
|
+// List<Map<String, Object>> testList = businessAgentTemperatureMapper.getTestDataList(map);
|
|
|
54
|
+// Map<String, Object> modelMap = new HashMap<String, Object>();
|
|
|
55
|
+// if(ParameterUtil.isnotnull(testList) && testList.size() != 0){
|
|
|
56
|
+// for (Map<String, Object> testData:testList) {
|
|
|
57
|
+// modelMap = testData;
|
|
|
58
|
+// modelMap.put("agentOrgId",dataList.get(i-1).get("agentOrgId"));
|
|
|
59
|
+// modelMap.put("agentStoreOrgId",dataList.get(i-1).get("agentStoreOrgId"));
|
|
|
60
|
+// modelMap.put("agentName",dataList.get(i-1).get("agentName"));
|
|
|
61
|
+// modelMap.put("agentDepotName",dataList.get(i-1).get("agentDepotName"));
|
|
|
62
|
+// modelMap.put("designCapacity",dataList.get(i-1).get("designCapacity"));
|
|
|
63
|
+// modelMap.put("storehouseName",dataList.get(i-1).get("storehouseName"));
|
|
|
64
|
+// modelMap.put("storehouseId",dataList.get(i-1).get("storehouseId"));
|
|
|
65
|
+// modelMap.put("keeper",dataList.get(i-1).get("keeper"));
|
|
|
66
|
+// AllList.add(modelMap);
|
|
|
67
|
+// if(AllList.size() == 100){
|
|
|
68
|
+// break;
|
|
|
69
|
+// }
|
|
|
70
|
+// }
|
|
|
71
|
+// }
|
|
|
72
|
+// break;
|
|
|
73
|
+// }
|
|
|
74
|
+// houseIds += dataList.get(i).get("storehouseId") + ",";
|
|
|
75
|
+// if(idNum == 0){//判断算是否是一个库的仓房编号
|
|
|
76
|
+// depotId = dataList.get(i).get("agentOrgId").toString();
|
|
|
77
|
+// updatetime = dataList.get(i).get("updatetime").toString();
|
|
|
78
|
+// houseCode.add(dataList.get(i).get("storehouseCode").toString());
|
|
|
79
|
+// idNum++;
|
|
|
80
|
+// }else if(ParameterUtil.isequal(depotId,dataList.get(i).get("agentOrgId").toString())){//如果是一个库的则组成字符串
|
|
|
81
|
+// houseCode.add(dataList.get(i).get("storehouseCode").toString());
|
|
|
82
|
+// }else{//不是一个库的还原idNum值,以便下回循环,然后把这个库的100条温度数据查出来加入list集合,继续循环查下一个库
|
|
|
83
|
+// idNum = 0;
|
|
|
84
|
+// map.put("depotId",depotId);
|
|
|
85
|
+// map.put("updatetime",updatetime);
|
|
|
86
|
+// map.put("houseCode",houseCode);
|
|
|
87
|
+// List<Map<String, Object>> testList = businessAgentTemperatureMapper.getTestDataList(map);
|
|
|
88
|
+// Map<String, Object> modelMap = new HashMap<String, Object>();
|
|
|
89
|
+// if(ParameterUtil.isnotnull(testList) && testList.size() != 0){
|
|
|
90
|
+// for (Map<String, Object> testData:testList) {
|
|
|
91
|
+// modelMap = testData;
|
|
|
92
|
+// modelMap.put("agentOrgId",dataList.get(i-1).get("agentOrgId"));
|
|
|
93
|
+// modelMap.put("agentStoreOrgId",dataList.get(i-1).get("agentStoreOrgId"));
|
|
|
94
|
+// modelMap.put("agentName",dataList.get(i-1).get("agentName"));
|
|
|
95
|
+// modelMap.put("agentDepotName",dataList.get(i-1).get("agentDepotName"));
|
|
|
96
|
+// modelMap.put("designCapacity",dataList.get(i-1).get("designCapacity"));
|
|
|
97
|
+// modelMap.put("storehouseName",dataList.get(i-1).get("storehouseName"));
|
|
|
98
|
+// modelMap.put("storehouseId",dataList.get(i-1).get("storehouseId"));
|
|
|
99
|
+// modelMap.put("keeper",dataList.get(i-1).get("keeper"));
|
|
|
100
|
+// AllList.add(modelMap);
|
|
|
101
|
+// if(AllList.size() == 100){
|
|
|
102
|
+// break;
|
|
|
103
|
+// }
|
|
|
104
|
+// }
|
|
|
105
|
+// }
|
|
|
106
|
+// }
|
|
|
107
|
+// if(AllList.size() == 100){
|
|
|
108
|
+// break;
|
|
|
109
|
+// }
|
|
|
110
|
+// }
|
|
|
111
|
+//
|
|
|
112
|
+// String url = "http://localhost:9026/agile/kcsw/getDateByHouseIds";
|
|
|
113
|
+// Map<String, Object> dataMap = new HashMap<String, Object>();
|
|
|
114
|
+// dataMap.put("houseIds",houseIds.substring(0,houseIds.length()-1));
|
|
|
115
|
+// String strResult = HTTPUtils.doPost(url,dataMap);
|
|
|
116
|
+// JSONArray json = JSONArray.parseArray(strResult);
|
|
|
117
|
+// if(ParameterUtil.isnotnull(json) && json.size() != 0){
|
|
|
118
|
+// for (int i = 0; i < AllList.size(); i++) {
|
|
|
119
|
+// for (int j = 0; j < json.size(); j++) {
|
|
|
120
|
+// JSONObject job = json.getJSONObject(j);
|
|
|
121
|
+// if(ParameterUtil.isequal(AllList.get(i).get("storehouseId").toString(),job.get("ch").toString())){
|
|
|
122
|
+// AllList.get(i).put("lspz",Integer.parseInt(job.get("pz").toString()));
|
|
|
123
|
+// }
|
|
|
124
|
+// }
|
|
|
125
|
+// }
|
|
|
126
|
+// }
|
|
|
127
|
+// return AllList;
|
|
|
128
|
+ return businessAgentTemperatureMapper.getDataByExample(map);
|
|
128
|
129
|
}
|
|
129
|
130
|
|
|
130
|
131
|
@Override
|