魏超 5 years ago
parent
commit
422e3e3570

+ 6
- 3
src/main/java/com/huiju/estateagents/redpack/controller/TaOrgOrderController.java View File

113
                                                    @RequestParam(value = "startDate", required = false) String startDate,
113
                                                    @RequestParam(value = "startDate", required = false) String startDate,
114
                                                    @RequestParam(value = "endDate", required = false) String endDate,
114
                                                    @RequestParam(value = "endDate", required = false) String endDate,
115
                                                    @RequestParam(value = "orderType", required = false) String orderType,
115
                                                    @RequestParam(value = "orderType", required = false) String orderType,
116
+                                                   @RequestParam(value = "orgId", required = false) Integer orgId,
116
                                                    HttpServletRequest request, HttpServletResponse response) throws IOException {
117
                                                    HttpServletRequest request, HttpServletResponse response) throws IOException {
117
         response.setContentType("application/octet-stream");
118
         response.setContentType("application/octet-stream");
118
         response.setCharacterEncoding("utf-8");
119
         response.setCharacterEncoding("utf-8");
122
         WriteSheet writeSheet = EasyExcel.writerSheet("活动统计").build();
123
         WriteSheet writeSheet = EasyExcel.writerSheet("活动统计").build();
123
 
124
 
124
         // 设置 sheet, 同一个sheet只需要设置一次
125
         // 设置 sheet, 同一个sheet只需要设置一次
125
-        List<RechargeOrder> data = iTaOrgOrderService.rechargeListByConditionExport(orderType, tradeNo, isOffline, tradingStatus, startDate, endDate, miniAppName);
126
+        List<RechargeOrder> data = iTaOrgOrderService.rechargeListByConditionExport(orderType, tradeNo, isOffline, tradingStatus, startDate, endDate, miniAppName, orgId);
126
         excelWriter.write(data, writeSheet);
127
         excelWriter.write(data, writeSheet);
127
         // finish 会帮忙关闭流
128
         // finish 会帮忙关闭流
128
         excelWriter.finish();
129
         excelWriter.finish();
141
                                    @RequestParam(value = "startDate", required = false) String startDate,
142
                                    @RequestParam(value = "startDate", required = false) String startDate,
142
                                    @RequestParam(value = "endDate", required = false) String endDate,
143
                                    @RequestParam(value = "endDate", required = false) String endDate,
143
                                    @RequestParam(value = "orderType", required = false) String orderType,
144
                                    @RequestParam(value = "orderType", required = false) String orderType,
145
+                                   @RequestParam(value = "orgId", required = false) Integer orgId,
144
                                    HttpServletRequest request, HttpServletResponse response) throws IOException {
146
                                    HttpServletRequest request, HttpServletResponse response) throws IOException {
145
         response.setContentType("application/octet-stream");
147
         response.setContentType("application/octet-stream");
146
         response.setCharacterEncoding("utf-8");
148
         response.setCharacterEncoding("utf-8");
150
         WriteSheet writeSheet = EasyExcel.writerSheet("活动统计").build();
152
         WriteSheet writeSheet = EasyExcel.writerSheet("活动统计").build();
151
 
153
 
152
         // 设置 sheet, 同一个sheet只需要设置一次
154
         // 设置 sheet, 同一个sheet只需要设置一次
153
-        List<ConsumeOrder> data = iTaOrgOrderService.consumeListByConditionExport(orderType, tradeNo, receivePhone, tradingStatus, startDate, endDate, miniAppName);
155
+        List<ConsumeOrder> data = iTaOrgOrderService.consumeListByConditionExport(orderType, tradeNo, receivePhone, tradingStatus, startDate, endDate, miniAppName, orgId);
154
         excelWriter.write(data, writeSheet);
156
         excelWriter.write(data, writeSheet);
155
         // finish 会帮忙关闭流
157
         // finish 会帮忙关闭流
156
         excelWriter.finish();
158
         excelWriter.finish();
167
                                    @RequestParam(value = "startDate", required = false) String startDate,
169
                                    @RequestParam(value = "startDate", required = false) String startDate,
168
                                    @RequestParam(value = "endDate", required = false) String endDate,
170
                                    @RequestParam(value = "endDate", required = false) String endDate,
169
                                    @RequestParam(value = "orderType", required = false) String orderType,
171
                                    @RequestParam(value = "orderType", required = false) String orderType,
172
+                                   @RequestParam(value = "orgId", required = false) Integer orgId,
170
                                    HttpServletRequest request, HttpServletResponse response) throws IOException {
173
                                    HttpServletRequest request, HttpServletResponse response) throws IOException {
171
         response.setContentType("application/octet-stream");
174
         response.setContentType("application/octet-stream");
172
         response.setCharacterEncoding("utf-8");
175
         response.setCharacterEncoding("utf-8");
176
         WriteSheet writeSheet = EasyExcel.writerSheet("活动统计").build();
179
         WriteSheet writeSheet = EasyExcel.writerSheet("活动统计").build();
177
 
180
 
178
         // 设置 sheet, 同一个sheet只需要设置一次
181
         // 设置 sheet, 同一个sheet只需要设置一次
179
-        List<RefundOrder> data = iTaOrgOrderService.refundListByConditionExport(orderType, tradeNo, startDate, endDate, miniAppName);
182
+        List<RefundOrder> data = iTaOrgOrderService.refundListByConditionExport(orderType, tradeNo, startDate, endDate, miniAppName, orgId);
180
         excelWriter.write(data, writeSheet);
183
         excelWriter.write(data, writeSheet);
181
         // finish 会帮忙关闭流
184
         // finish 会帮忙关闭流
182
         excelWriter.finish();
185
         excelWriter.finish();

+ 6
- 3
src/main/java/com/huiju/estateagents/redpack/mapper/TaOrgOrderMapper.java View File

75
                                                           @Param("tradingStatus") String tradingStatus,
75
                                                           @Param("tradingStatus") String tradingStatus,
76
                                                           @Param("startDate") String startDate,
76
                                                           @Param("startDate") String startDate,
77
                                                           @Param("endDate") String endDate,
77
                                                           @Param("endDate") String endDate,
78
-                                                          @Param("miniAppName") String miniAppName);
78
+                                                          @Param("miniAppName") String miniAppName,
79
+                                                          @Param("orgId") Integer orgId);
79
 
