From 24f29c9a58cf6706fe4d40a5d49f49b0f87ccf62 Mon Sep 17 00:00:00 2001 From: wen <1455474577@qq.com> Date: Thu, 30 Sep 2021 17:15:52 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E6=94=B9=E4=BA=8C=E7=BB=B4=E7=A0=81?= =?UTF-8?q?=E7=94=9F=E6=88=90=E9=9C=80=E6=B1=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../station/service/XhpcChargingPileServiceImpl.java | 3 ++- .../com/xhpc/charging/station/utils/img/QrImgUtils.java | 7 ++++--- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/xhpc-modules/xhpc-charging-station/src/main/java/com/xhpc/charging/station/service/XhpcChargingPileServiceImpl.java b/xhpc-modules/xhpc-charging-station/src/main/java/com/xhpc/charging/station/service/XhpcChargingPileServiceImpl.java index ebce66fc..9150a16f 100644 --- a/xhpc-modules/xhpc-charging-station/src/main/java/com/xhpc/charging/station/service/XhpcChargingPileServiceImpl.java +++ b/xhpc-modules/xhpc-charging-station/src/main/java/com/xhpc/charging/station/service/XhpcChargingPileServiceImpl.java @@ -123,9 +123,10 @@ public class XhpcChargingPileServiceImpl implements IXhpcChargingPileService { xhpcTerminalMapper.addXhpcTerminal(xhpcTerminal); //获取场站名称: + String chargingStationName = xhpcChargingStationMapper.selectXhpcChargingStationById(xhpcTerminal.getChargingStationId()).getName(); //生成最终的完整图片,并上传 - QrImgUtils.uploadImg(xhpcTerminal, xhpcTerminal.getSerialNumber(),environment,xhpcImgMapper,chargingStationName,i,letterMap); + QrImgUtils.uploadImg(xhpcTerminal, xhpcTerminal.getSerialNumber(),environment,xhpcImgMapper,chargingStationName,i,letterMap,name); } diff --git a/xhpc-modules/xhpc-charging-station/src/main/java/com/xhpc/charging/station/utils/img/QrImgUtils.java b/xhpc-modules/xhpc-charging-station/src/main/java/com/xhpc/charging/station/utils/img/QrImgUtils.java index e982e5d0..cbe679fb 100644 --- a/xhpc-modules/xhpc-charging-station/src/main/java/com/xhpc/charging/station/utils/img/QrImgUtils.java +++ b/xhpc-modules/xhpc-charging-station/src/main/java/com/xhpc/charging/station/utils/img/QrImgUtils.java @@ -3,6 +3,7 @@ package com.xhpc.charging.station.utils.img; import cn.hutool.core.date.DateUtil; import com.aliyun.oss.OSSClient; import com.xhpc.charging.station.mapper.XhpcImgMapper; +import com.xhpc.common.domain.XhpcChargingPile; import com.xhpc.common.domain.XhpcTerminal; import org.springframework.core.env.Environment; @@ -20,11 +21,11 @@ public class QrImgUtils { * @Return void * @Since version-1.0 */ - public static void uploadImg(XhpcTerminal xhpcTerminal, String serialNumber, Environment environment, XhpcImgMapper xhpcImgMapper, String chargingStationName, int forIndex, Map letterMap) { + public static void uploadImg(XhpcTerminal xhpcTerminal, String serialNumber, Environment environment, XhpcImgMapper xhpcImgMapper, String chargingStationName, int forIndex, Map letterMap, String name) { //生成桩的二维码图片 //1.生成二维码链接内容: - StringBuilder prefix = new StringBuilder("https://xhpc.scxhua.com?pNum="); + StringBuilder prefix = new StringBuilder("https://xhpc.scxhua.cn?pNum="); String QrContent = prefix.append(xhpcTerminal.getSerialNumber()).toString(); try { @@ -43,7 +44,7 @@ public class QrImgUtils { QrCode, serialNumber, chargingStationName, - String.valueOf(xhpcTerminal.getNumber()), + name, String.valueOf(letterMap.get(forIndex)), new File(environment.getProperty("oss.fullImgDestPath")+finallyImgFileName) );