Merge branch 'div' of ssh://193.112.35.168:29418/fanli-server into div
| | |
| | | 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;
|
| | |
| | | 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());
|
| | |
| | | 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;
|
| | |
| | |
|
| | | @Resource
|
| | | private PDDCommonTemplateContentService pddCommonTemplateContentService;
|
| | |
|
| | |
|
| | | /**
|
| | | * 通用模板导航
|
| | |
| | | * @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;
|
| | |
| | | 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);
|
| | |
| | | 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);
|
| | |
| | | out.print(JsonUtil.loadTrueResult(root));
|
| | | }
|
| | |
|
| | | |
| | | /**
|
| | | * 京东通用专题模板
|
| | | * |
| | | * @param acceptData
|
| | | * @param key
|
| | | * @param page
|
| | |
| | | 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;
|
| | |
| | | out.print(JsonUtil.loadTrueResult(data));
|
| | | }
|
| | |
|
| | | |
| | | /**
|
| | | * 拼多多通用专题模板
|
| | | * |
| | | * @param acceptData
|
| | | * @param key
|
| | | * @param page
|
| | |
| | | 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) {
|
| | |
| | | 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())));
|
New file |
| | |
| | | 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;
|
| | | }
|
| | |
|
| | | }
|
New file |
| | |
| | | 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
|
| | |
|
| | | }
|
| | |
|
| | | }
|
| | |
| | | update.setGoodsName(order.getGoodsName());
|
| | | update.setGoodsPrice(order.getGoodsPrice());
|
| | | update.setUpdateTime(new Date());
|
| | | update.setOrderReceiveTime(order.getOrderReceiveTime());
|
| | | pddOrderMapper.updateByPrimaryKeySelective(update);
|
| | | return pddOrderMapper.selectByPrimaryKey(old.getId());
|
| | | }
|
New file |
| | |
| | | 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);
|
| | |
|
| | | }
|
| | |
| | | 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());
|
| | |
| | | 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()) {
|