admin
2020-01-17 81a2c8e297787cc7dc405d6db4972cb917cd80b5
无用代码删除,单品分享接口修改
51个文件已修改
15个文件已添加
3404 ■■■■ 已修改文件
fanli/src/main/java/com/yeshi/fanli/controller/AuthCallBackController.java 50 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/controller/admin/ExtractAdminController.java 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/controller/client/v1/BanLiShopController.java 31 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/controller/client/v1/DynamicRecommendController.java 13 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/controller/client/v1/RecommendController.java 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/controller/client/v1/ShareController.java 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/controller/client/v1/UserAccountController.java 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/controller/client/v1/UserMoneyController.java 11 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/controller/client/v1/UserMsgController.java 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/controller/client/v1/h5/AppH5CouponController.java 194 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/controller/client/v2/CommonContentControllerV2.java 21 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/controller/client/v2/ConvertLinkController.java 284 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/controller/client/v2/GoodsControllerV2.java 29 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/controller/client/v2/RecommendControllerV2.java 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/controller/client/v2/RedPackControllerV2.java 84 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/controller/client/v2/SearchControllerV2.java 544 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/controller/client/v2/ShareControllerV2.java 370 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/controller/client/v2/UserAccountControllerV2.java 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/controller/h5/H5RecommendController.java 11 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/controller/web/WebRecommendController.java 15 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/controller/wxmp/v1/GoodsController.java 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/controller/wxmp/v1/UserMsgController.java 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/dao/MongodbBaseDao.java 11 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/dao/user/UserConvertLinkTemplateDao.java 13 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/entity/accept/AcceptData.java 9 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/entity/bus/help/HelpClass.java 8 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/entity/bus/user/UserConvertLinkTemplate.java 84 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/entity/money/UserMoneyDetail.java 8 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/entity/system/ConfigKeyEnum.java 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/entity/system/SystemClientParams.java 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/entity/taobao/TaoBaoGoodsBrief.java 14 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/exception/taobao/TaoBaoTokenParseException.java 21 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/job/order/jd/UpdateJDOrderJob.java 14 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/log/LogHelper.java 6 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/log/LogManager.java 15 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/log/LogType.java 22 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/service/impl/goods/ShareGoodsServiceImpl.java 55 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/service/impl/goods/recommend/HomeRecommendGoodsServiceImpl.java 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/service/impl/order/tb/TaoBaoWeiQuanOrderServiceImpl.java 3 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/service/impl/redpack/RedPackExchangeServiceImpl.java 115 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/service/impl/shop/BanLiShopOrderPayServiceImpl.java 31 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/service/impl/taobao/TaoBaoGoodsUpdateServiceImpl.java 2 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/service/impl/user/TokenRecordServiceImpl.java 139 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/service/impl/user/UserAccountServiceImpl.java 8 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/service/impl/user/UserConvertLinkTemplateServiceImpl.java 143 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/service/impl/user/UserInfoServiceImpl.java 22 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/service/inter/user/TokenRecordService.java 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/service/inter/user/UserConvertLinkTemplateService.java 58 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/service/manger/ClipboardAnalysisManager.java 463 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/service/manger/ClipboardContentType.java 21 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/service/manger/IClipboardAnalysisResult.java 30 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/service/manger/goods/ConvertLinkManager.java 29 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/util/RedisKeyEnum.java 10 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/util/StringUtil.java 18 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/util/VersionUtil.java 8 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/util/factory/goods/GoodsDetailVOFactory.java 2 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/util/taobao/TaoBaoOrderUtil.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 32 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/vo/common/JumpDetailContentVO.java 31 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/vo/goods/GoodsDetailVO.java 10 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/vo/goods/ShareGoodsCommentChoiceInfo.java 81 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/vo/goods/ShareInfoVO.java 37 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/vo/search/GoodsDocParseResultVO.java 47 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
utils/src/main/java/org/yeshi/utils/HttpUtil.java 33 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
utils/src/main/java/org/yeshi/utils/JsonUtil.java 5 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/controller/AuthCallBackController.java
@@ -20,6 +20,8 @@
import com.yeshi.fanli.exception.taobao.TaoBaoAuthException;
import com.yeshi.fanli.exception.user.UserExtraTaoBaoInfoException;
import com.yeshi.fanli.log.LogHelper;
import com.yeshi.fanli.log.LogManager;
import com.yeshi.fanli.log.LogType;
import com.yeshi.fanli.service.inter.user.UserActiveLogService;
import com.yeshi.fanli.service.inter.user.UserInfoModifyRecordService;
import com.yeshi.fanli.service.inter.user.msg.UserAccountMsgNotificationService;
@@ -67,11 +69,11 @@
    @RequestMapping(value = "tb")
    public void tb(String code, String state, HttpServletRequest request, HttpServletResponse response) {
        LogHelper.test("淘宝授权回调:" + code + ":" + state);
        LogManager.getLogger(LogType.taobaoAuth).info("淘宝授权回调:" + code + ":" + state);
        if (StringUtil.isNullOrEmpty(code) || StringUtil.isNullOrEmpty(state)) {
            LogHelper.error("淘宝授权回调出错");
            try {
                response.sendRedirect("http://apph5.yeshitv.com/flqWeb/h5/tbauth/fail.html?code=1");
                response.sendRedirect("http://apph5.banliapp.com/flqWeb/h5/tbauth/fail.html?code=1");
            } catch (IOException e1) {
                e1.printStackTrace();
            }
@@ -110,9 +112,9 @@
            source = json.optString("s");
        }
        LogHelper.userErrorInfo("淘宝授权回调state:" + state);
        LogManager.getLogger(LogType.taobaoAuth).info("淘宝授权回调state:" + state);
        LogHelper.userErrorInfo("淘宝授权回调解密:" + stateStr);
        LogManager.getLogger(LogType.taobaoAuth).info("淘宝授权回调解密:" + stateStr);
        int errCode = 0;
        if (StringUtil.isNullOrEmpty(stateStr)) {
@@ -143,7 +145,7 @@
            } catch (Exception e) {
            }
            final String name = nickName;
            LogHelper.test("uid:" + uid + "\n accessToken:" + accessToken);
            LogManager.getLogger(LogType.taobaoAuth).info("uid:" + uid + "\n accessToken:" + accessToken);
            // 获取渠道ID与会员ID
            if ("share".equalsIgnoreCase(source)) {
@@ -153,12 +155,11 @@
                    relationId = TaoKeApiUtil.getRelationId(accessToken, TaoBaoConstant.TAOBAO_AUTH_APPKEY,
                            TaoBaoConstant.TAOBAO_AUTH_APPSECRET);// 渠道ID
                } catch (TaoBaoAuthException e) {
                    LogManager.getLogger(LogType.taobaoAuth).error(uid + "渠道备案失败:" + e.getMessage());
                    if (e.getCode() == TaoBaoAuthException.CODE_NOT_REAL_NAME)
                        userAccountMsgNotificationService.taoBaoAuthFail(uid, name, "淘宝账号未实名");
                }
                if (StringUtil.isNullOrEmpty(relationId))
                    LogHelper.test(uid + "渠道备案失败");
                try {
                    userExtraTaoBaoInfoService.addRelationId(uid, relationId, taoBaoUid, nickName, true);
                } catch (UserExtraTaoBaoInfoException e) {
@@ -168,7 +169,7 @@
                final String relationId2 = relationId;
                // 异步申请会员ID
                final Long fuid=uid;
                final Long fuid = uid;
                ThreadUtil.run(new Runnable() {
                    @Override
@@ -178,11 +179,9 @@
                            specialId = TaoKeApiUtil.getSpecialId(accessToken, TaoBaoConstant.TAOBAO_AUTH_APPKEY,
                                    TaoBaoConstant.TAOBAO_AUTH_APPSECRET);
                        } catch (TaoBaoAuthException e1) {
                            LogManager.getLogger(LogType.taobaoAuth).error(fuid + "会员备案失败:" + e1.getMessage());
                        }
                        if (StringUtil.isNullOrEmpty(specialId))
                            LogHelper.test(fuid + "会员备案失败");
                        try {
                            userExtraTaoBaoInfoService.addSpecialId(fuid, specialId, taoBaoUid, name, true);
@@ -205,17 +204,16 @@
                } catch (TaoBaoAuthException e) {
                    if (e.getCode() == TaoBaoAuthException.CODE_NOT_REAL_NAME)
                        userAccountMsgNotificationService.taoBaoAuthFail(uid, name, "淘宝账号未实名");
                    LogManager.getLogger(LogType.taobaoAuth).error(uid + "会员备案失败:" + e.getMessage());
                }
                if (StringUtil.isNullOrEmpty(specialId))
                    LogHelper.test(uid + "会员备案失败");
                try {
                    userExtraTaoBaoInfoService.addSpecialId(uid, specialId, taoBaoUid, nickName, true);
                } catch (UserExtraTaoBaoInfoException e) {
                    LogHelper.test(e.getMsg());
                    errCode = 5;
                }
                final Long fuid=uid;
                final Long fuid = uid;
                final String specialId2 = specialId;
                // 异步申请渠道ID
@@ -228,9 +226,8 @@
                            relationId = TaoKeApiUtil.getRelationId(accessToken, TaoBaoConstant.TAOBAO_AUTH_APPKEY,
                                    TaoBaoConstant.TAOBAO_AUTH_APPSECRET);
                        } catch (TaoBaoAuthException e1) {
                        } // 渠道ID
                        if (StringUtil.isNullOrEmpty(relationId))
                            LogHelper.test(fuid + "渠道备案失败");
                            LogManager.getLogger(LogType.taobaoAuth).error(fuid + "渠道备案失败:" + e1.getMessage());
                        }
                        try {
                            userExtraTaoBaoInfoService.addRelationId(fuid, relationId, taoBaoUid, name, true);
@@ -255,11 +252,11 @@
                    relationId = TaoKeApiUtil.getRelationId(accessToken, Constant.TAOBAO_AUTH_APPKEY,
                            TaoBaoConstant.TAOBAO_AUTH_APPSECRET);// 渠道ID
                } catch (TaoBaoAuthException e) {
                    LogManager.getLogger(LogType.taobaoAuth).error(uid + "渠道备案失败");
                    tbErrorCode = e.getCode();
                }
                if (StringUtil.isNullOrEmpty(relationId)) {
                    LogHelper.test(uid + "渠道备案失败");
                    bindInfo = false;
                }
@@ -270,9 +267,9 @@
                                TaoBaoConstant.TAOBAO_AUTH_APPSECRET);
                    } catch (TaoBaoAuthException e) {
                        tbErrorCode = e.getCode();
                        LogManager.getLogger(LogType.taobaoAuth).error(uid + "会员备案失败");
                    }
                    if (StringUtil.isNullOrEmpty(specialId)) {
                        LogHelper.test(uid + "会员备案失败");
                        bindInfo = false;
                    }
                }
