Procházet zdrojové kódy

直播订单数据,直播优惠券

yuhongqi před 1 týdnem
rodič
revize
fe622c7f8b
22 změnil soubory, kde provedl 837 přidání a 8 odebrání
  1. 4 0
      fs-admin/src/main/java/com/fs/live/controller/LiveCouponController.java
  2. 31 4
      fs-admin/src/main/java/com/fs/live/controller/LiveOrderController.java
  3. 4 0
      fs-company/src/main/java/com/fs/company/controller/live/LiveCouponController.java
  4. 28 0
      fs-company/src/main/java/com/fs/company/controller/live/LiveOrderController.java
  5. 5 0
      fs-service/src/main/java/com/fs/his/domain/FsUser.java
  6. 9 0
      fs-service/src/main/java/com/fs/his/mapper/FsUserMapper.java
  7. 4 0
      fs-service/src/main/java/com/fs/live/domain/LiveCouponIssue.java
  8. 9 0
      fs-service/src/main/java/com/fs/live/domain/LiveOrder.java
  9. 85 0
      fs-service/src/main/java/com/fs/live/dto/LiveOrderCustomerExportDTO.java
  10. 1 1
      fs-service/src/main/java/com/fs/live/mapper/LiveCouponUserMapper.java
  11. 1 1
      fs-service/src/main/java/com/fs/live/mapper/LiveGoodsMapper.java
  12. 3 0
      fs-service/src/main/java/com/fs/live/mapper/LiveOrderMapper.java
  13. 3 0
      fs-service/src/main/java/com/fs/live/service/ILiveOrderService.java
  14. 10 1
      fs-service/src/main/java/com/fs/live/service/impl/LiveCouponServiceImpl.java
  15. 8 0
      fs-service/src/main/java/com/fs/live/service/impl/LiveOrderServiceImpl.java
  16. 17 0
      fs-service/src/main/java/com/fs/live/service/impl/LiveServiceImpl.java
  17. 1 0
      fs-service/src/main/java/com/fs/live/vo/LiveDataListVo.java
  18. 1 0
      fs-service/src/main/java/com/fs/live/vo/LiveDataStatisticsVo.java
  19. 467 0
      fs-service/src/main/java/com/fs/live/vo/LiveOrderVoZm.java
  20. 1 1
      fs-service/src/main/resources/application-config-druid-bjzm.yml
  21. 4 0
      fs-service/src/main/resources/mapper/live/LiveCouponIssueMapper.xml
  22. 141 0
      fs-service/src/main/resources/mapper/live/LiveOrderMapper.xml

+ 4 - 0
fs-admin/src/main/java/com/fs/live/controller/LiveCouponController.java

@@ -122,6 +122,8 @@ public class LiveCouponController extends BaseController
         issue.setIsPermanent(0);
         issue.setStatus(1);
         issue.setCreateTime(new Date());
+        // 继承优惠券的领取上限字段
+        issue.setLimitReceiveCount(coupon.getLimitReceiveCount());
         return toAjax( liveCouponIssueService.insertLiveCouponIssue(issue));
     }
 
@@ -143,6 +145,8 @@ public class LiveCouponController extends BaseController
             issue.setIsPermanent(0);
             issue.setStatus(1);
             issue.setCreateTime(new Date());
+            // 继承优惠券的领取上限字段
+            issue.setLimitReceiveCount(coupon.getLimitReceiveCount());
             liveCouponIssueService.insertLiveCouponIssue(issue);
         }
         return R.ok();

+ 31 - 4
fs-admin/src/main/java/com/fs/live/controller/LiveOrderController.java

@@ -34,14 +34,12 @@ import com.fs.hisStore.dto.StoreOrderExpressExportDTO;
 import com.fs.hisStore.param.*;
 import com.fs.hisStore.vo.FsStoreOrderVO;
 import com.fs.live.domain.*;
+import com.fs.live.dto.LiveOrderCustomerExportDTO;
 import com.fs.live.dto.LiveOrderExpressExportDTO;
 import com.fs.live.enums.LiveOrderCancleReason;
 import com.fs.live.param.LiveOrderScrmSetErpPhoneParam;
 import com.fs.live.service.*;
-import com.fs.live.vo.LiveGoodsVo;
-import com.fs.live.vo.LiveOrderPaymentVo;
-import com.fs.live.vo.LiveOrderTimeVo;
-import com.fs.live.vo.LiveOrderVO;
+import com.fs.live.vo.*;
 import com.fs.store.domain.FsStoreDelivers;
 import com.fs.system.domain.SysConfig;
 import com.fs.system.mapper.SysConfigMapper;
@@ -144,6 +142,35 @@ public class LiveOrderController extends BaseController
         return util.exportExcel(list, "订单数据");
     }
 
