魏超 5 yıl önce
ebeveyn
işleme
422e3e3570

+ 6
- 3
src/main/java/com/huiju/estateagents/redpack/controller/TaOrgOrderController.java Dosyayı Görüntüle

@@ -113,6 +113,7 @@ public class TaOrgOrderController extends BaseController {
113 113
                                                    @RequestParam(value = "startDate", required = false) String startDate,
114 114
                                                    @RequestParam(value = "endDate", required = false) String endDate,
115 115
                                                    @RequestParam(value = "orderType", required = false) String orderType,
116
+                                                   @RequestParam(value = "orgId", required = false) Integer orgId,
116 117
                                                    HttpServletRequest request, HttpServletResponse response) throws IOException {
117 118
         response.setContentType("application/octet-stream");
118 119
         response.setCharacterEncoding("utf-8");
@@ -122,7 +123,7 @@ public class TaOrgOrderController extends BaseController {
122 123
         WriteSheet writeSheet = EasyExcel.writerSheet("活动统计").build();
123 124
 
124 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 127
         excelWriter.write(data, writeSheet);
127 128
         // finish 会帮忙关闭流
128 129
         excelWriter.finish();
@@ -141,6 +142,7 @@ public class TaOrgOrderController extends BaseController {
141 142
                                    @RequestParam(value = "startDate", required = false) String startDate,
142 143
                                    @RequestParam(value = "endDate", required = false) String endDate,
143 144
                                    @RequestParam(value = "orderType", required = false) String orderType,
145
+                                   @RequestParam(value = "orgId", required = false) Integer orgId,
144 146
                                    HttpServletRequest request, HttpServletResponse response) throws IOException {
145 147
         response.setContentType("application/octet-stream");
146 148
         response.setCharacterEncoding("utf-8");
@@ -150,7 +152,7 @@ public class TaOrgOrderController extends BaseController {
150 152
         WriteSheet writeSheet = EasyExcel.writerSheet("活动统计").build();
151 153
 
152 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 156
         excelWriter.write(data, writeSheet);
155 157
         // finish 会帮忙关闭流
156 158
         excelWriter.finish();
@@ -167,6 +169,7 @@ public class TaOrgOrderController extends BaseController {
167 169
                                    @RequestParam(value = "startDate", required = false) String startDate,
168 170
                                    @RequestParam(value = "endDate", required = false) String endDate,
169 171
                                    @RequestParam(value = "orderType", required = false) String orderType,
172
+                                   @RequestParam(value = "orgId", required = false) Integer orgId,
170 173
                                    HttpServletRequest request, HttpServletResponse response) throws IOException {
171 174
         response.setContentType("application/octet-stream");
172 175
         response.setCharacterEncoding("utf-8");
@@ -176,7 +179,7 @@ public class TaOrgOrderController extends BaseController {
176 179
         WriteSheet writeSheet = EasyExcel.writerSheet("活动统计").build();
177 180
 
178 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 183
         excelWriter.write(data, writeSheet);
181 184
         // finish 会帮忙关闭流
182 185
         excelWriter.finish();

+ 6
- 3
src/main/java/com/huiju/estateagents/redpack/mapper/TaOrgOrderMapper.java Dosyayı Görüntüle

@@ -75,7 +75,8 @@ public interface TaOrgOrderMapper extends BaseMapper<TaOrgOrder> {
75 75
                                                           @Param("tradingStatus") String tradingStatus,
76 76
                                                           @Param("startDate") String startDate,
77 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,7 +89,8 @@ public interface TaOrgOrderMapper extends BaseMapper<TaOrgOrder> {
88 89
                                                 @Param("tradingStatus") String tradingStatus,
89 90
                                                 @Param("startDate") String startDate,
90 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,7 +101,8 @@ public interface TaOrgOrderMapper extends BaseMapper<TaOrgOrder> {
99 101
                                               @Param("tradeNo") String tradeNo,
100 102
                                               @Param("startDate") String startDate,
101 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 Dosyayı Görüntüle

@@ -58,21 +58,21 @@ public interface ITaOrgOrderService extends IService<TaOrgOrder> {
58 58
      *
59 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 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 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 Dosyayı Görüntüle

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

+ 6
- 6
src/main/java/com/huiju/estateagents/redpack/service/impl/TaOrgOrderServiceImpl.java Dosyayı Görüntüle

@@ -131,20 +131,20 @@ public class TaOrgOrderServiceImpl extends ServiceImpl<TaOrgOrderMapper, TaOrgOr
131 131
     }
132 132
 
133 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 136
         return result;
137 137
     }
138 138
 
139 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 142
         return result;
143 143
     }
144 144
 
145 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 148
         return result;
149 149
     }
150 150
 

+ 6
- 1
src/main/java/com/huiju/estateagents/service/impl/TaMiniappServiceImpl.java Dosyayı Görüntüle

@@ -94,7 +94,12 @@ public class TaMiniappServiceImpl extends ServiceImpl<TaMiniappMapper, TaMiniapp
94 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 104
         return taMiniapp;
100 105
     }

+ 16
- 6
src/main/resources/mapper/redpack/TaOrgOrderMapper.xml Dosyayı Görüntüle

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