80
 
80
     /**
81
     /**
81
      * 消费订单导出
82
      * 消费订单导出
88
                                                 @Param("tradingStatus") String tradingStatus,
89
                                                 @Param("tradingStatus") String tradingStatus,
89
                                                 @Param("startDate") String startDate,
90
                                                 @Param("startDate") String startDate,
90
                                                 @Param("endDate") String endDate,
91
                                                 @Param("endDate") String endDate,
91
-                                                @Param("miniAppName") String miniAppName);
92
+                                                @Param("miniAppName") String miniAppName,
93
+                                                @Param("orgId") Integer orgId);
92
 
94
 
93
     /**
95
     /**
94
      * 退款订单导出
96
      * 退款订单导出
99
                                               @Param("tradeNo") String tradeNo,
101
                                               @Param("tradeNo") String tradeNo,
100
                                               @Param("startDate") String startDate,
102
                                               @Param("startDate") String startDate,
101
                                               @Param("endDate") String endDate,
103
                                               @Param("endDate") String endDate,
102
-                                              @Param("miniAppName") String miniAppName);
104
+                                              @Param("miniAppName") String miniAppName,
105
+                                              @Param("orgId") Integer orgId);
103
 
106
 
104
     /**
107
     /**
105
      * 获取充值订单列表
108
      * 获取充值订单列表

+ 3
- 3
src/main/java/com/huiju/estateagents/redpack/service/ITaOrgOrderService.java View File

58
      *
58
      *
59
      * @return
59
      * @return
60
      */
