mirror of
https://codeup.aliyun.com/67c68d4e484ca2f0a13ac3c1/ydc/jsowell-charger-web.git
synced 2026-04-21 19:45:09 +08:00
新增 云快充协议查询、设置参数帧
This commit is contained in:
@@ -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);
|
||||
}
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user