2 Коммиты b7f6027710 ... 65646d40cd

Автор SHA1 Сообщение Дата
  tangxiangan 65646d40cd Merge remote-tracking branch 'origin/develop/v1.0' into develop/v1.0 4 дней назад
  tangxiangan 9134c23ad0 Bug修复 4 дней назад

+ 6 - 6
pdf-office-payment/src/main/java/cn/kdan/cloud/pdf/office/payment/service/impl/AppStoreServiceImpl.java

@@ -122,8 +122,8 @@ public class AppStoreServiceImpl implements AppStoreService {
             createSubscription.setPrice(price);
             createSubscription.setPayTime(0);
             subscriptionsService.createSubscription(createSubscription);
-            String readeNo = MyDateUtils.getTimeStamp() + "-" + product.getId() + "-" + (int) ((Math.random() * 9 + 1) * 1000);
-            // 更新订单
+            String readeNo = cn.kdan.cloud.pdf.office.payment.utils.CommonUtils.generateRightsId((long) ((Math.random() * 9999 + 1) * 10000));
+           // 更新订单
             CreateOrderManualDTO orderManualDTO = CreateOrderManualDTO.builder()
                     .thirdTradeNo(originalTransactionId)
                     .thirdOrderNo(transactionId)
@@ -177,8 +177,8 @@ public class AppStoreServiceImpl implements AppStoreService {
                 price = ObjectUtils.isNotEmpty(product.getCnyDisplayPrice())? product.getCnyDisplayPrice().toString() : product.getCnyPrice().toString();
                 renewPrice = product.getCnyPrice();
             }
-            contentMap.put("@payPrice@", orderManualDTO.getCurrency().equals("USD")?"$"+price:"¥"+price);
-            contentMap.put("@renewPrice@", orderManualDTO.getCurrency().equals("USD")?"$"+renewPrice.toString():"¥"+renewPrice.toString());
+            contentMap.put("@payPrice@", orderManualDTO.getCurrency()+price);
+            contentMap.put("@renewPrice@",orderManualDTO.getCurrency()+price);
 
             bo.setSendTitleContent(titleMap);
             //设置内容
@@ -212,7 +212,7 @@ public class AppStoreServiceImpl implements AppStoreService {
                 price = ObjectUtils.isNotEmpty(product.getCnyDisplayPrice())? product.getCnyDisplayPrice().toString() : product.getCnyPrice().toString();
                 renewPrice = product.getCnyPrice();
             }
-            contentMap.put("@payPrice@", orderManualDTO.getCurrency().equals("USD")?"$"+price:"¥"+price);
+            contentMap.put("@payPrice@", orderManualDTO.getCurrency()+price);
             bo.setSendTitleContent(titleMap);
             //设置内容
             bo.setSendContent(contentMap);
@@ -248,7 +248,7 @@ public class AppStoreServiceImpl implements AppStoreService {
         // 生成替换内容后的发票
         String htmlStr = TemplatesUtil.replaceStringUsingFreeMarker(invoiceHtml, map);
         if (!currency.equals("USD")) {
-            htmlStr = htmlStr.replace("USD", "CNY");
+            htmlStr = htmlStr.replace("USD", currency);
         }
         HttpHeaders headers = new HttpHeaders();
         headers.setContentType(MediaType.APPLICATION_FORM_URLENCODED);

+ 5 - 5
pdf-office-payment/src/main/java/cn/kdan/cloud/pdf/office/payment/service/impl/GooglePayServiceImpl.java

@@ -135,7 +135,7 @@ public class GooglePayServiceImpl implements GooglePayService {
         createSubscription.setPrice(price);
         createSubscription.setPayTime(0);
         subscriptionsService.createSubscription(createSubscription);
-        String readeNo = MyDateUtils.getTimeStamp() + "-" + product.getId() + "-" + (int) ((Math.random() * 9 + 1) * 1000);
+        String readeNo = cn.kdan.cloud.pdf.office.payment.utils.CommonUtils.generateRightsId((long) ((Math.random() * 9999 + 1) * 10000));
         CreateOrderManualDTO orderManualDTO = CreateOrderManualDTO.builder()
                 .thirdTradeNo(subscriptionPurchaseV2.getExternalAccountIdentifiers().getObfuscatedExternalAccountId())
                 .thirdOrderNo(subscriptionPurchaseV2.getLatestOrderId())
@@ -190,8 +190,8 @@ public class GooglePayServiceImpl implements GooglePayService {
                 price = ObjectUtils.isNotEmpty(product.getCnyDisplayPrice())? product.getCnyDisplayPrice().toString() : product.getCnyPrice().toString();
                 renewPrice = product.getCnyPrice();
             }
-            contentMap.put("@payPrice@", orderManualDTO.getCurrency().equals("USD")?"$"+price:"¥"+price);
-            contentMap.put("@renewPrice@", orderManualDTO.getCurrency().equals("USD")?"$"+renewPrice.toString():"¥"+renewPrice.toString());
+            contentMap.put("@payPrice@", orderManualDTO.getCurrency()+price);
+            contentMap.put("@renewPrice@",orderManualDTO.getCurrency()+price);
 
             bo.setSendTitleContent(titleMap);
             //设置内容
@@ -225,7 +225,7 @@ public class GooglePayServiceImpl implements GooglePayService {
                 price = ObjectUtils.isNotEmpty(product.getCnyDisplayPrice())? product.getCnyDisplayPrice().toString() : product.getCnyPrice().toString();
                 renewPrice = product.getCnyPrice();
             }
-            contentMap.put("@payPrice@", orderManualDTO.getCurrency().equals("USD")?"$"+price:"¥"+price);
+            contentMap.put("@payPrice@", orderManualDTO.getCurrency()+price);
             bo.setSendTitleContent(titleMap);
             //设置内容
             bo.setSendContent(contentMap);
@@ -261,7 +261,7 @@ public class GooglePayServiceImpl implements GooglePayService {
         // 生成替换内容后的发票
         String htmlStr = TemplatesUtil.replaceStringUsingFreeMarker(invoiceHtml, map);
         if (!currency.equals("USD")) {
-            htmlStr = htmlStr.replace("USD", "CNY");
+            htmlStr = htmlStr.replace("USD", currency);
         }
         HttpHeaders headers = new HttpHeaders();
         headers.setContentType(MediaType.APPLICATION_FORM_URLENCODED);

+ 1 - 1
pdf-office-payment/src/main/java/cn/kdan/cloud/pdf/office/payment/service/impl/WebhookServiceImpl.java

@@ -121,7 +121,7 @@ public class WebhookServiceImpl implements WebhookService {
         createOrderManual.setThirdOrderNo(thirdOrderId);
         createOrderManual.setSubscriptionId(subId);
         createOrderManual.setEmail(orderByTradeNo.getEmail());
-        String readeNo = MyDateUtils.getTimeStamp() + "-" + orderByTradeNo.getProductId() + "-" + (int) ((Math.random() * 9 + 1) * 1000);
+        String readeNo = cn.kdan.cloud.pdf.office.payment.utils.CommonUtils.generateRightsId((long) ((Math.random() * 9999 + 1) * 10000));
         createOrderManual.setTradeNo(readeNo);
         createOrderManual.setInvoiceNo(MyDateUtils.getTimeStamp() + (int) ((Math.random() * 9 + 1) * 1000));
         createOrderManual.setId(orderId);