yujian
2019-08-21 7f2f5ef5637a6871f4329e464eeba97eb59e94a3
Merge branch 'div' of ssh://193.112.35.168:29418/fanli-server into div
5个文件已修改
3个文件已添加
312 ■■■■ 已修改文件
fanli/src/main/java/com/yeshi/fanli/controller/client/v1/CommonContentController.java 9 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/controller/client/v2/CommonContentControllerV2.java 64 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/controller/client/v2/RecommendControllerV2.java 7 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/exception/integral/IntegralGetException.java 32 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/service/impl/integral/IntegralGetServiceImpl.java 89 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/service/impl/pdd/PDDOrderServiceImpl.java 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/service/inter/integral/IntegralGetService.java 97 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/util/factory/goods/CommonOrderFactory.java 13 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/controller/client/v1/CommonContentController.java
@@ -20,6 +20,7 @@
import com.yeshi.fanli.entity.accept.AcceptData;
import com.yeshi.fanli.entity.bus.homemodule.SwiperPicture;
import com.yeshi.fanli.entity.taobao.TaoBaoGoodsBrief;
import com.yeshi.fanli.entity.taobao.TaoBaoGoodsBriefExtra;
import com.yeshi.fanli.service.inter.goods.CommonTemplateContentService;
import com.yeshi.fanli.service.inter.homemodule.SwiperPictureService;
import com.yeshi.fanli.service.inter.hongbao.HongBaoManageService;
@@ -107,7 +108,13 @@
            pro = new BigDecimal(100);
        List<TaoBaoGoodsBrief> goodsList = result.getGoodsList();
        for (TaoBaoGoodsBrief taoBaoGoodsBrief : goodsList) {
            array.add(gson.toJson(TaoBaoUtil.getTaoBaoGoodsBriefExtra(taoBaoGoodsBrief, pro.toString(), "")));
            TaoBaoGoodsBriefExtra extra = TaoBaoUtil.getTaoBaoGoodsBriefExtra(taoBaoGoodsBrief, pro.toString(), "");
            if (CommonContentTypeEnum.valueOf(key) == CommonContentTypeEnum.mianDan)// 免单商品
            {
                extra.getTaoBaoHongBaoInfo().setRate("¥" + TaoBaoUtil.getAfterUseCouplePrice(taoBaoGoodsBrief));
                extra.getTaoBaoHongBaoInfo().setHongbao(TaoBaoUtil.getAfterUseCouplePrice(taoBaoGoodsBrief));
            }
            array.add(gson.toJson(extra));
        }
        root.put("goodsList", array);
        root.put("goodsCount", result.getCount());
fanli/src/main/java/com/yeshi/fanli/controller/client/v2/CommonContentControllerV2.java
@@ -35,6 +35,8 @@
import com.yeshi.fanli.util.Constant;
import com.yeshi.fanli.util.StringUtil;
import com.yeshi.fanli.util.factory.goods.GoodsDetailVOFactory;
import com.yeshi.fanli.util.taobao.TaoBaoUtil;
import com.yeshi.fanli.vo.goods.GoodsDetailVO;
import net.sf.json.JSONArray;
import net.sf.json.JSONObject;
@@ -51,7 +53,7 @@
    @Resource
    private SwiperPictureService swiperPictureService;
    @Resource
    private HongBaoManageService hongBaoManageService;
