admin
2019-06-10 a611b251f7486cc0e14cdf5bb26265f18956c068
拼多多商品与订单添加
1个文件已修改
7个文件已添加
1203 ■■■■■ 已修改文件
fanli/src/main/java/com/yeshi/fanli/dao/mybatis/pdd/PDDOrderMapper.java 8 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/dto/pdd/PDDGoodsDetail.java 472 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/dto/pdd/PDDGoodsResult.java 32 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/dto/pdd/PDDOrderResult.java 34 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/dto/pdd/PDDSearchFilter.java 94 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/entity/pdd/PDDOrder.java 280 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/mapping/pdd/PDDOrderMapper.xml 181 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/util/pinduoduo/PinDuoDuoApiUtil.java 102 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/dao/mybatis/pdd/PDDOrderMapper.java
New file
@@ -0,0 +1,8 @@
package com.yeshi.fanli.dao.mybatis.pdd;
import com.yeshi.fanli.dao.BaseMapper;
import com.yeshi.fanli.entity.pdd.PDDOrder;
public interface PDDOrderMapper extends BaseMapper<PDDOrder> {
}
fanli/src/main/java/com/yeshi/fanli/dto/pdd/PDDGoodsDetail.java
New file
@@ -0,0 +1,472 @@
package com.yeshi.fanli.dto.pdd;
import java.math.BigDecimal;
import com.google.gson.annotations.SerializedName;
public class PDDGoodsDetail {
    @SerializedName("goods_id")
    private Long goodsId;// 商品id
    @SerializedName("has_mall_coupon")
    private Boolean hasMallCoupon;// 是否有店铺券
    @SerializedName("mall_coupon_id")
    private Long mallCouponId;// 店铺券id
    @SerializedName("mall_coupon_discount_pct")
    private Integer mallCouponDiscountPct;// 店铺券折扣
    @SerializedName("mall_coupon_min_order_amount")
    private Integer mallCouponMinOrderAmount;// 最小使用金额
    @SerializedName("mall_coupon_max_discount_amount")
    private Integer mallCouponMaxDiscountAmount;// 最大使用金额
    @SerializedName("mall_coupon_total_quantity")
    private Long mallCouponTotalQuantity;// 店铺券总量
    @SerializedName("mall_coupon_remain_quantity")
    private Long mallCouponRemainQuantity;// 店铺券余量
    @SerializedName("mall_coupon_start_time")
    private Long mallCouponStartTime;// 店铺券开始使用时间
    @SerializedName("mall_coupon_end_time")
    private Long mallCouponEndTime;// 店铺券结束使用时间
    @SerializedName("create_at")
    private Long createAt;// 创建时间(unix时间戳)
    @SerializedName("goods_name")
    private String goodsName; // 商品名称
    @SerializedName("goods_desc")
    private String goodsDesc;// 商品描述
    @SerializedName("goods_thumbnail_url")
    private String goodsThumbnailUrl; // 商品缩略图
    @SerializedName("goods_image_url")
    private String goodsImageUrl;// 商品主图
    @SerializedName("goods_gallery_urls")
    private String[] goodsGalleryUrls;// 商品轮播图
    @SerializedName("sold_quantity")
    private Long soldQuantity;// 已售卖件数
    @SerializedName("min_group_price")
    private Long minGroupPrice;// 最小拼团价(单位为分)
    @SerializedName("min_normal_price")
    private Long minNormalPrice;// 最小单买价格(单位为分)
    @SerializedName("mall_name")
    private String mallName; // 店铺名字
    @SerializedName("merchant_type")
    private Integer merchantType; // 铺类型,1-个人,2-企业,3-旗舰店,4-专卖店,5-专营店,6-普通店
    @SerializedName("category_id")
    private Long categoryId; // 商品类目ID,使用pdd.goods.cats.get接口获取
    @SerializedName("category_name")
    private String categoryName;// 商品类目名
    @SerializedName("opt_id")
    private Long optId;// 商品标签ID,使用pdd.goods.opts.get接口获取
    @SerializedName("opt_name")
    private String optName;// 商品标签名
    @SerializedName("opt_ids")
    private Long[] optIds; // 商品标签id
    @SerializedName("cat_ids")
    private Long[] catIds; // 商品类目id
    @SerializedName("mall_cps")
    private Integer mallCps; // 该商品所在店铺是否参与全店推广,0:否,1:是
    @SerializedName("has_coupon")
    private Boolean hasCoupon; // 商品是否有优惠券
                                // true-有,false-没有
    @SerializedName("coupon_min_order_amount")
    private Long couponMinOrderAmount; // 优惠券门槛价格,单位为分
    @SerializedName("coupon_discount")
    private Long couponDiscount;// 优惠券面额,单位为分
    @SerializedName("coupon_total_quantity")
    private Long couponTotalQuantity; // 优惠券总数量
    @SerializedName("coupon_remain_quantity")
    private Long couponRemainQuantity; // 优惠券剩余数量
    @SerializedName("coupon_start_time")
    private Long couponStartTime;// 优惠券生效时间,UNIX时间戳
    @SerializedName("coupon_end_time")
    private Long couponEndTime;// 优惠券失效时间,UNIX时间戳
    @SerializedName("promotion_rate")
    private Long promotionRate;// 佣金比例,千分比
    @SerializedName("goods_eval_score")
    private String goodsEvalScore;// 商品评价分
    @SerializedName("goods_eval_count")
    private Long goodsEvalCount;// 商品评价数量
    @SerializedName("avg_desc")
    private Long avgDesc;// 描述评分
    @SerializedName("avg_lgst")
    private Long avgLgst;// 物流评分
    @SerializedName("avg_serv")
    private Long avgServ;// 服务评分
    @SerializedName("desc_pct")
    private BigDecimal descPct;// 描述分击败同类店铺百分比
    @SerializedName("lgst_pct")
    private BigDecimal lgstPct;// 物流分击败同类店铺百分比
    @SerializedName("serv_pct")
    private BigDecimal servPct;// 服务分击败同类店铺百分比
    @SerializedName("sales_tip")
    private String salesTip;// 模糊销量
    @SerializedName("activity_type")
    private Integer activityType;// 活动类型,0-无活动;1-秒杀;3-限量折扣;12-限时折扣;13-大促活动;14-名品折扣;15-品牌清仓;16-食品超市;17-一元幸运团;18-爱逛街;19-时尚穿搭;20-男人帮;21-9块9;22-竞价活动;23-榜单活动;24-幸运半价购;25-定金预售;26-幸运人气购;27-特色主题活动;28-断码清仓;29-一元话费;30-电器城;31-每日好店;32-品牌卡;101-大促搜索池;102-大促品类分会场;
    // mall_id:4217177,cps_sign:null,cat_id:null mall_rate:10
    public Long getGoodsId() {
        return goodsId;
    }
    public void setGoodsId(Long goodsId) {
        this.goodsId = goodsId;
    }
    public Boolean getHasMallCoupon() {
        return hasMallCoupon;
    }
    public void setHasMallCoupon(Boolean hasMallCoupon) {
        this.hasMallCoupon = hasMallCoupon;
    }
    public Long getMallCouponId() {
        return mallCouponId;
    }
    public void setMallCouponId(Long mallCouponId) {
        this.mallCouponId = mallCouponId;
    }
    public Integer getMallCouponDiscountPct() {
        return mallCouponDiscountPct;
    }
    public void setMallCouponDiscountPct(Integer mallCouponDiscountPct) {
        this.mallCouponDiscountPct = mallCouponDiscountPct;
    }
    public Integer getMallCouponMinOrderAmount() {
        return mallCouponMinOrderAmount;
    }
    public void setMallCouponMinOrderAmount(Integer mallCouponMinOrderAmount) {
        this.mallCouponMinOrderAmount = mallCouponMinOrderAmount;
    }
    public Integer getMallCouponMaxDiscountAmount() {
        return mallCouponMaxDiscountAmount;
    }
    public void setMallCouponMaxDiscountAmount(Integer mallCouponMaxDiscountAmount) {
        this.mallCouponMaxDiscountAmount = mallCouponMaxDiscountAmount;
    }
    public Long getMallCouponTotalQuantity() {
        return mallCouponTotalQuantity;
    }
    public void setMallCouponTotalQuantity(Long mallCouponTotalQuantity) {
        this.mallCouponTotalQuantity = mallCouponTotalQuantity;
    }
    public Long getMallCouponRemainQuantity() {
        return mallCouponRemainQuantity;
    }
    public void setMallCouponRemainQuantity(Long mallCouponRemainQuantity) {
        this.mallCouponRemainQuantity = mallCouponRemainQuantity;
    }
    public Long getMallCouponStartTime() {
        return mallCouponStartTime;
    }
    public void setMallCouponStartTime(Long mallCouponStartTime) {
        this.mallCouponStartTime = mallCouponStartTime;
    }
    public Long getMallCouponEndTime() {
        return mallCouponEndTime;
    }
    public void setMallCouponEndTime(Long mallCouponEndTime) {
        this.mallCouponEndTime = mallCouponEndTime;
    }
    public Long getCreateAt() {
        return createAt;
    }
    public void setCreateAt(Long createAt) {
        this.createAt = createAt;
    }
    public String getGoodsName() {
        return goodsName;
    }
    public void setGoodsName(String goodsName) {
        this.goodsName = goodsName;
    }
    public String getGoodsDesc() {
        return goodsDesc;
    }
    public void setGoodsDesc(String goodsDesc) {
        this.goodsDesc = goodsDesc;
    }
    public String getGoodsThumbnailUrl() {
        return goodsThumbnailUrl;
    }
    public void setGoodsThumbnailUrl(String goodsThumbnailUrl) {
        this.goodsThumbnailUrl = goodsThumbnailUrl;
    }
    public String getGoodsImageUrl() {
        return goodsImageUrl;
    }
    public void setGoodsImageUrl(String goodsImageUrl) {
        this.goodsImageUrl = goodsImageUrl;
    }
    public String[] getGoodsGalleryUrls() {
        return goodsGalleryUrls;
    }
    public void setGoodsGalleryUrls(String[] goodsGalleryUrls) {
        this.goodsGalleryUrls = goodsGalleryUrls;
    }
    public Long getSoldQuantity() {
        return soldQuantity;
    }
    public void setSoldQuantity(Long soldQuantity) {
        this.soldQuantity = soldQuantity;
    }
    public Long getMinGroupPrice() {
        return minGroupPrice;
    }
    public void setMinGroupPrice(Long minGroupPrice) {
        this.minGroupPrice = minGroupPrice;
    }
    public Long getMinNormalPrice() {
        return minNormalPrice;
    }
    public void setMinNormalPrice(Long minNormalPrice) {
        this.minNormalPrice = minNormalPrice;
    }
    public String getMallName() {
        return mallName;
    }
    public void setMallName(String mallName) {
        this.mallName = mallName;
    }
    public Integer getMerchantType() {
        return merchantType;
    }
    public void setMerchantType(Integer merchantType) {
        this.merchantType = merchantType;
    }
    public Long getCategoryId() {
        return categoryId;
    }
    public void setCategoryId(Long categoryId) {
        this.categoryId = categoryId;
    }
    public String getCategoryName() {
        return categoryName;
    }
    public void setCategoryName(String categoryName) {
        this.categoryName = categoryName;
    }
    public Long getOptId() {
        return optId;
    }
    public void setOptId(Long optId) {
        this.optId = optId;
    }
    public String getOptName() {
        return optName;
    }
    public void setOptName(String optName) {
        this.optName = optName;
    }
    public Long[] getOptIds() {
        return optIds;
    }
    public void setOptIds(Long[] optIds) {
        this.optIds = optIds;
    }
    public Long[] getCatIds() {
        return catIds;
    }
    public void setCatIds(Long[] catIds) {
        this.catIds = catIds;
    }
    public Integer getMallCps() {
        return mallCps;
    }
    public void setMallCps(Integer mallCps) {
        this.mallCps = mallCps;
    }
    public Boolean getHasCoupon() {
        return hasCoupon;
    }
    public void setHasCoupon(Boolean hasCoupon) {
        this.hasCoupon = hasCoupon;
    }
    public Long getCouponMinOrderAmount() {
        return couponMinOrderAmount;
    }
    public void setCouponMinOrderAmount(Long couponMinOrderAmount) {
        this.couponMinOrderAmount = couponMinOrderAmount;
    }
    public Long getCouponDiscount() {
        return couponDiscount;
    }
    public void setCouponDiscount(Long couponDiscount) {
        this.couponDiscount = couponDiscount;
    }
    public Long getCouponTotalQuantity() {
        return couponTotalQuantity;
    }
    public void setCouponTotalQuantity(Long couponTotalQuantity) {
        this.couponTotalQuantity = couponTotalQuantity;
    }
    public Long getCouponRemainQuantity() {
        return couponRemainQuantity;
    }
    public void setCouponRemainQuantity(Long couponRemainQuantity) {
        this.couponRemainQuantity = couponRemainQuantity;
    }
    public Long getCouponStartTime() {
        return couponStartTime;
    }
    public void setCouponStartTime(Long couponStartTime) {
        this.couponStartTime = couponStartTime;
    }
    public Long getCouponEndTime() {
        return couponEndTime;
    }
    public void setCouponEndTime(Long couponEndTime) {
        this.couponEndTime = couponEndTime;
    }
    public Long getPromotionRate() {
        return promotionRate;
    }
    public void setPromotionRate(Long promotionRate) {
        this.promotionRate = promotionRate;
    }
    public String getGoodsEvalScore() {
        return goodsEvalScore;
    }
    public void setGoodsEvalScore(String goodsEvalScore) {
        this.goodsEvalScore = goodsEvalScore;
    }
    public Long getGoodsEvalCount() {
        return goodsEvalCount;
    }
    public void setGoodsEvalCount(Long goodsEvalCount) {
        this.goodsEvalCount = goodsEvalCount;
    }
    public Long getAvgDesc() {
        return avgDesc;
    }
    public void setAvgDesc(Long avgDesc) {
        this.avgDesc = avgDesc;
    }
    public Long getAvgLgst() {
        return avgLgst;
    }
    public void setAvgLgst(Long avgLgst) {
        this.avgLgst = avgLgst;
    }
    public Long getAvgServ() {
        return avgServ;
    }
    public void setAvgServ(Long avgServ) {
        this.avgServ = avgServ;
    }
    public BigDecimal getDescPct() {
        return descPct;
    }
    public void setDescPct(BigDecimal descPct) {
        this.descPct = descPct;
    }
    public BigDecimal getLgstPct() {
        return lgstPct;
    }
    public void setLgstPct(BigDecimal lgstPct) {
        this.lgstPct = lgstPct;
    }
    public BigDecimal getServPct() {
        return servPct;
    }
    public void setServPct(BigDecimal servPct) {
        this.servPct = servPct;
    }
    public String getSalesTip() {
        return salesTip;
    }
    public void setSalesTip(String salesTip) {
        this.salesTip = salesTip;
    }
    public Integer getActivityType() {
        return activityType;
    }
    public void setActivityType(Integer activityType) {
        this.activityType = activityType;
    }
}
fanli/src/main/java/com/yeshi/fanli/dto/pdd/PDDGoodsResult.java
New file
@@ -0,0 +1,32 @@
package com.yeshi.fanli.dto.pdd;
import java.util.List;
public class PDDGoodsResult {
    private int totalCount;// 总数量
    private List<PDDGoodsDetail> goodsList;// 商品列表
    public PDDGoodsResult() {
    }
    public PDDGoodsResult(int totalCount, List<PDDGoodsDetail> goodsList) {
        this.totalCount = totalCount;
        this.goodsList = goodsList;
    }
    public int getTotalCount() {
        return totalCount;
    }
    public void setTotalCount(int totalCount) {
        this.totalCount = totalCount;
    }
    public List<PDDGoodsDetail> getGoodsList() {
        return goodsList;
    }
    public void setGoodsList(List<PDDGoodsDetail> goodsList) {
        this.goodsList = goodsList;
    }
}
fanli/src/main/java/com/yeshi/fanli/dto/pdd/PDDOrderResult.java
New file
@@ -0,0 +1,34 @@
package com.yeshi.fanli.dto.pdd;
import java.util.List;
import com.yeshi.fanli.entity.pdd.PDDOrder;
public class PDDOrderResult {
    private int totalCount;// 总数量
    private List<PDDOrder> orderList;// 商品列表
    public PDDOrderResult() {
    }
    public PDDOrderResult(int totalCount, List<PDDOrder> orderList) {
        this.totalCount = totalCount;
        this.orderList = orderList;
    }
    public int getTotalCount() {
        return totalCount;
    }
    public void setTotalCount(int totalCount) {
        this.totalCount = totalCount;
    }
    public List<PDDOrder> getGoodsList() {
        return orderList;
    }
    public void setGoodsList(List<PDDOrder> orderList) {
        this.orderList = orderList;
    }
}
fanli/src/main/java/com/yeshi/fanli/dto/pdd/PDDSearchFilter.java
New file
@@ -0,0 +1,94 @@
package com.yeshi.fanli.dto.pdd;
public class PDDSearchFilter {
    private String kw;// 关键字
    private Long optId;// 标签类目ID
    private Integer page;// 页码
    private Integer pageSize;// 页数量
    private Integer sortType;// 排序类型
    private Boolean hasCoupon;// 是否有券
    private Long catId;// 分类ID
    private Long[] goodsIdList;// 商品列表ID
    private Integer merchantType;// 卖家类型
    private String pid;// 推广位ID
    public String getKw() {
        return kw;
    }
    public void setKw(String kw) {
        this.kw = kw;
    }
    public Long getOptId() {
        return optId;
    }
    public void setOptId(Long optId) {
        this.optId = optId;
    }
    public Integer getPage() {
        return page;
    }
    public void setPage(Integer page) {
        this.page = page;
    }
    public Integer getPageSize() {
        return pageSize;
    }
    public void setPageSize(Integer pageSize) {
        this.pageSize = pageSize;
    }
    public Integer getSortType() {
        return sortType;
    }
    public void setSortType(Integer sortType) {
        this.sortType = sortType;
    }
    public Boolean getHasCoupon() {
        return hasCoupon;
    }
    public void setHasCoupon(Boolean hasCoupon) {
        this.hasCoupon = hasCoupon;
    }
    public Long getCatId() {
        return catId;
    }
    public void setCatId(Long catId) {
        this.catId = catId;
    }
    public Long[] getGoodsIdList() {
        return goodsIdList;
    }
    public void setGoodsIdList(Long[] goodsIdList) {
        this.goodsIdList = goodsIdList;
    }
    public Integer getMerchantType() {
        return merchantType;
    }
    public void setMerchantType(Integer merchantType) {
        this.merchantType = merchantType;
    }
    public String getPid() {
        return pid;
    }
    public void setPid(String pid) {
        this.pid = pid;
    }
}
fanli/src/main/java/com/yeshi/fanli/entity/pdd/PDDOrder.java
New file
@@ -0,0 +1,280 @@
package com.yeshi.fanli.entity.pdd;
import java.util.Date;
import org.yeshi.utils.mybatis.Column;
import org.yeshi.utils.mybatis.Table;
import com.google.gson.annotations.SerializedName;
/**
 * 拼多多订单
 *
 * @author Administrator
 *
 */
