Browse Source

FEAT: 直播订单导出修改

xdd 2 ngày trước cách đây
mục cha
commit
7e91b52e4c

+ 0 - 3
fs-service-system/src/main/java/com/fs/live/domain/LiveOrder.java

@@ -168,9 +168,6 @@ public class LiveOrder extends BaseEntity {
     @Excel(name = "商品名称")
     private String productName;
 
-    @Excel(name = "套餐名称",width = 60)
-    private String packageTitle;
-
     @Excel(name = "是否上传凭证 0:未上传 1:已上传")
     private Integer isUpload;
 

+ 7 - 0
fs-service-system/src/main/java/com/fs/live/mapper/LiveOrderPaymentMapper.java

@@ -3,10 +3,12 @@ package com.fs.live.mapper;
 
 import com.fs.live.domain.LiveOrderPayment;
 import com.fs.live.vo.LiveOrderPaymentVo;
+import org.apache.ibatis.annotations.MapKey;
 import org.apache.ibatis.annotations.Param;
 import org.apache.ibatis.annotations.Select;
 
 import java.util.List;
+import java.util.Map;
 
 
 /**
@@ -82,4 +84,9 @@ public interface LiveOrderPaymentMapper {
 
     @Select("select * from live_order_payment where business_id= #{orderId} and status=1 order by create_time desc limit 1")
     LiveOrderPayment selectLiveOrderLatestPayByOrderId(@Param("orderId") Long orderId);
+
+    @MapKey("orderId")
+    @Select("select order_id,bank_transaction_id from live_order_payment where bank_transaction_id is not null")
+    Map<Long, LiveOrderPayment> selectAllPayments();
+
 }

+ 9 - 0
fs-service-system/src/main/java/com/fs/live/service/impl/LiveOrderServiceImpl.java

@@ -761,6 +761,7 @@ public class LiveOrderServiceImpl implements ILiveOrderService {
         return liveOrders;
     }
 
+
     @Override
     public List<LiveOrder> selectLiveOrderListExport(LiveOrder liveOrder) {
         List<LiveOrder> liveOrders = baseMapper.selectLiveOrderList(liveOrder);
@@ -775,6 +776,8 @@ public class LiveOrderServiceImpl implements ILiveOrderService {
         }
         Map<Long, FsStoreDelivers> byOrderIdWithTypeBatch = fsStoreDeliversMapper
                 .findByOrderIdWithTypeBatch(collect, 1);
+        Map<Long, LiveOrderPayment> paymentMap = liveOrderPaymentMapper.selectAllPayments();
+
         for (LiveOrder order : liveOrders) {
             FsStoreDelivers delivers = byOrderIdWithTypeBatch.get(order.getOrderId());
             if(ObjectUtil.isNotNull(delivers)) {
@@ -790,6 +793,12 @@ public class LiveOrderServiceImpl implements ILiveOrderService {
                 order.setDeliveryStatus(null);
                 order.setDeliveryType(null);
             }
+            order.setPayPrice(order.getTotalPrice());
+
+            LiveOrderPayment liveOrderPayment = paymentMap.get(order.getOrderId());
+            if(ObjectUtil.isNotNull(liveOrderPayment)){
+                order.setBankTrxId(liveOrderPayment.getBankTransactionId());
+            }
         }
         return liveOrders;
     }