+    /**
+     * 查询订单列表
+     */
+    @PreAuthorize("@ss.hasPermi('live:liveOrder:list')")
+    @GetMapping("/listZm")
+    public TableDataInfo listZm(LiveOrder liveOrder)
+    {
+        startPage();
+        List<LiveOrderVoZm> list = liveOrderService.selectLiveOrderListZm(liveOrder);
+        for (LiveOrderVoZm vo : list){
+            vo.setUserPhone(ParseUtils.parsePhone(vo.getUserPhone()));
+        }
+        return getDataTable(list);
+    }
+
+    /**
+     * 导出订单列表
+     */
+    @PreAuthorize("@ss.hasPermi('live:liveOrder:export')")
+    @Log(title = "订单", businessType = BusinessType.EXPORT)
+    @GetMapping("/exportZm")
+    public AjaxResult exportZm(LiveOrder liveOrder)
+    {
+        List<LiveOrderVoZm> list = liveOrderService.selectLiveOrderListZm(liveOrder);
+        ExcelUtil<LiveOrderVoZm> util = new ExcelUtil<LiveOrderVoZm>(LiveOrderVoZm.class);
+        return util.exportExcel(list, "订单数据");
+    }
+
+
     /**
      * 获取订单详细信息
      */

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

@@ -122,6 +122,8 @@ public class LiveCouponController extends BaseController
         issue.setIsPermanent(0);
         issue.setStatus(1);
         issue.setCreateTime(new Date());
+        // 继承优惠券的领取上限字段
+        issue.setLimitReceiveCount(coupon.getLimitReceiveCount());
         return toAjax( liveCouponIssueService.insertLiveCouponIssue(issue));
     }
 
@@ -143,6 +145,8 @@ public class LiveCouponController extends BaseController
             issue.setIsPermanent(0);
             issue.setStatus(1);
             issue.setCreateTime(new Date());
+            // 继承优惠券的领取上限字段
+            issue.setLimitReceiveCount(coupon.getLimitReceiveCount());
             liveCouponIssueService.insertLiveCouponIssue(issue);
         }
         return R.ok();

+ 28 - 0
fs-company/src/main/java/com/fs/company/controller/live/LiveOrderController.java

@@ -109,6 +109,34 @@ public class LiveOrderController extends BaseController
         return R.ok().put("payments",payments);
     }
 
+    /**
+     * 查询订单列表
+     */
+    @PreAuthorize("@ss.hasPermi('live:liveOrder:list')")
+    @GetMapping("/listZm")
+    public TableDataInfo listZm(LiveOrder liveOrder)
+    {
+        startPage();
+        List<LiveOrder> list = liveOrderService.selectLiveOrderList(liveOrder);
+        for (LiveOrder vo : list){
+            vo.setUserPhone(ParseUtils.parsePhone(vo.getUserPhone()));
+        }
+        return getDataTable(list);
+    }
+
+    /**
+     * 导出订单列表
+     */
+    @PreAuthorize("@ss.hasPermi('live:liveOrder:export')")
+    @Log(title = "订单", businessType = BusinessType.EXPORT)
+    @GetMapping("/exportZm")
+    public AjaxResult exportZm(LiveOrder liveOrder)
+    {
+        List<LiveOrder> list = liveOrderService.selectLiveOrderList(liveOrder);
+        ExcelUtil<LiveOrder> util = new ExcelUtil<LiveOrder>(LiveOrder.class);
+        return util.exportExcel(list, "订单数据");
+    }
+
 
 //    @Log(title = "订单凭证上传", businessType = BusinessType.UPDATE)
 ////    @PreAuthorize("@ss.hasPermi('live:liveOrder:uploadCredentials')")

+ 5 - 0
fs-service/src/main/java/com/fs/his/domain/FsUser.java

@@ -155,6 +155,11 @@ public class FsUser extends BaseEntity
 
     /** 下单次数 */
     private Long orderCount;
+
+    /** 累计成交总额 */
+    @Excel(name = "累计成交总额")
+    private BigDecimal totalAmount;
+
     /**
      * 企微销售ID
      * **/

+ 9 - 0
fs-service/src/main/java/com/fs/his/mapper/FsUserMapper.java

@@ -1,5 +1,6 @@
 package com.fs.his.mapper;
 
+import java.math.BigDecimal;
 import java.util.List;
 import java.util.Map;
 
@@ -456,4 +457,12 @@ public interface FsUserMapper
     @Update("update fs_user set pay_count=pay_count+1" +
             " where user_id=#{userId}")
     void incPayCount(Long aLong);
+
+    /**
+     * 更新用户下单次数和累计成交总额
+     * @param userId 用户ID
+     * @param amount 成交金额
+     */
+    @Update("update fs_user set order_count = order_count + 1, total_amount = IFNULL(total_amount, 0) + #{amount} where user_id = #{userId}")
+    void updateUserOrderCountAndAmount(@Param("userId") Long userId, @Param("amount") BigDecimal amount);
 }

+ 4 - 0
fs-service/src/main/java/com/fs/live/domain/LiveCouponIssue.java

@@ -69,4 +69,8 @@ public class LiveCouponIssue extends BaseEntity
     private BigDecimal useMinPrice;
     private Long couponTime;
 
+    /** 限制领取次数(针对无门槛优惠券,每个用户可以领取的最大张数) */
+    @Excel(name = "限制领取次数")
+    private Integer limitReceiveCount;
+
 }

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

