|
@@ -51,7 +51,8 @@ public class ScreenSiZhuTestController {
|
|
* @throws ParseException
|
|
* @throws ParseException
|
|
*/
|
|
*/
|
|
@RequestMapping("/count_sizhu_record")
|
|
@RequestMapping("/count_sizhu_record")
|
|
- public R count_sizhu_record(HttpServletRequest request, @RequestParam(name = "farmId") Integer farmId) throws ClientException, ParseException {
|
|
|
|
|
|
+ public R count_sizhu_record(HttpServletRequest request, @RequestParam(name = "farmId") String farmId) throws ClientException, ParseException {
|
|
|
|
+ System.out.println(farmId);
|
|
Map map1 = new HashMap();
|
|
Map map1 = new HashMap();
|
|
map1.put("value1", getPastSevenDay(farmId));
|
|
map1.put("value1", getPastSevenDay(farmId));
|
|
map1.put("value2", getDay(farmId));
|
|
map1.put("value2", getDay(farmId));
|
|
@@ -63,7 +64,8 @@ public class ScreenSiZhuTestController {
|
|
return R.ok("当前牧场无设备").put("data", null);
|
|
return R.ok("当前牧场无设备").put("data", null);
|
|
}
|
|
}
|
|
@RequestMapping("/SiZhuList")
|
|
@RequestMapping("/SiZhuList")
|
|
- public R SiZhuList(HttpServletRequest request, @RequestParam(name = "farmId") Integer farmId) throws ClientException, ParseException {
|
|
|
|
|
|
+ public R SiZhuList(HttpServletRequest request, @RequestParam(name = "farmId") String farmId) throws ClientException, ParseException {
|
|
|
|
+ System.out.println(farmId);
|
|
GeneralResponse siZhuList = getSiZhuList(farmId);
|
|
GeneralResponse siZhuList = getSiZhuList(farmId);
|
|
if (ObjectUtil.isNotEmpty(siZhuList)){
|
|
if (ObjectUtil.isNotEmpty(siZhuList)){
|
|
return R.ok("请求成功").put("data", siZhuList);
|
|
return R.ok("请求成功").put("data", siZhuList);
|
|
@@ -72,7 +74,7 @@ public class ScreenSiZhuTestController {
|
|
}
|
|
}
|
|
|
|
|
|
//过去七天的值
|
|
//过去七天的值
|
|
- public String getPastSevenDay(Integer farmId) throws ClientException {
|
|
|
|
|
|
+ public String getPastSevenDay(String farmId) throws ClientException {
|
|
GetResponse getResponse = new GetResponse();
|
|
GetResponse getResponse = new GetResponse();
|
|
SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
|
|
SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
|
|
Calendar c = Calendar.getInstance();
|
|
Calendar c = Calendar.getInstance();
|
|
@@ -87,13 +89,13 @@ public class ScreenSiZhuTestController {
|
|
c.add(Calendar.DATE, -7);
|
|
c.add(Calendar.DATE, -7);
|
|
Date B = c.getTime();
|
|
Date B = c.getTime();
|
|
String formatB = format.format(B);
|
|
String formatB = format.format(B);
|
|
- if (farmId == 1){
|
|
|
|
|
|
+ if ("1".equals(farmId)){
|
|
return getResponse.SendMassageXixiaoPerson(formatB, formatA,oauthConfigBaseInfo,CommonConstant.SIZhuChannle);
|
|
return getResponse.SendMassageXixiaoPerson(formatB, formatA,oauthConfigBaseInfo,CommonConstant.SIZhuChannle);
|
|
}
|
|
}
|
|
- if (farmId == 22){
|
|
|
|
|
|
+ if ("22".equals(farmId)){
|
|
return getResponse.SendMassageXixiaoPerson02(formatB, formatA,oauthConfigBaseInfo02,CommonConstant.SIZhuChannle);
|
|
return getResponse.SendMassageXixiaoPerson02(formatB, formatA,oauthConfigBaseInfo02,CommonConstant.SIZhuChannle);
|
|
}
|
|
}
|
|
- if (farmId == 21){
|
|
|
|
|
|
+ if ("21".equals(farmId)){
|
|
return getResponse.SendMassageXixiaoPerson03(formatB, formatA,oauthConfigBaseInfo03,CommonConstant.SIZhuChannle);
|
|
return getResponse.SendMassageXixiaoPerson03(formatB, formatA,oauthConfigBaseInfo03,CommonConstant.SIZhuChannle);
|
|
}
|
|
}
|
|
return "0";
|
|
return "0";
|
|
@@ -102,7 +104,7 @@ public class ScreenSiZhuTestController {
|
|
|
|
|
|
|
|
|
|
//今天的数据
|
|
//今天的数据
|
|
- public String getDay(Integer farmId) throws ClientException {
|
|
|
|
|
|
+ public String getDay(String farmId) throws ClientException {
|
|
GetResponse getResponse = new GetResponse();
|
|
GetResponse getResponse = new GetResponse();
|
|
SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
|
|
SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
|
|
Calendar c = Calendar.getInstance();
|
|
Calendar c = Calendar.getInstance();
|
|
@@ -117,13 +119,13 @@ public class ScreenSiZhuTestController {
|
|
c.add(Calendar.DATE, -1);
|
|
c.add(Calendar.DATE, -1);
|
|
Date B = c.getTime();
|
|
Date B = c.getTime();
|
|
String formatB = format.format(B);
|
|
String formatB = format.format(B);
|
|
- if (farmId == 1){
|
|
|
|
|
|
+ if ("1".equals(farmId)){
|
|
return getResponse.SendMassageXixiaoPerson(formatB, formatA,oauthConfigBaseInfo,CommonConstant.SIZhuChannle);
|
|
return getResponse.SendMassageXixiaoPerson(formatB, formatA,oauthConfigBaseInfo,CommonConstant.SIZhuChannle);
|
|
}
|
|
}
|
|
- if (farmId == 22){
|
|
|
|
|
|
+ if ("22".equals(farmId)){
|
|
return getResponse.SendMassageXixiaoPerson02(formatB, formatA,oauthConfigBaseInfo02,CommonConstant.SIZhuChannle);
|
|
return getResponse.SendMassageXixiaoPerson02(formatB, formatA,oauthConfigBaseInfo02,CommonConstant.SIZhuChannle);
|
|
}
|
|
}
|
|
- if (farmId == 21){
|
|
|
|
|
|
+ if ("21".equals(farmId)){
|
|
return getResponse.SendMassageXixiaoPerson03(formatB, formatA,oauthConfigBaseInfo03,CommonConstant.SIZhuChannle);
|
|
return getResponse.SendMassageXixiaoPerson03(formatB, formatA,oauthConfigBaseInfo03,CommonConstant.SIZhuChannle);
|
|
}
|
|
}
|
|
return "0";
|
|
return "0";
|
|
@@ -131,7 +133,7 @@ public class ScreenSiZhuTestController {
|
|
|
|
|
|
|
|
|
|
//最新一条的数据
|
|
//最新一条的数据
|
|
- public String getLatestOne(Integer farmId) {
|
|
|
|
|
|
+ public String getLatestOne(String farmId) {
|
|
SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
|
|
SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
|
|
Calendar c = Calendar.getInstance();
|
|
Calendar c = Calendar.getInstance();
|
|
Date date = new Date();
|
|
Date date = new Date();
|
|
@@ -145,7 +147,7 @@ public class ScreenSiZhuTestController {
|
|
Date d = c.getTime();
|
|
Date d = c.getTime();
|
|
String formatD = format.format(d);
|
|
String formatD = format.format(d);
|
|
String result ="";
|
|
String result ="";
|
|
- if (farmId == 1){
|
|
|
|
|
|
+ if ("1".equals(farmId)){
|
|
System.out.println("曙光");
|
|
System.out.println("曙光");
|
|
XunZhengRequestSg requestSg = new XunZhengRequestSg(oauthConfigBaseInfo);
|
|
XunZhengRequestSg requestSg = new XunZhengRequestSg(oauthConfigBaseInfo);
|
|
requestSg.setPageNum(1);
|
|
requestSg.setPageNum(1);
|
|
@@ -155,7 +157,7 @@ public class ScreenSiZhuTestController {
|
|
requestSg.setEventType(1);
|
|
requestSg.setEventType(1);
|
|
result = requestSg.doAction();
|
|
result = requestSg.doAction();
|
|
}
|
|
}
|
|
- if (farmId == 22){
|
|
|
|
|
|
+ if ("22".equals(farmId)){
|
|
System.out.println("海宁");
|
|
System.out.println("海宁");
|
|
XunZhengRequestHn requestSg = new XunZhengRequestHn(oauthConfigBaseInfo02);
|
|
XunZhengRequestHn requestSg = new XunZhengRequestHn(oauthConfigBaseInfo02);
|
|
requestSg.setPageNum(1);
|
|
requestSg.setPageNum(1);
|
|
@@ -165,7 +167,7 @@ public class ScreenSiZhuTestController {
|
|
requestSg.setEventType(1);
|
|
requestSg.setEventType(1);
|
|
result = requestSg.doAction();
|
|
result = requestSg.doAction();
|
|
}
|
|
}
|
|
- if (farmId == 21){
|
|
|
|
|
|
+ if ("21".equals(farmId)){
|
|
System.out.println("苍南");
|
|
System.out.println("苍南");
|
|
XunZhengRequestCn requestSg = new XunZhengRequestCn(oauthConfigBaseInfo03);
|
|
XunZhengRequestCn requestSg = new XunZhengRequestCn(oauthConfigBaseInfo03);
|
|
requestSg.setPageNum(1);
|
|
requestSg.setPageNum(1);
|
|
@@ -193,7 +195,7 @@ public class ScreenSiZhuTestController {
|
|
|
|
|
|
|
|
|
|
//返回所有的死猪事件
|
|
//返回所有的死猪事件
|
|
- public GeneralResponse getSiZhuList(Integer farmId) throws ClientException {
|
|
|
|
|
|
+ public GeneralResponse getSiZhuList(String farmId) throws ClientException {
|
|
SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
|
|
SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
|
|
Calendar c = Calendar.getInstance();
|
|
Calendar c = Calendar.getInstance();
|
|
Date date = new Date();
|
|
Date date = new Date();
|
|
@@ -207,7 +209,7 @@ public class ScreenSiZhuTestController {
|
|
Date d = c.getTime();
|
|
Date d = c.getTime();
|
|
String formatD = format.format(d);
|
|
String formatD = format.format(d);
|
|
Map<String, Object> params = new HashMap<>();
|
|
Map<String, Object> params = new HashMap<>();
|
|
- if (farmId == 1){
|
|
|
|
|
|
+ if ("1".equals(farmId)){
|
|
XunZhengRequestSg requestSg = new XunZhengRequestSg(oauthConfigBaseInfo);
|
|
XunZhengRequestSg requestSg = new XunZhengRequestSg(oauthConfigBaseInfo);
|
|
requestSg.setPageNum(1);
|
|
requestSg.setPageNum(1);
|
|
requestSg.setPageSize(10);
|
|
requestSg.setPageSize(10);
|
|
@@ -217,7 +219,7 @@ public class ScreenSiZhuTestController {
|
|
String result = requestSg.doAction();
|
|
String result = requestSg.doAction();
|
|
System.out.println(result);
|
|
System.out.println(result);
|
|
}
|
|
}
|
|
- if (farmId == 22){
|
|
|
|
|
|
+ if ("22".equals(farmId)){
|
|
XunZhengRequestHn requestSg = new XunZhengRequestHn(oauthConfigBaseInfo02);
|
|
XunZhengRequestHn requestSg = new XunZhengRequestHn(oauthConfigBaseInfo02);
|
|
requestSg.setPageNum(1);
|
|
requestSg.setPageNum(1);
|
|
requestSg.setPageSize(10);
|
|
requestSg.setPageSize(10);
|
|
@@ -227,7 +229,7 @@ public class ScreenSiZhuTestController {
|
|
String result = requestSg.doAction();
|
|
String result = requestSg.doAction();
|
|
System.out.println(result);
|
|
System.out.println(result);
|
|
}
|
|
}
|
|
- if (farmId == 21){
|
|
|
|
|
|
+ if ("21".equals(farmId)){
|
|
XunZhengRequestCn requestSg = new XunZhengRequestCn(oauthConfigBaseInfo03);
|
|
XunZhengRequestCn requestSg = new XunZhengRequestCn(oauthConfigBaseInfo03);
|
|
requestSg.setPageNum(1);
|
|
requestSg.setPageNum(1);
|
|
requestSg.setPageSize(10);
|
|
requestSg.setPageSize(10);
|