mirror of
https://codeup.aliyun.com/67c68d4e484ca2f0a13ac3c1/ydc/jsowell-charger-web.git
synced 2026-04-21 03:25:12 +08:00
update 预约充电
This commit is contained in:
@@ -2,6 +2,7 @@ package com.jsowell.netty.service.yunkuaichong;
|
||||
|
||||
import com.jsowell.netty.command.ykc.GetRealTimeMonitorDataCommand;
|
||||
import com.jsowell.netty.command.ykc.IssueQRCodeCommand;
|
||||
import com.jsowell.netty.command.ykc.PileSettingCommand;
|
||||
import com.jsowell.netty.command.ykc.ProofreadTimeCommand;
|
||||
import com.jsowell.netty.command.ykc.PublishPileBillingTemplateCommand;
|
||||
import com.jsowell.netty.command.ykc.RebootCommand;
|
||||
@@ -61,4 +62,9 @@ public interface YKCPushCommandService {
|
||||
* @param command
|
||||
*/
|
||||
void pushUpdateFileCommand(UpdateFileCommand command);
|
||||
|
||||
/**
|
||||
* 发送充电桩设置命令
|
||||
*/
|
||||
void pushPileSettingCommand(PileSettingCommand command);
|
||||
}
|
||||
|
||||
@@ -14,6 +14,7 @@ import com.jsowell.common.util.StringUtils;
|
||||
import com.jsowell.common.util.YKCUtils;
|
||||
import com.jsowell.netty.command.ykc.GetRealTimeMonitorDataCommand;
|
||||
import com.jsowell.netty.command.ykc.IssueQRCodeCommand;
|
||||
import com.jsowell.netty.command.ykc.PileSettingCommand;
|
||||
import com.jsowell.netty.command.ykc.ProofreadTimeCommand;
|
||||
import com.jsowell.netty.command.ykc.PublishPileBillingTemplateCommand;
|
||||
import com.jsowell.netty.command.ykc.RebootCommand;
|
||||
@@ -183,6 +184,10 @@ public class YKCPushCommandServiceImpl implements YKCPushCommandService {
|
||||
transactionCode, pileSn, BytesUtil.bcd2Str(connectorCodeByteArr), logicCardNum, physicsCardNum, chargeAmount);
|
||||
}
|
||||
|
||||
/**
|
||||
* 发送停止ch
|
||||
* @param command
|
||||
*/
|
||||
@Override
|
||||
public void pushStopChargingCommand(StopChargingCommand command) {
|
||||
String pileSn = command.getPileSn();
|
||||
@@ -342,4 +347,37 @@ public class YKCPushCommandServiceImpl implements YKCPushCommandService {
|
||||
BytesUtil.binary(filePathByteArr, 16));
|
||||
}
|
||||
}
|
||||
|
||||
public static void main(String[] args) {
|
||||
Integer integer = new Integer(100);
|
||||
String s = Integer.toHexString(integer);
|
||||
byte[] bytes = s.getBytes();
|
||||
System.out.println(s);
|
||||
System.out.println(bytes);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void pushPileSettingCommand(PileSettingCommand command) {
|
||||
|
||||
// 充电桩编号
|
||||
String pileSn = command.getPileSn();
|
||||
byte[] pileSnByteArr = BytesUtil.str2Bcd(pileSn);
|
||||
|
||||
// 工作状态
|
||||
String workingState = command.getWorkingState();
|
||||
byte[] workingStateByteArr;
|
||||
if (StringUtils.equals(workingState, "0")) {
|
||||
workingStateByteArr = Constants.zeroByteArray;
|
||||
} else {
|
||||
workingStateByteArr = Constants.oneByteArray;
|
||||
}
|
||||
|
||||
// 最大功率
|
||||
Integer maxPower = command.getMaxPower();
|
||||
byte[] maxPowerByteArr = BytesUtil.str2Bcd(maxPower.toString());
|
||||
|
||||
byte[] msg = Bytes.concat(pileSnByteArr, workingStateByteArr, maxPowerByteArr);
|
||||
|
||||
this.push(msg, pileSn, YKCFrameTypeCode.CHARGING_PILE_WORKING_PARAMETER_SETTING_CODE);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user