nickchange
2023-10-10 ee9cb0da4a43bcf523ebb157678f64a2895fba1a
cloud-server-account/src/main/java/com/dsh/account/util/PayMoneyUtil.java
@@ -10,8 +10,17 @@
import com.alipay.api.domain.AlipayTradeQueryModel;
import com.alipay.api.request.*;
import com.alipay.api.response.*;
import com.dsh.account.dto.Receivers;
import com.dsh.account.feignclient.competition.DeductionCompetitionsClient;
import com.dsh.account.feignclient.competition.model.PaymentCompetition;
import com.dsh.account.feignclient.course.CoursePackageClient;
import com.dsh.account.feignclient.course.model.TCoursePackagePayment;
import com.dsh.account.feignclient.other.SiteClient;
import com.dsh.account.feignclient.other.model.SiteBooking;
import com.dsh.account.mapper.RechargeRecordsMapper;
import com.dsh.account.util.httpClinet.HttpClientUtil;
import org.apache.commons.collections.map.HashedMap;
import org.apache.http.client.methods.CloseableHttpResponse;
import org.bouncycastle.jce.provider.BouncyCastleProvider;
import org.dom4j.Document;
import org.dom4j.DocumentException;
@@ -21,6 +30,7 @@
import org.springframework.http.MediaType;
import org.springframework.stereotype.Component;
import javax.annotation.Resource;
import javax.crypto.BadPaddingException;
import javax.crypto.Cipher;
import javax.crypto.IllegalBlockSizeException;
@@ -389,7 +399,8 @@
    }
    @Resource
    private RechargeRecordsMapper rereMapper;
    /**
@@ -414,6 +425,9 @@
                    map1.put("transaction_id", map.get("transaction_id"));//微信支付订单号
                    String result = "<xml><return_code><![CDATA[SUCCESS]]></return_code><return_msg><![CDATA[OK]]></return_msg></xml>";
                    map1.put("result", result);
                    return map1;
                }else{
                    System.err.println(map.get("err_code_des"));
@@ -425,10 +439,57 @@
            e.printStackTrace();
        } catch (DocumentException e) {
            e.printStackTrace();
        } catch (Exception e) {
            throw new RuntimeException(e);
        }
        return null;
    }
@Resource
private CoursePackageClient coursePackageClient;
    @Resource
    private DeductionCompetitionsClient competitionsClient;
    @Resource
    private SiteClient siteClient;
    //分账
    public ResultUtil order(String code) throws Exception {
                  Integer    coursePackagePayments = coursePackageClient.queryByCode(code);
                  Integer paymentCompetitions = competitionsClient.queryByCode(code);
                  Integer siteBookings = siteClient.queryByCode(code);
//                    Map<String,String> headers = new HashMap<>();
//                    headers.put("Authorization",map.get("sign"));
//                    headers.put("Accept","application/json");
//                    headers.put("Wechatpay-Serial",certPath);
//
//                    List<Receivers> receivers = new ArrayList<>();
//
//                    Map<String,Object> body = new HashMap<>();
//                    body.put("appid",appid);
//                    body.put("transaction_id",map.get("transaction_id"));
//                    body.put("out_order_no",map.get("out_trade_no"));
//                    body.put("receivers",receivers);
//                    body.put("unfreeze_unsplit",true);
                    //支付分账
//                    String url ="https://api.mch.weixin.qq.com/v3/profitsharing/orders";
//                    CloseableHttpResponse closeableHttpResponse = HttpClientUtil.setPostHttpRequset(url, body, headers, "application/json");
//
    }
    /**
     * 微信扫码收款