admin
2021-06-11 bc9d4bf3fddcb3107f8509159a250f7a5a5f8ae5
特价bug修复
10个文件已添加
18个文件已修改
1749 ■■■■ 已修改文件
fanli/src/main/java/com/yeshi/fanli/aspect/H5SignValidateAspect.java 274 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/controller/apph5/AppH5HelpCenterController.java 297 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/controller/client/lijin/GoodsControllerLijin.java 74 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/controller/client/v2/DynamicControllerV2.java 156 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/controller/client/v2/GoodsControllerV2.java 75 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/exception/pdd/PDDAuthException.java 16 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/exception/suning/SuningGoodsException.java 16 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/job/DynamicInfoJob.java 3 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/lijin/manager/GoodsLijinMnager.java 11 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/lijin/manager/UserLijinMnager.java 14 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/service/manger/ClipboardAnalysisManager.java 2 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/service/manger/goods/jd/JDConvertLinkManager.java 78 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/service/manger/goods/pdd/PDDConvertLinkManager.java 71 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/service/manger/goods/suning/SuningConvertLinkManager.java 55 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/service/manger/goods/tb/TBConvertLinkManager.java 186 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/service/manger/goods/tb/TaoBaoTokenAuctionIdMapManager.java 39 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/service/manger/goods/vipshop/VipShopConvertLinkManager.java 27 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/util/exception/ExceptionConstant.java 24 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/util/factory/goods/GoodsDetailVOLijinFactory.java 18 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/util/goods/GoodsJumpUtil.java 145 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/util/jd/JDUtil.java 5 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/util/pinduoduo/PinDuoDuoUtil.java 13 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/util/suning/SuningUtil.java 10 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/util/taobao/TaoBaoUtil.java 43 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/util/taobao/TaoKeApiUtil.java 56 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/util/vipshop/VipShopUtil.java 6 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/vo/goods/ConvertLinkJumpVO.java 33 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/vo/goods/GoodsJumpLinkVO.java 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/aspect/H5SignValidateAspect.java
@@ -11,6 +11,7 @@
import javax.servlet.http.HttpServletRequest;
import com.yeshi.fanli.entity.SystemEnum;
import com.yeshi.fanli.entity.accept.AcceptData;
import com.yeshi.fanli.util.SystemInfoUtil;
import org.aspectj.lang.ProceedingJoinPoint;
@@ -35,160 +36,169 @@
@Aspect
public class H5SignValidateAspect {
    public static final String EDP = "execution(* com.yeshi.fanli.controller.apph5.*.*(..))";
    public static final String EDP = "execution(* com.yeshi.fanli.controller.apph5.*.*(..))";
    public static String KEY = "thisWarning";
    public static String KEY = "thisWarning";
    public static String KEY_TEJIA = "@?,223Hbb88lll";
    @Around(EDP)
    public Object appH5Around(ProceedingJoinPoint joinPoint) throws IOException {
        Object[] args = joinPoint.getArgs();
        ServletRequestAttributes servletContainer = (ServletRequestAttributes) RequestContextHolder
                .getRequestAttributes();
        HttpServletRequest request = servletContainer.getRequest();
    @Around(EDP)
    public Object appH5Around(ProceedingJoinPoint joinPoint) throws IOException {
        Object[] args = joinPoint.getArgs();
        ServletRequestAttributes servletContainer = (ServletRequestAttributes) RequestContextHolder
                .getRequestAttributes();
        HttpServletRequest request = servletContainer.getRequest();
        AcceptData acceptData = null;
        for (Object obj : args) {
            if (obj instanceof AcceptData) {
                acceptData = (AcceptData) obj;
            }
        }
        AcceptData acceptData = null;
        for (Object obj : args) {
            if (obj instanceof AcceptData) {
                acceptData = (AcceptData) obj;
            }
        }
        Signature signature = joinPoint.getSignature();
        MethodSignature methodSignature = (MethodSignature) signature;
        Method targetMethod = methodSignature.getMethod();
        Method realMethod = null;
        try {
            realMethod = joinPoint.getTarget().getClass().getDeclaredMethod(joinPoint.getSignature().getName(),
                    targetMethod.getParameterTypes());
        } catch (NoSuchMethodException e2) {
            e2.printStackTrace();
        } catch (SecurityException e2) {
            e2.printStackTrace();
        }
        Signature signature = joinPoint.getSignature();
        MethodSignature methodSignature = (MethodSignature) signature;
        Method targetMethod = methodSignature.getMethod();
        Method realMethod = null;
        try {
            realMethod = joinPoint.getTarget().getClass().getDeclaredMethod(joinPoint.getSignature().getName(),
                    targetMethod.getParameterTypes());
        } catch (NoSuchMethodException e2) {
            e2.printStackTrace();
        } catch (SecurityException e2) {
            e2.printStackTrace();
        }
        if (acceptData != null && !StringUtil.isNullOrEmpty(acceptData.getPackages())) {
            acceptData.setSystem(SystemInfoUtil.getSystem(acceptData));
        }
        // 判断是否有忽略验证的注解
        if (realMethod != null && realMethod.isAnnotationPresent(RequestNoSignValidate.class)) {
            if(acceptData!=null){
                acceptData.setSystem(SystemInfoUtil.getSystem(acceptData));
            }
        // 判断是否有忽略验证的注解
        if (realMethod != null && realMethod.isAnnotationPresent(RequestNoSignValidate.class)) {
            if (acceptData != null) {
                acceptData.setSystem(SystemInfoUtil.getSystem(acceptData));
            }
            try {
                return joinPoint.proceed(args);
            } catch (Throwable e) {
                LogHelper.errorDetailInfo(e, getHttpServletParams(request), request.getRequestURI().toString());
            }
        }
            try {
                return joinPoint.proceed(args);
            } catch (Throwable e) {
                LogHelper.errorDetailInfo(e, getHttpServletParams(request), request.getRequestURI().toString());
            }
        }
        PrintWriter out = servletContainer.getResponse().getWriter();
        String callback = request.getParameter("callback");
        PrintWriter out = servletContainer.getResponse().getWriter();
        String callback = request.getParameter("callback");
        String sign = request.getParameter("sign");
        Map<String, String> parameterMap = request.getParameterMap();
        // 参数-、sign 均不能为空
        if (parameterMap == null || StringUtil.isNullOrEmpty(sign)) {
            JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult("签名错误"));
            return null;
        }
        String sign = request.getParameter("sign");
        Map<String, String> parameterMap = request.getParameterMap();
        // 参数-、sign 均不能为空
        if (parameterMap == null || StringUtil.isNullOrEmpty(sign)) {
            JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult("签名错误"));
            return null;
        }
        boolean isRight = signIsRight(sign, parameterMap);
        boolean isRight = signIsRight(sign, parameterMap, acceptData.getSystem());
        // 签名是否正确
        if (isRight) {
            if(acceptData!=null){
                acceptData.setSystem(SystemInfoUtil.getSystem(acceptData));
            }
            Object obj = null;
            try {
                obj = joinPoint.proceed(args);
            } catch (Throwable e) {
                e.printStackTrace();
                try {
                    LogHelper.errorDetailInfo(e, getHttpServletParams(request), request.getRequestURI().toString());
                } catch (Exception e1) {
                    e1.printStackTrace();
                }
            }
            return obj;
        } else {
            JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult("签名错误"));
            out.close();
            LogHelper.error("H5签名错误:" + getHttpServletParams(request));
            return null;
        }
    }
        // 签名是否正确
        if (isRight) {
    /**
     * 获取请求参数
     *
     * @param request
     * @return
     */
    private String getHttpServletParams(HttpServletRequest request) {
        if (request == null) {
            return "";
        }
        Map map = request.getParameterMap();
        if (map != null) {
            Iterator<String> its = map.keySet().iterator();
            JSONObject json = new JSONObject();
            while (its.hasNext()) {
                String next = its.next();
                if (map.get(next) != null) {
                    Object[] objects = (Object[]) map.get(next);
                    if (objects != null && objects.length > 0) {
                        json.put(next, objects[0].toString());
                    }
                }
            }
            return json.toString();
        }
        return "";
    }
            if (acceptData != null) {
                acceptData.setSystem(SystemInfoUtil.getSystem(acceptData));
            }
    /**
     * 验证是否正确
     *
     * @param sign
     * @param parameterMap
     * @return
     */
    @SuppressWarnings("unchecked")
    private boolean signIsRight(String sign, Map<String, String> map) {
        int i = 0;
            Object obj = null;
            try {
                obj = joinPoint.proceed(args);
            } catch (Throwable e) {
                e.printStackTrace();
                try {
                    LogHelper.errorDetailInfo(e, getHttpServletParams(request), request.getRequestURI().toString());
                } catch (Exception e1) {
                    e1.printStackTrace();
                }
            }
            return obj;
        } else {
            JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult("签名错误"));
            out.close();
            LogHelper.error("H5签名错误:" + getHttpServletParams(request));
            return null;
        }
    }
        List<String> list = new ArrayList<>();
    /**
     * 获取请求参数
     *
     * @param request
     * @return
     */
    private String getHttpServletParams(HttpServletRequest request) {
        if (request == null) {
            return "";
        }
        Map map = request.getParameterMap();
        if (map != null) {
            Iterator<String> its = map.keySet().iterator();
            JSONObject json = new JSONObject();
            while (its.hasNext()) {
                String next = its.next();
                if (map.get(next) != null) {
                    Object[] objects = (Object[]) map.get(next);
                    if (objects != null && objects.length > 0) {
                        json.put(next, objects[0].toString());
                    }
                }
            }
            return json.toString();
        }
        return "";
    }
        Iterator<String> iterator = map.keySet().iterator();
    /**
     * 验证是否正确
     *
     * @param sign
     * @param map
     * @return
     */
    @SuppressWarnings("unchecked")
    private boolean signIsRight(String sign, Map<String, String> map, SystemEnum system) {
        int i = 0;
        while (iterator.hasNext()) {
            String key = iterator.next();
        List<String> list = new ArrayList<>();
            if ("sign".equalsIgnoreCase(key) || "callback".equalsIgnoreCase(key) || "_".equalsIgnoreCase(key)) {
                continue;
            }
        Iterator<String> iterator = map.keySet().iterator();
            Object value = map.get(key);
            Object[] values = (Object[]) value;
            list.add(values[0].toString());
        }
        Collections.sort(list);
        while (iterator.hasNext()) {
            String key = iterator.next();
        StringBuffer sb = new StringBuffer();
            if ("sign".equalsIgnoreCase(key) || "callback".equalsIgnoreCase(key) || "_".equalsIgnoreCase(key)) {
                continue;
            }
        for (String val : list) {
            sb.append(val);
            sb.append("###");
        }
            Object value = map.get(key);
            Object[] values = (Object[]) value;
            list.add(values[0].toString());
        }
        Collections.sort(list);
        String md5 = StringUtil.Md5(sb.toString() + KEY);
        StringBuffer sb = new StringBuffer();
        if (!md5.equalsIgnoreCase(sign)) {
            return false;
        } else {
            return true;
        }
    }
        for (String val : list) {
            sb.append(val);
            sb.append("###");
        }
        String md5 = StringUtil.Md5(sb.toString() + KEY);
        if (system != null && system == SystemEnum.yhqjx) {
            md5 = StringUtil.Md5(sb.toString() + KEY_TEJIA);
        }
        if (!md5.equalsIgnoreCase(sign)) {
            return false;
        } else {
            return true;
        }
    }
}
fanli/src/main/java/com/yeshi/fanli/controller/apph5/AppH5HelpCenterController.java
@@ -31,174 +31,179 @@
@RequestMapping("api/apph5/v1/helpCenter")
public class AppH5HelpCenterController {
    @Resource
    private HelpCenterService helpCenterService;
    @Resource
    private HelpCenterService helpCenterService;
    @Resource
    private HelpClassService helpClassService;
    @Resource
    private HelpClassService helpClassService;
    @Resource
    private AppVersionService appVersionService;
    @Resource
    private AppVersionService appVersionService;
    @Resource
    private AdActivityVersionControlService adActivityVersionControlService;
    @Resource
    private AdActivityVersionControlService adActivityVersionControlService;
    /**
     * 查询帮助列表
     * @param callback
     * @param pageSize
     * @param key
     * @param out
     */
    @RequestMapping(value = "query")
    public void query(String callback, AcceptData acceptData, Long pageId, Integer pageSize, String key, Long cid,
            PrintWriter out) {
        //其他APP无帮助中心列表
        acceptData.setSystem(SystemEnum.blks);
        try {
            if (pageSize == null)
                pageSize = Constant.PAGE_SIZE;
    /**
     * 查询帮助列表
     *
     * @param callback
     * @param pageSize
     * @param key
     * @param out
     */
    @RequestMapping(value = "query")
    public void query(String callback, AcceptData acceptData, Long pageId, Integer pageSize, String key, Long cid,
                      PrintWriter out) {
        //其他APP无帮助中心列表
        if (acceptData.getSystem() == null)
            acceptData.setSystem(SystemEnum.blks);
        try {
            if (pageSize == null)
                pageSize = Constant.PAGE_SIZE;
            if (cid != null && cid == 0)
                cid = null; // 查询全部
            if (cid != null && cid == 0)
                cid = null; // 查询全部
            if (!StringUtil.isNullOrEmpty(key))
                key = key.trim();
            if (!StringUtil.isNullOrEmpty(key))
                key = key.trim();
            if (pageId == null)
                pageId = 0L;
            if (pageId == null)
                pageId = 0L;
            List<HelpCenter> list1 = helpCenterService.listValid(pageId, pageSize, key, cid,acceptData.getSystem());
            List<HelpCenter> list = new ArrayList<>();
            if (list1 != null && list1.size() > 0)
                list.addAll(list1);
            List<HelpCenter> list1 = helpCenterService.listValid(pageId, pageSize, key, cid, acceptData.getSystem());
            List<HelpCenter> list = new ArrayList<>();
            if (list1 != null && list1.size() > 0)
                list.addAll(list1);
            if (list.size() == 0) {
            if (list.size() == 0) {
                pageId = 0L;
            } else {
                pageId = 0L;
            } else {
                pageId = list.get(list.size() - 1).getId();
                pageId = list.get(list.size() - 1).getId();
                // 版本过滤
                int version = Integer.parseInt(acceptData.getVersion());
                String platform = acceptData.getPlatform().toLowerCase();
                List<AppVersionInfo> versionList = appVersionService.listByPlatformAndMinVersionCode(platform, version,acceptData.getSystem());
                if (versionList == null || versionList.size() <= 0) {
                    list.clear();
                } else {
                    List<Long> sourceIdList = new ArrayList<>();
                    for (HelpCenter record : list) {
                        sourceIdList.add(record.getId());
                    }
                    List<Long> versionIdList = new ArrayList<>();
                    for (AppVersionInfo versionInfo : versionList)
                        versionIdList.add(versionInfo.getId());
                    Set<Long> sets = adActivityVersionControlService.filterSourceIdByVersion(sourceIdList,
                            AdActivityType.helpCenter, versionIdList);
                // 版本过滤
                int version = Integer.parseInt(acceptData.getVersion());
                String platform = acceptData.getPlatform().toLowerCase();
                List<AppVersionInfo> versionList = appVersionService.listByPlatformAndMinVersionCode(platform, version, acceptData.getSystem());
                if (versionList == null || versionList.size() <= 0) {
                    list.clear();
                } else {
                    List<Long> sourceIdList = new ArrayList<>();
                    for (HelpCenter record : list) {
                        sourceIdList.add(record.getId());
                    }
                    List<Long> versionIdList = new ArrayList<>();
                    for (AppVersionInfo versionInfo : versionList)
                        versionIdList.add(versionInfo.getId());
                    Set<Long> sets = adActivityVersionControlService.filterSourceIdByVersion(sourceIdList,
                            AdActivityType.helpCenter, versionIdList);
                    for (int i = 0; i < list.size(); i++) {
                        if (!sets.contains(list.get(i).getId())) {
                            list.remove(i--);
                        }
                    }
                }
            }
                    for (int i = 0; i < list.size(); i++) {
                        if (!sets.contains(list.get(i).getId())) {
                            list.remove(i--);
                        }
                    }
                }
            }
            JSONObject data = new JSONObject();
            data.put("pageId", pageId);
            data.put("result_list", JsonUtil.getApiCommonGson().toJson(list));
            JsonUtil.printMode(out, callback, JsonUtil.loadTrueResult(data));
        } catch (Exception e) {
            JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult("暂无数据"));
            e.printStackTrace();
        }
    }
            JSONObject data = new JSONObject();
            data.put("pageId", pageId);
            data.put("result_list", JsonUtil.getApiCommonGson().toJson(list));
            JsonUtil.printMode(out, callback, JsonUtil.loadTrueResult(data));
        } catch (Exception e) {
            JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult("暂无数据"));
            e.printStackTrace();
        }
    }
    /**
     * 获取帮助详情
     * @param callback
     * @param id
     * @param out
     */
    @RequestMapping(value = "getInfo")
    public void getInfo(String callback, Long id, PrintWriter out) {
        try {
            if (id == null) {
                JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult("该内容不存在"));
                return;
            }
            HelpCenter crrent = helpCenterService.selectByPrimaryKeyCache(id);
            if (crrent == null) {
                JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult("该内容已不存在"));
                return;
            }
    /**
     * 获取帮助详情
     *
     * @param callback
     * @param id
     * @param out
     */
    @RequestMapping(value = "getInfo")
    public void getInfo(String callback, Long id, PrintWriter out) {
        try {
            if (id == null) {
                JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult("该内容不存在"));
                return;
            }
            HelpCenter crrent = helpCenterService.selectByPrimaryKeyCache(id);
            if (crrent == null) {
                JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult("该内容已不存在"));
                return;
            }
            String html = null;
            HelpInfo helpInfo = helpCenterService.getHelpInfoCache(id);
            if (helpInfo != null) {
                html = helpInfo.getHtml();
            }
            String html = null;
            HelpInfo helpInfo = helpCenterService.getHelpInfoCache(id);
            if (helpInfo != null) {
                html = helpInfo.getHtml();
            }
            JSONObject data = new JSONObject();
            data.put("id", crrent.getId());
            data.put("title", crrent.getTitle());
            data.put("html", html);
            JsonUtil.printMode(out, callback, JsonUtil.loadTrueResult(data));
        } catch (Exception e) {
            JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult("数据失败"));
            e.printStackTrace();
        }
    }
            JSONObject data = new JSONObject();
            data.put("id", crrent.getId());
            data.put("title", crrent.getTitle());
            data.put("html", html);
            JsonUtil.printMode(out, callback, JsonUtil.loadTrueResult(data));
        } catch (Exception e) {
            JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult("数据失败"));
            e.printStackTrace();
        }
    }
    /**
     * 查询启用的分类
     * @param callback
     * @param out
     */
    @RequestMapping(value = "getClass")
    public void getClass(String callback, AcceptData acceptData, PrintWriter out) {
        acceptData.setSystem(SystemEnum.blks);
        try {
            List<HelpClass> resultList = new ArrayList<>();
    /**
     * 查询启用的分类
     *
     * @param callback
     * @param out
     */
    @RequestMapping(value = "getClass")
    public void getClass(String callback, AcceptData acceptData, PrintWriter out) {
        if (acceptData.getSystem() == null)
            acceptData.setSystem(SystemEnum.blks);
        try {
            List<HelpClass> resultList = new ArrayList<>();
            List<HelpClass> list = helpClassService.getClassByState(1,acceptData.getSystem());
            if (list != null && list.size() > 0) {
                resultList.addAll(list);
            }
            List<HelpClass> list = helpClassService.getClassByState(1, acceptData.getSystem());
            if (list != null && list.size() > 0) {
                resultList.addAll(list);
            }
            // 版本过滤
            int version = Integer.parseInt(acceptData.getVersion());
            String platform = acceptData.getPlatform().toLowerCase();
            List<AppVersionInfo> versionList = appVersionService.listByPlatformAndMinVersionCode(platform, version,acceptData.getSystem());
            if (versionList == null || versionList.size() <= 0) {
                resultList.clear();
            } else {
                List<Long> sourceIdList = new ArrayList<>();
                for (HelpClass record : resultList) {
                    sourceIdList.add(record.getId());
                }
                List<Long> versionIdList = new ArrayList<>();
                for (AppVersionInfo versionInfo : versionList)
                    versionIdList.add(versionInfo.getId());
                Set<Long> sets = adActivityVersionControlService.filterSourceIdByVersion(sourceIdList,
                        AdActivityType.helpClass, versionIdList);
            // 版本过滤
            int version = Integer.parseInt(acceptData.getVersion());
            String platform = acceptData.getPlatform().toLowerCase();
            List<AppVersionInfo> versionList = appVersionService.listByPlatformAndMinVersionCode(platform, version, acceptData.getSystem());
            if (versionList == null || versionList.size() <= 0) {
                resultList.clear();
            } else {
                List<Long> sourceIdList = new ArrayList<>();
                for (HelpClass record : resultList) {
                    sourceIdList.add(record.getId());
                }
                List<Long> versionIdList = new ArrayList<>();
                for (AppVersionInfo versionInfo : versionList)
                    versionIdList.add(versionInfo.getId());
                Set<Long> sets = adActivityVersionControlService.filterSourceIdByVersion(sourceIdList,
                        AdActivityType.helpClass, versionIdList);
                for (int i = 0; i < list.size(); i++) {
                    if (!sets.contains(list.get(i).getId())) {
                        list.remove(i--);
                for (int i = 0; i < list.size(); i++) {
                    if (!sets.contains(list.get(i).getId())) {
                        list.remove(i--);
                    }
                }
            }
                    }
                }
            }
            JSONObject data = new JSONObject();
            data.put("class_list", JsonUtil.getApiCommonGson().toJson(resultList));
            JsonUtil.printMode(out, callback, JsonUtil.loadTrueResult(data));
        } catch (Exception e) {
            JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult("操作异常"));
            e.printStackTrace();
        }
    }
            JSONObject data = new JSONObject();
            data.put("class_list", JsonUtil.getApiCommonGson().toJson(resultList));
            JsonUtil.printMode(out, callback, JsonUtil.loadTrueResult(data));
        } catch (Exception e) {
            JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult("操作异常"));
            e.printStackTrace();
        }
    }
}
fanli/src/main/java/com/yeshi/fanli/controller/client/lijin/GoodsControllerLijin.java
@@ -20,11 +20,14 @@
import com.yeshi.fanli.entity.bus.user.ShamUser;
import com.yeshi.fanli.entity.goods.CollectionGoodsV2;
import com.yeshi.fanli.entity.jd.JDGoods;
import com.yeshi.fanli.exception.goods.CommonGoodsException;
import com.yeshi.fanli.exception.goods.ScanHistoryException;
import com.yeshi.fanli.exception.pdd.PDDApiException;
import com.yeshi.fanli.exception.taobao.TaobaoGoodsDownException;
import com.yeshi.fanli.lijin.manager.GoodsLijinMnager;
import com.yeshi.fanli.lijin.manager.UserLijinMnager;
import com.yeshi.fanli.service.inter.goods.CollectionGoodsV2Service;
import com.yeshi.fanli.service.inter.goods.ScanHistoryV2Service;
import com.yeshi.fanli.service.inter.pdd.PDDAuthService;
import com.yeshi.fanli.service.inter.taobao.TaoBaoGoodsUpdateService;
import com.yeshi.fanli.service.inter.taobao.TaoBaoShopService;
@@ -87,6 +90,8 @@
    @Resource
    private PIDManager pidManager;
    @Resource
    private ScanHistoryV2Service scanHistoryV2Service;
    /**
@@ -114,6 +119,11 @@
                goodsDetailVO.setGoods(GoodsDetailVOLijinFactory.convertTaoBao(goods, paramsDTO));
                BigDecimal lijinAmount = goodsLijinMnager.getTBLijin(uid, goods);
                if (lijinAmount != null && lijinAmount.compareTo(new BigDecimal(0)) > 0) {
                    goodsDetailVO.getGoods().getMoneyInfo().setHongBaoMoney("¥" + lijinAmount);
                    GoodsDetailVOLijinFactory.fillRights(goodsDetailVO.getGoods());
                }
                // 店铺信息
                TaoBaoShop shop = taoBaoShopService.getTaoBaoShop(goods.getId(), goods.getSellerId());
                if (shop != null) {
@@ -125,7 +135,18 @@
                }
                extraVO.setDetailUrl("http://apph5.banliapp.com/apppage/goods_img.html?id=" + goodsId);
                ThreadUtil.run(new Runnable() {
                    @Override
                    public void run() {
                        try {
                            scanHistoryV2Service.addScanHistory(uid, acceptData.getDevice(), goods);
                        } catch (CommonGoodsException e) {
                            e.printStackTrace();
                        } catch (ScanHistoryException e) {
                            e.printStackTrace();
                        }
                    }
                });
                break;
            case Constant
@@ -133,7 +154,18 @@
                JDGoods jdGoods = getJDGoods(Long.parseLong(goodsId));
                goodsDetailVO.setGoods(GoodsDetailVOLijinFactory.convertJDGoods(jdGoods, paramsDTO));
                extraVO.setDetailUrl("https://in.m.jd.com/product/jieshao/video/" + goodsId + ".html");
                ThreadUtil.run(new Runnable() {
                    @Override
                    public void run() {
                        try {
                            scanHistoryV2Service.addJDScanHistory(uid, acceptData.getDevice(), jdGoods);
                        } catch (CommonGoodsException e) {
                            e.printStackTrace();
                        } catch (ScanHistoryException e) {
                            e.printStackTrace();
                        }
                    }
                });
                break;
            case Constant
@@ -141,12 +173,36 @@
                PDDGoodsDetail pddGoodsDetail = getPDDGoods(acceptData.getSystem(), Long.parseLong(goodsId), uid);
                goodsDetailVO.setGoods(GoodsDetailVOLijinFactory.convertPDDGoods(pddGoodsDetail, paramsDTO));
                extraVO.setDetailUrl("http://apph5.banliapp.com/apppage/goods_img_pdd.html?id=" + goodsId);
                ThreadUtil.run(new Runnable() {
                    @Override
                    public void run() {
                        try {
                            scanHistoryV2Service.addPDDScanHistory(uid, acceptData.getDevice(), pddGoodsDetail);
                        } catch (CommonGoodsException e) {
                            e.printStackTrace();
                        } catch (ScanHistoryException e) {
                            e.printStackTrace();
                        }
                    }
                });
                break;
            case Constant
                    .SOURCE_TYPE_VIP:
                VIPGoodsInfo vipGoodsInfo = VipShopApiUtil.getGoodsDetail(goodsId);
                goodsDetailVO.setGoods(GoodsDetailVOLijinFactory.convertVIPGoods(vipGoodsInfo, paramsDTO));
                ThreadUtil.run(new Runnable() {
                    @Override
                    public void run() {
                        try {
                            scanHistoryV2Service.addVIPScanHistory(uid, acceptData.getDevice(), vipGoodsInfo);
                        } catch (CommonGoodsException e) {
                            e.printStackTrace();
                        } catch (ScanHistoryException e) {
                            e.printStackTrace();
                        }
                    }
                });
                break;
            case Constant
@@ -159,6 +215,20 @@
                extraVO.setDetailUrl("http://apph5.banliapp.com/apppage/goods_img_suning.html?id="
                        + suningGoodsInfo.getCommodityInfo().getCommodityCode() + "&supplierCode="
                        + suningGoodsInfo.getCommodityInfo().getSupplierCode());
                ThreadUtil.run(new Runnable() {
                    @Override
                    public void run() {
                        try {
                            scanHistoryV2Service.addSuningScanHistory(uid, acceptData.getDevice(), suningGoodsInfo);
                        } catch (CommonGoodsException e) {
                            e.printStackTrace();
                        } catch (ScanHistoryException e) {
                            e.printStackTrace();
                        }
                    }
                });
                break;
        }
fanli/src/main/java/com/yeshi/fanli/controller/client/v2/DynamicControllerV2.java
@@ -13,19 +13,39 @@
import java.util.List;
import java.util.Map;
import java.util.UUID;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
import javax.annotation.Resource;
import com.ks.lib.common.exception.ParamsException;
import com.yeshi.fanli.dto.pdd.PDDGoodsDetail;
import com.yeshi.fanli.entity.SystemEnum;
import com.yeshi.fanli.entity.SystemFunction;
import com.yeshi.fanli.entity.SystemPIDInfo;
import com.yeshi.fanli.exception.pdd.PDDAuthException;
import com.yeshi.fanli.exception.pdd.PDDGoodsException;
import com.yeshi.fanli.exception.taobao.TaoBaoConvertLinkException;
import com.yeshi.fanli.exception.taobao.TaoBaoTokenParseException;
import com.yeshi.fanli.service.inter.pdd.PDDAuthService;
import com.yeshi.fanli.service.manger.ClipboardContentType;
import com.yeshi.fanli.service.manger.PIDManager;
import com.yeshi.fanli.service.manger.goods.TaoBaoLinkManager;
import com.yeshi.fanli.service.manger.goods.jd.JDConvertLinkManager;
import com.yeshi.fanli.service.manger.goods.pdd.PDDConvertLinkManager;
import com.yeshi.fanli.service.manger.goods.suning.SuningConvertLinkManager;
import com.yeshi.fanli.service.manger.goods.tb.TBConvertLinkManager;
import com.yeshi.fanli.service.manger.goods.vipshop.VipShopConvertLinkManager;
import com.yeshi.fanli.util.*;
import com.yeshi.fanli.util.StringUtil;
import com.yeshi.fanli.util.exception.ExceptionConstant;
import com.yeshi.fanli.util.goods.GoodsJumpUtil;
import com.yeshi.fanli.util.goods.GoodsTextUtil;
import com.yeshi.fanli.util.suning.SuningUtil;
import com.yeshi.fanli.util.taobao.TaoKeApiUtil;
import com.yeshi.fanli.util.vipshop.VipShopUtil;
import com.yeshi.fanli.vo.goods.ConvertLinkJumpVO;
import com.yeshi.fanli.vo.pdd.PDDConvertLinkResultVO;
import org.apache.commons.beanutils.PropertyUtils;
import org.springframework.core.task.TaskExecutor;
import org.springframework.stereotype.Controller;
@@ -146,10 +166,28 @@
    private ConvertLinkManager convertLinkManager;
    @Resource
    private TBConvertLinkManager tbConvertLinkManager;
    @Resource
    private JDConvertLinkManager jdConvertLinkManager;
    @Resource
    private PDDConvertLinkManager pddConvertLinkManager;
    @Resource
    private SuningConvertLinkManager suningConvertLinkManager;
    @Resource
    private VipShopConvertLinkManager vipShopConvertLinkManager;
    @Resource
    private DailyCountMomentsService dailyCountMomentsService;
    @Resource
    private CommonShareInfoService commonShareInfoService;
    @Resource
    private PDDAuthService pddAuthService;
    @Resource
@@ -823,6 +861,124 @@
    }
    /**
     * 转链
     *
     * @param acceptData
     * @param uid
     * @param link
     * @param out
     */
    @RequestMapping(value = "convertLink", method = RequestMethod.POST)
    public void convertLink(AcceptData acceptData, Long uid, String link, PrintWriter out) {
        if (StringUtil.isNullOrEmpty(link)) {
            out.print(JsonUtil.loadFalseResult("链接为空"));
            return;
        }
        ConvertLinkJumpVO convertLinkJumpVO = null;
        //判断result是否为淘口令
        List<String> urlList = UrlUtils.parseUrlsFromText(link);
        if (urlList.size() > 0) {
            //只处理京东/拼多多链接
            String url = urlList.get(0);
            if (JDUtil.isJDLink(url)) {
                try {
                    url = jdConvertLinkManager.convertShortUrl(url, uid, acceptData.getSystem(), SystemPIDInfo.PidType.fanli);
                } catch (ParamsException e) {
                    e.printStackTrace();
                }
                convertLinkJumpVO = new ConvertLinkJumpVO(GoodsJumpUtil.getJDJumpInfo(url), Constant.SOURCE_TYPE_JD);
                outPrintConvertResult(convertLinkJumpVO, out);
                return;
            }
            if (PinDuoDuoUtil.isPDDLink(url)) {
                String pddGoodsId = PinDuoDuoUtil.getPDDGoodsId(url);
                String customParams = pddAuthService.getFanliCustomParams(uid);
                PDDConvertLinkResultVO convertLinkResult = null;
                try {
                    convertLinkResult = pddConvertLinkManager.convertGoods(Long.parseLong(pddGoodsId), acceptData.getSystem(), customParams, SystemPIDInfo.PidType.fanli);
                    convertLinkJumpVO = new ConvertLinkJumpVO(GoodsJumpUtil.getPDDJumpInfo(convertLinkResult), Constant.SOURCE_TYPE_PDD);
                    outPrintConvertResult(convertLinkJumpVO, out);
                    return;
                } catch (PDDGoodsException e) {
                    e.printStackTrace();
                    //商品下线
                    out.print(JsonUtil.loadFalseResult(ExceptionConstant.CODE_GOODS_OFFLINE, "商品已下线"));
                    return;
                } catch (PDDAuthException e) {
                    e.printStackTrace();
                    //拼多多未授权
                    out.print(JsonUtil.loadFalseResult(ExceptionConstant.CODE_AUTH_PDD_NO_AUTH, "拼多多尚未授权,请授权"));
                    return;
                }
            }
            return;
        }
        List<String> tokenList = TaoBaoUtil.getTokenListFromTextWithKuoHao(link);
        if (tokenList.size() > 0) {
            //还原口令
            try {
                TaoKeApiUtil.TokenConvertResult convertResult = TaoKeApiUtil.tokenConvert(tokenList.get(0));
                if (convertResult != null) {
                    String originUrl = convertResult.getOrigin_url();
                    long goodsId = convertResult.getNum_iid();
                    TaoBaoLink taoBaoLink = tbConvertLinkManager.convertGoods(goodsId, uid, acceptData.getSystem(), SystemPIDInfo.PidType.fanli);
                    convertLinkJumpVO = new ConvertLinkJumpVO(GoodsJumpUtil.getTBJumpInfo(taoBaoLink), Constant.SOURCE_TYPE_TAOBAO);
                    outPrintConvertResult(convertLinkJumpVO, out);
                    return;
                } else {
                    throw new Exception("转链失败");
                }
            } catch (Exception e) {
                e.printStackTrace();
                //输出原来的淘口令
                JSONObject root = new JSONObject();
                root.put("data", new Gson().toJson(new ConvertLinkJumpVO(null, Constant.SOURCE_TYPE_TAOBAO)));
                root.put("code", ExceptionConstant.CODE_JUMP_NO_SUPPORT);
                out.print(root.toString());
                return;
            }
        }
        out.print(JsonUtil.loadFalseResult("不支持的类型"));
    }
    private void outPrintConvertResult(ConvertLinkJumpVO vo, PrintWriter out) {
        out.print(JsonUtil.loadTrueResult(new Gson().toJson(vo)));
    }
    /**
     * 复制推荐语
     *
     * @param acceptData
     * @param uid
     * @param id
     * @param type
     * @param goodsId
     * @param goodsType
     * @param out
     */
    @RequestMapping(value = "evaluateCopyRecommend", method = RequestMethod.POST)
    public void evaluateCopyRecommend(AcceptData acceptData, Long uid, String id, PrintWriter out) {
        GoodsEvaluate goodsEvaluate = goodsEvaluateService.getById(id);
        if (goodsEvaluate == null) {
            out.print(JsonUtil.loadFalseResult("该内容已不存在"));
            return;
        }
        JSONObject data = new JSONObject();
        String result = GoodsTextUtil.decodeAppHtmlText(goodsEvaluate.getTitle());
        data.put("content", result);
        out.print(JsonUtil.loadTrueResult(data));
    }
    /**
     * @param acceptData
     * @param uid
fanli/src/main/java/com/yeshi/fanli/controller/client/v2/GoodsControllerV2.java
@@ -22,6 +22,7 @@
import com.yeshi.fanli.service.inter.user.tb.UserExtraTaoBaoInfoService;
import com.yeshi.fanli.service.manger.PIDManager;
import com.yeshi.fanli.util.*;
import com.yeshi.fanli.util.goods.GoodsJumpUtil;
import com.yeshi.fanli.vo.common.WXXCXJumpInfoVO;
import com.yeshi.fanli.vo.pdd.PDDConvertLinkResultVO;
import com.yeshi.fanli.vo.goods.GoodsJumpLinkVO;
@@ -1689,7 +1690,7 @@
            }
        }
        GoodsJumpLinkVO vo = new GoodsJumpLinkVO();
        GoodsJumpLinkVO vo = GoodsJumpUtil.getJDJumpInfo(jumpLink);
        vo.set_native(true);
        vo.setJumpLink(jumpLink);
        vo.setNativeJumpLink(jumpLink);
@@ -1773,20 +1774,7 @@
            }
        }
        GoodsJumpLinkVO vo = new GoodsJumpLinkVO();
        vo.set_native(true);
        vo.setJumpLink(jumpLink);
        vo.setNativeJumpLink(jumpLink);
        try {
            String wxPage = "pages/union/proxy/proxy?spreadUrl=" + URLEncoder.encode(jumpLink, "UTF-8");
            WXXCXJumpInfoVO wxxcxJumpInfoVO = new WXXCXJumpInfoVO();
            wxxcxJumpInfoVO.setUserName("gh_45b306365c3d");
            wxxcxJumpInfoVO.setPath(wxPage);
            vo.setWxxcxJumpInfo(wxxcxJumpInfoVO);
        } catch (UnsupportedEncodingException e) {
            e.printStackTrace();
        }
        GoodsJumpLinkVO vo = GoodsJumpUtil.getJDJumpInfo(jumpLink);
        JSONObject data = JSONObject.fromObject(new Gson().toJson(vo));
        data.put("native", vo.is_native());
        data.put("userLevel", userLijinMnager.getUserLevelInfo(uid, acceptData.getSystem()));
@@ -1875,16 +1863,7 @@
            LogHelper.test(String.format("拼多多转链:uid:%s data:%s", uid + "", data.toString()));
        }
        GoodsJumpLinkVO vo = new GoodsJumpLinkVO();
        vo.set_native(true);
        vo.setNativeJumpLink(PinDuoDuoUtil.getAndroidNativeURI(convertUrl.getUrl()));
        vo.setJumpLink(convertUrl.getUrl());
        if (convertUrl.getWe_app_info() != null) {
            WXXCXJumpInfoVO wxxcxJumpInfoVO = new WXXCXJumpInfoVO();
            wxxcxJumpInfoVO.setPath(convertUrl.getWe_app_info().getPage_path());
            wxxcxJumpInfoVO.setUserName(convertUrl.getWe_app_info().getUser_name());
            vo.setWxxcxJumpInfo(wxxcxJumpInfoVO);
        }
        GoodsJumpLinkVO vo = GoodsJumpUtil.getPDDJumpInfo(convertUrl);
        data = JSONObject.fromObject(new Gson().toJson(vo));
        data.put("native", vo.is_native());
        data.put("userLevel", userLijinMnager.getUserLevelInfo(uid, acceptData.getSystem()));
@@ -1936,17 +1915,7 @@
        }
        VIPConvertResultDTO convertUrl = VipShopApiUtil.convertLink(id + "", tag);
        GoodsJumpLinkVO vo = new GoodsJumpLinkVO();
        vo.set_native(true);
        vo.setJumpLink(convertUrl.getUrl());
        vo.setNativeJumpLink(convertUrl.getDeeplinkUrl());
        if (!StringUtil.isNullOrEmpty(convertUrl.getVipWxUrl())) {
            WXXCXJumpInfoVO wxxcxJumpInfoVO = new WXXCXJumpInfoVO();
            wxxcxJumpInfoVO.setUserName("gh_8ed2afad9972");
            wxxcxJumpInfoVO.setPath(convertUrl.getVipWxUrl());
            vo.setWxxcxJumpInfo(wxxcxJumpInfoVO);
        }
        GoodsJumpLinkVO vo = GoodsJumpUtil.getVIPShopJumpInfo(convertUrl);
        JSONObject data = JSONObject.fromObject(new Gson().toJson(vo));
        data.put("native", vo.is_native());
@@ -1996,23 +1965,7 @@
        SuningConvertLinkResult link = SuningApiUtil.convertLinkNew(goodsCode, supplierCode,
                pid, uid + "");
        GoodsJumpLinkVO vo = new GoodsJumpLinkVO();
        vo.set_native(false);
        try {
            vo.setJumpLink(URLDecoder.decode(link.getWapExtendUrl(), "UTF-8"));
        } catch (UnsupportedEncodingException e) {
            e.printStackTrace();
        }
        if (!StringUtil.isNullOrEmpty(link.getSpPageUrl())) {
            WXXCXJumpInfoVO wxxcxJumpInfoVO = new WXXCXJumpInfoVO();
            wxxcxJumpInfoVO.setUserName("gh_1d1e15e90afc");
            try {
                wxxcxJumpInfoVO.setPath(URLDecoder.decode(link.getSpPageUrl(), "UTF-8"));
            } catch (UnsupportedEncodingException e) {
                e.printStackTrace();
            }
            vo.setWxxcxJumpInfo(wxxcxJumpInfoVO);
        }
        GoodsJumpLinkVO vo = GoodsJumpUtil.getSuningJumpInfo(link);
        JSONObject data = JSONObject.fromObject(new Gson().toJson(vo));
        data.put("native", vo.is_native());
@@ -2205,21 +2158,7 @@
        link = JDApiUtil.convertLinkWithSubUnionId(link, null, null, pidManager.getPidCache(acceptData.getSystem(), Constant.SOURCE_TYPE_JD, SystemPIDInfo.PidType.fanli), uid + "");
        GoodsJumpLinkVO vo = new GoodsJumpLinkVO();
        vo.set_native(true);
        vo.setJumpLink(link);
        vo.setNativeJumpLink(link);
        try {
            String wxPage = "pages/union/proxy/proxy?spreadUrl=" + URLEncoder.encode(link, "UTF-8");
            WXXCXJumpInfoVO wxxcxJumpInfoVO = new WXXCXJumpInfoVO();
            wxxcxJumpInfoVO.setUserName("gh_45b306365c3d");
            wxxcxJumpInfoVO.setPath(wxPage);
            vo.setWxxcxJumpInfo(wxxcxJumpInfoVO);
        } catch (UnsupportedEncodingException e) {
            e.printStackTrace();
        }
        GoodsJumpLinkVO vo = GoodsJumpUtil.getJDJumpInfo(link);
        JSONObject data = JSONObject.fromObject(new Gson().toJson(vo));
        data.put("native", vo.is_native());
        JsonUtil.printMode(out, callback, JsonUtil.loadTrueResult(data));
fanli/src/main/java/com/yeshi/fanli/exception/pdd/PDDAuthException.java
New file
@@ -0,0 +1,16 @@
package com.yeshi.fanli.exception.pdd;
import com.yeshi.fanli.exception.BaseException;
public class PDDAuthException extends BaseException {
    private static final long serialVersionUID = 1L;
    public PDDAuthException(int code, String msg) {
        super(code, msg);
    }
    public PDDAuthException() {
        super();
    }
}
fanli/src/main/java/com/yeshi/fanli/exception/suning/SuningGoodsException.java
New file
@@ -0,0 +1,16 @@
package com.yeshi.fanli.exception.suning;
import com.yeshi.fanli.exception.BaseException;
public class SuningGoodsException extends BaseException {
    private static final long serialVersionUID = 1L;
    public SuningGoodsException(int code, String msg) {
        super(code, msg);
    }
    public SuningGoodsException() {
        super();
    }
}
fanli/src/main/java/com/yeshi/fanli/job/DynamicInfoJob.java
@@ -555,8 +555,9 @@
        DaTaoKeResult result = DaTaoKeApiUtil.listTipOff(4, null, 50);
        if (result != null) {
            List<DaTaoKeListTopOffDTO> list = (List<DaTaoKeListTopOffDTO>) result.getList();
            for (DaTaoKeListTopOffDTO dto : list) {
            for (int i = list.size() - 1; i >= 0; i--) {
                try {
                    DaTaoKeListTopOffDTO dto = list.get(i);
                    List<ActivityRuleUser> ruleList = activityUserService
                            .listByRuleCode(ActivityRuleUser.RULE_HAOHUO, 1, 20);
                    ActivityUser user = ruleList.get((int) (ruleList.size() * Math.random())).getActivityUser();
fanli/src/main/java/com/yeshi/fanli/lijin/manager/GoodsLijinMnager.java
@@ -50,20 +50,25 @@
@Component
public class GoodsLijinMnager {
    //    @Reference(version = "1.0", check = false, url = "dubbo://193.112.35.168:20904/com.ks.lijin.service.LijinCreateService")
    @Reference(version = "1.0", check = false)
    private LijinCreateService lijinCreateService;
    //    @Reference(version = "1.0", check = false, url = "dubbo://193.112.35.168:20902/com.ks.vip.service.VipCenterService")
    @Reference(version = "1.0", check = false)
    private VipCenterService vipCenterService;
    //    @Reference(version = "1.0", check = false, url = "dubbo://193.112.35.168:20902/com.ks.vip.service.VipGradePotenceService")
    @Reference(version = "1.0", check = false)
    private VipGradePotenceService vipGradePotenceService;
    //    @Reference(version = "1.0", check = false, url = "dubbo://193.112.35.168:20902/com.ks.vip.service.VipGradeService")
    @Reference(version = "1.0", check = false)
    private VipGradeService vipGradeService;
    //    @Reference(version = "1.0", check = false, url = "dubbo://193.112.35.168:20904/com.ks.lijin.service.LiJinLinkService")
    @Reference(version = "1.0", check = false)
    private LiJinLinkService liJinLinkService;
@@ -164,6 +169,12 @@
    }
    public BigDecimal getTBLijin(Long uid, TaoBaoGoodsBrief goodsBrief) {
        List<MoneyInfo> moneyInfo = lijinCreateService.getMoneyInfo(getUid(uid), Arrays.asList(new TaoBaoGoodsBrief[]{goodsBrief}));
        return moneyInfo.get(0).getLijinAmount();
    }
    private List<GoodsDetailVOWithKey> loadTBMoneyInfo(SystemEnum system, Long uid, List<TaoBaoGoodsBrief> goodsBriefList, List<String> goodsKeyList, GoodsMoneyConfigParamsDTO paramsDTO) {
        Map<String, MoneyInfo> lijinMap = null;
        boolean hasCreateTime = false;
fanli/src/main/java/com/yeshi/fanli/lijin/manager/UserLijinMnager.java
@@ -28,34 +28,44 @@
@Component
public class UserLijinMnager {
    //    @Reference(version = "1.0", check = false, url = "dubbo://193.112.35.168:20904/com.ks.lijin.service.LijinCreateService")
    @Reference(version = "1.0", check = false)
    private LijinCreateService lijinCreateService;
    //    @Reference(version = "1.0", check = false,url="dubbo://193.112.35.168:20902/com.ks.vip.service.VipCenterService")
    @Reference(version = "1.0", check = false)
    private VipCenterService vipCenterService;
    //    @Reference(version = "1.0", check = false,url="dubbo://193.112.35.168:20902/com.ks.vip.service.VipCenterRecordService")
    @Reference(version = "1.0", check = false)
    private VipCenterRecordService vipCenterRecordService;
    //    @Reference(version = "1.0", check = false,url="dubbo://193.112.35.168:20902/com.ks.vip.service.VipGradePotenceService")
    @Reference(version = "1.0", check = false)
    private VipGradePotenceService vipGradePotenceService;
    //    @Reference(version = "1.0", check = false,url="dubbo://193.112.35.168:20902/com.ks.vip.service.VipGradeService")
    @Reference(version = "1.0", check = false)
    private VipGradeService vipGradeService;
    //    @Reference(version = "1.0", check = false,url="dubbo://193.112.35.168:20902/com.ks.vip.service.VipComboService")
    @Reference(version = "1.0", check = false)
    private VipComboService vipComboService;
    //    @Reference(version = "1.0", check = false, url = "dubbo://193.112.35.168:20904/com.ks.lijin.service.LiJinLinkService")
    @Reference(version = "1.0", check = false)
    private LiJinLinkService liJinLinkService;
    //    @Reference(version = "1.0", check = false, url = "dubbo://193.112.35.168:20904/com.ks.lijin.service.LiJinExpendRecordService")
    @Reference(version = "1.0", check = false)
    private LiJinExpendRecordService liJinExpendRecordService;
    //    @Reference(version = "1.0", check = false,url="dubbo://193.112.35.168:20902/com.ks.vip.service.VipOrederService")
    @Reference(version = "1.0", check = false)
    private VipOrederService vipOrederService;
    //    @Reference(version = "1.0", check = false,url="dubbo://193.112.35.168:20902/com.ks.vip.service.VipOrederPayService")
    @Reference(version = "1.0", check = false)
    private VipOrederPayService vipOrederPayService;
@@ -269,12 +279,12 @@
    public String getWXPaySuccessOutOrderNo(String notifyContent) throws Exception {
       return vipOrederPayService.getWXPaySuccessOutOrderNo(notifyContent);
        return vipOrederPayService.getWXPaySuccessOutOrderNo(notifyContent);
    }
    public String getAlipayPaySuccessOutOrderNo(Map<String, String> params) throws Exception {
     return   vipOrederPayService.getAlipayPaySuccessOutOrderNo(params);
        return vipOrederPayService.getAlipayPaySuccessOutOrderNo(params);
    }
fanli/src/main/java/com/yeshi/fanli/service/manger/ClipboardAnalysisManager.java
@@ -492,6 +492,8 @@
        return jdId;
    }
    public String parseTBAuctionIdFromLink(String link) {
        TaoBaoGoodsBrief tb = null;
        String auctionId = null;
fanli/src/main/java/com/yeshi/fanli/service/manger/goods/jd/JDConvertLinkManager.java
New file
@@ -0,0 +1,78 @@
package com.yeshi.fanli.service.manger.goods.jd;
import com.ks.lib.common.exception.ParamsException;
import com.yeshi.fanli.entity.SystemEnum;
import com.yeshi.fanli.entity.SystemPIDInfo;
import com.yeshi.fanli.service.manger.PIDManager;
import com.yeshi.fanli.util.Constant;
import com.yeshi.fanli.util.StringUtil;
import com.yeshi.fanli.util.jd.JDApiUtil;
import org.springframework.stereotype.Component;
import javax.annotation.Resource;
/**
 * 京东转链管理
 */
