|
@@ -1,5 +1,6 @@
|
1
|
1
|
package com.yunzhi.niucai.service.impl;
|
2
|
2
|
|
|
3
|
+import com.alibaba.fastjson.JSONObject;
|
3
|
4
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
4
|
5
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
5
|
6
|
import com.yunzhi.niucai.common.CommConstants;
|
|
@@ -14,6 +15,7 @@ import com.yunzhi.niucai.enums.StatusEnum;
|
14
|
15
|
import com.yunzhi.niucai.mapper.TaOrderMapper;
|
15
|
16
|
import com.yunzhi.niucai.service.ITaBettingPlanService;
|
16
|
17
|
import com.yunzhi.niucai.service.ITaCustomerBettingService;
|
|
18
|
+import com.yunzhi.niucai.service.ITaOrderPayService;
|
17
|
19
|
import com.yunzhi.niucai.service.ITaOrderService;
|
18
|
20
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
19
|
21
|
import com.yunzhi.niucai.vo.DrawOrderParam;
|
|
@@ -21,6 +23,7 @@ import org.springframework.beans.factory.annotation.Autowired;
|
21
|
23
|
import org.springframework.stereotype.Service;
|
22
|
24
|
import org.springframework.transaction.annotation.Transactional;
|
23
|
25
|
|
|
26
|
+import java.time.LocalDateTime;
|
24
|
27
|
import java.util.ArrayList;
|
25
|
28
|
import java.util.List;
|
26
|
29
|
import java.util.Map;
|
|
@@ -42,6 +45,9 @@ public class TaOrderServiceImpl extends ServiceImpl<TaOrderMapper, TaOrder> impl
|
42
|
45
|
@Autowired
|
43
|
46
|
ITaBettingPlanService iTaBettingPlanService;
|
44
|
47
|
|
|
48
|
+ @Autowired
|
|
49
|
+ ITaOrderPayService iTaOrderPayService;
|
|
50
|
+
|
45
|
51
|
@Autowired
|
46
|
52
|
TaOrderMapper taOrderMapper;
|
47
|
53
|
|
|
@@ -141,6 +147,18 @@ public class TaOrderServiceImpl extends ServiceImpl<TaOrderMapper, TaOrder> impl
|
141
|
147
|
return taOrder;
|
142
|
148
|
}
|
143
|
149
|
|
|
150
|
+ @Override
|
|
151
|
+ public void fundTransNotify(JSONObject transRes) throws Exception {
|
|
152
|
+ // transRes 结构
|
|
153
|
+ // https://opendocs.alipay.com/apis/msgapi_60/alipay.fund.trans.order.changed#%E6%B6%88%E6%81%AF%E5%B1%9E%E6%80%A7
|
|
154
|
+ // 依据文档, 转账只有成功一种结果
|
|
155
|
+ String tradeNO = transRes.getString("out_biz_no");
|
|
156
|
+ String payDate = transRes.getString("pay_date");
|
|
157
|
+ LocalDateTime payTime = DateUtils.
|
|
158
|
+
|
|
159
|
+ iTaOrderPayService.updatePayResult(tradeNO, payDate, true, null);
|
|
160
|
+ }
|
|
161
|
+
|
144
|
162
|
private String nextOrderNo(String prefix, int length, boolean padDate) throws Exception {
|
145
|
163
|
List<String> parts = new ArrayList<>();
|
146
|
164
|
parts.add(prefix);
|