yuhongqi 14 hours ago
parent
commit
065c496bb6

+ 2 - 1
fs-admin/src/main/java/com/fs/live/controller/OrderController.java

@@ -262,7 +262,8 @@ public class OrderController extends BaseController
             // 时间信息
             exportVO.setCreateTime(vo.getCreateTime());
             exportVO.setPayTime(vo.getPayTime());
-            
+            exportVO.setHfshh(vo.getHfshh());
+
             // 物流信息
             exportVO.setDeliverySn(vo.getDeliveryCode()); // 快递公司编号,合并订单暂无此字段
             exportVO.setDeliveryName(vo.getDeliveryName()); // 快递公司,合并订单暂无此字段

+ 1 - 0
fs-company/src/main/java/com/fs/company/controller/live/OrderController.java

@@ -270,6 +270,7 @@ public class OrderController extends BaseController
             // 公司和销售信息
             exportVO.setCompanyName(vo.getCompanyName());
             exportVO.setCompanyUserNickName(vo.getCompanyUserNickName());
+            exportVO.setHfshh(vo.getHfshh());
 
             // 套餐信息
             exportVO.setPackageName(null); // 套餐名称,合并订单暂无此字段

+ 15 - 2
fs-service/src/main/java/com/fs/live/service/impl/LiveDataServiceImpl.java

@@ -1088,6 +1088,19 @@ public class LiveDataServiceImpl implements ILiveDataService {
             return new ArrayList<>();
         }
 
+        // 查询直播间视频时长
+        LiveVideoMapper liveVideoMapper = SpringUtils.getBean(LiveVideoMapper.class);
+        List<LiveVideo> videos = liveVideoMapper.selectByLiveId(liveId);
+        Long videoDuration = videos.stream()
+                .filter(v -> v.getVideoType() != null && (v.getVideoType() == 1 || v.getVideoType() == 2))
+                .mapToLong(v -> v.getDuration() != null ? v.getDuration() : 0L)
+                .sum();
+        
+        // 根据视频时长确定完课标准 卓美
+        // 如果视频时长大于40分钟(2400秒),30分钟(1800秒)算完课
+        // 如果视频时长小于等于40分钟(2400秒),20分钟(1200秒)算完课
+        long completionThreshold = (videoDuration > 2400) ? 1800 : 1200;
+
         // 转换为导出VO列表
         List<LiveUserDetailExportVO> exportList = new ArrayList<>();
         for (LiveUserDetailVo userDetail : userDetailList) {
@@ -1114,8 +1127,8 @@ public class LiveDataServiceImpl implements ILiveDataService {
             exportVO.setCompanyName(userDetail.getCompanyName());
             exportVO.setSalesName(userDetail.getSalesName());
 
-            // 是否完课(根据观看时长判断,假设30分钟以上为完课
-            if (totalSeconds >= 1800) {
+            // 是否完课(根据视频时长动态判断完课标准
+            if (totalSeconds >= completionThreshold) {
                 exportVO.setIsCompleted("是");
             } else {
                 exportVO.setIsCompleted("否");

+ 16 - 11
fs-service/src/main/java/com/fs/live/vo/MergedOrderExportVO.java

@@ -48,13 +48,25 @@ public class MergedOrderExportVO implements Serializable
     private Integer totalNum;
 
     /** 产品价格 */
-    @Excel(name = "产品价格")
+//    @Excel(name = "产品价格")
     private BigDecimal price;
 
     /** 成本价 */
     @Excel(name = "成本价")
     private BigDecimal cost;
 
+    /** 商品金额 */
+    @Excel(name = "商品金额")
+    private BigDecimal totalPrice;
+
+    /** 应付金额 */
+    @Excel(name = "应付金额")
+    private BigDecimal payPrice;
+
+    /** 实付金额 */
+    @Excel(name = "实付金额")
+    private BigDecimal payMoney;
+
     /** 结算价 */
     @Excel(name = "结算价")
     private BigDecimal FPrice;
@@ -137,18 +149,11 @@ public class MergedOrderExportVO implements Serializable
     /** 银行交易流水号 */
     @Excel(name = "银行交易流水号")
     private String bankTransactionId;
+    /** 汇付商户订单号 */
+    @Excel(name = "汇付商户订单号")
+    private String hfshh;
 
-    /** 商品金额 */
-    @Excel(name = "商品金额")
-    private BigDecimal totalPrice;
 
-    /** 应付金额 */
-    @Excel(name = "应付金额")
-    private BigDecimal payPrice;
-
-    /** 实付金额 */
-    @Excel(name = "实付金额")
-    private BigDecimal payMoney;
 
 
 }

+ 2 - 0
fs-service/src/main/java/com/fs/live/vo/MergedOrderVO.java

@@ -109,6 +109,8 @@ public class MergedOrderVO implements Serializable
 
     /** 订单类型:1-销售订单,2-商城订单,3-直播订单 */
     private Integer orderType;
+//    汇付商户订单号
+    private String hfshh;
 
     /** 订单类型名称 */
     private String orderTypeName;

+ 7 - 4
fs-service/src/main/resources/mapper/hisStore/MergedOrderMapper.xml

@@ -61,7 +61,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
       o.delivery_pay_status,
       o.total_price,
       csc.NAME AS mini_program_name,
-      sp_latest.bank_transaction_id
+      sp_latest.bank_transaction_id,
+        CONCAT('store-',sp_latest.pay_code) as hfshh
       FROM
       fs_store_order_scrm o
       left join ( SELECT fsois.*, ROW_NUMBER() OVER ( PARTITION BY fsois.order_id ORDER BY fsois.item_id ) AS rn FROM fs_store_order_item_scrm fsois ) item_latest ON item_latest.order_id = o.id and item_latest.rn = 1
@@ -202,8 +203,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
       o.delivery_pay_status,
       o.total_price,
       csc.NAME AS mini_program_name,
-      sp_latest.bank_transaction_id
-      FROM
+      sp_latest.bank_transaction_id,
+        CONCAT('store-',sp_latest.pay_code) as hfshh
+        FROM
       fs_store_order_scrm o
         left join ( SELECT fsois.*, ROW_NUMBER() OVER ( PARTITION BY fsois.order_id ORDER BY fsois.item_id ) AS rn FROM fs_store_order_item_scrm fsois ) item_latest ON item_latest.order_id = o.id and item_latest.rn = 1
       LEFT JOIN fs_user u ON o.user_id = u.user_id
@@ -343,7 +345,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
       o.delivery_pay_status,
       o.total_price,
       csc.NAME AS mini_program_name,
-      sp_latest.bank_transaction_id
+      sp_latest.bank_transaction_id,
+        CONCAT('live-',sp_latest.pay_code) as hfshh
       FROM
       live_order o
       left join live_order_item loi on loi.order_id = o.order_id

+ 1 - 1
fs-service/src/main/resources/mapper/live/LiveCompletionPointsRecordMapper.xml

@@ -101,7 +101,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
     <!-- 查询用户的完课积分领取记录列表 -->
     <select id="selectRecordsByUser" resultMap="LiveCompletionPointsRecordResult">
         SELECT * FROM live_completion_points_record
-        WHERE user_id = #{userId}
+        WHERE user_id = #{userId} and receive_status = 1
         ORDER BY current_completion_date DESC
     </select>