@Component
public class JDConvertLinkManager {
    @Resource
    private PIDManager pidManager;
    /**
     * 转链短链接
     *
     * @param shortLink
     * @param uid
     * @param system
     * @param pidType
     * @return
     * @throws ParamsException
     */
    public String convertShortUrl(String shortLink, Long uid, SystemEnum system, SystemPIDInfo.PidType pidType) throws ParamsException {
        if (StringUtil.isNullOrEmpty(shortLink)) {
            throw new ParamsException(ParamsException.CODE_PARAMS_NOT_ENOUGH, "短链为空");
        }
        if (system == null) {
            throw new ParamsException(ParamsException.CODE_PARAMS_NOT_ENOUGH, "system为空");
        }
        if (pidType == null) {
            throw new ParamsException(ParamsException.CODE_PARAMS_NOT_ENOUGH, "推广位类型为空");
        }
        return JDApiUtil.convertLinkWithSubUnionId(shortLink, null, null, pidManager.getPidCache(system, Constant.SOURCE_TYPE_JD, pidType), uid + "");
    }
    /**
     * 转链常规链接
     *
     * @param materialId
     * @param couponUrl
     * @param uid
     * @param system
     * @param pidType
     * @return
     * @throws ParamsException
     */
    public String convertGoodsUrl(String materialId, String couponUrl, Long uid, SystemEnum system, SystemPIDInfo.PidType pidType) throws ParamsException {
        if (StringUtil.isNullOrEmpty(materialId)) {
            throw new ParamsException(ParamsException.CODE_PARAMS_NOT_ENOUGH, "materialId为空");
        }
        if (system == null) {
            throw new ParamsException(ParamsException.CODE_PARAMS_NOT_ENOUGH, "system为空");
        }
        if (pidType == null) {
            throw new ParamsException(ParamsException.CODE_PARAMS_NOT_ENOUGH, "推广位类型为空");
        }
        return JDApiUtil.convertLinkWithSubUnionId(materialId, couponUrl, null, pidManager.getPidCache(system, Constant.SOURCE_TYPE_JD, pidType), uid + "");
    }
}
fanli/src/main/java/com/yeshi/fanli/service/manger/goods/pdd/PDDConvertLinkManager.java
New file
@@ -0,0 +1,71 @@
package com.yeshi.fanli.service.manger.goods.pdd;
import com.yeshi.fanli.dto.pdd.PDDGoodsDetail;
import com.yeshi.fanli.entity.SystemEnum;
import com.yeshi.fanli.entity.SystemPIDInfo;
import com.yeshi.fanli.exception.pdd.PDDAuthException;
import com.yeshi.fanli.exception.pdd.PDDGoodsException;
import com.yeshi.fanli.service.manger.PIDManager;
import com.yeshi.fanli.util.Constant;
import com.yeshi.fanli.util.cache.PinDuoDuoCacheUtil;
import com.yeshi.fanli.util.pinduoduo.PinDuoDuoApiUtil;
import com.yeshi.fanli.vo.pdd.PDDConvertLinkResultVO;
import org.springframework.stereotype.Component;
import javax.annotation.Resource;
@Component
public class PDDConvertLinkManager {
    @Resource
    private PIDManager pidManager;
    @Resource
    private PinDuoDuoCacheUtil pinDuoDuoCacheUtil;
    /**
     * 商品转链
     *
     * @param goodsId
     * @param system
     * @param customParams
     * @param pidType
     * @return
     * @throws PDDGoodsException
     * @throws PDDAuthException
     */
    public PDDConvertLinkResultVO convertGoods(Long goodsId, SystemEnum system, String customParams, SystemPIDInfo.PidType pidType) throws PDDGoodsException, PDDAuthException {
        String pid = pidManager.getPidCache(system, Constant.SOURCE_TYPE_PDD, pidType);
        PDDGoodsDetail goods = pinDuoDuoCacheUtil.getGoodsInfo(goodsId);
        if (goods == null) {
            throw new PDDGoodsException(1, "商品已下架");
        }
        boolean auth = PinDuoDuoApiUtil.isAuth(pid, customParams);
        PDDConvertLinkResultVO convertUrl = null;
        if (!auth) {
            throw new PDDAuthException(1, "用户未授权");
        } else {
            convertUrl = PinDuoDuoApiUtil.convert(goods.getGoodsSign(), pid + "", customParams, !auth);
        }
        return convertUrl;
    }
    /**
     * 获取授权链接信息
     *
     * @param system
     * @param customParams
     * @param pidType
     * @return
     */
    public PDDConvertLinkResultVO getAuthLinkInfo(SystemEnum system, String customParams, SystemPIDInfo.PidType pidType) {
        String pid = pidManager.getPidCache(system, Constant.SOURCE_TYPE_PDD, pidType);
        return PinDuoDuoApiUtil.getAuthLink(pid, customParams);
    }
}
fanli/src/main/java/com/yeshi/fanli/service/manger/goods/suning/SuningConvertLinkManager.java
New file
@@ -0,0 +1,55 @@
package com.yeshi.fanli.service.manger.goods.suning;
import com.yeshi.fanli.dto.suning.SuningGoodsInfo;
import com.yeshi.fanli.entity.SystemEnum;
import com.yeshi.fanli.entity.SystemPIDInfo;
import com.yeshi.fanli.exception.suning.SuningGoodsException;
import com.yeshi.fanli.service.manger.PIDManager;
import com.yeshi.fanli.util.Constant;
import com.yeshi.fanli.util.StringUtil;
import com.yeshi.fanli.util.suning.SuningApiUtil;
import com.yeshi.fanli.util.suning.SuningUtil;
import com.yeshi.fanli.vo.suning.SuningConvertLinkResult;
import org.springframework.stereotype.Component;
import javax.annotation.Resource;
@Component
public class SuningConvertLinkManager {
    @Resource
    private PIDManager pidManager;
    /**
     * 商品转链
     *
     * @param concatGoodsId
     * @param uid
     * @param system
     * @param pidType
     * @return
     * @throws SuningGoodsException
     */
    public SuningConvertLinkResult convertGoods(String concatGoodsId, Long uid, SystemEnum system, SystemPIDInfo.PidType pidType) throws SuningGoodsException {
        String pid = pidManager.getPidCache(system, Constant.SOURCE_TYPE_SUNING, pidType);
        String[] sts = SuningUtil.getGoodsIdDetail(concatGoodsId);
        String supplierCode = sts[0];
        String goodsCode = sts[1];
        SuningGoodsInfo goods = SuningApiUtil.getGoodsDetail(goodsCode, supplierCode);
        if (goods == null) {
            throw new SuningGoodsException(1, "商品下架");
        }
        String quanUrl = null;
        if (!StringUtil.isNullOrEmpty(goods.getCouponInfo().getCouponUrl()))
            quanUrl = goods.getCouponInfo().getCouponUrl();
        SuningConvertLinkResult link = SuningApiUtil.convertLinkNew(goodsCode, supplierCode,
                pid, uid + "");
        return link;
    }
}
fanli/src/main/java/com/yeshi/fanli/service/manger/goods/tb/TBConvertLinkManager.java
New file
@@ -0,0 +1,186 @@
package com.yeshi.fanli.service.manger.goods.tb;
import com.yeshi.common.entity.taobao.TaoKeAppInfo;
import com.yeshi.fanli.entity.SystemEnum;
import com.yeshi.fanli.entity.SystemPIDInfo;
import com.yeshi.fanli.entity.bus.user.UserExtraTaoBaoInfo;
import com.yeshi.fanli.entity.taobao.TaoBaoLink;
import com.yeshi.fanli.exception.taobao.TaoBaoAuthException;
import com.yeshi.fanli.exception.taobao.TaoBaoBuyRelationMapException;
import com.yeshi.fanli.exception.taobao.TaoBaoConvertLinkException;
import com.yeshi.fanli.exception.taobao.TaobaoGoodsDownException;
import com.yeshi.fanli.service.inter.taobao.TaoBaoBuyRelationMapService;
import com.yeshi.fanli.service.inter.user.tb.UserExtraTaoBaoInfoService;
import com.yeshi.fanli.service.manger.PIDManager;
import com.yeshi.fanli.util.Constant;
import com.yeshi.fanli.util.StringUtil;
import com.yeshi.fanli.util.TaoBaoConstant;
import com.yeshi.fanli.util.cache.TaoBaoGoodsCacheUtil;
import com.yeshi.fanli.util.taobao.TaoBaoUtil;
import com.yeshi.fanli.util.taobao.TaoKeApiUtil;
import com.yeshi.goods.facade.entity.taobao.TaoBaoGoodsBrief;
import com.yeshi.goods.facade.utils.taobao.DaTaoKeApiUtil;
import org.springframework.stereotype.Component;
import javax.annotation.Resource;
/**
 * 淘宝转链
 */
