admin
2020-01-01 48a204f4c90a80c0bb4e5ba1f9f0f42939cadba8
用户资金记录bug修改,京东,拼多多小程序商品转链
6个文件已修改
71 ■■■■ 已修改文件
fanli/src/main/java/com/yeshi/fanli/mapping/money/UserMoneyDetailMapper.xml 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/service/impl/order/OrderMoneySettleServiceImpl.java 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/service/impl/order/OrderProcessServiceImpl.java 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/util/jd/JDApiUtil.java 24 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/util/pinduoduo/PinDuoDuoApiUtil.java 34 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
utils/src/main/java/org/yeshi/utils/wx/WXXCXUtil.java 9 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/mapping/money/UserMoneyDetailMapper.xml
@@ -177,7 +177,7 @@
            <if test="beiZhu != null">#{beiZhu,jdbcType=VARCHAR},</if>
            <if test="createTime != null">#{createTime,jdbcType=TIMESTAMP},</if>
            <if test="updateTime != null">#{updateTime,jdbcType=TIMESTAMP},</if>
            <if test="orderType != null">#{orderType,jdbcType=INTEGER}</if>
            <if test="orderType != null">#{orderType,jdbcType=INTEGER},</if>
            <if test="show != null">#{show,jdbcType=BOOLEAN}</if>
        </trim>
    </insert>
fanli/src/main/java/com/yeshi/fanli/service/impl/order/OrderMoneySettleServiceImpl.java
@@ -484,6 +484,7 @@
                    }
                }
            } catch (Exception e) {
                LogHelper.errorDetailInfo(e);
                throw new OrderMoneySettleException(2, "维权订单出错");
            }
        }
fanli/src/main/java/com/yeshi/fanli/service/impl/order/OrderProcessServiceImpl.java
@@ -494,6 +494,7 @@
                                    hongBaoOrder.getCommonOrder().getSourceType(), key);
                            return TransactionStatus.CommitTransaction;
                        } catch (Exception e) {
                            e.printStackTrace();
                            return TransactionStatus.RollbackTransaction;
                        }
                    }
