4个文件已删除
1 文件已重命名
9个文件已修改
5个文件已添加
New file |
| | |
| | | package com.yeshi.fanli.dao.mybatis.taobao; |
| | | |
| | | import com.yeshi.fanli.dao.BaseMapper; |
| | | import com.yeshi.fanli.entity.taobao.TBPid; |
| | | |
| | | public interface TBPidMapper extends BaseMapper<TBPid> { |
| | | |
| | | TBPid selectAvailablePid(String likeStr); |
| | | |
| | | Long count(); |
| | | } |
New file |
| | |
| | | package com.yeshi.fanli.dao.mybatis.taobao; |
| | | |
| | | import java.util.List; |
| | | |
| | | import org.apache.ibatis.annotations.Param; |
| | | |
| | | import com.yeshi.fanli.dao.BaseMapper; |
| | | import com.yeshi.fanli.entity.taobao.TaoBaoCoupon; |
| | | |
| | | public interface TaoBaoCouponMapper extends BaseMapper<TaoBaoCoupon>{ |
| | | |
| | | void deleteBeforeCouponInfo(Long id); |
| | | |
| | | |
| | | List<TaoBaoCoupon> getTaoBaoCouponList(@Param("start") long start, @Param("count") int count, @Param("key") String key); |
| | | |
| | | int getCount(@Param("key")String key); |
| | | |
| | | |
| | | |
| | | List<TaoBaoCoupon> getTaoBaoCouponListBykeys(@Param("start") long start, @Param("count") int count, @Param("list")List<String> list); |
| | | |
| | | |
| | | |
| | | int countTaoBaoCouponListBykeys(@Param("list")List<String> list); |
| | | |
| | | |
| | | TaoBaoCoupon getTaoBaoCouponByActionId(@Param("auctionId") String auctionId); |
| | | } |
New file |
| | |
| | | package com.yeshi.fanli.dao.mybatis.taobao; |
| | | |
| | | import org.apache.ibatis.annotations.Param; |
| | | |
| | | import com.yeshi.fanli.dao.BaseMapper; |
| | | import com.yeshi.fanli.entity.taobao.TaoBaoLink; |
| | | |
| | | public interface TaoBaoLinkMapper extends BaseMapper<TaoBaoLink>{ |
| | | |
| | | TaoBaoLink getTaoBaoLink(@Param("auctionId") Long auctionId, @Param("systemId") Long systemId); |
| | | |
| | | } |
| | |
| | |
|
| | | import java.math.BigDecimal;
|
| | |
|
| | | import javax.persistence.Column;
|
| | | import javax.persistence.Entity;
|
| | | import javax.persistence.GeneratedValue;
|
| | | import javax.persistence.GenerationType;
|
| | | import javax.persistence.Id;
|
| | | import javax.persistence.Table;
|
| | | import javax.persistence.Transient;
|
| | |
|
| | | import org.yeshi.utils.mybatis.Column;
|
| | | import org.yeshi.utils.mybatis.Table;
|
| | |
|
| | | import com.google.gson.annotations.Expose;
|
| | |
|
| | | @Table(name = "yeshi_ec_taobao_coupon")
|
| | | @Entity
|
| | |
|
| | | @Table("yeshi_ec_taobao_coupon")
|
| | | public class TaoBaoCoupon {
|
| | | @Id
|
| | | @GeneratedValue(strategy = GenerationType.AUTO)
|
| | | @Column(name = "id")
|
| | | @Expose
|
| | | private long id;
|
| | | @Column(name = "id")
|
| | | private Long id;
|
| | | |
| | | @Expose
|
| | | @Column(name = "auctionId")
|
| | | private String auctionId;
|
| | | @Column(name = "`title`")
|
| | | |
| | | @Expose
|
| | | @Column(name = "title")
|
| | | private String title;
|
| | | |
| | | @Expose
|
| | | @Column(name = "pictUrl")
|
| | | private String pictUrl;
|
| | | |
| | | @Expose
|
| | | @Column(name = "auctionUrl")
|
| | | private String auctionUrl;
|
| | | |
| | | @Column(name = "classNames")
|
| | | private String classNames; // 分类名称 多级分类/分开
|
| | | @Column(name = "`taobaokeUrl`", length = 1024)
|
| | | |
| | | @Column(name = "taobaokeUrl")
|
| | | private String taobaokeUrl;
|
| | | |
| | | @Expose
|
| | | @Column(name = "zkPrice")
|
| | | private BigDecimal zkPrice; // 无线价格
|
| | | |
| | | @Expose
|
| | | private int biz30day;
|
| | | @Column(name = "biz30day")
|
| | | private Integer biz30day;
|
| | | |
| | | @Expose
|
| | | private double tkRate; // 比例
|
| | | @Column(name = "tkRate")
|
| | | private Double tkRate; // 比例
|
| | | |
| | | @Column(name = "brokerage")
|
| | | private BigDecimal brokerage; // 佣金
|
| | | |
| | | @Column(name = "shopWangWang")
|
| | | private String shopWangWang; // 店铺旺旺
|
| | | private long sellerId;// 卖家Id
|
| | | |
| | | @Column(name = "sellerId")
|
| | | private Long sellerId;// 卖家Id
|
| | | |
| | | @Column(name = "shopTitle")
|
| | | private String shopTitle; // 店铺名称
|
| | | |
| | | @Expose
|
| | | private int shopType; // 平台类型 1-淘宝 2-天猫 0-其他
|
| | | @Column(name = "shopType")
|
| | | private Integer shopType; // 平台类型 1-淘宝 2-天猫 0-其他
|
| | | |
| | | @Column(name = "couponId")
|
| | | private String couponId; // 优惠券ID
|
| | | private int couponSum; // 优惠券总数
|
| | | private int couponCount; // 优惠券剩余量
|
| | | |
| | | @Column(name = "couponSum")
|
| | | private Integer couponSum; // 优惠券总数
|
| | | |
| | | @Column(name = "couponCount")
|
| | | private Integer couponCount; // 优惠券剩余量
|
| | | |
| | | @Expose
|
| | | @Column(name = "couponinfo")
|
| | | private String couponinfo; // 优惠券信息
|
| | | |
| | | @Column(name = "couponStartFee")
|
| | | private BigDecimal couponStartFee; // 优惠券起始金额
|
| | | |
| | | @Column(name = "couponAmount")
|
| | | private BigDecimal couponAmount; // 优惠券金额
|
| | | |
| | | @Expose
|
| | | @Column(name = "quanPrice")
|
| | | private BigDecimal quanPrice;
|
| | | |
| | | @Column(name = "couponBegin")
|
| | | private String couponBegin;
|
| | | |
| | | @Column(name = "couponEnd")
|
| | | private String couponEnd;
|
| | | @Column(name = "couponLink", length = 1024)
|
| | | |
| | | @Column(name = "couponLink")
|
| | | private String couponLink;
|
| | | @Column(name = "generalizeUrl", length = 1024)
|
| | | |
| | | @Column(name = "generalizeUrl")
|
| | | private String generalizeUrl; // 推广URl
|
| | | |
| | | @Expose
|
| | | private int orderby;
|
| | | @Column(name = "orderby")
|
| | | private Integer orderby;
|
| | | |
| | | @Expose
|
| | | private long createtime;
|
| | |
|
| | | @Column(name = "createtime")
|
| | | private Long createtime;
|
| | | |
| | | @Expose
|
| | | @Column(name = "showType")
|
| | | private Integer showType;
|
| | | |
| | | @Expose
|
| | | @Transient
|
| | | private BigDecimal hongbao;
|
| | |
|
| | | @Expose
|
| | | private int showType; //
|
| | |
|
| | | public TaoBaoCoupon() {
|
| | | }
|
| | | |
| | | |
| | | public TaoBaoCoupon() {}
|
| | |
|
| | | public TaoBaoCoupon(long id) {
|
| | | super();
|
| | | this.id = id;
|
| | | }
|
| | |
|
| | | public long getId() {
|
| | | |
| | | public Long getId() {
|
| | | return id;
|
| | | }
|
| | |
|
| | | public void setId(long id) {
|
| | | public void setId(Long id) {
|
| | | this.id = id;
|
| | | }
|
| | |
|
| | | public int getShowType() {
|
| | | return showType;
|
| | | }
|
| | |
|
| | | public void setShowType(int showType) {
|
| | | this.showType = showType;
|
| | | }
|
| | |
|
| | | public BigDecimal getHongbao() {
|
| | | return hongbao;
|
| | | }
|
| | |
|
| | | public void setHongbao(BigDecimal hongbao) {
|
| | | this.hongbao = hongbao;
|
| | | }
|
| | |
|
| | | public BigDecimal getQuanPrice() {
|
| | | return quanPrice;
|
| | | }
|
| | |
|
| | | public void setQuanPrice(BigDecimal quanPrice) {
|
| | | this.quanPrice = quanPrice;
|
| | | }
|
| | |
|
| | | public String getAuctionId() {
|
| | | return auctionId;
|
| | | }
|
| | |
|
| | | public BigDecimal getCouponStartFee() {
|
| | | return couponStartFee;
|
| | | }
|
| | |
|
| | | public int getOrderby() {
|
| | | return orderby;
|
| | | }
|
| | |
|
| | | public void setOrderby(int orderby) {
|
| | | this.orderby = orderby;
|
| | | }
|
| | |
|
| | | public void setCouponStartFee(BigDecimal couponStartFee) {
|
| | | this.couponStartFee = couponStartFee;
|
| | | }
|
| | |
|
| | | public BigDecimal getCouponAmount() {
|
| | | return couponAmount;
|
| | | }
|
| | |
|
| | | public void setCouponAmount(BigDecimal couponAmount) {
|
| | | this.couponAmount = couponAmount;
|
| | | }
|
| | |
|
| | | public void setAuctionId(String auctionId) {
|
| | |
| | | this.zkPrice = zkPrice;
|
| | | }
|
| | |
|
| | | public int getBiz30day() {
|
| | | public Integer getBiz30day() {
|
| | | return biz30day;
|
| | | }
|
| | |
|
| | | public void setBiz30day(int biz30day) {
|
| | | public void setBiz30day(Integer biz30day) {
|
| | | this.biz30day = biz30day;
|
| | | }
|
| | |
|
| | | public double getTkRate() {
|
| | | public Double getTkRate() {
|
| | | return tkRate;
|
| | | }
|
| | |
|
| | | public void setTkRate(double tkRate) {
|
| | | public void setTkRate(Double tkRate) {
|
| | | this.tkRate = tkRate;
|
| | | }
|
| | |
|
| | |
| | | this.shopWangWang = shopWangWang;
|
| | | }
|
| | |
|
| | | public long getSellerId() {
|
| | | public Long getSellerId() {
|
| | | return sellerId;
|
| | | }
|
| | |
|
| | | public void setSellerId(long sellerId) {
|
| | | public void setSellerId(Long sellerId) {
|
| | | this.sellerId = sellerId;
|
| | | }
|
| | |
|
| | |
| | | this.shopTitle = shopTitle;
|
| | | }
|
| | |
|
| | | public int getShopType() {
|
| | | public Integer getShopType() {
|
| | | return shopType;
|
| | | }
|
| | |
|
| | | public void setShopType(int shopType) {
|
| | | public void setShopType(Integer shopType) {
|
| | | this.shopType = shopType;
|
| | | }
|
| | |
|
| | |
| | | this.couponId = couponId;
|
| | | }
|
| | |
|
| | | public int getCouponSum() {
|
| | | public Integer getCouponSum() {
|
| | | return couponSum;
|
| | | }
|
| | |
|
| | | public void setCouponSum(int couponSum) {
|
| | | public void setCouponSum(Integer couponSum) {
|
| | | this.couponSum = couponSum;
|
| | | }
|
| | |
|
| | | public int getCouponCount() {
|
| | | public Integer getCouponCount() {
|
| | | return couponCount;
|
| | | }
|
| | |
|
| | | public void setCouponCount(int couponCount) {
|
| | | public void setCouponCount(Integer couponCount) {
|
| | | this.couponCount = couponCount;
|
| | | }
|
| | |
|
| | | public long getCreatetime() {
|
| | | return createtime;
|
| | | }
|
| | |
|
| | | public void setCreatetime(long createtime) {
|
| | | this.createtime = createtime;
|
| | | }
|
| | |
|
| | | public String getCouponinfo() {
|
| | |
| | |
|
| | | public void setCouponinfo(String couponinfo) {
|
| | | this.couponinfo = couponinfo;
|
| | | }
|
| | |
|
| | | public BigDecimal getCouponStartFee() {
|
| | | return couponStartFee;
|
| | | }
|
| | |
|
| | | public void setCouponStartFee(BigDecimal couponStartFee) {
|
| | | this.couponStartFee = couponStartFee;
|
| | | }
|
| | |
|
| | | public BigDecimal getCouponAmount() {
|
| | | return couponAmount;
|
| | | }
|
| | |
|
| | | public void setCouponAmount(BigDecimal couponAmount) {
|
| | | this.couponAmount = couponAmount;
|
| | | }
|
| | |
|
| | | public BigDecimal getQuanPrice() {
|
| | | return quanPrice;
|
| | | }
|
| | |
|
| | | public void setQuanPrice(BigDecimal quanPrice) {
|
| | | this.quanPrice = quanPrice;
|
| | | }
|
| | |
|
| | | public String getCouponBegin() {
|
| | |
| | | this.generalizeUrl = generalizeUrl;
|
| | | }
|
| | |
|
| | | public Integer getOrderby() {
|
| | | return orderby;
|
| | | }
|
| | |
|
| | | public void setOrderby(Integer orderby) {
|
| | | this.orderby = orderby;
|
| | | }
|
| | |
|
| | | public Long getCreatetime() {
|
| | | return createtime;
|
| | | }
|
| | |
|
| | | public void setCreatetime(Long createtime) {
|
| | | this.createtime = createtime;
|
| | | }
|
| | |
|
| | | public Integer getShowType() {
|
| | | return showType;
|
| | | }
|
| | |
|
| | | public void setShowType(Integer showType) {
|
| | | this.showType = showType;
|
| | | }
|
| | |
|
| | | public BigDecimal getHongbao() {
|
| | | return hongbao;
|
| | | }
|
| | |
|
| | | public void setHongbao(BigDecimal hongbao) {
|
| | | this.hongbao = hongbao;
|
| | | }
|
| | |
|
| | | @Override
|
| | | public int hashCode() {
|
| | | final int prime = 31;
|
| | |
| | | package com.yeshi.fanli.entity.taobao;
|
| | |
|
| | | import javax.persistence.Column;
|
| | | import javax.persistence.Entity;
|
| | | import javax.persistence.GeneratedValue;
|
| | | import javax.persistence.GenerationType;
|
| | | import javax.persistence.Id;
|
| | | import javax.persistence.JoinColumn;
|
| | | import javax.persistence.ManyToOne;
|
| | | import javax.persistence.Table;
|
| | | import javax.persistence.Transient;
|
| | | import org.yeshi.utils.mybatis.Column;
|
| | | import org.yeshi.utils.mybatis.Table;
|
| | |
|
| | | import com.yeshi.fanli.entity.system.BusinessSystem;
|
| | |
|
| | | @Entity
|
| | | @Table(name="yeshi_ec_taobao_link")
|
| | | @Table("yeshi_ec_taobao_link")
|
| | | public class TaoBaoLink {
|
| | | /**
|
| | | * 淘宝ID
|
| | | */
|
| | | @Id
|
| | | @GeneratedValue(strategy=GenerationType.AUTO)
|
| | | @Column(name="id")
|
| | | private Long id;
|
| | |
|
| | | @Column(name="auctionId")
|
| | | private Long auctionId;
|
| | |
|
| | | @ManyToOne
|
| | | @JoinColumn(name="sid")
|
| | | @Column(name="sid")
|
| | | private BusinessSystem system;
|
| | |
|
| | | /**
|
| | | * 淘宝token
|
| | | */
|
| | | @Column(name="taoToken",length=50)
|
| | | @Column(name="taoToken")
|
| | | private String taoToken;
|
| | |
|
| | | /**
|
| | | * 淘宝券链�? |
| | | */
|
| | | @Column(name="couponLink",length=512,insertable=true)
|
| | | @Column(name="couponLink")
|
| | | private String couponLink;
|
| | |
|
| | | /**
|
| | | * 淘宝推广链接
|
| | | */
|
| | | @Column(name="clickUrl",length=512)
|
| | | @Column(name="clickUrl")
|
| | | private String clickUrl;
|
| | | |
| | |
|
| | | @Transient
|
| | |
|
| | | private TaoBaoGoodsBrief goods;
|
| | |
|
| | | public TaoBaoGoodsBrief getGoods() {
|
File was renamed from fanli/src/main/java/com/yeshi/fanli/mapping/TBPidMapper.xml |
| | |
| | | <?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.TBPidMapper"> |
| | | <mapper namespace="com.yeshi.fanli.dao.mybatis.taobao.TBPidMapper"> |
| | | <resultMap id="BaseResultMap" type="com.yeshi.fanli.entity.taobao.TBPid"> |
| | | <id column="id" property="id" jdbcType="BIGINT" /> |
| | | <result column="name" property="name" jdbcType="VARCHAR" /> |
| | |
| | | from yeshi_ec_pid where pid like #{0} and used=0 limit 1 for update |
| | | </select> |
| | | |
| | | <select id="count" resultType="java.lang.Long"> |
| | | SELECT IFNULL(COUNT(id),0) FROM yeshi_ec_pid |
| | | </select> |
| | | |
| | | |
| | | <delete id="deleteByPrimaryKey" parameterType="java.lang.Long">delete from |
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.taobao.TaoBaoCouponMapper"> |
| | | <resultMap id="BaseResultMap" type="com.yeshi.fanli.entity.taobao.TaoBaoCoupon"> |
| | | <id column="id" property="id" jdbcType="BIGINT"/> |
| | | <result column="auctionId" property="auctionId" jdbcType="VARCHAR"/> |
| | | <result column="title" property="title" jdbcType="VARCHAR"/> |
| | | <result column="pictUrl" property="pictUrl" jdbcType="VARCHAR"/> |
| | | <result column="auctionUrl" property="auctionUrl" jdbcType="VARCHAR"/> |
| | | <result column="classNames" property="classNames" jdbcType="VARCHAR"/> |
| | | <result column="taobaokeUrl" property="taobaokeUrl" jdbcType="VARCHAR"/> |
| | | <result column="zkPrice" property="zkPrice" jdbcType="DECIMAL"/> |
| | | <result column="biz30day" property="biz30day" jdbcType="INTEGER"/> |
| | | <result column="tkRate" property="tkRate" jdbcType="VARCHAR"/> |
| | | <result column="brokerage" property="brokerage" jdbcType="DECIMAL"/> |
| | | <result column="shopWangWang" property="shopWangWang" jdbcType="VARCHAR"/> |
| | | <result column="sellerId" property="sellerId" jdbcType="BIGINT"/> |
| | | <result column="shopTitle" property="shopTitle" jdbcType="VARCHAR"/> |
| | | <result column="shopType" property="shopType" jdbcType="INTEGER"/> |
| | | <result column="couponId" property="couponId" jdbcType="VARCHAR"/> |
| | | <result column="couponSum" property="couponSum" jdbcType="INTEGER"/> |
| | | <result column="couponCount" property="couponCount" jdbcType="INTEGER"/> |
| | | <result column="couponinfo" property="couponinfo" jdbcType="VARCHAR"/> |
| | | <result column="couponStartFee" property="couponStartFee" jdbcType="DECIMAL"/> |
| | | <result column="couponAmount" property="couponAmount" jdbcType="DECIMAL"/> |
| | | <result column="quanPrice" property="quanPrice" jdbcType="DECIMAL"/> |
| | | <result column="couponBegin" property="couponBegin" jdbcType="VARCHAR"/> |
| | | <result column="couponEnd" property="couponEnd" jdbcType="VARCHAR"/> |
| | | <result column="couponLink" property="couponLink" jdbcType="VARCHAR"/> |
| | | <result column="generalizeUrl" property="generalizeUrl" jdbcType="VARCHAR"/> |
| | | <result column="orderby" property="orderby" jdbcType="INTEGER"/> |
| | | <result column="createtime" property="createtime" jdbcType="BIGINT"/> |
| | | <result column="showType" property="showType" jdbcType="INTEGER"/> |
| | | </resultMap> |
| | | <sql id="Base_Column_List">id,auctionId,title,pictUrl,auctionUrl,classNames,taobaokeUrl,zkPrice,biz30day,tkRate,brokerage,shopWangWang,sellerId,shopTitle,shopType,couponId,couponSum,couponCount,couponinfo,couponStartFee,couponAmount,quanPrice,couponBegin,couponEnd,couponLink,generalizeUrl,orderby,createtime,showType</sql> |
| | | <select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.Long">select |
| | | <include refid="Base_Column_List"/>from yeshi_ec_taobao_coupon where id = #{id,jdbcType=BIGINT} |
| | | </select> |
| | | <delete id="deleteByPrimaryKey" parameterType="java.lang.Long">delete from yeshi_ec_taobao_coupon where id = #{id,jdbcType=BIGINT}</delete> |
| | | <insert id="insert" parameterType="com.yeshi.fanli.entity.taobao.TaoBaoCoupon" useGeneratedKeys="true" keyProperty="id">insert into yeshi_ec_taobao_coupon (id,auctionId,title,pictUrl,auctionUrl,classNames,taobaokeUrl,zkPrice,biz30day,tkRate,brokerage,shopWangWang,sellerId,shopTitle,shopType,couponId,couponSum,couponCount,couponinfo,couponStartFee,couponAmount,quanPrice,couponBegin,couponEnd,couponLink,generalizeUrl,orderby,createtime,showType) values (#{id,jdbcType=BIGINT},#{auctionId,jdbcType=VARCHAR},#{title,jdbcType=VARCHAR},#{pictUrl,jdbcType=VARCHAR},#{auctionUrl,jdbcType=VARCHAR},#{classNames,jdbcType=VARCHAR},#{taobaokeUrl,jdbcType=VARCHAR},#{zkPrice,jdbcType=DECIMAL},#{biz30day,jdbcType=INTEGER},#{tkRate,jdbcType=VARCHAR},#{brokerage,jdbcType=DECIMAL},#{shopWangWang,jdbcType=VARCHAR},#{sellerId,jdbcType=BIGINT},#{shopTitle,jdbcType=VARCHAR},#{shopType,jdbcType=INTEGER},#{couponId,jdbcType=VARCHAR},#{couponSum,jdbcType=INTEGER},#{couponCount,jdbcType=INTEGER},#{couponinfo,jdbcType=VARCHAR},#{couponStartFee,jdbcType=DECIMAL},#{couponAmount,jdbcType=DECIMAL},#{quanPrice,jdbcType=DECIMAL},#{couponBegin,jdbcType=VARCHAR},#{couponEnd,jdbcType=VARCHAR},#{couponLink,jdbcType=VARCHAR},#{generalizeUrl,jdbcType=VARCHAR},#{orderby,jdbcType=INTEGER},#{createtime,jdbcType=BIGINT},#{showType,jdbcType=INTEGER})</insert> |
| | | <insert id="insertSelective" parameterType="com.yeshi.fanli.entity.taobao.TaoBaoCoupon" useGeneratedKeys="true" keyProperty="id">insert into yeshi_ec_taobao_coupon |
| | | <trim prefix="(" suffix=")" suffixOverrides=","> |
| | | <if test="id != null">id,</if> |
| | | <if test="auctionId != null">auctionId,</if> |
| | | <if test="title != null">title,</if> |
| | | <if test="pictUrl != null">pictUrl,</if> |
| | | <if test="auctionUrl != null">auctionUrl,</if> |
| | | <if test="classNames != null">classNames,</if> |
| | | <if test="taobaokeUrl != null">taobaokeUrl,</if> |
| | | <if test="zkPrice != null">zkPrice,</if> |
| | | <if test="biz30day != null">biz30day,</if> |
| | | <if test="tkRate != null">tkRate,</if> |
| | | <if test="brokerage != null">brokerage,</if> |
| | | <if test="shopWangWang != null">shopWangWang,</if> |
| | | <if test="sellerId != null">sellerId,</if> |
| | | <if test="shopTitle != null">shopTitle,</if> |
| | | <if test="shopType != null">shopType,</if> |
| | | <if test="couponId != null">couponId,</if> |
| | | <if test="couponSum != null">couponSum,</if> |
| | | <if test="couponCount != null">couponCount,</if> |
| | | <if test="couponinfo != null">couponinfo,</if> |
| | | <if test="couponStartFee != null">couponStartFee,</if> |
| | | <if test="couponAmount != null">couponAmount,</if> |
| | | <if test="quanPrice != null">quanPrice,</if> |
| | | <if test="couponBegin != null">couponBegin,</if> |
| | | <if test="couponEnd != null">couponEnd,</if> |
| | | <if test="couponLink != null">couponLink,</if> |
| | | <if test="generalizeUrl != null">generalizeUrl,</if> |
| | | <if test="orderby != null">orderby,</if> |
| | | <if test="createtime != null">createtime,</if> |
| | | <if test="showType != null">showType,</if> |
| | | </trim>values |
| | | <trim prefix="(" suffix=")" suffixOverrides=","> |
| | | <if test="id != null">#{id,jdbcType=BIGINT},</if> |
| | | <if test="auctionId != null">#{auctionId,jdbcType=VARCHAR},</if> |
| | | <if test="title != null">#{title,jdbcType=VARCHAR},</if> |
| | | <if test="pictUrl != null">#{pictUrl,jdbcType=VARCHAR},</if> |
| | | <if test="auctionUrl != null">#{auctionUrl,jdbcType=VARCHAR},</if> |
| | | <if test="classNames != null">#{classNames,jdbcType=VARCHAR},</if> |
| | | <if test="taobaokeUrl != null">#{taobaokeUrl,jdbcType=VARCHAR},</if> |
| | | <if test="zkPrice != null">#{zkPrice,jdbcType=DECIMAL},</if> |
| | | <if test="biz30day != null">#{biz30day,jdbcType=INTEGER},</if> |
| | | <if test="tkRate != null">#{tkRate,jdbcType=VARCHAR},</if> |
| | | <if test="brokerage != null">#{brokerage,jdbcType=DECIMAL},</if> |
| | | <if test="shopWangWang != null">#{shopWangWang,jdbcType=VARCHAR},</if> |
| | | <if test="sellerId != null">#{sellerId,jdbcType=BIGINT},</if> |
| | | <if test="shopTitle != null">#{shopTitle,jdbcType=VARCHAR},</if> |
| | | <if test="shopType != null">#{shopType,jdbcType=INTEGER},</if> |
| | | <if test="couponId != null">#{couponId,jdbcType=VARCHAR},</if> |
| | | <if test="couponSum != null">#{couponSum,jdbcType=INTEGER},</if> |
| | | <if test="couponCount != null">#{couponCount,jdbcType=INTEGER},</if> |
| | | <if test="couponinfo != null">#{couponinfo,jdbcType=VARCHAR},</if> |
| | | <if test="couponStartFee != null">#{couponStartFee,jdbcType=DECIMAL},</if> |
| | | <if test="couponAmount != null">#{couponAmount,jdbcType=DECIMAL},</if> |
| | | <if test="quanPrice != null">#{quanPrice,jdbcType=DECIMAL},</if> |
| | | <if test="couponBegin != null">#{couponBegin,jdbcType=VARCHAR},</if> |
| | | <if test="couponEnd != null">#{couponEnd,jdbcType=VARCHAR},</if> |
| | | <if test="couponLink != null">#{couponLink,jdbcType=VARCHAR},</if> |
| | | <if test="generalizeUrl != null">#{generalizeUrl,jdbcType=VARCHAR},</if> |
| | | <if test="orderby != null">#{orderby,jdbcType=INTEGER},</if> |
| | | <if test="createtime != null">#{createtime,jdbcType=BIGINT},</if> |
| | | <if test="showType != null">#{showType,jdbcType=INTEGER},</if> |
| | | </trim> |
| | | </insert> |
| | | <update id="updateByPrimaryKey" parameterType="com.yeshi.fanli.entity.taobao.TaoBaoCoupon">update yeshi_ec_taobao_coupon set auctionId = #{auctionId,jdbcType=VARCHAR},title = #{title,jdbcType=VARCHAR},pictUrl = #{pictUrl,jdbcType=VARCHAR},auctionUrl = #{auctionUrl,jdbcType=VARCHAR},classNames = #{classNames,jdbcType=VARCHAR},taobaokeUrl = #{taobaokeUrl,jdbcType=VARCHAR},zkPrice = #{zkPrice,jdbcType=DECIMAL},biz30day = #{biz30day,jdbcType=INTEGER},tkRate = #{tkRate,jdbcType=VARCHAR},brokerage = #{brokerage,jdbcType=DECIMAL},shopWangWang = #{shopWangWang,jdbcType=VARCHAR},sellerId = #{sellerId,jdbcType=BIGINT},shopTitle = #{shopTitle,jdbcType=VARCHAR},shopType = #{shopType,jdbcType=INTEGER},couponId = #{couponId,jdbcType=VARCHAR},couponSum = #{couponSum,jdbcType=INTEGER},couponCount = #{couponCount,jdbcType=INTEGER},couponinfo = #{couponinfo,jdbcType=VARCHAR},couponStartFee = #{couponStartFee,jdbcType=DECIMAL},couponAmount = #{couponAmount,jdbcType=DECIMAL},quanPrice = #{quanPrice,jdbcType=DECIMAL},couponBegin = #{couponBegin,jdbcType=VARCHAR},couponEnd = #{couponEnd,jdbcType=VARCHAR},couponLink = #{couponLink,jdbcType=VARCHAR},generalizeUrl = #{generalizeUrl,jdbcType=VARCHAR},orderby = #{orderby,jdbcType=INTEGER},createtime = #{createtime,jdbcType=BIGINT},showType = #{showType,jdbcType=INTEGER} where id = #{id,jdbcType=BIGINT}</update> |
| | | <update id="updateByPrimaryKeySelective" parameterType="com.yeshi.fanli.entity.taobao.TaoBaoCoupon">update yeshi_ec_taobao_coupon |
| | | <set> |
| | | <if test="auctionId != null">auctionId=#{auctionId,jdbcType=VARCHAR},</if> |
| | | <if test="title != null">title=#{title,jdbcType=VARCHAR},</if> |
| | | <if test="pictUrl != null">pictUrl=#{pictUrl,jdbcType=VARCHAR},</if> |
| | | <if test="auctionUrl != null">auctionUrl=#{auctionUrl,jdbcType=VARCHAR},</if> |
| | | <if test="classNames != null">classNames=#{classNames,jdbcType=VARCHAR},</if> |
| | | <if test="taobaokeUrl != null">taobaokeUrl=#{taobaokeUrl,jdbcType=VARCHAR},</if> |
| | | <if test="zkPrice != null">zkPrice=#{zkPrice,jdbcType=DECIMAL},</if> |
| | | <if test="biz30day != null">biz30day=#{biz30day,jdbcType=INTEGER},</if> |
| | | <if test="tkRate != null">tkRate=#{tkRate,jdbcType=VARCHAR},</if> |
| | | <if test="brokerage != null">brokerage=#{brokerage,jdbcType=DECIMAL},</if> |
| | | <if test="shopWangWang != null">shopWangWang=#{shopWangWang,jdbcType=VARCHAR},</if> |
| | | <if test="sellerId != null">sellerId=#{sellerId,jdbcType=BIGINT},</if> |
| | | <if test="shopTitle != null">shopTitle=#{shopTitle,jdbcType=VARCHAR},</if> |
| | | <if test="shopType != null">shopType=#{shopType,jdbcType=INTEGER},</if> |
| | | <if test="couponId != null">couponId=#{couponId,jdbcType=VARCHAR},</if> |
| | | <if test="couponSum != null">couponSum=#{couponSum,jdbcType=INTEGER},</if> |
| | | <if test="couponCount != null">couponCount=#{couponCount,jdbcType=INTEGER},</if> |
| | | <if test="couponinfo != null">couponinfo=#{couponinfo,jdbcType=VARCHAR},</if> |
| | | <if test="couponStartFee != null">couponStartFee=#{couponStartFee,jdbcType=DECIMAL},</if> |
| | | <if test="couponAmount != null">couponAmount=#{couponAmount,jdbcType=DECIMAL},</if> |
| | | <if test="quanPrice != null">quanPrice=#{quanPrice,jdbcType=DECIMAL},</if> |
| | | <if test="couponBegin != null">couponBegin=#{couponBegin,jdbcType=VARCHAR},</if> |
| | | <if test="couponEnd != null">couponEnd=#{couponEnd,jdbcType=VARCHAR},</if> |
| | | <if test="couponLink != null">couponLink=#{couponLink,jdbcType=VARCHAR},</if> |
| | | <if test="generalizeUrl != null">generalizeUrl=#{generalizeUrl,jdbcType=VARCHAR},</if> |
| | | <if test="orderby != null">orderby=#{orderby,jdbcType=INTEGER},</if> |
| | | <if test="createtime != null">createtime=#{createtime,jdbcType=BIGINT},</if> |
| | | <if test="showType != null">showType=#{showType,jdbcType=INTEGER},</if> |
| | | </set> where id = #{id,jdbcType=BIGINT} |
| | | </update> |
| | | |
| | | <delete id="deleteBeforeCouponInfo"> |
| | | delete from yeshi_ec_taobao_coupon where id <![CDATA[<]]> #{id,jdbcType=BIGINT} |
| | | </delete> |
| | | |
| | | <select id="getTaoBaoCouponList" resultMap="BaseResultMap"> |
| | | select * from yeshi_ec_taobao_coupon tbc |
| | | where tbc.title like '%#{key}%' |
| | | order by tbc.orderby,tbc.id |
| | | LIMIT ${start},${count} |
| | | </select> |
| | | |
| | | <select id="getCount" resultType="java.lang.Integer"> |
| | | select count(*) from TaoBaoCoupon tbc |
| | | where tbc.title like '%#{key}%' |
| | | </select> |
| | | |
| | | <select id="getTaoBaoCouponListBykeys" resultMap="BaseResultMap"> |
| | | select * from yeshi_ec_taobao_coupon tbc |
| | | where tbc.showType = 3 AND |
| | | <foreach collection="list" index="index" item="item" open="(" |
| | | separator="or" close=")"> |
| | | tbc.title LIKE '%${item}%' |
| | | </foreach> |
| | | LIMIT ${start},${count} |
| | | </select> |
| | | |
| | | <select id="countTaoBaoCouponListBykeys" resultType="java.lang.Integer"> |
| | | select count(tbc.id) from yeshi_ec_taobao_coupon tbc |
| | | where tbc.showType = 3 AND |
| | | <foreach collection="list" index="index" item="item" open="(" |
| | | separator="or" close=")"> |
| | | tbc.title LIKE '%${item}%' |
| | | </foreach> |
| | | </select> |
| | | |
| | | <select id="getTaoBaoCouponByActionId" resultMap="BaseResultMap"> |
| | | select * from yeshi_ec_taobao_coupon tbc |
| | | where tbc.auctionId = #{auctionId} |
| | | LIMIT 1 |
| | | </select> |
| | | </mapper> |
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.taobao.TaoBaoLinkMapper"> |
| | | <resultMap id="BaseResultMap" type="com.yeshi.fanli.entity.taobao.TaoBaoLink"> |
| | | <id column="id" property="id" jdbcType="BIGINT"/> |
| | | <result column="auctionId" property="auctionId" jdbcType="BIGINT"/> |
| | | <result column="taoToken" property="taoToken" jdbcType="VARCHAR"/> |
| | | <result column="couponLink" property="couponLink" jdbcType="VARCHAR"/> |
| | | <result column="clickUrl" property="clickUrl" jdbcType="VARCHAR"/> |
| | | |
| | | <association property="system" column="sid" javaType="com.yeshi.fanli.entity.system.BusinessSystem"> |
| | | <id column="sid" property="id" jdbcType="BIGINT"/> |
| | | </association> |
| | | |
| | | </resultMap> |
| | | <sql id="Base_Column_List">id,auctionId,sid,taoToken,couponLink,clickUrl</sql> |
| | | |
| | | <select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.Long">select |
| | | <include refid="Base_Column_List"/>from yeshi_ec_taobao_link where id = #{id,jdbcType=BIGINT} |
| | | </select> |
| | | |
| | | <select id="getTaoBaoLink"> |
| | | select <include refid="Base_Column_List"/> from yeshi_ec_taobao_link |
| | | where auctionId = #{auctionId} and sid = #{systemId} |
| | | </select> |
| | | |
| | | |
| | | |
| | | <delete id="deleteByPrimaryKey" parameterType="java.lang.Long">delete from yeshi_ec_taobao_link where id = #{id,jdbcType=BIGINT}</delete> |
| | | <insert id="insert" parameterType="com.yeshi.fanli.entity.taobao.TaoBaoLink" useGeneratedKeys="true" keyProperty="id">insert into yeshi_ec_taobao_link (id,auctionId,sid,taoToken,couponLink,clickUrl) values (#{id,jdbcType=BIGINT},#{auctionId,jdbcType=BIGINT},#{system.id,jdbcType=BIGINT},#{taoToken,jdbcType=VARCHAR},#{couponLink,jdbcType=VARCHAR},#{clickUrl,jdbcType=VARCHAR})</insert> |
| | | <insert id="insertSelective" parameterType="com.yeshi.fanli.entity.taobao.TaoBaoLink" useGeneratedKeys="true" keyProperty="id">insert into yeshi_ec_taobao_link |
| | | <trim prefix="(" suffix=")" suffixOverrides=","> |
| | | <if test="id != null">id,</if> |
| | | <if test="auctionId != null">auctionId,</if> |
| | | <if test="system != null">sid,</if> |
| | | <if test="taoToken != null">taoToken,</if> |
| | | <if test="couponLink != null">couponLink,</if> |
| | | <if test="clickUrl != null">clickUrl,</if> |
| | | </trim>values |
| | | <trim prefix="(" suffix=")" suffixOverrides=","> |
| | | <if test="id != null">#{id,jdbcType=BIGINT},</if> |
| | | <if test="auctionId != null">#{auctionId,jdbcType=BIGINT},</if> |
| | | <if test="system != null">#{system.id,jdbcType=BIGINT},</if> |
| | | <if test="taoToken != null">#{taoToken,jdbcType=VARCHAR},</if> |
| | | <if test="couponLink != null">#{couponLink,jdbcType=VARCHAR},</if> |
| | | <if test="clickUrl != null">#{clickUrl,jdbcType=VARCHAR},</if> |
| | | </trim> |
| | | </insert> |
| | | <update id="updateByPrimaryKey" parameterType="com.yeshi.fanli.entity.taobao.TaoBaoLink">update yeshi_ec_taobao_link set auctionId = #{auctionId,jdbcType=BIGINT},sid = #{system.id,jdbcType=BIGINT},taoToken = #{taoToken,jdbcType=VARCHAR},couponLink = #{couponLink,jdbcType=VARCHAR},clickUrl = #{clickUrl,jdbcType=VARCHAR} where id = #{id,jdbcType=BIGINT}</update> |
| | | <update id="updateByPrimaryKeySelective" parameterType="com.yeshi.fanli.entity.taobao.TaoBaoLink">update yeshi_ec_taobao_link |
| | | <set> |
| | | <if test="auctionId != null">auctionId=#{auctionId,jdbcType=BIGINT},</if> |
| | | <if test="system != null">sid=#{system.id,jdbcType=BIGINT},</if> |
| | | <if test="taoToken != null">taoToken=#{taoToken,jdbcType=VARCHAR},</if> |
| | | <if test="couponLink != null">couponLink=#{couponLink,jdbcType=VARCHAR},</if> |
| | | <if test="clickUrl != null">clickUrl=#{clickUrl,jdbcType=VARCHAR},</if> |
| | | </set> where id = #{id,jdbcType=BIGINT} |
| | | </update> |
| | | </mapper> |
| | |
| | | package com.yeshi.fanli.service.impl.goods;
|
| | |
|
| | | import java.util.List;
|
| | |
|
| | | import javax.annotation.Resource;
|
| | |
|
| | | import org.springframework.stereotype.Service;
|
| | |
| | |
|
| | | @Override
|
| | | public int deleteByPrimaryKey(Long id) {
|
| | | // TODO Auto-generated method stub
|
| | | return taoBaoClassRelationMapper.deleteByPrimaryKey(id);
|
| | | }
|
| | |
|
| | | @Override
|
| | | public int insert(TaoBaoClassRelation record) {
|
| | | // TODO Auto-generated method stub
|
| | | return taoBaoClassRelationMapper.insert(record);
|
| | | }
|
| | |
|
| | | @Override
|
| | | public int insertSelective(TaoBaoClassRelation record) {
|
| | | // TODO Auto-generated method stub
|
| | | return taoBaoClassRelationMapper.insertSelective(record);
|
| | | }
|
| | |
|
| | | @Override
|
| | | public TaoBaoClassRelation selectByPrimaryKey(Long id) {
|
| | | // TODO Auto-generated method stub
|
| | | return taoBaoClassRelationMapper.selectByPrimaryKey(id);
|
| | | }
|
| | |
|
| | | @Override
|
| | | public int updateByPrimaryKeySelective(TaoBaoClassRelation record) {
|
| | | // TODO Auto-generated method stub
|
| | | return taoBaoClassRelationMapper.updateByPrimaryKeySelective(record);
|
| | | }
|
| | |
|
| | | @Override
|
| | | public int updateByPrimaryKey(TaoBaoClassRelation record) {
|
| | | // TODO Auto-generated method stub
|
| | | return taoBaoClassRelationMapper.updateByPrimaryKey(record);
|
| | | }
|
| | |
|
| | |
| | |
|
| | | import com.yeshi.fanli.dao.mybatis.TaoBaoClassMapper;
|
| | | import com.yeshi.fanli.entity.bus.clazz.TaoBaoClass;
|
| | | import com.yeshi.fanli.entity.bus.clazz.TaoBaoClassRelation;
|
| | | import com.yeshi.fanli.service.inter.goods.TaoBaoClassService;
|
| | | import com.yeshi.fanli.util.StringUtil;
|
| | | import org.yeshi.utils.JsonUtil;
|
| | |
|
| | | @Service
|
| | | public class TaoBaoClassServiceImpl implements TaoBaoClassService {
|
| | |
| | |
|
| | | @Override
|
| | | public int deleteByPrimaryKey(Long id) {
|
| | | // TODO Auto-generated method stub
|
| | | return taoBaoClassMapper.deleteByPrimaryKey(id);
|
| | | }
|
| | |
|
| | | @Override
|
| | | public int insert(TaoBaoClass record) {
|
| | | // TODO Auto-generated method stub
|
| | | return taoBaoClassMapper.insert(record);
|
| | | }
|
| | |
|
| | | @Override
|
| | | public int insertSelective(TaoBaoClass record) {
|
| | | // TODO Auto-generated method stub
|
| | | return taoBaoClassMapper.insertSelective(record);
|
| | | }
|
| | |
|
| | | @Override
|
| | | public TaoBaoClass selectByPrimaryKey(Long id) {
|
| | | // TODO Auto-generated method stub
|
| | | return taoBaoClassMapper.selectByPrimaryKey(id);
|
| | | }
|
| | |
|
| | | @Override
|
| | | public int updateByPrimaryKeySelective(TaoBaoClass record) {
|
| | | // TODO Auto-generated method stub
|
| | | return taoBaoClassMapper.updateByPrimaryKeySelective(record);
|
| | | }
|
| | |
|
| | | @Override
|
| | | public int updateByPrimaryKey(TaoBaoClass record) {
|
| | | // TODO Auto-generated method stub
|
| | | return taoBaoClassMapper.updateByPrimaryKey(record);
|
| | | }
|
| | |
|
| | | @Override
|
| | | public List<TaoBaoClass> listBySystemCid(long start, int count, Long systemCid) {
|
| | | // TODO Auto-generated method stub
|
| | | return taoBaoClassMapper.listBySystemCid(start, count, systemCid);
|
| | | }
|
| | |
|
| | |
| | | package com.yeshi.fanli.service.impl.goods;
|
| | |
|
| | | import java.io.Serializable;
|
| | | import java.lang.reflect.Type;
|
| | | import java.util.ArrayList;
|
| | | import java.util.Collections;
|
| | |
| | |
|
| | | import javax.annotation.Resource;
|
| | |
|
| | | import org.hibernate.HibernateException;
|
| | | import org.hibernate.Query;
|
| | | import org.hibernate.Session;
|
| | | import org.springframework.cache.annotation.Cacheable;
|
| | | import org.springframework.orm.hibernate4.HibernateCallback;
|
| | | import org.springframework.stereotype.Service;
|
| | | import org.springframework.transaction.annotation.Transactional;
|
| | |
|
| | | import com.google.gson.Gson;
|
| | | import com.google.gson.reflect.TypeToken;
|
| | | import com.yeshi.fanli.dao.taobao.TaoBaoCouponDao;
|
| | | import com.yeshi.fanli.dao.mybatis.taobao.TaoBaoCouponMapper;
|
| | | import com.yeshi.fanli.entity.taobao.PidUser;
|
| | | import com.yeshi.fanli.entity.taobao.TaoBaoCoupon;
|
| | | import com.yeshi.fanli.entity.taobao.TaoBaoGoodsBrief;
|
| | |
| | | public class TaoBaoCouponServiceImpl implements TaoBaoCouponService {
|
| | |
|
| | | @Resource
|
| | | private TaoBaoCouponDao taoBaoCouponDao;
|
| | | private TaoBaoCouponMapper taoBaoCouponMapper;
|
| | |
|
| | | @Resource
|
| | | private TaoBaoUnionConfigService taoBaoUnionConfigService;
|
| | |
| | | private RedisManager redisManager;
|
| | |
|
| | | @Transactional
|
| | | @Override
|
| | | public void updateTaoBaoCoupon() {
|
| | | List<TaoBaoUnionConfig> config = taoBaoUnionConfigService.getConfigByTypeCache(PidUser.TYPE_FANLI_ANDROID);
|
| | |
|
| | |
| | | int ii = 0;
|
| | | for (TaoBaoCoupon taoBaoCoupon : list) {
|
| | | if (ii == 0) {
|
| | | minId = (Long) taoBaoCouponDao.save(taoBaoCoupon);
|
| | | taoBaoCouponMapper.insert(taoBaoCoupon);
|
| | | minId = taoBaoCoupon.getId();
|
| | | } else {
|
| | | taoBaoCouponDao.save(taoBaoCoupon);
|
| | | taoBaoCouponMapper.insert(taoBaoCoupon);
|
| | | }
|
| | | ii++;
|
| | | }
|
| | |
|
| | | final long endId = minId;
|
| | | taoBaoCouponDao.excute(new HibernateCallback() {
|
| | |
|
| | | public Object doInHibernate(Session session) throws HibernateException {
|
| | | Query query = session.createSQLQuery("delete from yeshi_ec_taobao_coupon where id < ? ");
|
| | | query.setParameter(0, endId);
|
| | | return query.executeUpdate();
|
| | | }
|
| | | });
|
| | | |
| | | taoBaoCouponMapper.deleteBeforeCouponInfo(minId);
|
| | | }
|
| | |
|
| | | @Override
|
| | | public List<TaoBaoCoupon> getTaoBaoCouponList(String key, int page) {
|
| | | int start = (page - 1) * Constant.PAGE_SIZE;
|
| | | List<TaoBaoCoupon> list = taoBaoCouponDao.list(
|
| | | "from TaoBaoCoupon tbc where tbc.title like ? order by tbc.orderby,tbc.id ", start, Constant.PAGE_SIZE,
|
| | | new Serializable[] { "%" + key + "%" });
|
| | | return list;
|
| | | return taoBaoCouponMapper.getTaoBaoCouponList((page - 1) * Constant.PAGE_SIZE, Constant.PAGE_SIZE, key);
|
| | | }
|
| | |
|
| | | @Override
|
| | | public int getCount(String key) {
|
| | | Long count = taoBaoCouponDao.getCount("select count(*) from TaoBaoCoupon tbc where tbc.title like ? ",
|
| | | new Serializable[] { "%" + key + "%" });
|
| | | return count.intValue();
|
| | | return taoBaoCouponMapper.getCount(key);
|
| | | }
|
| | |
|
| | | public void deleteTaoBaoCoupons(long[] ids) {
|
| | | for (long id : ids) {
|
| | | taoBaoCouponDao.delete(new TaoBaoCoupon(id));
|
| | | }
|
| | | }
|
| | |
|
| | | public TaoBaoCoupon getaoBaoCoupon(long id) {
|
| | | TaoBaoCoupon find = taoBaoCouponDao.find(TaoBaoCoupon.class, id);
|
| | | return find;
|
| | | }
|
| | |
|
| | | @Transactional
|
| | | public void updatetaoBaoCoupon(TaoBaoCoupon find) {
|
| | | taoBaoCouponDao.update(find);
|
| | | }
|
| | |
|
| | | public List<TaoBaoCoupon> getTaoBaoCouponListByClassKeys(String[] keys, int page) {
|
| | | int start = (page - 1) * Constant.PAGE_SIZE;
|
| | | StringBuffer sb = new StringBuffer("from TaoBaoCoupon tbc where tbc.classNames like ? ");
|
| | | int keyCount = keys.length;
|
| | | for (int i = 0; i < keyCount; i++) {
|
| | | if (i != 0) {
|
| | | sb.append(" or tbc.classNames like ? ");
|
| | | }
|
| | | keys[i] = "%" + keys[i] + "%";
|
| | | }
|
| | | sb.append(" order by tbc.biz30day desc ");
|
| | | List<TaoBaoCoupon> list = taoBaoCouponDao.list(sb.toString(), start, Constant.PAGE_SIZE, keys);
|
| | | // if(list.size() > 0){
|
| | | // String proportion =
|
| | | // hongBaoManageService.get(Constant.HONGBAO_GOODS_PROPORTION);
|
| | | // double pd=Double.parseDouble(proportion)/100;
|
| | | // for (TaoBaoCoupon taoBaoCoupon : list) {
|
| | | // double tk = (taoBaoCoupon.getTkRate()/100) * pd;
|
| | | // BigDecimal zkPrice = taoBaoCoupon.getZkPrice();
|
| | | // BigDecimal hb = BigDecimalUtil.mul2(zkPrice, new BigDecimal(tk));
|
| | | // taoBaoCoupon.setHongbao(hb);
|
| | | // }
|
| | | // }
|
| | | return list;
|
| | |
|
| | | }
|
| | |
|
| | | @Override
|
| | | public List<TaoBaoCoupon> getTaoBaoCouponListBykeys(List<String> searchKeys, int page) {
|
| | |
|
| | | if (searchKeys == null || searchKeys.size() == 0) {
|
| | | searchKeys = new ArrayList<String>();
|
| | | searchKeys.add("");
|
| | | }
|
| | |
|
| | | StringBuffer sb = new StringBuffer("from TaoBaoCoupon tbc where ");
|
| | | int ii = 0;
|
| | | for (String key : searchKeys) {
|
| | | key = key.replaceAll(" ", "%");
|
| | | if (ii == 0) {
|
| | | sb.append("( tbc.title like '%" + key + "%' ");
|
| | | } else {
|
| | | sb.append(" or tbc.title like '%" + key + "%' ");
|
| | | }
|
| | | ii++;
|
| | | }
|
| | | sb.append(") and tbc.showType = 3 ");
|
| | | // sb.append(" order by tbc.biz30day desc ");
|
| | | int start = (page - 1) * Constant.PAGE_SIZE;
|
| | | return taoBaoCouponDao.list(sb.toString(), start, Constant.PAGE_SIZE, new Serializable[] {});
|
| | | |
| | | return taoBaoCouponMapper.getTaoBaoCouponListBykeys((page - 1) * Constant.PAGE_SIZE, Constant.PAGE_SIZE,searchKeys);
|
| | | }
|
| | |
|
| | | public TaoBaoCoupon getTaoBaoCouponByActionId(String id) {
|
| | | List<TaoBaoCoupon> list = taoBaoCouponDao.list("from TaoBaoCoupon tbc where tbc.auctionId = ? ",
|
| | | new Serializable[] { id });
|
| | | if (list.size() > 0) {
|
| | | return list.get(0);
|
| | | }
|
| | | return null;
|
| | | }
|
| | |
|
| | | public int getCount(List<String> searchKeys) {
|
| | |
|
| | | if (searchKeys == null || searchKeys.size() == 0) {
|
| | | return 0;
|
| | | }
|
| | |
|
| | | StringBuffer sb = new StringBuffer();
|
| | | sb.append("select count(tbc.id) from TaoBaoCoupon tbc where ");
|
| | | int ii = 0;
|
| | | for (String key : searchKeys) {
|
| | | key = key.replaceAll(" ", "%");
|
| | | if (ii == 0) {
|
| | | sb.append("( tbc.title like '%" + key + "%' ");
|
| | | } else {
|
| | | sb.append(" or tbc.title like '%" + key + "%' ");
|
| | | }
|
| | | ii++;
|
| | | }
|
| | | sb.append(") and tbc.showType = 3 ");
|
| | | Long count = taoBaoCouponDao.getCount(sb.toString());
|
| | | return count.intValue();
|
| | | }
|
| | |
|
| | | |
| | | @Override
|
| | | public TaoBaoCoupon getTaoBaoCouponByAuctionId(long id) {
|
| | | List<TaoBaoCoupon> findList = taoBaoCouponDao.list("from TaoBaoCoupon coupon where coupon.auctionId=" + id);
|
| | | if (findList != null && findList.size() > 0)
|
| | | return findList.get(0);
|
| | | return null;
|
| | | public int getCount(List<String> searchKeys) {
|
| | | if (searchKeys == null || searchKeys.size() == 0) {
|
| | | searchKeys = new ArrayList<String>();
|
| | | searchKeys.add("");
|
| | | }
|
| | | |
| | | return taoBaoCouponMapper.countTaoBaoCouponListBykeys(searchKeys);
|
| | | }
|
| | | |
| | | |
| | | @Override
|
| | | public TaoBaoCoupon getTaoBaoCouponByActionId(String auctionId) {
|
| | | return taoBaoCouponMapper.getTaoBaoCouponByActionId(auctionId);
|
| | | }
|
| | |
|
| | |
|
| | | /**
|
| | | * 采用redis做缓存
|
| | |
| | | package com.yeshi.fanli.service.impl.goods;
|
| | |
|
| | | import java.io.Serializable;
|
| | | import java.util.List;
|
| | |
|
| | | import javax.annotation.Resource;
|
| | |
|
| | | import org.hibernate.HibernateException;
|
| | | import org.hibernate.Session;
|
| | | import org.springframework.orm.hibernate4.HibernateCallback;
|
| | | import org.springframework.stereotype.Service;
|
| | |
|
| | | import com.yeshi.fanli.dao.taobao.TaoBaoLinkDao;
|
| | | import com.yeshi.fanli.dao.mybatis.taobao.TaoBaoLinkMapper;
|
| | | import com.yeshi.fanli.entity.system.BusinessSystem;
|
| | | import com.yeshi.fanli.entity.taobao.TaoBaoLink;
|
| | | import com.yeshi.fanli.service.inter.goods.TaoBaoLinkService;
|
| | |
| | | public class TaoBaoLinkServiceImpl implements TaoBaoLinkService {
|
| | |
|
| | | @Resource
|
| | | private TaoBaoLinkDao dao;
|
| | | private TaoBaoLinkMapper taoBaoLinkMapper;
|
| | | |
| | |
|
| | | public TaoBaoLink find(long auctionId, BusinessSystem system) {
|
| | | List<TaoBaoLink> list = dao.list("from TaoBaoLink tbk where tbk.auctionId = ? and tbk.system.id = ? ", new Serializable[]{auctionId,system.getId()});
|
| | | if(list.size() >0){
|
| | | return list.get(0);
|
| | | if (system == null) {
|
| | | return null;
|
| | | }
|
| | | return null;
|
| | | return taoBaoLinkMapper.getTaoBaoLink(auctionId, system.getId());
|
| | | }
|
| | |
|
| | | public void save(final TaoBaoLink tbk) {
|
| | | dao.excute(new HibernateCallback() {
|
| | |
|
| | | public Object doInHibernate(Session session)
|
| | | throws HibernateException {
|
| | | session.getTransaction().begin();
|
| | | session.save(tbk);
|
| | | session.getTransaction().commit();
|
| | | return null;
|
| | | }
|
| | | });
|
| | | }
|
| | |
|
| | | }
|
| | |
| | | import org.apache.commons.httpclient.HttpException;
|
| | | import org.apache.commons.httpclient.NameValuePair;
|
| | | import org.apache.commons.httpclient.methods.PostMethod;
|
| | | import org.hibernate.HibernateException;
|
| | | import org.hibernate.Session;
|
| | | import org.springframework.orm.hibernate4.HibernateCallback;
|
| | | import org.springframework.stereotype.Service;
|
| | | import org.springframework.transaction.annotation.Transactional;
|
| | | import org.yeshi.utils.HttpUtil;
|
| | |
|
| | | import com.yeshi.fanli.dao.mybatis.TBPidMapper;
|
| | | import com.yeshi.fanli.dao.mybatis.share.PidUserMapper;
|
| | | import com.yeshi.fanli.dao.taobao.TBPidDao;
|
| | | import com.yeshi.fanli.dao.mybatis.taobao.TBPidMapper;
|
| | | import com.yeshi.fanli.entity.taobao.ClientTBPid;
|
| | | import com.yeshi.fanli.entity.taobao.PidUser;
|
| | | import com.yeshi.fanli.entity.taobao.TBPid;
|
| | |
| | | import com.yeshi.fanli.log.LogHelper;
|
| | | import com.yeshi.fanli.service.inter.taobao.TaoBaoUnionConfigService;
|
| | | import com.yeshi.fanli.service.inter.user.TBPidService;
|
| | | import org.yeshi.utils.HttpUtil;
|
| | |
|
| | | import net.sf.json.JSONObject;
|
| | |
|
| | | @Service
|
| | | public class TBPidServiceImpl implements TBPidService {
|
| | |
|
| | | @Resource
|
| | | private TBPidDao tbPidDao;
|
| | |
|
| | | @Resource
|
| | | private TBPidMapper tbPidMapper;
|
| | |
| | | e.printStackTrace();
|
| | | }
|
| | |
|
| | | Long count = (Long) tbPidDao.excute(new HibernateCallback<Long>() {
|
| | |
|
| | | @Override
|
| | | public Long doInHibernate(Session session) throws HibernateException {
|
| | | return Long.parseLong(session.createQuery("select count(*) from TBPid").uniqueResult().toString());
|
| | | }
|
| | | });
|
| | | Long count = tbPidMapper.count();
|
| | | |
| | | String name = "quanqudao_" + count;
|
| | |
|
| | | String cookies = getCookie();
|
| | |
| | | e.printStackTrace();
|
| | | }
|
| | |
|
| | | Long count = (Long) tbPidDao.excute(new HibernateCallback<Long>() {
|
| | |
|
| | | @Override
|
| | | public Long doInHibernate(Session session) throws HibernateException {
|
| | | return Long.parseLong(session.createQuery("select count(*) from TBPid").uniqueResult().toString());
|
| | | }
|
| | | });
|
| | | Long count = tbPidMapper.count();
|
| | | |
| | | String name = "tuiguang_" + count;
|
| | |
|
| | | String cookies = getCookieBuXin();
|
| | |
| | | tbPid.setCreatetime(System.currentTimeMillis());
|
| | | tbPid.setName(name);
|
| | | tbPid.setPid(pid);
|
| | | tbPidDao.create(tbPid);
|
| | | tbPidMapper.insert(tbPid);
|
| | | return true;
|
| | | } else {
|
| | | System.out.println(result);
|
| | |
| | |
|
| | | public int getCount(String key);
|
| | |
|
| | | public void deleteTaoBaoCoupons(long[] ids);
|
| | |
|
| | | public TaoBaoCoupon getaoBaoCoupon(long id);
|
| | |
|
| | | public TaoBaoCoupon getTaoBaoCouponByAuctionId(long id);
|
| | |
|
| | | public void updatetaoBaoCoupon(TaoBaoCoupon find);
|
| | |
|
| | | public List<TaoBaoCoupon> getTaoBaoCouponListByClassKeys(String[] key, int page);
|
| | |
|
| | | public List<TaoBaoCoupon> getTaoBaoCouponListBykeys(List<String> searchKeys, int page);
|
| | |
|
| | |
| | |
|
| | | TaoBaoLink find(long auctionId, BusinessSystem system);
|
| | |
|
| | | void save(TaoBaoLink tbk);
|
| | |
|
| | | }
|