@Component
public class TBConvertLinkManager {
    @Resource
    private PIDManager pidManager;
    @Resource
    private TaoBaoGoodsCacheUtil taoBaoGoodsCacheUtil;
    @Resource
    private UserExtraTaoBaoInfoService userExtraTaoBaoInfoService;
    @Resource
    private TaoBaoBuyRelationMapService taoBaoBuyRelationMapService;
    /**
     * 商品转链
     *
     * @param auctionId
     * @param uid
     * @param system
     * @param pidType
     * @return
     * @throws TaobaoGoodsDownException
     * @throws TaoBaoAuthException
     * @throws TaoBaoConvertLinkException
     */
    public TaoBaoLink convertGoods(Long auctionId, Long uid, SystemEnum system, SystemPIDInfo.PidType pidType) throws TaobaoGoodsDownException, TaoBaoAuthException, TaoBaoConvertLinkException {
        //验证商品是否在线
        TaoBaoGoodsBrief goods = null;
        try {
            goods = TaoKeApiUtil.getSimpleGoodsInfo(auctionId);
        } catch (TaobaoGoodsDownException e) {
            throw e;
        }
        //--------判断淘宝是否授权-------------
        String specialId = null;
        String relationId = null;
        // 查询用户ID是否绑定了会员运营ID
        UserExtraTaoBaoInfo userInfo = userExtraTaoBaoInfoService.getByUid(uid);
        if (userInfo != null && !StringUtil.isNullOrEmpty(userInfo.getSpecialId()) && userInfo.getSpecialValid() != null
                && userInfo.getSpecialValid() == true) {
            specialId = userInfo.getSpecialId();
        }
        if (userInfo != null && !StringUtil.isNullOrEmpty(userInfo.getRelationId()) && userInfo.getRelationId() != null
                && userInfo.getRelationValid() == true) {
            relationId = userInfo.getRelationId();
        }
        if (pidType == SystemPIDInfo.PidType.fanli) {
            if (StringUtil.isNullOrEmpty(specialId)) {
                throw new TaoBaoAuthException(10, "淘宝未授权");
            }
        } else if (pidType == SystemPIDInfo.PidType.share) {
            if (StringUtil.isNullOrEmpty(relationId)) {
                throw new TaoBaoAuthException(11, "淘宝未授权");
            }
        }
        //领券
        if (pidType == SystemPIDInfo.PidType.coupon) {
            return convertGoods(auctionId, specialId, null, system, SystemPIDInfo.PidType.coupon);
        }
        if (pidType == SystemPIDInfo.PidType.share) {
            return convertGoods(auctionId, null, relationId, system, SystemPIDInfo.PidType.share);
        }
        if (pidType == SystemPIDInfo.PidType.fanli) {
            boolean specialConvert = false;
            if (TaoBaoUtil.isSpecialGoods(goods.getMaterialLibType())) {
                specialConvert = true;
            } else
                specialConvert = false;
            if (specialConvert)
                return convertGoods(auctionId, specialId, null, system, SystemPIDInfo.PidType.fanli);
            else {
                try {
                    relationId = taoBaoBuyRelationMapService.getRelationId(uid);
                } catch (TaoBaoBuyRelationMapException e) {
                    throw new TaoBaoConvertLinkException(101, "非返利库商品分配pid出错");
                }
                return convertGoods(auctionId, null, relationId, system, SystemPIDInfo.PidType.fanliChannel);
            }
        }
        throw new TaoBaoConvertLinkException(201, "pid类型不存在");
    }
    public TaoBaoLink convertGoods(Long auctionId, String specialId, String relationId, SystemEnum system, SystemPIDInfo.PidType pidType) throws TaoBaoConvertLinkException {
        String pid = pidManager.getPidCache(system, Constant.SOURCE_TYPE_TAOBAO, pidType);
        TaoKeAppInfo app = new TaoKeAppInfo();
        app.setAppKey(TaoBaoConstant.TAOBAO_AUTH_APPKEY);
        app.setAppSecret(TaoBaoConstant.TAOBAO_AUTH_APPSECRET);
        app.setPid(pid);
        TaoBaoLink taoBaoLink = new TaoBaoLink();
        taoBaoLink.setAuctionId(auctionId);
        String baseUrl = taoBaoGoodsCacheUtil.getBaseConvertLink(auctionId, app.getPid());
        if (!StringUtil.isNullOrEmpty(baseUrl)) {
            taoBaoLink.setClickUrl(baseUrl);
            taoBaoLink.setCouponLink(baseUrl);
            return taoBaoLink;
        }
        // 查询是否为大淘客商品
        String link = null;
        try {
            link = DaTaoKeApiUtil.convertLink(auctionId, app.getPid());
        } catch (Exception e) {
        }
        if (!StringUtil.isNullOrEmpty(link)) {
            taoBaoGoodsCacheUtil.cacheBaseConvertLink(auctionId, app.getPid(), link);
        }
        if (!StringUtil.isNullOrEmpty(link)) {
            taoBaoLink.setCouponLink(link);
            return taoBaoLink;
        }
        TaoBaoGoodsBrief goods = TaoKeApiUtil.specialConvertCoupon(auctionId, app, specialId, relationId);
        if (goods == null) {
            throw new TaoBaoConvertLinkException(1, "");
        }
        String clickUrl = goods.getAuctionUrl();
        String couponLink = goods.getCouponLink();
        if (!StringUtil.isNullOrEmpty(relationId)) {
            clickUrl = TaoBaoUtil.concatRelationId(clickUrl, relationId);
            couponLink = TaoBaoUtil.concatRelationId(couponLink, relationId);
        }
        taoBaoLink.setClickUrl(clickUrl);
        taoBaoLink.setCouponLink(couponLink);
        if (!StringUtil.isNullOrEmpty(goods.getYsylClickUrl()))
            taoBaoLink.setCouponLink(goods.getYsylClickUrl());
        taoBaoLink.setGoods(goods);
        //缓存
        goods.setCouponLink(taoBaoLink.getCouponLink());
        return taoBaoLink;
    }
}
fanli/src/main/java/com/yeshi/fanli/service/manger/goods/tb/TaoBaoTokenAuctionIdMapManager.java
@@ -12,24 +12,27 @@
@Component
public class TaoBaoTokenAuctionIdMapManager {
    @Resource
    private TaoBaoGoodsCacheUtil taoBaoGoodsCacheUtil;
    @Resource
    private TaoBaoGoodsCacheUtil taoBaoGoodsCacheUtil;
    public Long getAuctionIdByToken(String token) {
        if (StringUtil.isNullOrEmpty(token))
            return null;
        Long auctionId = taoBaoGoodsCacheUtil.getGoodsIdByToken(token);
        if (auctionId != null)
            return auctionId;
        try {
            auctionId = TaoKeApiUtil.tokenConvertAuctionId(token);
        } catch (TaoBaoTokenParseException e) {
            e.printStackTrace();
        }
        if (auctionId != null) {
            taoBaoGoodsCacheUtil.saveTokenGoodsIdMap(token, auctionId);
        }
        return auctionId;
    }
    public Long getAuctionIdByToken(String token) {
        if (StringUtil.isNullOrEmpty(token))
            return null;
        Long auctionId = taoBaoGoodsCacheUtil.getGoodsIdByToken(token);
        if (auctionId != null)
            return auctionId;
        try {
            TaoKeApiUtil.TokenConvertResult result = TaoKeApiUtil.tokenConvert(token);
            if (result != null) {
                auctionId = result.getNum_iid();
            }
        } catch (TaoBaoTokenParseException e) {
            e.printStackTrace();
        }
        if (auctionId != null) {
            taoBaoGoodsCacheUtil.saveTokenGoodsIdMap(token, auctionId);
        }
        return auctionId;
    }
}
fanli/src/main/java/com/yeshi/fanli/service/manger/goods/vipshop/VipShopConvertLinkManager.java
New file
@@ -0,0 +1,27 @@
package com.yeshi.fanli.service.manger.goods.vipshop;
import com.yeshi.fanli.dto.vip.VIPConvertResultDTO;
import com.yeshi.fanli.entity.SystemPIDInfo;
import com.yeshi.fanli.util.vipshop.VipShopApiUtil;
import com.yeshi.fanli.util.vipshop.VipShopUtil;
import org.springframework.stereotype.Component;
@Component
public class VipShopConvertLinkManager {
    public VIPConvertResultDTO convertGoods(String goodsId, Long uid, SystemPIDInfo.PidType pidType) {
        String tag = null;
        if (pidType == SystemPIDInfo.PidType.fanli)
            tag = VipShopUtil.getBuyChanTag(uid);
        else if (pidType == SystemPIDInfo.PidType.coupon) {
            tag = VipShopUtil.getCouponChanTag();
        } else if (pidType == SystemPIDInfo.PidType.share) {
            tag = VipShopUtil.getShareChanTag(uid);
        }
        VIPConvertResultDTO convertUrl = VipShopApiUtil.convertLink(goodsId, tag);
        return convertUrl;
    }
}
fanli/src/main/java/com/yeshi/fanli/util/exception/ExceptionConstant.java
New file
@@ -0,0 +1,24 @@
package com.yeshi.fanli.util.exception;
/**
 * 异常常量
 */
