Administrator
2025-03-18 124c85c184236ae4efa1047c4c203b0815ad215a
'bug修复'
2个文件已修改
15 ■■■■■ 已修改文件
src/main/java/com/taoke/autopay/utils/order/DYOrderApi.java 11 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/taoke/autopay/utils/order/OrderChannelApiUtil.java 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/taoke/autopay/utils/order/DYOrderApi.java
@@ -48,6 +48,7 @@
    private static DYOrderDto getOrderDetail1(String orderNo) throws KeyOrderException {
        String result = requestByOrderNo1(orderNo);
        try {
        JSONObject root = JSONObject.fromObject(result);
        if (root.optInt("code") != 1000) {
            logger.error(String.format("抖音订单查询出错(超享佣):%s - %s",orderNo, result));
@@ -57,18 +58,26 @@
        DYOrderDto dto =  JsonUtil.getSimpleGson().fromJson(data.toString(),DYOrderDto.class);
        dto.setOrderChannel(Constant.ORDER_CHANNEL_CYX);
        return dto;
        }catch(Exception e){
            throw new KeyOrderException(e.getMessage());
        }
    }
    private static DYOrderDto getOrderDetail2(String orderNo) throws KeyOrderException {
        String result = requestByOrderNo2(orderNo);
        logger.info(String.format("爆品社接口%s:%s", orderNo, result));
        System.out.println(result);
        JSONObject data = null;
        try {
        JSONObject root = JSONObject.fromObject(result);
        if (root.optInt("errCode") != 0) {
            logger.error(String.format("抖音订单查询出错(爆品社):%s - %s",orderNo, result));
            throw new KeyOrderException(root.optString("errMsg"));
        }
        JSONObject data = root.optJSONObject("data");
            data = root.optJSONObject("data");
        }catch(Exception e){
        }
        if(data==null){
            logger.error(String.format("抖音订单查询无数据(2):%s - %s",orderNo, result));
            throw new KeyOrderException("订单查询无数据");
src/main/java/com/taoke/autopay/utils/order/OrderChannelApiUtil.java
@@ -36,6 +36,7 @@
     * @param: orderChannelName
     **/
    public static boolean isMerchantCanPay(OrderChannelEnum channel, String merchant, BigDecimal payMoney) throws UnsupportedEncodingException {
       try {
        if (channel == OrderChannelEnum.cyx) {
            String url = String.format("https://api.youihuo.com/open/free.checkKsCompanyName?bsName=%s&apiKey=%s", URLEncoder.encode(merchant, "UTF-8"), OrderChannelUtil.CYX_API_KEY);
            String result = HttpUtil.get(url);
@@ -66,6 +67,9 @@
                }
            }
        }
       }catch(Exception e){
           logger.error("商家验证错误:", e);
       }
        return false;
    }