|
@@ -67,9 +67,17 @@ public class OverviewController {
|
|
//status=2,显示镇汇总(养殖云)数据
|
|
//status=2,显示镇汇总(养殖云)数据
|
|
System.out.println("status=2,显示镇汇总(养殖云)数据");
|
|
System.out.println("status=2,显示镇汇总(养殖云)数据");
|
|
String farmCodes = getFarmCodeByAdcode(farmCode);
|
|
String farmCodes = getFarmCodeByAdcode(farmCode);
|
|
|
|
+ System.out.println("大屏总览farmCodes:"+farmCodes);
|
|
System.out.println(farmCodes);
|
|
System.out.println(farmCodes);
|
|
if (StringUtils.isBlank(farmCodes)){
|
|
if (StringUtils.isBlank(farmCodes)){
|
|
- return new Result(ResultCode.SUCCESS,new ArrayList<>());
|
|
|
|
|
|
+ JSONObject jsonObject = new JSONObject();
|
|
|
|
+ jsonObject.put("stockCount", 0);
|
|
|
|
+ jsonObject.put("outCount", 0);
|
|
|
|
+ jsonObject.put("breedCount", 0);
|
|
|
|
+ jsonObject.put("farmCount", 0);
|
|
|
|
+ jsonObject.put("outputValue", 0);
|
|
|
|
+ jsonObject.put("variety", 0);
|
|
|
|
+ return new Result(ResultCode.SUCCESS,jsonObject);
|
|
}
|
|
}
|
|
return getStockFromBreedCloud(farmCodes);
|
|
return getStockFromBreedCloud(farmCodes);
|
|
//++++++++++++++++++++++++++++++++++++++++++++++++++
|
|
//++++++++++++++++++++++++++++++++++++++++++++++++++
|
|
@@ -95,10 +103,17 @@ public class OverviewController {
|
|
} else {
|
|
} else {
|
|
//status=2,显示村汇总(养殖云)数据
|
|
//status=2,显示村汇总(养殖云)数据
|
|
System.out.println("status=2,显示村汇总(养殖云)数据");
|
|
System.out.println("status=2,显示村汇总(养殖云)数据");
|
|
- String farmCodes = getFarmCodeByAdcode(farmCode);
|
|
|
|
- System.out.println(farmCodes);
|
|
|
|
- if (StringUtils.isBlank(farmCodes)){
|
|
|
|
- return new Result(ResultCode.SUCCESS,new ArrayList<>());
|
|
|
|
|
|
+ String farmCodes = getFarmCodeByAdcode(farmCode);
|
|
|
|
+ System.out.println("大屏总览farmCodes:"+farmCodes);
|
|
|
|
+ if (StringUtils.isEmpty(farmCodes)){
|
|
|
|
+ JSONObject jsonObject = new JSONObject();
|
|
|
|
+ jsonObject.put("stockCount", 0);
|
|
|
|
+ jsonObject.put("outCount", 0);
|
|
|
|
+ jsonObject.put("breedCount", 0);
|
|
|
|
+ jsonObject.put("farmCount", 0);
|
|
|
|
+ jsonObject.put("outputValue", 0);
|
|
|
|
+ jsonObject.put("variety", 0);
|
|
|
|
+ return new Result(ResultCode.SUCCESS,jsonObject);
|
|
}
|
|
}
|
|
return getStockFromBreedCloud(farmCodes);
|
|
return getStockFromBreedCloud(farmCodes);
|
|
}
|
|
}
|
|
@@ -106,7 +121,7 @@ public class OverviewController {
|
|
}
|
|
}
|
|
|
|
|
|
private String getFarmCodeByAdcode(String farmCode) {
|
|
private String getFarmCodeByAdcode(String farmCode) {
|
|
- String adcode = "620826";
|
|
|
|
|
|
+ String adcode = "640424";
|
|
if (!"0".equals(farmCode)){
|
|
if (!"0".equals(farmCode)){
|
|
SysFarm list = farmService.getOne(new QueryWrapper<SysFarm>().eq("farm_code", farmCode));
|
|
SysFarm list = farmService.getOne(new QueryWrapper<SysFarm>().eq("farm_code", farmCode));
|
|
if (ObjectUtil.isNotEmpty(list)){
|
|
if (ObjectUtil.isNotEmpty(list)){
|
|
@@ -114,7 +129,7 @@ public class OverviewController {
|
|
adcode = split[split.length-1];
|
|
adcode = split[split.length-1];
|
|
}
|
|
}
|
|
}
|
|
}
|
|
- String remoteUrl = "http://123.60.134.84:10001/admin/v1.0.0/account/getFarmCodeByAdcode";
|
|
|
|
|
|
+ String remoteUrl = "http://earcon-cattle.xuyunbao.com/smartRanchApi/admin/v1.0.0/account/getFarmCodeByAdcode";
|
|
Map map = new HashMap();
|
|
Map map = new HashMap();
|
|
map.put("adcode",adcode);
|
|
map.put("adcode",adcode);
|
|
ResponseEntity<String> stringResponseEntity = restTemplate.postForEntity(remoteUrl, map, String.class);
|
|
ResponseEntity<String> stringResponseEntity = restTemplate.postForEntity(remoteUrl, map, String.class);
|
|
@@ -132,13 +147,16 @@ public class OverviewController {
|
|
map.put("farmCode", farmCodes);
|
|
map.put("farmCode", farmCodes);
|
|
HttpEntity<Map<String, Object>> objectHttpEntity = new HttpEntity<>(map, httpHeaders);
|
|
HttpEntity<Map<String, Object>> objectHttpEntity = new HttpEntity<>(map, httpHeaders);
|
|
//读取真实数据
|
|
//读取真实数据
|
|
- String remoteUrl = "http://123.60.134.84:10001/breed/api/v1.0.0/cattle/getFarmCountByDivision";
|
|
|
|
|
|
+ String remoteUrl = "http://earcon-cattle.xuyunbao.com/smartRanchApi/breed/api/v1.0.0/cattle/getFarmCountByDivision";
|
|
ResponseEntity<String> entity = restTemplate.postForEntity(remoteUrl, objectHttpEntity, String.class);
|
|
ResponseEntity<String> entity = restTemplate.postForEntity(remoteUrl, objectHttpEntity, String.class);
|
|
if(entity.getStatusCode().toString().contains("200")){
|
|
if(entity.getStatusCode().toString().contains("200")){
|
|
String body = entity.getBody();
|
|
String body = entity.getBody();
|
|
System.out.println(body);
|
|
System.out.println(body);
|
|
JSONObject dataJo = JSON.parseObject(body).getJSONObject("data");
|
|
JSONObject dataJo = JSON.parseObject(body).getJSONObject("data");
|
|
System.out.println("dataJo="+dataJo);
|
|
System.out.println("dataJo="+dataJo);
|
|
|
|
+ if (ObjectUtil.isEmpty(dataJo)){
|
|
|
|
+
|
|
|
|
+ }
|
|
dataJo.put("variety",0);
|
|
dataJo.put("variety",0);
|
|
//, )
|
|
//, )
|
|
return new Result(ResultCode.SUCCESS,dataJo);
|
|
return new Result(ResultCode.SUCCESS,dataJo);
|