mirror of
https://gitee.com/san-bing/JChargePointProtocol
synced 2026-05-04 18:09:54 +08:00
@@ -37,6 +37,14 @@ public class TestController {
|
|||||||
return ResponseEntity.ok("success");
|
return ResponseEntity.ok("success");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@GetMapping("/api/stopCharge")
|
||||||
|
public ResponseEntity<String> stopCharge() {
|
||||||
|
|
||||||
|
pileProtocolService.stopCharge("20231212000010", "01");
|
||||||
|
|
||||||
|
return ResponseEntity.ok("success");
|
||||||
|
}
|
||||||
|
|
||||||
@GetMapping("/api/restartPile")
|
@GetMapping("/api/restartPile")
|
||||||
public ResponseEntity<String> restartPile() {
|
public ResponseEntity<String> restartPile() {
|
||||||
|
|
||||||
|
|||||||
@@ -78,6 +78,11 @@ public interface PileProtocolService {
|
|||||||
*/
|
*/
|
||||||
void startCharge(String pileCode, String gunCode, BigDecimal limitYuan, String orderNo);
|
void startCharge(String pileCode, String gunCode, BigDecimal limitYuan, String orderNo);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 停止充电
|
||||||
|
*/
|
||||||
|
void stopCharge(String pileCode, String gunCode);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 重启充电
|
* 重启充电
|
||||||
*/
|
*/
|
||||||
|
|||||||
@@ -6,8 +6,8 @@
|
|||||||
*/
|
*/
|
||||||
package sanbing.jcpp.app.service.impl;
|
package sanbing.jcpp.app.service.impl;
|
||||||
|
|
||||||
import com.fasterxml.jackson.databind.node.ObjectNode;
|
|
||||||
import cn.hutool.core.date.DateUtil;
|
import cn.hutool.core.date.DateUtil;
|
||||||
|
import com.fasterxml.jackson.databind.node.ObjectNode;
|
||||||
import jakarta.annotation.Resource;
|
import jakarta.annotation.Resource;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
@@ -303,6 +303,27 @@ public class DefaultPileProtocolService implements PileProtocolService {
|
|||||||
downlinkCallService.sendDownlinkMessage(downlinkRequestMessageBuilder, pileCode);
|
downlinkCallService.sendDownlinkMessage(downlinkRequestMessageBuilder, pileCode);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void stopCharge(String pileCode, String gunCode) {
|
||||||
|
|
||||||
|
UUID messageId = UUID.randomUUID();
|
||||||
|
UUID requestId = UUID.randomUUID();
|
||||||
|
|
||||||
|
DownlinkRequestMessage.Builder downlinkRequestMessageBuilder = DownlinkRequestMessage.newBuilder()
|
||||||
|
.setMessageIdMSB(messageId.getMostSignificantBits())
|
||||||
|
.setMessageIdLSB(messageId.getLeastSignificantBits())
|
||||||
|
.setPileCode(pileCode)
|
||||||
|
.setRequestIdMSB(requestId.getMostSignificantBits())
|
||||||
|
.setRequestIdLSB(requestId.getLeastSignificantBits())
|
||||||
|
.setDownlinkCmd(DownlinkCmdEnum.REMOTE_STOP_CHARGING.name())
|
||||||
|
.setRemoteStopChargingRequest(RemoteStopChargingRequest.newBuilder()
|
||||||
|
.setPileCode(pileCode)
|
||||||
|
.setGunCode(gunCode)
|
||||||
|
.build());
|
||||||
|
|
||||||
|
downlinkCallService.sendDownlinkMessage(downlinkRequestMessageBuilder, pileCode);
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void restartPile(String pileCode, Integer type) {
|
public void restartPile(String pileCode, Integer type) {
|
||||||
|
|
||||||
|
|||||||
@@ -44,7 +44,6 @@ public enum YunKuaiChongDownlinkCmdEnum {
|
|||||||
|
|
||||||
OFFLINE_CARD_SYNC_REQUEST(0x44),
|
OFFLINE_CARD_SYNC_REQUEST(0x44),
|
||||||
|
|
||||||
|
|
||||||
SYNC_TIME_REQUEST(0x56),
|
SYNC_TIME_REQUEST(0x56),
|
||||||
|
|
||||||
;
|
;
|
||||||
|
|||||||
Reference in New Issue
Block a user