mirror of
https://codeup.aliyun.com/67c68d4e484ca2f0a13ac3c1/ydc/jsowell-charger-web.git
synced 2026-05-11 13:30:15 +08:00
发送遥控地锁指令
This commit is contained in:
@@ -1,16 +1,17 @@
|
|||||||
package com.jsowell.web.controller.pile;
|
package com.jsowell.web.controller.pile;
|
||||||
|
|
||||||
import com.google.common.collect.ImmutableMap;
|
import com.google.common.collect.ImmutableMap;
|
||||||
|
import com.jsowell.common.core.controller.BaseController;
|
||||||
import com.jsowell.common.core.domain.AjaxResult;
|
import com.jsowell.common.core.domain.AjaxResult;
|
||||||
import com.jsowell.common.enums.ykc.ReturnCodeEnum;
|
import com.jsowell.common.enums.ykc.ReturnCodeEnum;
|
||||||
import com.jsowell.common.exception.BusinessException;
|
import com.jsowell.common.exception.BusinessException;
|
||||||
import com.jsowell.common.util.StringUtils;
|
import com.jsowell.common.util.StringUtils;
|
||||||
import com.jsowell.common.util.id.IdUtils;
|
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.GenerateOrderDTO;
|
||||||
import com.jsowell.pile.dto.QueryPileDTO;
|
import com.jsowell.pile.dto.QueryPileDTO;
|
||||||
import com.jsowell.pile.dto.UpdateFirmwareDTO;
|
import com.jsowell.pile.dto.UpdateFirmwareDTO;
|
||||||
import com.jsowell.pile.service.PileRemoteService;
|
import com.jsowell.pile.service.PileRemoteService;
|
||||||
import com.jsowell.service.OrderService;
|
|
||||||
import org.apache.commons.collections4.CollectionUtils;
|
import org.apache.commons.collections4.CollectionUtils;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.web.bind.annotation.PostMapping;
|
import org.springframework.web.bind.annotation.PostMapping;
|
||||||
@@ -25,14 +26,11 @@ import java.math.BigDecimal;
|
|||||||
*/
|
*/
|
||||||
@RestController
|
@RestController
|
||||||
@RequestMapping("/pile/remote")
|
@RequestMapping("/pile/remote")
|
||||||
public class PileRemoteController {
|
public class PileRemoteController extends BaseController {
|
||||||
|
|
||||||
@Autowired
|
@Autowired
|
||||||
private PileRemoteService pileRemoteService;
|
private PileRemoteService pileRemoteService;
|
||||||
|
|
||||||
@Autowired
|
|
||||||
private OrderService orderService;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 获取实时上传数据
|
* 获取实时上传数据
|
||||||
* http://localhost:8080/pile/remote/getRealTimeMonitorData
|
* http://localhost:8080/pile/remote/getRealTimeMonitorData
|
||||||
@@ -139,4 +137,24 @@ public class PileRemoteController {
|
|||||||
return result;
|
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;
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -219,4 +219,7 @@ public class PileRemoteService {
|
|||||||
ykcPushCommandService.pushAccountBalanceUpdateCommand(command);
|
ykcPushCommandService.pushAccountBalanceUpdateCommand(command);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void remoteControlGroundLock(RemoteControlGroundLockCommand command) {
|
||||||
|
ykcPushCommandService.pushRemoteControlGroundLock(command);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user