Browse Source

Merge remote-tracking branch 'remotes/origin/dev-2.19.1' into dev

gaodd 1 year ago
parent
commit
6f7b92ea8f

+ 25 - 5
src/main/java/com/chinaitop/depot/business/controller/BusinessContractController.java

@@ -5,17 +5,23 @@ import java.io.IOException;
5 5
 import java.util.HashMap;
6 6
 import java.util.List;
7 7
 import java.util.Map;
8
+import java.lang.reflect.InvocationTargetException;
9
+import java.lang.reflect.Method;
10
+
8 11
 
9 12
 import javax.annotation.Resource;
10 13
 import javax.servlet.http.HttpServletRequest;
11 14
 
12 15
 import org.apache.commons.lang3.StringUtils;
13 16
 import org.springframework.beans.factory.annotation.Autowired;
17
+import org.springframework.beans.factory.annotation.Value;
14 18
 import org.springframework.http.MediaType;
15 19
 import org.springframework.web.bind.annotation.RequestMapping;
16 20
 import org.springframework.web.bind.annotation.RequestMethod;
17 21
 import org.springframework.web.bind.annotation.RestController;
22
+import org.springframework.web.client.RestTemplate;
18 23
 
24
+import com.alibaba.fastjson.JSON;
19 25
 import com.chinaitop.depot.act.service.ActTaskService;
20 26
 import com.chinaitop.depot.business.model.BusinessContract;
21 27
 import com.chinaitop.depot.business.model.BusinessContractExample;
@@ -35,6 +41,7 @@ import com.fasterxml.jackson.databind.JsonMappingException;
35 41
 import com.fasterxml.jackson.databind.ObjectMapper;
36 42
 import com.github.pagehelper.PageHelper;
37 43
 import com.github.pagehelper.PageInfo;
44
+import com.google.gson.JsonObject;
38 45
 
39 46
 import io.swagger.annotations.Api;
40 47
 import io.swagger.annotations.ApiImplicitParam;
@@ -62,6 +69,12 @@ public class BusinessContractController {
62 69
     @Autowired
63 70
     private BusinessDeliveryStorageNoticeService businessNoticeService;
64 71
     
72
+    @Autowired
73
+    private RestTemplate restTemplate;
74
+    
75
+    @Value("${customerUrl}")
76
+    private String customerUrl;
77
+    
65 78
     /**
66 79
      * 合同申请列表.
67 80
      * @param pageNum 页码
@@ -240,14 +253,21 @@ public class BusinessContractController {
240 253
 		@ApiImplicitParam(name = "id", value = "合同id", paramType = "query")
241 254
 	})
242 255
     public Map<String, Object> edit(Integer id) {
243
-        Map<String, Object> modelMap = new HashMap<String, Object>();
256
+        Map<String, Object> returnMap = new HashMap<String, Object>();
257
+        
244 258
         if (id != null) {
259
+        	
245 260
             BusinessContract contract = contractService.findById(id);
246
-            modelMap.put("contract", contract);
247
-            List<BusinessFile> fileList= businessFileService.getByBid(id, "contract", null, null);
248
-            modelMap.put("fileList", fileList);
261
+            returnMap.put("contract", contract);
262
+            
263
+            Map<String,Integer> paramMap = new HashMap<String, Integer>();
264
+            paramMap.put("id", contract.getCustomerBid());
265
+            
266
+            Object forObject =  restTemplate.getForEntity(customerUrl+""+contract.getCustomerBid(), Object.class);
267
+            returnMap.put("customer",forObject);
268
+            
249 269
         }
250
-        return modelMap;
270
+        return returnMap;
251 271
     }
252 272
     
253 273
     /**

+ 2 - 0
src/main/resources/bootstrap-dev.yml

@@ -69,3 +69,5 @@ logging:
69 69
     com.chinaitop.depot.system.mapper: debug
70 70
 
71 71
 jsgjjsjUrl: http://localhost:9022/recPublish/sendMessage
72
+customerUrl: http://localhost:9016/depot/business/customer/edit?id=
73
+

+ 2 - 0
src/main/resources/bootstrap-prod.yml

@@ -65,3 +65,5 @@ cxf:
65 65
 crk-webservice: http://10.223.3.62:9025/Base/webServices/StoreChangeServer?wsdl
66 66
 
67 67
 jsgjjsjUrl: http://localhost:9022/recPublish/sendMessage
68
+customerUrl: http://localhost:9016/depot/business/customer/edit?id=
69
+