diff --git a/pjcloud-wallet/pjcloud-wallet-biz/src/main/java/com/bsd/pjcloud/wallet/service/impl/recharge/WalletRechargeInvoiceServiceImpl.java b/pjcloud-wallet/pjcloud-wallet-biz/src/main/java/com/bsd/pjcloud/wallet/service/impl/recharge/WalletRechargeInvoiceServiceImpl.java index 250f56d1e..37f6bed0e 100644 --- a/pjcloud-wallet/pjcloud-wallet-biz/src/main/java/com/bsd/pjcloud/wallet/service/impl/recharge/WalletRechargeInvoiceServiceImpl.java +++ b/pjcloud-wallet/pjcloud-wallet-biz/src/main/java/com/bsd/pjcloud/wallet/service/impl/recharge/WalletRechargeInvoiceServiceImpl.java @@ -67,12 +67,12 @@ import org.springframework.web.multipart.MultipartFile; import javax.imageio.ImageIO; import java.awt.*; import java.awt.image.BufferedImage; -import java.io.File; -import java.io.FileInputStream; -import java.io.IOException; +import java.io.ByteArrayOutputStream; +import java.io.InputStream; import java.math.BigDecimal; import java.math.RoundingMode; import java.net.URL; +import java.net.URLConnection; import java.time.LocalDateTime; import java.util.ArrayList; import java.util.HashMap; @@ -415,42 +415,86 @@ public class WalletRechargeInvoiceServiceImpl extends ServiceImpl upload = remoteFileService.innerUpload(multipartFile, null, null, null); + if (ObjectUtil.isEmpty(upload) || !upload.isOk() || ObjectUtil.isEmpty(upload.getData())) { + log.error("|{}|盖章失败,上传失败,upload:|{}|invoice:|{}|", TAG, JSON.toJSONString(upload), JSONUtil.toJsonStr(invoice)); + return null; + } + Object dataObj = upload.getData(); + if (!(dataObj instanceof Map data)) { + log.error("|{}|盖章失败,上传返回结构异常,data:|{}|invoice:|{}|", TAG, JSON.toJSONString(dataObj), JSONUtil.toJsonStr(invoice)); + return null; + } + Object urlObj = data.get("url"); + return ObjectUtil.isEmpty(urlObj) ? null : String.valueOf(urlObj); + } catch (Exception e) { + log.error("|{}|盖章失败,异常,invoice:|{}|", TAG, JSONUtil.toJsonStr(invoice), e); return null; } } @@ -582,4 +626,4 @@ public class WalletRechargeInvoiceServiceImpl extends ServiceImpl