Просмотр исходного кода

业绩归属,查询数据条件

yuhongqi 3 недель назад
Родитель
Сommit
6599ea78c4

+ 16 - 0
fs-admin/src/main/java/com/fs/live/controller/LiveOrderPaymentController.java

@@ -49,6 +49,14 @@ public class LiveOrderPaymentController extends BaseController
     @GetMapping
     public TableDataInfo listNew(LiveOrderPaymentVo liveOrderPayment)
     {
+        // 处理提交时间范围
+        if (liveOrderPayment.getCreateTimeRange() != null && !liveOrderPayment.getCreateTimeRange().isEmpty()) {
+            String[] timeRange = liveOrderPayment.getCreateTimeRange().split("--");
+            if (timeRange.length == 2) {
+                liveOrderPayment.setCreateBeginTime(timeRange[0]);
+                liveOrderPayment.setCreateEndTime(timeRange[1]);
+            }
+        }
         startPage();
         List<LiveOrderPaymentVo> list = liveOrderPaymentService.selectLiveOrderPaymentVoList(liveOrderPayment);
         for (LiveOrderPaymentVo vo : list){
@@ -65,6 +73,14 @@ public class LiveOrderPaymentController extends BaseController
     @GetMapping("/export")
     public AjaxResult export(LiveOrderPaymentVo liveOrderPayment)
     {
+        // 处理提交时间范围
+        if (liveOrderPayment.getCreateTimeRange() != null && !liveOrderPayment.getCreateTimeRange().isEmpty()) {
+            String[] timeRange = liveOrderPayment.getCreateTimeRange().split("--");
+            if (timeRange.length == 2) {
+                liveOrderPayment.setCreateBeginTime(timeRange[0]);
+                liveOrderPayment.setCreateEndTime(timeRange[1]);
+            }
+        }
         PageHelper.startPage(1, 10000, "");
         List<LiveOrderPaymentVo> list = liveOrderPaymentService.selectLiveOrderPaymentVoList(liveOrderPayment);
         for (LiveOrderPaymentVo vo : list){

+ 1 - 1
fs-live-socket/src/main/java/com/fs/live/websocket/service/WebSocketServer.java

@@ -168,7 +168,7 @@ public class WebSocketServer {
                 }
             } else {
                 // 这个用户A邀请用户b,b的业绩算a的销售的
-                if (companyUserId == -2L) {
+                if (companyId == -2L) {
                     LiveUserFirstEntry clientB = liveUserFirstEntryService.selectEntityByLiveIdUserId(liveId, companyUserId);
                     companyId = clientB.getCompanyId();
                     companyUserId = clientB.getCompanyUserId();

+ 25 - 1
fs-service-system/src/main/java/com/fs/live/vo/LiveOrderPaymentVo.java

@@ -32,7 +32,7 @@ public class LiveOrderPaymentVo extends BaseEntity{
     private String businessCode;
 
 //    @Excel(name = "付款单号")
-    private Integer orderCode;
+//    private Integer orderCode;
 
     /** 外部订单号 */
     @Excel(name = "外部订单号")
@@ -148,7 +148,31 @@ public class LiveOrderPaymentVo extends BaseEntity{
 //    @Excel(name = "是否分账")
     private Integer isShare;
 
+    /** 订单号(用于查询,前端传递的orderCode) */
+    private String orderCode;
 
+    /** 手机号(用于查询,前端传递的mobile) */
+    private String mobile;
 
+    /** 提交时间范围(格式:开始日期--结束日期) */
+    private String createTimeRange;
+
+    /** 提交开始时间 */
+    private String createBeginTime;
+
+    /** 提交结束时间 */
+    private String createEndTime;
+
+    /** 支付开始时间 */
+    private String beginTime;
+
+    /** 支付结束时间 */
+    private String endTime;
+
+    /** 退款开始时间 */
+    private String refundBeginTime;
+
+    /** 退款结束时间 */
+    private String refundEndTime;
 
 }

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

@@ -91,14 +91,30 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="refundMoney != null "> and lop.refund_money = #{refundMoney}</if>
             <if test="refundTime != null "> and lop.refund_time = #{refundTime}</if>
             <if test="storeId != null "> and lop.store_id = #{storeId}</if>
-            <if test="companyId != null "> and lop.company_id = #{companyId}</if>
-            <if test="companyUserId != null "> and lop.company_user_id = #{companyUserId}</if>
+            <if test="companyId != null "> and lo.company_id = #{companyId}</if>
+            <if test="companyUserId != null "> and lo.company_user_id = #{companyUserId}</if>
             <if test="businessCode != null  and businessCode != ''"> and lop.business_code = #{businessCode}</if>
             <if test="payMode != null  and payMode != ''"> and lop.pay_mode = #{payMode}</if>
             <if test="shareStatus != null "> and lop.share_status = #{shareStatus}</if>
             <if test="shareCode != null  and shareCode != ''"> and lop.share_code = #{shareCode}</if>
             <if test="shareMoney != null "> and lop.share_money = #{shareMoney}</if>
             <if test="isShare != null "> and lop.is_share = #{isShare}</if>
+            <!-- 订单号查询(支持businessCode和orderCode) -->
+            <if test="orderCode != null  and orderCode != ''"> and (lop.business_code = #{orderCode} or lo.order_code = #{orderCode})</if>
+            <!-- 手机号查询 -->
+            <if test="mobile != null  and mobile != ''"> and lo.user_phone like concat('%',#{mobile},'%')</if>
+            <if test="userPhone != null  and userPhone != ''"> and lo.user_phone like concat('%',#{userPhone},'%')</if>
+            <!-- 员工姓名查询 -->
+            <if test="companyUserNickName != null  and companyUserNickName != ''"> and cu.nick_name like concat('%',#{companyUserNickName},'%')</if>
+            <!-- 提交时间范围查询 -->
+            <if test="createBeginTime != null  and createBeginTime != ''"> and date_format(lop.create_time,'%y%m%d') &gt;= date_format(#{createBeginTime},'%y%m%d')</if>
+            <if test="createEndTime != null  and createEndTime != ''"> and date_format(lop.create_time,'%y%m%d') &lt;= date_format(#{createEndTime},'%y%m%d')</if>
+            <!-- 支付时间范围查询 -->
+            <if test="beginTime != null  and beginTime != ''"> and date_format(lop.pay_time,'%y%m%d') &gt;= date_format(#{beginTime},'%y%m%d')</if>
+            <if test="endTime != null  and endTime != ''"> and date_format(lop.pay_time,'%y%m%d') &lt;= date_format(#{endTime},'%y%m%d')</if>
+            <!-- 退款时间范围查询 -->
+            <if test="refundBeginTime != null  and refundBeginTime != ''"> and date_format(lop.refund_time,'%y%m%d') &gt;= date_format(#{refundBeginTime},'%y%m%d')</if>
+            <if test="refundEndTime != null  and refundEndTime != ''"> and date_format(lop.refund_time,'%y%m%d') &lt;= date_format(#{refundEndTime},'%y%m%d')</if>
         </where>
     </select>
     <select id="selectLiveOrderPaymentByPaymentIdNew"  resultType="com.fs.live.vo.LiveOrderPaymentVo">