60
      */
61
-    List<RechargeOrder> rechargeListByConditionExport(String itemType, String tradeNo, Integer isOffline, String tradingStatus, String startDate, String endDate, String miniAppName);
61
+    List<RechargeOrder> rechargeListByConditionExport(String itemType, String tradeNo, Integer isOffline, String tradingStatus, String startDate, String endDate, String miniAppName, Integer orgId);
62
 
62
 
63
     /**
63
     /**
64
      * 消费订单列表导出
64
      * 消费订单列表导出
65
      *
65
      *
66
      * @return
66
      * @return
67
      */
67
      */
68
-    List<ConsumeOrder> consumeListByConditionExport(String itemType, String tradeNo, String receivePhone, String tradingStatus, String startDate, String endDate, String miniAppName);
68
+    List<ConsumeOrder> consumeListByConditionExport(String itemType, String tradeNo, String receivePhone, String tradingStatus, String startDate, String endDate, String miniAppName, Integer orgId);
69
 
69
 
70
     /**
70
     /**
71
      * 退款订单列表导出
71
      * 退款订单列表导出
72
      *
72
      *
73
      * @return
73
      * @return
74
      */
74
      */
75
-    List<RefundOrder> refundListByConditionExport(String itemType, String tradeNo, String startDate, String endDate, String miniAppName);
75
+    List<RefundOrder> refundListByConditionExport(String itemType, String tradeNo, String startDate, String endDate, String miniAppName, Integer orgId);
76
 
76
 
77
 
77
 
