更改二维码生成需求
This commit is contained in:
parent
d6f21c6d5a
commit
24f29c9a58
@ -123,9 +123,10 @@ public class XhpcChargingPileServiceImpl implements IXhpcChargingPileService {
|
|||||||
xhpcTerminalMapper.addXhpcTerminal(xhpcTerminal);
|
xhpcTerminalMapper.addXhpcTerminal(xhpcTerminal);
|
||||||
|
|
||||||
//获取场站名称:
|
//获取场站名称:
|
||||||
|
|
||||||
String chargingStationName = xhpcChargingStationMapper.selectXhpcChargingStationById(xhpcTerminal.getChargingStationId()).getName();
|
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);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -3,6 +3,7 @@ package com.xhpc.charging.station.utils.img;
|
|||||||
import cn.hutool.core.date.DateUtil;
|
import cn.hutool.core.date.DateUtil;
|
||||||
import com.aliyun.oss.OSSClient;
|
import com.aliyun.oss.OSSClient;
|
||||||
import com.xhpc.charging.station.mapper.XhpcImgMapper;
|
import com.xhpc.charging.station.mapper.XhpcImgMapper;
|
||||||
|
import com.xhpc.common.domain.XhpcChargingPile;
|
||||||
import com.xhpc.common.domain.XhpcTerminal;
|
import com.xhpc.common.domain.XhpcTerminal;
|
||||||
import org.springframework.core.env.Environment;
|
import org.springframework.core.env.Environment;
|
||||||
|
|
||||||
@ -20,11 +21,11 @@ public class QrImgUtils {
|
|||||||
* @Return void
|
* @Return void
|
||||||
* @Since version-1.0
|
* @Since version-1.0
|
||||||
*/
|
*/
|
||||||
public static void uploadImg(XhpcTerminal xhpcTerminal, String serialNumber, Environment environment, XhpcImgMapper xhpcImgMapper, String chargingStationName, int forIndex, Map<Integer,Character> letterMap) {
|
public static void uploadImg(XhpcTerminal xhpcTerminal, String serialNumber, Environment environment, XhpcImgMapper xhpcImgMapper, String chargingStationName, int forIndex, Map<Integer,Character> letterMap, String name) {
|
||||||
|
|
||||||
//生成桩的二维码图片
|
//生成桩的二维码图片
|
||||||
//1.生成二维码链接内容:
|
//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();
|
String QrContent = prefix.append(xhpcTerminal.getSerialNumber()).toString();
|
||||||
|
|
||||||
try {
|
try {
|
||||||
@ -43,7 +44,7 @@ public class QrImgUtils {
|
|||||||
QrCode,
|
QrCode,
|
||||||
serialNumber,
|
serialNumber,
|
||||||
chargingStationName,
|
chargingStationName,
|
||||||
String.valueOf(xhpcTerminal.getNumber()),
|
name,
|
||||||
String.valueOf(letterMap.get(forIndex)),
|
String.valueOf(letterMap.get(forIndex)),
|
||||||
new File(environment.getProperty("oss.fullImgDestPath")+finallyImgFileName)
|
new File(environment.getProperty("oss.fullImgDestPath")+finallyImgFileName)
|
||||||
);
|
);
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user