发送遥控地锁指令

This commit is contained in:
2023-08-02 10:35:13 +08:00
parent 0c45524a0d
commit 9b2b2396bb
2 changed files with 26 additions and 5 deletions

View File

@@ -1,16 +1,17 @@
package com.jsowell.web.controller.pile;
import com.google.common.collect.ImmutableMap;
import com.jsowell.common.core.controller.BaseController;
import com.jsowell.common.core.domain.AjaxResult;
import com.jsowell.common.enums.ykc.ReturnCodeEnum;
import com.jsowell.common.exception.BusinessException;
import com.jsowell.common.util.StringUtils;
import com.jsowell.common.util.id.IdUtils;
import com.jsowell.pile.domain.ykcCommond.RemoteControlGroundLockCommand;
import com.jsowell.pile.dto.GenerateOrderDTO;
import com.jsowell.pile.dto.QueryPileDTO;
import com.jsowell.pile.dto.UpdateFirmwareDTO;
import com.jsowell.pile.service.PileRemoteService;
import com.jsowell.service.OrderService;
import org.apache.commons.collections4.CollectionUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
@@ -25,14 +26,11 @@ import java.math.BigDecimal;
*/
@RestController
@RequestMapping("/pile/remote")
public class PileRemoteController {
public class PileRemoteController extends BaseController {
@Autowired
private PileRemoteService pileRemoteService;
@Autowired
private OrderService orderService;
/**
* 获取实时上传数据
* http://localhost:8080/pile/remote/getRealTimeMonitorData
@@ -139,4 +137,24 @@ public class PileRemoteController {
return result;
}
/**
* 遥控地锁
* http://localhost:8080/pile/remote/remoteControlGroundLock
*/
@PostMapping("remoteControlGroundLock")
public AjaxResult remoteControlGroundLock(@RequestBody RemoteControlGroundLockCommand command) {
AjaxResult result;
try {
pileRemoteService.remoteControlGroundLock(command);
result = AjaxResult.success();
} catch (BusinessException e) {
logger.error("遥控地锁error", e);
result = AjaxResult.error(e.getMessage());
} catch (Exception e) {
logger.error("遥控地锁error", e);
result = AjaxResult.error(e.getMessage());
}
return result;
}
}