| | |
| | | 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 |
| | |
| | | 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("升级硬件设备类型指令有误,请确认!"); |
| | | } |
| | | |
| | | //启动远程升级命令 |