魏超 il y a 4 ans
Parent
révision
97cdf30258

+ 4
- 2
src/main/java/com/huiju/estateagents/redpack/controller/TaOrgOrderController.java Voir le fichier

@@ -74,12 +74,14 @@ public class TaOrgOrderController extends BaseController {
74 74
                                        @RequestParam(value = "itemType", required = false) String itemType,
75 75
                                        @RequestParam(value = "startDate", required = false) String startDate,
76 76
                                        @RequestParam(value = "endDate", required = false) String endDate,
77
+                                       @RequestParam(value = "payStartDate", required = false) String payStartDate,
78
+                                       @RequestParam(value = "payEndDate", required = false) String payEndDate,
77 79
                                        @RequestParam(value = "auditStatus", required = false) String auditStatus) {
78 80
         ResponseBean responseBean = new ResponseBean();
79 81
         try {
80 82
             //使用分页插件
81 83
             IPage<TaOrgOrder> pg = new Page<>(pageNum, pageSize);
82
-            IPage<TaOrgOrder> result = iTaOrgOrderService.listByCondition(pg, orderType, orgId, tradeNo, isOffline, tradingStatus, receivePhone, itemType, startDate, endDate, miniAppName, auditStatus);
84
+            IPage<TaOrgOrder> result = iTaOrgOrderService.listByCondition(pg, orderType, orgId, tradeNo, isOffline, tradingStatus, receivePhone, itemType, startDate, endDate, miniAppName, auditStatus, payStartDate, payEndDate);
83 85
             responseBean.addSuccess(result);
84 86
         } catch (Exception e) {
85 87
             e.printStackTrace();
@@ -137,7 +139,7 @@ public class TaOrgOrderController extends BaseController {
137 139
         response.setCharacterEncoding("utf-8");
138 140
         response.setHeader("Content-disposition", "attachment;filename=订单统计.xlsx");
139 141
 
140
-        ExcelWriter excelWriter = EasyExcel.write(response.getOutputStream(), RechargeOrder.class).registerWriteHandler(new CustomCellWriteHandler()).build();
142
+        ExcelWriter excelWriter = EasyExcel.write(response.getOutputStream(), ConsumeOrder.class).registerWriteHandler(new CustomCellWriteHandler()).build();
141 143
         WriteSheet writeSheet = EasyExcel.writerSheet("活动统计").build();
142 144
 
143 145
         // 设置 sheet, 同一个sheet只需要设置一次

+ 7
- 0
src/main/java/com/huiju/estateagents/redpack/entity/ConsumeOrder.java Voir le fichier

@@ -37,6 +37,13 @@ public class ConsumeOrder {
37 37
     @ExcelProperty(value = "消费方式", index = 3)
38 38
     private String consumeType;
39 39
 
40
+    /**
41
+     * 活动名称
42
+     */
43
+    @ColumnWidth(15)
44
+    @ExcelProperty(value = "活动名称", index = 4)
45
+    private String activityName;
46
+
40 47
     /**
41 48
      * 消费下单时间
42 49
      */

+ 3
- 1
src/main/java/com/huiju/estateagents/redpack/mapper/TaOrgOrderMapper.java Voir le fichier

@@ -44,7 +44,9 @@ public interface TaOrgOrderMapper extends BaseMapper<TaOrgOrder> {
44 44
                                                   @Param("startDate") String startDate,
45 45
                                                   @Param("endDate") String endDate,
46 46
                                                   @Param("miniAppName") String miniAppName,
47
-                                                  @Param("auditStatus") String auditStatus);
47
+                                                  @Param("auditStatus") String auditStatus,
48
+                                                  @Param("payStartDate") String payStartDate,
49
+                                                  @Param("payEndDate") String payEndDate);
48 50
 
49 51
     /**
50 52
      * 消费订单

+ 1
- 1
src/main/java/com/huiju/estateagents/redpack/service/ITaOrgOrderService.java Voir le fichier

@@ -51,7 +51,7 @@ public interface ITaOrgOrderService extends IService<TaOrgOrder> {
51 51
      * @param orderType
52 52
      * @return
53 53
      */
54
-    IPage<TaOrgOrder> listByCondition(IPage<TaOrgOrder> pg, String orderType, Integer orgId, String tradeNo, Integer isOffline, String tradingStatus, String receivePhone, String itemType, String startDate, String endDate, String miniAppName, String auditStatus);
54
+    IPage<TaOrgOrder> listByCondition(IPage<TaOrgOrder> pg, String orderType, Integer orgId, String tradeNo, Integer isOffline, String tradingStatus, String receivePhone, String itemType, String startDate, String endDate, String miniAppName, String auditStatus, String payStartDate, String payEndDate);
55 55
 
56 56
     /**
57 57
      * 充值订单列表导出

+ 15
- 2
src/main/java/com/huiju/estateagents/redpack/service/impl/TaOrgOrderServiceImpl.java Voir le fichier

@@ -102,12 +102,25 @@ public class TaOrgOrderServiceImpl extends ServiceImpl<TaOrgOrderMapper, TaOrgOr
102 102
     private ITaOrgAccountService taOrgAccountService;
103 103
 
104 104
     @Override
105
-    public IPage<TaOrgOrder> listByCondition(IPage<TaOrgOrder> pg, String orderType, Integer orgId, String tradeNo, Integer isOffline, String tradingStatus, String receivePhone, String itemType, String startDate, String endDate, String miniAppName, String auditStatus) {
105
+    public IPage<TaOrgOrder> listByCondition(IPage<TaOrgOrder> pg,
106
+                                             String orderType,
107
+                                             Integer orgId,
108
+                                             String tradeNo,
109
+                                             Integer isOffline,
110
+                                             String tradingStatus,
111
+                                             String receivePhone,
112
+                                             String itemType,
113
+                                             String startDate,
114
+                                             String endDate,
115
+                                             String miniAppName,
116
+                                             String auditStatus,
117
+                                             String payStartDate,
118
+                                             String payEndDate) {
106 119
         IPage<TaOrgOrder> result = pg;
107 120
 
108 121
         if (CommConstant.ITEM_TYPE_RECHARGE.equals(orderType) || CommConstant.ITEM_TYPE_REFUND.equals(orderType)) {
109 122
             List<String> urlList = new ArrayList<>();
110
-            result = taOrgOrderMapper.orderListByRechargeOrRefund(pg, orderType, orgId, tradeNo, isOffline, tradingStatus, startDate, endDate, miniAppName, auditStatus);
123
+            result = taOrgOrderMapper.orderListByRechargeOrRefund(pg, orderType, orgId, tradeNo, isOffline, tradingStatus, startDate, endDate, miniAppName, auditStatus, payStartDate, payEndDate);
111 124
             result.getRecords().forEach(e -> {
112 125
                 e.setCertificateUrlList(getCertificateByOrderId(e.getOrderId()));
113 126
             });

+ 3
- 1
src/main/resources/mapper/redpack/TaOrgAccountMapper.xml Voir le fichier

@@ -8,7 +8,9 @@
8 8
         d.name as orgName,
9 9
         c.channel_proxy_name,
10 10
         t.purchase_amount,
11
-        total_refund
11
+        total_refund,
12
+        t.account_id,
13
+        t.org_id
12 14
         From ta_org_account  t
13 15
         left join ta_channel_app_relation b on t.org_id = b.org_id
14 16
         left join ta_channel_proxy c on b.channel_id = c.channel_id

+ 9
- 3
src/main/resources/mapper/redpack/TaOrgOrderMapper.xml Voir le fichier

@@ -45,10 +45,16 @@
45 45
             and d.audit_status = #{auditStatus}
46 46
         </if>
47 47
         <if test="startDate != null and startDate != ''">
48
-            and t.create_date > #{startDate}
48
+            and t.create_date >= #{startDate}
49 49
         </if>
50 50
         <if test="endDate != null and endDate != ''">
51
-            and t.create_date &lt; #{endDate}
51
+            and t.create_date &lt;= #{endDate}
52
+        </if>
53
+        <if test="payStartDate != null and payStartDate != ''">
54
+            and t.pay_date >= #{payStartDate}
55
+        </if>
56
+        <if test="payEndDate != null and payEndDate != ''">
57
+            and t.pay_date &lt;= #{payEndDate}
52 58
         </if>
53 59
         <if test="miniAppName != null and miniAppName != ''">
54 60
             and b.name like concat('%', #{miniAppName}, '%')
@@ -158,7 +164,7 @@
158 164
         left join ta_org_order_detail a on t.order_id = a.order_id
159 165
         left join ta_miniapp b on t.org_id = b.org_id
160 166
         left join ta_person c on a.receiver_id = c.person_id
161
-        left join ta_drainage d on a.target_id = d.drainage_id
167
+        left join ta_red_packet d on a.target_id = d.activity_id
162 168
         where
163 169
         a.item_type = #{itemType}
164 170
         <if test="tradeNo != null and tradeNo != ''">