admin
2019-01-26 6a486f505881408d991cebfae2c20cb5108a7746
bug修改
7个文件已修改
1个文件已添加
90 ■■■■ 已修改文件
fanli/src/main/java/com/yeshi/fanli/controller/client/GoodsController.java 18 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/controller/client/RecommendController.java 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/controller/client/ShareController.java 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/controller/client/UserAuthController.java 11 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/controller/client/UserMsgController.java 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/mapping/goods/ScanHistoryV2Mapper.xml 9 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/service/impl/goods/ShareGoodsServiceImpl.java 35 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/service/inter/goods/GoodsShareActivityService.java 11 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/controller/client/GoodsController.java
@@ -74,12 +74,13 @@
        JSONObject data = new JSONObject();
        boolean isNative = false;
        String pid = null;
        String specialId = null;
        // 查询用户ID是否绑定了会员运营ID
        UserExtraTaoBaoInfo userInfo = userExtraTaoBaoInfoService.getByUid(uid);
        if (userInfo != null && !StringUtil.isNullOrEmpty(userInfo.getSpecialId()) && userInfo.getSpecialValid() != null
                && userInfo.getSpecialValid() == true) {
            specialId = userInfo.getSpecialId();
            // 已经绑定
            try {
                TaoBaoGoodsBrief goods = TaoKeApiUtil.getSimpleGoodsInfo(auctionId);
@@ -97,16 +98,19 @@
        } else {// 尚未绑定
            isNative = true;
        }
        data.put("native", isNative);
        try {
            int pidType = PidUser.TYPE_FANLI_ANDROID;
            if (acceptData.getPlatform().equalsIgnoreCase("ios"))
                pidType = PidUser.TYPE_FANLI_IOS;
            TaoBaoLink taoBaoLink = shareGoodsService.getTaoBaoLinkForBuy(uid, auctionId, pidType);
            TaoBaoLink taoBaoLink = null;
            if (!StringUtil.isNullOrEmpty(specialId)) {
                taoBaoLink = shareGoodsService.getTaoBaoLinkForBuyWithSpecial(uid, specialId, auctionId);
            } else {
                taoBaoLink = shareGoodsService.getTaoBaoLinkForBuy(uid, auctionId, pidType);
            }
            JSONObject link = new JSONObject();
            link.put("clickUrl", taoBaoLink.getClickUrl());
            link.put("couponUrl", taoBaoLink.getCouponLink());
@@ -115,6 +119,7 @@
            out.print(JsonUtil.loadTrueResult(data));
        } catch (Exception e) {
            isNative = false;
            try {
                monitorService.addClientAPIMonitor(MonitorFactory.createClientAPI(request, 0, 0, "购买淘宝商品转链出错"));
            } catch (Exception e1) {
@@ -140,6 +145,7 @@
                out.print(JsonUtil.loadFalseResult(1, "请求失败"));
            }
        }
        data.put("native", isNative);
    }
fanli/src/main/java/com/yeshi/fanli/controller/client/RecommendController.java
@@ -2044,7 +2044,7 @@
        JSONObject shareActivity = new JSONObject();
        shareActivity.put("moneyDesc", "春节狂欢奖金:¥" + TaoBaoUtil.getGoodsHongBaoMoney(tb,
                new BigDecimal(configService.get("share_activity_proportion")).divide(new BigDecimal(100))));
                new BigDecimal(hongBaoManageService.get("share_activity_proportion"))));
        shareActivity.put("ruleDescPicture", "http://img.flqapp.com/resource/share_activity_img.png");
        data.put("shareActivity", shareActivity);
