Bladeren bron

订单来源信息条件调整为多选,导出将订单来源导出

yfh 1 week geleden
bovenliggende
commit
811d520990

+ 13 - 1
fs-admin/src/main/java/com/fs/store/controller/FsStoreHealthOrderController.java

@@ -30,6 +30,7 @@ import org.springframework.web.bind.annotation.GetMapping;
 import org.springframework.web.bind.annotation.RequestMapping;
 import org.springframework.web.bind.annotation.RestController;
 
+import java.util.Arrays;
 import java.util.List;
 
 @RestController
@@ -50,6 +51,12 @@ public class FsStoreHealthOrderController extends BaseController {
     @GetMapping("/healthList")
     public TableDataInfo healthStoreList(FsStoreOrderParam param) {
         startPage();
+        // 将逗号分隔的字符串转换为 List
+        List<String> orderSourceList = null;
+        if (StringUtils.isNotBlank(param.getOrderSource())) {
+            orderSourceList = Arrays.asList(param.getOrderSource().split(","));
+            param.setOrderSources(orderSourceList);
+        }
         if(!StringUtils.isEmpty(param.getCreateTimeRange())){
             param.setCreateTimeList(param.getCreateTimeRange().split("--"));
         }
@@ -83,6 +90,12 @@ public class FsStoreHealthOrderController extends BaseController {
     @Log(title = "健康商城订单", businessType = BusinessType.EXPORT)
     @GetMapping("/healthExport")
     public AjaxResult export1(FsStoreOrderParam param) {
+        // 将逗号分隔的字符串转换为 List
+        List<String> orderSourceList = null;
+        if (StringUtils.isNotBlank(param.getOrderSource())) {
+            orderSourceList = Arrays.asList(param.getOrderSource().split(","));
+            param.setOrderSources(orderSourceList);
+        }
         if (param.getBeginTime().equals("") && param.getEndTime().equals("")){
             param.setBeginTime(null);
             param.setEndTime(null);
@@ -113,7 +126,6 @@ public class FsStoreHealthOrderController extends BaseController {
                 if (vo.getUserPhone() != null) {
                     vo.setUserPhone(vo.getUserPhone().replaceAll("(\\d{3})\\d*(\\d{4})", "$1****$2"));
                 }
-
             }
         }
         ExcelUtil<FsStoreOrderExportVO> util = new ExcelUtil<FsStoreOrderExportVO>(FsStoreOrderExportVO.class);

+ 7 - 0
fs-admin/src/main/java/com/fs/store/controller/FsStoreOrderController.java

@@ -1,6 +1,7 @@
 package com.fs.store.controller;
 
 import java.util.ArrayList;
+import java.util.Arrays;
 import java.util.List;
 
 import cn.hutool.core.bean.BeanUtil;
@@ -98,6 +99,12 @@ public class FsStoreOrderController extends BaseController {
     @GetMapping("/list")
     public TableDataInfo list(FsStoreOrderParam param) {
         startPage();
+        // 将逗号分隔的字符串转换为 List
+        List<String> orderSourceList = null;
+        if (StringUtils.isNotBlank(param.getOrderSource())) {
+            orderSourceList = Arrays.asList(param.getOrderSource().split(","));
+            param.setOrderSources(orderSourceList);
+        }
         if(!StringUtils.isEmpty(param.getCreateTimeRange())){
             param.setCreateTimeList(param.getCreateTimeRange().split("--"));
         }

+ 1 - 1
fs-service-system/src/main/java/com/fs/store/mapper/FsStorePaymentMapper.java

@@ -391,6 +391,6 @@ public interface FsStorePaymentMapper
     List<FsStorePayment> queryByBankTrxId(@Param("list") List<String> bankTrxIds);
 
     @MapKey("orderId")
-    @Select("select order_id,bank_transaction_id from fs_store_payment where bank_transaction_id is not null")
+    @Select("select order_id,bank_transaction_id,app_id from fs_store_payment where bank_transaction_id is not null")
     Map<Long,FsStorePayment> selectAllPayments();
 }

+ 6 - 0
fs-service-system/src/main/java/com/fs/store/param/FsStoreOrderParam.java

@@ -5,6 +5,7 @@ import com.fs.common.core.domain.BaseEntity;
 import lombok.Data;
 
 import java.io.Serializable;
+import java.util.List;
 
 @Data
 public class FsStoreOrderParam extends BaseEntity implements Serializable
@@ -85,6 +86,11 @@ public class FsStoreOrderParam extends BaseEntity implements Serializable
      */
     private String orderSource;
 
+    /**
+     * 多个订单来源
+     */
+    private List<String> orderSources;
+
     private String orderVisit;
 
 }

+ 4 - 0
fs-service-system/src/main/java/com/fs/store/service/impl/FsStoreOrderServiceImpl.java

@@ -2708,6 +2708,10 @@ public class FsStoreOrderServiceImpl implements IFsStoreOrderService
             FsStorePayment fsStorePayment = paymentMap.get(item.getId());
             if(ObjectUtil.isNotNull(fsStorePayment)){
                 item.setBankTrxId(fsStorePayment.getBankTransactionId());
+                FsCoursePlaySourceConfig fsCoursePlaySourceConfig = fsCoursePlaySourceConfigMapper.selectFsCoursePlaySourceConfigByAppId(fsStorePayment.getAppId());
+                if(ObjectUtil.isNotEmpty(fsCoursePlaySourceConfig)){
+                    item.setOrderSource(fsCoursePlaySourceConfig.getName());
+                }
             }
         }
         return fsStoreOrderExportVOS;

+ 5 - 1
fs-service-system/src/main/java/com/fs/store/vo/FsStoreOrderExportVO.java

@@ -265,6 +265,10 @@ public class FsStoreOrderExportVO implements Serializable
 
     @Excel(name = "归属档期")
     private String scheduleName;
-
+    /**
+     * appId 订单来源
+     */
+    @Excel(name = "订单来源")
+    private String orderSource;
 
 }

+ 6 - 3
fs-service-system/src/main/resources/mapper/store/FsStoreOrderMapper.xml

@@ -577,7 +577,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             left join fs_store_order_item oi on o.id = oi.order_id
             left join fs_store_product fsp on fsp.product_id = oi.product_id
         </if>
-        <if test = 'maps.orderSource != null and  maps.orderSource !=  "" '>
+        <if test="maps.orderSources != null and maps.orderSources.size() > 0">
             left join fs_store_payment sp on o.id = sp.order_id
         </if>
 
@@ -603,8 +603,11 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test = 'maps.phone != null and  maps.phone !=""     '>
                 and u.phone like CONCAT(#{maps.phone},'%')
             </if>
-            <if test = 'maps.orderSource != null and  maps.orderSource !=  "" '>
-                and sp.app_id =#{maps.orderSource}
+            <if test="maps.orderSources != null and maps.orderSources.size() > 0">
+                and sp.app_id in
+                <foreach collection="maps.orderSources" item="item" open="(" separator="," close=")">
+                    #{item}
+                </foreach>
             </if>
             <if test = 'maps.userPhone != null and  maps.userPhone !=""     '>
                 and o.user_phone like CONCAT(#{maps.userPhone},'%')