update 自定义二维码前缀

This commit is contained in:
2023-04-07 09:18:31 +08:00
parent 291bd06330
commit c9f586ccdd
4 changed files with 30 additions and 24 deletions

View File

@@ -33,6 +33,7 @@ import com.jsowell.pile.service.IPileMsgRecordService;
import com.jsowell.pile.service.IPileStationInfoService;
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;
@@ -238,12 +239,18 @@ public class YKCPushCommandServiceImpl implements YKCPushCommandService {
// String qrCodePrefix = "https://wx.charging.shbochong.cn/prepare_charge?code=";
// String qrCodePrefix = pileBasicInfoService.getPileQrCodeUrl(null);
String qrCodePrefix = "";
if (StringUtils.isBlank(command.getQrcodePrefix())) {
// 为空则给平台二维码前缀
qrCodePrefix = pileBasicInfoService.getPileQrCodeUrl(null);
}else {
if (StringUtils.isNotBlank(command.getQrcodePrefix())) {
qrCodePrefix = command.getQrcodePrefix();
} else {
PileStationVO pileStationVO = pileStationInfoService.getStationInfoByPileSn(pileSn);
if (StringUtils.isNotBlank(pileStationVO.getQrcodePrefix())) {
qrCodePrefix = pileStationVO.getQrcodePrefix();
} else {
// 为空则给平台二维码前缀
qrCodePrefix = pileBasicInfoService.getPileQrCodeUrl(null);
}
}
byte[] qrCodePrefixByteArr = BytesUtil.str2Asc(qrCodePrefix);
// 二维码前缀长度 二维码前缀长度长度最大不超过200 字节