xuhy
2025-01-16 a1dd6582ec1a00911095ad7023e8935300eab93e
UserOKTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/api/OrderController.java
@@ -28,6 +28,7 @@
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.PrintWriter;
import java.text.SimpleDateFormat;
import java.util.*;
@@ -90,6 +91,8 @@
    @Autowired
    private IOrderCancelService orderCancelService;
    @Autowired
    private PayMoneyUtil payMoneyUtil;
    @Value("${pushMinistryOfTransport}")
    private boolean pushMinistryOfTransport;
@@ -1247,33 +1250,37 @@
    @PostMapping("/base/wxPayOrderTaxi")
    public void wxPayOrderTaxi(HttpServletRequest request, HttpServletResponse response){
        try {
            Map<String, String> map = icbcPayUtil.payCallback(request);
            System.out.println("完成订单微信支付回调");
            Map<String, String> map = payMoneyUtil.weixinpayCallback(request);
            System.out.println("wx支付信息:"+map);
            if(null != map){
                String order_id = map.get("transaction_id");
                String out_trade_no = 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(out_trade_no) && ToolUtil.isNotEmpty(order_id) && s.equals("0")){
                    String[] split = out_trade_no.split(",");
                String result = map.get("result");
                String total_fee = map.get("total_fee");
                String transaction_id = map.get("transaction_id");
                if(ToolUtil.isNotEmpty(out_trade_no) && ToolUtil.isNotEmpty(order_id)){
                    PrintWriter out = response.getWriter();
                    out.write(result);
                    out.flush();
                    out.close();
                    String[] split = out_trade_no.split("_");
                    Integer id = Integer.valueOf(split[0]);
                    Integer type = Integer.valueOf(split[1]);
                    switch (type){
                        case 1:
                            orderPrivateCarService.payOrderPrivateCarCallback(id, order_id, 1);
                            break;
                        case 2:
                            orderTaxiService.payOrderTaxiCallback(id, order_id, 1);
                            orderTaxiService.payOrderTaxiCallback(id, order_id, 2);
                            break;
                        case 3:
                            orderCrossCityService.payOrderCrossCityCallback(id, order_id, 1);
                            break;
                        case 4:
                            orderLogisticsService.payOrderLogisticsCallback(id, order_id, 1);
                            break;
                        case 5:
                            orderLogisticsService.payOrderLogisticsCallback(id, order_id, 1);
                            break;
                    }
                }