@@ -335,6 +335,15 @@ public class LiveOrder extends BaseEntity {
 
     /** 优惠券金额 */
     private BigDecimal couponPrice;
+    // 卓美新增筛选条件
+    private String productName;
+    private String productSpec;
+    private String productNum;
+    private Date createTimeStart;
+    private Date createTimeEnd;
+
+    private Integer price;
+    private Integer cost;
 
 
 }

+ 85 - 0
fs-service/src/main/java/com/fs/live/dto/LiveOrderCustomerExportDTO.java

@@ -0,0 +1,85 @@
+package com.fs.live.dto;
+
+import com.fasterxml.jackson.annotation.JsonFormat;
+import com.fs.common.annotation.Excel;
+import lombok.Data;
+
+import java.math.BigDecimal;
+import java.util.Date;
+
+/**
+ * 直播订单客户导出DTO
+ * 
+ * @author fs
+ * @date 2025-11-13
+ */
+@Data
+public class LiveOrderCustomerExportDTO {
+
+    /** 销售id */
+    @Excel(name = "销售ID")
+    private Long companyUserId;
+
+    /** 绑定销售昵称 */
+    @Excel(name = "销售昵称")
+    private String companyUserNickName;
+
+    /** 客户编码 */
+    @Excel(name = "客户编码")
+    private String customerCode;
+
+    /** 会员等级 */
+    @Excel(name = "会员等级")
+    private Integer userLevel;
+
+    /** 销售绑定手机号 */
+    @Excel(name = "销售手机号")
+    private String companyUserPhone;
+
+    /** 销售创建时间 */
+    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
+    @Excel(name = "销售创建时间", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss")
+    private Date companyUserCreateTime;
+
+    /** 客户id */
+    @Excel(name = "客户ID")
+    private Long userId;
+
+    /** 客户昵称 */
+    @Excel(name = "客户昵称")
+    private String nickName;
+
+    /** 客户绑定手机号 */
+    @Excel(name = "客户手机号")
+    private String userPhone;
+
+    /** 收货手机号 */
+    @Excel(name = "收货手机号")
+    private String receivePhone;
+
+    /** 累计成交笔数 */
+    @Excel(name = "累计成交笔数")
+    private Long totalOrderCount;
+
+    /** 累计成交总额 */
+    @Excel(name = "累计成交总额", cellType = Excel.ColumnType.NUMERIC)
+    private BigDecimal totalOrderAmount;
+
+    /** 最新绑定时间 */
+    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
+    @Excel(name = "最新绑定时间", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss")
+    private Date latestBindTime;
+
+    /** 客户状态 */
+    @Excel(name = "客户状态", dictType = "user_status")
+    private Integer userStatus;
+
+    /** 所属店铺 */
+    @Excel(name = "所属店铺ID")
+    private Long storeId;
+
+    /** 所属店铺名称 */
+    @Excel(name = "所属店铺名称")
+    private String storeName;
+}
+

+ 1 - 1
fs-service/src/main/java/com/fs/live/mapper/LiveCouponUserMapper.java

@@ -68,7 +68,7 @@ public interface LiveCouponUserMapper
     @Select("<script>" +
             "select lcu.* from live_coupon_user lcu where lcu.user_id= #{coupon.userId} " +
             " <if test='coupon.goodsId != null'>" +
-            " and lcu.goods_id= #{coupon.goodsId}" +
+            " and (lcu.goods_id= #{coupon.goodsId} or lcu.goods_id is null or lcu.goods_id = 0)" +
             " </if>" +
             "</script>")
     List<LiveCouponUser> curCoupon(@Param("coupon") CouponPO coupon);

+ 1 - 1
fs-service/src/main/java/com/fs/live/mapper/LiveGoodsMapper.java

@@ -155,6 +155,6 @@ public interface LiveGoodsMapper {
      * @param goodsId 商品ID
      * @param status 状态:1-上架 0-下架
      */
-    @Update("update live_goods set is_show = #{status} where goods_id = #{goodsId}")
+    @Update("update live_goods set status = #{status} where goods_id = #{goodsId}")
     void updateLiveGoodsStatus(@Param("goodsId") Long goodsId, @Param("status") Integer status);
 }

+ 3 - 0
fs-service/src/main/java/com/fs/live/mapper/LiveOrderMapper.java

@@ -421,4 +421,7 @@ public interface LiveOrderMapper {
             "where o.user_id=#{userId}  and o.status =#{status} " +
             "</script>"})
     Integer selectLiveOrderCount(long userId, int status);
+
+
+    List<LiveOrderVoZm> selectLiveOrderListZm(LiveOrder liveOrder);
 }

+ 3 - 0
fs-service/src/main/java/com/fs/live/service/ILiveOrderService.java

@@ -231,4 +231,7 @@ public interface ILiveOrderService {
     Integer selectFsStoreOrderCount(long l, int i);
 
     R payConfirmReward(LiveOrder liveOrder);
+
+
+    List<LiveOrderVoZm> selectLiveOrderListZm(LiveOrder liveOrder);
 }

