xuhy
2024-12-25 0acc148cc017272f7f68ea685d1e8a22452863ee
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
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
package com.stylefeng.guns.modular.api;
 
import com.stylefeng.guns.modular.system.service.IReassignService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.RestController;
 
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.util.Map;
 
/**
 * 第三方支付回调控制器
 */
@RestController
@RequestMapping("/base")
public class CallbackController {
 
    @Autowired
    private IReassignService reassignService;
//    @Autowired
//    private ICBCPayUtil icbcPayUtil;
 
 
 
 
    /**
     * 订单改派微信回调
     * @param request
     */
    @ResponseBody
    @PostMapping("/wxReassign")
    public void wxReassign(HttpServletRequest request, HttpServletResponse response){
        try {
//            Map<String, String> map = icbcPayUtil.payCallback(request);
//            if(null != map){
//                String id = map.get("out_trade_no");
//                String order_id = map.get("order_id");
//                //调用查询
//                String s = icbcPayUtil.queryTransaction("", order_id);
//                if(s.equals("0")){
//                    icbcPayUtil.answer(response);//回调应答
//                }
//                if(ToolUtil.isNotEmpty(id) && ToolUtil.isNotEmpty(order_id) && s.equals("0")){
//                    reassignService.payReassign(id, order_id, 1);
//                }
//            }
        }catch (Exception e){
            e.printStackTrace();
        }
    }
 
 
    /**
     * 订单改派支付宝回调
     * @param request
     */
    @ResponseBody
    @PostMapping("/aliReassign")
    public void aliReassign(HttpServletRequest request, HttpServletResponse response){
        try {
//            Map<String, String> map = icbcPayUtil.payCallback(request);
//            if(null != map){
//                String id = map.get("out_trade_no");
//                String order_id = map.get("order_id");
//                //调用查询
//                String s = icbcPayUtil.queryTransaction("", order_id);
//                if(s.equals("0")){
//                    icbcPayUtil.answer(response);//回调应答
//                }
//                if(ToolUtil.isNotEmpty(id) && ToolUtil.isNotEmpty(order_id) && s.equals("0")){
//                    reassignService.payReassign(id, order_id, 2);
//                }
//            }
        }catch (Exception e){
            e.printStackTrace();
        }
    }
}