Jelajahi Sumber

FEAT: 直播订单导出修改

xdd 19 jam lalu
induk
melakukan
f30783a312

+ 4 - 0
fs-company/src/main/java/com/fs/company/controller/live/LiveAfterSalesController.java

@@ -1,6 +1,7 @@
 package com.fs.company.controller.live;
 
 import com.fs.common.annotation.Log;
+import com.fs.common.config.LoginContextManager;
 import com.fs.common.core.controller.BaseController;
 import com.fs.common.core.domain.AjaxResult;
 import com.fs.common.core.domain.R;
@@ -55,6 +56,7 @@ public class LiveAfterSalesController extends BaseController
     public TableDataInfo list(LiveAfterSalesVo liveAfterSales)
     {
         startPage();
+        liveAfterSales.setCompanyId(LoginContextManager.getCurrentCompanyId());
         List<LiveAfterSalesVo> list = liveAfterSalesService.selectLiveAfterSalesVoList(liveAfterSales);
         for (LiveAfterSalesVo liveAfterSalesVo : list) {
             liveAfterSalesVo.setUserPhone(ParseUtils.parsePhone(liveAfterSalesVo.getUserPhone()));
@@ -70,6 +72,8 @@ public class LiveAfterSalesController extends BaseController
     @GetMapping("/export")
     public AjaxResult export(LiveAfterSalesVo liveAfterSales)
     {
+        liveAfterSales.setCompanyId(LoginContextManager.getCurrentCompanyId());
+
         PageHelper.startPage(1, 10000, "");
         List<LiveAfterSalesVo> list = liveAfterSalesService.selectLiveAfterSalesVoList(liveAfterSales);
         for (LiveAfterSalesVo liveAfterSalesVo : list) {

+ 4 - 2
fs-company/src/main/java/com/fs/company/controller/live/LiveOrderController.java

@@ -2,6 +2,7 @@ package com.fs.company.controller.live;
 
 import cn.hutool.core.util.StrUtil;
 import com.fs.common.annotation.Log;
+import com.fs.common.config.LoginContextManager;
 import com.fs.common.core.controller.BaseController;
 import com.fs.common.core.domain.AjaxResult;
 import com.fs.common.core.domain.R;
@@ -188,9 +189,9 @@ public class LiveOrderController extends BaseController
     @GetMapping("/list")
     public TableDataInfo list(LiveOrderQueryVO liveOrder)
     {
+        logger.info("查询订单列表: {}",liveOrder);
         startPage();
-        Long companyId = SecurityUtils.getLoginUser().getCompany().getCompanyId();
-        liveOrder.setCompanyId(companyId);
+        liveOrder.setCompanyId(LoginContextManager.getCurrentCompanyId());
         List<LiveOrder> list = liveOrderService.selectLiveOrderList(liveOrder);
         for (LiveOrder vo : list){
             vo.setUserPhone(ParseUtils.parsePhone(vo.getUserPhone()));
@@ -207,6 +208,7 @@ public class LiveOrderController extends BaseController
     @GetMapping("/export")
     public AjaxResult export(LiveOrderQueryVO liveOrder)
     {
+        liveOrder.setCompanyId(LoginContextManager.getCurrentCompanyId());
         List<LiveOrder> list = liveOrderService.selectLiveOrderListExport(liveOrder);
         for (LiveOrder order : list) {
             order.setUserPhone(ParseUtils.parsePhone(order.getUserPhone()));

+ 21 - 1
fs-service-system/src/main/java/com/fs/live/service/impl/LiveOrderPaymentServiceImpl.java

@@ -10,14 +10,19 @@ import com.fs.live.mapper.LiveOrderPaymentMapper;
 import com.fs.live.service.ILiveOrderPaymentService;
 import com.fs.live.service.ILiveOrderService;
 import com.fs.live.vo.LiveOrderPaymentVo;
+import com.fs.store.domain.FsStoreProduct;
+import com.fs.store.mapper.FsStoreProductMapper;
 import lombok.extern.slf4j.Slf4j;
 import org.checkerframework.checker.units.qual.A;
+import org.mybatis.spring.boot.autoconfigure.MybatisAutoConfiguration;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
+import org.springframework.util.ObjectUtils;
 
 import java.text.SimpleDateFormat;
 import java.util.Collections;
 import java.util.List;
+import java.util.Map;
 
 /**
  * 支付明细Service业务层处理
@@ -30,6 +35,8 @@ import java.util.List;
 public class LiveOrderPaymentServiceImpl implements ILiveOrderPaymentService {
     @Autowired
     private LiveOrderPaymentMapper baseMapper;
+    @Autowired
+    private MybatisAutoConfiguration.MapperScannerRegistrarNotFoundConfiguration mapperScannerRegistrarNotFoundConfiguration;
 
     /**
      * 查询支付明细
@@ -55,9 +62,22 @@ public class LiveOrderPaymentServiceImpl implements ILiveOrderPaymentService {
         return baseMapper.selectLiveOrderPaymentList(liveOrderPayment);
     }
 
+    @Autowired
+    private FsStoreProductMapper fsStoreProductMapper;
     @Override
     public List<LiveOrderPaymentVo> selectLiveOrderPaymentVoList(LiveOrderPaymentVo liveOrderPayment) {
-        return baseMapper.selectLiveOrderPaymentVoList(liveOrderPayment);
+        Map<Long, FsStoreProduct> productMap = fsStoreProductMapper.selectAllProductName();
+        List<LiveOrderPaymentVo> liveOrderPaymentVos = baseMapper.selectLiveOrderPaymentVoList(liveOrderPayment);
+
+        for (LiveOrderPaymentVo vo : liveOrderPaymentVos) {
+            if(ObjectUtils.isEmpty(vo.getProductId())){
+                FsStoreProduct fsStoreProduct = productMap.get(vo.getProductId());
+                if(fsStoreProduct != null){
+                    vo.setPackageTitle(fsStoreProduct.getProductName());
+                }
+            }
+        }
+        return liveOrderPaymentVos;
     }
 
     @Override

+ 52 - 41
fs-service-system/src/main/java/com/fs/live/vo/LiveOrderPaymentVo.java

@@ -23,37 +23,45 @@ public class LiveOrderPaymentVo extends BaseEntity{
     private Long paymentId;
 
     /** 支付订单号 */
-    @Excel(name = "付款单号")
+    @Excel(name = "支付订单号")
     private String payCode;
 
+    @Excel(name = "会员手机号")
+    private String userPhone;
+    /** 支付类型 weixin alipay */
+    @Excel(name = "支付类型 weixin alipay")
+    private String payTypeCode;
 
-    /** 关联业务编号 */
-    @Excel(name = "订单号")
-    private String businessCode;
 
-//    @Excel(name = "付款单号")
-    private Integer orderCode;
+    /** 支付金额 */
+    @Excel(name = "支付金额")
+    private BigDecimal payMoney;
+
+    /** 支付时间 */
+    @JsonFormat(pattern = "yyyy-MM-dd")
+    @Excel(name = "支付时间", width = 30, dateFormat = "yyyy-MM-dd  HH:mm:ss")
+    private Date payTime;
 
     /** 外部订单号 */
     @Excel(name = "外部订单号")
     private String tradeNo;
 
+    /** 状态 0未支付 1已支付 -1 已退款 */
+    @Excel(name = "支付状态 0未支付 1已支付 -1 已退款",readConverterExp = "0=未支付,1=已支付,-1=已退款")
+    private Integer status;
 
+    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
+    @Excel(name = "下单时间", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss")
+    private Date createTime;
 
-    @Excel(name = "会员手机号")
-    private String userPhone;
+    /** 备注 */
+    @Excel(name = "备注")
+    private String mark;
 
-    /** 支付类型 weixin alipay */
-    @Excel(name = "支付类型 weixin alipay")
-    private String payTypeCode;
 
-    /** 支付金额 */
-    @Excel(name = "支付金额")
-    private BigDecimal payMoney;
 
-    /** 退款金额 */
-    @Excel(name = "退款金额")
-    private BigDecimal refundMoney;
+//    @Excel(name = "付款单号")
+    private Integer orderCode;
 
     /** 交易单号 */
     @Excel(name = "交易单号")
@@ -63,40 +71,43 @@ public class LiveOrderPaymentVo extends BaseEntity{
     @Excel(name = "银行单号")
     private String bankSerialNo;
 
+    /** 退款金额 */
+    @Excel(name = "退款金额")
+    private BigDecimal refundMoney;
 
-    @Excel(name = "所属公司")
-    private String companyName;
-
-    @Excel(name = "所属部门")
-    private String deptName;
-
-    @Excel(name = "员工")
-    private String companyUserNickName;
-
-    /** 状态 0未支付 1已支付 -1 已退款 */
-    @Excel(name = "状态",readConverterExp = "0=未支付,1=已支付,-1=已退款")
-    private Integer status;
-
-    /** 支付方式: zb tz wx */
-    @Excel(name = "支付方式",dictType = "sys_pay_mode")
-    private String payMode;
+    /** 退款时间 */
+    @JsonFormat(pattern = "yyyy-MM-dd")
+    @Excel(name = "退款时间", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss")
+    private Date refundTime;
 
 
+    @Excel(name = "公司名称")
+    private String companyName;
 
+    @Excel(name = "部门")
+    private String deptName;
 
+    @Excel(name = "销售帐号")
+    private String companyUserName;
 
-    /** 支付时间 */
-    @JsonFormat(pattern = "yyyy-MM-dd")
-    @Excel(name = "支付时间", width = 30, dateFormat = "yyyy-MM-dd  HH:mm:ss")
-    private Date payTime;
+    @Excel(name = "销售姓名")
+    private String companyUserNickName;
 
 
-    /** 退款时间 */
-    @JsonFormat(pattern = "yyyy-MM-dd")
-    @Excel(name = "退款时间", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss")
-    private Date refundTime;
+    /** 关联业务编号 */
+    @Excel(name = "商城订单号")
+    private String businessCode;
 
+    /**
+     * 产品名称
+     */
+    private Long productId;
+    @Excel(name = "产品名称",width = 60)
+    private String packageTitle;
 
+    /** 支付方式: zb tz wx */
+    @Excel(name = "服务商类型",dictType = "sys_pay_mode")
+    private String payMode;
 
     /** 用户ID */
 //    @Excel(name = "用户ID")

+ 16 - 2
fs-service-system/src/main/java/com/fs/live/vo/LiveOrderQueryVO.java

@@ -101,6 +101,16 @@ public class LiveOrderQueryVO extends BaseEntity {
     @Excel(name = "支付时间", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss")
     private Date payTime;
 
+    /**
+     * 支付开始时间
+     */
+    private String payTimeStart;
+    /**
+     * 支付结束时间
+     */
+    private String payTimeEnd;
+
+
     /** 支付方式 1微信 */
     @Excel(name = "支付方式", readConverterExp = "微信=1")
     private String payType;
@@ -253,9 +263,13 @@ public class LiveOrderQueryVO extends BaseEntity {
 //    @Excel(name = "结束时间", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss")
     private Date finishTime;
 
-    // 完成时间-开始
+    /**
+     * 完成时间-开始
+     */
     private String finishTimeStart;
-    // 完成时间-结束
+    /**
+     * 完成时间-结束
+     */
     private String finishTimeEnd;
 
 

+ 4 - 0
fs-service-system/src/main/java/com/fs/store/mapper/FsStoreProductMapper.java

@@ -248,4 +248,8 @@ public interface FsStoreProductMapper
             " left join fs_warehouses fw " +
             " on sp.warehouse_code=fw.warehouse_code ")
     Map<Long, FsStoreProduct> selectAllProductMappingInfoLiveOrder();
+
+    @Select("select product_id,product_name from fs_store_product")
+    @MapKey("productId")
+    Map<Long, FsStoreProduct> selectAllProductName();
 }

+ 9 - 7
fs-service-system/src/main/resources/mapper/live/LiveOrderMapper.xml

@@ -115,8 +115,6 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         left join company_user cu on a.company_user_id = cu.user_id
         left join company c on a.company_id = c.company_id
         <where>
-            <if test="finishTimeStart != null and finishTimeEnd != null">and finish_time between #{finishTimeStart} and #{finishTimeEnd}</if>
-            <if test="payStartTime != null and payEndTime != null">and pay_time between #{payStartTime} and #{payEndTime}</if>
             <if test="liveId != null "> and live_id = #{liveId}</if>
             <if test="storeId != null "> and store_id = #{storeId}</if>
             <if test="orderCode != null  and orderCode != ''"> and a.order_code = #{orderCode}</if>
@@ -147,7 +145,6 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="verifyCode != null  and verifyCode != ''"> and verify_code = #{verifyCode}</if>
             <if test="shippingType != null "> and shipping_type = #{shippingType}</if>
             <if test="isChannel != null  and isChannel != ''"> and is_channel = #{isChannel}</if>
-            <if test="finishTime != null ">and a.finish_time >= #{finishTime} and a.finish_time &lt; date_add(#{finishTime}, interval 1 day)</if>
             <if test="deliveryTime != null  and deliveryTime != ''"> and a.delivery_time = #{deliveryTime}</if>
             <if test="tuiMoney != null "> and tui_money = #{tuiMoney}</if>
             <if test="tuiMoneyStatus != null "> and tui_money_status = #{tuiMoneyStatus}</if>
@@ -167,9 +164,14 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="deliveryType != null  and deliveryType != ''"> and delivery_type = #{deliveryType}</if>
             <if test="deliveryPayMoney != null "> and delivery_pay_money = #{deliveryPayMoney}</if>
             <if test="deliveryImportTime != null "> and delivery_import_time = #{deliveryImportTime}</if>
-            <if test="deliverySendTime != null "> and delivery_send_time = #{deliverySendTime}</if>
-            <if test="deliverySendTimeStart != null and deliverySendTimeEnd !=null ">
-                   and delivery_send_time between #{deliverySendTimeStart} and #{deliverySendTimeStart}
+            <if test="deliverySendTimeStart != null and deliverySendTimeEnd != null and deliverySendTimeStart != '' and deliverySendTimeEnd!= ''">
+                and a.delivery_send_time between CONCAT(#{deliverySendTimeStart}, ' 00:00:00') and CONCAT(#{deliverySendTimeEnd}, ' 23:59:59')
+            </if>
+            <if test="payTimeStart != null and payTimeEnd != null and payTimeStart!='' and payTimeEnd!=''">
+                and a.pay_time between CONCAT(#{payTimeStart}, ' 00:00:00') and CONCAT(#{payTimeEnd}, ' 23:59:59')
+            </if>
+            <if test="finishTimeStart != null and finishTimeEnd != null and finishTimeStart != '' and finishTimeEnd!=''">
+                and a.finish_time between CONCAT(#{finishTimeStart}, ' 00:00:00') and CONCAT(#{finishTimeEnd}, ' 23:59:59')
             </if>
             <if test="isAfterSales != null "> and is_after_sales = #{isAfterSales}</if>
             <if test="deptId != null "> and cu.dept_id = #{deptId}</if>
@@ -184,7 +186,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="backIntegral != null "> and back_integral = #{backIntegral}</if>
             <if test="isEditMoney != null "> and is_edit_money = #{isEditMoney}</if>
             <if test="orderName != null "> and order_name = #{orderName}</if>
-            <if test="companyUserName != null "> and cu.user_name like concat(#{companyUserName},'%')</if>
+            <if test="companyUserName != null and companyUserName != ''"> and cu.user_name like concat(#{companyUserName},'%')</if>
         </where>
         order by a.create_time desc
     </select>

+ 2 - 2
fs-service-system/src/main/resources/mapper/live/LiveOrderPaymentMapper.xml

@@ -68,13 +68,13 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
     <select id="selectLiveOrderPaymentVoList" parameterType="com.fs.live.vo.LiveOrderPaymentVo" resultType="com.fs.live.vo.LiveOrderPaymentVo">
         select lop.payment_id, lop.pay_code, lop.pay_type_code, lop.pay_money, lop.pay_time, lop.create_time, lop.trade_no, lop.user_id, lop.open_id, lop.business_type, lop.business_id as order_code,
         lop.status, lop.remark, lop.bank_transaction_id, lop.bank_serial_no, lop.refund_money, lop.refund_time, lop.store_id, lo.company_id, lo.company_user_id, lop.business_code,
-        lop.pay_mode, lop.share_status, lop.share_code, lop.share_money, lop.is_share, lo.user_phone,c.company_name as company_name, cde.dept_name as dept_name,cu.nick_name as company_user_nick_name
+        lop.pay_mode, lop.share_status, lop.share_code, lop.share_money, lop.is_share, lo.user_phone,c.company_name as company_name, cde.dept_name as dept_name,cu.nick_name as company_user_nick_name,
+        cu.user_name as company_user_name, lo.product_id as product_id
         from live_order_payment lop
         left join live_order lo on lop.business_id = lo.order_id
         left join company_user cu on lo.company_user_id = cu.user_id
         left join company c on lo.company_id = c.company_id
         left join company_dept cde  on cde.dept_id = cu.dept_id
-
         <where>
             <if test="payCode != null  and payCode != ''"> and lop.pay_code = #{payCode}</if>
             <if test="payTypeCode != null  and payTypeCode != ''"> and lop.pay_type_code = #{payTypeCode}</if>