@@ -337,17 +334,17 @@
            {
                if ("share".equalsIgnoreCase(source)) {
                    if (isNewJump)
                        response.sendRedirect("http://apph5.yeshitv.com/flqWeb/h5/tbauth/success.html");
                        response.sendRedirect("http://apph5.banliapp.com/flqWeb/h5/tbauth/success.html");
                    else
                        closeWebPage(response.getWriter());
                } else if ("zigou".equalsIgnoreCase(source)) {
                    if (isNewJump)
                        response.sendRedirect("http://apph5.yeshitv.com/flqWeb/h5/tbauth/success.html");
                        response.sendRedirect("http://apph5.banliapp.com/flqWeb/h5/tbauth/success.html");
                    else
                        closeWebPage(response.getWriter());
                } else if ("bind".equalsIgnoreCase(source)) {
                    if (isNewJump)
                        response.sendRedirect("http://apph5.yeshitv.com/flqWeb/h5/tbauth/success.html");
                        response.sendRedirect("http://apph5.banliapp.com/flqWeb/h5/tbauth/success.html");
                    else {
                        String script = String.format(
                                "<script>if(/(iPhone|iPad|iPod|iOS)/i.test(navigator.userAgent)) {window.location.href = 'yestv://toast#%s';setTimeout(function(){window.location.href = 'yestv://finishPage';},100);} else {yestv.toast(\"恭喜你,淘宝绑定成功\");yestv.finishPage();}</script>",
@@ -358,17 +355,17 @@
            } else {// 失败
                if ("share".equalsIgnoreCase(source)) {
                    if (isNewJump)
                        response.sendRedirect("http://apph5.yeshitv.com/flqWeb/h5/tbauth/fail.html");
                        response.sendRedirect("http://apph5.banliapp.com/flqWeb/h5/tbauth/fail.html");
                    else
                        closeWebPage(response.getWriter());
                } else if ("zigou".equalsIgnoreCase(source)) {
                    if (isNewJump)
                        response.sendRedirect("http://apph5.yeshitv.com/flqWeb/h5/tbauth/fail.html");
                        response.sendRedirect("http://apph5.banliapp.com/flqWeb/h5/tbauth/fail.html");
                    else
                        closeWebPage(response.getWriter());
                } else if ("bind".equalsIgnoreCase(source)) {
                    if (isNewJump)
                        response.sendRedirect("http://apph5.yeshitv.com/flqWeb/h5/tbauth/fail.html");
                        response.sendRedirect("http://apph5.banliapp.com/flqWeb/h5/tbauth/fail.html");
                    else {
                        String script = String.format(
                                "<script>if(/(iPhone|iPad|iPod|iOS)/i.test(navigator.userAgent)) {window.location.href = 'yestv://toast#%s';setTimeout(function(){window.location.href = 'yestv://finishPage';},100);} else {yestv.toast(\"抱歉,淘宝绑定失败\");yestv.finishPage();}</script>",
@@ -378,9 +375,8 @@
                }
            }
        } catch (Exception e) {
            LogHelper.errorDetailInfo(e);
        }
    }
    private void closeWebPage(PrintWriter out) {
fanli/src/main/java/com/yeshi/fanli/controller/admin/ExtractAdminController.java
@@ -430,7 +430,7 @@
                        desc.append("维权订单数:" + record.getExtraInfo().getWeiQuanOrderCount() + "\n#");
                        desc.append("维权订单佣金:" + record.getExtraInfo().getWeiQuanOrderFanAmount() + "\n#");
                        if (record.getExtraInfo().getOrderCount50More() > 0
                                || record.getExtraInfo().getWeiQuanOrderCount() > 1
                                || record.getExtraInfo().getWeiQuanOrderCount() > 0
                                || record.getExtraInfo().getWeiQuanOrderFanAmount().compareTo(new BigDecimal(10)) >= 0)
                            warnLevel = 2;
                    } else {
fanli/src/main/java/com/yeshi/fanli/controller/client/v1/BanLiShopController.java
@@ -15,12 +15,17 @@
import com.yeshi.fanli.entity.accept.AcceptData;
import com.yeshi.fanli.entity.bus.homemodule.SwiperPicture;
import com.yeshi.fanli.entity.common.AdminUser;
import com.yeshi.fanli.entity.common.Config;
import com.yeshi.fanli.entity.shop.BanLiShopGoods;
import com.yeshi.fanli.entity.shop.BanLiShopGoodsSets;
import com.yeshi.fanli.entity.shop.BanLiShopGoodsSetsPay;
import com.yeshi.fanli.entity.shop.BanLiShopOrder;
import com.yeshi.fanli.entity.system.ConfigKeyEnum;
import com.yeshi.fanli.exception.redpack.RedPackBalanceException;
import com.yeshi.fanli.exception.shop.BanLiShopOrderException;
import com.yeshi.fanli.service.AdminUserService;
import com.yeshi.fanli.service.inter.config.ConfigService;
import com.yeshi.fanli.service.inter.homemodule.SwiperPictureService;
import com.yeshi.fanli.service.inter.redpack.RedPackBalanceService;
import com.yeshi.fanli.service.inter.redpack.RedPackForbidService;
@@ -31,6 +36,8 @@
import com.yeshi.fanli.service.inter.shop.BanLiShopOrderService;
import com.yeshi.fanli.util.Constant;
import com.yeshi.fanli.util.StringUtil;
import com.yeshi.fanli.util.ThreadUtil;
import com.yeshi.fanli.util.email.MailSenderUtil;
import com.yeshi.fanli.util.factory.shop.BanLiShopOrderGoodsVOFactory;
import com.yeshi.fanli.util.wx.BanLiShopWXPayUtil;
import com.yeshi.fanli.vo.shop.BanLiShopOrderVO;
@@ -70,6 +77,13 @@
    @Resource
    private RedPackForbidService redPackForbidService;
    @Resource
    private ConfigService configService;
    @Resource
    private AdminUserService adminUserService;
    /**
     * 商品列表
@@ -246,6 +260,23 @@
                    out.print(JsonUtil.loadJSONP(callback, JsonUtil.loadTrueResult(data)));
                else
                    out.print(JsonUtil.loadTrueResult(data));
                ThreadUtil.run(new Runnable() {
                    @Override
                    public void run() {
                        long[] targetUids = new long[] { 3L, 4L };
                        Config config = configService.getConfig(ConfigKeyEnum.extractCodeEmailFrom.getKey());
                        String[] sts = config.getValue().split(",");
                        String account = sts[0];
                        String pwd = sts[1];
                        for (long adminId : targetUids) {
                            AdminUser adminUser = adminUserService.selectByPrimaryKey(adminId);
                            String msg = "红包商城有新的订单,请前往审核";
                            boolean isS = MailSenderUtil.sendEmail(adminUser.getEmail(), account, pwd, "红包商城新订单提醒", msg);
                        }
                    }
                });
            }
        } catch (BanLiShopOrderException e) {
fanli/src/main/java/com/yeshi/fanli/controller/client/v1/DynamicRecommendController.java
@@ -20,6 +20,7 @@
import com.yeshi.fanli.entity.taobao.TaoBaoGoodsBrief;
import com.yeshi.fanli.entity.taobao.TaoBaoSearchResult;
import com.yeshi.fanli.entity.taobao.dataoke.DaTaoKeDetailV2;
import com.yeshi.fanli.exception.taobao.TaoBaoTokenParseException;
import com.yeshi.fanli.exception.taobao.TaobaoGoodsDownException;
import com.yeshi.fanli.log.LogHelper;
import com.yeshi.fanli.service.inter.config.ConfigService;
@@ -270,9 +271,15 @@
     * @return
     */
    private boolean analysisTaoToken(String text, PrintWriter out) {
        String token = StringUtil.picUpTaoToken(text);
        if (!StringUtil.isNullOrEmpty(token)) {
            Long auctionId = TaoKeApiUtil.tokenConvertAuctionId(token);
        List<String> tokenList = TaoBaoUtil.getTokenListFromText(text);
        if (tokenList != null && tokenList.size() > 0) {
            String token = tokenList.get(0);
            Long auctionId = null;
            try {
                auctionId = TaoKeApiUtil.tokenConvertAuctionId(token);
            } catch (TaoBaoTokenParseException e1) {
                e1.printStackTrace();
            }
            if (auctionId != null) {
                TaoBaoGoodsBrief tb = null;
                try {
fanli/src/main/java/com/yeshi/fanli/controller/client/v1/RecommendController.java
@@ -1416,7 +1416,7 @@
            if (!StringUtil.isNullOrEmpty(imei) || !StringUtil.isNullOrEmpty(idfa)) {
                long startTime = java.lang.System.currentTimeMillis();
                TaoBaoSearchResult result = TaoKeApiUtil.guessDeviceLike(page, 50, imei, idfa);
                TaoBaoSearchResult result = TaoKeApiUtil.guessDeviceLike(page, 50, imei, idfa,"");
                if (result != null && result.getTaoBaoGoodsBriefs() != null) {
                    // 筛选
@@ -2253,7 +2253,7 @@
        data.put("shareUrl", shareUrl);
        data.put("shareUsers", listShareUser);
        data.put("couponUsers", listCouponUser);
        data.put("detailWebUrl", "http://apph5.yeshitv.com/apppage/goods_img.html?id=" + id);
        data.put("detailWebUrl", "http://apph5.banliapp.com/apppage/goods_img.html?id=" + id);
        String noRebateHelpLink = null;
fanli/src/main/java/com/yeshi/fanli/controller/client/v1/ShareController.java
@@ -379,7 +379,7 @@
            data.put("token", TaoBaoUtil.filterTaoToken(taoBaoLink.getTaoToken()));
            data.put("rule",
                    "http://apph5.yeshitv.com/apppage/all_help_content.html?id=148&from=singlemessage&isappinstalled=0");
                    "http://apph5.banliapp.com/apppage/all_help_content.html?id=148&from=singlemessage&isappinstalled=0");
            data.put("pictUrl", TbImgUtil.getTBSizeImg(taoBaoLink.getGoods().getPictUrl(), 500));
            // 无券
@@ -1058,7 +1058,7 @@
                // 帮助链接
                data.put("helpLink",
                        "http://apph5.yeshitv.com/apppage/all_help_content.html?id=148&from=singlemessage&isappinstalled=0");
                        "http://apph5.banliapp.com/apppage/all_help_content.html?id=148&from=singlemessage&isappinstalled=0");
                if (cid == 2) { // 2 推荐好货
                    ShareGoodsRecordDTO shareRecord = userShareGoodsRecordService.addRecordDynamic(uid,
fanli/src/main/java/com/yeshi/fanli/controller/client/v1/UserAccountController.java
@@ -282,7 +282,7 @@
        } catch (UserAccountException e) {
            try {
                LogHelper.cookieLog("登录出错:" + e.getCode() + "-" + e.getMessage());
                LogHelper.error("登录出错:" + e.getCode() + "-" + e.getMessage());
            } catch (Exception e1) {
                e1.printStackTrace();
            }
@@ -1210,7 +1210,7 @@
        } catch (UserAccountException e) {
            out.print(JsonUtil.loadFalseResult(e.getCode(), e.getMsg()));
            try {
                LogHelper.cookieLog("登录出错:" + e.getCode() + "-" + e.getMessage());
                LogHelper.error("登录出错:" + e.getCode() + "-" + e.getMessage());
            } catch (Exception e1) {
                e1.printStackTrace();
            }
fanli/src/main/java/com/yeshi/fanli/controller/client/v1/UserMoneyController.java
@@ -293,15 +293,8 @@
        maxDate = new Date(
                TimeUtil.convertToTimeTemp(TimeUtil.getGernalTime(ca.getTimeInMillis(), "yyyy-MM"), "yyyy-MM"));
        // 本月未到账,以app端我的页面上月收益为准
        BigDecimal selfMoney = hongBaoV2CountService.getRewardMoneyToCount(uid, 4, 1, null);
        BigDecimal shareMoney = hongBaoV2CountService.getRewardMoneyToCount(uid, 4, 2, null);
        BigDecimal inviteMoney = hongBaoV2CountService.getRewardMoneyToCount(uid, 4, 3, null);
        BigDecimal monthUnRecievedMoney = selfMoney.setScale(2, BigDecimal.ROUND_DOWN)
                .add(shareMoney.setScale(2, BigDecimal.ROUND_DOWN)).add(inviteMoney.setScale(2, BigDecimal.ROUND_DOWN));
        // 本月未到账
        BigDecimal monthUnRecievedMoney = hongBaoV2Service.getUnRecievedMoneyWithPreGetTime(uid, minDate, maxDate);
        vo.setMonthUnRecievedMoney(monthUnRecievedMoney);
        // 全部未到账
fanli/src/main/java/com/yeshi/fanli/controller/client/v1/UserMsgController.java
@@ -404,7 +404,7 @@
    }
    private void addRecommendGoods(Long uid, String device, String imei, String idfa) {
        TaoBaoSearchResult result = TaoKeApiUtil.guessDeviceLike(1, 50, imei, idfa);
        TaoBaoSearchResult result = TaoKeApiUtil.guessDeviceLike(1, 50, imei, idfa,"");
        if (result != null && result.getTaoBaoGoodsBriefs() != null) {
            for (int i = 0; i < result.getTaoBaoGoodsBriefs().size(); i++) {
                if (result.getTaoBaoGoodsBriefs().get(i).getCouponAmount() == null
fanli/src/main/java/com/yeshi/fanli/controller/client/v1/h5/AppH5CouponController.java
New file
@@ -0,0 +1,194 @@
package com.yeshi.fanli.controller.client.v1.h5;
import java.io.PrintWriter;
import java.math.BigDecimal;
import java.util.ArrayList;
import java.util.List;
import javax.annotation.Resource;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.yeshi.utils.JsonUtil;
import com.google.gson.Gson;
import com.google.gson.GsonBuilder;
import com.yeshi.fanli.dto.ConfigParamsDTO;
import com.yeshi.fanli.entity.accept.AcceptData;
import com.yeshi.fanli.entity.bus.lable.QualityFactory;
import com.yeshi.fanli.entity.bus.user.UserInfo;
import com.yeshi.fanli.entity.bus.user.UserInfoExtra;
import com.yeshi.fanli.entity.taobao.TaoBaoGoodsBrief;
import com.yeshi.fanli.exception.taobao.TaoKeApiException;
import com.yeshi.fanli.exception.taobao.TaobaoGoodsDownException;
import com.yeshi.fanli.service.inter.lable.QualityGoodsService;
import com.yeshi.fanli.service.inter.order.config.HongBaoManageService;
import com.yeshi.fanli.service.inter.user.UserInfoExtraService;
import com.yeshi.fanli.service.inter.user.UserInfoService;
import com.yeshi.fanli.service.inter.user.UserSystemCouponService;
import com.yeshi.fanli.service.inter.user.vip.UserVIPInfoService;
import com.yeshi.fanli.util.factory.goods.GoodsDetailVOFactory;
import com.yeshi.fanli.util.taobao.TaoBaoUtil;
import com.yeshi.fanli.util.taobao.TaoKeApiUtil;
import com.yeshi.fanli.vo.goods.GoodsDetailVO;
import net.sf.json.JSONArray;
import net.sf.json.JSONObject;
@Controller
@RequestMapping("api/apph5/v1/coupon")
public class AppH5CouponController {
    @Resource
    private QualityGoodsService qualityGoodsService;
    @Resource
    private HongBaoManageService hongBaoManageService;
    @Resource
    private UserInfoService userInfoService;
    @Resource
    private UserSystemCouponService userSystemCouponService;
    @Resource
    private UserInfoExtraService userInfoExtraService;
    @Resource
    private UserVIPInfoService userVIPInfoService;
    @RequestMapping("getMianDanGoodsList")
    public void getMianDanGoodsList(AcceptData acceptData, PrintWriter out, int page, int pageSize, String callback) {
        List<QualityFactory> listQuery = qualityGoodsService.listFreeGoods((page - 1) * pageSize, pageSize);
        if (listQuery == null || listQuery.size() == 0) {
            JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult(2, "没有更多了"));
            return;
        }
        List<Long> listGid = new ArrayList<Long>();
        for (QualityFactory qualityFactory : listQuery) {
            TaoBaoGoodsBrief taoBaoGoodsBrief = qualityFactory.getTaoBaoGoodsBrief();
            if (taoBaoGoodsBrief == null) {
                continue;
            }
            listGid.add(taoBaoGoodsBrief.getAuctionId());
        }
        // API网络接口验证是否在售
        List<TaoBaoGoodsBrief> listTaoKeGoods = null;
        try {
            listTaoKeGoods = TaoKeApiUtil.getBatchGoodsInfo(listGid);
        } catch (TaoKeApiException e) {
            e.printStackTrace();
        } catch (TaobaoGoodsDownException e) {
            e.printStackTrace();
        } catch (Exception e) {
            e.printStackTrace();
        }
        JSONArray array = new JSONArray();
        Gson gson = JsonUtil.getConvertBigDecimalToStringSubZeroBuilder(new GsonBuilder())
                .excludeFieldsWithoutExposeAnnotation().setDateFormat("yyyy-MM-dd").create();
        ConfigParamsDTO configParamsDTO = hongBaoManageService.getShowComputeRate(acceptData.getPlatform(),
                acceptData.getVersion());
        /* 遍历列表数据 */
        for (QualityFactory selectionGoods : listQuery) {
            TaoBaoGoodsBrief taoBaoGoodsBrief = selectionGoods.getTaoBaoGoodsBrief();
            if (taoBaoGoodsBrief == null) {
                continue;
            }
            if (listTaoKeGoods != null && listTaoKeGoods.size() > 0) {
                boolean stateSale = false; // 默认停售
                Long goodsId = taoBaoGoodsBrief.getAuctionId();
                for (TaoBaoGoodsBrief taoKeGoods : listTaoKeGoods) {
                    Long auctionId = taoKeGoods.getAuctionId();
                    if (goodsId == auctionId || goodsId.equals(auctionId)) {
                        stateSale = true; // 在售
                        break;
                    }
                }
                if (!stateSale) {
                    continue;
                }
            }
            BigDecimal couplePrice = TaoBaoUtil.getAfterUseCouplePrice(taoBaoGoodsBrief);
            if (couplePrice.compareTo(new BigDecimal("9.9")) == 1) {
                continue; // 券后价大于10
            }
            GoodsDetailVO detailVO = GoodsDetailVOFactory.convertTaoBao(taoBaoGoodsBrief, configParamsDTO);
            array.add(gson.toJson(detailVO));
        }
        JSONObject data = new JSONObject();
        data.put("goodsList", array);
        JsonUtil.printMode(out, callback, JsonUtil.loadTrueResult(data));
    }
    @RequestMapping("getMianDanInfo")
    public void getMianDanInfo(AcceptData acceptData, PrintWriter out, Long uid, String callback) {
        if (uid == null) {
            JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult("用户未登录"));
            return;
        }
        // 获取用户信息
        UserInfo user = userInfoService.getUserById(uid);
        if (user == null) {
            JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult("用户不存在"));
            return;
        }
        // 获取免单券数量
        long couponCount = userSystemCouponService.countUsableFreeCouponForBuy(uid);
        JSONObject userJson = new JSONObject();
        userJson.put("nickName", user.getNickName());
        userJson.put("portrait", user.getPortrait());
        userJson.put("id", user.getId());
        JSONObject data = new JSONObject();
        data.put("user", userJson);
        data.put("couponCount", couponCount);
        JsonUtil.printMode(out, callback, JsonUtil.loadTrueResult(data));
    }
    /**
     * 获取返利奖励券信息
     *
     * @param acceptData
     * @param out
     * @param uid
     * @param callback
     */
    @RequestMapping("getRewardCouponInfo")
    public void getRewardCouponInfo(AcceptData acceptData, PrintWriter out, Long uid, String callback) {
        if (uid == null) {
            JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult("用户未登录"));
            return;
        }
        // 获取用户信息
        UserInfo user = userInfoService.getUserById(uid);
        if (user == null) {
            JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult("用户不存在"));
            return;
        }
        // 获取免单券数量
        long couponCount = userSystemCouponService.countUsableRewardCoupon(uid);
        UserInfoExtra extraInfo = userInfoExtraService.getUserInfoExtra(uid);
        long integralCount = extraInfo != null ? extraInfo.getGoldCoin() : 0L;
        JSONObject userJson = new JSONObject();
        userJson.put("nickName", user.getNickName());
        userJson.put("portrait", user.getPortrait());
        userJson.put("id", user.getId());
        userJson.put("vip", userVIPInfoService.isVIP(user.getId()));
        JSONObject data = new JSONObject();
        data.put("user", userJson);
        data.put("couponCount", couponCount);
        data.put("integralCount", integralCount);
        JsonUtil.printMode(out, callback, JsonUtil.loadTrueResult(data));
    }
}
fanli/src/main/java/com/yeshi/fanli/controller/client/v2/CommonContentControllerV2.java
@@ -147,7 +147,7 @@
            // 猜你喜欢
            String idfa = acceptData.getIdfa();
            String imei = acceptData.getImei();
            result = guessLikeDeviceTB(idfa, imei, page);
            result = guessLikeDeviceTB(idfa, imei, acceptData.getUtdid(), page);
        } else {
            // 大淘客页码只能为10,50,100,200
            result = commonTemplateContentService.getContentList(type, cid, page, 10);
@@ -162,7 +162,9 @@
        JSONArray array = new JSONArray();
        Gson gson = JsonUtil.getConvertBigDecimalToStringSubZeroBuilder(new GsonBuilder()).create();
        List<TaoBaoGoodsBrief> goodsList = result.getGoodsList();
        List<TaoBaoGoodsBrief> goodsList = new ArrayList<>();
        if (result != null)
            goodsList = result.getGoodsList();
        ConfigParamsDTO paramsDTO = hongBaoManageService.getShowComputeRate(acceptData.getPlatform(),
                acceptData.getVersion());
@@ -178,7 +180,7 @@
        }
        root.put("list", array);
        root.put("count", result.getCount());
        root.put("count", result != null ? result.getCount() : 0);
        out.print(JsonUtil.loadTrueResult(root));
    }
@@ -215,7 +217,7 @@
                        .excludeFieldsWithoutExposeAnnotation().setDateFormat("yyyy-MM-dd").create();
                ConfigParamsDTO paramsDTO = hongBaoManageService.getShowComputeRate(acceptData.getPlatform(),
                        acceptData.getVersion());
                for (JDGoods goods : goodsList) {
                    array.add(gson.toJson(GoodsDetailVOFactory.convertJDGoods(goods, paramsDTO)));
                }
@@ -242,7 +244,8 @@
            // 2、顶部轮播图
            List<SwiperPicture> bannerList = null;
            if (Constant.IS_TEST) {
                bannerList = swiperPictureService.getByBannerCardAndVersion("index_top",acceptData.getPlatform(), Integer.parseInt(acceptData.getVersion()));
                bannerList = swiperPictureService.getByBannerCardAndVersion("index_top", acceptData.getPlatform(),
                        Integer.parseInt(acceptData.getVersion()));
            }
            if (bannerList == null) {
@@ -263,9 +266,9 @@
            if (goodsList != null && goodsList.size() > 0) {
                Gson gson = JsonUtil.getConvertBigDecimalToStringSubZeroBuilder(new GsonBuilder())
                        .excludeFieldsWithoutExposeAnnotation().setDateFormat("yyyy-MM-dd").create();
                ConfigParamsDTO paramsDTO =  hongBaoManageService.getShowComputeRate(acceptData.getPlatform(),
                ConfigParamsDTO paramsDTO = hongBaoManageService.getShowComputeRate(acceptData.getPlatform(),
                        acceptData.getVersion());
                for (PDDGoodsDetail goods : goodsList) {
                    array.add(gson.toJson(GoodsDetailVOFactory.convertPDDGoods(goods, paramsDTO)));
                }
@@ -285,8 +288,8 @@
     * @return
     */
    @Cacheable(value = "commonContentCache", key = "#idfa+'-'+#imei+'-'+#page")
    private CommonContentResult guessLikeDeviceTB(String idfa, String imei, Integer page) {
        TaoBaoSearchResult searchResult = TaoKeApiUtil.guessDeviceLike(page, Constant.PAGE_SIZE, imei, idfa);
    private CommonContentResult guessLikeDeviceTB(String idfa, String imei, String utdid, Integer page) {
        TaoBaoSearchResult searchResult = TaoKeApiUtil.guessDeviceLike(page, Constant.PAGE_SIZE, imei, idfa, utdid);
        if (searchResult != null && searchResult.getTaoBaoGoodsBriefs() != null
                && searchResult.getTaoBaoGoodsBriefs().size() > 0) {
            CommonContentResult result = new CommonContentResult();
fanli/src/main/java/com/yeshi/fanli/controller/client/v2/ConvertLinkController.java
New file
@@ -0,0 +1,284 @@
package com.yeshi.fanli.controller.client.v2;
import java.io.PrintWriter;
import java.util.ArrayList;
import java.util.List;
import java.util.UUID;
import javax.annotation.Resource;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.yeshi.utils.JsonUtil;
import com.google.gson.Gson;
import com.yeshi.fanli.entity.accept.AcceptData;
import com.yeshi.fanli.entity.bus.user.UserConvertLinkTemplate;
import com.yeshi.fanli.entity.system.ConfigKeyEnum;
import com.yeshi.fanli.service.inter.config.ConfigService;
import com.yeshi.fanli.service.inter.user.UserConvertLinkTemplateService;
import com.yeshi.fanli.service.manger.goods.ConvertLinkManager;
import com.yeshi.fanli.util.RedisKeyEnum;
import com.yeshi.fanli.util.RedisManager;
import com.yeshi.fanli.util.StringUtil;
import net.sf.json.JSONObject;
/**
 * 文案转链
 * @author Administrator
 *
 */
@Controller("convertLinkControllerV2")
@RequestMapping("api/v2/convertlink")
public class ConvertLinkController {
    @Resource
    private UserConvertLinkTemplateService userConvertLinkTemplateService;
    @Resource
    private ConfigService configService;
    @Resource
    private RedisManager redisManager;
    @Resource
    private ConvertLinkManager convertLinkManager;
    /**
     *
     * @Title: getCommonTextList
     * @Description: 获取模板
     * @param acceptData
     * @param uid
     * @param callback
     * @param out
     * void 返回类型
     * @throws
     */
    @RequestMapping(value = "getCommonTextList")
    public void getCommonTextList(AcceptData acceptData, Long uid, String callback, PrintWriter out) {
        if (uid == null || uid == 0L) {
            out.print(JsonUtil.loadJSONP(callback, JsonUtil.loadFalseResult("用户未登录")));
            return;
        }
        JSONObject data = new JSONObject();
        List<UserConvertLinkTemplate> list = userConvertLinkTemplateService.listByUid(uid);
        if (list == null)
            list = new ArrayList<>();
        Gson gson = JsonUtil.getApiCommonGson();
        data.put("list", gson.toJson(list));
        data.put("tip", configService.get(ConfigKeyEnum.convertDocTip.getKey()));
        data.put("helpLink", configService.get(ConfigKeyEnum.convertDocHelpLink.getKey()));
        String text = redisManager.getCommonString(RedisKeyEnum.convertLinkDocTemp.getKey() + uid);
        if (text != null) {
            data.put("lastText", text);
            redisManager.removeCommonString(RedisKeyEnum.convertLinkDocTemp.getKey() + uid);
        }
        out.print(JsonUtil.loadJSONP(callback, JsonUtil.loadTrueResult(data)));
    }
    /**
     *
     * @Title: setConvertLinkDoc
     * @Description: 暂存文案
     * @param acceptData
     * @param uid
     * @param text
     * @param callback
     * @param out
     * void 返回类型
     * @throws
     */
    @RequestMapping(value = "setConvertLinkDoc")
    public void setConvertLinkDoc(AcceptData acceptData, Long uid, String text, String callback, PrintWriter out) {
        if (uid == null || uid == 0L) {
            out.print(JsonUtil.loadJSONP(callback, JsonUtil.loadFalseResult("用户未登录")));
            return;
        }
        if (StringUtil.isNullOrEmpty(text)) {
            out.print(JsonUtil.loadJSONP(callback, JsonUtil.loadFalseResult("文案为空")));
            return;
        }
        redisManager.cacheCommonString(RedisKeyEnum.convertLinkDocTemp.getKey() + uid, text);
        out.print(JsonUtil.loadJSONP(callback, JsonUtil.loadTrueResult("")));
    }
    /**
     *
     * @Title: addCommonText
     * @Description: 添加模板
     * @param acceptData
     * @param uid
     * @param template
     * @param callback
     * @param out
     * void 返回类型
     * @throws
     */
    @RequestMapping(value = "addCommonText")
    public void addCommonText(AcceptData acceptData, Long uid, String template, String callback, PrintWriter out) {
        if (uid == null || uid == 0L) {
            out.print(JsonUtil.loadJSONP(callback, JsonUtil.loadFalseResult("用户未登录")));
            return;
        }
        if (StringUtil.isNullOrEmpty(template)) {
            out.print(JsonUtil.loadJSONP(callback, JsonUtil.loadFalseResult("文案为空")));
            return;
        }
        UserConvertLinkTemplate bean = new UserConvertLinkTemplate();
        bean.setUid(uid);
        bean.setTemplate(template);
        try {
            userConvertLinkTemplateService.addConvertLinkTemplate(bean);
        } catch (Exception e) {
            out.print(JsonUtil.loadJSONP(callback, JsonUtil.loadFalseResult(e.getMessage())));
            return;
        }
        out.print(JsonUtil.loadJSONP(callback, JsonUtil.loadTrueResult("")));
    }
    /**
     *
     * @Title: deleteCommonText
     * @Description: 删除模板
     * @param acceptData
     * @param uid
     * @param id
     * @param callback
     * @param out
     * void 返回类型
     * @throws
     */
    @RequestMapping(value = "deleteCommonText")
    public void deleteCommonText(AcceptData acceptData, Long uid, String id, String callback, PrintWriter out) {
        if (uid == null || uid == 0L) {
            out.print(JsonUtil.loadJSONP(callback, JsonUtil.loadFalseResult("用户未登录")));
            return;
        }
        if (StringUtil.isNullOrEmpty(id)) {
            out.print(JsonUtil.loadJSONP(callback, JsonUtil.loadFalseResult("模板ID为空")));
            return;
        }
        try {
            userConvertLinkTemplateService.deleteConvertLinkTemplate(id, uid);
        } catch (Exception e) {
            out.print(JsonUtil.loadJSONP(callback, JsonUtil.loadFalseResult(e.getMessage())));
            return;
        }
        out.print(JsonUtil.loadJSONP(callback, JsonUtil.loadTrueResult("")));
    }
    @RequestMapping(value = "updateCommonText")
    public void updateCommonText(AcceptData acceptData, Long uid, String id, String template, String callback,
            PrintWriter out) {
        if (uid == null || uid == 0L) {
            out.print(JsonUtil.loadJSONP(callback, JsonUtil.loadFalseResult("用户未登录")));
            return;
        }
        if (StringUtil.isNullOrEmpty(id)) {
            out.print(JsonUtil.loadJSONP(callback, JsonUtil.loadFalseResult("模板ID为空")));
            return;
        }
        if (StringUtil.isNullOrEmpty(template)) {
            out.print(JsonUtil.loadJSONP(callback, JsonUtil.loadFalseResult("模板内容为空")));
            return;
        }
        UserConvertLinkTemplate bean = new UserConvertLinkTemplate();
        bean.setUid(uid);
        bean.setTemplate(template);
        bean.setId(id);
        try {
            userConvertLinkTemplateService.updateTemplate(bean);
        } catch (Exception e) {
            out.print(JsonUtil.loadJSONP(callback, JsonUtil.loadFalseResult(e.getMessage())));
            return;
        }
        out.print(JsonUtil.loadJSONP(callback, JsonUtil.loadTrueResult("")));
    }
    /**
     *
     * @Title: convert
     * @Description: 文案转链
     * @param acceptData
     * @param uid
     * @param text
     * @param callback
     * @param out
     * void 返回类型
     * @throws
     */
    @RequestMapping(value = "convert")
    public void convert(AcceptData acceptData, Long uid, String text, String callback, PrintWriter out) {
        if (uid == null || uid == 0L) {
            out.print(JsonUtil.loadJSONP(callback, JsonUtil.loadFalseResult("用户未登录")));
            return;
        }
        if (StringUtil.isNullOrEmpty(text)) {
            out.print(JsonUtil.loadJSONP(callback, JsonUtil.loadFalseResult("文案为空")));
            return;
        }
        try {
            String key = RedisKeyEnum.convertLinkDocResultTemp.getKey() + uid + "-"
                    + StringUtil.Md5(UUID.randomUUID().toString());
            String result = convertLinkManager.convertLinkFromText(text, uid, true);
            redisManager.cacheCommonString(key, result, 60);
            JSONObject data = new JSONObject();
            data.put("id", key);
            out.print(JsonUtil.loadJSONP(callback, JsonUtil.loadTrueResult(data)));
        } catch (Exception e) {
            out.print(JsonUtil.loadJSONP(callback, JsonUtil.loadFalseResult(e.getMessage())));
            return;
        }
    }
    @RequestMapping(value = "getConvertResult")
    public void getConvertResult(AcceptData acceptData, Long uid, String id, String callback, PrintWriter out) {
        if (uid == null || uid == 0L) {
            out.print(JsonUtil.loadJSONP(callback, JsonUtil.loadFalseResult("用户未登录")));
            return;
        }
        if (StringUtil.isNullOrEmpty(id)) {
            out.print(JsonUtil.loadJSONP(callback, JsonUtil.loadFalseResult("文案ID为空")));
            return;
        }
        String key =id;
        String result = redisManager.getCommonString(key);
        if (StringUtil.isNullOrEmpty(result)) {
            out.print(JsonUtil.loadJSONP(callback, JsonUtil.loadFalseResult("获取转链结果出错")));
        } else {
            redisManager.removeCommonString(key);
            JSONObject data = new JSONObject();
            data.put("data", result);
            data.put("tip", "1.转好的链接/口令有效期,请在有效期内推广分享;\r\n" + "2.已经转好的链接/口令请不要修改,以免无法追踪到订单;\r\n"
                    + "3.请确保转换链接合法合规,一切违法的链/口令产生的法律后果自行承担与本App无关。");
            out.print(JsonUtil.loadJSONP(callback, JsonUtil.loadTrueResult(data)));
        }
    }
}
fanli/src/main/java/com/yeshi/fanli/controller/client/v2/GoodsControllerV2.java
@@ -195,10 +195,9 @@
    @Resource
    private UserVIPInfoService userVIPInfoService;
    @Resource
    private UserVipConfigService userVipConfigService;
    /**
     * 淘宝商品详情
@@ -383,7 +382,8 @@
                    "¥" + TaoBaoUtil.getGoodsHongBaoMoney(goods, hongBaoManageService.getVIPShareRate()));
            goodsDetail.getMoneyInfo().setRateInfo(goodsDetail.getMoneyInfo().getMaxRateInfo());
        }
        goodsDetail.getMoneyInfo().setRateInfoHelpUrl(configService.get(ConfigKeyEnum.goodsDetailFanliRateHelpUrl.getKey()));
        goodsDetail.getMoneyInfo()
                .setRateInfoHelpUrl(configService.get(ConfigKeyEnum.goodsDetailFanliRateHelpUrl.getKey()));
        if (TaoBaoUtil.isYUShou(goods)) {
            if (!StringUtil.isNullOrEmpty(goods.getPresaleDiscountFeeText())) {
@@ -416,7 +416,7 @@
        }
        extraVO.setTbPidInfo(clientTBPid);
        extraVO.setDetailUrl("http://apph5.yeshitv.com/apppage/goods_img.html?id=" + id);
        extraVO.setDetailUrl("http://apph5.banliapp.com/apppage/goods_img.html?id=" + id);
        // 分享赚人提示
        MoneyInfoVO moneyInfo = goodsDetail.getMoneyInfo();
@@ -552,7 +552,12 @@
            } else
                rewardCoupon.setDesc("用返利奖励券最高返");
            rewardCoupon.setParams(params1.toString());
            otherInfo.setRewardCoupon(rewardCoupon);
            if ("ios".equalsIgnoreCase(acceptData.getPlatform())
                    && configService.iosOnLining(Integer.parseInt(acceptData.getVersion())))
                otherInfo.setRewardCoupon(null);
            goodsDetail.setOtherInfo(otherInfo);
        }
        extraVO.setFanliValid(fanliValid);
@@ -639,7 +644,8 @@
                    .setShareMoney("¥" + JDUtil.getGoodsFanLiMoney(jdGoods, hongBaoManageService.getVIPShareRate()));
            goodsDetail.getMoneyInfo().setRateInfo(goodsDetail.getMoneyInfo().getMaxRateInfo());
        }
        goodsDetail.getMoneyInfo().setRateInfoHelpUrl(configService.get(ConfigKeyEnum.goodsDetailFanliRateHelpUrl.getKey()));
        goodsDetail.getMoneyInfo()
                .setRateInfoHelpUrl(configService.get(ConfigKeyEnum.goodsDetailFanliRateHelpUrl.getKey()));
        // 附加信息
        OtherInfo otherInfo = new OtherInfo();
@@ -691,7 +697,12 @@
            rewardCoupon.setDesc("用返利奖励券最高返");
        }
        rewardCoupon.setParams(params1.toString());
        otherInfo.setRewardCoupon(rewardCoupon);
        if ("ios".equalsIgnoreCase(acceptData.getPlatform())
                && configService.iosOnLining(Integer.parseInt(acceptData.getVersion())))
            otherInfo.setRewardCoupon(null);
        goodsDetail.setOtherInfo(otherInfo);
        CouponInfoVO couponInfo = goodsDetail.getCouponInfo();
@@ -835,7 +846,8 @@
                    "¥" + PinDuoDuoUtil.getGoodsFanLiMoney(pddGoods, hongBaoManageService.getVIPShareRate()));
            goodsDetail.getMoneyInfo().setRateInfo(goodsDetail.getMoneyInfo().getMaxRateInfo());
        }
        goodsDetail.getMoneyInfo().setRateInfoHelpUrl(configService.get(ConfigKeyEnum.goodsDetailFanliRateHelpUrl.getKey()));
        goodsDetail.getMoneyInfo()
                .setRateInfoHelpUrl(configService.get(ConfigKeyEnum.goodsDetailFanliRateHelpUrl.getKey()));
        // 附加信息
        OtherInfo otherInfo = new OtherInfo();
@@ -856,6 +868,9 @@
            rewardCoupon.setDesc("用返利奖励券最高返");
        rewardCoupon.setParams(params1.toString());
        otherInfo.setRewardCoupon(rewardCoupon);
        if ("ios".equalsIgnoreCase(acceptData.getPlatform())
                && configService.iosOnLining(Integer.parseInt(acceptData.getVersion())))
            otherInfo.setRewardCoupon(null);
        goodsDetail.setOtherInfo(otherInfo);
        CouponInfoVO couponInfo = goodsDetail.getCouponInfo();
@@ -883,7 +898,7 @@
        }
        // 图文详情
        extraVO.setDetailUrl("http://apph5.yeshitv.com/apppage/goods_img_pdd.html?id=" + id);
        extraVO.setDetailUrl("http://apph5.banliapp.com/apppage/goods_img_pdd.html?id=" + id);
        String salesTip = pddGoods.getSalesTip();
        if (!StringUtil.isNullOrEmpty(salesTip)) {
fanli/src/main/java/com/yeshi/fanli/controller/client/v2/RecommendControllerV2.java
@@ -615,7 +615,7 @@
            if (!StringUtil.isNullOrEmpty(imei) || !StringUtil.isNullOrEmpty(idfa)) {
                long startTime = java.lang.System.currentTimeMillis();
                TaoBaoSearchResult result = TaoKeApiUtil.guessDeviceLike(page, 50, imei, idfa);
                TaoBaoSearchResult result = TaoKeApiUtil.guessDeviceLike(page, 50, imei, idfa,"");
                if (result != null && result.getTaoBaoGoodsBriefs() != null) {
                    // 筛选
fanli/src/main/java/com/yeshi/fanli/controller/client/v2/RedPackControllerV2.java
@@ -2,8 +2,10 @@
import java.io.IOException;
import java.io.PrintWriter;
import java.io.UnsupportedEncodingException;
import java.lang.reflect.Type;
import java.math.BigDecimal;
import java.net.URLEncoder;
import java.util.ArrayList;
import java.util.Calendar;
import java.util.Date;
@@ -28,13 +30,18 @@
import com.yeshi.fanli.entity.accept.AcceptData;
import com.yeshi.fanli.entity.bus.user.ThreeSale;
import com.yeshi.fanli.entity.bus.user.UserInfo;
import com.yeshi.fanli.entity.common.AdminUser;
import com.yeshi.fanli.entity.common.Config;
import com.yeshi.fanli.entity.redpack.RedPackDetail.RedPackDetailTypeEnum;
import com.yeshi.fanli.entity.redpack.RedPackExchange;
import com.yeshi.fanli.entity.redpack.RedPackWinInvite;
import com.yeshi.fanli.entity.redpack.RedPackWinInvite.RedPackWinInviteTypeEnum;
import com.yeshi.fanli.entity.system.ConfigKeyEnum;
import com.yeshi.fanli.exception.redpack.RedPackExchangeException;
import com.yeshi.fanli.exception.redpack.RedPackGiveRecordException;
import com.yeshi.fanli.service.AdminUserService;
import com.yeshi.fanli.service.inter.common.JumpDetailV2Service;
import com.yeshi.fanli.service.inter.config.ConfigService;
import com.yeshi.fanli.service.inter.homemodule.SwiperPictureService;
import com.yeshi.fanli.service.inter.redpack.RedPackBalanceService;
import com.yeshi.fanli.service.inter.redpack.RedPackConfigService;
@@ -47,10 +54,13 @@
import com.yeshi.fanli.service.inter.user.UserInfoService;
import com.yeshi.fanli.service.inter.user.UserSystemCouponService;
import com.yeshi.fanli.service.inter.user.invite.ThreeSaleSerivce;
import com.yeshi.fanli.util.AESUtil;
import com.yeshi.fanli.util.Constant;
import com.yeshi.fanli.util.StringUtil;
import com.yeshi.fanli.util.ThreadUtil;
import com.yeshi.fanli.util.TimeUtil;
import com.yeshi.fanli.util.UserInviteUtil;
import com.yeshi.fanli.util.email.MailSenderUtil;
import com.yeshi.fanli.vo.redpack.RedPackDetailVO;
import com.yeshi.fanli.vo.redpack.RedPackGiveVO;
import com.yeshi.fanli.vo.redpack.RedPackWinInviteVO;
@@ -97,11 +107,16 @@
    @Resource
    private RedPackForbidService redPackForbidService;
    @Resource
    private ThreeSaleSerivce threeSaleSerivce;
    
    @Resource
    private ConfigService configService;
    
    @Resource
    private AdminUserService adminUserService;
    /**
     * 统计
     * 
@@ -299,23 +314,22 @@
        }
    }
    @RequestMapping(value = "getGiveList", method = RequestMethod.POST)
    public void getGiveList(AcceptData acceptData, Integer page, Long uid, PrintWriter out) {
        if (uid == null || uid <= 0) {
            out.print(JsonUtil.loadFalseResult(1, "用户未登录"));
            return;
        }
        if (page == null || page <= 0)
        if (page == null || page <= 0)
            page = 1;
        try {
            List<RedPackGiveVO> list = redPackGiveRecordService.getGiveList(page, Constant.PAGE_SIZE, uid);
            GsonBuilder gsonBuilder = new GsonBuilder();
            Gson gson = gsonBuilder.excludeFieldsWithoutExposeAnnotation().setDateFormat("yyyy.MM.dd HH:mm").create();
            JSONObject data = new JSONObject();
            data.put("list", gson.toJson(list));
            data.put("count", redPackGiveRecordService.countGiveList(uid));
@@ -326,8 +340,6 @@
        }
    }
    /**
     * 转换红包为真实金钱
     * 
@@ -346,6 +358,35 @@
        try {
            redPackExchangeService.exchangeCash(uid, amount);
            out.print(JsonUtil.loadTrueResult("提现申请成功"));
            ThreadUtil.run(new Runnable() {
                @Override
                public void run() {
                    JSONObject json = new JSONObject();
                    json.put("timeStamp", java.lang.System.currentTimeMillis());
                    json.put("adminId", 4L);
                    String sign = AESUtil.encrypt(json.toString(), Constant.ADMINH5_AESKEY);
                    String url = "";
                    try {
                        url = String.format("%s?from=emailh5&sign=%s",
                                Constant.systemCommonConfig.getExtractNotifyUrl(), URLEncoder.encode(sign, "UTF-8"));
                    } catch (UnsupportedEncodingException e) {
                        e.printStackTrace();
                    }
                    long[] targetUids = new long[] { 3L, 4L };
                    Config config = configService.getConfig(ConfigKeyEnum.extractCodeEmailFrom.getKey());
                    String[] sts = config.getValue().split(",");
                    String account = sts[0];
                    String pwd = sts[1];
                    for (long adminId : targetUids) {
                        AdminUser adminUser = adminUserService.selectByPrimaryKey(adminId);
                        String msg = "有用户采用红包兑换现金";
                        boolean isS = MailSenderUtil.sendEmail(adminUser.getEmail(), account, pwd, "红包兑换现金提醒", msg);
                    }
                }
            });
        } catch (RedPackExchangeException e) {
            out.print(JsonUtil.loadFalseResult(1, e.getMsg()));
        }
@@ -425,12 +466,12 @@
        data.put("redPackLock", redPackForbidService.verifyForbid(uid));
        String inviteCode = userInfoExtraService.getInviteCodeByUid(uid);
        if ( !StringUtil.isNullOrEmpty(inviteCode)) {
        if (!StringUtil.isNullOrEmpty(inviteCode)) {
            data.put("inviteCode", inviteCode);
        } else {
            data.put("inviteCode", "");
        }
        // 赠送免单券
        long freeCouponCount = userSystemCouponService.countGiveFreeCoupon(uid);
        // 奖励券
@@ -446,8 +487,6 @@
        }
    }
    /**
     *  该用户邀请奖金榜
     * 
@@ -456,27 +495,27 @@
     * @param out
     */
    @RequestMapping(value = "getInviteReward")
    public void getInviteReward(AcceptData acceptData,Integer page, Long uid, String callback, PrintWriter out) {
    public void getInviteReward(AcceptData acceptData, Integer page, Long uid, String callback, PrintWriter out) {
        if (uid == null || uid <= 0) {
            JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult(1, "用户未登录"));
            return;
        }
        if (page == null || page < 1)
            page = 1;
        List<RedPackWinProgressVO> listVO = new ArrayList<RedPackWinProgressVO>();
        List<RedPackWinInvite> list = redPackWinInviteService.getWinTopListByBossId(page, Constant.PAGE_SIZE, uid);
        if (list != null) {
            for (RedPackWinInvite win: list) {
            for (RedPackWinInvite win : list) {
                ThreeSale threeSale = threeSaleSerivce.getNearRelationByBossIdAndWorkerId(uid, win.getTeamUid());
                if (threeSale == null)
                    continue;
                UserInfo userInfo = userInfoService.selectByPKey(win.getTeamUid());
                if (userInfo == null)
                    continue;
                RedPackWinProgressVO progressVO = new RedPackWinProgressVO();
                progressVO.setUid(userInfo.getId());
                progressVO.setName(userInfo.getNickName());
@@ -486,7 +525,7 @@
                listVO.add(progressVO);
            }
        }
        JSONObject data = new JSONObject();
        data.put("list", listVO);
        data.put("count", redPackWinInviteService.countWinTopListByBossId(uid));
@@ -496,8 +535,7 @@
            out.print(JsonUtil.loadTrueResult(data));
        }
    }
    /**
     *  该用户邀请进度
     * 
@@ -511,7 +549,7 @@
            JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult(1, "传递参数缺失"));
            return;
        }
        JSONObject data = new JSONObject();
        data.put("list", redPackWinInviteService.getInviteProgressByWorkerId(uid, tid));
        data.put("num", redPackWinInviteService.countTeamNumByTid(uid, tid));
fanli/src/main/java/com/yeshi/fanli/controller/client/v2/SearchControllerV2.java
@@ -39,10 +39,12 @@
import com.yeshi.fanli.entity.taobao.TaoBaoGoodsBrief;
import com.yeshi.fanli.entity.taobao.TaoBaoSearchResult;
import com.yeshi.fanli.entity.taobao.dataoke.DaTaoKeDetailV2;
import com.yeshi.fanli.exception.taobao.TaoBaoTokenParseException;
import com.yeshi.fanli.exception.taobao.TaobaoGoodsDownException;
import com.yeshi.fanli.exception.user.TokenRecordException;
import com.yeshi.fanli.log.LogHelper;
import com.yeshi.fanli.service.inter.brand.BrandInfoService;
import com.yeshi.fanli.service.inter.common.JumpDetailV2Service;
import com.yeshi.fanli.service.inter.config.BusinessSystemService;
import com.yeshi.fanli.service.inter.config.ConfigService;
import com.yeshi.fanli.service.inter.config.SuperHotSearchService;
@@ -55,6 +57,8 @@
import com.yeshi.fanli.service.inter.user.HistorySearchService;
import com.yeshi.fanli.service.inter.user.TokenRecordService;
import com.yeshi.fanli.service.inter.user.integral.IntegralGetService;
import com.yeshi.fanli.service.manger.ClipboardAnalysisManager;
import com.yeshi.fanli.service.manger.IClipboardAnalysisResult;
import com.yeshi.fanli.service.manger.goods.jd.JDGoodsLinkParseManager;
import com.yeshi.fanli.tag.PageEntity;
import com.yeshi.fanli.util.Constant;
@@ -77,8 +81,10 @@
import com.yeshi.fanli.util.taobao.TaoKeApiUtil;
import com.yeshi.fanli.vo.brand.BrandInfoVO;
import com.yeshi.fanli.vo.brand.TaoBaoShopVO;
import com.yeshi.fanli.vo.common.JumpDetailContentVO;
import com.yeshi.fanli.vo.goods.GoodsDetailVO;
import com.yeshi.fanli.vo.msg.TokenVO;
import com.yeshi.fanli.vo.search.GoodsDocParseResultVO;
import net.sf.json.JSONArray;
import net.sf.json.JSONObject;
@@ -138,6 +144,12 @@
    @Resource
    private JDGoodsLinkParseManager jdGoodsLinkParseManager;
    @Resource
    private ClipboardAnalysisManager clipboardAnalysisManager;
    @Resource
    private JumpDetailV2Service jumpDetailV2Service;
    /**
     * 粘贴板信息推荐
     * 
@@ -156,381 +168,199 @@
        text = text.trim();
        String originalText = text;
        try {
            TokenVO tokenVO = tokenRecordService.discernToken(text, uid, acceptData);
            out.print(JsonUtil.loadTrueResult(tokenVO));
            return;
        } catch (TokenRecordException e) {
            if (e.getCode() == 1001) { // 需要用户登录
                out.print(JsonUtil.loadFalseResult(e.getCode(), e.getMsg()));
                return;
            }
        }
        JSONObject data = new JSONObject();
        TaoBaoGoodsBrief tb = null;
        String URL_REGEX = "(((http|https)://)|(www\\.))[a-zA-Z0-9\\._-]+\\.[a-zA-Z]{2,6}(:[0-9]{1,4})?(/[a-zA-Z0-9\\&%_\\./-~-]*)?";
        clipboardAnalysisManager.parse(acceptData.getPlatform(), acceptData.getVersion(), originalText, uid,
                new IClipboardAnalysisResult() {
        Pattern p = Pattern.compile(URL_REGEX);
        Matcher matcher = p.matcher(text);
        if (!matcher.find()) {// 不包含链接
            if (text.length() > 256) {
                out.print(JsonUtil.loadFalseResult("值过长"));
                return;
            }
            String pattern = "^[A-Za-z0-9-]+$";
            if (Pattern.matches(pattern, text.replace(" ", ""))) {// 删除空格
                out.println(JsonUtil.loadFalseResult("不支持推荐"));
                return;
            }
                    @Override
                    public void onResult(GoodsDocParseResultVO result) {
                        if (uid == null) {
                            out.print(JsonUtil.loadFalseResult("无推荐"));
                            return;
                        }
            LogHelper.test("根据粘贴板推荐:" + text);
                        JSONObject root = new JSONObject();
                        root.put("type", 20);
                        JSONObject data = new JSONObject();
                        data.put("text", originalText);
                        //
                        int platformCode = Constant.getPlatformCode(acceptData.getPlatform());
                        int version = Integer.parseInt(acceptData.getVersion());
                        JumpDetailContentVO convert = new JumpDetailContentVO();
                        convert.setJumpDetail(jumpDetailV2Service.getByTypeCache("web", platformCode, version));
                        JSONObject convertParams = new JSONObject();
                        convertParams.put("url", configService.get(ConfigKeyEnum.convertDocWebLink.getKey()));
                        convertParams.put("clipboard", false);
                        convert.setParams(convertParams);
            if (text.length() > 80) {
                out.print(JsonUtil.loadFalseResult("值过长"));
                return;
            }
                        JumpDetailContentVO view = null;
                        JumpDetailContentVO guessLike = null;
            if (analysisTaoToken(acceptData, text, out)) {
                return;
            }
            if (!StringUtil.isNullOrEmpty(TaoBaoUtil.parseSystemTaoToken(text))) {
                out.print(JsonUtil.loadFalseResult("不支持推荐"));
                return;
            }
            JSONObject root = new JSONObject();
            root.put("type", 2);
            JSONObject data = new JSONObject();
            data.put("title", text);
            root.put("data", data);
            out.print(JsonUtil.loadTrueResult(root));
            return;
        }
                        Gson gson = JsonUtil.getApiCommonGson();
                        data.put("title", "智能搜索");
        int type = 3;
        CommonGoods commonGoods = null;
        text = matcher.group();
                        int state = 0;
                        if (result.getFirstGoods() != null && result.getFirstGoods().getGoodsId() != null) {
                            state = 2;
                            data.put("stateDesc", "选择搜券或转链");
                            JSONObject params = new JSONObject();
                            params.put("id", result.getFirstGoods().getGoodsId()+"");
                            params.put("from", "转链");
                            if (result.getFirstGoods().getGoodsType() == Constant.SOURCE_TYPE_TAOBAO) {
                                view = new JumpDetailContentVO();
                                view.setJumpDetail(
                                        jumpDetailV2Service.getByTypeCache("goodsdetail", platformCode, version));
                                view.setParams(params);
                            } else if (result.getFirstGoods().getGoodsType() == Constant.SOURCE_TYPE_JD) {
                                view = new JumpDetailContentVO();
                                view.setJumpDetail(
                                        jumpDetailV2Service.getByTypeCache("goodsdetail_jd", platformCode, version));
                                view.setParams(params);
                            } else if (result.getFirstGoods().getGoodsType() == Constant.SOURCE_TYPE_PDD) {
                                view = new JumpDetailContentVO();
                                view.setJumpDetail(
                                        jumpDetailV2Service.getByTypeCache("goodsdetail_pdd", platformCode, version));
                                view.setParams(params);
                            }
        if (text.startsWith("https://a.m.taobao.com/i"))// 淘宝账号未登录状态
        {
            text = text.substring("https://a.m.taobao.com/i".length(), text.indexOf(".htm"));
            if (NumberUtil.isNumeric(text)) {
                tb = TaoBaoUtil.isAlimama(text);
            }
        } else if (text.contains("ju.taobao.com") || text.contains(".juhuasuan.com")) {// 聚划算
            int index = text.indexOf("item_id");
            if (index < 0) {
                out.println(JsonUtil.loadFalseResult("暂未找到该商品,请稍后再试!"));
                return;
            }
            text = text.substring(index);
            int last = text.indexOf("&");
            String id = "";
            if (last > 0)
                id = text.substring(text.indexOf("=") + 1, text.indexOf("&"));
            else {
                id = text.substring(text.indexOf("=" + 1));
            }
            tb = TaoBaoUtil.isAlimama(id);
            if (tb == null) {
                type = 4;
                tb = getTaoBaoGoodsBriefFromGoodsId(id, originalText);
            }
        } else if (text.contains("http://zmnxbc.com")) { // 手机端天猫APP分享
            tb = TaoBaoUtil.parsePhoneShareUrlByTM(text);
        } else if (text.contains("h5.m.taobao") || text.contains("detail.m.tmall") || text.contains("item.taobao")
                || text.contains("detail.tmall")) { // 手机页面和电脑页面
            Map<String, String> map = Utils.parseURL(text);
            String id = "";
            id = map.get("id").replace("}", "");
            tb = TaoBaoUtil.isAlimama(id);
            if (tb == null) {
                type = 4;
                tb = getTaoBaoGoodsBriefFromGoodsId(id, originalText);
            }
        } else if (text.contains("v.douyin.com")) { // 抖音
            analysisDouYin(acceptData, text, out);
            return;
        } else {
            tb = TaoBaoUtil.parsePhoneShareUrlByTB(text);
            if (tb == null) {
                String goodsId = TaoBaoUtil.getGoodsIdByPhoneShareUrl(text);
                if (!StringUtil.isNullOrEmpty(goodsId)) {
                    tb = getTaoBaoGoodsBriefFromGoodsId(goodsId, originalText);
                    if (tb != null)
                        type = 4;
                }
            }
            if (tb == null)// 淘宝是空值
            {
                String jdId = JDUtil.getJDGoodsId(text);
                // 微信链接
                if (StringUtil.isNullOrEmpty(jdId)) {
                    jdId = JDUtil.getJDGoodsIdByWeiXin(text);
                }
                // 领券短连接
                if (StringUtil.isNullOrEmpty(jdId) && text.contains("u.jd.com")) {
                    jdId = jdGoodsLinkParseManager.parseGoodsIdByJDShortUrl(text);
                }
                if (!StringUtil.isNullOrEmpty(jdId)) {
                    JDGoods goods = JDApiUtil.getGoodsDetail(Long.parseLong(jdId));
                    if (goods != null) {
                        // 高级接口 -- 信息更完整
                        JDGoods jdGoods = JDApiUtil.queryGoodsDetail(Long.parseLong(jdId));
                        if (jdGoods != null) {
                            commonGoods = CommonGoodsFactory.create(jdGoods);
                        } else if (!StringUtil.isNullOrEmpty(result.getFirstLink())) {
                            state = 2;
                            data.put("stateDesc", "选择搜券或转链");
                            view = new JumpDetailContentVO();
                            view.setJumpDetail(jumpDetailV2Service.getByTypeCache("web", platformCode, version));
                            JSONObject params = new JSONObject();
                            params.put("url", result.getFirstLink());
                            view.setParams(params);
                        } else {
                            commonGoods = CommonGoodsFactory.create(goods);
                            data.put("stateDesc", "去试试转链");
                            state = 1;
                        }
                    } else {
                        type = 4;
                        goods = JDUtil.getSimpleGoodsInfo(jdId);
                        if (goods != null) {
                            commonGoods = new CommonGoods();
                            commonGoods.setTitle(goods.getSkuName());
                            commonGoods.setPicture(goods.getPicUrl());
                        }
                        data.put("state", state);
                        if (convert != null)
                            data.put("convert", gson.toJson(convert));
                        if (view != null)
                            data.put("view", gson.toJson(view));
                        if (guessLike != null)
                            data.put("guessLike", gson.toJson(guessLike));
                        root.put("data", data);
                        out.print(JsonUtil.loadTrueResult(root));
                        return;
                    }
                } else {
                    String pddId = PinDuoDuoUtil.getPDDGoodsId(text);
                    if (!StringUtil.isNullOrEmpty(pddId)) {
                        PDDGoodsDetail goods = PinDuoDuoApiUtil.getGoodsDetail(Long.parseLong(pddId));
                        if (goods != null) {
                            commonGoods = CommonGoodsFactory.create(goods);
                        } else {
                            type = 4;
                            goods = PinDuoDuoUtil.getPDDGoodsInfo(pddId);
                            if (goods != null) {
                                commonGoods = new CommonGoods();
                                commonGoods.setTitle(goods.getGoodsName());
                                commonGoods.setPicture(goods.getGoodsThumbnailUrl());
                    @Override
                    public void onResult(String result) {
                        JSONObject root = new JSONObject();
                        root.put("type", 2);
                        JSONObject data = new JSONObject();
                        data.put("title", result);
                        root.put("data", data);
                        out.print(JsonUtil.loadTrueResult(root));
                        return;
                    }
                    @Override
                    public void onResult(CommonGoods goods) {
                        if (goods.getGoodsId() != null) {
                            if (VersionUtil.greaterThan_1_6_5(acceptData.getPlatform(), acceptData.getVersion())) {// 1.6.5版本后返回商品详情
                                if (goods.getGoodsType() == Constant.SOURCE_TYPE_TAOBAO) {
                                    TaoBaoGoodsBrief goodsBrief = null;
                                    try {
                                        goodsBrief = TaoKeApiUtil.searchGoodsDetail(goods.getGoodsId());
                                    } catch (TaobaoGoodsDownException e) {
                                        e.printStackTrace();
                                    }
                                    if (goodsBrief != null) {
                                        goods = CommonGoodsFactory.create(goodsBrief);
                                        Gson gson = JsonUtil
                                                .getConvertBigDecimalToStringSubZeroBuilder(new GsonBuilder())
                                                .excludeFieldsWithoutExposeAnnotation().setDateFormat("yyyy-MM-dd")
                                                .create();
                                        data.put("type", 3);
                                        data.put("goods",
                                                gson.toJson(
                                                        GoodsDetailVOFactory.convertCommonGoods(goods,
                                                                hongBaoManageService.getShowComputeRate(
                                                                        acceptData.getPlatform(),
                                                                        acceptData.getVersion()))));
                                        out.print(JsonUtil.loadTrueResult(data));
                                        return;
                                    }
                                } else {
                                    Gson gson = JsonUtil.getConvertBigDecimalToStringSubZeroBuilder(new GsonBuilder())
                                            .excludeFieldsWithoutExposeAnnotation().setDateFormat("yyyy-MM-dd")
                                            .create();
                                    data.put("type", 3);
                                    data.put("goods",
                                            gson.toJson(
                                                    GoodsDetailVOFactory.convertCommonGoods(goods,
                                                            hongBaoManageService.getShowComputeRate(
                                                                    acceptData.getPlatform(),
                                                                    acceptData.getVersion()))));
                                    out.print(JsonUtil.loadTrueResult(data));
                                    return;
                                }
                            } else {
                                // 低于1.6.5版本
                                JSONObject taoBaoGoodsJSON = new JSONObject();
                                taoBaoGoodsJSON.put("title", goods.getTitle());
                                taoBaoGoodsJSON.put("zkPrice", goods.getPrice() + "");
                                taoBaoGoodsJSON.put("id", goods.getGoodsId());
                                taoBaoGoodsJSON.put("goodsType", goods.getGoodsType());
                                if (goods.getGoodsType() == Constant.SOURCE_TYPE_TAOBAO) {
                                    taoBaoGoodsJSON.put("url",
                                            "http://item.taobao.com/item.htm?id=" + goods.getGoodsId());
                                } else if (goods.getGoodsType() == Constant.SOURCE_TYPE_JD) {
                                    taoBaoGoodsJSON.put("url",
                                            String.format("https://item.jd.com/%s.html", goods.getGoodsId() + ""));
                                } else if (goods.getGoodsType() == Constant.SOURCE_TYPE_PDD) {
                                    taoBaoGoodsJSON.put("url",
                                            "http://yangkeduo.com/goods.html?goods_id=" + goods.getGoodsId());
                                }
                                data.put("goods", taoBaoGoodsJSON);
                                List<String> picList = new ArrayList<>();
                                picList.add(goods.getPicture());
                                data.put("imgs", picList);
                                JSONObject root = new JSONObject();
                                root.put("type", 1);
                                root.put("data", data);
                                out.print(JsonUtil.loadTrueResult(root));
                                return;
                            }
                        }
                    }
                }
            }
        }
        if (tb == null && commonGoods == null) {
            out.println(JsonUtil.loadFalseResult("暂未找到该商品,请稍后再试!"));
            return;
        }
                        JSONObject goodsJSON = new JSONObject();
                        goodsJSON.put("title", goods.getTitle());
                        goodsJSON.put("pictUrl", goods.getPicture());
        if (type == 4) {
            if (!VersionUtil.greaterThan_2_0_1(acceptData.getPlatform(), acceptData.getVersion())) {
                out.println(JsonUtil.loadFalseResult("暂未找到该商品,请稍后再试!"));
                return;
            }
            JSONObject data = new JSONObject();
            if (tb != null) {
                commonGoods = new CommonGoods();
                commonGoods.setTitle(tb.getTitle());
                commonGoods.setPicture(tb.getPictUrl());
            }
            if (StringUtil.isNullOrEmpty(commonGoods.getTitle())
                    || StringUtil.isNullOrEmpty(commonGoods.getPicture())) {
                out.println(JsonUtil.loadFalseResult("暂未找到该商品,请稍后再试!"));
                return;
            }
            JSONObject goodsJSON = new JSONObject();
            goodsJSON.put("title", commonGoods.getTitle());
            goodsJSON.put("pictUrl", commonGoods.getPicture());
            data.put("type", type);
            data.put("desc", "该商品无推广信息");
            data.put("goods", goodsJSON);
            out.print(JsonUtil.loadTrueResult(data));
            return;
        }
        JSONObject data = new JSONObject();
        if (VersionUtil.greaterThan_1_6_5(acceptData.getPlatform(), acceptData.getVersion())) {
            if (tb != null) {
                TaoBaoGoodsBrief goodsBrief = null;
                try {
                    goodsBrief = TaoKeApiUtil.searchGoodsDetail(tb.getAuctionId());
                } catch (TaobaoGoodsDownException e) {
                    e.printStackTrace();
                }
                if (goodsBrief == null) {
                    out.println(JsonUtil.loadFalseResult("暂未找到该商品,请稍后再试!"));
                    return;
                }
                commonGoods = CommonGoodsFactory.create(goodsBrief);
            }
            Gson gson = JsonUtil.getConvertBigDecimalToStringSubZeroBuilder(new GsonBuilder())
                    .excludeFieldsWithoutExposeAnnotation().setDateFormat("yyyy-MM-dd").create();
            data.put("type", type);
            data.put("goods", gson.toJson(GoodsDetailVOFactory.convertCommonGoods(commonGoods,
                    hongBaoManageService.getShowComputeRate(acceptData.getPlatform(), acceptData.getVersion()))));
            out.print(JsonUtil.loadTrueResult(data));
            return;
        }
        if (tb != null) {
            commonGoods = new CommonGoods();
            commonGoods.setPrice(tb.getZkPrice());
            commonGoods.setTitle(tb.getTitle());
            commonGoods.setGoodsId(tb.getAuctionId());
            commonGoods.setGoodsType(Constant.SOURCE_TYPE_TAOBAO);
            commonGoods.setPicture(tb.getPictUrl());
        }
        JSONObject taoBaoGoodsJSON = new JSONObject();
        taoBaoGoodsJSON.put("title", commonGoods.getTitle());
        taoBaoGoodsJSON.put("zkPrice", commonGoods.getPrice() + "");
        taoBaoGoodsJSON.put("id", commonGoods.getGoodsId());
        taoBaoGoodsJSON.put("goodsType", commonGoods.getGoodsType());
        if (commonGoods.getGoodsType() == Constant.SOURCE_TYPE_TAOBAO) {
            taoBaoGoodsJSON.put("url", "http://item.taobao.com/item.htm?id=" + commonGoods.getGoodsId());
        } else if (commonGoods.getGoodsType() == Constant.SOURCE_TYPE_JD) {
            taoBaoGoodsJSON.put("url", String.format("https://item.jd.com/%s.html", commonGoods.getGoodsId() + ""));
        } else if (commonGoods.getGoodsType() == Constant.SOURCE_TYPE_PDD) {
            taoBaoGoodsJSON.put("url", "http://yangkeduo.com/goods.html?goods_id=" + commonGoods.getGoodsId());
        }
        data.put("goods", taoBaoGoodsJSON);
        List<String> picList = new ArrayList<>();
        picList.add(commonGoods.getPicture());
        data.put("imgs", picList);
        JSONObject root = new JSONObject();
        root.put("type", 1);
        root.put("data", data);
        out.print(JsonUtil.loadTrueResult(root));
    }
    private TaoBaoGoodsBrief getTaoBaoGoodsBriefFromGoodsId(String goodsId, String text) {
        TaoBaoGoodsBrief tb = TaoBaoUtil.getTmallGoodsInfo(goodsId);
        if (tb == null && NumberUtil.isNumeric(goodsId)) {// 是数字
            // tb = TaoBaoUtil.getSimpleGoodsBrief(Long.parseLong(goodsId));
            // if (tb != null) {
            // tb.setPictUrl(TbImgUtil.getTBSize220Img(tb.getPictUrl()));
            // }
            if (tb == null) {
                tb = new TaoBaoGoodsBrief();
                if (text.trim().indexOf("【") == 0 && text.trim().indexOf("】") > 0) {
                    // 截取标题
                    String title = text.trim().substring(1, text.trim().lastIndexOf("】"));
                    tb.setAuctionId(Long.parseLong(goodsId));
                    tb.setTitle(title);
                    tb.setPictUrl("http://");
                }
            }
        }
        return tb;
    }
    /**
     * 解析抖音链接
     *
     * @param acceptData
     * @param text
     * @param out
     * @return
     */
    private void analysisDouYin(AcceptData acceptData, String text, PrintWriter out) {
        String location = HttpUtil.getLocation(text);
        if (!StringUtil.isNullOrEmpty(location)) {
            if (location.contains("taobao.com")) { // 淘宝商品
                String realUrl = TaoBaoUtil.getRealUrl(location);
                if (!StringUtil.isNullOrEmpty(realUrl)) {
                    getRecommendInfo(acceptData, realUrl, null, out);
                    return;
                }
            } else if (location.contains("haohuo.jinritemai.com")) { // 抖音商品
                DouYinGoods goods = DouYinUtil.getGoodsInfo(location);
                JSONObject goodsJSON = new JSONObject();
                goodsJSON.put("title", goods.getName());
                goodsJSON.put("pictUrl", goods.getImg());
                JSONObject data = new JSONObject();
                data.put("type", 4);
                data.put("desc", "该商品无推广信息");
                data.put("goods", goodsJSON);
                out.print(JsonUtil.loadTrueResult(data));
                return;
            }
        }
        out.println(JsonUtil.loadFalseResult("暂未找到该商品,请稍后再试!"));
        return;
    }
    /**
     * 解析淘口令
     *
     * @param acceptData
     * @param text
     * @param out
     * @return
     */
    private boolean analysisTaoToken(AcceptData acceptData, String text, PrintWriter out) {
        String token = StringUtil.picUpTaoToken(text);
        if (!StringUtil.isNullOrEmpty(token)) {
            Long auctionId = TaoKeApiUtil.tokenConvertAuctionId(token);
            if (auctionId != null) {
                TaoBaoGoodsBrief tb = null;
                try {
                    tb = TaoKeApiUtil.getSimpleGoodsInfo(auctionId);
                } catch (TaobaoGoodsDownException e) {
                    e.printStackTrace();
                }
                if (tb != null) {
                    if (VersionUtil.greaterThan_1_6_5(acceptData.getPlatform(), acceptData.getVersion())) {
                        TaoBaoGoodsBrief goodsBrief = null;
                        try {
                            goodsBrief = TaoKeApiUtil.searchGoodsDetail(tb.getAuctionId());
                        } catch (TaobaoGoodsDownException e) {
                            e.printStackTrace();
                        }
                        if (goodsBrief == null) {
                            out.println(JsonUtil.loadFalseResult("暂未找到该商品,请稍后再试!"));
                            return false;
                        }
                        Gson gson = JsonUtil.getConvertBigDecimalToStringSubZeroBuilder(new GsonBuilder())
                                .excludeFieldsWithoutExposeAnnotation().setDateFormat("yyyy-MM-dd").create();
                        JSONObject data = new JSONObject();
                        data.put("type", 3);
                        data.put("goods",
                                gson.toJson(GoodsDetailVOFactory.convertTaoBao(goodsBrief, hongBaoManageService
                                        .getShowComputeRate(acceptData.getPlatform(), acceptData.getVersion()))));
                        data.put("type", 4);
                        data.put("desc", "该商品无推广信息");
                        data.put("goods", goodsJSON);
                        out.print(JsonUtil.loadTrueResult(data));
                        return true;
                        return;
                    }
                    JSONObject data = new JSONObject();
                    JSONObject taoBaoGoodsJSON = new JSONObject();
                    taoBaoGoodsJSON.put("title", tb.getTitle());
                    taoBaoGoodsJSON.put("zkPrice", tb.getZkPrice());
                    taoBaoGoodsJSON.put("id", tb.getAuctionId());
                    taoBaoGoodsJSON.put("goodsType", Constant.SOURCE_TYPE_TAOBAO);
                    taoBaoGoodsJSON.put("url", "http://item.taobao.com/item.htm?id=" + tb.getAuctionId());
                    data.put("goods", taoBaoGoodsJSON);
                    if (!StringUtil.isNullOrEmpty(tb.getPictUrl())) {
                        if (tb.getImgList() == null)
                            tb.setImgList(new ArrayList<>());
                        tb.getImgList().add(0, TbImgUtil.getTBSize220Img(tb.getPictUrl()));
                    @Override
                    public void onResult(TokenVO tokenVO) {
                        out.print(JsonUtil.loadTrueResult(tokenVO));
                        return;
                    }
                    data.put("imgs", tb.getImgList());
                    JSONObject root = new JSONObject();
                    root.put("type", 1);
                    root.put("data", data);
                    out.print(JsonUtil.loadTrueResult(root));
                    return true;
                }
            }
        }
        return false;
                    @Override
                    public void none() {
                        out.print(JsonUtil.loadFalseResult("无推荐"));
                    }
                    @Override
                    public void needLogin(String msg) {
                        out.print(JsonUtil.loadFalseResult(1001, msg));
                    }
                });
    }
    /**
fanli/src/main/java/com/yeshi/fanli/controller/client/v2/ShareControllerV2.java
@@ -73,7 +73,6 @@
import com.yeshi.fanli.util.cache.JDGoodsCacheUtil;
import com.yeshi.fanli.util.cache.PinDuoDuoCacheUtil;
import com.yeshi.fanli.util.cache.TaoBaoGoodsCacheUtil;
import com.yeshi.fanli.util.factory.MonitorFactory;
import com.yeshi.fanli.util.factory.goods.GoodsDetailVOFactory;
import com.yeshi.fanli.util.jd.JDApiUtil;
import com.yeshi.fanli.util.jd.JDUtil;
@@ -83,6 +82,7 @@
import com.yeshi.fanli.util.taobao.TaoKeApiUtil;
import com.yeshi.fanli.util.taobao.TaoLiJinUtil;
import com.yeshi.fanli.vo.goods.GoodsDetailVO;
import com.yeshi.fanli.vo.goods.ShareGoodsCommentChoiceInfo;
import com.yeshi.fanli.vo.goods.ShareInfoVO;
import net.sf.json.JSONArray;
@@ -157,6 +157,28 @@
    @Resource
    private UserTaoLiJinRecordService userTaoLiJinRecordService;
    private List<ShareGoodsCommentChoiceInfo> getCommentChoiceList(String token, String link, String inviteCode,
            BigDecimal fanliMoney) {
        List<ShareGoodsCommentChoiceInfo> list = new ArrayList<>();
        if (!StringUtil.isNullOrEmpty(token))
            list.add(new ShareGoodsCommentChoiceInfo(ShareGoodsCommentChoiceInfo.TYPE_TOKEN, "淘口令", token, true, false));
        if (!StringUtil.isNullOrEmpty(link)) {
            list.add(new ShareGoodsCommentChoiceInfo(ShareGoodsCommentChoiceInfo.TYPE_LINK, "链接",link, true, false));
        }
        if (!StringUtil.isNullOrEmpty(inviteCode)) {
            list.add(new ShareGoodsCommentChoiceInfo(ShareGoodsCommentChoiceInfo.TYPE_INVITE_CODE, "邀请码", inviteCode, false,
                    true));
        }
        list.add(new ShareGoodsCommentChoiceInfo(ShareGoodsCommentChoiceInfo.TYPE_DOWNLOAD_LINK, "下载链接", "http://www.baidu.com", false,
                true));
        list.add(
                new ShareGoodsCommentChoiceInfo(ShareGoodsCommentChoiceInfo.TYPE_FANLI_MONEY, "返利金额", "¥ "+fanliMoney, false, true));
        return list;
    }
    /**
     * 
@@ -261,169 +283,13 @@
        }
        // 淘礼金创建分享
        if (source != null && "taolijin".equals(source)) {
        if (source != null && "taolijin".equals(source)) {// 淘礼金分享创建
            createTaoLijin(uid, goodsId, totalNum, relationId, request, out);
            return;
        }
        try {
            ShareInfoVO shareInfo = new ShareInfoVO();
            // 测试
            TaoBaoLink taoBaoLink = shareGoodsService.getTaoBaoLinkForShare(uid, goodsId, relationId);
            if (taoBaoLink != null && taoBaoLink.getGoods() != null && needGoods) {
                ConfigParamsDTO dto = hongBaoManageService.getShowComputeRate(acceptData.getPlatform(),
                        acceptData.getVersion());
                GoodsDetailVO goodsInfo = GoodsDetailVOFactory.convertTaoBao(taoBaoLink.getGoods(), dto);
                shareInfo.setGoodsInfo(goodsInfo);
            }
            String url = String.format("http://%s%s?uid=%s&id=%s&appType=flq", configService.getH5Host(),
                    Constant.systemCommonConfig.getShareGoodsPagePath(), AESUtil.encrypt(uid + "", Constant.UIDAESKEY),
                    goodsId + "");
            String shortLink = HttpUtil.getShortLink(url);
            if (!StringUtil.isNullOrEmpty(shortLink)) {
                url = shortLink;
            }
            shareInfo.setClickUrl(url);
            shareInfo.setToken(TaoBaoUtil.filterTaoToken(taoBaoLink.getTaoToken()));
            shareInfo.setRule(configService.get(ConfigKeyEnum.shareSingleGoodsRule.getKey()));
            shareInfo.setPictUrl(TbImgUtil.getTBSizeImg(taoBaoLink.getGoods().getPictUrl(), 500));
            String commentTextStr = configService.get(ConfigKeyEnum.shareSingleGoodsCommentText.getKey());
            List<String> commentTexts = new ArrayList<>();
            if (!StringUtil.isNullOrEmpty(commentTextStr)) {
                JSONArray array = JSONArray.fromObject(commentTextStr);
                for (int i = 0; i < array.size(); i++) {
                    if (StringUtil.isNullOrEmpty(inviteCode)) {
                        if (array.optString(i).contains("[邀请码]")) {
                            continue;
                        }
                    }
                    if (StringUtil.isNullOrEmpty(inviteCode))
                        commentTexts.add(array.optString(i).replace("[下载链接]", Constant.YINGYONGBAO_LINK)
                                .replace("[淘口令]", shareInfo.getToken()));
                    else
                        commentTexts.add(array.optString(i).replace("[下载链接]", Constant.YINGYONGBAO_LINK)
                                .replace("[邀请码]", inviteCode).replace("[淘口令]", shareInfo.getToken()));
                }
            }
            shareInfo.setCommentTexts(commentTexts);
            String shareText = "";
            // 无券
            String shopType = taoBaoLink.getGoods().getUserType() == 0 ? TaoBaoConstant.SHARE_PRICE_TAOBAO
                    : TaoBaoConstant.SHARE_PRICE_TM;
            if (StringUtil.isNullOrEmpty(taoBaoLink.getGoods().getCouponInfo())) {
                String text = shareGoodsTextTemplateService.getCommonTemplate(uid);
                if (StringUtil.isNullOrEmpty(text))
                    text = configService.get(ConfigKeyEnum.goodsShareTextNoCoupon.getKey());
                shareText = text.replace("{标题}", taoBaoLink.getGoods().getTitle()).replace("{商品原价}",
                        MoneyBigDecimalUtil.getWithNoZera(taoBaoLink.getGoods().getZkPrice()) + "");
            } else// 有券
            {
                String text = shareGoodsTextTemplateService.geteCouponTemplate(uid);
                if (StringUtil.isNullOrEmpty(text))
                    text = configService.get(ConfigKeyEnum.goodsShareTextCoupon.getKey());
                shareText = text.replace("{标题}", taoBaoLink.getGoods().getTitle())
                        .replace("{商品原价}", MoneyBigDecimalUtil.getWithNoZera(taoBaoLink.getGoods().getZkPrice()) + "")
                        .replace("{优惠券面额}",
                                MoneyBigDecimalUtil.getWithNoZera(taoBaoLink.getGoods().getCouponAmount()).toString())
                        .replace("{优惠券价}", TaoBaoUtil.getAfterUseCouplePrice(taoBaoLink.getGoods()) + "");
            }
            shareText = shareText.replace("{店铺类型}", shopType)
                    .replace("{月销量}", TaoBaoUtil.getSaleCount(taoBaoLink.getGoods().getBiz30day()))
                    .replace("{领券短链}", shortLink).replace("{淘口令}", TaoBaoUtil.filterTaoToken(taoBaoLink.getTaoToken()));
            shareInfo.setShareText(shareText);
            String descText = shareText.replace(taoBaoLink.getGoods().getTitle(), "").trim();
            if (descText.startsWith("\\r\\n")) {
                descText = descText.substring(0);
            }
            shareInfo.setDescText(descText);
            // 测试
            // 2.0.2之前
            if (!VersionUtil.greaterThan_2_0_2(acceptData.getPlatform(), acceptData.getVersion()))
                shareInfo.setClickUrl(getERCodeContent(configService.get(ConfigKeyEnum.taobaoShareQrcodeText.getKey()),
                        taoBaoLink.getGoods(), shareInfo.getToken()));
            shareInfo.setWxErCode(getERCodeContent(configService.get(ConfigKeyEnum.taobaoShareQrcodeText.getKey()), taoBaoLink.getGoods(),
                    shareInfo.getToken()));
            // 提示图文内容
            String imgs = configService.get(ConfigKeyEnum.goodsShareNotifyImgs.getKey());
            JSONArray array = JSONArray.fromObject(imgs);
            int p = (int) (array.size() * Math.random());
            if (p < array.size()) {
                shareInfo.setNotifyPicture(array.optString(p));
            }
            shareInfo.setNotifyDesc(configService.get(ConfigKeyEnum.goodsShareNotify.getKey()));
            // 分享金额
            BigDecimal rate = hongBaoManageService.getShareRate();
            BigDecimal shareMoney = TaoBaoUtil.getShareGoodsHongBaoInfo(taoBaoLink.getGoods(), rate);
            shareInfo.setShareMoney("¥" + shareMoney.toString());
            // 分享id
            try {
                ShareGoodsRecordDTO shareRecord = userShareGoodsRecordService.addRecordGoodsDetail(uid, goodsId,
                        Constant.SOURCE_TYPE_TAOBAO, false);
                shareInfo.setShareId(shareRecord.getRedisKey());
            } catch (Exception e) {
                try {
                    LogHelper.errorDetailInfo(e);
                } catch (Exception e1) {
                    e1.printStackTrace();
                }
            }
            out.print(JsonUtil.loadTrueResult(
                    JsonUtil.getConvertBigDecimalToStringSubZeroBuilder(new GsonBuilder()).create().toJson(shareInfo)));
            final TaoBaoLink taobaoLink = taoBaoLink;
            // 异步操作
            com.yeshi.fanli.util.ThreadUtil.run(new Runnable() {
                @Override
                public void run() {
                    // 异步操作 添加分享记录
                    UserShareGoodsHistory history = new UserShareGoodsHistory();
                    history.setUser(new UserInfo(uid));
                    history.setHongbao(shareMoney);
                    history.setCreateTime(new Date());
                    history.setGoodsType(UserShareGoodsHistory.TYPE_TAOBAO);
                    history.setTkCode(TaoBaoUtil.filterTaoToken(taobaoLink.getTaoToken()));
                    history.setLink(taobaoLink.getClickUrl());
                    history.setQuanLink(taobaoLink.getCouponLink());
                    history.setGoodsId(taobaoLink.getGoods().getAuctionId());
                    history.setPostPicture(taobaoLink.getGoods().getPictUrl());
                    history.setShareImg(taobaoLink.getClickUrl());
                    List<String> imgList = taobaoLink.getGoods().getImgList();
                    if (imgList == null) {
                        imgList = new ArrayList<>();
                    }
                    history.setPictures(JsonUtil.getGson().toJson(imgList));
                    shareGoodsService.addShareGoodsHistory(history);
                }
            });
        } else {// 普通分享创建
            createCommonTaoBaoShare(acceptData.getPlatform(), acceptData.getVersion(), goodsId, inviteCode, uid,
                    needGoods, relationId, out);
            return;
        } catch (ShareGoodsException e) {
            LogHelper.errorDetailInfo(e, "分享出错:uid:" + uid + " goodsId:" + goodsId, "");
            // 分享出错报警
            try {
                monitorService.addClientAPIMonitor(MonitorFactory.createClientAPI(request, e.getCode(), 0, "分享出错"));
            } catch (Exception e1) {
            }
            out.print(JsonUtil.loadFalseResult(e.getCode(), e.getMessage()));
            businessEmergent110Service.shareTaoBaoGoodsError(StringUtil.Md5(goodsId + ""));
        }
    }
@@ -603,6 +469,166 @@
        }
    }
    public void createCommonTaoBaoShare(String platform, String version, Long goodsId, String inviteCode, Long uid,
            boolean needGoods, String relationId, PrintWriter out) {
        try {
            ShareInfoVO shareInfo = new ShareInfoVO();
            TaoBaoLink taoBaoLink = shareGoodsService.getTaoBaoLinkForShare(uid, goodsId, relationId);
            if (taoBaoLink != null && taoBaoLink.getGoods() != null && needGoods) {
                ConfigParamsDTO dto = hongBaoManageService.getShowComputeRate(platform, version);
                GoodsDetailVO goodsInfo = GoodsDetailVOFactory.convertTaoBao(taoBaoLink.getGoods(), dto);
                shareInfo.setGoodsInfo(goodsInfo);
            }
            String url = String.format("http://%s%s?uid=%s&id=%s&appType=flq", configService.getH5Host(),
                    Constant.systemCommonConfig.getShareGoodsPagePath(), AESUtil.encrypt(uid + "", Constant.UIDAESKEY),
                    goodsId + "");
            String shortLink = HttpUtil.getShortLink(url);
            if (!StringUtil.isNullOrEmpty(shortLink)) {
                url = shortLink;
            }
            shareInfo.setClickUrl(url);
            shareInfo.setToken(TaoBaoUtil.filterTaoToken(taoBaoLink.getTaoToken()));
            shareInfo.setRule(configService.get(ConfigKeyEnum.shareSingleGoodsRule.getKey()));
            shareInfo.setPictUrl(TbImgUtil.getTBSizeImg(taoBaoLink.getGoods().getPictUrl(), 500));
            String commentTextStr = configService.get(ConfigKeyEnum.shareSingleGoodsCommentText.getKey());
            List<String> commentTexts = new ArrayList<>();
            if (!StringUtil.isNullOrEmpty(commentTextStr)) {
                JSONArray array = JSONArray.fromObject(commentTextStr);
                for (int i = 0; i < array.size(); i++) {
                    if (StringUtil.isNullOrEmpty(inviteCode)) {
                        if (array.optString(i).contains("[邀请码]")) {
                            continue;
                        }
                    }
                    if (StringUtil.isNullOrEmpty(inviteCode))
                        commentTexts.add(array.optString(i).replace("[下载链接]", Constant.YINGYONGBAO_LINK)
                                .replace("[淘口令]", shareInfo.getToken()));
                    else
                        commentTexts.add(array.optString(i).replace("[下载链接]", Constant.YINGYONGBAO_LINK)
                                .replace("[邀请码]", inviteCode).replace("[淘口令]", shareInfo.getToken()));
                }
            }
            shareInfo.setCommentTexts(commentTexts);
            String shareText = "";
            // 无券
            String shopType = taoBaoLink.getGoods().getUserType() == 0 ? TaoBaoConstant.SHARE_PRICE_TAOBAO
                    : TaoBaoConstant.SHARE_PRICE_TM;
            if (StringUtil.isNullOrEmpty(taoBaoLink.getGoods().getCouponInfo())) {
                String text = shareGoodsTextTemplateService.getCommonTemplate(uid);
                if (StringUtil.isNullOrEmpty(text))
                    text = configService.get(ConfigKeyEnum.goodsShareTextNoCoupon.getKey());
                shareText = text.replace("{标题}", taoBaoLink.getGoods().getTitle()).replace("{商品原价}",
                        MoneyBigDecimalUtil.getWithNoZera(taoBaoLink.getGoods().getZkPrice()) + "");
            } else// 有券
            {
                String text = shareGoodsTextTemplateService.geteCouponTemplate(uid);
                if (StringUtil.isNullOrEmpty(text))
                    text = configService.get(ConfigKeyEnum.goodsShareTextCoupon.getKey());
                shareText = text.replace("{标题}", taoBaoLink.getGoods().getTitle())
                        .replace("{商品原价}", MoneyBigDecimalUtil.getWithNoZera(taoBaoLink.getGoods().getZkPrice()) + "")
                        .replace("{优惠券面额}",
                                MoneyBigDecimalUtil.getWithNoZera(taoBaoLink.getGoods().getCouponAmount()).toString())
                        .replace("{优惠券价}", TaoBaoUtil.getAfterUseCouplePrice(taoBaoLink.getGoods()) + "");
            }
            shareText = shareText.replace("{店铺类型}", shopType)
                    .replace("{月销量}", TaoBaoUtil.getSaleCount(taoBaoLink.getGoods().getBiz30day()))
                    .replace("{领券短链}", shortLink).replace("{淘口令}", TaoBaoUtil.filterTaoToken(taoBaoLink.getTaoToken()));
            shareInfo.setShareText(shareText);
            String descText = shareText.replace(taoBaoLink.getGoods().getTitle(), "").trim();
            if (descText.startsWith("\\r\\n")) {
                descText = descText.substring(0);
            }
            shareInfo.setDescText(descText);
            // 测试
            // 2.0.2之前
            if (!VersionUtil.greaterThan_2_0_2(platform, version))
                shareInfo.setClickUrl(getERCodeContent(configService.get(ConfigKeyEnum.taobaoShareQrcodeText.getKey()),
                        taoBaoLink.getGoods(), shareInfo.getToken()));
            shareInfo.setWxErCode(getERCodeContent(configService.get(ConfigKeyEnum.taobaoShareQrcodeText.getKey()),
                    taoBaoLink.getGoods(), shareInfo.getToken()));
            // 提示图文内容
            String imgs = configService.get(ConfigKeyEnum.goodsShareNotifyImgs.getKey());
            JSONArray array = JSONArray.fromObject(imgs);
            int p = (int) (array.size() * Math.random());
            if (p < array.size()) {
                shareInfo.setNotifyPicture(array.optString(p));
            }
            shareInfo.setNotifyDesc(configService.get(ConfigKeyEnum.goodsShareNotify.getKey()));
            // 分享金额
            BigDecimal rate = hongBaoManageService.getShareRate();
            BigDecimal shareMoney = TaoBaoUtil.getShareGoodsHongBaoInfo(taoBaoLink.getGoods(), rate);
            shareInfo.setShareMoney("¥" + shareMoney.toString());
            // 分享id
            try {
                ShareGoodsRecordDTO shareRecord = userShareGoodsRecordService.addRecordGoodsDetail(uid, goodsId,
                        Constant.SOURCE_TYPE_TAOBAO, false);
                shareInfo.setShareId(shareRecord.getRedisKey());
            } catch (Exception e) {
                try {
                    LogHelper.errorDetailInfo(e);
                } catch (Exception e1) {
                    e1.printStackTrace();
                }
            }
            // 设置评论文本选项
            shareInfo.setCommentTextChoiceList(getCommentChoiceList(shareInfo.getToken(), null, inviteCode,
                    TaoBaoUtil.getGoodsHongBaoMoney(taoBaoLink.getGoods(), hongBaoManageService.getFanLiRate())));
            shareInfo.setCommentText(shareInfo.getShareText());
            shareInfo.setRecommendText(shareInfo.getDescText());
            out.print(JsonUtil.loadTrueResult(
                    JsonUtil.getConvertBigDecimalToStringSubZeroBuilder(new GsonBuilder()).create().toJson(shareInfo)));
            final TaoBaoLink taobaoLink = taoBaoLink;
            // 异步操作
            com.yeshi.fanli.util.ThreadUtil.run(new Runnable() {
                @Override
                public void run() {
                    // 异步操作 添加分享记录
                    UserShareGoodsHistory history = new UserShareGoodsHistory();
                    history.setUser(new UserInfo(uid));
                    history.setHongbao(shareMoney);
                    history.setCreateTime(new Date());
                    history.setGoodsType(UserShareGoodsHistory.TYPE_TAOBAO);
                    history.setTkCode(TaoBaoUtil.filterTaoToken(taobaoLink.getTaoToken()));
                    history.setLink(taobaoLink.getClickUrl());
                    history.setQuanLink(taobaoLink.getCouponLink());
                    history.setGoodsId(taobaoLink.getGoods().getAuctionId());
                    history.setPostPicture(taobaoLink.getGoods().getPictUrl());
                    List<String> imgList = taobaoLink.getGoods().getImgList();
                    if (imgList == null) {
                        imgList = new ArrayList<>();
                    }
                    history.setPictures(JsonUtil.getGson().toJson(imgList));
                    shareGoodsService.addShareGoodsHistory(history);
                }
            });
            return;
        } catch (ShareGoodsException e) {
            LogHelper.errorDetailInfo(e, "分享出错:uid:" + uid + " goodsId:" + goodsId, "");
            out.print(JsonUtil.loadFalseResult(e.getCode(), e.getMessage()));
            businessEmergent110Service.shareTaoBaoGoodsError(StringUtil.Md5(goodsId + ""));
        }
    }
    /**
     * 京东创建分享
     * 
@@ -700,6 +726,16 @@
                e1.printStackTrace();
            }
        }
        String inviteCode = userInfoExtraService.getInviteCodeByUid(uid);
        // 设置评论文本选项
        shareInfo.setCommentTextChoiceList(getCommentChoiceList(null, shareInfo.getClickUrl(), inviteCode,
                JDUtil.getGoodsFanLiMoney(jdGoods, hongBaoManageService.getFanLiRate())));
        shareInfo.setCommentText(shareInfo.getShareText());
        shareInfo.setRecommendText(shareInfo.getDescText());
        out.print(JsonUtil.loadTrueResult(
                JsonUtil.getConvertBigDecimalToStringSubZeroBuilder(new GsonBuilder()).create().toJson(shareInfo)));
@@ -720,7 +756,7 @@
                history.setGoodsId(goodsId);
                history.setPostPicture(goods.getPicUrl());
                history.setShareImg(jumpLink);
                List<String> imgList = goods.getImageList();
                if (imgList == null) {
                    imgList = new ArrayList<>();
@@ -827,6 +863,16 @@
                e1.printStackTrace();
            }
        }
        String inviteCode = userInfoExtraService.getInviteCodeByUid(uid);
        // 设置评论文本选项
        shareInfo.setCommentTextChoiceList(getCommentChoiceList(null, shareInfo.getClickUrl(), inviteCode,
                PinDuoDuoUtil.getGoodsFanLiMoney(goods, hongBaoManageService.getFanLiRate())));
        shareInfo.setCommentText(shareInfo.getShareText());
        shareInfo.setRecommendText(shareInfo.getDescText());
        out.print(JsonUtil.loadTrueResult(
                JsonUtil.getConvertBigDecimalToStringSubZeroBuilder(new GsonBuilder()).create().toJson(shareInfo)));
fanli/src/main/java/com/yeshi/fanli/controller/client/v2/UserAccountControllerV2.java
@@ -268,7 +268,7 @@
            } else {
                out.print(JsonUtil.loadFalseResult(e.getCode(), e.getMsg()));
                try {
                    LogHelper.cookieLog("登录出错:" + e.getCode() + "-" + e.getMessage());
                    LogHelper.error("登录出错:" + e.getCode() + "-" + e.getMessage());
                } catch (Exception e1) {
                    e1.printStackTrace();
                }
fanli/src/main/java/com/yeshi/fanli/controller/h5/H5RecommendController.java
@@ -34,6 +34,8 @@
import com.yeshi.fanli.exception.share.UserShareGoodsRecordException;
import com.yeshi.fanli.exception.taobao.TaobaoGoodsDownException;
import com.yeshi.fanli.log.LogHelper;
import com.yeshi.fanli.log.LogManager;
import com.yeshi.fanli.log.LogType;
import com.yeshi.fanli.service.inter.config.BusinessSystemService;
import com.yeshi.fanli.service.inter.config.ConfigService;
import com.yeshi.fanli.service.inter.config.SystemConfigService;
@@ -245,7 +247,9 @@
        if (!StringUtil.isNullOrEmpty(uid))
            uid = uid.replace(" ", "+");
        LogHelper.shareGoods("分享出去的H5访问: uid:" + uid + " id:" + id);
        LogManager.getLogger(LogType.taobaoTrade)
                .info(String.format("淘宝分享商品H5访问:\n  商品ID:%s \n  原始用户ID:%s \n", id, uid));
        long begin = java.lang.System.currentTimeMillis();
        if (StringUtil.isNullOrEmpty(id)) {
            out.print(JsonUtil.loadFalseResult(1, "请上传id"));
@@ -448,7 +452,7 @@
        boolean hasCoupon = false;
        String couponUrl = null;
        BigDecimal discount = new BigDecimal(0);
        JDCouponInfo couponInfo = JDUtil.getShowCouponInfo( jdGoods) ;
        JDCouponInfo couponInfo = JDUtil.getShowCouponInfo(jdGoods);
        if (couponInfo != null) {
            hasCoupon = true;
            discount = couponInfo.getDiscount();
@@ -462,7 +466,8 @@
        }
        String materialId = "https://item.jd.com/" + id + ".html";
        String jumpLink = JDApiUtil.convertLinkWithSubUnionId(materialId, couponUrl, JDApiUtil.POSITION_SHARE + "", uid);
        String jumpLink = JDApiUtil.convertLinkWithSubUnionId(materialId, couponUrl, JDApiUtil.POSITION_SHARE + "",
                uid);
        int priceType = 1;
        BigDecimal price = jdGoods.getPrice();
fanli/src/main/java/com/yeshi/fanli/controller/web/WebRecommendController.java
@@ -23,6 +23,8 @@
import com.yeshi.fanli.entity.taobao.TaoBaoGoodsBriefExtra;
import com.yeshi.fanli.entity.taobao.TaoBaoUnionConfig;
import com.yeshi.fanli.exception.taobao.TaobaoGoodsDownException;
import com.yeshi.fanli.log.LogManager;
import com.yeshi.fanli.log.LogType;
import com.yeshi.fanli.service.inter.config.BusinessSystemService;
import com.yeshi.fanli.service.inter.config.ConfigService;
import com.yeshi.fanli.service.inter.config.SystemConfigService;
@@ -83,7 +85,8 @@
    @RequestMapping(value = "getRecommenBanner", method = RequestMethod.GET)
    public void getRecommendBanner(AcceptData acceptData, String callback, PrintWriter out) {
        BusinessSystem system = businessSystemService.getBusinessSystem("WEB", Constant.systemCommonConfig.getH5PackageName());
        BusinessSystem system = businessSystemService.getBusinessSystem("WEB",
                Constant.systemCommonConfig.getH5PackageName());
        JSONObject json = new JSONObject();
        if (system == null) {
            out.print(JsonUtil.loadFalseResult(1, WebControllerUtil.NOSYSTEM));
@@ -124,7 +127,6 @@
        return;
    }
    /**
     * 
     * 方法说明: 获取商品详情
@@ -137,18 +139,15 @@
     */
    @RequestMapping(value = "getGoodsDetail", method = RequestMethod.GET)
    public void getGoodsDetail(final AcceptData acceptData, final String id, final String uid, Integer goodsType,
    public void getGoodsDetail(final AcceptData acceptData, final String id, final String uid, Integer goodsType,
            String callback, PrintWriter out) {
        long begin = java.lang.System.currentTimeMillis();
        if (StringUtil.isNullOrEmpty(id)) {
            out.print(JsonUtil.loadFalseResult(1, "请上传id"));
            return;
        }
        BusinessSystem system = webControllerUtil.getSystem(acceptData);
        // 淘特价
        if (system.getId() == 7) {
            system = businessSystemService.getBusinessSystem("ANDROID", Constant.systemCommonConfig.getAndroidPackageName());
        }
        if (system == null) {
            out.print(JsonUtil.loadFalseResult(1, WebControllerUtil.NOSYSTEM));
@@ -215,7 +214,7 @@
            data.put("sharemoney", "分享奖金 ¥" + taoBaoGoodsBriefService.getShareGoodsUserHongBao(tb) + "元");
            out.print(JsonUtil.loadJSONP(callback, JsonUtil.loadTrueResult(data)));
            final TaoBaoGoodsBrief tbb=tb;
            final TaoBaoGoodsBrief tbb = tb;
        } else {
            out.print(JsonUtil.loadFalseResult(2, "商品已下架"));
fanli/src/main/java/com/yeshi/fanli/controller/wxmp/v1/GoodsController.java
@@ -477,7 +477,7 @@
        }
        
        GoodsDetailExtraVO extraVO = new GoodsDetailExtraVO();
        extraVO.setDetailUrl("http://apph5.yeshitv.com/apppage/goods_img_pdd.html?id=" + id);
        extraVO.setDetailUrl("http://apph5.banliapp.com/apppage/goods_img_pdd.html?id=" + id);
        
        String salesTip = pddGoods.getSalesTip();
        if (!StringUtil.isNullOrEmpty(salesTip)) {
fanli/src/main/java/com/yeshi/fanli/controller/wxmp/v1/UserMsgController.java
@@ -247,7 +247,7 @@
                
                // TODO 跳转地址 
                JSONObject params = new JSONObject();
                params.put("url", "http://apph5.yeshitv.com/special/1.0.9/jingXuanN_9.html?type=9_9");
                params.put("url", "http://apph5.banliapp.com/special/1.0.9/jingXuanN_9.html?type=9_9");
                JumpDetailV2 wxmpJumDetail = JumpDetailUtil.getWXMPJumDetail(jumpDetailV2Service.getByTypeCache("web"));
                userSystemMsgVO.setJumpDetail(wxmpJumDetail);
                
fanli/src/main/java/com/yeshi/fanli/dao/MongodbBaseDao.java
@@ -57,6 +57,17 @@
    public List<T> findList(Query query) {
        return mongoTemplate.find(query, this.getEntityClass());
    }
    /**
     * 统计数量
     *
     * @param query
     * @return
     */
    public long count(Query query) {
        return mongoTemplate.count(query, this.getEntityClass());
    }
    /**
     * 主键查询
fanli/src/main/java/com/yeshi/fanli/dao/user/UserConvertLinkTemplateDao.java
New file
@@ -0,0 +1,13 @@
package com.yeshi.fanli.dao.user;
import org.springframework.stereotype.Repository;
import com.yeshi.fanli.dao.MongodbBaseDao;
import com.yeshi.fanli.entity.bus.user.UserConvertLinkTemplate;
@Repository
public class UserConvertLinkTemplateDao extends MongodbBaseDao<UserConvertLinkTemplate> {
}
fanli/src/main/java/com/yeshi/fanli/entity/accept/AcceptData.java
@@ -15,6 +15,15 @@
    private String network;
    private String imei;
    private String idfa;
    private String utdid;
    public String getUtdid() {
        return utdid;
    }
    public void setUtdid(String utdid) {
        this.utdid = utdid;
    }
    public String getIdfa() {
        return idfa;
fanli/src/main/java/com/yeshi/fanli/entity/bus/help/HelpClass.java
@@ -1,5 +1,6 @@
package com.yeshi.fanli.entity.bus.help;
import java.io.Serializable;
import java.util.Date;
import org.yeshi.utils.mybatis.Column;
@@ -16,7 +17,12 @@
 */
@Table("yeshi_ec_help_class")
public class HelpClass {
public class HelpClass implements Serializable{
    /**
     *
     */
    private static final long serialVersionUID = 1L;
    @Expose
    @Column(name = "hc_id")
fanli/src/main/java/com/yeshi/fanli/entity/bus/user/UserConvertLinkTemplate.java
New file
@@ -0,0 +1,84 @@
package com.yeshi.fanli.entity.bus.user;
import java.util.Date;
import org.springframework.data.annotation.Id;
import org.springframework.data.mongodb.core.index.Indexed;
import org.springframework.data.mongodb.core.mapping.Document;
import org.springframework.data.mongodb.core.mapping.Field;
import com.google.gson.annotations.Expose;
/**
 * 文案转链模板
 * @author Administrator
 *
 */
@Document(collection = "convertLinkTemplate")
public class UserConvertLinkTemplate{
    @Expose
    @Id
    private String id;
    @Indexed
    @Field
    private Long uid;
    @Expose
    @Field
    private String template;
    @Field
    private Date createTime;
    @Field
    private Date updateTime;
    @Expose
    private String content;// 模板用户填充后的内容
    public String getContent() {
        return content;
    }
    public void setContent(String content) {
        this.content = content;
    }
    public String getId() {
        return id;
    }
    public void setId(String id) {
        this.id = id;
    }
    public String getTemplate() {
        return template;
    }
    public void setTemplate(String template) {
        this.template = template;
    }
    public Date getCreateTime() {
        return createTime;
    }
    public void setCreateTime(Date createTime) {
        this.createTime = createTime;
    }
    public Date getUpdateTime() {
        return updateTime;
    }
    public void setUpdateTime(Date updateTime) {
        this.updateTime = updateTime;
    }
    public Long getUid() {
        return uid;
    }
    public void setUid(Long uid) {
        this.uid = uid;
    }
}
fanli/src/main/java/com/yeshi/fanli/entity/money/UserMoneyDetail.java
@@ -32,16 +32,16 @@
        fanli("返利到账", "http://img.flqapp.com/resource/money_detail/icon_fanli.png", ""),
        fanliWeiQuan("返利扣除",
                "http://img.flqapp.com/resource/money_detail/icon_fanli.png",
                "http://apph5.yeshitv.com/AppPage/1.8.0/all_help_content.html?id=214"),
                "http://apph5.banliapp.com/AppPage/1.8.0/all_help_content.html?id=214"),
        inviteWeiQuan("邀请奖金扣除",
                "http://img.flqapp.com/resource/money_detail/icon_invite.png",
                "http://apph5.yeshitv.com/AppPage/1.8.0/all_help_content.html?id=214"),
                "http://apph5.banliapp.com/AppPage/1.8.0/all_help_content.html?id=214"),
        shareWeiQuan("分享奖金扣除",
                "http://img.flqapp.com/resource/money_detail/icon_share.png",
                "http://apph5.yeshitv.com/AppPage/1.8.0/all_help_content.html?id=214"),
                "http://apph5.banliapp.com/AppPage/1.8.0/all_help_content.html?id=214"),
        weiQuan("售后订单扣款",
                "http://img.flqapp.com/resource/money_detail/icon_fanli.png",
                "http://apph5.yeshitv.com/AppPage/1.8.0/all_help_content.html?id=214"),
                "http://apph5.banliapp.com/AppPage/1.8.0/all_help_content.html?id=214"),
        systemEqualize("系统补齐", "http://img.flqapp.com/resource/money_detail/icon_system.png", ""),
        scoreConvert("金币兑换", "http://img.flqapp.com/resource/money_detail/icon_score.png", ""),
        hongbao("官方红包", "http://img.flqapp.com/resource/money_detail/icon_hongbao.png", ""),
fanli/src/main/java/com/yeshi/fanli/entity/system/ConfigKeyEnum.java
@@ -163,6 +163,10 @@
    articleHotWords("article_hot_words", "动态-学院文章热搜词"),
    vipLink("vip_link", "超级会员升级链接"), // 转移至VIPConfig 已废弃
    helpLinkVipInfo("help_link_vip_info", "超级会员详情页帮助链接"), // 已废弃
    //文案转链
    convertDocWebLink("convert_doc_web_link","文案转链网页"),
    convertDocHelpLink("convert_doc_help_link","文案转链帮助网页"),
    convertDocTip("convert_doc_tip","文案转链温馨提示")
    ;
    private final String key;
fanli/src/main/java/com/yeshi/fanli/entity/system/SystemClientParams.java
@@ -34,11 +34,11 @@
    @Column(name = "value")
    private String value;
    @Expose
//    @Expose
    @Column(name = "name")
    private String name;
    @Expose
//    @Expose
    @Column(name = "updatetime")
    private Long updatetime;
fanli/src/main/java/com/yeshi/fanli/entity/taobao/TaoBaoGoodsBrief.java
@@ -83,8 +83,6 @@
    @Expose
    private String title;// 商品标题
    @Field
    @Indexed
    @org.yeshi.utils.mybatis.Column(name = "auctionId")
@@ -286,10 +284,14 @@
    @Transient
    private Integer materialLibType;//物料库类型
    
    private String description;//推荐语
    
    /* 新增字段 2018-7-16 ; 由于数据未从淘宝获取成功,暂不启用 */
    
    public Integer getMaterialLibType() {
        return materialLibType;
    }
@@ -889,4 +891,12 @@
        this.pictUrlWhite = pictUrlWhite;
    }
    
    public String getDescription() {
        return description;
    }
    public void setDescription(String description) {
        this.description = description;
    }
}
fanli/src/main/java/com/yeshi/fanli/exception/taobao/TaoBaoTokenParseException.java
New file
@@ -0,0 +1,21 @@
package com.yeshi.fanli.exception.taobao;
import com.yeshi.fanli.exception.BaseException;
public class TaoBaoTokenParseException extends BaseException {
    // 商品已下架
    public static int CODE_GOODS_OFFLINE = 10000;
    // 解析结果为空
    public static int CODE_NULL = 20011;
    /**
     *
     */
    private static final long serialVersionUID = 1L;
    public TaoBaoTokenParseException(int code, String msg) {
        super(code, msg);
    }
}
fanli/src/main/java/com/yeshi/fanli/job/order/jd/UpdateJDOrderJob.java
@@ -17,6 +17,7 @@
import com.yeshi.fanli.util.Constant;
import com.yeshi.fanli.util.RedisKeyEnum;
import com.yeshi.fanli.util.RedisManager;
import com.yeshi.fanli.util.StringUtil;
import com.yeshi.fanli.util.TimeUtil;
import com.yeshi.fanli.util.cmq.JDOrderCMQManager;
import com.yeshi.fanli.util.jd.JDApiUtil;
@@ -42,9 +43,9 @@
            if (order.getValidCode() == 15)// 过滤掉待付款
                continue;
            //防止多个商品拆单问题,爬取
            // 防止多个商品拆单问题,爬取
            if (order.getOrderItemList().size() > 1
                    && order.getOrderTime() > System.currentTimeMillis() - 1000 * 60 * 2L) {
                    && order.getOrderTime() > System.currentTimeMillis() - 1000 * 60 * 3L) {
                continue;
            }
@@ -53,12 +54,13 @@
                /**
                 * 做频率限制
                 */
                String key = RedisKeyEnum.getRedisKey(RedisKeyEnum.JDOrder,  order.getOrderId() + "" );
                String key = RedisKeyEnum.getRedisKey(RedisKeyEnum.JDOrder, order.getOrderId() + "");
                String result = redisManager.getCommonString(key);
                // 判断
                JDOrderCMQManager.getInstance().addJDOrder(order.getOrderId() + "");
                redisManager.cacheCommonString(key, "1", 60 * 60 * 2);// 2小时内不再更新
                if (StringUtil.isNullOrEmpty(result)) {
                    JDOrderCMQManager.getInstance().addJDOrder(order.getOrderId() + "");
                    redisManager.cacheCommonString(key, "1", 60 * 60 * 2);// 2小时内不再更新
                }
            } catch (JDOrderException e) {
                e.printStackTrace();
            }
fanli/src/main/java/com/yeshi/fanli/log/LogHelper.java
@@ -22,8 +22,6 @@
    private static Logger userOrderLogger = Logger.getLogger("userOrderLog");
    private static Logger cookieLogger = Logger.getLogger("cookieLog");
    private static Logger testLogger = Logger.getLogger("testLog");
    private static Logger errorLogger = Logger.getLogger("errorLog");
@@ -69,10 +67,6 @@
    public static void orderErrorInfo(Object obj) {
        orderLogger.error(obj);
    }
    public static void cookieLog(Object obj) {
        cookieLogger.info(obj);
    }
    public static void userOrder(Object obj) {
fanli/src/main/java/com/yeshi/fanli/log/LogManager.java
New file
@@ -0,0 +1,15 @@
package com.yeshi.fanli.log;
import java.util.HashMap;
import java.util.Map;
public class LogManager {
    private static Map<LogType, org.apache.logging.log4j.Logger> logMap = new HashMap<>();
    public static org.apache.logging.log4j.Logger getLogger(LogType logType) {
        if (logMap.get(logType) == null)
            logMap.put(logType, org.apache.logging.log4j.LogManager.getLogger(logType.name()));
        return logMap.get(logType);
    }
}
fanli/src/main/java/com/yeshi/fanli/log/LogType.java
New file
@@ -0,0 +1,22 @@
package com.yeshi.fanli.log;
//日志类型
public enum LogType {
    mqSend("消息发送"),
    mqConsume("消息消费"),
    taobaoTaoke("淘客api"),
    taobaoTrade("淘宝交易(分享/自购)"),
    taobaoAuth("淘宝授权"),
    userLogin("用户登录");
    private String desc;
    private LogType(String desc) {
        this.desc = desc;
    }
    public String getDesc() {
        return desc;
    }
}
fanli/src/main/java/com/yeshi/fanli/service/impl/goods/ShareGoodsServiceImpl.java
@@ -19,10 +19,8 @@
import org.yeshi.utils.exception.HttpException;
import org.yeshi.utils.tencentcloud.COSManager;
import com.yeshi.fanli.dao.mybatis.HongBaoManageMapper;
import com.yeshi.fanli.dao.mybatis.UserInfoMapper;
import com.yeshi.fanli.dao.mybatis.UserShareGoodsHistoryMapper;
import com.yeshi.fanli.dao.mybatis.share.PidUserMapper;
import com.yeshi.fanli.dto.taobao.TaoLiJinDTO;
import com.yeshi.fanli.entity.bus.share.UserShareGoodsHistory;
import com.yeshi.fanli.entity.bus.user.UserInfo;
@@ -39,20 +37,19 @@
import com.yeshi.fanli.exception.tlj.TaoLiJinCreateException;
import com.yeshi.fanli.exception.tlj.UserTaoLiJinNewbiesException;
import com.yeshi.fanli.log.LogHelper;
import com.yeshi.fanli.log.LogManager;
import com.yeshi.fanli.log.LogType;
import com.yeshi.fanli.service.inter.config.ConfigService;
import com.yeshi.fanli.service.inter.goods.CommonGoodsService;
import com.yeshi.fanli.service.inter.goods.ShareGoodsService;
import com.yeshi.fanli.service.inter.money.UserMoneyExtraService;
import com.yeshi.fanli.service.inter.monitor.BusinessEmergent110Service;
import com.yeshi.fanli.service.inter.order.config.HongBaoManageService;
import com.yeshi.fanli.service.inter.redpack.UserTaoLiJinNewbiesService;
import com.yeshi.fanli.service.inter.taobao.TLJBuyGoodsService;
import com.yeshi.fanli.service.inter.taobao.TaoBaoUnionConfigService;
import com.yeshi.fanli.service.inter.taobao.UserTLJBuyHistoryService;
import com.yeshi.fanli.service.inter.tlj.UserTaoLiJinRecordService;
import com.yeshi.fanli.service.inter.user.TBPidService;
import com.yeshi.fanli.service.inter.user.UserAccountService;
import com.yeshi.fanli.service.inter.user.UserShareGoodsRecordService;
import com.yeshi.fanli.service.manger.goods.ConvertLinkManager;
import com.yeshi.fanli.util.AESUtil;
import com.yeshi.fanli.util.Constant;
import com.yeshi.fanli.util.FilePathEnum;
@@ -68,8 +65,7 @@
@Service
public class ShareGoodsServiceImpl implements ShareGoodsService {
    @Resource
    private PidUserMapper pidUserMapper;
    @Resource
    private TBPidService tbPidService;
@@ -77,8 +73,6 @@
    @Resource
    private UserShareGoodsHistoryMapper userShareGoodsHistoryMapper;
    @Resource
    private HongBaoManageMapper hongBaoManageMapper;
    @Resource
    private UserInfoMapper userinfoMapper;
@@ -98,17 +92,6 @@
    @Resource
    private HongBaoManageService hongBaoManageService;
    @Resource
    private UserShareGoodsRecordService userShareGoodsRecordService;
    @Resource
    private CommonGoodsService commonGoodsService;
    @Resource
    private UserMoneyExtraService userMoneyExtraService;
    @Resource
    private UserTaoLiJinRecordService userTaoLiJinRecordService;
    @Resource
    private UserTLJBuyHistoryService userTLJBuyHistoryService;
@@ -122,6 +105,9 @@
    @Resource
    private UserTaoLiJinNewbiesService userTaoLiJinNewbiesService;
    
    @Resource
    private ConvertLinkManager convertLinkManager;
    @Override
    public void addShareGoodsHistory(UserShareGoodsHistory history) {
        UserShareGoodsHistory userShareGoodsHistory = userShareGoodsHistoryMapper
@@ -305,7 +291,8 @@
            }
            FileUploadResult shareImgResult = COSManager.getInstance().uploadInputStream(shareImgInputStream,
                    FilePathEnum.shareGoods.getPath() + "share_" + uid + "_" + goods.getAuctionId() + "_" + System.currentTimeMillis() + ".png");
                    FilePathEnum.shareGoods.getPath() + "share_" + uid + "_" + goods.getAuctionId() + "_"
                            + System.currentTimeMillis() + ".png");
            if (shareImgResult == null || StringUtil.isNullOrEmpty(shareImgResult.getUrl())) {
                throw new ShareGoodsException(6, "分享图片保存失败");
@@ -421,8 +408,6 @@
        }
        TaoBaoGoodsBrief goods = null;
        try {
            // 测试
            // info.setAdzoneId("123");
            goods = TaoKeApiUtil.searchGoodsDetail(auctionId, info);
        } catch (TaobaoGoodsDownException e) {
            throw new ShareGoodsException(4, "商品已下架");
@@ -433,8 +418,6 @@
        }
        if (StringUtil.isNullOrEmpty(goods.getCouponLink()) && !goods.getAuctionUrl().contains("s.click.taobao.com")) {
            TaoBaoUnionConfig taoBaoUnionConfig = taoBaoUnionConfigService
                    .getConfigByAppIdCache(info.getPid().split("_")[2]);
            TaoBaoGoodsBrief taoBaoLink = TaoKeApiUtil.specialConvertCoupon(auctionId, info);
            if (taoBaoLink == null) {
                throw new ShareGoodsException(201, "商品转链失败");
@@ -459,12 +442,12 @@
        tbLink.setCouponLink(goods.getCouponLink());
        if (!StringUtil.isNullOrEmpty(tbLink.getCouponLink())) {// 通过立即推广方式获取淘口令成功
            String quanToken = TaoKeApiUtil.getTKToken(goods.getPictUrl(), goods.getTitle(), tbLink.getCouponLink());
            String quanToken = convertLinkManager.createTaoBaoToken(uid, goods.getPictUrl(), goods.getTitle(), tbLink.getCouponLink());
            if (!StringUtil.isNullOrEmpty(quanToken)) {
                tbLink.setTaoToken(quanToken);
            }
        } else if (!StringUtil.isNullOrEmpty(tbLink.getClickUrl())) {
            String quanToken = TaoKeApiUtil.getTKToken(goods.getPictUrl(), goods.getTitle(), tbLink.getClickUrl());
            String quanToken = convertLinkManager.createTaoBaoToken(uid,goods.getPictUrl(), goods.getTitle(), tbLink.getClickUrl());
            if (!StringUtil.isNullOrEmpty(quanToken)) {
                tbLink.setTaoToken(quanToken);
            }
@@ -475,6 +458,10 @@
        // 存储分享商品的信息,用于加快分享网页接口请求速度
        if (Constant.IS_OUTNET)
            redisManager.saveTaoBaoGoodsBriefTemp(goods);
        LogManager.getLogger(LogType.taobaoTrade)
                .info(String.format("淘宝商品分享\n UID:%s \n 商品ID:%s \n 券链接%s \n商品链接:%s \n 口令:%s ", uid, auctionId,
                        tbLink.getCouponLink(), tbLink.getClickUrl(), tbLink.getTaoToken()));
        return tbLink;
    }
@@ -680,22 +667,22 @@
    @Override
    public TaoBaoLink getTaoLiJinLinkForBuy(Long uid, String specialId, Long auctionId, String pid)
            throws ShareGoodsException {
        if (uid == null || uid <= 0)
        if (uid == null || uid <= 0)
            throw new ShareGoodsException(1, "用户ID不能为空");
        if (auctionId == null || auctionId <= 0)
        if (auctionId == null || auctionId <= 0)
            throw new ShareGoodsException(1, "商品ID不能为空");
        TaoBaoGoodsBrief goods = null;
        try {
            goods = TaoKeApiUtil.searchGoodsDetail(auctionId);
        } catch (TaobaoGoodsDownException e) {
            throw new ShareGoodsException(1, "该商品已下架");
        }
        if (goods == null)
        if (goods == null)
            throw new ShareGoodsException(1, "该商品已下架");
        String taoLiJinLink = null;
        try {
            goods.setAuctionId(auctionId);
fanli/src/main/java/com/yeshi/fanli/service/impl/goods/recommend/HomeRecommendGoodsServiceImpl.java
@@ -138,7 +138,7 @@
        if (fList != null && fList.size() > 0)
            return fList;
        TaoBaoSearchResult result = TaoKeApiUtil.guessDeviceLike(1, 50, imei, idfa);
        TaoBaoSearchResult result = TaoKeApiUtil.guessDeviceLike(1, 50, imei, idfa,"");
        List<TaoBaoGoodsBrief> finalList = new ArrayList<>();
        if (result != null && result.getTaoBaoGoodsBriefs() != null) {
fanli/src/main/java/com/yeshi/fanli/service/impl/order/tb/TaoBaoWeiQuanOrderServiceImpl.java
@@ -47,8 +47,7 @@
                .selectByOrderIdAndOrderItemId(order.getOrderId(), order.getOrderItemId());
        if (taoBaoWeiQuanOrder != null) {
            // 已经是最新的状态了
            if (taoBaoWeiQuanOrder.getState() != null && (taoBaoWeiQuanOrder.getState().contains("维权成功")
                    || taoBaoWeiQuanOrder.getState().contains("维权失败")))
            if (taoBaoWeiQuanOrder.getState() != null && (taoBaoWeiQuanOrder.getState().contains("维权成功")))
                return;
            // 更新金额,状态与时间
            TaoBaoWeiQuanOrder update = new TaoBaoWeiQuanOrder();
fanli/src/main/java/com/yeshi/fanli/service/impl/redpack/RedPackExchangeServiceImpl.java
@@ -31,6 +31,7 @@
import com.yeshi.fanli.service.inter.redpack.RedPackExchangeService;
import com.yeshi.fanli.service.inter.redpack.RedPackForbidService;
import com.yeshi.fanli.util.StringUtil;
import com.yeshi.fanli.util.ThreadUtil;
import com.yeshi.fanli.util.TimeUtil;
import com.yeshi.fanli.util.factory.RedPackDetailFactory;
@@ -39,82 +40,78 @@
    @Resource
    private RedPackExchangeMapper redPackExchangeMapper;
    @Resource
    private RedPackConfigService redPackConfigService;
    @Resource
    private RedPackBalanceService redPackBalanceService;
    @Resource
    private UserMoneyService userMoneyService;
    @Resource
    private RedPackDetailService redPackDetailService;
    @Resource
    private UserMoneyMsgNotificationService userMoneyMsgNotificationService;
    @Resource
    private RedPackForbidService redPackForbidService;
    @Override
    public List<RedPackExchange> query(Integer start, Integer count, String key, Integer state){
    public List<RedPackExchange> query(Integer start, Integer count, String key, Integer state) {
        return redPackExchangeMapper.query(start, count, key, state);
    }
    @Override
    public Long count(String key, Integer state){
    public Long count(String key, Integer state) {
        return redPackExchangeMapper.count(key, state);
    }
    @Override
    public Long countByUidAndState(long uid, Integer state) {
        return redPackExchangeMapper.countByUidAndState(uid, state);
    }
    @Override
    public BigDecimal countMoneyByUidAndState(Long uid, Integer state){
    public BigDecimal countMoneyByUidAndState(Long uid, Integer state) {
        return redPackExchangeMapper.countMoneyByUidAndState(uid, state);
    }
    @Override
    public RedPackExchange selectByPrimaryKey(long id){
    public RedPackExchange selectByPrimaryKey(long id) {
        return redPackExchangeMapper.selectByPrimaryKey(id);
    }
    @Override
    @Transactional(rollbackFor = Exception.class)
    public void exchangeCash(Long uid, BigDecimal amount) throws RedPackExchangeException {
        if (uid == null || amount == null)
            throw new RedPackExchangeException(1, "参数不正确");
        if(redPackForbidService.verifyForbid(uid))
        if (redPackForbidService.verifyForbid(uid))
            throw new RedPackExchangeException(1, "红包功能已被封禁");
        String extractBanlenMin = redPackConfigService.getValueByKey("extract_banlen_min");
        BigDecimal balance =  redPackBalanceService.getBalance(uid);
        BigDecimal balance = redPackBalanceService.getBalance(uid);
        if (balance == null || balance.compareTo(new BigDecimal(extractBanlenMin)) < 0)
            throw new RedPackExchangeException(1, "余额不足" + extractBanlenMin + "元");
        if (balance.compareTo(amount) < 0)
            throw new RedPackExchangeException(1, "提现余额不足");
        String moneyMin = redPackConfigService.getValueByKey("extract_money_min");
        String moneyMax = redPackConfigService.getValueByKey("extract_money_max");
        if (amount.compareTo(new BigDecimal(moneyMin)) < 0 || amount.compareTo(new BigDecimal(moneyMax)) > 0)
            throw new RedPackExchangeException(1, "提现金额至少" + moneyMin + "元至多" + moneyMax + "元");
        long countToday = redPackExchangeMapper.countTodayByUid(uid);
        String extractDayMax = redPackConfigService.getValueByKey("extract_day_max");
        if (!StringUtil.isNullOrEmpty(extractDayMax) && countToday >= Long.parseLong(extractDayMax))
        if (!StringUtil.isNullOrEmpty(extractDayMax) && countToday >= Long.parseLong(extractDayMax))
            throw new RedPackExchangeException(1, "今日红包提现次数超限");
        Date nowDate = new Date();
        // 提现申请
        RedPackExchange exchange = new RedPackExchange();
@@ -123,7 +120,7 @@
        exchange.setState(RedPackExchange.STATE_INIT);
        exchange.setCreateTime(nowDate);
        redPackExchangeMapper.insertSelective(exchange);
        // 减少红包
        try {
            redPackBalanceService.subRedPack(uid, amount, RedPackDetailFactory.createExchange(exchange));
@@ -131,27 +128,26 @@
            throw new RedPackExchangeException(1, "红包信息异常");
        }
    }
    @Override
    @Transactional(rollbackFor = Exception.class)
    public void passExchange(final long id, AdminUser admin) throws RedPackExchangeException {
        RedPackExchange record = redPackExchangeMapper.selectByPrimaryKey(id);
        if (record == null)
            throw new RedPackExchangeException(1,"申请记录已不存在");
        if (record == null)
            throw new RedPackExchangeException(1, "申请记录已不存在");
        if (RedPackExchange.STATE_INIT != record.getState())
            throw new RedPackExchangeException(1,"该申请已被处理,请刷新");
            throw new RedPackExchangeException(1, "该申请已被处理,请刷新");
        if(redPackForbidService.verifyForbid(record.getUid()))
        if (redPackForbidService.verifyForbid(record.getUid()))
            throw new RedPackExchangeException(1, "红包功能已被封禁");
        Date nowDate = new Date();
        record.setAuditId(admin.getId());
        record.setAuditTime(nowDate);
        record.setState(RedPackExchange.STATE_SUCCESS);
        redPackExchangeMapper.updateByPrimaryKeySelective(record);
        // 资金明细-添加资金
        UserMoneyDetail detail = new UserMoneyDetail();
        detail.setCreateTime(new Date());
@@ -159,13 +155,13 @@
        detail.setMoney(record.getMoney());
        detail.setType(UserMoneyDetailTypeEnum.redPackExchange);
        detail.setTitle(UserMoneyDetailTypeEnum.redPackExchange.getDesc());
        detail.setDescInfo("于"+ TimeUtil.formatDate(record.getCreateTime()) +"提现");
        detail.setDescInfo("于" + TimeUtil.formatDate(record.getCreateTime()) + "提现");
        detail.setUpdateTime(new Date());
        detail.setUserInfo(new UserInfo(record.getUid()));
        // 添加资金
        userMoneyService.addUserMoney(record.getUid(), record.getMoney(), detail);
        // 更新红包提现明细
        try {
            String identifyCode = StringUtil.Md5(RedPackDetailTypeEnum.redExchange.name() + ":" + record.getId());
@@ -175,56 +171,57 @@
            redPackDetailService.updateByPrimaryKeySelective(updateDetail);
        } catch (Exception e) {
            LogHelper.errorDetailInfo(e);
            throw new RedPackExchangeException(1,"更新提现明细出错");
            throw new RedPackExchangeException(1, "更新提现明细出错");
        }
        //消息
        // 消息
        SimpleDateFormat sd = new SimpleDateFormat("yyyy.MM.dd HH:mm");
        String beizu = "红包提现成功后请到“我的-账户余额”中查看";
        MsgRedPackExchangeContentDTO dto = new MsgRedPackExchangeContentDTO();
        dto.setTitle("红包提现");
        dto.setTime(sd.format(record.getCreateTime()));
        dto.setHandle("人工审核" + sd.format(new Date()));
        dto.setMoney("¥" + record.getMoney().setScale(2));
        dto.setHandle("人工审核" + sd.format(new Date()));
        dto.setMoney("¥" + record.getMoney().setScale(2));
        dto.setBalance("¥" + redPackBalanceService.getBalance(record.getUid()));
        userMoneyMsgNotificationService.redPackMsg(record.getUid(), MsgTypeMoneyTypeEnum.redPackExchangePass, new Gson().toJson(dto), beizu);
        userMoneyMsgNotificationService.redPackMsg(record.getUid(), MsgTypeMoneyTypeEnum.redPackExchangePass,
                new Gson().toJson(dto), beizu);
    }
    @Override
    @Transactional(rollbackFor = Exception.class)
    public void rejectExchange(long id, String reason, AdminUser admin) throws RedPackExchangeException {
        RedPackExchange record = redPackExchangeMapper.selectByPrimaryKey(id);
        if (record == null)
            throw new RedPackExchangeException(1,"申请记录已不存在");
        if (record == null)
            throw new RedPackExchangeException(1, "申请记录已不存在");
        if (RedPackExchange.STATE_INIT != record.getState())
            throw new RedPackExchangeException(1,"该申请已被处理,请刷新");
            throw new RedPackExchangeException(1, "该申请已被处理,请刷新");
        record.setReason(reason);
        record.setAuditTime(new Date());
        record.setAuditId(admin.getId());
        record.setState(RedPackExchange.STATE_REJECT);
        redPackExchangeMapper.updateByPrimaryKeySelective(record);
        // 退回红包
        try {
            redPackBalanceService.addRedPack(record.getUid(), record.getMoney(), RedPackDetailFactory.createExchangeReject(record));
            redPackBalanceService.addRedPack(record.getUid(), record.getMoney(),
                    RedPackDetailFactory.createExchangeReject(record));
        } catch (Exception e) {
            LogHelper.errorDetailInfo(e);
            throw new RedPackExchangeException(1, "红包退回时出错");
        }
        //消息
        // 消息
        SimpleDateFormat sd = new SimpleDateFormat("yyyy.MM.dd HH:mm");
        MsgRedPackExchangeContentDTO dto = new MsgRedPackExchangeContentDTO();
        dto.setTitle("红包提现");
        dto.setReason(reason);
        dto.setHandle(""); // TODO 处理方式待定
        dto.setTime(sd.format(record.getCreateTime()));
        userMoneyMsgNotificationService.redPackMsg(record.getUid(), MsgTypeMoneyTypeEnum.redPackExchangeReject, new Gson().toJson(dto), null);
        userMoneyMsgNotificationService.redPackMsg(record.getUid(), MsgTypeMoneyTypeEnum.redPackExchangeReject,
                new Gson().toJson(dto), null);
    }
}
fanli/src/main/java/com/yeshi/fanli/service/impl/shop/BanLiShopOrderPayServiceImpl.java
@@ -18,16 +18,21 @@
import com.yeshi.fanli.dto.mq.order.body.BanLiShopOrderMQMsg;
import com.yeshi.fanli.dto.msg.MsgRedPackUseContentDTO;
import com.yeshi.fanli.entity.bus.msg.MsgMoneyDetail.MsgTypeMoneyTypeEnum;
import com.yeshi.fanli.entity.common.AdminUser;
import com.yeshi.fanli.entity.common.Config;
import com.yeshi.fanli.entity.redpack.RedPackDetail;
import com.yeshi.fanli.entity.shop.BanLiShopGoods;
import com.yeshi.fanli.entity.shop.BanLiShopGoodsClass;
import com.yeshi.fanli.entity.shop.BanLiShopGoodsSets;
import com.yeshi.fanli.entity.shop.BanLiShopOrder;
import com.yeshi.fanli.entity.shop.ChargeTypeEnum;
import com.yeshi.fanli.entity.system.ConfigKeyEnum;
import com.yeshi.fanli.exception.redpack.RedPackBalanceException;
import com.yeshi.fanli.exception.redpack.RedPackDetailException;
import com.yeshi.fanli.exception.shop.BanLiShopOrderException;
import com.yeshi.fanli.exception.shop.FuLuChargeException;
import com.yeshi.fanli.service.AdminUserService;
import com.yeshi.fanli.service.inter.config.ConfigService;
import com.yeshi.fanli.service.inter.money.msg.UserMoneyMsgNotificationService;
import com.yeshi.fanli.service.inter.redpack.RedPackBalanceService;
import com.yeshi.fanli.service.inter.redpack.RedPackDetailService;
@@ -38,7 +43,9 @@
import com.yeshi.fanli.service.inter.shop.BanLiShopOrderService;
import com.yeshi.fanli.util.Constant;
import com.yeshi.fanli.util.StringUtil;
import com.yeshi.fanli.util.ThreadUtil;
import com.yeshi.fanli.util.charge.FuLuChargeApiUtil;
import com.yeshi.fanli.util.email.MailSenderUtil;
import com.yeshi.fanli.util.factory.RedPackDetailFactory;
import com.yeshi.fanli.util.rocketmq.MQMsgBodyFactory;
import com.yeshi.fanli.util.rocketmq.MQTopicName;
@@ -66,6 +73,12 @@
    @Resource
    private UserMoneyMsgNotificationService userMoneyMsgNotificationService;
    @Resource
    private ConfigService configService;
    @Resource
    private AdminUserService adminUserService;
    @Resource(name = "producer")
    private Producer producer;
@@ -162,6 +175,24 @@
     * 支付成功
     */
    private void paySuccess(BanLiShopOrder order) {
        ThreadUtil.run(new Runnable() {
            @Override
            public void run() {
                long[] targetUids = new long[] { 3L, 4L };
                Config config = configService.getConfig(ConfigKeyEnum.extractCodeEmailFrom.getKey());
                String[] sts = config.getValue().split(",");
                String account = sts[0];
                String pwd = sts[1];
                for (long adminId : targetUids) {
                    AdminUser adminUser = adminUserService.selectByPrimaryKey(adminId);
                    String msg = "有新的红包商城订单";
                    boolean isS = MailSenderUtil.sendEmail(adminUser.getEmail(), account, pwd, "有新的红包商城订单", msg);
                }
            }
        });
    }
    @Transactional(rollbackFor=Exception.class)
fanli/src/main/java/com/yeshi/fanli/service/impl/taobao/TaoBaoGoodsUpdateServiceImpl.java
@@ -9,6 +9,7 @@
import javax.annotation.Resource;
import org.springframework.context.annotation.Lazy;
import org.springframework.scheduling.annotation.Async;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
@@ -50,6 +51,7 @@
    @Resource
    private CommonGoodsService commonGoodsService;
    @Lazy
    @Resource
    private ShareHotGoodsService shareHotGoodsService;
fanli/src/main/java/com/yeshi/fanli/service/impl/user/TokenRecordServiceImpl.java
@@ -82,23 +82,22 @@
    @Resource
    private UserOtherMsgNotificationService userOtherMsgNotificationService;
    @Lazy
    @Resource
    private IntegralGetService  integralGetService;
    private IntegralGetService integralGetService;
    @Resource
    private SystemCouponService systemCouponService;
    @Resource
    private UserInviteMsgNotificationService userInviteMsgNotificationService;
    @Resource
    private RedPackGiveRecordService redPackGiveRecordService;
    @Resource
    private UserMoneyMsgNotificationService userMoneyMsgNotificationService;
    @Override
    public void insertSelective(TokenRecord record) {
@@ -107,29 +106,28 @@
        tokenRecordMapper.insertSelective(record);
    }
    @Override
    public void updateByPrimaryKeySelective(TokenRecord record) {
        tokenRecordMapper.updateByPrimaryKeySelective(record);
    }
    @Override
    public TokenRecord getNearByTypeAndIdentify(String type, String identify) {
        return tokenRecordMapper.getNearByTypeAndIdentify(type, identify);
    }
    @Override
    public TokenRecord getByTypeAndIdentify(String type, String identify) {
        return tokenRecordMapper.getByTypeAndIdentify(type, identify);
    }
    @Override
    public TokenVO discernToken(String token, Long uid, AcceptData acceptData) throws TokenRecordException {
    public TokenVO discernToken(String token, Long uid, String platform, String version) throws TokenRecordException {
        // 解析口令
        String parseToken = TokenUtil.parseToken(token);
        if (StringUtil.isNullOrEmpty(parseToken))
        if (StringUtil.isNullOrEmpty(parseToken))
            throw new TokenRecordException(1, "未发现口令");
        TokenRecord rokenRecord = tokenRecordMapper.getByToken(parseToken);
        if (rokenRecord == null)
            throw new TokenRecordException(1, "口令不存在");
@@ -137,22 +135,21 @@
        Long uidToken = rokenRecord.getUid();
        if (uid != null && uidToken != null && uid.longValue() == uidToken.longValue())
            throw new TokenRecordException(1, "不能自己赠送给自己");
        Date now = new Date();
        Date endTimeToken = rokenRecord.getEndTime();
        Integer stateTtoken = rokenRecord.getState();
        if (endTimeToken != null && endTimeToken.getTime() < now.getTime()
                || (stateTtoken != null && stateTtoken == 1) || StringUtil.isNullOrEmpty(rokenRecord.getIdentify()))
        if (endTimeToken != null && endTimeToken.getTime() < now.getTime() || (stateTtoken != null && stateTtoken == 1)
                || StringUtil.isNullOrEmpty(rokenRecord.getIdentify()))
            throw new TokenRecordException(1, "口令已失效");
        Integer num = 0;
        Integer type = 0;
        String money = null;
        boolean state = false;
        List<String> tips = new ArrayList<String>();
        String identify = rokenRecord.getIdentify();
        TokenTypeEnum tokenType = rokenRecord.getType();
        if (tokenType == TokenTypeEnum.freeCoupon) {
            type = 10;
@@ -160,21 +157,22 @@
                    .selectByPrimaryKey(Long.parseLong(identify));
            if (giveRecord == null)
                throw new TokenRecordException(1, "赠送记录不存在");
            Date endTime = giveRecord.getEndTime();
            // 用户券信息
            UserSystemCoupon userCoupon = userSystemCouponService.selectByPrimaryKey(giveRecord.getCouponId());
            if (userCoupon == null || userCoupon.getGive() == null || !userCoupon.getGive())
                throw new TokenRecordException(1, "券不存在或非赠送状态");
            if (userCoupon.getState() == UserSystemCoupon.STATE_OVERDUE || (endTime != null && endTime.getTime() < now.getTime())) {
            if (userCoupon.getState() == UserSystemCoupon.STATE_OVERDUE
                    || (endTime != null && endTime.getTime() < now.getTime())) {
                tips.add("哎呀,这张免单券已失效了!");
            } else if (userCoupon.getState() == UserSystemCoupon.STATE_END_USE) {
                tips.add("哎呀,这张免单券已被领取了!");
            } else if (userCoupon.getState() == UserSystemCoupon.STATE_IN_USE) {
                if (uid == null || uid <= 0)
                    throw new TokenRecordException(1001, "温馨提示,[免单券]需要登录后领取");
                state = true;
                UserInfoExtra userInfoExtra = userInfoExtraService.getUserInfoExtra(uid);
                if (userInfoExtra == null || StringUtil.isNullOrEmpty(userInfoExtra.getInviteCode())) {
@@ -196,14 +194,14 @@
                    .selectByPrimaryKey(Long.parseLong(identify));
            if (giveRecord == null)
                throw new TokenRecordException(1, "赠送记录不存在");
            Date endTime = giveRecord.getEndTime();
            UserSystemCoupon userCoupon = userSystemCouponService.selectByPrimaryKey(giveRecord.getCouponId());
            if (userCoupon == null || userCoupon.getGive() == null || !userCoupon.getGive())
                throw new TokenRecordException(1, "券不存在或非赠送状态");
            if (userCoupon.getState() == UserSystemCoupon.STATE_OVERDUE|| (endTime != null && endTime.getTime() < now.getTime())) {
            if (userCoupon.getState() == UserSystemCoupon.STATE_OVERDUE
                    || (endTime != null && endTime.getTime() < now.getTime())) {
                tips.add("哎呀,这张返利奖励券已失效了!");
            } else if (userCoupon.getState() == UserSystemCoupon.STATE_END_USE) {
                tips.add("哎呀,这张返利奖励券已被领取了!");
@@ -225,20 +223,19 @@
                throw new TokenRecordException(1, "口令已失效");
            }
        } else if (tokenType == TokenTypeEnum.redPack) {
            if(!VersionUtil.greaterThan_2_0_5(acceptData.getPlatform(), acceptData.getVersion()))
            if (!VersionUtil.greaterThan_2_0_5(platform, version))
                throw new TokenRecordException(1, "请升级到最新版");
            type = 13;
            RedPackGiveRecord giveRecord = redPackGiveRecordService.selectByPrimaryKey(Long.parseLong(identify));
            if (giveRecord == null)
                throw new TokenRecordException(1, "口令已失效");
            Date endTime = giveRecord.getEndTime();
            // 赠送面额
            money = giveRecord.getAmount().setScale(2).toString();
            if(giveRecord.getState() == UserTaoLiJinGiveRecord.STATE_OVERDUE
            if (giveRecord.getState() == UserTaoLiJinGiveRecord.STATE_OVERDUE
                    || (endTime != null && endTime.getTime() < now.getTime())) {
                tips.add("哎呀,这个红包已失效了!");
            } else if (giveRecord.getState() == UserTaoLiJinGiveRecord.STATE_RECEIVE) {
@@ -283,7 +280,7 @@
        if (nickName.length() > 6) {
            nickName = nickName.substring(0, 6) + "...";
        }
        TokenVO tokenVO = new TokenVO();
        tokenVO.setAmount(num);
        tokenVO.setMoney(money);
@@ -295,8 +292,6 @@
        tokenVO.setType(type);
        return tokenVO;
    }
    @Override
    public String receiveToken(String token, Long uid, AcceptData acceptData) throws TokenRecordException {
@@ -309,11 +304,11 @@
        TokenRecord rokenRecord = tokenRecordMapper.getByToken(token);
        if (rokenRecord == null)
            throw new TokenRecordException(1, "口令已失效");
        Long uidToken = rokenRecord.getUid();
        if (uidToken != null && uid.longValue() == uidToken.longValue())
            throw new TokenRecordException(1, "不能自己赠送给自己");
        Date now = new Date();
        Date endTimeToken = rokenRecord.getEndTime();
        if (endTimeToken != null && endTimeToken.getTime() < now.getTime())
@@ -349,11 +344,11 @@
            if (userCoupon == null || userCoupon.getGive() == null || !userCoupon.getGive()
                    || userCoupon.getState() != UserSystemCoupon.STATE_IN_USE)
                throw new TokenRecordException(1, "该券不存在或非赠送");
            UserSystemCoupon userSystemCoupon= null;
            UserSystemCoupon userSystemCoupon = null;
            try {
                userSystemCoupon = userSystemCouponService.insertUserCoupon(uid, CouponTypeEnum.freeCoupon.name(),
                        UserSystemCoupon.SOURCE_GIVE, null,true);
                        UserSystemCoupon.SOURCE_GIVE, null, true);
            } catch (Exception e) {
                LogHelper.errorDetailInfo(e);
                throw new TokenRecordException(1, "领取失败");
@@ -389,7 +384,7 @@
            userSystemCouponGiveRecordService.updateByPrimaryKeySelective(updateGiveRecord);
            integralGetService.addGiveFreeCoupon(giveUid);
            msg = "领取成功[免单券]成功,请到[我的-福利中心]中查看";
            // 消息 + 队员
            executor.execute(new Runnable() {
@@ -414,10 +409,10 @@
                    msgOther.setGiveTime(sd.format(giveRecord.getGiveTime()));
                    msgOther.setReceiveTime(sd.format(new Date()));
                    userOtherMsgNotificationService.tokenGiveMsg(giveUid, beiZhu, msgOther);
                    // 激活邀请信息
                    if (addTeam)
                        addInviteMsg(uid, giveUid, "免单券");
                        addInviteMsg(uid, giveUid, "免单券");
                }
            });
        } else if (tokenType == TokenTypeEnum.rebatePercentCoupon) {
@@ -439,15 +434,16 @@
            SystemCoupon systemCoupon = userCoupon.getSystemCoupon();
            if (systemCoupon == null)
                throw new TokenRecordException(1, "该券不存在");
            systemCoupon = systemCouponService.selectByPrimaryKey(systemCoupon.getId());
            if (systemCoupon == null)
                throw new TokenRecordException(1, "该券不存在");
            UserSystemCoupon userSystemCoupon= null;
            UserSystemCoupon userSystemCoupon = null;
            try {
                userSystemCoupon = userSystemCouponService.insertUserCoupon(uid, CouponTypeEnum.rebatePercentCoupon.name(),
                        UserSystemCoupon.SOURCE_GIVE, systemCoupon.getPercent(),true);
                userSystemCoupon = userSystemCouponService.insertUserCoupon(uid,
                        CouponTypeEnum.rebatePercentCoupon.name(), UserSystemCoupon.SOURCE_GIVE,
                        systemCoupon.getPercent(), true);
            } catch (Exception e) {
                LogHelper.errorDetailInfo(e);
                throw new TokenRecordException(1, "领取失败");
@@ -483,10 +479,11 @@
            userSystemCouponGiveRecordService.updateByPrimaryKeySelective(updateGiveRecord);
            integralGetService.addGiveRebateCoupon(giveUid);
            msg = "领取成功[返利奖励券]成功,请到[我的-福利中心]中查看";
            // 消息 + 队员
            executor.execute(new Runnable() {
                @Override
                public void run() {
                    SimpleDateFormat sd = new SimpleDateFormat("yyyy.MM.dd HH:mm");
@@ -508,27 +505,28 @@
                    msgOther.setGiveTime(sd.format(giveRecord.getGiveTime()));
                    msgOther.setReceiveTime(sd.format(new Date()));
                    userOtherMsgNotificationService.tokenGiveMsg(giveUid, beiZhu, msgOther);
                    // 激活邀请信息
                    if (addTeam)
                        addInviteMsg(uid, giveUid, "返利奖励券");
                        addInviteMsg(uid, giveUid, "返利奖励券");
                }
            });
        } else if (tokenType == TokenTypeEnum.redPack) {
            if(!VersionUtil.greaterThan_2_0_5(acceptData.getPlatform(), acceptData.getVersion()))
            if (!VersionUtil.greaterThan_2_0_5(acceptData.getPlatform(), acceptData.getVersion()))
                throw new TokenRecordException(1, "请升级到最新版");
            try {
                msg = "领取红包成功,请到[我的-红包]中查看";
                // 领取红包、更新记录
                RedPackGiveRecord giveRecord = redPackGiveRecordService.receiveFriendsGive(uid, Long.parseLong(identify));
                RedPackGiveRecord giveRecord = redPackGiveRecordService.receiveFriendsGive(uid,
                        Long.parseLong(identify));
                // 消息 + 队员
                executor.execute(new Runnable() {
                    @Override
                    public void run() {
                        SimpleDateFormat sd = new SimpleDateFormat("yyyy.MM.dd HH:mm");
                        boolean addTeam = addInviteTeam(uid, giveUid, userInfoExtra);
                        String beiZhu = "无";
                        String giveBeiZhu = "无";
                        if (addTeam) {
@@ -537,7 +535,7 @@
                            // 激活邀请信息
                            addInviteMsg(uid, giveUid, giveRecord.getAmount().setScale(2) + "元红包");
                        }
                        // 领取人消息
                        String giveUserName = "无";
                        UserInfo giveuser = userInfoService.selectByPKey(giveUid);
@@ -548,8 +546,9 @@
                        dto.setUserInfo("昵称:" + giveUserName + " ID:" + giveUid);
                        dto.setTime(sd.format(giveRecord.getGiveTime()));
                        dto.setMoney("¥" + giveRecord.getAmount().setScale(2));
                        userMoneyMsgNotificationService.redPackMsg(uid, MsgTypeMoneyTypeEnum.redPackReceiveOff, new Gson().toJson(dto), beiZhu);
                        userMoneyMsgNotificationService.redPackMsg(uid, MsgTypeMoneyTypeEnum.redPackReceiveOff,
                                new Gson().toJson(dto), beiZhu);
                        // 赠送人消息
                        String userName = "无";
                        UserInfo user = userInfoService.selectByPKey(uid);
@@ -560,7 +559,8 @@
                        givedto.setUserInfo("昵称:" + userName + " ID:" + uid);
                        givedto.setTime(sd.format(new Date()));
                        givedto.setMoney("¥" + giveRecord.getAmount().setScale(2));
                        userMoneyMsgNotificationService.redPackMsg(giveUid, MsgTypeMoneyTypeEnum.redPackGiveOff, new Gson().toJson(givedto), giveBeiZhu);
                        userMoneyMsgNotificationService.redPackMsg(giveUid, MsgTypeMoneyTypeEnum.redPackGiveOff,
                                new Gson().toJson(givedto), giveBeiZhu);
                    }
                });
            } catch (RedPackGiveRecordException e) {
@@ -601,66 +601,63 @@
        }
        return invite;
    }
    private void addInviteMsg(Long uid, Long giveUid, String giftName) {
        try {
            UserInfo user = userInfoService.selectByPKey(giveUid);
            UserInfoExtra userInfoExtra = userInfoExtraService.getUserInfoExtra(uid);
            String inviteCode = null;
            if (!StringUtil.isNullOrEmpty(userInfoExtra.getInviteCodeVip())) {
                inviteCode = userInfoExtra.getInviteCodeVip();
            } else {
                inviteCode = userInfoExtra.getInviteCode();
            }
            MsgInviteContentDTO msgInvite = new MsgInviteContentDTO();
            msgInvite.setTitle("邀请消息");
            msgInvite.setState("成功激活邀请");
            msgInvite.setCode("你的邀请码:" + inviteCode);
            msgInvite.setInviter("昵称:"+user.getNickName());
            msgInvite.setInviter("昵称:" + user.getNickName());
            msgInvite.setMode("成功领取邀请人的" + giftName);
            userInviteMsgNotificationService.receiveGift(uid, "邀请关系一旦确立无法更改 ", msgInvite);
        } catch (Exception e) {
            LogHelper.errorDetailInfo(e);
        }
    }
    @Override
    public List<TokenRecord> overdueList(int count) {
        return tokenRecordMapper.overdueList(count);
    }
    @Override
    public void overdue(List<TokenRecord> list) {
        if (list == null || list.size() == 0)
            return;
        Date date = new Date();
        for (TokenRecord tokenRecord: list) {
        for (TokenRecord tokenRecord : list) {
            tokenRecord.setState(1);
            tokenRecord.setUpdateTime(date);
            tokenRecordMapper.updateByPrimaryKeySelective(tokenRecord);
        }
    }
    @Override
    public void invalidByRedPack(Long id) {
        if (id == null)
            return;
        List<String> list = new ArrayList<String>();
        list.add(TokenTypeEnum.redPack.name());
        tokenRecordMapper.invalidByTypeAndIdentify(list, id.toString());
    }
    @Override
    public void invalidByCoupon(Long id) {
        if (id == null)
            return;
        List<String> list = new ArrayList<String>();
        list.add(TokenTypeEnum.freeCoupon.name());
        list.add(TokenTypeEnum.rebatePercentCoupon.name());
fanli/src/main/java/com/yeshi/fanli/service/impl/user/UserAccountServiceImpl.java
@@ -18,8 +18,6 @@
import com.google.gson.Gson;
import com.qcloud.cos.model.COSObjectSummary;
import com.qcloud.cos.model.ObjectListing;
import com.yeshi.fanli.dao.mybatis.AccountMessageMapper;
import com.yeshi.fanli.dao.mybatis.UserConnectHistoryMapper;
import com.yeshi.fanli.dao.mybatis.UserInfoMapper;
import com.yeshi.fanli.dto.wx.WXAccountInfoDTO;
import com.yeshi.fanli.entity.accept.AcceptData;
@@ -78,13 +76,7 @@
    private BindingAccountService bindingAccountService;
    @Resource
    private UserConnectHistoryMapper userConnectHistoryMapper;
    @Resource
    private ThreeSaleSerivce threeSaleSerivce;
    @Resource
    private AccountMessageMapper accountMessageMapper;
    @Resource
    private SpreadUserImgService spreadUserImgService;
fanli/src/main/java/com/yeshi/fanli/service/impl/user/UserConvertLinkTemplateServiceImpl.java
New file
@@ -0,0 +1,143 @@
package com.yeshi.fanli.service.impl.user;
import java.util.Date;
import java.util.List;
import java.util.UUID;
import javax.annotation.Resource;
import org.springframework.data.mongodb.core.query.Criteria;
import org.springframework.data.mongodb.core.query.Query;
import org.springframework.stereotype.Service;
import com.yeshi.fanli.dao.user.UserConvertLinkTemplateDao;
import com.yeshi.fanli.entity.bus.user.UserConvertLinkTemplate;
import com.yeshi.fanli.service.inter.user.UserConvertLinkTemplateService;
import com.yeshi.fanli.service.inter.user.UserInfoExtraService;
import com.yeshi.fanli.service.inter.user.vip.UserVIPInfoService;
import com.yeshi.fanli.util.StringUtil;
@Service
public class UserConvertLinkTemplateServiceImpl implements UserConvertLinkTemplateService {
    @Resource
    private UserConvertLinkTemplateDao userConvertLinkTemplateDao;
    @Resource
    private UserVIPInfoService userVIPInfoService;
    @Resource
    private UserInfoExtraService userInfoExtraService;
    /**
     *
     * @Title: countByUid
     * @Description: 根据用户ID统计数量
     * @param uid
     * @return
     * long 返回类型
     * @throws
     */
    private long countByUid(Long uid) {
        Query query = new Query();
        query.addCriteria(Criteria.where("uid").is(uid));
        return userConvertLinkTemplateDao.count(query);
    }
    /**
     *
     * @Title: verifyTemplate
     * @Description: 验证模板内容是否正确
     * @param template
     * @param uid
     * @throws Exception
     * void 返回类型
     * @throws
     */
    private void verifyTemplate(String template, Long uid) throws Exception {
        if (StringUtil.isNullOrEmpty(template))
            throw new Exception("模板内容不能为空");
        if (template.length() > 140) {
            throw new Exception("最长为140个字");
        }
        if (template.contains("[邀请码]")) {
            String inviteCode = userInfoExtraService.getInviteCodeByUid(uid);
            if (StringUtil.isNullOrEmpty(inviteCode)) {
                throw new Exception("用户未激活,模板本不能出现[邀请码]");
            }
        }
    }
    @Override
    public List<UserConvertLinkTemplate> listByUid(Long uid) {
        Query query = new Query();
        query.addCriteria(Criteria.where("uid").is(uid).and("createTime").lte(new Date(System.currentTimeMillis()+1000*60*60*24L)));
        List<UserConvertLinkTemplate> templateList = userConvertLinkTemplateDao.findList(query);
        if (templateList != null) {
            String inviteCode = null;
            for (UserConvertLinkTemplate userConvertLinkTemplate : templateList) {
                // 替换邀请码
                if (userConvertLinkTemplate.getTemplate().contains("[邀请码]")) {
                    if (inviteCode == null)
                        inviteCode = userInfoExtraService.getInviteCodeByUid(uid);
                    userConvertLinkTemplate
                            .setContent(userConvertLinkTemplate.getTemplate().replace("[邀请码]", inviteCode));
                }
            }
        }
        return templateList;
    }
    @Override
    public void updateTemplate(UserConvertLinkTemplate template) throws Exception {
        if (template.getId() == null || StringUtil.isNullOrEmpty(template.getTemplate()))
            throw new Exception("参数不完整");
        UserConvertLinkTemplate oldTemplate = userConvertLinkTemplateDao.get(template.getId());
        if (oldTemplate == null)
            throw new Exception("模板不存在");
        verifyTemplate(template.getTemplate(), oldTemplate.getUid());
        oldTemplate.setTemplate(template.getTemplate());
        oldTemplate.setUpdateTime(new Date());
        userConvertLinkTemplateDao.save(oldTemplate);
    }
    @Override
    public void deleteConvertLinkTemplate(String id, Long uid) throws Exception {
        UserConvertLinkTemplate template = userConvertLinkTemplateDao.get(id);
        if (template != null && template.getUid().longValue() != uid)
            throw new Exception("只能删除属于自己的");
        userConvertLinkTemplateDao.delete(id);
    }
    @Override
    public void addConvertLinkTemplate(UserConvertLinkTemplate template) throws Exception {
        if (template.getUid() == null || StringUtil.isNullOrEmpty(template.getTemplate()))
            throw new Exception("参数不完整");
        int maxCount = 5;
        // 判断数量
        long count = countByUid(template.getUid());
        if (count >= maxCount) {
            throw new Exception("数量超限");
        }
        verifyTemplate(template.getTemplate(), template.getUid());
        // 添加模板
        if (template.getCreateTime() == null)
            template.setCreateTime(new Date());
        template.setId(template.getUid() + "-"
                + StringUtil.Md5(UUID.randomUUID().toString() + "#" + System.currentTimeMillis()));
        userConvertLinkTemplateDao.save(template);
    }
}
fanli/src/main/java/com/yeshi/fanli/service/impl/user/UserInfoServiceImpl.java
@@ -36,15 +36,10 @@
import com.yeshi.fanli.exception.user.ThreeSaleException;
import com.yeshi.fanli.exception.user.UserInfoException;
import com.yeshi.fanli.log.LogHelper;
import com.yeshi.fanli.service.inter.config.ConfigService;
import com.yeshi.fanli.service.inter.count.HongBaoV2CountService;
import com.yeshi.fanli.service.inter.money.extract.BindingAccountService;
import com.yeshi.fanli.service.inter.user.ForbiddenUserIdentifyCodeService;
import com.yeshi.fanli.service.inter.user.SpreadUserImgService;
import com.yeshi.fanli.service.inter.user.UserActiveLogService;
import com.yeshi.fanli.service.inter.user.UserInfoModifyRecordService;
import com.yeshi.fanli.service.inter.user.UserInfoService;
import com.yeshi.fanli.service.inter.user.UserRankService;
import com.yeshi.fanli.service.inter.user.invite.ThreeSaleSerivce;
import com.yeshi.fanli.service.inter.user.tb.TaoBaoUnionAuthRecordService;
import com.yeshi.fanli.service.inter.user.tb.UserExtraTaoBaoInfoService;
@@ -63,12 +58,6 @@
    @Resource(name = "taskExecutor")
    private TaskExecutor executor;
    @Resource
    private UserInfoService userInfoService;
    @Resource
    private ConfigService configService;
    @Resource
    private ThreeSaleSerivce threeSaleSerivce;
@@ -94,11 +83,6 @@
    @Resource
    private HongBaoV2CountService hongBaoV2CountService;
    @Resource
    private UserRankService userRankService;
    @Resource
    private UserActiveLogService userActiveLogService;
    @Resource
    private UserExtraTaoBaoInfoService userExtraTaoBaoInfoService;
@@ -108,12 +92,6 @@
    @Resource
    private SpreadUserImgService spreadUserImgService;
    @Resource
    private ForbiddenUserIdentifyCodeService forbiddenUserIdentifyCodeService;
    @Resource
    private BindingAccountService bindingAccountService;
    @Lazy
    @Resource
fanli/src/main/java/com/yeshi/fanli/service/inter/user/TokenRecordService.java
@@ -26,7 +26,7 @@
     * @return
     * @throws TokenRecordException
     */
    public TokenVO discernToken(String token, Long uid, AcceptData acceptData) throws TokenRecordException;
    public TokenVO discernToken(String token, Long uid, String platform,String version) throws TokenRecordException;
    
    /**
fanli/src/main/java/com/yeshi/fanli/service/inter/user/UserConvertLinkTemplateService.java
New file
@@ -0,0 +1,58 @@
package com.yeshi.fanli.service.inter.user;
import java.util.List;
import com.yeshi.fanli.entity.bus.user.UserConvertLinkTemplate;
/**
 * 用户文案转链模板服务
 * @author Administrator
 *
 */
public interface UserConvertLinkTemplateService {
    /**
     *
     * @Title: listByUid
     * @Description: 根据用户ID检索
     * @param uid
     * @return
     * List<UserConvertLinkTemplate> 返回类型
     * @throws
     */
    public List<UserConvertLinkTemplate> listByUid(Long uid);
    /**
     *
     * @Title: updateTemplate
     * @Description: 更新模板
     * @param template
     * void 返回类型
     * @throws
     */
    public void updateTemplate(UserConvertLinkTemplate template) throws Exception;
    /**
     *
     * @Title: deleteConvertLinkTemplate
     * @Description: 删除模板
     * @param id
     * @param uid
     * @throws Exception
     * void 返回类型
     * @throws
     */
    public void deleteConvertLinkTemplate(String id, Long uid) throws Exception;
    /**
     *
     * @Title: addConvertLinkTemplate
     * @Description: 添加模板
     * @param template
     * @throws Exception
     * void 返回类型
     * @throws
     */
    public void addConvertLinkTemplate(UserConvertLinkTemplate template) throws Exception;
}
fanli/src/main/java/com/yeshi/fanli/service/manger/ClipboardAnalysisManager.java
New file
@@ -0,0 +1,463 @@
package com.yeshi.fanli.service.manger;
import java.util.HashSet;
import java.util.List;
import java.util.Map;
import java.util.Set;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
import javax.annotation.Resource;
import org.springframework.stereotype.Component;
import org.yeshi.utils.HttpUtil;
import org.yeshi.utils.NumberUtil;
import com.yeshi.fanli.dto.douyin.DouYinGoods;
import com.yeshi.fanli.dto.pdd.PDDGoodsDetail;
import com.yeshi.fanli.entity.goods.CommonGoods;
import com.yeshi.fanli.entity.jd.JDGoods;
import com.yeshi.fanli.entity.taobao.TaoBaoGoodsBrief;
import com.yeshi.fanli.exception.taobao.TaoBaoTokenParseException;
import com.yeshi.fanli.exception.user.TokenRecordException;
import com.yeshi.fanli.service.inter.user.TokenRecordService;
import com.yeshi.fanli.service.manger.goods.jd.JDGoodsLinkParseManager;
import com.yeshi.fanli.util.DouYinUtil;
import com.yeshi.fanli.util.StringUtil;
import com.yeshi.fanli.util.TokenUtil;
import com.yeshi.fanli.util.Utils;
import com.yeshi.fanli.util.VersionUtil;
import com.yeshi.fanli.util.factory.CommonGoodsFactory;
import com.yeshi.fanli.util.jd.JDApiUtil;
import com.yeshi.fanli.util.jd.JDUtil;
import com.yeshi.fanli.util.pinduoduo.PinDuoDuoApiUtil;
import com.yeshi.fanli.util.pinduoduo.PinDuoDuoUtil;
import com.yeshi.fanli.util.taobao.TaoBaoUtil;
import com.yeshi.fanli.util.taobao.TaoKeApiUtil;
import com.yeshi.fanli.vo.msg.TokenVO;
import com.yeshi.fanli.vo.search.GoodsDocParseResultVO;
import net.sf.json.JSONObject;
/**
 * 粘贴板解析
 * @author Administrator
 *
 */
@Component
public class ClipboardAnalysisManager {
    @Resource
    private JDGoodsLinkParseManager jdGoodsLinkParseManager;
    @Resource
    private TokenRecordService tokenRecordService;
    /**
     * @Title: parseContentType
     * @Description: 解析文本的类型
     * @param text
     * @return
     * Set<ClipboardContentType> 返回类型
     * @throws
     */
    public static Set<ClipboardContentType> parseContentType(String originText) {
        Set<ClipboardContentType> typeSet = new HashSet<>();
        StringBuffer textBuffer = new StringBuffer(originText);
        String text = textBuffer.toString();
        // 自有口令
        String parseToken = TokenUtil.parseToken(text);
        if (!StringUtil.isNullOrEmpty(parseToken)) {
            typeSet.add(ClipboardContentType.systemToken);
            text = text.replace(parseToken, "");
        }
        // 链接
        String URL_REGEX = "(((http|https)://)|(www\\.))[a-zA-Z0-9\\._-]+\\.[a-zA-Z]{2,6}(:[0-9]{1,4})?(/[a-zA-Z0-9\\&%_\\./-~-]*)?";
        Pattern p = Pattern.compile(URL_REGEX);
        Matcher matcher = p.matcher(text);
        while (matcher.find()) {
            String url = matcher.group();
            if (!StringUtil.isNullOrEmpty(url)) {
                typeSet.add(ClipboardContentType.link);
                text = text.replace(url, "");
            }
        }
        // 淘口令
        List<String> taoBaoTokenList = TaoBaoUtil.getTokenListFromText(text);
        if (taoBaoTokenList != null && taoBaoTokenList.size() > 0) {
            typeSet.add(ClipboardContentType.taoBaoToken);
            for (String token : taoBaoTokenList) {
                text = text.replace(token, "");
            }
        }
        // 文本
        if (text != null && text.trim().length() > 0) {
            typeSet.add(ClipboardContentType.text);
        }
        return typeSet;
    }
    /**
     *
     * @Title: parse
     * @Description: 解析
     * @param text
     * @param typeSet
     * void 返回类型
     * @throws
     */
    public void parse(String platform, String version, String text, Long uid, IClipboardAnalysisResult resultListener) {
        if (text == null)
            return;
        text = text.trim();
        Set<ClipboardContentType> typeSet = parseContentType(text);
        // 系统口令
        if (typeSet.contains(ClipboardContentType.systemToken)) {
            try {
                TokenVO tokenVO = tokenRecordService.discernToken(text, uid, platform, version);
                resultListener.onResult(tokenVO);
            } catch (TokenRecordException e) {
                if (e.getCode() == 1001) { // 需要用户登录
                    resultListener.needLogin(e.getMsg());
                } else {
                    resultListener.none();
                }
            }
            return;
        }
        // 只有链接 淘宝链接/京东链接/拼多多链接
        if (typeSet.size() == 1) {
            if (typeSet.contains(ClipboardContentType.link)) {// 纯链接
                // 解析商品
                CommonGoods goods = parseLink(text);
                if (goods == null) {
                    resultListener.none();
                } else {
                    resultListener.onResult(goods);
                }
            } else if (typeSet.contains(ClipboardContentType.taoBaoToken)) {// 纯淘口令
                try {
                    CommonGoods commonGoods = parseTaoBaoToken(text);
                    if (commonGoods != null)
                        resultListener.onResult(commonGoods);
                    else
                        resultListener.onResult(text);
                } catch (TaoBaoTokenParseException e1) {
                    resultListener.onResult(text);
                }
            } else {// 纯文本
                // 文本推荐
                if (text.length() > 256)
                    resultListener.none();
                else
                    resultListener.onResult(text);
            }
        } else if (typeSet.size() == 2) {
            List<String> urlList = HttpUtil.getUrlListFromText(text);
            List<String> tokenList = TaoBaoUtil.getTokenListFromText(text);
            String link = null;
            String token = null;
            if (typeSet.contains(ClipboardContentType.link) && typeSet.contains(ClipboardContentType.taoBaoToken)) {// 链接+口令
                if (text.indexOf(urlList.get(0)) < text.indexOf(tokenList.get(0)))// 第一个链接在第一个口令前面
                    link = urlList.get(0);
                else// 第一个口令在第一个链接前面
                    token = tokenList.get(0);
            } else if (typeSet.contains(ClipboardContentType.link) && typeSet.contains(ClipboardContentType.text)) {// 链接+文本
                link = urlList.get(0);
            } else {// 口令+文本
                token = tokenList.get(0);
            }
            if (!StringUtil.isNullOrEmpty(link)) {
                CommonGoods goods = parseLink(urlList.get(0));
                if (goods == null || goods.getGoodsId() == null) {
                    resultListener.onResult(new GoodsDocParseResultVO(text, urlList.get(0)));
                } else {
                    if (VersionUtil.greaterThan_2_0_7(platform, version)) {
                        resultListener.onResult(new GoodsDocParseResultVO(text, goods));
                    } else {
                        resultListener.onResult(goods);
                    }
                }
            } else {
                CommonGoods goods = null;
                try {
                    goods = parseTaoBaoToken(token);
                } catch (TaoBaoTokenParseException e) {
                    resultListener.onResult(new GoodsDocParseResultVO(text));
                    return;
                }
                if (goods != null && goods.getGoodsId() != null) {
                    resultListener.onResult(new GoodsDocParseResultVO(text, goods));
                } else {
                    resultListener.onResult(new GoodsDocParseResultVO(text));
                }
            }
        } else if (typeSet.size() == 3) {// 口令+链接+文本
            List<String> tokenList = TaoBaoUtil.getTokenListFromText(text);
            List<String> urlList = HttpUtil.getUrlListFromText(text);
            if (text.startsWith("【") && tokenList != null && tokenList.size() == 1 && urlList != null
                    && urlList.size() == 1) {// Android淘宝链接复制
                CommonGoods goods = null;
                try {
                    goods = parseTaoBaoToken(tokenList.get(0));
                } catch (TaoBaoTokenParseException e1) {
                    e1.printStackTrace();
                }
                if (goods == null) {
                    if (text.trim().indexOf("【") == 0 && text.trim().indexOf("】") > 0) {
                        // 截取标题
                        String title = text.trim().substring(1, text.trim().lastIndexOf("】"));
                        goods = new CommonGoods();
                        goods.setTitle(title);
                        goods.setPicture("http://");
                    }
                }
                if (goods != null) {
                    resultListener.onResult(goods);
                }
            } else {// 文案
                String link = null;
                String token = null;
                if (text.indexOf(urlList.get(0)) < text.indexOf(tokenList.get(0)))// 第一个链接在第一个口令前面
                    link = urlList.get(0);
                else// 第一个口令在第一个链接前面
                    token = tokenList.get(0);
                if (!StringUtil.isNullOrEmpty(link)) {
                    CommonGoods goods = parseLink(urlList.get(0));
                    if (goods == null || goods.getGoodsId() == null) {
                        resultListener.onResult(new GoodsDocParseResultVO(text, urlList.get(0)));
                    } else {
                        resultListener.onResult(new GoodsDocParseResultVO(text, goods));
                    }
                } else {
                    CommonGoods goods = null;
                    try {
                        goods = parseTaoBaoToken(token);
                        if (goods != null && goods.getGoodsId() != null) {
                            resultListener.onResult(new GoodsDocParseResultVO(text, goods));
                        } else {
                            resultListener.onResult(new GoodsDocParseResultVO(text));
                        }
                    } catch (TaoBaoTokenParseException e) {
                        resultListener.onResult(new GoodsDocParseResultVO(text));
                    }
                }
            }
            return;
        }
    }
    /**
     *
     * @Title: parseLink
     * @Description: 解析单链接
     * @param link
     * @return
     * CommonGoods 返回类型
     * @throws
     */
    public CommonGoods parseLink(String link) {
        TaoBaoGoodsBrief tb = null;
        if (link.startsWith("https://a.m.taobao.com/i"))// 淘宝账号未登录状态
        {
            link = link.substring("https://a.m.taobao.com/i".length(), link.indexOf(".htm"));
            if (NumberUtil.isNumeric(link)) {
                tb = TaoBaoUtil.isAlimama(link);
            }
        } else if (link.contains("ju.taobao.com") || link.contains(".juhuasuan.com")) {// 聚划算
            int index = link.indexOf("item_id");
            if (index >= 0) {
                link = link.substring(index);
                int last = link.indexOf("&");
                String id = "";
                if (last > 0)
                    id = link.substring(link.indexOf("=") + 1, link.indexOf("&"));
                else {
                    id = link.substring(link.indexOf("=" + 1));
                }
                tb = TaoBaoUtil.isAlimama(id);
                if (tb == null) {
                    tb = new TaoBaoGoodsBrief(Long.parseLong(id));
                }
            }
        } else if (link.contains("http://zmnxbc.com")) { // 手机端天猫APP分享
            tb = TaoBaoUtil.parsePhoneShareUrlByTM(link);
        } else if (link.contains("h5.m.taobao") || link.contains("detail.m.tmall") || link.contains("item.taobao")
                || link.contains("detail.tmall")) { // 手机页面和电脑页面
            Map<String, String> map = Utils.parseURL(link);
            String id = "";
            id = map.get("id").replace("}", "");
            tb = TaoBaoUtil.isAlimama(id);
            if (tb == null) {
                tb = new TaoBaoGoodsBrief(Long.parseLong(id));
            }
        } else if (link.contains("v.douyin.com")) { // 抖音
            tb = analysisDouYin(link);
            if (tb != null) {
                if (!StringUtil.isNullOrEmpty(tb.getAuctionUrl())) {// 抖音解析到淘宝商品链接
                    return parseLink(tb.getAuctionUrl());
                }
            }
        } else {
            tb = TaoBaoUtil.parsePhoneShareUrlByTB(link);
        }
        // 没解析到淘宝相关商品
        if (tb == null) {
            String goodsId = TaoBaoUtil.getGoodsIdByPhoneShareUrl(link);
            if (!StringUtil.isNullOrEmpty(goodsId)) {
                tb = TaoBaoUtil.isAlimama(goodsId);
                if (tb == null) {
                    tb = new TaoBaoGoodsBrief(Long.parseLong(goodsId));
                }
            }
        }
        CommonGoods commonGoods = null;
        // 淘宝商品解析结束
        if (tb != null) {
            if (StringUtil.isNullOrEmpty(tb.getTitle())) {
                tb = TaoBaoUtil.getTaoBaoGoodsBriefNotInPub(tb.getId());
                if (tb != null) {
                    commonGoods = new CommonGoods();
                    commonGoods.setPicture(tb.getPictUrl());
                    commonGoods.setTitle(tb.getTitle());
                }
            } else {
                commonGoods = CommonGoodsFactory.create(tb);
            }
        } else {
            // 解析其他商品
            String jdId = JDUtil.getJDGoodsId(link);
            // 微信链接
            if (StringUtil.isNullOrEmpty(jdId)) {
                jdId = JDUtil.getJDGoodsIdByWeiXin(link);
            }
            // 领券短连接
            if (StringUtil.isNullOrEmpty(jdId) && link.contains("u.jd.com")) {
                jdId = jdGoodsLinkParseManager.parseGoodsIdByJDShortUrl(link);
            }
            if (!StringUtil.isNullOrEmpty(jdId)) {
                JDGoods goods = JDApiUtil.getGoodsDetail(Long.parseLong(jdId));
                if (goods != null) {
                    // 高级接口 -- 信息更完整
                    JDGoods jdGoods = JDApiUtil.queryGoodsDetail(Long.parseLong(jdId));
                    if (jdGoods != null) {
                        commonGoods = CommonGoodsFactory.create(jdGoods);
                    } else {
                        commonGoods = CommonGoodsFactory.create(goods);
                    }
                } else {
                    goods = JDUtil.getSimpleGoodsInfo(jdId);
                    if (goods != null) {
                        commonGoods = new CommonGoods();
                        commonGoods.setTitle(goods.getSkuName());
                        commonGoods.setPicture(goods.getPicUrl());
                    }
                }
            } else {
                String pddId = PinDuoDuoUtil.getPDDGoodsId(link);
                if (!StringUtil.isNullOrEmpty(pddId)) {
                    PDDGoodsDetail goods = PinDuoDuoApiUtil.getGoodsDetail(Long.parseLong(pddId));
                    if (goods != null) {
                        commonGoods = CommonGoodsFactory.create(goods);
                    } else {
                        goods = PinDuoDuoUtil.getPDDGoodsInfo(pddId);
                        if (goods != null) {
                            commonGoods = new CommonGoods();
                            commonGoods.setTitle(goods.getGoodsName());
                            commonGoods.setPicture(goods.getGoodsThumbnailUrl());
                        }
                    }
                }
            }
        }
        return commonGoods;
    }
    private CommonGoods parseTaoBaoToken(String token) throws TaoBaoTokenParseException {
        Long auctionId = TaoKeApiUtil.tokenConvertAuctionId(token);
        if (auctionId != null) {//
            TaoBaoGoodsBrief goods = TaoBaoUtil.isAlimama(auctionId + "");
            if (goods == null) {
                goods = TaoBaoUtil.getTaoBaoGoodsBriefNotInPub(auctionId);
            }
            if (goods != null) {
                CommonGoods commonGoods = CommonGoodsFactory.create(goods);
                return commonGoods;
            } else
                return null;
        } else {
            return null;
        }
    }
    /**
     *
     * @Title: analysisDouYin
     * @Description: 抖音解析
     * @param link
     * @return
     * CommonGoods 返回类型
     * @throws
     */
    private TaoBaoGoodsBrief analysisDouYin(String link) {
        String location = HttpUtil.getLocation(link);
        if (!StringUtil.isNullOrEmpty(location)) {
            if (location.contains("taobao.com")) { // 淘宝商品
                String realUrl = TaoBaoUtil.getRealUrl(location);
                if (!StringUtil.isNullOrEmpty(realUrl)) {
                    TaoBaoGoodsBrief goods = new TaoBaoGoodsBrief();
                    goods.setAuctionUrl(realUrl);
                    return goods;
                }
            } else if (location.contains("haohuo.jinritemai.com")) { // 抖音商品
                DouYinGoods goods = DouYinUtil.getGoodsInfo(location);
                JSONObject goodsJSON = new JSONObject();
                goodsJSON.put("title", goods.getName());
                goodsJSON.put("pictUrl", goods.getImg());
                TaoBaoGoodsBrief commonGoods = new TaoBaoGoodsBrief();
                commonGoods.setPictUrl(goods.getImg());
                commonGoods.setTitle(goods.getName());
                return commonGoods;
            }
        }
        return null;
    }
}
/**
 * 粘贴板解析结果
 * @author Administrator
 *
 */
fanli/src/main/java/com/yeshi/fanli/service/manger/ClipboardContentType.java
New file
@@ -0,0 +1,21 @@
package com.yeshi.fanli.service.manger;
/**
 * 粘贴板的内容类型
 * @author Administrator
 *
 */
public enum ClipboardContentType {
    systemToken("自有口令"), text("文本"), link("链接"), taoBaoToken("淘口令");
    private String desc;
    private ClipboardContentType(String desc) {
        this.desc = desc;
    }
    public String getDesc() {
        return desc;
    }
}
fanli/src/main/java/com/yeshi/fanli/service/manger/IClipboardAnalysisResult.java
New file
@@ -0,0 +1,30 @@
package com.yeshi.fanli.service.manger;
import com.yeshi.fanli.entity.goods.CommonGoods;
import com.yeshi.fanli.vo.msg.TokenVO;
import com.yeshi.fanli.vo.search.GoodsDocParseResultVO;
/**
 * 粘贴板解析接口
 * @author Administrator
 *
 */
public interface IClipboardAnalysisResult {
    // 系统口令解析结果
    public void onResult(TokenVO tokenVO);
    // 商品解析结果
    public void onResult(CommonGoods goods);
    // 标题解析结果
    public void onResult(String result);
    // 文案解析结果
    public void onResult(GoodsDocParseResultVO result);
    // 需要登录
    public void needLogin(String msg);
    // 无结果
    public void none();
}
fanli/src/main/java/com/yeshi/fanli/service/manger/goods/ConvertLinkManager.java
@@ -15,6 +15,8 @@
import com.yeshi.fanli.entity.taobao.TaoKeAppInfo;
import com.yeshi.fanli.service.inter.taobao.TaoBaoBuyRelationMapService;
import com.yeshi.fanli.service.inter.user.tb.UserExtraTaoBaoInfoService;
import com.yeshi.fanli.util.RedisKeyEnum;
import com.yeshi.fanli.util.RedisManager;
import com.yeshi.fanli.util.TaoBaoConstant;
import com.yeshi.fanli.util.jd.JDApiUtil;
import com.yeshi.fanli.util.jd.JDUtil;
@@ -35,6 +37,9 @@
    @Resource
    private TaoBaoBuyRelationMapService taoBaoBuyRelationMapService;
    @Resource
    private RedisManager redisManager;
    /**
     * 
@@ -201,4 +206,28 @@
        return newText;
    }
    /**
     * 创建口令
     * @Title: createTaoBaoToken
     * @Description:
     * @param uid 用户ID
     * @param picturl
     * @param title
     * @param link
     * @return
     * String 返回类型
     * @throws
     */
    public String createTaoBaoToken(Long uid, String picturl, String title, String link) {
        String token = TaoKeApiUtil.getTKToken(picturl, title, link);
        if (!StringUtil.isNullOrEmpty(token)) {
            // 缓存30分钟
            redisManager.cacheCommonString(
                    RedisKeyEnum.getRedisKey(RedisKeyEnum.taobaoUserTKToken, uid + "-" + StringUtil.Md5(token)), "1",
                    60 * 30);
        }
        return token;
    }
}
fanli/src/main/java/com/yeshi/fanli/util/RedisKeyEnum.java
@@ -1,7 +1,5 @@
package com.yeshi.fanli.util;
import com.yeshi.fanli.dao.user.DeviceSexDao;
public enum RedisKeyEnum {
    emptyKey("", "空值-key外部空值"),
    SMS("sms-", "短信"),
@@ -22,6 +20,7 @@
    taobaoTokenCommon("taobao-common-token-", "淘宝口令"),
    taobaoTokenTLJ("taobao-tlj-token-", "淘礼金的口令"),
    taobaoCoupleXCX("taobao-couple-xcx-", "淘宝券"),
    taobaoUserTKToken("taobao-user-token-","用户的淘口令"),
    taobaoCachecoupon("cachecoupon-", "淘宝券商品列表"),
    taobaolinkParse("linkParse-", "获取淘宝推广链接"),
    taobaoUpdate("tb-u-", "淘宝商品更新"),
@@ -56,7 +55,12 @@
    PDDOrder("pdd-order-", "拼多多订单"),
    hongBaoFanLi("hongbao-fanli-", "红包返利"),
    
    deviceSex(" device_sex-", "设备性别版本");
    deviceSex("device_sex-", "设备性别版本"),
    convertLinkDocTemp("convert-link-doc-temp-","转链文本暂存"),
    convertLinkDocResultTemp("convert-link-doc-result-temp-","转链文本结果暂存")
    ;
    private final String key;
    private final String desc;
fanli/src/main/java/com/yeshi/fanli/util/StringUtil.java
@@ -318,22 +318,4 @@
        return str;
    }
    /**
     * 淘口令提取
     *
     * @param str
     * @return
     */
    public static String picUpTaoToken(String str) {
        String pattern = "(₳{1}[A-Za-z0-9]+₳{1})|(¥{1}[A-Za-z0-9]+¥{1})|(¥{1}[A-Za-z0-9]+¥{1})";
        Pattern r = Pattern.compile(pattern);
        Matcher m = r.matcher(str);
        while (m.find()) {
            String group = m.group(0);
            if (!StringUtil.isNullOrEmpty(group))
                return group;
        }
        return null;
    }
}
fanli/src/main/java/com/yeshi/fanli/util/VersionUtil.java
@@ -89,6 +89,14 @@
        else
            return false;
    }
    public static boolean greaterThan_2_0_7(String platform, String versionCode) {
        if ((("android".equalsIgnoreCase(platform) && Integer.parseInt(versionCode) >= 55))
                || (("ios".equalsIgnoreCase(platform) && Integer.parseInt(versionCode) >= 77)))
            return true;
        else
            return false;
    }
    public static boolean smallerThan_1_5_1(String platform, String versionCode) {
        if ((("android".equalsIgnoreCase(platform) && Integer.parseInt(versionCode) < 36))
fanli/src/main/java/com/yeshi/fanli/util/factory/goods/GoodsDetailVOFactory.java
@@ -250,6 +250,7 @@
        goodsInfo.setState(goods.getState() == null ? 0 : goods.getState());
        goodsInfo.setSalesCount(goods.getSalesCount());
        goodsInfo.setPicUrl(goods.getPictUrl());
        goodsInfo.setDescription(goods.getDescription());
        Integer shopType = goods.getUserType();
        if (shopType != null && shopType == 1) {
@@ -357,6 +358,7 @@
        goodsInfo.setTitle(goods.getTitle());
        goodsInfo.setSalesType(1); // 默认月销量
        goodsInfo.setZkPrice(goods.getZkPrice());
        goodsInfo.setDescription(goods.getDescription());
        String provcity = goods.getProvcity();
        if (!StringUtil.isNullOrEmpty(provcity)) {
fanli/src/main/java/com/yeshi/fanli/util/taobao/TaoBaoOrderUtil.java
@@ -101,14 +101,14 @@
            String as = gm.getResponseBodyAsString();
            JSONObject root = JSONObject.fromObject(as);
            if (root.optInt("code") == 0) {// 上报成功
                LogHelper.cookieLog("上报成功!");
                LogHelper.error("上报成功!");
                return;
            }
            LogHelper.cookieLog("上报失败!");
            LogHelper.error("上报失败!");
        } catch (Exception e) {
            e.printStackTrace();
            LogHelper.cookieLog("上报失败!");
            LogHelper.error("上报失败!");
        }
    }
@@ -121,7 +121,7 @@
    public static List<TaoBaoOrder> getOrderList(int day, TaoBaoUnionConfig config) {
        String cookie1 = getTaoBaoCookie(config.getAccount());
        LogHelper.cookieLog("账号为:" + config.getAccount() + ",cookie为:" + cookie1);
        LogHelper.error("账号为:" + config.getAccount() + ",cookie为:" + cookie1);
        String[] cookies = new String[] { cookie1 };
        List<TaoBaoOrder> list = new ArrayList<TaoBaoOrder>();
@@ -195,7 +195,7 @@
    private static List<TaoBaoOrder> downLoadOrderFromTaoBao(String url, TaoBaoUnionConfig config)
            throws TaoBaoOrderException {
        String cookie1 = getTaoBaoCookie(config.getAccount());
        LogHelper.cookieLog("账号为:" + config.getAccount() + ",cookie为:" + cookie1);
        LogHelper.error("账号为:" + config.getAccount() + ",cookie为:" + cookie1);
        String[] cookies = new String[] { cookie1 };
        List<TaoBaoOrder> list = new ArrayList<TaoBaoOrder>();
        int i = 0;
fanli/src/main/java/com/yeshi/fanli/util/taobao/TaoBaoUtil.java
@@ -6,6 +6,7 @@
import java.net.URLDecoder;
import java.net.URLEncoder;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
@@ -25,6 +26,7 @@
import org.apache.commons.httpclient.MultiThreadedHttpConnectionManager;
import org.apache.commons.httpclient.methods.GetMethod;
import org.apache.commons.httpclient.params.HttpMethodParams;
import org.hibernate.cache.spi.NaturalIdCacheKey;
import org.jsoup.Connection;
import org.jsoup.Jsoup;
import org.jsoup.nodes.Document;
@@ -1073,23 +1075,18 @@
        return tg;
    }
    public static TaoBaoGoodsBrief getTaoBaoGoodsBrief(String id) {
        Map<String, String> params = new HashMap<String, String>();
        params.put("q", String.format("http://item.taobao.com/item.htm?id=%s", id));
        params.put("_t", System.currentTimeMillis() + "");
        params.put("auctionTag", "");
        params.put("perPageSize", 40 + "");
        params.put("t", System.currentTimeMillis() + "");
        String result = TaoBaoHttpUtil.get(SEARCH_URL, params);
        result = result.replace("</span>", "").replace("<span class=H>", "");
        TaoBaoSearchResult presult = parseTaoBao(result);
        if (presult != null && presult.getTaoBaoGoodsBriefs().size() > 0) {
            // TaoBaoGoodsBrief taoBaoGoodsBrief =
            // presult.getTaoBaoGoodsBriefs().get(0);
            return presult.getTaoBaoGoodsBriefs().get(0);
        } else
            return null;
    /**
     * 获取未参与推广的淘宝商品详情
     * @Title: getTaoBaoGoodsBrief
     * @Description:
     * @param id
     * @return
     * TaoBaoGoodsBrief 包含(标题与图片)
     * @throws
     */
    public static TaoBaoGoodsBrief getTaoBaoGoodsBriefNotInPub(Long id) {
        TaoBaoGoodsBrief tb = TaoBaoUtil.getTmallGoodsInfo(id+"");
        return tb;
    }
    public static List<String> getSuguestSearch(String key) {
@@ -2137,7 +2134,17 @@
     * @throws
     */
    public static List<String> getTokenListFromText(String str) {
        String pattern = "(₳{1}[A-Za-z0-9]+₳{1})|(¥{1}[A-Za-z0-9]+¥{1})|(¥{1}[A-Za-z0-9]+¥{1})|(€{1}[A-Za-z0-9]+€{1})";
        String[] marks = new String[] { "₳", "¥", "¥", "€", "\\$", "₴", "¢", "₤" };
        return getTokenListFromText(str, Arrays.asList(marks));
    }
    public static List<String> getTokenListFromText(String str, List<String> markList) {
        List<String> expressList = new ArrayList<>();
        for (String st : markList) {
            expressList.add(String.format("(%s{1}[A-Za-z0-9]{11,13}+%s{1})", st, st));
        }
        String pattern = StringUtil.concat(expressList, "|");
        Pattern r = Pattern.compile(pattern);
        Matcher m = r.matcher(str);
        List<String> urlList = new ArrayList<>();
fanli/src/main/java/com/yeshi/fanli/util/taobao/TaoKeApiUtil.java
@@ -22,6 +22,7 @@
import com.yeshi.fanli.entity.taobao.TaoBaoShopInfo;
import com.yeshi.fanli.entity.taobao.TaoKeAppInfo;
import com.yeshi.fanli.exception.taobao.TaoBaoAuthException;
import com.yeshi.fanli.exception.taobao.TaoBaoTokenParseException;
import com.yeshi.fanli.exception.taobao.TaoKeApiException;
import com.yeshi.fanli.exception.taobao.TaobaoGoodsDownException;
import com.yeshi.fanli.exception.tlj.TaoLiJinCreateException;
@@ -914,6 +915,9 @@
        if (!StringUtil.isNullOrEmpty(item.optString("reserve_price")))
            goods.setReservePrice(new BigDecimal(item.optString("reserve_price")));
        goods.setTotalFee(new BigDecimal("0"));
        // 推荐语
        goods.setDescription(item.optString("item_description"));
        goods = loadYuShouInfo(goods, item);
        return goods;
    }
@@ -1343,23 +1347,27 @@
     * @param idfa
     * @return
     */
    public static TaoBaoSearchResult guessDeviceLike(int page, int pageSize, String imei, String idfa) {
    public static TaoBaoSearchResult guessDeviceLike(int page, int pageSize, String imei, String idfa, String utdid) {
        List<TaoBaoGoodsBrief> goodsList = new ArrayList<>();
        Map<String, String> map = new HashMap<>();
        map.put("method", "taobao.tbk.dg.optimus.material");
        map.put("page_no", page + "");
        map.put("page_size", pageSize + "");
        map.put("material_id", "6708");
        if (StringUtil.isNullOrEmpty(imei) && StringUtil.isNullOrEmpty(idfa))
        if (StringUtil.isNullOrEmpty(imei) && StringUtil.isNullOrEmpty(idfa) && StringUtil.isNullOrEmpty(utdid))
            return null;
        map.put("device_encrypt", "MD5");
        if (!StringUtil.isNullOrEmpty(imei)) {
            map.put("device_encrypt", "MD5");
            map.put("device_value", StringUtil.Md5(imei));
            map.put("device_type", "IMEI");
        } else {
        } else if (!StringUtil.isNullOrEmpty(idfa)) {
            map.put("device_encrypt", "MD5");
            map.put("device_value", StringUtil.Md5(idfa));
            map.put("device_type", "IDFA");
        } else if (!StringUtil.isNullOrEmpty(utdid)) {
            map.put("device_value", utdid);
            map.put("device_type", "UTDID");
        }
        JSONObject resultJSON = null;
@@ -1851,7 +1859,7 @@
     * @param token
     * @return
     */
    public static Long tokenConvertAuctionId(String token) {
    public static Long tokenConvertAuctionId(String token) throws TaoBaoTokenParseException {
        Map<String, String> map = new HashMap<>();
        map.put("method", "taobao.tbk.tpwd.convert");
        map.put("password_content", token);
@@ -1861,14 +1869,24 @@
        app.setAppSecret(TaoBaoConstant.TAOBAO_AUTH_APPSECRET);
        try {
            JSONObject json = TaoKeBaseUtil.baseRequest(map, app);
            try {
                return json.optJSONObject("tbk_tpwd_convert_response").optJSONObject("data").optLong("num_iid");
            } catch (Exception e) {
                return null;
            }
        } catch (TaoKeApiException e) {
            e.printStackTrace();
            JSONObject msg = null;
            try {
                msg = JSONObject.fromObject(e.getMsg());
            } catch (Exception e2) {
            }
            if (msg != null && msg.optJSONObject("error_response") != null) {
                throw new TaoBaoTokenParseException(msg.optJSONObject("error_response").optInt("sub_code"),
                        msg.optJSONObject("error_response").optString("sub_msg"));
            }
        }
        return null;
    }
@@ -2051,7 +2069,7 @@
        return null;
    }
    public static List<TaoBaoGoodsBrief> guessLikeByAuctionId(Long auctionId,int count) {
    public static List<TaoBaoGoodsBrief> guessLikeByAuctionId(Long auctionId, int count) {
        Map<String, String> map = new HashMap<>();
        map.put("method", "taobao.tbk.dg.optimus.material");
        map.put("item_id", auctionId + "");
fanli/src/main/java/com/yeshi/fanli/vo/common/JumpDetailContentVO.java
New file
@@ -0,0 +1,31 @@
package com.yeshi.fanli.vo.common;
import com.google.gson.annotations.Expose;
import com.yeshi.fanli.entity.common.JumpDetailV2;
import net.sf.json.JSONObject;
public class JumpDetailContentVO {
    @Expose
    private JumpDetailV2 jumpDetail;
    @Expose
    private JSONObject params;
    public JumpDetailV2 getJumpDetail() {
        return jumpDetail;
    }
    public void setJumpDetail(JumpDetailV2 jumpDetail) {
        this.jumpDetail = jumpDetail;
    }
    public JSONObject getParams() {
        return params;
    }
    public void setParams(JSONObject params) {
        this.params = params;
    }
}
fanli/src/main/java/com/yeshi/fanli/vo/goods/GoodsDetailVO.java
@@ -72,6 +72,16 @@
    private boolean baoyou; // 是否包邮
    @Expose
    private String provcity; // 商品所在地
    @Expose
    private String description;//推荐语
    public String getDescription() {
        return description;
    }
    public void setDescription(String description) {
        this.description = description;
    }
    public Long getGoodsId() {
        return goodsId;
fanli/src/main/java/com/yeshi/fanli/vo/goods/ShareGoodsCommentChoiceInfo.java
New file
@@ -0,0 +1,81 @@
package com.yeshi.fanli.vo.goods;
import com.google.gson.annotations.Expose;
/**
 * 分享商品的评论文本选择信息
 * @author Administrator
 *
 */
public class ShareGoodsCommentChoiceInfo {
    public final static int TYPE_TOKEN = 1;// 口令
    public final static int TYPE_LINK = 2;// 购买链接
    public final static int TYPE_INVITE_CODE = 3;// 邀请码
    public final static int TYPE_DOWNLOAD_LINK = 4;// 下载链接
    public final static int TYPE_FANLI_MONEY = 5;// 返利金额
    @Expose
    private int type;// 类型
    @Expose
    private String name;// 名称
    @Expose
    private String content;// 内容
    @Expose
    private boolean selected;// 是否选中
    @Expose
    private boolean canCancel;// 是否可取消
    public boolean isCanCancel() {
        return canCancel;
    }
    public void setCanCancel(boolean canCancel) {
        this.canCancel = canCancel;
    }
    public ShareGoodsCommentChoiceInfo() {
    }
    public ShareGoodsCommentChoiceInfo(int type, String name, String content, boolean selected, boolean canCancel) {
        this.type = type;
        this.name = name;
        this.content = content;
        this.selected = selected;
        this.canCancel = canCancel;
    }
    public boolean isSelected() {
        return selected;
    }
    public void setSelected(boolean selected) {
        this.selected = selected;
    }
    public int getType() {
        return type;
    }
    public void setType(int type) {
        this.type = type;
    }
    public String getName() {
        return name;
    }
    public void setName(String name) {
        this.name = name;
    }
    public String getContent() {
        return content;
    }
    public void setContent(String content) {
        this.content = content;
    }
}
fanli/src/main/java/com/yeshi/fanli/vo/goods/ShareInfoVO.java
@@ -76,10 +76,45 @@
    @Expose
    private String wxErCode;// 微信二维码内容
    @Expose
    private GoodsDetailVO goodsInfo;
    // 评论文本
    @Expose
    private String commentText;
    // 评论文本选择项
    @Expose
    private List<ShareGoodsCommentChoiceInfo> commentTextChoiceList;
    // 推荐语
    @Expose
    private String recommendText;
    public List<ShareGoodsCommentChoiceInfo> getCommentTextChoiceList() {
        return commentTextChoiceList;
    }
    public void setCommentTextChoiceList(List<ShareGoodsCommentChoiceInfo> commentTextChoiceList) {
        this.commentTextChoiceList = commentTextChoiceList;
    }
    public String getCommentText() {
        return commentText;
    }
    public void setCommentText(String commentText) {
        this.commentText = commentText;
    }
    public String getRecommendText() {
        return recommendText;
    }
    public void setRecommendText(String recommendText) {
        this.recommendText = recommendText;
    }
    public GoodsDetailVO getGoodsInfo() {
        return goodsInfo;
    }
fanli/src/main/java/com/yeshi/fanli/vo/search/GoodsDocParseResultVO.java
New file
@@ -0,0 +1,47 @@
package com.yeshi.fanli.vo.search;
import com.yeshi.fanli.entity.goods.CommonGoods;
//商品文案解析结果
public class GoodsDocParseResultVO {
    private String sourceDoc;// 原始文案
    private CommonGoods firstGoods;// 第一个商品
    private String firstLink;// 第一个链接
    public GoodsDocParseResultVO(String sourceDoc, CommonGoods firstGoods) {
        this.sourceDoc = sourceDoc;
        this.firstGoods = firstGoods;
    }
    public GoodsDocParseResultVO(String sourceDoc, String firstLink) {
        this.sourceDoc = sourceDoc;
        this.firstLink = firstLink;
    }
    public GoodsDocParseResultVO(String sourceDoc) {
    }
    public String getSourceDoc() {
        return sourceDoc;
    }
    public void setSourceDoc(String sourceDoc) {
        this.sourceDoc = sourceDoc;
    }
    public CommonGoods getFirstGoods() {
        return firstGoods;
    }
    public void setFirstGoods(CommonGoods firstGoods) {
        this.firstGoods = firstGoods;
    }
    public String getFirstLink() {
        return firstLink;
    }
    public void setFirstLink(String firstLink) {
        this.firstLink = firstLink;
    }
}
utils/src/main/java/org/yeshi/utils/HttpUtil.java
@@ -10,8 +10,12 @@
import java.net.URL;
import java.net.URLEncoder;
import java.security.KeyStore;
import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;
import java.util.Map;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
import javax.net.ssl.SSLContext;
@@ -47,6 +51,21 @@
import net.sf.json.JSONObject;
public class HttpUtil {
    public static List<String> getUrlListFromText(String text) {
        List<String> urlList = new ArrayList<String>();
        // 链接
        String URL_REGEX = "(((http|https)://)|(www\\.))[a-zA-Z0-9\\._-]+\\.[a-zA-Z]{2,6}(:[0-9]{1,4})?(/[a-zA-Z0-9\\&%_\\./-~-]*)?";
        Pattern p = Pattern.compile(URL_REGEX);
        Matcher matcher = p.matcher(text);
        while (matcher.find()) {
            String url = matcher.group();
            if (!StringUtil.isNullOrEmpty(url)) {
                urlList.add(url);
            }
        }
        return urlList;
    }
    public static String getHost(String host) {
        try {
@@ -473,13 +492,13 @@
        }
        return "";
    }
    @SuppressWarnings("deprecation")
    public static String post(String url, String entity,String charset) {
    public static String post(String url, String entity, String charset) {
        HttpClient client = new HttpClient();
        PostMethod method = new PostMethod(url);
        method.addRequestHeader("Content-Type", "text/html;charset="+charset);
        method.setRequestHeader("Content-Type", "text/html;charset="+charset);
        method.addRequestHeader("Content-Type", "text/html;charset=" + charset);
        method.setRequestHeader("Content-Type", "text/html;charset=" + charset);
        method.setRequestBody(entity);
        try {
            client.executeMethod(method);
@@ -601,9 +620,7 @@
        return result;
    }
    /**
     * 获取post返回location
     * @param url
@@ -614,7 +631,7 @@
        PostMethod method = new PostMethod(url);
        try {
            client.executeMethod(method);
            return method.getResponseHeader("location").getValue();
            return method.getResponseHeader("location").getValue();
        } catch (HttpException e) {
            e.printStackTrace();
        } catch (IOException e) {
utils/src/main/java/org/yeshi/utils/JsonUtil.java
@@ -63,7 +63,10 @@
    }
    public static String loadJSONP(String callback, String data) {
        return callback + "(" + data + ")";
        if (StringUtil.isNullOrEmpty(callback))
            return data;
        else
            return callback + "(" + data + ")";
    }
    public static String loadFalseResult(int code, String error) {