Merge remote-tracking branch 'origin/master'
| | |
| | | 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);
|
| | |
| | | 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());
|
| | |
| | | out.print(JsonUtil.loadTrueResult(data));
|
| | |
|
| | | } catch (Exception e) {
|
| | | isNative = false;
|
| | | try {
|
| | | monitorService.addClientAPIMonitor(MonitorFactory.createClientAPI(request, 0, 0, "购买淘宝商品转链出错"));
|
| | | } catch (Exception e1) {
|
| | |
| | | out.print(JsonUtil.loadFalseResult(1, "请求失败"));
|
| | | }
|
| | | }
|
| | | data.put("native", isNative);
|
| | |
|
| | | }
|
| | |
|
| | |
| | |
|
| | | 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);
|
| | |
| | | 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);
|
| | |
| | |
|
| | | 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;
|
| | |
| | |
|
| | | @Resource
|
| | | private UserExtraTaoBaoInfoService userExtraTaoBaoInfoService;
|
| | |
|
| | | @Resource
|
| | | private ConfigService configService;
|
| | |
|
| | | /**
|
| | | * 获取淘宝授权信息
|
| | |
| | | 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)) {
|
| | |
| | | }
|
| | |
|
| | | 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)}";
|
| | |
| | | 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;
|
| | | }
|
| | | }
|
New file |
| | |
| | | package com.yeshi.fanli.dao.mybatis.order; |
| | | |
| | | import java.util.List; |
| | | |
| | | import org.apache.ibatis.annotations.Param; |
| | | |
| | | import com.yeshi.fanli.dao.BaseMapper; |
| | | import com.yeshi.fanli.entity.order.ShareGoodsActivityOrder; |
| | | |
| | | public interface ShareGoodsActivityOrderMapper extends BaseMapper<ShareGoodsActivityOrder> { |
| | | |
| | | /** |
| | | * 计算分享活动的订单数 |
| | | * |
| | | * @param uid |
| | | * @return |
| | | */ |
| | | long countShareGoodsActivityOrderByUid(Long uid); |
| | | |
| | | /** |
| | | * 查询分享活动(根据订单号与用户ID) |
| | | * |
| | | * @param uid |
| | | * @param orderId |
| | | * @return |
| | | */ |
| | | List<ShareGoodsActivityOrder> listByOrderIdAndUid(@Param("uid") Long uid, @Param("orderId") Long orderId); |
| | | } |
New file |
| | |
| | | package com.yeshi.fanli.entity.order;
|
| | |
|
| | | import java.math.BigDecimal;
|
| | | import java.util.Date;
|
| | |
|
| | | import org.yeshi.utils.mybatis.Column;
|
| | | import org.yeshi.utils.mybatis.Table;
|
| | |
|
| | | import com.yeshi.fanli.entity.bus.user.Order;
|
| | | import com.yeshi.fanli.entity.bus.user.UserInfo;
|
| | |
|
| | | /**
|
| | | * 分享活动的返利比例
|
| | | * |
| | | * @author hexiaohui
|
| | | *
|
| | | */
|
| | | @Table("yeshi_ec_share_goods_activity_order")
|
| | | public class ShareGoodsActivityOrder {
|
| | | @Column(name = "sgao_id")
|
| | | private Long id;
|
| | | @Column(name = "sgao_uid")
|
| | | private UserInfo user;
|
| | | @Column(name = "sgao_order_id")
|
| | | private Order order;// 订单
|
| | | @Column(name = "sgao_share_rate")
|
| | | private BigDecimal shareRate;// 分享比例
|
| | | @Column(name = "sgao_create_time")
|
| | | private Date createTime;
|
| | | @Column(name = "sgao_update_time")
|
| | | private Date updateTime;
|
| | |
|
| | | public Long getId() {
|
| | | return id;
|
| | | }
|
| | |
|
| | | public void setId(Long id) {
|
| | | this.id = id;
|
| | | }
|
| | |
|
| | | public UserInfo getUser() {
|
| | | return user;
|
| | | }
|
| | |
|
| | | public void setUser(UserInfo user) {
|
| | | this.user = user;
|
| | | }
|
| | |
|
| | | public Order getOrder() {
|
| | | return order;
|
| | | }
|
| | |
|
| | | public void setOrder(Order order) {
|
| | | this.order = order;
|
| | | }
|
| | |
|
| | | public BigDecimal getShareRate() {
|
| | | return shareRate;
|
| | | }
|
| | |
|
| | | public void setShareRate(BigDecimal shareRate) {
|
| | | this.shareRate = shareRate;
|
| | | }
|
| | |
|
| | | 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;
|
| | | }
|
| | |
|
| | | }
|
New file |
| | |
| | | package com.yeshi.fanli.exception.order; |
| | | |
| | | public class ShareGoodsActivityOrderException 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 ShareGoodsActivityOrderException(int code, String msg) { |
| | | this.code = code; |
| | | this.msg = msg; |
| | | } |
| | | |
| | | public ShareGoodsActivityOrderException() { |
| | | } |
| | | |
| | | @Override |
| | | public String getMessage() { |
| | | return this.msg; |
| | | } |
| | | |
| | | } |
| | |
| | | |
| | | <!-- 根据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> |
| | | |
New file |
| | |
| | | <?xml version="1.0" encoding="UTF-8"?> |
| | | <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> |
| | | |
| | | <mapper |
| | | namespace="com.yeshi.fanli.dao.mybatis.order.ShareGoodsActivityOrderMapper"> |
| | | <resultMap id="BaseResultMap" |
| | | type="com.yeshi.fanli.entity.order.ShareGoodsActivityOrder"> |
| | | <id column="sgao_id" property="id" jdbcType="BIGINT" /> |
| | | <result column="sgao_share_rate" property="shareRate" jdbcType="DECIMAL" /> |
| | | <result column="sgao_create_time" property="createTime" |
| | | jdbcType="TIMESTAMP" /> |
| | | <result column="sgao_update_time" property="updateTime" |
| | | jdbcType="TIMESTAMP" /> |
| | | <association property="user" column="sgao_uid" |
| | | javaType="com.yeshi.fanli.entity.bus.user.UserInfo"> |
| | | <id property="id" column="sgao_uid" jdbcType="BIGINT" /> |
| | | </association> |
| | | <association property="order" column="sgao_order_id" |
| | | javaType="com.yeshi.fanli.entity.bus.user.Order"> |
| | | <id property="id" column="sgao_order_id" jdbcType="BIGINT" /> |
| | | </association> |
| | | |
| | | </resultMap> |
| | | <sql id="Base_Column_List">sgao_id,sgao_uid,sgao_order_id,sgao_share_rate,sgao_create_time,sgao_update_time |
| | | </sql> |
| | | <select id="selectByPrimaryKey" resultMap="BaseResultMap" |
| | | parameterType="java.lang.Long"> |
| | | select |
| | | <include refid="Base_Column_List" /> |
| | | from yeshi_ec_share_goods_activity_order where sgao_id = |
| | | #{id,jdbcType=BIGINT} |
| | | </select> |
| | | |
| | | |
| | | |
| | | <select id="countShareGoodsActivityOrderByUid" resultType="java.lang.Long" |
| | | parameterType="java.lang.Long"> |
| | | select |
| | | count(sgao_id) |
| | | from |
| | | yeshi_ec_share_goods_activity_order where sgao_uid =#{0} |
| | | </select> |
| | | |
| | | |
| | | <select id="listByOrderIdAndUid" resultMap="BaseResultMap"> |
| | | select |
| | | <include refid="Base_Column_List" /> |
| | | from yeshi_ec_share_goods_activity_order where sgao_uid =#{uid} and |
| | | sgao_order_id=#{orderId} |
| | | </select> |
| | | |
| | | |
| | | |
| | | |
| | | <delete id="deleteByPrimaryKey" parameterType="java.lang.Long">delete from |
| | | yeshi_ec_share_goods_activity_order where sgao_id = |
| | | #{id,jdbcType=BIGINT} |
| | | </delete> |
| | | <insert id="insert" |
| | | parameterType="com.yeshi.fanli.entity.order.ShareGoodsActivityOrder" |
| | | useGeneratedKeys="true" keyProperty="id">insert into |
| | | yeshi_ec_share_goods_activity_order |
| | | (sgao_id,sgao_uid,sgao_order_id,sgao_share_rate,sgao_create_time,sgao_update_time) |
| | | values |
| | | (#{id,jdbcType=BIGINT},#{user.id,jdbcType=BIGINT},#{order.id,jdbcType=BIGINT},#{shareRate,jdbcType=DECIMAL},#{createTime,jdbcType=TIMESTAMP},#{updateTime,jdbcType=TIMESTAMP}) |
| | | </insert> |
| | | <insert id="insertSelective" |
| | | parameterType="com.yeshi.fanli.entity.order.ShareGoodsActivityOrder" |
| | | useGeneratedKeys="true" keyProperty="id"> |
| | | insert into yeshi_ec_share_goods_activity_order |
| | | <trim prefix="(" suffix=")" suffixOverrides=","> |
| | | <if test="id != null">sgao_id,</if> |
| | | <if test="user != null">sgao_uid,</if> |
| | | <if test="order != null">sgao_order_id,</if> |
| | | <if test="shareRate != null">sgao_share_rate,</if> |
| | | <if test="createTime != null">sgao_create_time,</if> |
| | | <if test="updateTime != null">sgao_update_time,</if> |
| | | </trim> |
| | | values |
| | | <trim prefix="(" suffix=")" suffixOverrides=","> |
| | | <if test="id != null">#{id,jdbcType=BIGINT},</if> |
| | | <if test="user != null">#{user.id,jdbcType=BIGINT},</if> |
| | | <if test="order != null">#{order.id,jdbcType=BIGINT},</if> |
| | | <if test="shareRate != null">#{shareRate,jdbcType=DECIMAL},</if> |
| | | <if test="createTime != null">#{createTime,jdbcType=TIMESTAMP},</if> |
| | | <if test="updateTime != null">#{updateTime,jdbcType=TIMESTAMP},</if> |
| | | </trim> |
| | | </insert> |
| | | <update id="updateByPrimaryKey" |
| | | parameterType="com.yeshi.fanli.entity.order.ShareGoodsActivityOrder">update yeshi_ec_share_goods_activity_order set sgao_uid |
| | | = #{user.id,jdbcType=BIGINT},sgao_order_id = |
| | | #{order.id,jdbcType=BIGINT},sgao_share_rate = |
| | | #{shareRate,jdbcType=DECIMAL},sgao_create_time = |
| | | #{createTime,jdbcType=TIMESTAMP},sgao_update_time = |
| | | #{updateTime,jdbcType=TIMESTAMP} where sgao_id = |
| | | #{id,jdbcType=BIGINT} |
| | | </update> |
| | | <update id="updateByPrimaryKeySelective" |
| | | parameterType="com.yeshi.fanli.entity.order.ShareGoodsActivityOrder"> |
| | | update yeshi_ec_share_goods_activity_order |
| | | <set> |
| | | <if test="user != null">sgao_uid=#{user.id,jdbcType=BIGINT},</if> |
| | | <if test="order != null">sgao_order_id=#{order.id,jdbcType=BIGINT},</if> |
| | | <if test="shareRate != null">sgao_share_rate=#{shareRate,jdbcType=DECIMAL},</if> |
| | | <if test="createTime != null">sgao_create_time=#{createTime,jdbcType=TIMESTAMP},</if> |
| | | <if test="updateTime != null">sgao_update_time=#{updateTime,jdbcType=TIMESTAMP},</if> |
| | | </set> |
| | | where sgao_id = #{id,jdbcType=BIGINT} |
| | | </update> |
| | | </mapper> |
| | |
| | | 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);
|
| | |
| | | }
|
| | |
|
| | | 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, "商品转链失败");
|
| | | }
|
| | |
| | | @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);
|
| | | }
|
| | |
|
| | | }
|
New file |
| | |
| | | package com.yeshi.fanli.service.impl.order;
|
| | |
|
| | | import java.math.BigDecimal;
|
| | | import java.util.Date;
|
| | | import java.util.List;
|
| | |
|
| | | import javax.annotation.Resource;
|
| | |
|
| | | import org.springframework.stereotype.Service;
|
| | |
|
| | | import com.yeshi.fanli.dao.mybatis.order.ShareGoodsActivityOrderMapper;
|
| | | import com.yeshi.fanli.entity.bus.user.Order;
|
| | | import com.yeshi.fanli.entity.bus.user.UserInfo;
|
| | | import com.yeshi.fanli.entity.order.ShareGoodsActivityOrder;
|
| | | import com.yeshi.fanli.exception.order.ShareGoodsActivityOrderException;
|
| | | import com.yeshi.fanli.service.inter.order.ShareGoodsActivityOrderService;
|
| | |
|
| | | @Service
|
| | | public class ShareGoodsActivityOrderServiceImpl implements ShareGoodsActivityOrderService {
|
| | |
|
| | | @Resource
|
| | | private ShareGoodsActivityOrderMapper shareGoodsActivityOrderMapper;
|
| | |
|
| | | @Override
|
| | | public void addShareGoodsActivityOrder(Long uid, BigDecimal rate, Order order)
|
| | | throws ShareGoodsActivityOrderException {
|
| | | if (uid == null || rate == null || order == null || order.getId() == null)
|
| | | throw new ShareGoodsActivityOrderException(1, "数据不完整");
|
| | |
|
| | | List<ShareGoodsActivityOrder> list = listByOrderIdAndUid(uid, order.getId());
|
| | | if (list != null && list.size() > 0)
|
| | | throw new ShareGoodsActivityOrderException(2, "订单号已存在");
|
| | |
|
| | | ShareGoodsActivityOrder shareOrder = new ShareGoodsActivityOrder();
|
| | | shareOrder.setCreateTime(new Date());
|
| | | shareOrder.setOrder(order);
|
| | | shareOrder.setShareRate(rate);
|
| | | shareOrder.setUser(new UserInfo(uid));
|
| | | shareGoodsActivityOrderMapper.insertSelective(shareOrder);
|
| | | }
|
| | |
|
| | | @Override
|
| | | public long countShareGoodsActivityOrder(Long uid) {
|
| | | return shareGoodsActivityOrderMapper.countShareGoodsActivityOrderByUid(uid);
|
| | | }
|
| | |
|
| | | @Override
|
| | | public List<ShareGoodsActivityOrder> listByOrderIdAndUid(Long uid, Long orderId) {
|
| | | return shareGoodsActivityOrderMapper.listByOrderIdAndUid(uid, orderId);
|
| | | }
|
| | |
|
| | | }
|
New file |
| | |
| | | package com.yeshi.fanli.service.inter.goods;
|
| | |
|
| | | /**
|
| | | * 商品分享活动
|
| | | * |
| | | * @author Administrator
|
| | | *
|
| | | */
|
| | | public class GoodsShareActivityService {
|
| | |
|
| | | }
|
New file |
| | |
| | | package com.yeshi.fanli.service.inter.order;
|
| | |
|
| | | import java.math.BigDecimal;
|
| | | import java.util.List;
|
| | |
|
| | | import com.yeshi.fanli.entity.bus.user.Order;
|
| | | import com.yeshi.fanli.entity.order.ShareGoodsActivityOrder;
|
| | | import com.yeshi.fanli.exception.order.ShareGoodsActivityOrderException;
|
| | |
|
| | | /**
|
| | | * 分享活动的订单服务
|
| | | * |
| | | * @author hexiaohui
|
| | | *
|
| | | */
|
| | | public interface ShareGoodsActivityOrderService {
|
| | |
|
| | | /**
|
| | | * 添加分享活动订单
|
| | | * |
| | | * @param uid
|
| | | * @param rate
|
| | | * @param order
|
| | | * @throws ShareGoodsActivityOrderException
|
| | | */
|
| | | public void addShareGoodsActivityOrder(Long uid, BigDecimal rate, Order order)
|
| | | throws ShareGoodsActivityOrderException;
|
| | |
|
| | | /**
|
| | | * 查询用户的分享活动订单
|
| | | * |
| | | * @param uid
|
| | | * @return
|
| | | */
|
| | | public long countShareGoodsActivityOrder(Long uid);
|
| | |
|
| | | /**
|
| | | * 查询分享活动(根据订单号与用户ID)
|
| | | * |
| | | * @param uid
|
| | | * @param orderId
|
| | | * @return
|
| | | */
|
| | | public List<ShareGoodsActivityOrder> listByOrderIdAndUid(Long uid, Long orderId);
|
| | |
|
| | | }
|
| | |
| | | return null;
|
| | | }
|
| | |
|
| | | public static void getTaoBaoOrder(String appKey, String appSecret) {
|
| | | Map<String, String> map = new HashMap<>();
|
| | | map.put("method", "taobao.tbk.order.get");
|
| | | map.put("fields",
|
| | | "tb_trade_parent_id,tb_trade_id,num_iid,item_title,item_num,price,pay_price,seller_nick,seller_shop_title,commission,commission_rate,unid,create_time,earning_time,tk_status,tk3rd_pub_id,tk3rd_site_id,tk3rd_adzone_id,relation_id,tb_trade_parent_id,tb_trade_id,num_iid,item_title,item_num,price,pay_price,seller_nick,seller_shop_title,commission,commission_rate,unid,create_time,earning_time,tk3rd_pub_id,tk3rd_site_id,tk3rd_adzone_id,special_id,click_time,relation_id,special_id");
|
| | | map.put("start_time", "2019-01-27 21:23:00");
|
| | | map.put("span", "1200");
|
| | | map.put("tk_status", "1");
|
| | | map.put("order_query_type","create_time");
|
| | | map.put("page_no", 1+"");
|
| | | map.put("page_size", 100+"");
|
| | | |
| | | |
| | | |
| | | |
| | |
|
| | | TaoKeAppInfo app = new TaoKeAppInfo();
|
| | | app.setAppKey(appKey);
|
| | | app.setAppSecret(appSecret);
|
| | | try {
|
| | | JSONObject json = TaoKeBaseUtil.baseRequest(map, app);
|
| | | System.out.println(json.toString());
|
| | | } catch (TaoKeApiException e) {
|
| | | e.printStackTrace();
|
| | | }
|
| | |
|
| | | }
|
| | |
|
| | | // AA5ISJ
|
| | |
|
| | | private static TaoBaoGoodsBrief parseWuLiaoItemFromMaterialId(JSONObject item) {
|