update 二维码下发规则

This commit is contained in:
Lemon
2023-04-06 16:18:06 +08:00
parent 36ec9c9940
commit 34f9aa4317
2 changed files with 18 additions and 9 deletions

View File

@@ -16,8 +16,10 @@ import com.jsowell.pile.domain.PileBillingTemplate;
import com.jsowell.pile.dto.PublishBillingTemplateDTO;
import com.jsowell.pile.service.IPileBasicInfoService;
import com.jsowell.pile.service.IPileBillingTemplateService;
import com.jsowell.pile.service.IPileStationInfoService;
import com.jsowell.pile.vo.web.BillingTemplateVO;
import com.jsowell.pile.vo.web.PileDetailVO;
import com.jsowell.pile.vo.web.PileStationVO;
import org.apache.commons.collections4.CollectionUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@@ -41,6 +43,9 @@ public class PileRemoteService {
@Autowired
private YKCPushCommandService ykcPushCommandService;
@Autowired
private IPileStationInfoService pileStationInfoService;
/**
* 获取充电桩实时数据信息
*
@@ -108,9 +113,11 @@ public class PileRemoteService {
public void issueQRCode(String pileSn) {
IssueQRCodeCommand command = IssueQRCodeCommand.builder().pileSn(pileSn).build();
// 查询充电站info
ykcPushCommandService.pushIssueQRCodeCommand(command);
PileStationVO pileStationVO = pileStationInfoService.getStationInfoByPileSn(pileSn);
if (StringUtils.isNotBlank(pileStationVO.getQrcodePrefix())) {
command.setQrcodePrefix(pileStationVO.getQrcodePrefix());
ykcPushCommandService.pushIssueQRCodeCommand(command);
}
}
/**

View File

@@ -16,13 +16,11 @@ import com.jsowell.common.util.StringUtils;
import com.jsowell.common.util.YKCUtils;
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;
import com.jsowell.pile.service.IPileConnectorInfoService;
import com.jsowell.pile.service.IPileModelInfoService;
import com.jsowell.pile.service.IPileMsgRecordService;
import com.jsowell.pile.domain.PileBasicInfo;
import com.jsowell.pile.service.*;
import com.jsowell.pile.vo.web.BillingTemplateVO;
import com.jsowell.pile.vo.web.PileModelInfoVO;
import com.jsowell.pile.vo.web.PileStationVO;
import io.netty.buffer.ByteBuf;
import io.netty.channel.Channel;
import io.netty.channel.ChannelFuture;
@@ -49,6 +47,9 @@ public class YKCPushCommandServiceImpl implements YKCPushCommandService {
@Autowired
private IPileBasicInfoService pileBasicInfoService;
@Autowired
private IPileStationInfoService pileStationInfoService;
@Autowired
private RedisCache redisCache;
@@ -226,7 +227,8 @@ public class YKCPushCommandServiceImpl implements YKCPushCommandService {
// String qrCodePrefix = pileBasicInfoService.getPileQrCodeUrl(null);
String qrCodePrefix = "";
if (StringUtils.isBlank(command.getQrcodePrefix())) {
qrCodePrefix = pileConnectorInfoService.getPileConnectorQrCodeUrl(null);
// 为空则给平台二维码前缀
qrCodePrefix = pileBasicInfoService.getPileQrCodeUrl(null);
}else {
qrCodePrefix = command.getQrcodePrefix();
}