@@ -64,7 +66,6 @@
    @Resource
    private PDDCommonTemplateContentService pddCommonTemplateContentService;
    /**
     * 通用模板导航
     * 
@@ -78,7 +79,7 @@
            out.print(JsonUtil.loadFalseResult(1, "请传入Key"));
            return;
        }
        List<CommonContentNav> list = null;
        if (type == null || type == Constant.SOURCE_TYPE_TAOBAO) {
            list = commonTemplateContentService.getNavList(CommonContentTypeEnum.valueOf(key));
@@ -87,14 +88,14 @@
        } else if (type == Constant.SOURCE_TYPE_PDD) {
            list = pddCommonTemplateContentService.getNavList(PDDCommonContentTypeEnum.valueOf(key));
        }
        if (list == null) {
            list = new ArrayList<CommonContentNav>();
        }
        out.print(JsonUtil.loadTrueResult(new Gson().toJson(list)));
    }
    /**
     * 获取内容
     * 
@@ -105,7 +106,8 @@
     * @param out
     */
    @RequestMapping(value = "getNavGoodsList", method = RequestMethod.POST)
    public void getNavContent(AcceptData acceptData, String key, Integer type, Integer page, String cid, PrintWriter out) {
    public void getNavContent(AcceptData acceptData, String key, Integer type, Integer page, String cid,
            PrintWriter out) {
        if (StringUtil.isNullOrEmpty(key)) {
            out.print(JsonUtil.loadFalseResult(1, "请传入Key"));
            return;
@@ -120,12 +122,12 @@
            getListTB(acceptData, key, page, cid, out);
            return;
        }
        if (type == Constant.SOURCE_TYPE_JD) {
            getListJD(acceptData, key, page, cid, out);
            return;
        }
        if (type == Constant.SOURCE_TYPE_PDD) {
            getListPDD(acceptData, key, page, cid, out);
            return;
@@ -133,7 +135,6 @@
        out.print(JsonUtil.loadFalseResult("goodsType参数不正确"));
    }
    private void getListTB(AcceptData acceptData, String key, Integer page, String cid, PrintWriter out) {
        CommonContentResult result = commonTemplateContentService.getContentList(CommonContentTypeEnum.valueOf(key),
                cid, page, Constant.PAGE_SIZE);
@@ -150,18 +151,25 @@
        List<TaoBaoGoodsBrief> goodsList = result.getGoodsList();
        BigDecimal fanLiRate = hongBaoManageService.getFanLiRate();
        BigDecimal shareRate = hongBaoManageService.getShareRate();
        for (TaoBaoGoodsBrief taoBaoGoodsBrief : goodsList) {
            array.add(gson.toJson(GoodsDetailVOFactory.convertTaoBao(taoBaoGoodsBrief, null, fanLiRate, shareRate)));
            GoodsDetailVO vo = GoodsDetailVOFactory.convertTaoBao(taoBaoGoodsBrief, null, fanLiRate, shareRate);
            if (CommonContentTypeEnum.valueOf(key) == CommonContentTypeEnum.mianDan)// 免单商品
            {
                vo.getMoneyInfo().setFanliMoney("¥" + TaoBaoUtil.getAfterUseCouplePrice(taoBaoGoodsBrief));
                vo.getMoneyInfo().setShareMoney("¥" + TaoBaoUtil.getAfterUseCouplePrice(taoBaoGoodsBrief));
            }
            array.add(gson.toJson(vo));
        }
        root.put("list", array);
        root.put("count", result.getCount());
        out.print(JsonUtil.loadTrueResult(root));
    }
    /**
     * 京东通用专题模板
     *
     * @param acceptData
     * @param key
     * @param page
@@ -175,16 +183,17 @@
            data.put("bannerList", new Gson().toJson(bannerList));
        }
        JDSearchResult result = jdCommonTemplateContentService.getContentList(JDCommonContentTypeEnum.valueOf(key), cid, page, Constant.PAGE_SIZE);
        JDSearchResult result = jdCommonTemplateContentService.getContentList(JDCommonContentTypeEnum.valueOf(key), cid,
                page, Constant.PAGE_SIZE);
        JSONArray array = new JSONArray();
        long count = 0;
        if (result != null) {
            PageEntity pageEntity = result.getPageEntity();
            if (pageEntity != null) {
                count = pageEntity.getTotalCount();
            }
            List<JDGoods> goodsList = result.getGoodsList();
            if (goodsList != null && goodsList.size() > 0) {
                BigDecimal fanLiRate = hongBaoManageService.getFanLiRate();
@@ -196,15 +205,15 @@
                }
            }
        }
        data.put("list", array);
        data.put("count", count);
        out.print(JsonUtil.loadTrueResult(data));
    }
    /**
     *   拼多多通用专题模板
     * 拼多多通用专题模板
     *
     * @param acceptData
     * @param key
     * @param page
@@ -218,21 +227,22 @@
            List<SwiperPicture> bannerList = null;
            if (Constant.IS_TEST) {
                bannerList = swiperPictureService.getByBannerCard("index_top");
            }
            }
            if (bannerList == null) {
                bannerList = new ArrayList<SwiperPicture>();
            }
            data.put("bannerList", new Gson().toJson(bannerList));
        }
        PDDGoodsResult result = pddCommonTemplateContentService.getContentList(PDDCommonContentTypeEnum.valueOf(key), cid, page, Constant.PAGE_SIZE);
        PDDGoodsResult result = pddCommonTemplateContentService.getContentList(PDDCommonContentTypeEnum.valueOf(key),
                cid, page, Constant.PAGE_SIZE);
        JSONArray array = new JSONArray();
        long count = 0;
        if (result != null) {
            count = result.getTotalCount();
            List<PDDGoodsDetail> goodsList = result.getGoodsList();
            if (goodsList != null && goodsList.size() > 0) {
                BigDecimal fanLiRate = hongBaoManageService.getFanLiRate();
@@ -244,7 +254,7 @@
                }
            }
        }
        data.put("list", array);
        data.put("count", count);
        out.print(JsonUtil.loadTrueResult(data));
fanli/src/main/java/com/yeshi/fanli/controller/client/v2/RecommendControllerV2.java
@@ -324,13 +324,12 @@
        JSONObject root = new JSONObject();
        JSONArray array = new JSONArray();
        array.add(
                "https://gw.alicdn.com/bao/uploaded/i2/72768346/O1CN01rwRcUH2BWW6oc01hd_!!0-item_pic.jpg_180x180xz.jpg_.webp");
                "http://img.flqapp.com/resource/integral/integral_home_icon_2.png");
        array.add(
                "https://gw.alicdn.com/bao/uploaded/i2/479184430/O1CN01HjEq4j1iaz7HbWeX9_!!479184430.jpg_180x180xz.jpg_.webp");
                "http://img.flqapp.com/resource/integral/integral_home_icon_1.png");
        root.put("imgList", array);
        JSONObject params = new JSONObject();
        params.put("url", configService.get("spike_goods_link"));
        params.put("balanceMore", true);
        root.put("params", params);
        root.put("jumpDetail", jumpDetailV2Service.getByTypeCache("integralExchange",
                Constant.getPlatformCode(acceptData.getPlatform()), Integer.parseInt(acceptData.getVersion())));
fanli/src/main/java/com/yeshi/fanli/exception/integral/IntegralGetException.java
New file
@@ -0,0 +1,32 @@
package com.yeshi.fanli.exception.integral;
public class IntegralGetException extends Exception {
    /**
     *
     */
    private static final long serialVersionUID = 1L;
    private int code;
    private String msg;
    public int getCode() {
        return code;
    }
    public String getMsg() {
        return msg;
    }
    public IntegralGetException(int code, String msg) {
        this.code = code;
        this.msg = msg;
    }
    public IntegralGetException() {
    }
    @Override
    public String getMessage() {
        return this.msg;
    }
}
fanli/src/main/java/com/yeshi/fanli/service/impl/integral/IntegralGetServiceImpl.java
New file
@@ -0,0 +1,89 @@
package com.yeshi.fanli.service.impl.integral;
import org.springframework.stereotype.Service;
import com.yeshi.fanli.exception.integral.IntegralGetException;
import com.yeshi.fanli.service.inter.integral.IntegralGetService;
import net.sf.json.JSONObject;
@Service
public class IntegralGetServiceImpl implements IntegralGetService {
    @Override
    public void addEventStatistic(Long uid, String event, JSONObject params) throws IntegralGetException {
        switch (event) {
        case "recommendSearch":
            break;
        case "shareInvite":
            break;
        case "inShop":
            break;
        case "scanPush":
            break;
        case "scanGoods":
            break;
        case "scanHomeBanner":
            break;
        case "scanSpecial":
            break;
        case "scanTBCart":
            break;
        }
    }
    @Override
    public void addRecommendSearch(Long uid) throws IntegralGetException {
        // TODO Auto-generated method stub
    }
    @Override
    public void addSearchResultScan(Long uid) throws IntegralGetException {
        // TODO Auto-generated method stub
    }
    @Override
    public void addShareInvite(Long uid) throws IntegralGetException {
        // TODO Auto-generated method stub
    }
    @Override
    public void addIntoShop(Long uid) throws IntegralGetException {
        // TODO Auto-generated method stub
    }
    @Override
    public void addScanPushHistory(Long uid) throws IntegralGetException {
        // TODO Auto-generated method stub
    }
    @Override
    public void addScanGoodsDetail(Long uid, int goodsType, Long goodsId) {
        // TODO Auto-generated method stub
    }
    @Override
    public void addScanRecommendBanner(Long uid) {
        // TODO Auto-generated method stub
    }
    @Override
    public void addScanRecommendSpecial(Long uid) {
        // TODO Auto-generated method stub
    }
    @Override
    public void addScanTaoBaoCart(Long uid) {
        // TODO Auto-generated method stub
    }
}
fanli/src/main/java/com/yeshi/fanli/service/impl/pdd/PDDOrderServiceImpl.java
@@ -42,6 +42,7 @@
                update.setGoodsName(order.getGoodsName());
                update.setGoodsPrice(order.getGoodsPrice());
                update.setUpdateTime(new Date());
                update.setOrderReceiveTime(order.getOrderReceiveTime());
                pddOrderMapper.updateByPrimaryKeySelective(update);
                return pddOrderMapper.selectByPrimaryKey(old.getId());
            }
