|
@@ -98,8 +98,8 @@ public class FarmStockRankController {
|
|
|
} else {
|
|
|
//status=2,显示镇汇总(养殖云)数据
|
|
|
System.out.println("status=2,显示镇汇总(养殖云)数据");
|
|
|
- JSONArray farmCodes = getFarmCodeByAdcode(farmCode);
|
|
|
- if (ObjectUtil.isEmpty(farmCodes)){
|
|
|
+ JSONArray farmCodes = getFarmCodeByAdcode(farmCode);
|
|
|
+ if (ObjectUtil.isEmpty(farmCodes) || farmCodes.size() ==0){
|
|
|
return new Result(ResultCode.SUCCESS,new ArrayList<>());
|
|
|
}
|
|
|
return getStockRankByDivision(farmCodes);
|
|
@@ -108,13 +108,14 @@ public class FarmStockRankController {
|
|
|
}
|
|
|
|
|
|
private Result getStockRankByDivision(JSONArray farmCodes) {
|
|
|
+ System.out.println("1");
|
|
|
HttpHeaders httpHeaders = new HttpHeaders();
|
|
|
MediaType type = MediaType.parseMediaType("application/json;charset=UTF-8");
|
|
|
httpHeaders.setContentType(type);
|
|
|
- HashMap<String, Object> map = new HashMap<>();
|
|
|
+ HashMap<String, JSONArray> map = new HashMap<>();
|
|
|
//这里提交的是区县编码或乡镇编码
|
|
|
map.put("farmCodes", farmCodes);
|
|
|
- HttpEntity<Map<String, Object>> objectHttpEntity = new HttpEntity<>(map, httpHeaders);
|
|
|
+ HttpEntity<Map<String, JSONArray>> objectHttpEntity = new HttpEntity<>(map, httpHeaders);
|
|
|
//读取真实数据
|
|
|
String remoteUrl = "http://123.60.134.84:10001/breed/api/v1.0.0/cattle/getStockRankByDivision";
|
|
|
ResponseEntity<String> entity = restTemplate.postForEntity(remoteUrl, objectHttpEntity, String.class);
|