+ 10 - 1
fs-service/src/main/java/com/fs/live/service/impl/LiveCouponServiceImpl.java

@@ -170,7 +170,16 @@ public class LiveCouponServiceImpl implements ILiveCouponService
         }
         Long couponId = Long.valueOf(payload.get("couponId").toString());
         LiveCouponIssueRelation liveCouponIssueRelation = liveCouponMapper.selectRelation(liveId,couponId);
-        if(ObjectUtil.isEmpty(liveCouponIssueRelation.getGoodsId())) return R.error("未绑定商品,无法发布!");
+
+        // 查询优惠券类型
+        LiveCoupon liveCoupon = liveCouponMapper.selectLiveCouponById(couponId);
+        boolean isNoThresholdCoupon = liveCoupon != null && liveCoupon.getType() != null && liveCoupon.getType() == 3L;
+
+        // 如果不是无门槛优惠券,需要检查是否绑定了商品
+        if (!isNoThresholdCoupon && ObjectUtil.isEmpty(liveCouponIssueRelation.getGoodsId())) {
+            return R.error("未绑定商品,无法发布!");
+        }
+
         liveCouponMapper.updateShow(liveId, couponId, isShow ? 1 : 0);
         return R.ok("操作成功");
     }

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

@@ -77,6 +77,7 @@ import com.fs.hisStore.vo.FsStoreOrderItemVO;
 import com.fs.hisStore.vo.FsStoreOrderVO;
 import com.fs.live.domain.*;
 import com.fs.live.dto.LiveOrderComputeDTO;
+import com.fs.live.dto.LiveOrderCustomerExportDTO;
 import com.fs.live.dto.LiveOrderItemDTO;
 import com.fs.live.mapper.*;
 import com.fs.live.param.*;
@@ -2456,6 +2457,8 @@ public class LiveOrderServiceImpl implements ILiveOrderService {
             }
             //增加用户购买次数
             userMapper.incPayCount(Long.valueOf(liveOrder.getUserId()));
+            //更新用户下单次数和累计成交总额
+            userMapper.updateUserOrderCountAndAmount(Long.valueOf(liveOrder.getUserId()), liveOrder.getPayMoney());
 
             liveOrder.setStatus(2);
             liveOrder.setPayTime(LocalDateTime.now());
@@ -2475,6 +2478,11 @@ public class LiveOrderServiceImpl implements ILiveOrderService {
         }
     }
 
+    @Override
+    public List<LiveOrderVoZm> selectLiveOrderListZm(LiveOrder liveOrder) {
+        return baseMapper.selectLiveOrderListZm(liveOrder);
+    }
+
 
     @Override
     @Transactional(rollbackFor = Throwable.class,propagation = Propagation.REQUIRED)

+ 17 - 0
fs-service/src/main/java/com/fs/live/service/impl/LiveServiceImpl.java

@@ -750,6 +750,7 @@ public class LiveServiceImpl implements ILiveService
         List<LiveAutoTask> goodsTaskList = liveAutoTasksList.stream().filter(liveAutoTask -> liveAutoTask.getTaskType() == 1L).collect(Collectors.toList());
         List<LiveAutoTask> redTaskList = liveAutoTasksList.stream().filter(liveAutoTask -> liveAutoTask.getTaskType() == 2L).collect(Collectors.toList());
         List<LiveAutoTask> lotteryTaskList = liveAutoTasksList.stream().filter(liveAutoTask -> liveAutoTask.getTaskType() == 4L).collect(Collectors.toList());