fanli/src/main/java/com/yeshi/fanli/util/jd/JDApiUtil.java
@@ -26,6 +26,7 @@
import com.yeshi.fanli.dto.jd.JDPingouInfo;
import com.yeshi.fanli.dto.jd.JDSearchResult;
import com.yeshi.fanli.dto.jd.JDShopInfo;
import com.yeshi.fanli.entity.bus.clazz.GoodsClass;
import com.yeshi.fanli.entity.jd.JDGoods;
import com.yeshi.fanli.entity.jd.JDOrder;
import com.yeshi.fanli.entity.jd.JDOrderItem;
@@ -172,7 +173,6 @@
        resultJson = JSONObject.fromObject(result);
        return resultJson.optJSONObject("data").optString("shortURL");
    }
    public static JDGoods queryGoodsDetail(Long skuId) {
        List<Long> skuIdList = new ArrayList<>();
@@ -580,12 +580,12 @@
        return searchResult;
    }
    public static JDSearchResult getGoodsClass() {
    public static List<GoodsClass> getGoodsClass(int parentId, int grade) {
        JDSearchResult searchResult = new JDSearchResult();
        List<JDGoods> list = new ArrayList<>();
        List<GoodsClass> list = new ArrayList<>();
        JSONObject json = new JSONObject();
        json.put("parentId", 0);
        json.put("grade", 0);
        json.put("parentId", parentId);
        json.put("grade", grade);
        JSONObject jsonDTO = new JSONObject();
        jsonDTO.put("req", json);
@@ -593,7 +593,7 @@
        String result = baseRequest2("jd.union.open.category.goods.get", null, jsonDTO);
        System.out.println(result);
        JSONObject resultJson = JSONObject.fromObject(result);
        resultJson = resultJson.optJSONObject("jd_union_open_goods_jingfen_query_response");
        resultJson = resultJson.optJSONObject("jd_union_open_category_goods_get_response");
        if (resultJson.optInt("code") == 0) {
            result = resultJson.optString("result");
            resultJson = JSONObject.fromObject(result);
@@ -602,9 +602,11 @@
                JSONArray array = resultJson.optJSONArray("data");
                if (array != null) {
                    for (int i = 0; i < array.size(); i++) {
                        JDGoods goods = parseJDGoods(array.optJSONObject(i));
                        if (goods != null)
                            list.add(goods);
                        GoodsClass gc = new GoodsClass();
                        JSONObject item = array.optJSONObject(i);
                        gc.setName(item.optString("name"));
                        gc.setId(item.optLong("id"));
                        list.add(gc);
                    }
                }
            }
@@ -612,11 +614,9 @@
            long totalCount = resultJson.optLong("totalCount");
            PageEntity pageEntity = new PageEntity();
            pageEntity.setTotalCount(totalCount);
            searchResult.setPageEntity(pageEntity);
        }
        searchResult.setGoodsList(list);
        return searchResult;
        return list;
    }
    public static JDGoods getGoodsDetail(Long skuId) {
fanli/src/main/java/com/yeshi/fanli/util/pinduoduo/PinDuoDuoApiUtil.java
@@ -278,6 +278,7 @@
        map.put("p_id", pid);
        map.put("multi_group", "true");
        map.put("generate_weapp_webview", "true");
        // map.put("generate_weiboapp_webview", "true");
        JSONArray array = new JSONArray();
        array.add(goodsId);
@@ -303,6 +304,39 @@
    }
    /**
     * 微信小程序转链 @Title: convertWXMP @Description: @param goodsId @param
     * pid @param customParams @return PDDPromotionUrl 返回类型 @throws
     */
    public static String convertWXMP(Long goodsId, String pid, String customParams) {
        Map<String, String> map = new HashMap<>();
        map.put("type", "pdd.ddk.goods.promotion.url.generate");
        map.put("p_id", pid);
        map.put("multi_group", "true");
        map.put("generate_we_app", "true");
        JSONArray array = new JSONArray();
        array.add(goodsId);
        map.put("goods_id_list", array.toString());
        if (!StringUtil.isNullOrEmpty(customParams)) {
            map.put("custom_parameters", customParams);
        }
        String result = baseRequest(map);
        JSONObject root = JSONObject.fromObject(result);
        JSONObject json = root.optJSONObject("goods_promotion_url_generate_response");
        if (json == null) {
            return null;
        }
        JSONArray resultArray = json.optJSONArray("goods_promotion_url_list");
        if (resultArray != null && resultArray.size() > 0) {
            JSONObject weApp = resultArray.optJSONObject(0).optJSONObject("we_app_info");
            if (weApp != null)
                return weApp.optString("page_path");
        }
        return null;
    }
    /**
     * 商品转链
     * 
     * @param goodsId
utils/src/main/java/org/yeshi/utils/wx/WXXCXUtil.java
@@ -16,7 +16,6 @@
import org.yeshi.utils.entity.wx.WXMPSessionInfo;
import org.yeshi.utils.entity.wx.WXMPUserInfo;
import com.aliyun.openservices.shade.io.netty.util.internal.StringUtil;
import com.google.gson.Gson;
import net.sf.json.JSONObject;
@@ -26,9 +25,7 @@
    public static InputStream getXCXCode(String accessToken, String path, String scene) {
        String url = "https://api.weixin.qq.com/wxa/getwxacodeunlimit?access_token=" + accessToken;
        JSONObject data = new JSONObject();
        data.put("scene", "123123,12312321123");
        data.put("scene", scene);
        data.put("page", path);
        // JSONObject color = new JSONObject();
        // color.put("r", );
@@ -37,7 +34,11 @@
        //
        // data.put("line_color", color);
        try {
        return HttpUtil.postForInputstream(url, data.toString());
        } catch (Exception e) {
            return null;
        }
    }
    // 获取有限的小程序码