|
|
@ -5,6 +5,7 @@ import com.bellmann.common.constant.SystemConstants; |
|
|
|
import com.bellmann.common.enums.OperateTaskStateEnum; |
|
|
|
import com.bellmann.common.enums.OperateTaskStateEnum; |
|
|
|
import com.bellmann.common.enums.RemoteOperateMsgEnum; |
|
|
|
import com.bellmann.common.enums.RemoteOperateMsgEnum; |
|
|
|
import com.bellmann.common.exception.BusinessException; |
|
|
|
import com.bellmann.common.exception.BusinessException; |
|
|
|
|
|
|
|
import com.bellmann.common.model.OptionTree; |
|
|
|
import com.bellmann.common.result.PageResult; |
|
|
|
import com.bellmann.common.result.PageResult; |
|
|
|
import com.bellmann.common.result.Result; |
|
|
|
import com.bellmann.common.result.Result; |
|
|
|
import com.bellmann.common.result.ResultCode; |
|
|
|
import com.bellmann.common.result.ResultCode; |
|
|
@ -24,6 +25,7 @@ import lombok.extern.slf4j.Slf4j; |
|
|
|
import org.springframework.web.bind.annotation.*; |
|
|
|
import org.springframework.web.bind.annotation.*; |
|
|
|
|
|
|
|
|
|
|
|
import javax.validation.Valid; |
|
|
|
import javax.validation.Valid; |
|
|
|
|
|
|
|
import java.util.ArrayList; |
|
|
|
import java.util.List; |
|
|
|
import java.util.List; |
|
|
|
import java.util.Map; |
|
|
|
import java.util.Map; |
|
|
|
import java.util.concurrent.TimeUnit; |
|
|
|
import java.util.concurrent.TimeUnit; |
|
|
@ -134,7 +136,6 @@ public class DeviceStaticController { |
|
|
|
@PreventDuplicateSubmit |
|
|
|
@PreventDuplicateSubmit |
|
|
|
public Result<RemoteOperateResult> checkDevOnline(@PathVariable Long devId) { |
|
|
|
public Result<RemoteOperateResult> checkDevOnline(@PathVariable Long devId) { |
|
|
|
Long count = remoteOperateTaskService.sendTaskByDevId(devId, SecurityUtils.getUsername(), RemoteOperateMsgEnum.TOUCH_DEVICE.getValue()); |
|
|
|
Long count = remoteOperateTaskService.sendTaskByDevId(devId, SecurityUtils.getUsername(), RemoteOperateMsgEnum.TOUCH_DEVICE.getValue()); |
|
|
|
log.info("{}任务执行中: {}", RemoteOperateMsgEnum.TOUCH_DEVICE.getLabel(), count); |
|
|
|
|
|
|
|
try { |
|
|
|
try { |
|
|
|
TimeUnit.MILLISECONDS.sleep(SystemConstants.TASK_TIME_OUT_CONST1); |
|
|
|
TimeUnit.MILLISECONDS.sleep(SystemConstants.TASK_TIME_OUT_CONST1); |
|
|
|
RemoteOperateResult result = remoteOperateTaskService.findDevInfoArgsByDevIdIsTimeOut(devId, RemoteOperateMsgEnum.TOUCH_DEVICE.getValue()); |
|
|
|
RemoteOperateResult result = remoteOperateTaskService.findDevInfoArgsByDevIdIsTimeOut(devId, RemoteOperateMsgEnum.TOUCH_DEVICE.getValue()); |
|
|
@ -148,82 +149,62 @@ public class DeviceStaticController { |
|
|
|
@Operation(summary = "远程操作-获取设备链路信息") |
|
|
|
@Operation(summary = "远程操作-获取设备链路信息") |
|
|
|
@PreventDuplicateSubmit |
|
|
|
@PreventDuplicateSubmit |
|
|
|
public Result<List<DeviceLinkVO>> remoteDeviceLinkInfo(@PathVariable Long devId) { |
|
|
|
public Result<List<DeviceLinkVO>> remoteDeviceLinkInfo(@PathVariable Long devId) { |
|
|
|
Long count = remoteOperateTaskService.sendTaskByDevId(devId, SecurityUtils.getUsername(), RemoteOperateMsgEnum.BASIC_PARAMETER.getValue()); |
|
|
|
Long taskId = remoteOperateTaskService.sendTaskByDevId(devId, SecurityUtils.getUsername(), RemoteOperateMsgEnum.BASIC_PARAMETER.getValue()); |
|
|
|
log.info("{}任务执行中: {}", RemoteOperateMsgEnum.BASIC_PARAMETER.getLabel(), count); |
|
|
|
boolean isSuccess = deviceStaticService.taskIsSuccess(taskId); |
|
|
|
try { |
|
|
|
if (isSuccess){ |
|
|
|
TimeUnit.MILLISECONDS.sleep(SystemConstants.TASK_TIME_OUT_CONST1); |
|
|
|
|
|
|
|
List<DeviceLinkVO> result = operateResultArgsService.getDeviceLinkInfo(devId); |
|
|
|
List<DeviceLinkVO> result = operateResultArgsService.getDeviceLinkInfo(devId); |
|
|
|
return Result.success(result); |
|
|
|
return Result.success(result); |
|
|
|
} catch (InterruptedException e) { |
|
|
|
|
|
|
|
throw new BusinessException(ResultCode.LINK_INFO_ERROR); |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
return Result.success(); |
|
|
|
} |
|
|
|
} |
|
|
|
@GetMapping("/remote/compare-parameter/{devId}/{serviceId}/{serviceVerName}/{serviceName}") |
|
|
|
@GetMapping("/remote/compare-parameter/{devId}/{serviceId}/{serviceVerName}/{serviceName}") |
|
|
|
@Operation(summary = "远程操作-业务参数对照") |
|
|
|
@Operation(summary = "远程操作-业务参数对照") |
|
|
|
@PreventDuplicateSubmit |
|
|
|
@PreventDuplicateSubmit |
|
|
|
public Result<List<ServiceCompareVO>> compareParameter(@PathVariable Long devId, @PathVariable String serviceName, @PathVariable Long serviceId, @PathVariable String serviceVerName){ |
|
|
|
public Result<List<ServiceCompareVO>> compareParameter(@PathVariable Long devId, @PathVariable String serviceName, @PathVariable Long serviceId, @PathVariable String serviceVerName){ |
|
|
|
int result = deviceStaticService.compareParameter(devId,serviceName,serviceId,serviceVerName); |
|
|
|
Long taskId = deviceStaticService.compareParameter(devId,serviceName,serviceId,serviceVerName); |
|
|
|
try { |
|
|
|
boolean isSuccess = deviceStaticService.taskIsSuccess(taskId); |
|
|
|
TimeUnit.MILLISECONDS.sleep(SystemConstants.TASK_TIME_OUT_CONST1); |
|
|
|
if (isSuccess) { |
|
|
|
List<ServiceCompareVO> list = operateResultArgsService.getServiceInfo(devId, serviceName); |
|
|
|
List<ServiceCompareVO> list = operateResultArgsService.getServiceInfo(devId, serviceName); |
|
|
|
return Result.success(list); |
|
|
|
return Result.success(list); |
|
|
|
} catch (InterruptedException e) { |
|
|
|
|
|
|
|
throw new BusinessException(ResultCode.LINK_INFO_ERROR); |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
return Result.success(new ArrayList<>()); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
@GetMapping("/remote/fttp-primary-gateway/{devId}") |
|
|
|
@GetMapping("/remote/fttp-primary-gateway/{devId}") |
|
|
|
@Operation(summary = "远程操作-刷新设备主网关信息") |
|
|
|
@Operation(summary = "远程操作-刷新设备主网关信息") |
|
|
|
@PreventDuplicateSubmit |
|
|
|
@PreventDuplicateSubmit |
|
|
|
public Result<List<FTTRInfoVO>> remoteFTTRPrimaryGateway(@PathVariable Long devId) { |
|
|
|
public Result<List<FTTRInfoVO>> remoteFTTRPrimaryGateway(@PathVariable Long devId) { |
|
|
|
Long count = remoteOperateTaskService.sendTaskByDevId(devId, SecurityUtils.getUsername(), RemoteOperateMsgEnum.FTTR_CONFIG.getValue()); |
|
|
|
Long taskId = remoteOperateTaskService.sendTaskByDevId(devId, SecurityUtils.getUsername(), RemoteOperateMsgEnum.FTTR_CONFIG.getValue()); |
|
|
|
log.info("{}任务执行中: {}", RemoteOperateMsgEnum.FTTR_CONFIG.getLabel(), count); |
|
|
|
boolean isSuccess = deviceStaticService.taskIsSuccess(taskId); |
|
|
|
try { |
|
|
|
if (isSuccess) { |
|
|
|
TimeUnit.MILLISECONDS.sleep(SystemConstants.TASK_TIME_OUT_CONST1); |
|
|
|
|
|
|
|
List<FTTRInfoVO> result = operateResultArgsService.getFTTRPrimaryGateway(devId); |
|
|
|
List<FTTRInfoVO> result = operateResultArgsService.getFTTRPrimaryGateway(devId); |
|
|
|
return Result.success(result); |
|
|
|
return Result.success(result); |
|
|
|
} catch (InterruptedException e) { |
|
|
|
|
|
|
|
throw new BusinessException(ResultCode.LINK_INFO_ERROR); |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
return Result.success(new ArrayList<>()); |
|
|
|
} |
|
|
|
} |
|
|
|
@GetMapping("/remote/fttp-sub-gateway/{devId}") |
|
|
|
@GetMapping("/remote/fttp-sub-gateway/{devId}") |
|
|
|
@Operation(summary = "远程操作-刷新设备子网关信息") |
|
|
|
@Operation(summary = "远程操作-刷新设备子网关信息") |
|
|
|
@PreventDuplicateSubmit |
|
|
|
@PreventDuplicateSubmit |
|
|
|
public Result<String> remoteFTTRSubGateway(@PathVariable Long devId) { |
|
|
|
public Result<String> remoteFTTRSubGateway(@PathVariable Long devId) { |
|
|
|
Long count = remoteOperateTaskService.sendTaskByDevId(devId, SecurityUtils.getUsername(), RemoteOperateMsgEnum.FTTR_STATS.getValue()); |
|
|
|
Long taskId = remoteOperateTaskService.sendTaskByDevId(devId, SecurityUtils.getUsername(), RemoteOperateMsgEnum.FTTR_STATS.getValue()); |
|
|
|
log.info("{}任务执行中: {}", RemoteOperateMsgEnum.FTTR_STATS.getLabel(), count); |
|
|
|
boolean isSuccess = deviceStaticService.taskIsSuccess(taskId); |
|
|
|
try { |
|
|
|
return Result.judge(isSuccess); |
|
|
|
TimeUnit.MILLISECONDS.sleep(SystemConstants.TASK_TIME_OUT_CONST1); |
|
|
|
|
|
|
|
return Result.success(); |
|
|
|
|
|
|
|
} catch (InterruptedException e) { |
|
|
|
|
|
|
|
throw new BusinessException(ResultCode.LINK_INFO_ERROR); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
@PostMapping("/remote/ip-ping") |
|
|
|
@PostMapping("/remote/ip-ping") |
|
|
|
@Operation(summary = "远程操作-设备Ping测试") |
|
|
|
@Operation(summary = "远程操作-设备Ping测试") |
|
|
|
@PreventDuplicateSubmit |
|
|
|
@PreventDuplicateSubmit |
|
|
|
public Result<String> remoteIpPing(@RequestBody @Valid PingForm form) { |
|
|
|
public Result<String> remoteIpPing(@RequestBody @Valid PingForm form) { |
|
|
|
Long taskId = deviceStaticService.remoteIpPing(form); |
|
|
|
Long taskId = deviceStaticService.remoteIpPing(form); |
|
|
|
log.info("{}任务执行中: {}", RemoteOperateMsgEnum.IP_PING.getLabel(), taskId); |
|
|
|
boolean isSuccess = deviceStaticService.taskIsSuccess(taskId); |
|
|
|
try { |
|
|
|
return Result.judge(isSuccess); |
|
|
|
TimeUnit.MILLISECONDS.sleep(SystemConstants.TASK_TIME_OUT_CONST1); |
|
|
|
|
|
|
|
return Result.success(); |
|
|
|
|
|
|
|
} catch (InterruptedException e) { |
|
|
|
|
|
|
|
throw new BusinessException(ResultCode.LINK_INFO_ERROR); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
@GetMapping("/remote/upload-log/{devId}") |
|
|
|
@GetMapping("/remote/upload-log/{devId}") |
|
|
|
@Operation(summary = "远程操作-获取设备日志文件") |
|
|
|
@Operation(summary = "远程操作-获取设备日志文件") |
|
|
|
@PreventDuplicateSubmit |
|
|
|
@PreventDuplicateSubmit |
|
|
|
public Result<String> remoteUploadLog(@PathVariable Long devId) { |
|
|
|
public Result<String> remoteUploadLog(@PathVariable Long devId) { |
|
|
|
Long taskId = remoteOperateTaskService.sendTaskByDevId(devId,SecurityUtils.getUsername(),RemoteOperateMsgEnum.UPLOAD_LOG.getValue()); |
|
|
|
Long taskId = remoteOperateTaskService.sendTaskByDevId(devId,SecurityUtils.getUsername(),RemoteOperateMsgEnum.UPLOAD_LOG.getValue()); |
|
|
|
log.info("{}任务执行中: {}", RemoteOperateMsgEnum.UPLOAD_LOG.getLabel(), taskId); |
|
|
|
boolean isSuccess = deviceStaticService.taskIsSuccess(taskId); |
|
|
|
try { |
|
|
|
return Result.judge(isSuccess); |
|
|
|
TimeUnit.MILLISECONDS.sleep(SystemConstants.TASK_TIME_OUT_CONST1); |
|
|
|
|
|
|
|
return Result.success(); |
|
|
|
|
|
|
|
} catch (InterruptedException e) { |
|
|
|
|
|
|
|
throw new BusinessException(ResultCode.LINK_INFO_ERROR); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
@GetMapping("/remote/upload-config/{devId}") |
|
|
|
@GetMapping("/remote/upload-config/{devId}") |
|
|
@ -231,39 +212,24 @@ public class DeviceStaticController { |
|
|
|
@PreventDuplicateSubmit |
|
|
|
@PreventDuplicateSubmit |
|
|
|
public Result<String> remoteUploadConfig(@PathVariable Long devId) { |
|
|
|
public Result<String> remoteUploadConfig(@PathVariable Long devId) { |
|
|
|
Long taskId = remoteOperateTaskService.sendTaskByDevId(devId,SecurityUtils.getUsername(),RemoteOperateMsgEnum.UPLOAD_CONFIG.getValue()); |
|
|
|
Long taskId = remoteOperateTaskService.sendTaskByDevId(devId,SecurityUtils.getUsername(),RemoteOperateMsgEnum.UPLOAD_CONFIG.getValue()); |
|
|
|
log.info("{}任务执行中: {}", RemoteOperateMsgEnum.UPLOAD_CONFIG.getLabel(), taskId); |
|
|
|
boolean isSuccess = deviceStaticService.taskIsSuccess(taskId); |
|
|
|
try { |
|
|
|
return Result.judge(isSuccess); |
|
|
|
TimeUnit.MILLISECONDS.sleep(SystemConstants.TASK_TIME_OUT_CONST1); |
|
|
|
|
|
|
|
return Result.success(); |
|
|
|
|
|
|
|
} catch (InterruptedException e) { |
|
|
|
|
|
|
|
throw new BusinessException(ResultCode.LINK_INFO_ERROR); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
@GetMapping("/remote/factory-reset/{devId}") |
|
|
|
@GetMapping("/remote/factory-reset/{devId}") |
|
|
|
@Operation(summary = "远程操作-恢复设备出厂设置") |
|
|
|
@Operation(summary = "远程操作-恢复设备出厂设置") |
|
|
|
@PreventDuplicateSubmit |
|
|
|
@PreventDuplicateSubmit |
|
|
|
public Result<String> remoteFactoryReset(@PathVariable Long devId) { |
|
|
|
public Result<String> remoteFactoryReset(@PathVariable Long devId) { |
|
|
|
Long taskId = remoteOperateTaskService.sendTaskByDevId(devId,SecurityUtils.getUsername(),RemoteOperateMsgEnum.FACTORY_RESET.getValue()); |
|
|
|
Long taskId = remoteOperateTaskService.sendTaskByDevId(devId,SecurityUtils.getUsername(),RemoteOperateMsgEnum.FACTORY_RESET.getValue()); |
|
|
|
log.info("{}任务执行中: {}", RemoteOperateMsgEnum.FACTORY_RESET.getLabel(), taskId); |
|
|
|
boolean isSuccess = deviceStaticService.taskIsSuccess(taskId); |
|
|
|
try { |
|
|
|
return Result.judge(isSuccess); |
|
|
|
TimeUnit.MILLISECONDS.sleep(SystemConstants.TASK_TIME_OUT_CONST1); |
|
|
|
|
|
|
|
return Result.success(); |
|
|
|
|
|
|
|
} catch (InterruptedException e) { |
|
|
|
|
|
|
|
throw new BusinessException(ResultCode.LINK_INFO_ERROR); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
@GetMapping("/remote/reboot/{devId}") |
|
|
|
@GetMapping("/remote/reboot/{devId}") |
|
|
|
@Operation(summary = "远程操作-远程重启") |
|
|
|
@Operation(summary = "远程操作-远程重启") |
|
|
|
@PreventDuplicateSubmit |
|
|
|
@PreventDuplicateSubmit |
|
|
|
public Result<String> remoteReboot(@PathVariable Long devId) { |
|
|
|
public Result<String> remoteReboot(@PathVariable Long devId) { |
|
|
|
Long taskId = remoteOperateTaskService.sendTaskByDevId(devId,SecurityUtils.getUsername(),RemoteOperateMsgEnum.REBOOT.getValue()); |
|
|
|
Long taskId = remoteOperateTaskService.sendTaskByDevId(devId,SecurityUtils.getUsername(),RemoteOperateMsgEnum.REBOOT.getValue()); |
|
|
|
log.info("{}任务执行中: {}", RemoteOperateMsgEnum.REBOOT.getLabel(), taskId); |
|
|
|
boolean isSuccess = deviceStaticService.taskIsSuccess(taskId); |
|
|
|
try { |
|
|
|
return Result.judge(isSuccess); |
|
|
|
TimeUnit.MILLISECONDS.sleep(SystemConstants.TASK_TIME_OUT_CONST1); |
|
|
|
|
|
|
|
return Result.success(); |
|
|
|
|
|
|
|
} catch (InterruptedException e) { |
|
|
|
|
|
|
|
throw new BusinessException(ResultCode.LINK_INFO_ERROR); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
@PostMapping("/remote/device-monitor") |
|
|
|
@PostMapping("/remote/device-monitor") |
|
|
@ -271,13 +237,8 @@ public class DeviceStaticController { |
|
|
|
@PreventDuplicateSubmit |
|
|
|
@PreventDuplicateSubmit |
|
|
|
public Result<String> remoteDeviceMonitor(@RequestBody @Valid DeviceMonitorForm form) { |
|
|
|
public Result<String> remoteDeviceMonitor(@RequestBody @Valid DeviceMonitorForm form) { |
|
|
|
Long taskId = deviceStaticService.remoteDeviceMonitor(form); |
|
|
|
Long taskId = deviceStaticService.remoteDeviceMonitor(form); |
|
|
|
log.info("{}任务执行中: {}", RemoteOperateMsgEnum.IP_PING.getLabel(), taskId); |
|
|
|
boolean isSuccess = deviceStaticService.taskIsSuccess(taskId); |
|
|
|
try { |
|
|
|
return Result.judge(isSuccess); |
|
|
|
TimeUnit.MILLISECONDS.sleep(SystemConstants.TASK_TIME_OUT_CONST1); |
|
|
|
|
|
|
|
return Result.success(); |
|
|
|
|
|
|
|
} catch (InterruptedException e) { |
|
|
|
|
|
|
|
throw new BusinessException(ResultCode.LINK_INFO_ERROR); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
@GetMapping("/remote/check-conn-type/{devId}") |
|
|
|
@GetMapping("/remote/check-conn-type/{devId}") |
|
|
|
@Operation(summary = "远程操作-测速-上网方式") |
|
|
|
@Operation(summary = "远程操作-测速-上网方式") |
|
|
@ -285,13 +246,12 @@ public class DeviceStaticController { |
|
|
|
public Result<String> remoteCheckConnType(@PathVariable Long devId) { |
|
|
|
public Result<String> remoteCheckConnType(@PathVariable Long devId) { |
|
|
|
Long taskId = deviceStaticService.remoteCheckConnType(devId); |
|
|
|
Long taskId = deviceStaticService.remoteCheckConnType(devId); |
|
|
|
log.info("{}任务执行中: {}", RemoteOperateMsgEnum.REBOOT.getLabel(), taskId); |
|
|
|
log.info("{}任务执行中: {}", RemoteOperateMsgEnum.REBOOT.getLabel(), taskId); |
|
|
|
try { |
|
|
|
boolean isSuccess = deviceStaticService.taskIsSuccess(taskId); |
|
|
|
TimeUnit.MILLISECONDS.sleep(SystemConstants.TASK_TIME_OUT_CONST2); |
|
|
|
if (isSuccess) { |
|
|
|
String connType = deviceStaticService.remoteConnType(taskId, devId); |
|
|
|
String connType = deviceStaticService.remoteConnType(taskId, devId); |
|
|
|
return Result.success(connType); |
|
|
|
return Result.success(connType); |
|
|
|
} catch (InterruptedException e) { |
|
|
|
|
|
|
|
throw new BusinessException(ResultCode.LINK_INFO_ERROR); |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
return Result.failed(); |
|
|
|
} |
|
|
|
} |
|
|
|
@GetMapping("/remote/tr143-speed/{devId}") |
|
|
|
@GetMapping("/remote/tr143-speed/{devId}") |
|
|
|
@Operation(summary = "远程操作-测速") |
|
|
|
@Operation(summary = "远程操作-测速") |
|
|
@ -318,37 +278,35 @@ public class DeviceStaticController { |
|
|
|
@PreventDuplicateSubmit |
|
|
|
@PreventDuplicateSubmit |
|
|
|
public Result<String> remoteSoftVerUpgrade(@PathVariable Long devId,@PathVariable Long fileId){ |
|
|
|
public Result<String> remoteSoftVerUpgrade(@PathVariable Long devId,@PathVariable Long fileId){ |
|
|
|
Long taskId = remoteOperateTaskService.sendTaskByDevIdByFileId(devId, SecurityUtils.getUsername(), fileId, RemoteOperateMsgEnum.DOWNLOAD_SOFT_VER_FILE.getValue()); |
|
|
|
Long taskId = remoteOperateTaskService.sendTaskByDevIdByFileId(devId, SecurityUtils.getUsername(), fileId, RemoteOperateMsgEnum.DOWNLOAD_SOFT_VER_FILE.getValue()); |
|
|
|
log.info("{}任务执行中: {}", RemoteOperateMsgEnum.DOWNLOAD_SOFT_VER_FILE.getLabel(), taskId); |
|
|
|
boolean isSuccess = deviceStaticService.taskIsSuccess(taskId); |
|
|
|
return Result.success(); |
|
|
|
|
|
|
|
|
|
|
|
return Result.judge(isSuccess); |
|
|
|
} |
|
|
|
} |
|
|
|
@GetMapping("/remote/register/{devId}") |
|
|
|
@GetMapping("/remote/register/{devId}") |
|
|
|
@Operation(summary = "远程操作-开启终端注册页面") |
|
|
|
@Operation(summary = "远程操作-开启终端注册页面") |
|
|
|
@PreventDuplicateSubmit |
|
|
|
@PreventDuplicateSubmit |
|
|
|
public Result<String> remoteOpenRegister(@PathVariable Long devId){ |
|
|
|
public Result<String> remoteOpenRegister(@PathVariable Long devId){ |
|
|
|
Long taskId = deviceStaticService.remoteOpenRegister(devId); |
|
|
|
Long taskId = deviceStaticService.remoteOpenRegister(devId); |
|
|
|
log.info("{}任务执行中: {}", RemoteOperateMsgEnum.X_REGISTER.getLabel(), taskId); |
|
|
|
boolean isSuccess = deviceStaticService.taskIsSuccess(taskId); |
|
|
|
return Result.success(); |
|
|
|
|
|
|
|
|
|
|
|
return Result.judge(isSuccess); |
|
|
|
} |
|
|
|
} |
|
|
|
@GetMapping("/remote/account-password/{devId}") |
|
|
|
@GetMapping("/remote/account-password/{devId}") |
|
|
|
@Operation(summary = "远程操作-设备设置电信帐户密码") |
|
|
|
@Operation(summary = "远程操作-设备设置电信帐户密码") |
|
|
|
@PreventDuplicateSubmit |
|
|
|
@PreventDuplicateSubmit |
|
|
|
public Result<String> setAccountPassword(@PathVariable Long devId){ |
|
|
|
public Result<String> setAccountPassword(@PathVariable Long devId){ |
|
|
|
Long taskId = deviceStaticService.setAccountPassword(devId); |
|
|
|
Long taskId = deviceStaticService.setAccountPassword(devId); |
|
|
|
log.info("{}任务执行中: {}", RemoteOperateMsgEnum.SET_TELEPHONE_COM_ACCOUNT_PASSWORD.getLabel(), taskId); |
|
|
|
boolean isSuccess = deviceStaticService.taskIsSuccess(taskId); |
|
|
|
try { |
|
|
|
return Result.judge(isSuccess); |
|
|
|
TimeUnit.MILLISECONDS.sleep(SystemConstants.TASK_TIME_OUT_CONST2); |
|
|
|
|
|
|
|
} catch (InterruptedException e) { |
|
|
|
|
|
|
|
throw new BusinessException(ResultCode.LINK_INFO_ERROR); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
return Result.success(); |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
@GetMapping("/remote/vendor-profile/{devId}/{fileId}") |
|
|
|
@GetMapping("/remote/vendor-profile/{devId}/{fileId}") |
|
|
|
@Operation(summary = "远程操作-厂商配置文件下发") |
|
|
|
@Operation(summary = "远程操作-厂商配置文件下发") |
|
|
|
@PreventDuplicateSubmit |
|
|
|
@PreventDuplicateSubmit |
|
|
|
public Result<String> remoteVendorProfile(@PathVariable Long devId,@PathVariable Long fileId){ |
|
|
|
public Result<String> remoteVendorProfile(@PathVariable Long devId,@PathVariable Long fileId){ |
|
|
|
Long taskId = remoteOperateTaskService.sendTaskByDevIdByFileId(devId,SecurityUtils.getUsername(),fileId,RemoteOperateMsgEnum.DOWNLOAD_CONFIG.getValue()); |
|
|
|
Long taskId = remoteOperateTaskService.sendTaskByDevIdByFileId(devId,SecurityUtils.getUsername(),fileId,RemoteOperateMsgEnum.DOWNLOAD_CONFIG.getValue()); |
|
|
|
log.info("{}任务执行中: {}", RemoteOperateMsgEnum.DOWNLOAD_CONFIG.getLabel(), taskId); |
|
|
|
boolean isSuccess = deviceStaticService.taskIsSuccess(taskId); |
|
|
|
return Result.success(); |
|
|
|
|
|
|
|
|
|
|
|
return Result.judge(isSuccess); |
|
|
|
} |
|
|
|
} |
|
|
|
@GetMapping("/remote/reset-service/{devId}/{serviceName}") |
|
|
|
@GetMapping("/remote/reset-service/{devId}/{serviceName}") |
|
|
|
@Operation(summary = "远程操作-业务重置") |
|
|
|
@Operation(summary = "远程操作-业务重置") |
|
|
@ -363,4 +321,54 @@ public class DeviceStaticController { |
|
|
|
|
|
|
|
|
|
|
|
return Result.success(); |
|
|
|
return Result.success(); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@GetMapping("/remote/tree/infos/{devId}") |
|
|
|
|
|
|
|
@Operation(summary = "远程操作-当前节点的所有子节点") |
|
|
|
|
|
|
|
@PreventDuplicateSubmit() |
|
|
|
|
|
|
|
public Result<List<OptionTree<String>>> getNodeChildNodes(@PathVariable Long devId,@RequestParam String nodePath){ |
|
|
|
|
|
|
|
List<OptionTree<String>> nodeChildNodes = deviceStaticService.getNodeChildNodes(devId, nodePath); |
|
|
|
|
|
|
|
return Result.success(nodeChildNodes); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
@GetMapping("/remote/tree/param-value/{devId}") |
|
|
|
|
|
|
|
@Operation(summary = "远程操作-获取参数") |
|
|
|
|
|
|
|
@PreventDuplicateSubmit() |
|
|
|
|
|
|
|
public Result<OptionTree<String>> getParameterValues(@PathVariable Long devId,@RequestParam String nodePath){ |
|
|
|
|
|
|
|
OptionTree<String> node = deviceStaticService.getParameterValues(devId, nodePath); |
|
|
|
|
|
|
|
return Result.success(node); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
@PutMapping("/remote/tree/set-param-value/{devId}") |
|
|
|
|
|
|
|
@Operation(summary = "远程操作-设置参数") |
|
|
|
|
|
|
|
@PreventDuplicateSubmit() |
|
|
|
|
|
|
|
public Result<String> setParameterValues(@PathVariable Long devId,@RequestParam String nodePath,@RequestParam String argValue){ |
|
|
|
|
|
|
|
boolean result = deviceStaticService.setParameterValues(devId, nodePath,argValue); |
|
|
|
|
|
|
|
return Result.judge(result); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
@GetMapping("/remote/tree/param-attribute/{devId}") |
|
|
|
|
|
|
|
@Operation(summary = "远程操作-获取参数属性") |
|
|
|
|
|
|
|
@PreventDuplicateSubmit() |
|
|
|
|
|
|
|
public Result<OptionTree<String>> getParameterAttributes(@PathVariable Long devId,@RequestParam String nodePath){ |
|
|
|
|
|
|
|
OptionTree<String> node = deviceStaticService.getParameterAttributes(devId, nodePath); |
|
|
|
|
|
|
|
return Result.success(node); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
@PutMapping("/remote/tree/set-param-attribute/{devId}") |
|
|
|
|
|
|
|
@Operation(summary = "远程操作-设置参数属性") |
|
|
|
|
|
|
|
@PreventDuplicateSubmit() |
|
|
|
|
|
|
|
public Result<String> setParameterAttributes(@PathVariable Long devId,@RequestParam String nodePath,@RequestParam String argValue){ |
|
|
|
|
|
|
|
deviceStaticService.setParameterAttributes(devId, nodePath,argValue); |
|
|
|
|
|
|
|
return Result.success(); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
@GetMapping("/remote/tree/add-instance-node/{devId}") |
|
|
|
|
|
|
|
@Operation(summary = "远程操作-增加实例") |
|
|
|
|
|
|
|
@PreventDuplicateSubmit() |
|
|
|
|
|
|
|
public Result<OptionTree<String>> remoteAddInstanceNode(@PathVariable Long devId,@RequestParam String nodePath){ |
|
|
|
|
|
|
|
OptionTree<String> node = deviceStaticService.addInstanceNode(devId, nodePath); |
|
|
|
|
|
|
|
return Result.success(node); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
@GetMapping("/remote/tree/delete-instance-node/{devId}") |
|
|
|
|
|
|
|
@Operation(summary = "远程操作-删除实例") |
|
|
|
|
|
|
|
@PreventDuplicateSubmit() |
|
|
|
|
|
|
|
public Result<String> remoteDeleteInstanceNode(@PathVariable Long devId,@RequestParam String nodePath){ |
|
|
|
|
|
|
|
boolean result = deviceStaticService.deleteInstanceNode(devId, nodePath); |
|
|
|
|
|
|
|
return Result.judge(result); |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|