Bläddra i källkod

代储点下粮情数据展示列表bug修改

fanxw 5 år sedan
förälder
incheckning
64b1ad76fc

+ 22 - 2
src/main/java/com/chinaitop/depot/agent/basic/controller/AgentStorehouseController.java

@@ -14,6 +14,8 @@ import io.swagger.annotations.Api;
14 14
 import io.swagger.annotations.ApiImplicitParam;
15 15
 import io.swagger.annotations.ApiImplicitParams;
16 16
 import io.swagger.annotations.ApiOperation;
17
+
18
+import org.apache.commons.collections.IteratorUtils;
17 19
 import org.springframework.http.MediaType;
18 20
 import org.springframework.web.bind.annotation.RequestMapping;
19 21
 import org.springframework.web.bind.annotation.RequestMethod;
@@ -22,6 +24,7 @@ import org.springframework.web.bind.annotation.RestController;
22 24
 import javax.annotation.Resource;
23 25
 import java.util.ArrayList;
24 26
 import java.util.HashMap;
27
+import java.util.Iterator;
25 28
 import java.util.List;
26 29
 import java.util.Map;
27 30
 
@@ -82,9 +85,10 @@ public class AgentStorehouseController {
82 85
     @ApiImplicitParams({
83 86
             @ApiImplicitParam(name = "orgId", value = "组织id", paramType = "query"),
84 87
             @ApiImplicitParam(name = "depotId", value = "代储库id", paramType = "query"),
85
-            @ApiImplicitParam(name = "is_three", value = "是否需要第三方的仓房 和油罐信息,1是需要,空值是不需要", paramType = "query")
88
+            @ApiImplicitParam(name = "is_three", value = "是否需要第三方的仓房 和油罐信息,1是需要,空值是不需要", paramType = "query"),
89
+            @ApiImplicitParam(name = "is_lq", value = "是否需要油罐信息,1是需要,空值是不需要", paramType = "query")
86 90
     })
87
-    public List<Map<String,Object>> getDepotToStoreList(String orgId, String depotId, String is_three){
91
+    public List<Map<String,Object>> getDepotToStoreList(String orgId, String depotId, String is_three, String is_lq){
88 92
         Map<String,Object> map = new HashMap<>();
89 93
         if (null != orgId && !"".equals(orgId)) {
90 94
         	map.put("orgId",orgId);
@@ -108,6 +112,22 @@ public class AgentStorehouseController {
108 112
         		new_list.add(list_map);
109 113
         	}
110 114
         }
115
+        //如果是粮情数据,那就不要油罐的信息
116
+        if (null == is_lq || "".equals(is_lq)) {
117
+        	if (null != new_list && new_list.size() > 0) {
118
+        		List<Map<String,Object>> list2 = new ArrayList<Map<String, Object>>();
119
+        		Iterator<Map<String,Object>> ite = list.iterator();
120
+        		while (ite.hasNext()) {
121
+        			Map<String,Object> map2 = ite.next();
122
+        			if ("YG".equals(map2.get("storehouseId").toString().substring(0, 2))) {
123
+        				ite.remove();
124
+        			} else {
125
+        				list2.add(map2);
126
+        			}
127
+        		}
128
+        		new_list = list2;
129
+        	}
130
+        }
111 131
         return new_list;
112 132
     }
113 133
 

+ 21 - 15
src/main/java/com/chinaitop/depot/agent/temperature/controller/AgentTemperatureController.java

@@ -1,8 +1,21 @@
1 1
 package com.chinaitop.depot.agent.temperature.controller;
2 2
 
3
+import java.util.ArrayList;
4
+import java.util.HashMap;
5
+import java.util.List;
6
+import java.util.Map;
7
+
8
+import javax.annotation.Resource;
9
+import javax.servlet.http.HttpServletRequest;
10
+
11
+import org.apache.commons.lang.StringUtils;
12
+import org.springframework.http.MediaType;
13
+import org.springframework.web.bind.annotation.RequestMapping;
14
+import org.springframework.web.bind.annotation.RequestMethod;
15
+import org.springframework.web.bind.annotation.RestController;
16
+import org.springframework.web.multipart.MultipartFile;
17
+
3 18
 import com.alibaba.fastjson.JSON;
4
-import com.alibaba.fastjson.JSONObject;
5
-import com.chinaitop.depot.agent.basic.model.BusinessAgentTank;
6 19
 import com.chinaitop.depot.agent.basic.service.agentService;
7 20
 import com.chinaitop.depot.agent.temperature.model.BusinessAgentTemperature;
8 21
 import com.chinaitop.depot.agent.temperature.model.TPoints;
@@ -12,20 +25,11 @@ import com.chinaitop.utils.ParameterUtil;
12 25
 import com.fasterxml.jackson.databind.ObjectMapper;
13 26
 import com.github.pagehelper.PageHelper;
14 27
 import com.github.pagehelper.PageInfo;
28
+
15 29
 import io.swagger.annotations.Api;
16 30
 import io.swagger.annotations.ApiImplicitParam;
17 31
 import io.swagger.annotations.ApiImplicitParams;
18 32
 import io.swagger.annotations.ApiOperation;
19
-import org.apache.commons.lang.StringUtils;
20
-import org.springframework.http.MediaType;
21
-import org.springframework.web.bind.annotation.RequestMapping;
22
-import org.springframework.web.bind.annotation.RequestMethod;
23
-import org.springframework.web.bind.annotation.RestController;
24
-import org.springframework.web.multipart.MultipartFile;
25
-
26
-import javax.annotation.Resource;
27
-import javax.servlet.http.HttpServletRequest;
28
-import java.util.*;
29 33
 
30 34
 @RestController
31 35
 @RequestMapping(value = "/agentTemperature")
@@ -152,18 +156,20 @@ public class AgentTemperatureController {
152 156
     public Map<String, Object> getAgentTemperatureEdit(Integer id) {
153 157
         Map<String, Object> modelMap = new HashMap<>();
154 158
         List<TPoints> tPointsList = new ArrayList<TPoints>();
155
-        BusinessAgentTemperature agentTemper;
159
+        BusinessAgentTemperature agentTemper = null;
156 160
         if (id != null) {
157 161
             agentTemper = agentTemperatureService.findById(id);
158
-            modelMap.put("agentTemper", agentTemper);
159 162
             String[] points = agentTemper.gettPoints().substring(2, agentTemper.gettPoints().length() - 2).split("\\},\\{");
160 163
             ObjectMapper mapper = new ObjectMapper();
161 164
             for (String point : points) {
162 165
                 TPoints tPoints = JSON.parseObject(JSON.parse("{" + point + "}").toString(), TPoints.class);
163 166
                 tPointsList.add(tPoints);
164 167
             }
165
-            modelMap.put("tPoints", tPointsList);
168
+        } else {
169
+        	agentTemper = new BusinessAgentTemperature();
166 170
         }
171
+        modelMap.put("agentTemper", agentTemper);
172
+        modelMap.put("tPoints", tPointsList);
167 173
         return modelMap;
168 174
     }
169 175
 

+ 2 - 2
src/main/java/com/chinaitop/depot/agent/temperature/mapper/BusinessAgentTemperatureMapper.xml

@@ -627,8 +627,8 @@
627 627
     LEFT JOIN business_agent_depot depot ON depot.id = temper.agent_depot_id
628 628
     AND depot.org_id = #{orgId,jdbcType=INTEGER}
629 629
     LEFT JOIN basic_storehouse store ON store.storehouse_id = temper.storehouse_id
630
-    AND store.library_type = 1
631
-    AND store.org_id = #{orgId,jdbcType=INTEGER}
630
+<!--     AND store.library_type = 1 -->
631
+<!--     AND store.org_id = #{orgId,jdbcType=INTEGER} -->
632 632
     WHERE temper.org_id = #{orgId,jdbcType=INTEGER}
633 633
     <if test="agentId != null">
634 634
       AND temper.agent_id = #{agentId,jdbcType=INTEGER}