fanli/src/main/java/com/yeshi/fanli/controller/client/ShareController.java
@@ -103,7 +103,7 @@
        UserExtraTaoBaoInfo extraInfo = userExtraTaoBaoInfoService.getByUid(uid);
        try {
            String relationId = null;
            if (extraInfo.getRelationId() != null && extraInfo.getRelationValid() != null
            if (extraInfo != null && extraInfo.getRelationId() != null && extraInfo.getRelationValid() != null
                    && extraInfo.getRelationValid() == true)
                relationId = extraInfo.getRelationId();
            TaoBaoLink taoBaoLink = shareGoodsService.getTaoBaoLinkForShare(uid, auctionId, relationId);
fanli/src/main/java/com/yeshi/fanli/controller/client/UserAuthController.java
@@ -12,6 +12,7 @@
import com.yeshi.fanli.entity.accept.AcceptData;
import com.yeshi.fanli.entity.bus.user.UserExtraTaoBaoInfo;
import com.yeshi.fanli.service.inter.config.ConfigService;
import com.yeshi.fanli.service.inter.user.UserExtraTaoBaoInfoService;
import com.yeshi.fanli.util.AESUtil;
import com.yeshi.fanli.util.Constant;
@@ -26,6 +27,9 @@
    @Resource
    private UserExtraTaoBaoInfoService userExtraTaoBaoInfoService;
    @Resource
    private ConfigService configService;
    /**
     * 获取淘宝授权信息
@@ -53,6 +57,11 @@
            return;
        }
        if (!"1".equalsIgnoreCase(configService.get("open_speical_and_relation_apply"))) {
            out.print(JsonUtil.loadFalseResult(1, "暂不开放申请"));
            return;
        }
        //
        UserExtraTaoBaoInfo user = userExtraTaoBaoInfoService.getByUid(uid);
        if ("share".equalsIgnoreCase(source)) {
@@ -69,7 +78,7 @@
        }
        String link = TaoBaoUtil.getTaoBaoUnionAuthUrl(Constant.TAOBAO_AUTH_APPKEY,
                "http://192.168.1.122:8080/fanli/client/v1/auth/callback/tb", uid, source);
                "http://test.flqapp.com/fanli/client/v1/auth/callback/tb", uid, source);
        String orderJS = "var orderId= document.getElementById('tp-bought-root').getElementsByClassName('js-order-container')[0].getElementsByTagName('div')[0].getAttribute('data-id');";
        orderJS += "if(/(iPhone|iPad|iPod|iOS)/i.test(navigator.userAgent)) {window.location.href='yestv://taobaoorder#'+orderId;} else {window.handle.showOrder(orderId)}";
fanli/src/main/java/com/yeshi/fanli/controller/client/UserMsgController.java
@@ -345,7 +345,7 @@
                canAdd = true;
            } else {
                // 是否和上次间隔时间足够
                if (System.currentTimeMillis() - goods.getCreateTime().getTime() >= 1000 * 60 * 60 * 8L) {
                if (System.currentTimeMillis() - goods.getCreateTime().getTime() >= 1000 * 60 * 60 * 4L) {
                    canAdd = true;
                }
            }
fanli/src/main/java/com/yeshi/fanli/mapping/goods/ScanHistoryV2Mapper.xml
@@ -29,13 +29,16 @@
    <!-- 根据UID或者设备号获取浏览记录 -->
    <select id="selectByDeviceOrUid" resultMap="BaseResultMap">
        SELECT s.*,MAX(s.`s_createtime`) AS orderid FROM yeshi_ec_scanhistory_v2 s
        select * from (SELECT s.* FROM yeshi_ec_scanhistory_v2 s
        WHERE
        <trim prefix="(" suffix=")" suffixOverrides="or">
            <if test="uid != null"> s.`s_uid`=#{uid,jdbcType=BIGINT} or</if>
            <if test="device != null">s.`s_device`=#{device,jdbcType=VARCHAR} or</if>
        </trim>
        GROUP BY s.`s_common_goods_id` ORDER BY orderid DESC limit
        GROUP BY s.`s_common_goods_id`
        ) s
        order by s.s_createtime DESC
        limit
        #{start},#{count}
    </select>
@@ -90,7 +93,7 @@
        values
        (#{id,jdbcType=BIGINT},#{device,jdbcType=VARCHAR},#{userInfo.id,jdbcType=BIGINT},#{commonGoods.id,jdbcType=BIGINT},#{createTime,jdbcType=TIMESTAMP},#{updateTime,jdbcType=TIMESTAMP})
    </insert>
    <insert id="insertSelective" parameterType="com.yeshi.fanli.entity.goods.ScanHistoryV2"
        useGeneratedKeys="true" keyProperty="id">
        insert into yeshi_ec_scanhistory_v2
fanli/src/main/java/com/yeshi/fanli/service/impl/goods/ShareGoodsServiceImpl.java
@@ -458,15 +458,32 @@
        if (tbPid == null) {
            throw new ShareGoodsException(3, "获取推广位失败");
        }
        String appId = tbPid.getPid().split("_")[2];
        String adzoneId = tbPid.getPid().split("_")[3];
        return getTaoBaoLink(uid, auctionId, tbPid.getPid());
    }
    public TaoBaoLink getTaoBaoLink(Long uid, Long auctionId, String pid) throws ShareGoodsException {
        if (uid == null || uid <= 0) {
            throw new ShareGoodsException(1, "用户ID不能为空");
        }
        if (auctionId == null || auctionId <= 0) {
            throw new ShareGoodsException(2, "商品ID不能为空");
        }
        if (StringUtil.isNullOrEmpty(pid)) {
            throw new ShareGoodsException(3, "无推广位");
        }
        String appId = pid.split("_")[2];
        String adzoneId = pid.split("_")[3];
        TaoBaoUnionConfig taoBaoUnionConfig = taoBaoUnionConfigService.getConfigByAppIdCache(appId);
        TaoKeAppInfo info = new TaoKeAppInfo();
        info.setAdzoneId(adzoneId);
        info.setAppKey(taoBaoUnionConfig.getAppKey());
        info.setAppSecret(taoBaoUnionConfig.getAppSecret());
        info.setPid(tbPid.getPid());
        info.setPid(pid);
        TaoBaoGoodsBrief goods = null;
        try {
            goods = TaoKeApiUtil.searchGoodsDetailForConvert(auctionId, info);
@@ -479,7 +496,7 @@
        }
        if (StringUtil.isNullOrEmpty(goods.getCouponLink()) && !goods.getAuctionUrl().contains("s.click.taobao.com")) {
            TaoBaoLink taoBaoLink = TaoBaoUtil.getTbLinkForShare(auctionId, tbPid.getPid(), taoBaoUnionConfig);
            TaoBaoLink taoBaoLink = TaoBaoUtil.getTbLinkForShare(auctionId, pid, taoBaoUnionConfig);
            if (taoBaoLink == null) {
                throw new ShareGoodsException(201, "商品转链失败");
            }
@@ -498,7 +515,15 @@
    @Override
    public TaoBaoLink getTaoBaoLinkForBuyWithSpecial(Long uid, String specialId, Long auctionId)
            throws ShareGoodsException {
        return null;
        if (uid == null || uid <= 0) {
            throw new ShareGoodsException(1, "用户ID不能为空");
        }
        if (auctionId == null || auctionId <= 0) {
            throw new ShareGoodsException(2, "商品ID不能为空");
        }
        return getTaoBaoLink(uid, auctionId, Constant.TAOBAO_SPECIAL_PID_DEFAULT);
    }
}
fanli/src/main/java/com/yeshi/fanli/service/inter/goods/GoodsShareActivityService.java
New file
@@ -0,0 +1,11 @@
package com.yeshi.fanli.service.inter.goods;
/**
 * 商品分享活动
 *
 * @author Administrator
 *
 */
public class GoodsShareActivityService {
}