+        List<LiveAutoTask> shelfTaskList = liveAutoTasksList.stream().filter(liveAutoTask -> liveAutoTask.getTaskType() == 6L).collect(Collectors.toList());
         List<LiveAutoTask> addList = new ArrayList<>();
         if (!barrageTask.isEmpty()) {
             for (LiveAutoTask liveAutoTask : barrageTask) {
@@ -868,6 +869,22 @@ public class LiveServiceImpl implements ILiveService
                 liveAutoTaskEntity.setContent(JSON.toJSONString(liveGoods));
                 liveAutoTaskService.directInsertLiveAutoTask(liveAutoTaskEntity);
 
+                // 处理上下架任务 taskType=6
+                LiveAutoTask shelfTask = shelfTaskList.stream().filter(item -> parseIdFromContent(item.getContent(), "goodsId").equals(liveGoods.getGoodsId())).findFirst().orElse(null);
+                if(shelfTask != null) {
+                    LiveAutoTask shelfAutoTaskEntity = new LiveAutoTask();
+                    BeanUtils.copyBeanProp(shelfAutoTaskEntity, shelfTask);
+                    shelfAutoTaskEntity.setId(null);
+                    shelfAutoTaskEntity.setLiveId(newLiveId);
+                    shelfAutoTaskEntity.setCreateTime(now);
+                    shelfAutoTaskEntity.setUpdateTime(now);
+                    shelfAutoTaskEntity.setFinishStatus(0L);
+                    // 更新content中的goodsId为新的goodsId
+                    JSONObject contentJson = JSON.parseObject(shelfTask.getContent());
+                    contentJson.put("goodsId", liveGoodsEntity.getGoodsId());
+                    shelfAutoTaskEntity.setContent(contentJson.toJSONString());
+                    liveAutoTaskService.directInsertLiveAutoTask(shelfAutoTaskEntity);
+                }
             }
         }
         for (LiveCouponIssueRelation liveCouponIssueRelation : liveCouponIssueRelations) {

+ 1 - 0
fs-service/src/main/java/com/fs/live/vo/LiveDataListVo.java

@@ -73,3 +73,4 @@ public class LiveDataListVo {
 
 
 
+

+ 1 - 0
fs-service/src/main/java/com/fs/live/vo/LiveDataStatisticsVo.java

@@ -54,3 +54,4 @@ public class LiveDataStatisticsVo {
 
 
 
+

+ 467 - 0
fs-service/src/main/java/com/fs/live/vo/LiveOrderVoZm.java

@@ -0,0 +1,467 @@
+package com.fs.live.vo;
+
+import com.fasterxml.jackson.annotation.JsonFormat;
+import com.fs.common.annotation.Excel;
+import com.fs.common.core.domain.BaseEntity;
+import lombok.Data;
+
+import java.math.BigDecimal;
+import java.time.LocalDateTime;
+import java.util.Date;
+
+/**
+ * 订单对象 live_order
+ *
+ * @author fs
+ * @date 2025-07-08
+ */
+@Data
+public class LiveOrderVoZm{
+
+    /** 订单ID */
+    private Long orderId;
+
+    /** 公司员工id */
+    @Excel(name = "销售id")
+    private Long companyUserId;
+
+    /** 绑定销售昵称 */
+    @Excel(name = "绑定销售昵称")
+    private String companyUserNickName;
+
+    /** 客户编码 */
+//    @Excel(name = "客户编码")
+    private String userCode;
+
+    /** 会员等级 */
+    @Excel(name = "会员等级")
+    private Integer userLevel;
+
+
+    /** 销售绑定手机号 */
+    @Excel(name = "销售手机号")
+    private String companyUserPhone;
+
+    /** 销售加入时间 */
+    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
+    @Excel(name = "销售加入时间", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss")
+    private Date companyUserCreateTime;
+
+
+    /** 用户id */
+    @Excel(name = "客户ID")
+    private String userId;
+
+    /** 客户昵称 */
+    @Excel(name = "客户昵称")
+    private String nickName;
+
+    /** 客户绑定手机号 */
+    @Excel(name = "客户手机号")
+    private String userBindPhone;
+
+    /** 收货人电话 */
+    @Excel(name = "收货手机号")
+    private String userPhone;
+
+
+    /** 累计成交笔数 */
+    @Excel(name = "累计成交笔数")
+    private Long totalOrderCount;
+
+
+
+    /** 累计成交总额 */
+    @Excel(name = "累计成交总额", cellType = Excel.ColumnType.NUMERIC)
+    private BigDecimal totalOrderAmount;
+
+    /** 最新绑定时间 */
+    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
+    @Excel(name = "最新绑定时间", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss")
+    private Date latestBindTime;
+
+
+    /** 客户状态 */
+    @Excel(name = "客户状态")
+    private Integer userStatus;
+
+    @Excel(name = "所属店铺")
+    private Long storeId;
+
+
+    /** 所属门店名称 */
+    @Excel(name = "所属店铺名称")
+    private String storeName;
+
+    @Excel(name = "商品ID")
+    private Long productId;
+
+    /** 商品名称 */
+    @Excel(name = "商品名称")
+    private String productName;
+
+
+    /** 商品规格 */
+    @Excel(name = "商品规格")
+    private String productSpec;
+
+    /** 订单商品总数 */
+    @Excel(name = "商品数量")
+    private String totalNum;
+
+    @Excel(name = "销售价格")
+    private BigDecimal price;
+
+    @Excel(name = "成本价格")
+    private BigDecimal cost;
+
+    /** 详细地址 */
+    @Excel(name = "收货地址")
+    private String userAddress;
+
+    /** 支付时间 */
+    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
+    @Excel(name = "支付时间", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss")
+    private LocalDateTime payTime;
+
+
+
+
+    /** 直播ID */
+//    @Excel(name = "直播ID")
+    private Long liveId;
+
+
+
+
+
+    /** 订单号 */
+//    @Excel(name = "订单号")
+    private String orderCode;
+
+
+    /** 收货人 */
+//    @Excel(name = "收货人")
+    private String userName;
+
+
+
+
+    /** 购物车id */
+//    @Excel(name = "购物车id")
+    private String cartId;
+
+
+
+    /** 订单总价 */
+//    @Excel(name = "订单总价")
+    private BigDecimal totalPrice;
+
+    /** 实际支付金额 */
+//    @Excel(name = "实际支付金额")
+    private BigDecimal payPrice;
+
+    /** 支付金额 */
+//    @Excel(name = "支付金额")
+    private BigDecimal payMoney;
+
+    /** 支付状态 待支付 1已支付 */
+//    @Excel(name = "支付状态 待支付 1已支付")
+    private String isPay;
+
+    /** 取消理由*/
+//    @Excel(name = "取消理由")
+    private String cancelReason;
+
+
+
+    // 支付开始时间
+    private String payStartTime;
+    // 支付结束时间
+    private String payEndTime;
+
+    /** 支付方式 1微信 */
+//    @Excel(name = "支付方式 1微信")
+    private String payType;
+
+    /** 订单状态(-1 : 申请退款 -2 : 退货成功 0:已取消 1:待支付 2:待发货;3:待收货;4:待评价;5:已完成) */
+    @Excel(name = "订单状态",dictType="sys_order_status")
+    private Integer status;
+
+    /** 对应供应商 */
+    @Excel(name = "对应供应商")
+    private String supplierName;
+
+    /** 0 未退款 1 申请中 2 已退款 */
+//    @Excel(name = "0 未退款 1 申请中 2 已退款")
+    private String refundStatus;
+    /** 收货人 */
+//    @Excel(name = "收货人")
+    private String realName;
+
+
+    /** 退款图片 */
+//    @Excel(name = "退款图片")
+    private String refundImg;
+
+    /** 退款用户说明 */
+//    @Excel(name = "退款用户说明")
+    private String refundExplain;
+
+    /** 退款时间 */
+    @JsonFormat(pattern = "yyyy-MM-dd")
+//    @Excel(name = "退款时间", width = 30, dateFormat = "yyyy-MM-dd")
+    private Date refundTime;
+
+    /** 不退款的理由 */
+//    @Excel(name = "不退款的理由")
+    private String refundReason;
+
+    /** 退款金额 */
+//    @Excel(name = "退款金额")
+    private BigDecimal refundMoney;
+
+    /** 快递公司编号 */
+//    @Excel(name = "快递公司编号")
+    private String deliveryCode;
+
+    /** 快递名称 */
+//    @Excel(name = "快递名称")
+    private String deliveryName;
+
+    /** 快递单号 */
+//    @Excel(name = "快递单号")
+    private String deliverySn;
+
+    /** 是否删除 */
+//    @Excel(name = "是否删除")
+    private String isDel;
+
+    /** 成本价 */
+//    @Excel(name = "成本价")
+    private BigDecimal costPrice;
+
+    /** 核销码 */
+//    @Excel(name = "核销码")
+    private String verifyCode;
+
+    /** 配送方式 1=快递 ,2=门店自提 */
+//    @Excel(name = "配送方式 1=快递 ,2=门店自提")
+    private Integer shippingType;
+
+    /** 支付渠道(1微信小程序) */
+//    @Excel(name = "支付渠道(1微信小程序)")
+    private String isChannel;
+
+    /** $column.columnComment */
+    @JsonFormat(pattern = "yyyy-MM-dd")
+//    @Excel(name = "支付渠道(1微信小程序)", width = 30, dateFormat = "yyyy-MM-dd")
+    private Date finishTime;
+
+    // 完成时间-开始
+    private String finishTimeStart;
+    // 完成时间-结束
+    private String finishTimeEnd;
+
+    /** 发货时间 */
+//    @Excel(name = "发货时间")
+    private String deliveryTime;
+
+    /** 推广佣金 */
+//    @Excel(name = "推广佣金")
+    private BigDecimal tuiMoney;
+
+    /** 推广佣金状态 1已发放 0待发放 */
+//    @Excel(name = "推广佣金状态 1已发放 0待发放")
+    private Integer tuiMoneyStatus;
+
+    /** 上级推荐人ID */
+//    @Excel(name = "上级推荐人ID")
+    private Long tuiUserId;
+
+    /** orderItem字符串 */
+//    @Excel(name = "orderItem字符串")
+    private String itemJson;
+
+    /** 优惠金额 */
+//    @Excel(name = "优惠金额")
+    private BigDecimal discountMoney;
+
+    /** $column.columnComment */
+//    @Excel(name = "优惠金额")
+    private Long userCouponId;
+
+    /** 公司id */
+//    @Excel(name = "公司id")
+    private Long companyId;
+
+
+
+    /** 仓库代码 */
+//    @Excel(name = "仓库代码")
+    private String storeHouseCode;
+
+    /** 扩展订单ID */
+//    @Excel(name = "扩展订单ID")
+    private String extendOrderId;
+
+    /** 支付运费 */
+//    @Excel(name = "支付运费")
+    private BigDecimal payDelivery;
+
+    /** 剩余金额 */
+//    @Excel(name = "剩余金额")
+    private BigDecimal payRemain;
+
+    /** 物流状态 */
+//    @Excel(name = "物流状态")
+    private Integer deliveryStatus;
+
+    /** 物流结算状态 */
+//    @Excel(name = "物流结算状态")
+    private Integer deliveryPayStatus;
+
+    /** $column.columnComment */
+//    @Excel(name = "物流结算状态")
+    private String deliveryPayTime;
+
+    /** 物流跟踪状态 */
+//    @Excel(name = "物流跟踪状态")
+    private String deliveryType;
+
+    /** 物流结算金额 */
+//    @Excel(name = "物流结算金额")
+    private BigDecimal deliveryPayMoney;
+
+    /** 回单导入时间 */
+    @JsonFormat(pattern = "yyyy-MM-dd")
+//    @Excel(name = "回单导入时间", width = 30, dateFormat = "yyyy-MM-dd")
+    private Date deliveryImportTime;
+
+    /** 发货时间 */
+    @JsonFormat(pattern = "yyyy-MM-dd")
+//    @Excel(name = "发货时间", width = 30, dateFormat = "yyyy-MM-dd")
+    private Date deliverySendTime;
+
+    /** 是否可售后 */
+//    @Excel(name = "是否可售后")
+    private Integer isAfterSales;
+
+    /** 部门id */
+//    @Excel(name = "部门id")
+    private Long deptId;
+
+    /** 渠道 */
+//    @Excel(name = "渠道")
+    private String channel;
+
+    /** 订单来源 */
+//    @Excel(name = "订单来源")
+    private Long source;
+
+    /** 开票金额 */
+//    @Excel(name = "开票金额")
+    private BigDecimal billPrice;
+
+    /** 邮费 */
+//    @Excel(name = "邮费")
+    private BigDecimal totalPostage;
+
+    /** 支付邮费 */
+//    @Excel(name = "支付邮费")
+    private BigDecimal payPostage;
+
+    /** 消费赚取积分 */
+//    @Excel(name = "消费赚取积分")
+    private BigDecimal gainIntegral;
+
+    /** 使用积分 */
+//    @Excel(name = "使用积分")
+    private BigDecimal useIntegral;
+
+    /** 实际支付积分 */
+//    @Excel(name = "实际支付积分")
+    private BigDecimal payIntegral;
+
+    /** 给用户退了多少积分 */
+//    @Excel(name = "给用户退了多少积分")
+    private BigDecimal backIntegral;
+
+    /** 是否改价 */
+//    @Excel(name = "是否改价")
+    private Integer isEditMoney;
+
+    /** 创建时间*/
+//    @Excel(name = "创建时间")
+    private Date createTime;
+
+    /** 更新时间*/
+//    @Excel(name = "更新时间")
+    private Date updateTime;
+
+    /** 备注*/
+//    @Excel(name = "备注")
+    private String remark;
+
+    /** 备注*/
+//    @Excel(name = "订单名称")
+    private String orderName;
+
+    /** 备注*/
+//    @Excel(name = "订单名称")
+    private String productIntroduce;
+
+    /** 备注*/
+//    @Excel(name = "订单key")
+    private String orderKey;
+
+    /** 城市Id*/
+    private Long cityId;
+
+    private String companyName;
+    private String companyUserName;
+
+    private Long customerId;
+    private Long couponUserId;
+    private Long recordId;
+
+    /** 优惠券金额 */
+    private BigDecimal couponPrice;
+
+    // ========== 新增字段 ==========
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+    // 筛选条件字段
+    private String productNameQuery;
+    private String productSpecQuery;
+    private String supplierNameQuery;
+    private String createTimeStart;
+    private String createTimeEnd;
+
+
+
+}

+ 1 - 1
fs-service/src/main/resources/application-config-druid-bjzm.yml

@@ -89,7 +89,7 @@ headerImg:
   imgUrl:
 
 ipad:
-  ipadUrl: http://ipad.cdwjyyh.com
+  ipadUrl: http://aipad.klbycp.com
   aiApi: 1212121212
   voiceApi:
   commonApi:

+ 4 - 0
fs-service/src/main/resources/mapper/live/LiveCouponIssueMapper.xml

@@ -21,6 +21,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         <result property="couponPrice"    column="coupon_price"    />
         <result property="useMinPrice"    column="use_min_price"    />
         <result property="couponTime"    column="coupon_time"    />
+        <result property="limitReceiveCount"    column="limit_receive_count"    />
     </resultMap>
 
     <sql id="selectLiveCouponIssueVo">
@@ -65,6 +66,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="isDel != null">is_del,</if>
             <if test="createTime != null">create_time,</if>
             <if test="updateTime != null">update_time,</if>
+            <if test="limitReceiveCount != null">limit_receive_count,</if>
          </trim>
         <trim prefix="values (" suffix=")" suffixOverrides=",">
             <if test="couponName != null">#{couponName},</if>
@@ -79,6 +81,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="isDel != null">#{isDel},</if>
             <if test="createTime != null">#{createTime},</if>
             <if test="updateTime != null">#{updateTime},</if>
+            <if test="limitReceiveCount != null">#{limitReceiveCount},</if>
          </trim>
     </insert>
 
@@ -97,6 +100,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="isDel != null">is_del = #{isDel},</if>
             <if test="createTime != null">create_time = #{createTime},</if>
             <if test="updateTime != null">update_time = #{updateTime},</if>
+            <if test="limitReceiveCount != null">limit_receive_count = #{limitReceiveCount},</if>
         </trim>
         where id = #{id}
     </update>

+ 141 - 0
fs-service/src/main/resources/mapper/live/LiveOrderMapper.xml

@@ -917,4 +917,145 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         ${maps.params.dataScope} GROUP BY sp.product_id
         ) AS t
     </select>
+
+    <!-- 查询订单列表Zm -->
+    <select id="selectLiveOrderListZm" parameterType="LiveOrder" resultType="com.fs.live.vo.LiveOrderVoZm">
+        SELECT
+            o.order_id,
+            o.live_id,
+            o.store_id,
+            o.order_code,
+            o.user_id,
+            o.user_name,
+            o.user_phone,
+            o.user_address,
+            o.cart_id,
+            o.total_num,
+            o.total_price,
+            o.pay_price,
+            o.pay_money,
+            o.is_pay,
+            o.pay_time,
+            o.pay_type,
+            o.create_time,
+            o.update_time,
+            o.status,
+            o.refund_status,
+            o.refund_img,
+            o.refund_explain,
+            o.refund_time,
+            o.refund_reason,
+            o.refund_money,
+            o.delivery_code,
+            o.delivery_name,
+            o.delivery_sn,
+            o.remark,
+            o.is_del,
+            o.cost_price,
+            o.company_id,
+            o.company_user_id,
+            o.product_id,
+            o.customer_id,
+            o.coupon_price,
+            o.cancel_reason,
+
+            <!-- 销售信息 -->
+            cu.nick_name AS companyUserNickName,
+            cu.phonenumber AS companyUserPhone,
+            cu.create_time AS companyUserCreateTime,
+
+            <!-- 客户信息 -->
+            u.user_code AS userCode,
+            u.level AS userLevel,
+            u.nick_name AS nickName,
+            u.phone AS userBindPhone,
+            u.order_count AS totalOrderCount,
+            u.total_amount AS totalOrderAmount,
+            u.status AS userStatus,
+            u.update_time AS latestBindTime,
+
+            <!-- 商品信息 -->
+            p.product_name AS productName,
+            p.cost AS costPrice,
+            p.price AS price,
+            p.cost AS cost,
+            p.prescribe_spec AS productSpec,
+            p.prescribe_factory AS supplierName,
+
+            <!-- 门店信息 -->
+            s.store_name AS storeName,
+            s.store_id AS storeId
+
+        FROM
+            live_order o
+            LEFT JOIN fs_user u ON o.user_id = u.user_id
+            LEFT JOIN company_user cu ON o.company_user_id = cu.user_id
+            LEFT JOIN fs_store_product_scrm p ON o.product_id = p.product_id
+            LEFT JOIN fs_store_scrm s ON p.store_id = s.store_id
+        <where>
+            o.is_del = 0
+            <if test="orderId != null">
+                AND o.order_id = #{orderId}
+            </if>
+            <if test="liveId != null">
+                AND o.live_id = #{liveId}
+            </if>
+            <if test="storeId != null">
+                AND o.store_id = #{storeId}
+            </if>
+            <if test="orderCode != null and orderCode != ''">
+                AND o.order_code LIKE CONCAT('%', #{orderCode}, '%')
+            </if>
+            <if test="userId != null and userId != ''">
+                AND o.user_id = #{userId}
+            </if>
+            <if test="status != null">
+                AND o.status = #{status}
+            </if>
+            <if test="companyId != null">
+                AND o.company_id = #{companyId}
+            </if>
+            <if test="totalNum != null">
+                AND o.total_num = #{totalNum}
+            </if>
+            <if test="price != null">
+                AND p.price = #{price}
+            </if>
+            <if test="cost != null">
+                AND p.cost = #{cost}
+            </if>
+            <if test="companyUserId != null">
+                AND o.company_user_id = #{companyUserId}
+            </if>
+            <if test="productId != null">
+                AND o.product_id = #{productId}
+            </if>
+            <!-- 新增筛选条件 -->
+            <if test="productName != null and productName != ''">
+                AND p.product_name LIKE CONCAT('%', #{productName}, '%')
+            </if>
+            <if test="productSpec != null and productSpec != ''">
+                AND p.prescribe_spec LIKE CONCAT('%', #{productSpec}, '%')
+            </if>
+            <if test="storeId != null and storeId != ''">
+                AND p.store_id #{storeId}
+            </if>
+            <if test="userAddress != null and userAddress != ''">
+                AND o.user_address LIKE CONCAT('%', #{userAddress}, '%')
+            </if>
+            <if test="createTimeStart != null and createTimeStart != ''">
+                AND o.create_time &gt;= #{createTimeStart}
+            </if>
+            <if test="createTimeEnd != null and createTimeEnd != ''">
+                AND o.create_time &lt;= #{createTimeEnd}
+            </if>
+            <if test="payStartTime != null and payStartTime != ''">
+                AND o.pay_time &gt;= #{payStartTime}
+            </if>
+            <if test="payEndTime != null and payEndTime != ''">
+                AND o.pay_time &lt;= #{payEndTime}
+            </if>
+        </where>
+        ORDER BY o.create_time DESC
+    </select>
 </mapper>