新增 云快充协议查询、设置参数帧

This commit is contained in:
Lemon
2023-04-04 13:53:31 +08:00
parent d06bb71f08
commit 218c5715ac
6 changed files with 286 additions and 18 deletions

View File

@@ -1,14 +1,6 @@
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;
import com.jsowell.netty.command.ykc.StartChargingCommand;
import com.jsowell.netty.command.ykc.StopChargingCommand;
import com.jsowell.netty.command.ykc.UpdateFileCommand;
import com.jsowell.netty.command.ykc.*;
/**
* 云快充协议向充电桩发送命令service
@@ -67,4 +59,10 @@ public interface YKCPushCommandService {
* 发送充电桩设置命令
*/
void pushPileSettingCommand(PileSettingCommand command);
/**
* 平台査询工作参数
* @param command
*/
void pushQueryWorkParamsCommand(QueryWorkParamsCommand command);
}

View File

@@ -6,21 +6,15 @@ import com.jsowell.common.constant.Constants;
import com.jsowell.common.core.domain.ykc.YKCFrameTypeCode;
import com.jsowell.common.core.redis.RedisCache;
import com.jsowell.common.enums.ykc.PileChannelEntity;
import com.jsowell.common.enums.ykc.ReturnCodeEnum;
import com.jsowell.common.exception.BusinessException;
import com.jsowell.common.util.BytesUtil;
import com.jsowell.common.util.CRC16Util;
import com.jsowell.common.util.Cp56Time2a.Cp56Time2aUtil;
import com.jsowell.common.util.DateUtils;
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;
import com.jsowell.netty.command.ykc.StartChargingCommand;
import com.jsowell.netty.command.ykc.StopChargingCommand;
import com.jsowell.netty.command.ykc.UpdateFileCommand;
import com.jsowell.netty.command.ykc.*;
import com.jsowell.netty.service.yunkuaichong.YKCPushCommandService;
import com.jsowell.pile.service.IPileBasicInfoService;
import com.jsowell.pile.service.IPileBillingTemplateService;
@@ -377,4 +371,30 @@ public class YKCPushCommandServiceImpl implements YKCPushCommandService {
this.push(msg, pileSn, YKCFrameTypeCode.CHARGING_PILE_WORKING_PARAMETER_SETTING_CODE);
}
/**
* 平台査询工作参数
* @param command
*/
@Override
public void pushQueryWorkParamsCommand(QueryWorkParamsCommand command) {
// 桩编号
String pileSn = command.getPileSn();
byte[] pileSnByteArr = BytesUtil.str2Bcd(pileSn);
// 桩类型
byte[] pileType = Constants.oneByteArray;
PileModelInfoVO info = pileModelInfoService.getPileModelInfoByPileSn(pileSn);
if (info == null) {
throw new BusinessException(ReturnCodeEnum.CODE_GET_PILE_DETAIL_ERROR);
}
String chargerPileType = info.getChargerPileType();
if (StringUtils.equals("1", chargerPileType)) {
// 直流
pileType = Constants.zeroByteArray;
}
// 拼装msg信息
byte[] msg = Bytes.concat(pileSnByteArr, pileType);
this.push(msg, pileSn, YKCFrameTypeCode.QUERY_PILE_WORK_PARAMS_CODE);
}
}