Browse Source

查询交易中的订单

liujc 1 year ago
parent
commit
a9dde9d7be

+ 1 - 1
cooleshow-user/user-biz/src/main/java/com/yonge/cooleshow/biz/dal/service/impl/PaymentDivMemberRecordServiceImpl.java

@@ -910,7 +910,7 @@ public class PaymentDivMemberRecordServiceImpl extends ServiceImpl<PaymentDivMem
     private void platformDivRecord(UserOrderDetailVo userPaymentOrder, Map<Long, BigDecimal> tenantdivMap) {
         // 写入平台收支表
         PlatformCashAccountRecord platformCashAccountRecord = new PlatformCashAccountRecord(userPaymentOrder.getUserId(), tenantdivMap.get(-1L),
-                InOrOutEnum.IN, PostStatusEnum.RECORDED, AccountBizTypeEnum.TENANT_ALBUM, userPaymentOrder.getBizId(),
+                InOrOutEnum.IN, PostStatusEnum.RECORDED, AccountBizTypeEnum.valueOf(userPaymentOrder.getOrderType().name()), userPaymentOrder.getBizId(),
                 userPaymentOrder.getOrderNo(), new Date());
         platformCashAccountRecordService.save(platformCashAccountRecord);
     }

+ 17 - 0
cooleshow-user/user-biz/src/main/java/com/yonge/cooleshow/biz/dal/service/impl/UserOrderServiceImpl.java

@@ -20,6 +20,7 @@ import com.yonge.cooleshow.biz.dal.vo.UserOrderVo;
 import com.yonge.cooleshow.biz.dal.vo.res.OrderCreateRes;
 import com.yonge.cooleshow.biz.dal.vo.res.OrderPayRes;
 import com.yonge.cooleshow.biz.dal.wrapper.PaymentDivMemberRecordWrapper;
+import com.yonge.cooleshow.biz.dal.wrapper.UserPaymentOrderWrapper;
 import com.yonge.cooleshow.biz.dal.wrapper.coupon.CouponOrderWrapper;
 import com.yonge.cooleshow.common.constant.SysConfigConstant;
 import com.yonge.cooleshow.common.entity.HttpResponseResult;
@@ -113,6 +114,8 @@ public class UserOrderServiceImpl extends ServiceImpl<UserOrderDao, UserOrder> i
     private ActivityPlanService activityPlanService;
 
     @Autowired
+    private RedisCacheService redisCacheService;
+    @Autowired
     private ActivityUserRewardService activityUserRewardService;
     @Autowired
     private CouponInfoService couponInfoService;
@@ -476,6 +479,20 @@ public class UserOrderServiceImpl extends ServiceImpl<UserOrderDao, UserOrder> i
         if (null != userOrderVo) {
             userOrderVo.setOrderDetailList(orderDetailService.getOrderDetilListByOrderNo(userOrderVo.getOrderNo()));
         }
+
+
+        // 查询用户下单配置
+        String ret = redisCacheService.getUserOrderConfig(query.getUserId().toString(), query.getGoodType());
+        if (!StringUtils.isEmpty(ret) && userOrderVo != null) {
+            UserPaymentOrderWrapper.PaymentOrderReqConfig config = UserPaymentOrderWrapper.PaymentOrderReqConfig
+                    .from(ret);
+            UserPaymentOrderWrapper.PaymentConfig build = UserPaymentOrderWrapper.PaymentConfig.builder()
+                    .orderNo(userOrderVo.getOrderNo())
+                    .paymentConfig(config)
+                    .paymentType(userOrderVo.getPaymentVendor())
+                    .build();
+            userOrderVo.setPaymentConfig(build);
+        }
         return HttpResponseResult.succeed(userOrderVo);
     }
 

+ 12 - 0
cooleshow-user/user-biz/src/main/java/com/yonge/cooleshow/biz/dal/vo/UserOrderVo.java

@@ -3,6 +3,7 @@ package com.yonge.cooleshow.biz.dal.vo;
 import com.baomidou.mybatisplus.annotation.TableField;
 import com.yonge.cooleshow.biz.dal.entity.UserOrder;
 import com.yonge.cooleshow.biz.dal.enums.ClientEnum;
+import com.yonge.cooleshow.biz.dal.wrapper.UserPaymentOrderWrapper;
 import com.yonge.toolset.payment.base.enums.OpenEnum;
 import com.yonge.toolset.payment.base.enums.PayChannelEnum;
 import io.swagger.annotations.ApiModel;
@@ -44,6 +45,17 @@ public class UserOrderVo extends UserOrder {
     @ApiModelProperty("机构名称")
     private String tenantName;
 
+    @ApiModelProperty("支付配置")
+    private  UserPaymentOrderWrapper.PaymentConfig paymentConfig;
+
+    public UserPaymentOrderWrapper.PaymentConfig getPaymentConfig() {
+        return paymentConfig;
+    }
+
+    public void setPaymentConfig(UserPaymentOrderWrapper.PaymentConfig paymentConfig) {
+        this.paymentConfig = paymentConfig;
+    }
+
     public String getTenantName() {
         return tenantName;
     }

+ 1 - 0
cooleshow-user/user-biz/src/main/resources/config/mybatis/UserOrderMapper.xml

@@ -30,6 +30,7 @@
          t.id_ as id
         , t.order_no_ as orderNo
          ,t.payment_version_ as paymentVersion
+         ,t.payment_vendor_ as paymentVendor
         , t.user_id_ as userId
         , t.recom_user_id_ as recomUserId
         , t.activity_id_ as activityId