From 7b4e8c2fa93a973ed29c9f7ee1a5b9e539f85e1d Mon Sep 17 00:00:00 2001
From: zhanzhiqin <895896009@qq.com>
Date: 星期五, 14 十月 2022 18:50:03 +0800
Subject: [PATCH] 大气农耕

---
 ximon-admin/src/main/java/com/sandu/ximon/admin/controller/RemoteUpdateController.java |   47 +++++++++++++++++++++++++----------------------
 1 files changed, 25 insertions(+), 22 deletions(-)

diff --git a/ximon-admin/src/main/java/com/sandu/ximon/admin/controller/RemoteUpdateController.java b/ximon-admin/src/main/java/com/sandu/ximon/admin/controller/RemoteUpdateController.java
index 580baa6..6714a39 100644
--- a/ximon-admin/src/main/java/com/sandu/ximon/admin/controller/RemoteUpdateController.java
+++ b/ximon-admin/src/main/java/com/sandu/ximon/admin/controller/RemoteUpdateController.java
@@ -1,25 +1,21 @@
 package com.sandu.ximon.admin.controller;
 
-import com.google.gson.internal.$Gson$Preconditions;
 import com.sandu.common.domain.ResponseVO;
 import com.sandu.common.execption.BusinessException;
-import com.sandu.common.security.annotation.AnonymousAccess;
 import com.sandu.common.util.ResponseUtil;
 import com.sandu.ximon.admin.dto.RemoteFileDto;
 import com.sandu.ximon.admin.manager.iot.rrpc.enums.A5OrderEnum;
+import com.sandu.ximon.admin.manager.iot.rrpc.enums.RemoteUpdateTypeEnum;
 import com.sandu.ximon.admin.param.RemotePrarm;
 import com.sandu.ximon.admin.param.RemoteUpdateParam;
 import com.sandu.ximon.admin.security.PermissionConfig;
 import com.sandu.ximon.admin.service.RemoteUpdateService;
-import com.sandu.ximon.admin.utils.HexUtils;
-import com.sandu.ximon.admin.utils.StringUtil;
 import com.sandu.ximon.dao.enums.MenuEnum;
 import lombok.AllArgsConstructor;
 import org.springframework.validation.annotation.Validated;
 import org.springframework.web.bind.annotation.*;
 
-import java.util.Arrays;
-import java.util.List;
+import static com.sandu.ximon.admin.manager.iot.rrpc.enums.RemoteUpdateTypeEnum.MQTT_MAIN;
 
 /**
  * 鍥轰欢鍗囩骇Controller
@@ -91,22 +87,29 @@
         String orderType;
         boolean UpdateFlag = false;
 
-        switch (remotePrarm.getDeviceType()) {
-            case "MQTT涓插彛":
-            case "CAT1":
-                orderType = A5OrderEnum.REQUEST_LIGHT_DATA.getCode();
-                break;
-            case "澶ф皵":
-                orderType = A5OrderEnum.REQUEST_ATMOSPHERE_DATA.getCode();
-                break;
-            case "C3鍏呯數妗�":
-                orderType = A5OrderEnum.REQUEST_C3_DATA.getCode();
-                break;
-            case "鏉嗕綋鍊炬枩":
-                orderType = A5OrderEnum.REQUEST_POLE_MONITOR_DATA.getCode();
-                break;
-            default:
-                throw new BusinessException("鍗囩骇纭欢璁惧绫诲瀷鎸囦护鏈夎锛岃纭锛�");
+        if (RemoteUpdateTypeEnum.MQTT_MAIN.equals(remotePrarm.getDeviceType())) {
+            //MQTT涓绘澘
+            orderType = A5OrderEnum.REQUEST_LIGHT_DATA.getCode();
+        } else if (RemoteUpdateTypeEnum.MQTT_CORE.equals(remotePrarm.getDeviceType())) {
+            //MQTT鏍稿績鏉�
+            orderType = A5OrderEnum.REQUEST_LIGHT_DATA.getCode();
+        } else if (RemoteUpdateTypeEnum.LIGHT.equals(remotePrarm.getDeviceType())) {
+            //鍗曠伅妯″潡
+            orderType = A5OrderEnum.REQUEST_LIGHT_DATA.getCode();
+        } else if (RemoteUpdateTypeEnum.C3_CHARGING.equals(remotePrarm.getDeviceType())) {
+            //C3鍏呯數妗╂ā鍧�
+            orderType = A5OrderEnum.REQUEST_C3_DATA.getCode();
+        } else if (RemoteUpdateTypeEnum.CAT1_MAIN.equals(remotePrarm.getDeviceType())) {
+            //Cat.1涓绘澘
+            orderType = A5OrderEnum.REQUEST_LIGHT_DATA.getCode();
+        } else if (RemoteUpdateTypeEnum.LIGHT_POLE_HELING.equals(remotePrarm.getDeviceType())) {
+            //鐏潌鍊炬枩妯″潡
+            orderType = A5OrderEnum.REQUEST_POLE_MONITOR_DATA.getCode();
+        } else if (RemoteUpdateTypeEnum.AIR_EQUIPMENT.equals(remotePrarm.getDeviceType())) {
+            //澶ф皵璁惧妯″潡
+            orderType = A5OrderEnum.REQUEST_ATMOSPHERE_DATA.getCode();
+        } else {
+            throw new BusinessException("鍗囩骇纭欢璁惧绫诲瀷鎸囦护鏈夎锛岃纭锛�");
         }
 
         //鍚姩杩滅▼鍗囩骇鍛戒护

--
Gitblit v1.9.3