|
@@ -12,7 +12,6 @@ import com.usky.dxtop.common.exception.CustomException;
|
|
|
import com.usky.dxtop.common.utils.QRCodeUtil;
|
|
|
import com.usky.dxtop.common.utils.SecurityUtils;
|
|
|
import com.usky.dxtop.common.utils.StringUtils;
|
|
|
-import com.usky.dxtop.common.utils.file.FileUtils;
|
|
|
import com.usky.dxtop.common.utils.sign.Base64;
|
|
|
import com.usky.dxtop.mapper.QrCodeMapper;
|
|
|
import com.usky.dxtop.model.QrCode;
|
|
@@ -53,8 +52,10 @@ public class QrCodeServiceImpl extends ServiceImpl<QrCodeMapper, QrCode> impleme
|
|
|
try {
|
|
|
String s = sysConfigService.selectConfigByKey("app.pay.path");
|
|
|
Optional.ofNullable(qrCode.getTopChannelId())
|
|
|
- .orElseThrow(() ->new CustomException("渠道不能为空"));
|
|
|
+ .orElseThrow(() ->new CustomException("渠道编号不能为空"));
|
|
|
TopChannel topChannel = topChannelService.getById(qrCode.getTopChannelId());
|
|
|
+ Optional.ofNullable(topChannel)
|
|
|
+ .orElseThrow(() ->new CustomException("渠道不能为空"));
|
|
|
String payPath = String.format("%s%s",s,topChannel.getId());
|
|
|
//生成二维码
|
|
|
BufferedImage image = QRCodeUtil.encode(payPath, null, true);
|
|
@@ -104,14 +105,6 @@ public class QrCodeServiceImpl extends ServiceImpl<QrCodeMapper, QrCode> impleme
|
|
|
QrCode qrCode = new QrCode();
|
|
|
qrCode.setId(id);
|
|
|
qrCode.setDelFlag(true);
|
|
|
- boolean b = this.updateById(qrCode);
|
|
|
- if (b){
|
|
|
- qrCode = this.getById(id);
|
|
|
- b = FileUtils.deleteFile(qrCode.getQrPath());
|
|
|
- if (!b){
|
|
|
- throw new CustomException("删除二维码文件失败");
|
|
|
- }
|
|
|
- }
|
|
|
- return b;
|
|
|
+ return this.updateById(qrCode);
|
|
|
}
|
|
|
}
|