Kaynağa Gözat

Merge remote-tracking branch 'origin/develop' into develop

‘linchangsheng’ 9 ay önce
ebeveyn
işleme
8b40945bb4

+ 3 - 2
mall-miniapp-service/src/main/java/com/gree/mall/miniapp/controller/material/MaterialSalesController.java

@@ -190,8 +190,9 @@ public class MaterialSalesController {
     @GetMapping("/pay")
     @ApiOperation(value = "生成支付")
     public ResponseHelper<PayDetail> websitDefault(
-            @ApiParam(value = "appOrderId",required = true) @RequestParam String key,
+            @ApiParam(value = "appOrderId或payConfigId",required = true) @RequestParam String key,
             @ApiParam(value = "openid",required = true) @RequestParam String openid,
+            @ApiParam(value = "salesId") @RequestParam(required = false) String salesId,
             @ApiParam(value = "通联支付类型") @RequestParam(required = false, defaultValue = SybConstants.PAY_TYPE_W06) String payType,
             @ApiParam(value = "支付完成跳转(必须为https协议地址,且不允许带参数)") @RequestParam(required = false) String frontUrl
     ) throws RemoteServiceException, InterruptedException {
@@ -200,7 +201,7 @@ public class MaterialSalesController {
             throw new RemoteServiceException("系统繁忙,请稍后再尝试");
         }
         try {
-            PayDetail pay = websitSalesLogic.generatePayRecord(key, openid, payType, frontUrl);
+            PayDetail pay = websitSalesLogic.generatePayRecord(key, openid, salesId, payType, frontUrl);
             return ResponseHelper.success(pay);
         }finally {
             obtain.unlock();

+ 12 - 4
mall-miniapp-service/src/main/java/com/gree/mall/miniapp/logic/material/WebsitSalesLogic.java

@@ -499,18 +499,26 @@ public class WebsitSalesLogic {
      * 生成支付记录
      * @param key
      * @param openid
+     * @param salesId
      * @param payType
      * @param frontUrl
      * @return
      */
-    public PayDetail generatePayRecord(String key, String openid, String payType, String frontUrl) {
+    public PayDetail generatePayRecord(String key, String openid, String salesId, String payType, String frontUrl) {
         PayDetail payDetail = null;
-        final WebsitSalesPayMap payMap = websitSalesPayMapService.getById(key);
+        AdminWebsitPayConfig payConfig = null;
+        WebsitSales sales = null;
+        if (SybConstants.PAY_TYPE_W06.equals(payType)) {
+            final WebsitSalesPayMap payMap = websitSalesPayMapService.getById(key);
 
-        final AdminWebsitPayConfig payConfig = adminWebsitPayConfigService.getById(payMap.getPayConfigId());
+            payConfig = adminWebsitPayConfigService.getById(payMap.getPayConfigId());
 
-        final WebsitSales sales = websitSalesService.getById(payMap.getSalesId());
+            sales = websitSalesService.getById(payMap.getSalesId());
+        } else if (SybConstants.PAY_TYPE_W02.equals(payType)) {
+            payConfig = adminWebsitPayConfigService.getById(key);
 
+            sales = websitSalesService.getById(salesId);
+        }
         if (Objects.nonNull(sales)) {
             WebsitSalesPayOrder payOrder = new WebsitSalesPayOrder();
             payOrder.setId(IdWorker.getIdStr())