|
@@ -56,15 +56,21 @@ public class OrderCustomersController extends BaseController
|
|
|
@ResponseBody
|
|
|
public Object list(HttpServletRequest request)
|
|
|
{
|
|
|
-
|
|
|
- //设置为form方式
|
|
|
- HttpHeaders headers = new HttpHeaders();
|
|
|
- headers.setContentType(MediaType.APPLICATION_FORM_URLENCODED);
|
|
|
- MultiValueMap<String, Object> map = MapDataUtil.convertMultiValueMap(request);
|
|
|
-
|
|
|
- HttpEntity<Object> requestEntity
|
|
|
- = new HttpEntity<>(map, headers);
|
|
|
- String str = restTemplate.postForObject(cloudPath+"/order"+request.getRequestURI(),requestEntity,String.class);
|
|
|
+ String str="";
|
|
|
+ String url = cloudPath + "order" + request.getRequestURI();
|
|
|
+ try {
|
|
|
+ //设置为form方式
|
|
|
+ HttpHeaders headers = new HttpHeaders();
|
|
|
+ headers.setContentType(MediaType.APPLICATION_FORM_URLENCODED);
|
|
|
+ MultiValueMap<String, Object> map = MapDataUtil.convertMultiValueMap(request);
|
|
|
+
|
|
|
+ HttpEntity<Object> requestEntity
|
|
|
+ = new HttpEntity<>(map, headers);
|
|
|
+ str = restTemplate.postForObject(url, requestEntity, String.class);
|
|
|
+ }catch (Exception e){
|
|
|
+ logger.error("查找经销商列表接口报错:"+url,e);
|
|
|
+ throw e;
|
|
|
+ }
|
|
|
return str;
|
|
|
}
|
|
|
|
|
@@ -74,8 +80,18 @@ public class OrderCustomersController extends BaseController
|
|
|
@GetMapping("/edit/{id}")
|
|
|
public String edit(@PathVariable("id") Long id, ModelMap mmap)
|
|
|
{
|
|
|
- String str = restTemplate.getForObject(cloudPath+"/order/order/customers/info/"+id,String.class);
|
|
|
- OrderCustomers orderCustomers =JSONObject.toJavaObject(JSON.parseObject(str),OrderCustomers.class);
|
|
|
+ String str = "";
|
|
|
+ OrderCustomers orderCustomers = null;
|
|
|
+ String url = cloudPath+"/order/order/customers/info/"+id;
|
|
|
+ try{
|
|
|
+
|
|
|
+ str = restTemplate.getForObject(url,String.class);
|
|
|
+ orderCustomers =JSONObject.toJavaObject(JSON.parseObject(str),OrderCustomers.class);
|
|
|
+
|
|
|
+ }catch (Exception e){
|
|
|
+ logger.error("查找经销商详情报错"+url,e);
|
|
|
+ throw e;
|
|
|
+ }
|
|
|
mmap.put("orderCustomers", orderCustomers);
|
|
|
return prefix + "/edit";
|
|
|
}
|