shikeyin
2024-01-11 65da8373531677b1c37a98f53eaa30c892f35e5a
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
package com.iplatform.pay;
 
import com.iplatform.model.po.S_pay_notify;
import com.iplatform.pay.service.PlatformOrderServiceImpl;
import com.walker.pay.PayStatus;
import com.walker.pay.callback.AbstractOrderCallback;
 
public abstract class PlatformOrderCallback extends AbstractOrderCallback {
 
    /**
     * 是否已经存在该订单通知。
     * @param s_pay_notify 通知记录
//     * @param notifyId
     * @return
     */
    protected boolean isAlreadySuccessNotify(S_pay_notify s_pay_notify){
//        long orderId = Long.parseLong(notifyValue.getOrderId());
//        S_pay_notify exist = this.orderService.get(new S_pay_notify(orderId));
        if(s_pay_notify != null && s_pay_notify.getPay_status().equals(PayStatus.Success.getIndex())){
            logger.warn("订单通知已经接收,而且支付成功,不再重复处理,notifyId = {}, orderId = {}", s_pay_notify.getNotify_id(), s_pay_notify.getOrder_id());
            return true;
        }
        return false;
    }
 
    /**
     * 根据订单id查询已存在的通知记录。
     * @param orderId
     * @return
     */
    protected S_pay_notify getExistNotifyRecord(long orderId){
        return this.orderService.get(new S_pay_notify(orderId));
    }
 
    public void setOrderService(PlatformOrderServiceImpl orderService) {
        this.orderService = orderService;
    }
 
    protected PlatformOrderServiceImpl orderService;
}