78
     /**
78
     /**

+ 1
- 1
src/main/java/com/huiju/estateagents/redpack/service/impl/TaOrgAccountServiceImpl.java View File

135
         List<TaContact> taContacts = selectSmsContactUser();
135
         List<TaContact> taContacts = selectSmsContactUser();
136
         if (CollectionUtils.isNotEmpty(taContacts)){
136
         if (CollectionUtils.isNotEmpty(taContacts)){
137
             TaContact taContact = taContacts.get(0);
137
             TaContact taContact = taContacts.get(0);
138
-            String[] smsParams = {"业务平台充值成功", taOrgOrder.getTradeNo()};
138
+            String[] smsParams = {"业务平台充值提醒", taOrgOrder.getTradeNo()};
139
             // 短信发送
139
             // 短信发送
140
             sendSmsMessage(taContact.getPhone(), CommConstant.ITEM_TYPE_RECHARGE, smsParams);
140
             sendSmsMessage(taContact.getPhone(), CommConstant.ITEM_TYPE_RECHARGE, smsParams);
141
         }
141
         }

+ 6
- 6
src/main/java/com/huiju/estateagents/redpack/service/impl/TaOrgOrderServiceImpl.java View File

131
     }
131
     }
132
 
132
 
133
     @Override
133
     @Override
134
-    public List<RechargeOrder> rechargeListByConditionExport(String itemType, String tradeNo, Integer isOffline, String tradingStatus, String startDate, String endDate, String miniAppName) {
135
-        List<RechargeOrder> result = taOrgOrderMapper.orderListByRechargeOrRefundExport(itemType, tradeNo, isOffline, tradingStatus, startDate, endDate, miniAppName);
134
+    public List<RechargeOrder> rechargeListByConditionExport(String itemType, String tradeNo, Integer isOffline, String tradingStatus, String startDate, String endDate, String miniAppName, Integer orgId) {
135
+        List<RechargeOrder> result = taOrgOrderMapper.orderListByRechargeOrRefundExport(itemType, tradeNo, isOffline, tradingStatus, startDate, endDate, miniAppName, orgId);
136
         return result;
136
         return result;
137
     }
137
     }
138
 
138
 
139
     @Override
139
     @Override
140
-    public List<ConsumeOrder> consumeListByConditionExport(String itemType, String tradeNo, String receivePhone, String tradingStatus, String startDate, String endDate, String miniAppName) {
141
-        List<ConsumeOrder> result = taOrgOrderMapper.orderListByConsumeExport(itemType, tradeNo, receivePhone, tradingStatus, startDate, endDate, miniAppName);
140
+    public List<ConsumeOrder> consumeListByConditionExport(String itemType, String tradeNo, String receivePhone, String tradingStatus, String startDate, String endDate, String miniAppName, Integer orgId) {
141
+        List<ConsumeOrder> result = taOrgOrderMapper.orderListByConsumeExport(itemType, tradeNo, receivePhone, tradingStatus, startDate, endDate, miniAppName, orgId);
142
         return result;
142
         return result;
143
     }
143
     }
144
 
144
 
145
     @Override
145
     @Override
146
-    public List<RefundOrder> refundListByConditionExport(String itemType, String tradeNo, String startDate, String endDate, String miniAppName) {
147
-        List<RefundOrder> result = taOrgOrderMapper.orderListByRefundExport(itemType, tradeNo, startDate, endDate, miniAppName);
146
+    public List<RefundOrder> refundListByConditionExport(String itemType, String tradeNo, String startDate, String endDate, String miniAppName, Integer orgId) {
147
+        List<RefundOrder> result = taOrgOrderMapper.orderListByRefundExport(itemType, tradeNo, startDate, endDate, miniAppName, orgId);
148
         return result;
148
         return result;
149
     }
149
     }
150
 
150
 

+ 6
- 1
src/main/java/com/huiju/estateagents/service/impl/TaMiniappServiceImpl.java View File

94
             wxUtils.newService(taMiniapp, true);
94
             wxUtils.newService(taMiniapp, true);
95
         }
95
         }
96
 
96
 
97
-        createOrgAccount(taMiniapp.getOrgId(), taMiniapp.getName());
97
+        QueryWrapper<TaOrgAccount> taOrgAccountQueryWrapper = new QueryWrapper<>();
98
+        taOrgAccountQueryWrapper.eq("org_id", taMiniapp.getOrgId());
99
+        Integer count = taOrgAccountMapper.selectCount(taOrgAccountQueryWrapper);
100
+        if (count < 1){
101
+            createOrgAccount(taMiniapp.getOrgId(), taMiniapp.getName());
102
+        }
98
 
103
 
99
         return taMiniapp;
104
         return taMiniapp;
100
     }
105
     }

+ 16
- 6
src/main/resources/mapper/redpack/TaOrgOrderMapper.xml View File

17
             d.audit_status,
17
             d.audit_status,
18
             d.audit_result,
18
             d.audit_result,
19
         </if>
19
         </if>
20
-        t.trading_status
20
+        t.trading_status,
21
+        t.pay_date
21
         From ta_org_order t
22
         From ta_org_order t
22
         left join ta_org_order_detail a on t.order_id = a.order_id
23
         left join ta_org_order_detail a on t.order_id = a.order_id
23
         left join ta_miniapp b on t.org_id = b.org_id
24
         left join ta_miniapp b on t.org_id = b.org_id
62
         t.create_date,
63
         t.create_date,
63
         c.phone,
64
         c.phone,
64
         t.trading_status,
65
         t.trading_status,
65
-        d.`name` as activityName
66
+        d.`name` as activityName,
67
+        t.pay_date
66
         From ta_org_order t
68
         From ta_org_order t
67
         left join ta_org_order_detail a on t.order_id = a.order_id
69
         left join ta_org_order_detail a on t.order_id = a.order_id
68
         left join ta_miniapp b on t.org_id = b.org_id
70
         left join ta_miniapp b on t.org_id = b.org_id
105
         t.trade_no as tradeNo,
107
         t.trade_no as tradeNo,
106
         FORMAT(t.amount/100, 2) as amount,
108
         FORMAT(t.amount/100, 2) as amount,
107
         b.name as miniAppName,
109
         b.name as miniAppName,
108
-        if(t.is_offline = 1, '业务线上充值', '运营手工充值') as isOffline,
110
+        if(t.is_offline = 1, '运营手工充值', '业务线上充值') as isOffline,
109
         t.create_date as createDate,
111
         t.create_date as createDate,
110
         if(t.trading_status = 'processing', '待支付', if(t.trading_status = 'success', '已支付','已超时')) as tradingStatus,
112
         if(t.trading_status = 'processing', '待支付', if(t.trading_status = 'success', '已支付','已超时')) as tradingStatus,
111
         t.pay_date as payDate
113
         t.pay_date as payDate
132
         <if test="miniAppName != null and miniAppName != ''">
134
         <if test="miniAppName != null and miniAppName != ''">
133
             and b.name like concat('%', #{miniAppName}, '%')
135
             and b.name like concat('%', #{miniAppName}, '%')
134
         </if>
136
         </if>
137
+        <if test="orgId != null and orgId != ''">
138
+            and t.org_id = #{orgId}
139
+        </if>
135
         GROUP BY t.order_id order by t.create_date desc
140
         GROUP BY t.order_id order by t.create_date desc
136
     </select>
141
     </select>
137
 
142
 
170
         <if test="miniAppName != null and miniAppName != ''">
175
         <if test="miniAppName != null and miniAppName != ''">
171
             and b.name like concat('%', #{miniAppName}, '%')
176
             and b.name like concat('%', #{miniAppName}, '%')
172
         </if>
177
         </if>
178
+        <if test="orgId != null and orgId != ''">
179
+            and t.org_id = #{orgId}
180
+        </if>
173
         GROUP BY t.order_id order by t.create_date desc
181
         GROUP BY t.order_id order by t.create_date desc
174
     </select>
182
     </select>
175
 
183
 
471
         b.name as miniAppName,
479
         b.name as miniAppName,
472
         t.create_date as createDate,
480
         t.create_date as createDate,
473
         d.audit_result as auditResult,
481
         d.audit_result as auditResult,
474
-        if(d.audit_status = 'checking', '未审核', if(d.audit_status = 'unAgree', '不同意','同意')) as auditStatus
482
+        if(d.audit_status = 'checking', '已申请', if(d.audit_status = 'unAgree', '已驳回','已退款')) as auditStatus
475
         From ta_org_order t
483
         From ta_org_order t
476
         left join ta_org_order_detail a on t.order_id = a.order_id
484
         left join ta_org_order_detail a on t.order_id = a.order_id
477
         left join ta_miniapp b on t.org_id = b.org_id
485
         left join ta_miniapp b on t.org_id = b.org_id
478
-        left join ta_org_account_certificate c on t.order_id = c.order_id
479
-        left join ta_org_refund_application d on d.org_id = t.org_id
486
+        left join ta_org_refund_application d on d.org_id = t.org_id and t.order_id = d.order_id
480
         where
487
         where
481
         a.item_type = #{itemType}
488
         a.item_type = #{itemType}
482
         <if test="tradeNo != null and tradeNo != ''">
489
         <if test="tradeNo != null and tradeNo != ''">
491
         <if test="miniAppName != null and miniAppName != ''">
498
         <if test="miniAppName != null and miniAppName != ''">
492
             and b.name like concat('%', #{miniAppName}, '%')
499
             and b.name like concat('%', #{miniAppName}, '%')
493
         </if>
500
         </if>
501
+        <if test="orgId != null and orgId != ''">
502
+            and t.org_id = #{orgId}
503
+        </if>
494
         GROUP BY t.order_id order by t.create_date desc
504
         GROUP BY t.order_id order by t.create_date desc
495
     </select>
505
     </select>
496
 
506