From fdf9b33851d5fe193aa93f4bc803aa69a267083e Mon Sep 17 00:00:00 2001
From: zhanzhiqin <895896009@qq.com>
Date: 星期一, 17 十月 2022 10:28:57 +0800
Subject: [PATCH] 大气农耕
---
ximon-admin/src/main/java/com/sandu/ximon/admin/service/AirEquipmentNongGengService.java | 98 +-----------------------------------------------
1 files changed, 3 insertions(+), 95 deletions(-)
diff --git a/ximon-admin/src/main/java/com/sandu/ximon/admin/service/AirEquipmentNongGengService.java b/ximon-admin/src/main/java/com/sandu/ximon/admin/service/AirEquipmentNongGengService.java
index 323c6eb..690a92d 100644
--- a/ximon-admin/src/main/java/com/sandu/ximon/admin/service/AirEquipmentNongGengService.java
+++ b/ximon-admin/src/main/java/com/sandu/ximon/admin/service/AirEquipmentNongGengService.java
@@ -50,7 +50,6 @@
public void addAirEquipment(AirEquipmentNongGeng airEquipmentNongGeng) {
AirEquipmentNongGeng one = getOne(Wrappers.lambdaQuery(AirEquipmentNongGeng.class).eq(AirEquipmentNongGeng::getMac, airEquipmentNongGeng.getMac()));
if (one == null) {
- //TODO
save(airEquipmentNongGeng);
/**
* 娣诲姞鍐滆�曞ぇ姘旇澶� 鏃ュ織璁板綍寮�濮�
@@ -138,6 +137,9 @@
*/
public AirEquipmentNongGeng getAirEquipment(String mac) {
AirEquipmentNongGeng one = getOne(Wrappers.lambdaQuery(AirEquipmentNongGeng.class).eq(AirEquipmentNongGeng::getMac, mac));
+ if (one == null) {
+ throw new BusinessException("澶ф皵璁惧涓嶅瓨鍦紒");
+ }
if (RedisUtils.getBean().get(AtmoFunctionCode.AIR_HEARTBEAT_NONG_GENG_STATE.getCode() + mac) != null) {
one.setState(1);
} else {
@@ -183,98 +185,4 @@
throw new BusinessException("鏁版嵁鏍¢獙寮傚父锛�");
}
}
-//
-// /**
-// * 鏌ヨ澶ф皵璁惧蹇冭烦鍖呮椂闂�
-// */
-// public String QueryHeartBeatTime(String mac) {
-// if (StringUtil.strIsNullOrEmpty(mac)) {
-// throw new BusinessException("鐏潌mac鍙傛暟閿欒锛�");
-// }
-// AirEquipmentNongGeng airEquipmentNongGeng = SpringContextHolder.getBean(AirEquipmentNongGengService.class).
-// getOne(Wrappers.lambdaQuery(AirEquipmentNongGeng.class).eq(AirEquipmentNongGeng::getMac, mac).last("limit 1"));
-// if (airEquipmentNongGeng == null) {
-// throw new BusinessException("澶ф皵璁惧涓嶅瓨鍦紒");
-// }
-//
-// AtmosphereQueryHeartBeatTimeReqInnerFrame atmosphereQueryHeartBeatTimeReqInnerFrame = new AtmosphereQueryHeartBeatTimeReqInnerFrame();
-// A5Frame a5Frame = new A5Frame(A5OrderEnum.REQUEST_ATMOSPHERE_DATA.getCode(), atmosphereQueryHeartBeatTimeReqInnerFrame);
-// System.out.println(a5Frame + " --------a5Frame");
-// CommonFrame commonFrame = MainBoardInvokeSyncService.getInstance().sendRRPC(mac, a5Frame);
-// System.out.println(commonFrame + " -----------commonFrame");
-//
-// A5AtmosphereHeartBeatTimeReportInnerFrame a5AtmosphereHeartBeatTimeReportInnerFrame
-// = new A5AtmosphereHeartBeatTimeReportInnerFrame().transformFrame(commonFrame.getPayload());
-//
-// if (a5AtmosphereHeartBeatTimeReportInnerFrame != null && a5AtmosphereHeartBeatTimeReportInnerFrame.isValidate()) {
-// return "璇ュぇ姘旇澶囧績璺冲寘闂撮殧鏃堕棿涓猴細" + a5AtmosphereHeartBeatTimeReportInnerFrame.getIntervalTime() + "s";
-// } else {
-// throw new BusinessException("鏁版嵁鏍¢獙寮傚父锛�");
-// }
-// }
-//
-// /**
-// * 鏌ヨ杞‖浠剁増鏈�
-// *
-// * @param mac
-// * @return
-// */
-// public String QueryVersion(String mac) {
-// if (StringUtil.strIsNullOrEmpty(mac)) {
-// throw new BusinessException("鐏潌mac鍙傛暟閿欒锛�");
-// }
-// AirEquipmentNongGeng airEquipmentNongGeng = SpringContextHolder.getBean(AirEquipmentNongGengService.class).
-// getOne(Wrappers.lambdaQuery(AirEquipmentNongGeng.class).eq(AirEquipmentNongGeng::getMac, mac).last("limit 1"));
-// if (airEquipmentNongGeng == null) {
-// throw new BusinessException("澶ф皵璁惧涓嶅瓨鍦紒");
-// }
-//
-// AtmosphereQueryVersionReqInnerFrame atmosphereQueryVersionReqInnerFrame = new AtmosphereQueryVersionReqInnerFrame();
-// A5Frame a5Frame = new A5Frame(A5OrderEnum.REQUEST_ATMOSPHERE_DATA.getCode(), atmosphereQueryVersionReqInnerFrame);
-// System.out.println(a5Frame + " --------a5Frame");
-// CommonFrame commonFrame = MainBoardInvokeSyncService.getInstance().sendRRPC(mac, a5Frame);
-// System.out.println(commonFrame + " -----------commonFrame");
-//
-// A5AtmosphereQueryVersionReportInnerFrame a5AtmosphereQueryVersionReportInnerFrame =
-// new A5AtmosphereQueryVersionReportInnerFrame().transformFrame(commonFrame.getPayload());
-// if (a5AtmosphereQueryVersionReportInnerFrame != null && a5AtmosphereQueryVersionReportInnerFrame.isValidate()) {
-// return a5AtmosphereQueryVersionReportInnerFrame.getVersion();
-// } else {
-// throw new BusinessException("鏁版嵁鏍¢獙寮傚父锛�");
-// }
-// }
-//
-// /**
-// * 杞噸鍚�
-// *
-// * @param mac
-// * @return
-// */
-// public String Reboot(String mac) {
-// if (StringUtil.strIsNullOrEmpty(mac)) {
-// throw new BusinessException("鐏潌mac鍙傛暟閿欒锛�");
-// }
-//
-// AirEquipmentNongGeng airEquipmentNongGeng = SpringContextHolder.getBean(AirEquipmentNongGengService.class).
-// getOne(Wrappers.lambdaQuery(AirEquipmentNongGeng.class).eq(AirEquipmentNongGeng::getMac, mac).last("limit 1"));
-// if (airEquipmentNongGeng == null) {
-// throw new BusinessException("澶ф皵璁惧涓嶅瓨鍦紒");
-// }
-//
-// AtmosphereRebootReqInnerFrame atmosphereRebootReqInnerFrame = new AtmosphereRebootReqInnerFrame();
-// A5Frame a5Frame = new A5Frame(A5OrderEnum.REQUEST_ATMOSPHERE_DATA.getCode(), atmosphereRebootReqInnerFrame);
-// System.out.println(a5Frame + " --------a5Frame");
-// CommonFrame commonFrame = MainBoardInvokeSyncService.getInstance().sendRRPC(mac, a5Frame);
-// System.out.println(commonFrame + " -----------commonFrame");
-//
-// A5AtmosphereOperationReportInnerFrame a5AtmosphereOperationReportInnerFrame =
-// new A5AtmosphereOperationReportInnerFrame().transformFrame(commonFrame.getPayload());
-//
-// if (a5AtmosphereOperationReportInnerFrame != null && a5AtmosphereOperationReportInnerFrame.isValidate()) {
-// return a5AtmosphereOperationReportInnerFrame.getState();
-// } else {
-// throw new BusinessException("鏁版嵁鏍¢獙寮傚父锛�");
-// }
-// }
-
}
--
Gitblit v1.9.3