public class ExceptionConstant {
    //未登录
    public final static int CODE_NOT_LOGIN = 1;
    //拼多多未授权
    public final static int CODE_AUTH_PDD_NO_AUTH = 20010;
    //淘宝未授权
    public final static int CODE_AUTH_TAOBAO_NO_AUTH = 20011;
    //不支持的跳转
    public final static int CODE_JUMP_NO_SUPPORT = 50001;
    //商品下线
    public final static int CODE_GOODS_OFFLINE = 40001;
}
fanli/src/main/java/com/yeshi/fanli/util/factory/goods/GoodsDetailVOLijinFactory.java
@@ -11,6 +11,7 @@
import com.yeshi.fanli.dto.vip.goods.VIPGoodsInfo;
import com.yeshi.fanli.entity.goods.CommonGoods;
import com.yeshi.fanli.entity.jd.JDGoods;
import com.yeshi.fanli.log.LogHelper;
import com.yeshi.fanli.util.Constant;
import com.yeshi.fanli.util.StringUtil;
import com.yeshi.fanli.util.jd.JDUtil;
@@ -51,7 +52,7 @@
        String provcity = goods.getProvcity();
        if (!StringUtil.isNullOrEmpty(provcity)) {
            String[] arr = provcity.split("\\s+");
            goodsInfo.setAddress(StringUtil.concat(Arrays.asList(arr),"·"));
            goodsInfo.setAddress(StringUtil.concat(Arrays.asList(arr), "·"));
        }
        List<String> imgList = goods.getImgList();