fanli/src/main/java/com/yeshi/fanli/service/inter/integral/IntegralGetService.java
New file
@@ -0,0 +1,97 @@
package com.yeshi.fanli.service.inter.integral;
import com.yeshi.fanli.exception.integral.IntegralGetException;
import net.sf.json.JSONObject;
/**
 * 金币获取服务
 *
 * @author Administrator
 *
 */
public interface IntegralGetService {
    /**
     * 添加事件统计
     *
     * @param uid
     * @param params
     *            事件相关参数
     * @param event
     *            事件编码
     * @throws IntegralGetException
     */
    public void addEventStatistic(Long uid, String event, JSONObject params) throws IntegralGetException;
    /**
     * 从粘贴板推荐进入搜索结果
     *
     * @param uid
     * @throws IntegralGetException
     */
    public void addRecommendSearch(Long uid) throws IntegralGetException;
    /**
     * 搜索结果浏览
     *
     * @param uid
     * @throws IntegralGetException
     */
    public void addSearchResultScan(Long uid) throws IntegralGetException;
    /**
     * 分享邀请图
     *
     * @param uid
     * @throws IntegralGetException
     */
    public void addShareInvite(Long uid) throws IntegralGetException;
    /**
     * 进入店铺
     *
     * @param uid
     * @throws IntegralGetException
     */
    public void addIntoShop(Long uid) throws IntegralGetException;
    /**
     * 推送记录页浏览
     *
     * @param uid
     * @throws IntegralGetException
     */
    public void addScanPushHistory(Long uid) throws IntegralGetException;
    /**
     * 商品详情页浏览
     *
     * @param uid
     * @param goodsType
     * @param goodsId
     */
    public void addScanGoodsDetail(Long uid, int goodsType, Long goodsId);
    /**
     * 推荐banner浏览
     *
     * @param uid
     */
    public void addScanRecommendBanner(Long uid);
    /**
     * 推荐专题浏览
     *
     * @param uid
     */
    public void addScanRecommendSpecial(Long uid);
    /**
     * 淘宝购物车浏览
     *
     * @param uid
     */
    public void addScanTaoBaoCart(Long uid);
}
fanli/src/main/java/com/yeshi/fanli/util/factory/goods/CommonOrderFactory.java
@@ -15,16 +15,23 @@
        CommonOrder commonOrder = new CommonOrder();
        commonOrder.setCount(order.getGoodsQuantity());
        commonOrder.setCreateTime(new Date());
        if (order.getOrderStatus() == 3) {
        if (order.getOrderStatus() == 3) {// 审核通过
            commonOrder.seteIncome(
                    MoneyBigDecimalUtil.div(new BigDecimal(order.getPromotionAmount()), new BigDecimal(100)));
            commonOrder.setSettlement(
                    MoneyBigDecimalUtil.div(new BigDecimal(order.getOrderAmount()), new BigDecimal(100)));// 结算金额
            commonOrder.setSettleTime(new Date(order.getOrderVerifyTime() * 1000));
        } else if (order.getOrderStatus() == 2) {// 确认收货归为审核通过
            commonOrder.seteIncome(
                    MoneyBigDecimalUtil.div(new BigDecimal(order.getPromotionAmount()), new BigDecimal(100)));
            commonOrder.setSettlement(
                    MoneyBigDecimalUtil.div(new BigDecimal(order.getOrderAmount()), new BigDecimal(100)));// 结算金额
            commonOrder.setSettleTime(new Date(order.getOrderReceiveTime() * 1000));
        } else {
            commonOrder.seteIncome(new BigDecimal(0));
            commonOrder.setSettlement(new BigDecimal(0));
        }
        commonOrder
                .setEstimate(MoneyBigDecimalUtil.div(new BigDecimal(order.getPromotionAmount()), new BigDecimal(100)));
        commonOrder.setOrderNo(order.getOrderSn());
@@ -39,8 +46,8 @@
            state = CommonOrder.STATE_FK;
        } else if (1 == order.getOrderStatus()) {
            state = CommonOrder.STATE_FK;
        } else if (2 == order.getOrderStatus()) {
            state = CommonOrder.STATE_FK;
        } else if (2 == order.getOrderStatus()) {// 确认收货
            state = CommonOrder.STATE_JS;
        } else if (3 == order.getOrderStatus()) {
            state = CommonOrder.STATE_FK;
        } else if (4 == order.getOrderStatus()) {