@Table("yeshi_ec_pdd_order")
public class PDDOrder {
    @Column(name = "po_id")
    private Long id;
    @SerializedName("order_sn")
    @Column(name = "po_order_sn")
    private String orderSn;// 推广订单编号
    @SerializedName("goods_id")
    @Column(name = "po_goods_id")
    private Long goodsId;// 商品ID
    @SerializedName("group_id")
    @Column(name = "po_group_id")
    private Long groupId;// 成团ID
    @SerializedName("goods_name")
    @Column(name = "po_goods_name")
    private String goodsName;// 商品标题
    @SerializedName("goods_thumbnail_url")
    @Column(name = "po_goods_thumbnail_url")
    private String goodsThumbnailUrl;// 商品缩略图
    @SerializedName("goods_quantity")
    @Column(name = "po_goods_quantity")
    private Integer goodsQuantity;// 购买商品的数量
    @SerializedName("goods_price")
    @Column(name = "po_goods_price")
    private Long goodsPrice;// 订单中sku的单件价格,单位为分
    @SerializedName("order_amount")
    @Column(name = "po_order_amount")
    private Long orderAmount;// 实际支付金额,单位为分
    @SerializedName("p_id")
    @Column(name = "po_p_id")
    private String pId;// 推广位ID
    @SerializedName("promotion_rate")
    @Column(name = "po_promotion_rate")
    private Long promotionRate;// 佣金比例,千分比
    @SerializedName("promotion_amount")
    @Column(name = "po_promotion_amount")
    private Long promotionAmount;// 佣金金额,单位为分
    @SerializedName("order_status")
    @Column(name = "po_order_status")
    private Integer orderStatus;// 订单状态: -1 未支付;
                                // 0-已支付;1-已成团;2-确认收货;3-审核成功;4-审核失败(不可提现);5-已经结算;8-非多多进宝商品(无佣金订单)
    @SerializedName("order_status_desc")
    @Column(name = "po_order_status_desc")
    private String orderStatusDesc;// 订单状态描述
    @SerializedName("order_create_time")
    @Column(name = "po_order_create_time")
    private Long orderCreateTime;// 订单生成时间,UNIX时间戳
    @SerializedName("order_pay_time")
    @Column(name = "po_order_pay_time")
    private Long orderPayTime;// 支付时间
    @SerializedName("order_group_success_time")
    @Column(name = "po_order_group_success_time")
    private Long orderGroupSuccessTime;// 成团时间
    @SerializedName("order_verify_time")
    @Column(name = "po_order_verify_time")
    private Long orderVerifyTime;// 审核时间
    @SerializedName("order_modify_at")
    @Column(name = "po_order_modify_at")
    private Long orderModifyAt;// 最后更新时间
    @SerializedName("custom_parameters")
    @Column(name = "po_custom_parameters")
    private String customParameters;// 自定义参数
    @SerializedName("order_settle_time")
    @Column(name = "po_order_settle_time")
    private Long orderSettleTime;// 订单结算时间
    @SerializedName("order_id")
    @Column(name = "po_order_id")
    private String orderId;// 订单编号
    @Column(name = "po_create_time")
    private Date createTime;// 创建时间
    @Column(name = "po_update_time")
    private Date updateTime;// 更新时间
    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 getId() {
        return id;
    }
    public void setId(Long id) {
        this.id = id;
    }
    public String getOrderSn() {
        return orderSn;
    }
    public void setOrderSn(String orderSn) {
        this.orderSn = orderSn;
    }
    public Long getGoodsId() {
        return goodsId;
    }
    public void setGoodsId(Long goodsId) {
        this.goodsId = goodsId;
    }
    public Long getGroupId() {
        return groupId;
    }
    public void setGroupId(Long groupId) {
        this.groupId = groupId;
    }
    public String getGoodsName() {
        return goodsName;
    }
    public void setGoodsName(String goodsName) {
        this.goodsName = goodsName;
    }
    public String getGoodsThumbnailUrl() {
        return goodsThumbnailUrl;
    }
    public void setGoodsThumbnailUrl(String goodsThumbnailUrl) {
        this.goodsThumbnailUrl = goodsThumbnailUrl;
    }
    public Integer getGoodsQuantity() {
        return goodsQuantity;
    }
    public void setGoodsQuantity(Integer goodsQuantity) {
        this.goodsQuantity = goodsQuantity;
    }
    public Long getGoodsPrice() {
        return goodsPrice;
    }
    public void setGoodsPrice(Long goodsPrice) {
        this.goodsPrice = goodsPrice;
    }
    public Long getOrderAmount() {
        return orderAmount;
    }
    public void setOrderAmount(Long orderAmount) {
        this.orderAmount = orderAmount;
    }
    public String getpId() {
        return pId;
    }
    public void setpId(String pId) {
        this.pId = pId;
    }
    public Long getPromotionRate() {
        return promotionRate;
    }
    public void setPromotionRate(Long promotionRate) {
        this.promotionRate = promotionRate;
    }
    public Long getPromotionAmount() {
        return promotionAmount;
    }
    public void setPromotionAmount(Long promotionAmount) {
        this.promotionAmount = promotionAmount;
    }
    public Integer getOrderStatus() {
        return orderStatus;
    }
    public void setOrderStatus(Integer orderStatus) {
        this.orderStatus = orderStatus;
    }
    public String getOrderStatusDesc() {
        return orderStatusDesc;
    }
    public void setOrderStatusDesc(String orderStatusDesc) {
        this.orderStatusDesc = orderStatusDesc;
    }
    public Long getOrderCreateTime() {
        return orderCreateTime;
    }
    public void setOrderCreateTime(Long orderCreateTime) {
        this.orderCreateTime = orderCreateTime;
    }
    public Long getOrderPayTime() {
        return orderPayTime;
    }
    public void setOrderPayTime(Long orderPayTime) {
        this.orderPayTime = orderPayTime;
    }
    public Long getOrderGroupSuccessTime() {
        return orderGroupSuccessTime;
    }
    public void setOrderGroupSuccessTime(Long orderGroupSuccessTime) {
        this.orderGroupSuccessTime = orderGroupSuccessTime;
    }
    public Long getOrderVerifyTime() {
        return orderVerifyTime;
    }
    public void setOrderVerifyTime(Long orderVerifyTime) {
        this.orderVerifyTime = orderVerifyTime;
    }
    public Long getOrderModifyAt() {
        return orderModifyAt;
    }
    public void setOrderModifyAt(Long orderModifyAt) {
        this.orderModifyAt = orderModifyAt;
    }
    public String getCustomParameters() {
        return customParameters;
    }
    public void setCustomParameters(String customParameters) {
        this.customParameters = customParameters;
    }
    public Long getOrderSettleTime() {
        return orderSettleTime;
    }
    public void setOrderSettleTime(Long orderSettleTime) {
        this.orderSettleTime = orderSettleTime;
    }
    public String getOrderId() {
        return orderId;
    }
    public void setOrderId(String orderId) {
        this.orderId = orderId;
    }
}
fanli/src/main/java/com/yeshi/fanli/mapping/pdd/PDDOrderMapper.xml
New file
@@ -0,0 +1,181 @@
<?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.entity.dao.PDDOrderMapper">
    <resultMap id="BaseResultMap" type="com.yeshi.fanli.entity.pdd.PDDOrder">
        <id column="po_id" property="id" jdbcType="BIGINT" />
        <result column="po_order_sn" property="orderSn" jdbcType="VARCHAR" />
        <result column="po_goods_id" property="goodsId" jdbcType="BIGINT" />
        <result column="po_group_id" property="groupId" jdbcType="BIGINT" />
        <result column="po_goods_name" property="goodsName" jdbcType="VARCHAR" />
        <result column="po_goods_thumbnail_url" property="goodsThumbnailUrl"
            jdbcType="VARCHAR" />
        <result column="po_goods_quantity" property="goodsQuantity"
            jdbcType="INTEGER" />
        <result column="po_goods_price" property="goodsPrice" jdbcType="BIGINT" />
        <result column="po_order_amount" property="orderAmount"
            jdbcType="BIGINT" />
        <result column="po_p_id" property="pId" jdbcType="VARCHAR" />
        <result column="po_promotion_rate" property="promotionRate"
            jdbcType="BIGINT" />
        <result column="po_promotion_amount" property="promotionAmount"
            jdbcType="BIGINT" />
        <result column="po_order_status" property="orderStatus"
            jdbcType="INTEGER" />
        <result column="po_order_status_desc" property="orderStatusDesc"
            jdbcType="VARCHAR" />
        <result column="po_order_create_time" property="orderCreateTime"
            jdbcType="BIGINT" />
        <result column="po_order_pay_time" property="orderPayTime"
            jdbcType="BIGINT" />
        <result column="po_order_group_success_time" property="orderGroupSuccessTime"
            jdbcType="BIGINT" />
        <result column="po_order_verify_time" property="orderVerifyTime"
            jdbcType="BIGINT" />
        <result column="po_order_modify_at" property="orderModifyAt"
            jdbcType="BIGINT" />
        <result column="po_custom_parameters" property="customParameters"
            jdbcType="VARCHAR" />
        <result column="po_order_settle_time" property="orderSettleTime"
            jdbcType="BIGINT" />
        <result column="po_order_id" property="orderId" jdbcType="VARCHAR" />
        <result column="po_create_time" property="createTime" jdbcType="TIMESTAMP" />
        <result column="po_update_time" property="updateTime" jdbcType="TIMESTAMP" />
    </resultMap>
    <sql id="Base_Column_List">po_id,po_order_sn,po_goods_id,po_group_id,po_goods_name,po_goods_thumbnail_url,po_goods_quantity,po_goods_price,po_order_amount,po_p_id,po_promotion_rate,po_promotion_amount,po_order_status,po_order_status_desc,po_order_create_time,po_order_pay_time,po_order_group_success_time,po_order_verify_time,po_order_modify_at,po_custom_parameters,po_order_settle_time,po_order_id,po_create_time,po_update_time
    </sql>
    <select id="selectByPrimaryKey" resultMap="BaseResultMap"
        parameterType="java.lang.Long">
        select
        <include refid="Base_Column_List" />
        from yeshi_ec_pdd_order where po_id = #{id,jdbcType=BIGINT}
    </select>
    <delete id="deleteByPrimaryKey" parameterType="java.lang.Long">delete from
        yeshi_ec_pdd_order where po_id = #{id,jdbcType=BIGINT}</delete>
    <insert id="insert" parameterType="com.yeshi.fanli.entity.pdd.PDDOrder"
        useGeneratedKeys="true" keyProperty="id">insert into yeshi_ec_pdd_order
        (po_id,po_order_sn,po_goods_id,po_group_id,po_goods_name,po_goods_thumbnail_url,po_goods_quantity,po_goods_price,po_order_amount,po_p_id,po_promotion_rate,po_promotion_amount,po_order_status,po_order_status_desc,po_order_create_time,po_order_pay_time,po_order_group_success_time,po_order_verify_time,po_order_modify_at,po_custom_parameters,po_order_settle_time,po_order_id,po_create_time,po_update_time)
        values
        (#{id,jdbcType=BIGINT},#{orderSn,jdbcType=VARCHAR},#{goodsId,jdbcType=BIGINT},#{groupId,jdbcType=BIGINT},#{goodsName,jdbcType=VARCHAR},#{goodsThumbnailUrl,jdbcType=VARCHAR},#{goodsQuantity,jdbcType=INTEGER},#{goodsPrice,jdbcType=BIGINT},#{orderAmount,jdbcType=BIGINT},#{pId,jdbcType=VARCHAR},#{promotionRate,jdbcType=BIGINT},#{promotionAmount,jdbcType=BIGINT},#{orderStatus,jdbcType=INTEGER},#{orderStatusDesc,jdbcType=VARCHAR},#{orderCreateTime,jdbcType=BIGINT},#{orderPayTime,jdbcType=BIGINT},#{orderGroupSuccessTime,jdbcType=BIGINT},#{orderVerifyTime,jdbcType=BIGINT},#{orderModifyAt,jdbcType=BIGINT},#{customParameters,jdbcType=VARCHAR},#{orderSettleTime,jdbcType=BIGINT},#{orderId,jdbcType=VARCHAR},#{createTime,jdbcType=TIMESTAMP},#{updateTime,jdbcType=TIMESTAMP})
    </insert>
    <insert id="insertSelective" parameterType="com.yeshi.fanli.entity.pdd.PDDOrder"
        useGeneratedKeys="true" keyProperty="id">
        insert into yeshi_ec_pdd_order
        <trim prefix="(" suffix=")" suffixOverrides=",">
            <if test="id != null">po_id,</if>
            <if test="orderSn != null">po_order_sn,</if>
            <if test="goodsId != null">po_goods_id,</if>
            <if test="groupId != null">po_group_id,</if>
            <if test="goodsName != null">po_goods_name,</if>
            <if test="goodsThumbnailUrl != null">po_goods_thumbnail_url,</if>
            <if test="goodsQuantity != null">po_goods_quantity,</if>
            <if test="goodsPrice != null">po_goods_price,</if>
            <if test="orderAmount != null">po_order_amount,</if>
            <if test="pId != null">po_p_id,</if>
            <if test="promotionRate != null">po_promotion_rate,</if>
            <if test="promotionAmount != null">po_promotion_amount,</if>
            <if test="orderStatus != null">po_order_status,</if>
            <if test="orderStatusDesc != null">po_order_status_desc,</if>
            <if test="orderCreateTime != null">po_order_create_time,</if>
            <if test="orderPayTime != null">po_order_pay_time,</if>
            <if test="orderGroupSuccessTime != null">po_order_group_success_time,</if>
            <if test="orderVerifyTime != null">po_order_verify_time,</if>
            <if test="orderModifyAt != null">po_order_modify_at,</if>
            <if test="customParameters != null">po_custom_parameters,</if>
            <if test="orderSettleTime != null">po_order_settle_time,</if>
            <if test="orderId != null">po_order_id,</if>
            <if test="createTime != null">po_create_time,</if>
            <if test="updateTime != null">po_update_time,</if>
        </trim>
        values
        <trim prefix="(" suffix=")" suffixOverrides=",">
            <if test="id != null">#{id,jdbcType=BIGINT},</if>
            <if test="orderSn != null">#{orderSn,jdbcType=VARCHAR},</if>
            <if test="goodsId != null">#{goodsId,jdbcType=BIGINT},</if>
            <if test="groupId != null">#{groupId,jdbcType=BIGINT},</if>
            <if test="goodsName != null">#{goodsName,jdbcType=VARCHAR},</if>
            <if test="goodsThumbnailUrl != null">#{goodsThumbnailUrl,jdbcType=VARCHAR},</if>
            <if test="goodsQuantity != null">#{goodsQuantity,jdbcType=INTEGER},</if>
            <if test="goodsPrice != null">#{goodsPrice,jdbcType=BIGINT},</if>
            <if test="orderAmount != null">#{orderAmount,jdbcType=BIGINT},</if>
            <if test="pId != null">#{pId,jdbcType=VARCHAR},</if>
            <if test="promotionRate != null">#{promotionRate,jdbcType=BIGINT},</if>
            <if test="promotionAmount != null">#{promotionAmount,jdbcType=BIGINT},</if>
            <if test="orderStatus != null">#{orderStatus,jdbcType=INTEGER},</if>
            <if test="orderStatusDesc != null">#{orderStatusDesc,jdbcType=VARCHAR},</if>
            <if test="orderCreateTime != null">#{orderCreateTime,jdbcType=BIGINT},</if>
            <if test="orderPayTime != null">#{orderPayTime,jdbcType=BIGINT},</if>
            <if test="orderGroupSuccessTime != null">#{orderGroupSuccessTime,jdbcType=BIGINT},</if>
            <if test="orderVerifyTime != null">#{orderVerifyTime,jdbcType=BIGINT},</if>
            <if test="orderModifyAt != null">#{orderModifyAt,jdbcType=BIGINT},</if>
            <if test="customParameters != null">#{customParameters,jdbcType=VARCHAR},</if>
            <if test="orderSettleTime != null">#{orderSettleTime,jdbcType=BIGINT},</if>
            <if test="orderId != null">#{orderId,jdbcType=VARCHAR},</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.pdd.PDDOrder">update
        yeshi_ec_pdd_order set po_order_sn =
        #{orderSn,jdbcType=VARCHAR},po_goods_id =
        #{goodsId,jdbcType=BIGINT},po_group_id =
        #{groupId,jdbcType=BIGINT},po_goods_name =
        #{goodsName,jdbcType=VARCHAR},po_goods_thumbnail_url =
        #{goodsThumbnailUrl,jdbcType=VARCHAR},po_goods_quantity =
        #{goodsQuantity,jdbcType=INTEGER},po_goods_price =
        #{goodsPrice,jdbcType=BIGINT},po_order_amount =
        #{orderAmount,jdbcType=BIGINT},po_p_id =
        #{pId,jdbcType=VARCHAR},po_promotion_rate =
        #{promotionRate,jdbcType=BIGINT},po_promotion_amount =
        #{promotionAmount,jdbcType=BIGINT},po_order_status =
        #{orderStatus,jdbcType=INTEGER},po_order_status_desc =
        #{orderStatusDesc,jdbcType=VARCHAR},po_order_create_time =
        #{orderCreateTime,jdbcType=BIGINT},po_order_pay_time =
        #{orderPayTime,jdbcType=BIGINT},po_order_group_success_time =
        #{orderGroupSuccessTime,jdbcType=BIGINT},po_order_verify_time =
        #{orderVerifyTime,jdbcType=BIGINT},po_order_modify_at =
        #{orderModifyAt,jdbcType=BIGINT},po_custom_parameters =
        #{customParameters,jdbcType=VARCHAR},po_order_settle_time =
        #{orderSettleTime,jdbcType=BIGINT},po_order_id =
        #{orderId,jdbcType=VARCHAR},po_create_time =
        #{createTime,jdbcType=TIMESTAMP},po_update_time =
        #{updateTime,jdbcType=TIMESTAMP} where po_id = #{id,jdbcType=BIGINT}
    </update>
    <update id="updateByPrimaryKeySelective" parameterType="com.yeshi.fanli.entity.pdd.PDDOrder">
        update yeshi_ec_pdd_order
        <set>
            <if test="orderSn != null">po_order_sn=#{orderSn,jdbcType=VARCHAR},</if>
            <if test="goodsId != null">po_goods_id=#{goodsId,jdbcType=BIGINT},</if>
            <if test="groupId != null">po_group_id=#{groupId,jdbcType=BIGINT},</if>
            <if test="goodsName != null">po_goods_name=#{goodsName,jdbcType=VARCHAR},</if>
            <if test="goodsThumbnailUrl != null">po_goods_thumbnail_url=#{goodsThumbnailUrl,jdbcType=VARCHAR},
            </if>
            <if test="goodsQuantity != null">po_goods_quantity=#{goodsQuantity,jdbcType=INTEGER},</if>
            <if test="goodsPrice != null">po_goods_price=#{goodsPrice,jdbcType=BIGINT},</if>
            <if test="orderAmount != null">po_order_amount=#{orderAmount,jdbcType=BIGINT},</if>
            <if test="pId != null">po_p_id=#{pId,jdbcType=VARCHAR},</if>
            <if test="promotionRate != null">po_promotion_rate=#{promotionRate,jdbcType=BIGINT},</if>
            <if test="promotionAmount != null">po_promotion_amount=#{promotionAmount,jdbcType=BIGINT},
            </if>
            <if test="orderStatus != null">po_order_status=#{orderStatus,jdbcType=INTEGER},</if>
            <if test="orderStatusDesc != null">po_order_status_desc=#{orderStatusDesc,jdbcType=VARCHAR},
            </if>
            <if test="orderCreateTime != null">po_order_create_time=#{orderCreateTime,jdbcType=BIGINT},
            </if>
            <if test="orderPayTime != null">po_order_pay_time=#{orderPayTime,jdbcType=BIGINT},</if>
            <if test="orderGroupSuccessTime != null">po_order_group_success_time=#{orderGroupSuccessTime,jdbcType=BIGINT},
            </if>
            <if test="orderVerifyTime != null">po_order_verify_time=#{orderVerifyTime,jdbcType=BIGINT},
            </if>
            <if test="orderModifyAt != null">po_order_modify_at=#{orderModifyAt,jdbcType=BIGINT},</if>
            <if test="customParameters != null">po_custom_parameters=#{customParameters,jdbcType=VARCHAR},
            </if>
            <if test="orderSettleTime != null">po_order_settle_time=#{orderSettleTime,jdbcType=BIGINT},
            </if>
            <if test="orderId != null">po_order_id=#{orderId,jdbcType=VARCHAR},</if>
            <if test="createTime != null">po_create_time=#{createTime,jdbcType=TIMESTAMP},</if>
            <if test="updateTime != null">po_update_time=#{updateTime,jdbcType=TIMESTAMP},</if>
        </set>
        where po_id = #{id,jdbcType=BIGINT}
    </update>
</mapper>
fanli/src/main/java/com/yeshi/fanli/util/pinduoduo/PinDuoDuoApiUtil.java
@@ -1,6 +1,7 @@
package com.yeshi.fanli.util.pinduoduo;
import java.io.UnsupportedEncodingException;
import java.lang.reflect.Type;
import java.net.URLEncoder;
import java.util.ArrayList;
import java.util.Collections;
@@ -11,11 +12,22 @@
import org.yeshi.utils.HttpUtil;
import com.google.gson.Gson;
import com.google.gson.reflect.TypeToken;
import com.yeshi.fanli.dto.pdd.PDDGoodsDetail;
import com.yeshi.fanli.dto.pdd.PDDGoodsResult;
import com.yeshi.fanli.dto.pdd.PDDOrderResult;
import com.yeshi.fanli.dto.pdd.PDDSearchFilter;
import com.yeshi.fanli.entity.pdd.PDDOrder;
import com.yeshi.fanli.util.StringUtil;
import net.sf.json.JSONArray;
import net.sf.json.JSONObject;
public class PinDuoDuoApiUtil {
    public final static String PID_FANLI = "8590899_72067894";
    public final static String PID_SHARE = "8590899_72067895";
    private final static String CLIENT_ID = "9f6ee5ebd3b94c2080c4d51c2427e9fa";
    private final static String CLIENT_SECRET = "95e1f1904385664bf4b87d4b34de12f9f31c505d";
@@ -55,42 +67,96 @@
        return result;
    }
    public static void searchGoods(String key) {
    public static PDDGoodsResult searchGoods(PDDSearchFilter sf) {
        Map<String, String> map = new HashMap<>();
        map.put("type", "pdd.ddk.goods.search");
        map.put("keyword", key);
        if (sf.getOptId() != null)
            map.put("opt_id", sf.getOptId() + "");
        if (sf.getPage() != null)
            map.put("page", sf.getPage() + "");
        if (sf.getPageSize() != null)
            map.put("page_size", sf.getPageSize() + "");
        if (sf.getSortType() != null)
            map.put("sort_type", sf.getSortType() + "");
        if (sf.getHasCoupon() != null)
            map.put("with_coupon", sf.getHasCoupon() + "");
        if (sf.getCatId() != null)
            map.put("cat_id", sf.getCatId() + "");
        if (sf.getKw() != null)
            map.put("keyword", sf.getKw());
        map.put("pid", PID_FANLI);
        String result = baseRequest(map);
        System.out.println(result);
        JSONObject json = JSONObject.fromObject(result);
        JSONObject root = json.optJSONObject("goods_search_response");
        JSONArray array = root.optJSONArray("goods_list");
        Type type = new TypeToken<List<PDDGoodsDetail>>() {
        }.getType();
        List<PDDGoodsDetail> goodsList = new Gson().fromJson(array.toString(), type);
        int totalCount = json.optInt("total_count");
        return new PDDGoodsResult(totalCount, goodsList);
    }
    public static void convert(Long goodsId) {
    /**
     * 商品转链
     *
     * @param goodsId
     * @param pid
     * @param customParams
     * @return
     */
    public static String convert(Long goodsId, String pid, String customParams) {
        Map<String, String> map = new HashMap<>();
        map.put("type", "pdd.ddk.goods.promotion.url.generate");
        map.put("p_id", "8590899_61877633");
        map.put("p_id", pid);
        map.put("multi_group", "true");
        map.put("generate_weapp_webview", "true");
        map.put("generate_weiboapp_webview", "true");
        JSONArray array = new JSONArray();
        array.add(goodsId);
        map.put("goods_id_list", array.toString());
        map.put("custom_parameters", "437032");
        map.put("custom_parameters", customParams);
        String result = baseRequest(map);
        System.out.println(result);
        JSONObject root = JSONObject.fromObject(result);
        JSONObject json = root.optJSONObject("goods_promotion_url_generate_response");
        array = json.optJSONArray("goods_promotion_url_list");
        if (array != null && array.size() > 0)
            return array.optJSONObject(0).optString("short_url");
        return null;
    }
    public static void createPid() {
        Map<String, String> map = new HashMap<>();
        map.put("type", "pdd.ddk.goods.pid.generate");
        map.put("number", "1");
        map.put("number", "2");
        JSONArray array = new JSONArray();
        array.add("返利PID");
        array.add("分享PID");
        map.put("p_id_name_list", array.toString());
        String result = baseRequest(map);
        System.out.println(result);
    }
    public static void getOrders() {
    public static PDDOrderResult getOrders(int page, int pageSize, long startTime, long endTime) {
        Map<String, String> map = new HashMap<>();
        map.put("type", "pdd.ddk.order.list.increment.get");
        map.put("start_update_time", System.currentTimeMillis() / 1000 - 60 * 60 + "");
        map.put("end_update_time", System.currentTimeMillis() / 1000 + "");
        map.put("start_update_time", startTime / 1000 + "");
        map.put("end_update_time", endTime / 1000 + "");
        map.put("page", page + "");
        map.put("page_size", pageSize + "");
        String result = baseRequest(map);
        System.out.println(result);
        JSONObject json = JSONObject.fromObject(result);
        JSONObject root = json.optJSONObject("order_list_get_response");
        if (root != null) {
            int totalCount = root.optInt("total_count");
            JSONArray array = root.optJSONArray("order_list");
            Type type = new TypeToken<List<PDDOrder>>() {
            }.getType();
            List<PDDOrder> orderList = new Gson().fromJson(array.toString(), type);
            return new PDDOrderResult(totalCount, orderList);
        }
        return null;
    }
    /**
@@ -98,14 +164,22 @@
     * 
     * @param goodsId
     */
    public static void getGoodsDetail(Long goodsId) {
    public static PDDGoodsDetail getGoodsDetail(Long goodsId) {
        JSONArray array = new JSONArray();
        array.add(goodsId);
        Map<String, String> map = new HashMap<>();
        map.put("type", "pdd.ddk.goods.detail");
        map.put("goods_id_list", array.toString());
        String result = baseRequest(map);
        System.out.println(result);
        JSONObject resultJson = JSONObject.fromObject(result);
        JSONObject root = resultJson.optJSONObject("goods_detail_response");
        array = root.optJSONArray("goods_details");
        Type type = new TypeToken<List<PDDGoodsDetail>>() {
        }.getType();
        List<PDDGoodsDetail> goodsList = new Gson().fromJson(array.toString(), type);
        if (goodsList != null && goodsList.size() > 0)
            return goodsList.get(0);
        return null;
    }
}