@@ -157,7 +158,7 @@
            goodsInfo.setLabels(labels);
        }
        return fillFanliPrice(fillRights(goodsInfo), false);
        return fillRights(fillFanliPrice(goodsInfo, false));
    }
    private static GoodsInfoVO loadYuShouInfo(GoodsInfoVO goodsInfo, TaoBaoGoodsBrief goods, String pid,
@@ -570,9 +571,10 @@
    }
    private static GoodsInfoVO fillRights(GoodsInfoVO goodsInfoVO) {
    public static GoodsInfoVO fillRights(GoodsInfoVO goodsInfoVO) {
        List<GoodsRightsVO> rightsVOS = new ArrayList<>();
        if (goodsInfoVO.getCouponInfoList() != null) {
            List<GoodsRightsVO> rightsVOS = new ArrayList<>();
            //加载券权益
            for (CouponInfoVO couponInfoVO : goodsInfoVO.getCouponInfoList()) {
                String desc = "";
                if (couponInfoVO.getStartFee() == null || couponInfoVO.getStartFee().compareTo(new BigDecimal(0)) <= 0) {
@@ -582,8 +584,14 @@
                }
                rightsVOS.add(new GoodsRightsVO(1, "¥" + MoneyBigDecimalUtil.getWithNoZera(couponInfoVO.getAmount()).toString(), desc));
            }
            goodsInfoVO.setRights(rightsVOS);
        }
        //加载礼金权益
        if (!StringUtil.isNullOrEmpty(goodsInfoVO.getMoneyInfo().getHongBaoMoney())) {
            rightsVOS.add(new GoodsRightsVO(2, goodsInfoVO.getMoneyInfo().getHongBaoMoney(), "自动发放"));
        }
        goodsInfoVO.setRights(rightsVOS);
        return goodsInfoVO;
    }
fanli/src/main/java/com/yeshi/fanli/util/goods/GoodsJumpUtil.java
New file
@@ -0,0 +1,145 @@
package com.yeshi.fanli.util.goods;
import com.yeshi.fanli.dto.vip.VIPConvertResultDTO;
import com.yeshi.fanli.entity.taobao.TaoBaoLink;
import com.yeshi.fanli.util.StringUtil;
import com.yeshi.fanli.util.pinduoduo.PinDuoDuoUtil;
import com.yeshi.fanli.vo.common.WXXCXJumpInfoVO;
import com.yeshi.fanli.vo.goods.GoodsJumpLinkVO;
import com.yeshi.fanli.vo.pdd.PDDConvertLinkResultVO;
import com.yeshi.fanli.vo.suning.SuningConvertLinkResult;
import java.io.UnsupportedEncodingException;
import java.net.URLDecoder;
import java.net.URLEncoder;
public class GoodsJumpUtil {
    /**
     * 淘宝跳转
     *
     * @param taoBaoLink
     * @return
     */
    public static GoodsJumpLinkVO getTBJumpInfo(TaoBaoLink taoBaoLink) {
        String jumpLink = taoBaoLink.getClickUrl();
        if (!StringUtil.isNullOrEmpty(taoBaoLink.getCouponLink())) {
            jumpLink = taoBaoLink.getCouponLink();
        }
        GoodsJumpLinkVO vo = new GoodsJumpLinkVO();
        vo.set_native(true);
        vo.setJumpLink(jumpLink);
        vo.setNativeJumpLink(jumpLink);
        return vo;
    }
    /**
     * 京东跳转
     *
     * @param jumpLink
     * @return
     */
    public static GoodsJumpLinkVO getJDJumpInfo(String jumpLink) {
        GoodsJumpLinkVO vo = new GoodsJumpLinkVO();
        vo.set_native(true);
        vo.setJumpLink(jumpLink);
        vo.setNativeJumpLink(jumpLink);
        try {
            String wxPage = "pages/union/proxy/proxy?spreadUrl=" + URLEncoder.encode(jumpLink, "UTF-8");
            WXXCXJumpInfoVO wxxcxJumpInfoVO = new WXXCXJumpInfoVO();
            wxxcxJumpInfoVO.setUserName("gh_45b306365c3d");
            wxxcxJumpInfoVO.setPath(wxPage);
            vo.setWxxcxJumpInfo(wxxcxJumpInfoVO);
        } catch (UnsupportedEncodingException e) {
            e.printStackTrace();
        }
        return vo;
    }
    /**
     * 拼多多跳转
     *
     * @param convertUrl
     * @return
     */
    public static GoodsJumpLinkVO getPDDJumpInfo(PDDConvertLinkResultVO convertUrl) {
        GoodsJumpLinkVO vo = new GoodsJumpLinkVO();
        vo.set_native(true);
        vo.setNativeJumpLink(PinDuoDuoUtil.getAndroidNativeURI(convertUrl.getUrl()));
        vo.setJumpLink(convertUrl.getUrl());
        if (convertUrl.getWe_app_info() != null) {
            WXXCXJumpInfoVO wxxcxJumpInfoVO = new WXXCXJumpInfoVO();
            wxxcxJumpInfoVO.setPath(convertUrl.getWe_app_info().getPage_path());
            wxxcxJumpInfoVO.setUserName(convertUrl.getWe_app_info().getUser_name());
            vo.setWxxcxJumpInfo(wxxcxJumpInfoVO);
        }
        return vo;
    }
    /**
     * 获取拼多多跳转信息
     *
     * @param jumpUrl
     * @return
     */
    public static GoodsJumpLinkVO getPDDJumpInfo(String jumpUrl) {
        GoodsJumpLinkVO vo = new GoodsJumpLinkVO();
        vo.set_native(true);
        vo.setNativeJumpLink(PinDuoDuoUtil.getAndroidNativeURI(jumpUrl));
        vo.setJumpLink(jumpUrl);
        return vo;
    }
    /**
     * 唯品会跳转
     *
     * @param convertUrl
     * @return
     */
    public static GoodsJumpLinkVO getVIPShopJumpInfo(VIPConvertResultDTO convertUrl) {
        GoodsJumpLinkVO vo = new GoodsJumpLinkVO();
        vo.set_native(true);
        vo.setJumpLink(convertUrl.getUrl());
        vo.setNativeJumpLink(convertUrl.getDeeplinkUrl());
        if (!StringUtil.isNullOrEmpty(convertUrl.getVipWxUrl())) {
            WXXCXJumpInfoVO wxxcxJumpInfoVO = new WXXCXJumpInfoVO();
            wxxcxJumpInfoVO.setUserName("gh_8ed2afad9972");
            wxxcxJumpInfoVO.setPath(convertUrl.getVipWxUrl());
            vo.setWxxcxJumpInfo(wxxcxJumpInfoVO);
        }
        return vo;
    }
    /**
     * 苏宁跳转
     *
     * @param link
     * @return
     */
    public static GoodsJumpLinkVO getSuningJumpInfo(SuningConvertLinkResult link) {
        GoodsJumpLinkVO vo = new GoodsJumpLinkVO();
        vo.set_native(false);
        try {
            vo.setJumpLink(URLDecoder.decode(link.getWapExtendUrl(), "UTF-8"));
        } catch (UnsupportedEncodingException e) {
            e.printStackTrace();
        }
        if (!StringUtil.isNullOrEmpty(link.getSpPageUrl())) {
            WXXCXJumpInfoVO wxxcxJumpInfoVO = new WXXCXJumpInfoVO();
            wxxcxJumpInfoVO.setUserName("gh_1d1e15e90afc");
            try {
                wxxcxJumpInfoVO.setPath(URLDecoder.decode(link.getSpPageUrl(), "UTF-8"));
            } catch (UnsupportedEncodingException e) {
                e.printStackTrace();
            }
            vo.setWxxcxJumpInfo(wxxcxJumpInfoVO);
        }
        return vo;
    }
}
fanli/src/main/java/com/yeshi/fanli/util/jd/JDUtil.java
@@ -530,6 +530,11 @@
        return list;
    }
    public static boolean isJDLink(String url) {
        return url.startsWith("https://item.m.jd.com/product/") || url.startsWith("http://item.m.jd.com/product/")
                || url.startsWith("https://item.jd.com/") || url.startsWith("http://item.jd.com/")||url.startsWith("https://u.jd.com/");
    }
    /**
     * 根据链接提取商品ID
     *
fanli/src/main/java/com/yeshi/fanli/util/pinduoduo/PinDuoDuoUtil.java
@@ -100,7 +100,6 @@
    }
    /**
     * 计算商品券后价,没有券则返回原价
     *
@@ -551,11 +550,21 @@
    }
    /**
     * 是否为拼多多的链接
     *
     * @param link
     * @return
     */
    public static boolean isPDDLink(String link) {
        return link.contains("://p.pinduoduo.com/");
    }
    public static String getPDDGoodsId(String url) {
        if (url == null)
            return null;
        String link = url;
        if (link.contains("://p.pinduoduo.com/")) {// 拼多多的短链
        if (isPDDLink(link)) {// 拼多多的短链
            HttpClient client = new HttpClient();
            client.getHttpConnectionManager().getParams().setConnectionTimeout(5000);
            PostMethod pm = new PostMethod(link);
fanli/src/main/java/com/yeshi/fanli/util/suning/SuningUtil.java
@@ -14,7 +14,7 @@
        BigDecimal hundred = new BigDecimal(100);
        rate = MoneyBigDecimalUtil.div(rate, hundred);
        BigDecimal afterUseCouponPrice = getCouponPrice(goods);
        BigDecimal commission = MoneyBigDecimalUtil.mul(afterUseCouponPrice, MoneyBigDecimalUtil.div(new BigDecimal(goods.getCommodityInfo().getRate()), new BigDecimal(100), 5));
@@ -100,10 +100,14 @@
        return String.format("https://product.suning.com/%s/%s.html", supplierCode, goodsId);
    }
    public static boolean isSuningLink(String url) {
        return (url.contains(".suning.com/")
                && (url.contains(".suning.com/product/") || url.contains("product.suning.com/")));
    }
    public static String parseGoodsIdByUrl(String url) {
        try {
            if (url.contains(".suning.com/")
                    && (url.contains(".suning.com/product/") || url.contains("product.suning.com/"))) {
            if (isSuningLink(url)) {
                String preUrl = url.split("\\?")[0];
                String[] sts = preUrl.split("/");
                if (sts.length > 2) {
fanli/src/main/java/com/yeshi/fanli/util/taobao/TaoBaoUtil.java
@@ -23,6 +23,7 @@
import javax.xml.parsers.DocumentBuilderFactory;
import com.yeshi.fanli.entity.SystemEnum;
import com.yeshi.fanli.util.*;
import org.apache.commons.httpclient.HttpClient;
import org.apache.commons.httpclient.MultiThreadedHttpConnectionManager;
import org.apache.commons.httpclient.methods.GetMethod;
@@ -67,12 +68,7 @@
import com.yeshi.fanli.service.inter.goods.TaoBaoLinkService;
import com.yeshi.fanli.service.inter.order.config.HongBaoManageService;
import com.yeshi.common.entity.PageEntity;
import com.yeshi.fanli.util.AESUtil;
import com.yeshi.fanli.util.Constant;
import org.yeshi.utils.MoneyBigDecimalUtil;
import com.yeshi.fanli.util.StringUtil;
import com.yeshi.fanli.util.TaoBaoConstant;
import com.yeshi.fanli.util.TaoBaoHttpUtil;
import org.yeshi.utils.TimeUtil;
import com.yeshi.common.vo.ClientTextStyleVO;
@@ -2234,9 +2230,15 @@
     * @return
     */
    public static String concatRelationId(String url, String relationId) {
        if (StringUtil.isNullOrEmpty(url)) {
            return url;
        }
        if (StringUtil.isNullOrEmpty(relationId))
            return url;
        return url + "&relationId=" + relationId;
        if (!url.contains("&relationId="))
            return url + "&relationId=" + relationId;
        else
            return url;
    }
@@ -2258,6 +2260,7 @@
    /**
     * 获取淘宝授权链接
     *
     * @param uid
     * @param source
     * @return
@@ -2267,4 +2270,32 @@
                "http://api.flqapp.com/fanli/client/v1/auth/callback/tb", uid, source);
    }
    /**
     * 是否为淘宝系的链接
     *
     * @param link
     * @return
     */
    public static boolean isTaoBaoLink(String link) {
        TaoBaoGoodsBrief tb = null;
        String auctionId = null;
        if (link.startsWith("https://a.m.taobao.com/i"))// 淘宝账号未登录状态
        {
            return true;
        } else if (link.contains("ju.taobao.com") || link.contains(".juhuasuan.com")) {// 聚划算
            return true;
        } else if (link.contains("http://zmnxbc.com")) { // 手机端天猫APP分享
            return true;
        } else if (link.contains("h5.m.taobao") || link.contains("detail.m.tmall") || link.contains("item.taobao")
                || link.contains("detail.tmall")) { // 手机页面和电脑页面
            return true;
        } else if (link.contains("//s.click.taobao.com")) {
            return true;
        }
        return false;
    }
}
fanli/src/main/java/com/yeshi/fanli/util/taobao/TaoKeApiUtil.java
@@ -1,5 +1,6 @@
package com.yeshi.fanli.util.taobao;
import com.google.gson.Gson;
import com.yeshi.common.entity.PageEntity;
import com.yeshi.common.entity.taobao.TaoBaoShopInfo;
import com.yeshi.common.entity.taobao.TaoKeAppInfo;
@@ -1895,7 +1896,7 @@
     * @param token
     * @return
     */
    public static Long tokenConvertAuctionId(String token) throws TaoBaoTokenParseException {
    public static TokenConvertResult tokenConvert(String token) throws TaoBaoTokenParseException {
        Map<String, String> map = new HashMap<>();
        map.put("method", "taobao.tbk.tpwd.convert");
        map.put("password_content", token);
@@ -1909,7 +1910,10 @@
            System.out.println(json.toString());
            try {
                return json.optJSONObject("tbk_tpwd_convert_response").optJSONObject("data").optLong("num_iid");
                JSONObject data = json.optJSONObject("tbk_tpwd_convert_response").optJSONObject("data");
                Gson gson = new Gson();
                return gson.fromJson(data.toString(), TokenConvertResult.class);
            } catch (Exception e) {
                return null;
@@ -2218,6 +2222,54 @@
        public BigDecimal coupon_start_fee;// 券起始金额
    }
    public static class TokenConvertResult {
        private Long num_iid;//    商品Id
        private String click_url;//商品淘客转链
        private String seller_id;//店铺卖家ID
        private String origin_url;//入参淘口令对应原始链接
        private String origin_pid;//入参淘口令推广链接中的pid,如果不属于当前调用的推广者则展示“0”
        public Long getNum_iid() {
            return num_iid;
        }
        public void setNum_iid(Long num_iid) {
            this.num_iid = num_iid;
        }
        public String getClick_url() {
            return click_url;
        }
        public void setClick_url(String click_url) {
            this.click_url = click_url;
        }
        public String getSeller_id() {
            return seller_id;
        }
        public void setSeller_id(String seller_id) {
            this.seller_id = seller_id;
        }
        public String getOrigin_url() {
            return origin_url;
        }
        public void setOrigin_url(String origin_url) {
            this.origin_url = origin_url;
        }
        public String getOrigin_pid() {
            return origin_pid;
        }
        public void setOrigin_pid(String origin_pid) {
            this.origin_pid = origin_pid;
        }
    }
}
fanli/src/main/java/com/yeshi/fanli/util/vipshop/VipShopUtil.java
@@ -91,9 +91,13 @@
        return StringUtil.Md5(orderSn + "#" + goodsId + "#" + sizeId);
    }
    public static boolean isVIPShopLink(String url) {
        return url.contains(".vip.com/");
    }
    public static String parseGoodsIdByUrl(String url) {
        try {
            if (url.contains(".vip.com/") && (url.contains("detail-") || url.contains("product-"))) {
            if (isVIPShopLink(url) && (url.contains("detail-") || url.contains("product-"))) {
                String preUrl = url.split("\\?")[0];
                String goodsId = preUrl.split("-")[preUrl.split("-").length - 1].replace(".html", "").replace(".htm",
                        "");
fanli/src/main/java/com/yeshi/fanli/vo/goods/ConvertLinkJumpVO.java
New file
@@ -0,0 +1,33 @@
package com.yeshi.fanli.vo.goods;
/**
 * 转链结果跳转
 */
public class ConvertLinkJumpVO {
    private GoodsJumpLinkVO jumpLink;
    private Integer sourceType;
    public ConvertLinkJumpVO() {
    }
    public ConvertLinkJumpVO(GoodsJumpLinkVO jumpLink, Integer sourceType) {
        this.jumpLink = jumpLink;
        this.sourceType = sourceType;
    }
    public GoodsJumpLinkVO getJumpLink() {
        return jumpLink;
    }
    public void setJumpLink(GoodsJumpLinkVO jumpLink) {
        this.jumpLink = jumpLink;
    }
    public Integer getSourceType() {
        return sourceType;
    }
    public void setSourceType(Integer sourceType) {
        this.sourceType = sourceType;
    }
}
fanli/src/main/java/com/yeshi/fanli/vo/goods/GoodsJumpLinkVO.java
@@ -3,7 +3,7 @@
import com.yeshi.fanli.vo.common.WXXCXJumpInfoVO;
/**
 * 拼多多跳转链接
 * 跳转链接
 */
public class GoodsJumpLinkVO {
    private String jumpLink;