yujian
2020-06-29 ec60e757d358636dcac1589c44a66f3e276fe58c
拉新
5个文件已修改
20个文件已添加
2243 ■■■■■ 已修改文件
fanli/src/main/java/com/yeshi/fanli/controller/client/v1/h5/AppH5PullNewController.java 187 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/dao/goods/FreeGoodsCouponDao.java 45 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/dao/goods/PullNewGoodsDao.java 39 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/dto/pdd/PDDSearchRange.java 48 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/dto/taobao/haodanku/HDKSearchFilter.java 142 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/dto/user/PullNewRuleTerm.java 33 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/entity/bus/user/UserSystemCoupon.java 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/entity/goods/FreeGoodsCoupon.java 83 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/entity/goods/PullNewGoods.java 510 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/job/RedPackJob.java 89 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/job/goods/FreeGoodsCouponJob.java 397 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/job/goods/PullNewGoodsJob.java 73 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/service/impl/goods/FreeGoodsCouponServiceImpl.java 69 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/service/impl/goods/PullNewGoodsServiceImpl.java 81 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/service/impl/redpack/RedPackWinInviteServiceImpl.java 170 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/service/inter/goods/FreeGoodsCouponService.java 38 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/service/inter/goods/PullNewGoodsService.java 29 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/service/inter/redpack/RedPackWinInviteService.java 27 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/util/rocketmq/consumer/redpack/RedPackMessageListener.java 41 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/vo/user/PullNewRuleNumVO.java 32 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/vo/user/PullNewRuleVO.java 63 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/resource/image/invite/blks_ico.png 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/resource/image/invite/pull_new.png 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/resource/image/invite/qr_code_frame.png 补丁 | 查看 | 原始文档 | blame | 历史
utils/src/main/java/org/yeshi/utils/DateUtil.java 46 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/controller/client/v1/h5/AppH5PullNewController.java
New file
@@ -0,0 +1,187 @@
package com.yeshi.fanli.controller.client.v1.h5;
import java.io.PrintWriter;
import java.lang.reflect.Type;
import java.math.BigDecimal;
import java.util.List;
import javax.annotation.Resource;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.yeshi.utils.DateUtil;
import org.yeshi.utils.JsonUtil;
import com.google.gson.Gson;
import com.google.gson.GsonBuilder;
import com.google.gson.reflect.TypeToken;
import com.yeshi.fanli.dto.ConfigParamsDTO;
import com.yeshi.fanli.entity.accept.AcceptData;
import com.yeshi.fanli.entity.bus.user.UserInfo;
import com.yeshi.fanli.entity.bus.user.UserRankings;
import com.yeshi.fanli.entity.goods.PullNewGoods;
import com.yeshi.fanli.service.inter.goods.PullNewGoodsService;
import com.yeshi.fanli.service.inter.order.OrderHongBaoMoneyComputeService;
import com.yeshi.fanli.service.inter.order.config.HongBaoManageService;
import com.yeshi.fanli.service.inter.redpack.RedPackConfigService;
import com.yeshi.fanli.service.inter.user.QrCodeService;
import com.yeshi.fanli.service.inter.user.UserInfoExtraService;
import com.yeshi.fanli.service.inter.user.UserInfoService;
import com.yeshi.fanli.service.inter.user.UserRankingsService;
import com.yeshi.fanli.util.Constant;
import com.yeshi.fanli.util.StringUtil;
import com.yeshi.fanli.util.factory.goods.GoodsDetailVOFactory;
import com.yeshi.fanli.util.factory.goods.TaoBaoGoodsFactory;
import com.yeshi.fanli.vo.user.PullNewRuleVO;
import net.sf.json.JSONArray;
import net.sf.json.JSONObject;
@Controller
@RequestMapping("api/apph5/v1/pullNew")
public class AppH5PullNewController {
    @Resource
    private PullNewGoodsService pullNewGoodsService;
    @Resource
    private RedPackConfigService redPackConfigService;
    @Resource
    private UserRankingsService userRankingsService;
    @Resource
    private HongBaoManageService hongBaoManageService;
    @Resource
    private OrderHongBaoMoneyComputeService orderHongBaoMoneyComputeService;
    @Resource
    private QrCodeService qrCodeService;
    @Resource
    private UserInfoService userInfoService;
    @Resource
    private UserInfoExtraService userInfoExtraService;
    /**
     * 拉新商品
     *
     * @param acceptData
     * @param callback
     * @param uid
     * @param page
     * @param goodsType
     * @param out
     */
    @RequestMapping("getGoodsList")
    public void getGoodsList(AcceptData acceptData, String callback, Long uid, Integer page, PrintWriter out) {
        JSONArray array = new JSONArray();
        List<PullNewGoods> list = pullNewGoodsService.listQuery((page-1)*Constant.PAGE_SIZE, Constant.PAGE_SIZE);
        if (list != null && list.size() > 0) {
            Gson gson = JsonUtil.getConvertBigDecimalToStringSubZeroBuilder(new GsonBuilder()).create();
            ConfigParamsDTO paramsDTO = orderHongBaoMoneyComputeService.getShowComputeRate(acceptData.getPlatform(),
                    acceptData.getVersion());
            paramsDTO.setBaseFanliRate(hongBaoManageService.getBaseFanliRate());
            for (PullNewGoods goods : list) {
                array.add(gson.toJson(GoodsDetailVOFactory.convertTaoBao(TaoBaoGoodsFactory.create(goods),paramsDTO)));
            }
        }
        JSONObject data = new JSONObject();
        if (page == 1) {
            String ruleStr = redPackConfigService.getValueByKey("pullnew_activity_rule");
            if (!StringUtil.isNullOrEmpty(ruleStr)) {
                Type type = new TypeToken<PullNewRuleVO>() {
                }.getType();
                PullNewRuleVO rule = new Gson().fromJson(ruleStr, type);
                rule.setRuleName(DateUtil.getCurrentMonthChinese() + "月活动规则");
                data.put("rule", rule);
            }
            data.put("tip", redPackConfigService.getValueByKey("pullnew_page_tip"));
        }
        data.put("count", pullNewGoodsService.countQuery());
        data.put("list", array);
        JsonUtil.printMode(out, callback, JsonUtil.loadTrueResult(data));
    }
    /**
     * 拉新排行榜
     *
     * @param acceptData
     * @param callback
     * @param uid
     * @param page
     * @param out
     */
    @RequestMapping("getRankList")
    public void getRankList(AcceptData acceptData, String callback, Long uid, PrintWriter out) {
        JSONArray array = new JSONArray();
        List<UserRankings> list = userRankingsService.getRankList(0, 10);
        if (list != null && list.size() > 0) {
            for (UserRankings rank : list) {
                JSONObject user = new JSONObject();
                user.put("nickName", rank.getNickName());
                user.put("portrait", rank.getPortrait());
                user.put("money", "¥ " + rank.getShareReward().setScale(2, BigDecimal.ROUND_DOWN));
                array.add(user);
            }
        }
        JSONObject data = new JSONObject();
        data.put("count", array.size());
        data.put("list", array);
        JsonUtil.printMode(out, callback, JsonUtil.loadTrueResult(data));
    }
    /**
     * 创建分享图
     *
     * @param acceptData
     * @param callback
     * @param uid
     * @param out
     */
    @RequestMapping("getShareImg")
    public void getShareImg(AcceptData acceptData, String callback, Long uid, PrintWriter out) {
        if (uid == null) {
            JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult("用户未登录"));
            return;
        }
        UserInfo userInfo = userInfoService.selectByPKey(uid);
        if (userInfo == null) {
            JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult("该用户不存在"));
            return;
        }
        String inviteCode = userInfoExtraService.getInviteCodeByUid(uid);
        if (StringUtil.isNullOrEmpty(inviteCode)) {
            JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult("邀请码未激活"));
            return;
        }
        PullNewRuleVO rule = null;
        String ruleStr = redPackConfigService.getValueByKey("pullnew_activity_rule");
        if (!StringUtil.isNullOrEmpty(ruleStr)) {
            Type type = new TypeToken<PullNewRuleVO>() {
            }.getType();
            rule = new Gson().fromJson(ruleStr, type);
            rule.setRuleName(DateUtil.getCurrentMonthChinese() + "月活动规则");
        }
        String url = qrCodeService.drawPullNewPoster(uid, userInfo.getPortrait(), inviteCode, rule);
        if (StringUtil.isNullOrEmpty(url)) {
            JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult("生成分享图失败"));
            return;
        }
        JSONObject data = new JSONObject();
        data.put("imgUrl",url);
        JsonUtil.printMode(out, callback, JsonUtil.loadTrueResult(data));
    }
}
fanli/src/main/java/com/yeshi/fanli/dao/goods/FreeGoodsCouponDao.java
New file
@@ -0,0 +1,45 @@
package com.yeshi.fanli.dao.goods;
import java.util.Date;
import java.util.List;
import org.springframework.data.domain.Sort;
import org.springframework.data.mongodb.core.query.Criteria;
import org.springframework.data.mongodb.core.query.Query;
import org.springframework.data.mongodb.core.query.Update;
import org.springframework.stereotype.Repository;
import com.yeshi.fanli.dao.MongodbBaseDao;
import com.yeshi.fanli.entity.goods.FreeGoodsCoupon;
import com.yeshi.fanli.vo.goods.GoodsDetailVO;
@Repository
public class FreeGoodsCouponDao extends MongodbBaseDao<FreeGoodsCoupon> {
    /**
     * 查询免单商品-更新在前
     * @param start
     * @param count
     * @param goodsType
     * @return
     */
    public List<FreeGoodsCoupon> listByType(int start,int count, Integer goodsType) {
        Query query = new Query();
        if (goodsType != null)
            query.addCriteria(Criteria.where("goodsType").is(goodsType));
        query.with(new Sort(Sort.Direction.DESC, "updateTime"));
        query.skip(start).limit(count);
        return mongoTemplate.find(query, getEntityClass());
    }
    public long countByType(Integer goodsType) {
        Query query = new Query();
        if (goodsType != null)
            query.addCriteria(Criteria.where("goodsType").is(goodsType));
        return mongoTemplate.count(query, getEntityClass());
    }
}
fanli/src/main/java/com/yeshi/fanli/dao/goods/PullNewGoodsDao.java
New file
@@ -0,0 +1,39 @@
package com.yeshi.fanli.dao.goods;
import java.util.List;
import org.springframework.data.mongodb.core.query.Criteria;
import org.springframework.data.mongodb.core.query.Query;
import org.springframework.stereotype.Repository;
import com.yeshi.fanli.dao.MongodbBaseDao;
import com.yeshi.fanli.entity.goods.PullNewGoods;
@Repository
public class PullNewGoodsDao extends MongodbBaseDao<PullNewGoods> {
    public List<PullNewGoods> listQuery(int start, int count) {
        Query query = new Query();
        query.skip(start).limit(count);
        return mongoTemplate.find(query, getEntityClass());
    }
    public long countQuery() {
        Query query = new Query();
        return mongoTemplate.count(query, getEntityClass());
    }
    public List<PullNewGoods> getByItemid(Long itemid) {
        Query query = new Query();
        query.addCriteria(Criteria.where("itemid").is(itemid));
        return mongoTemplate.find(query, getEntityClass());
    }
    public void deleteByItemid(Long itemid) {
        Query query = new Query();
        query.addCriteria(Criteria.where("itemid").is(itemid));
        mongoTemplate.remove(query, getEntityClass());
    }
}
fanli/src/main/java/com/yeshi/fanli/dto/pdd/PDDSearchRange.java
New file
@@ -0,0 +1,48 @@
package com.yeshi.fanli.dto.pdd;
public class PDDSearchRange{
    private Long range_from; // 区间的开始值
    private Long range_to; // 区间的结束值
    private Integer range_id; // 0,最小成团价 1,券后价 2,佣金比例 3,优惠券价格 4,广告创建时间 5,销量 6,佣金金额 7,店铺描述分 8,店铺物流分 9,店铺服务分
                            // 10, 店铺描述分击败同行业百分比 11, 店铺物流分击败同行业百分比 12,店铺服务分击败同行业百分比 13,商品分 17 ,优惠券/最小团购价 18,过去两小时pv 19,过去两小时销量
    public PDDSearchRange() {}
    public PDDSearchRange(Long range_from, Integer range_id) {
        this.range_from = range_from;
        this.range_id = range_id;
    }
    public PDDSearchRange(Integer range_id, Long range_to) {
        this.range_id = range_id;
        this.range_to = range_to;
    }
    public PDDSearchRange(Long range_from, Integer range_id, Long range_to) {
        this.range_from = range_from;
        this.range_id = range_id;
        this.range_to = range_to;
    }
    public Long getrange_from() {
        return range_from;
    }
    public void setrange_from(Long range_from) {
        this.range_from = range_from;
    }
    public Long getrange_to() {
        return range_to;
    }
    public void setrange_to(Long range_to) {
        this.range_to = range_to;
    }
    public Integer getrange_id() {
        return range_id;
    }
    public void setrange_id(Integer range_id) {
        this.range_id = range_id;
    }
}
fanli/src/main/java/com/yeshi/fanli/dto/taobao/haodanku/HDKSearchFilter.java
New file
@@ -0,0 +1,142 @@
package com.yeshi.fanli.dto.taobao.haodanku;
public class HDKSearchFilter {
    private Integer minId;// 页码
    private Integer back;// 页数量
    private Integer nav;// 默认是全部商品1(1实时跑单商品,2爆单榜商品,3全部商品,4纯视频单,5聚淘专区)
    private Integer sort;// 排序类型
    private Integer priceMin;// 券后价筛选,筛选大于等于所设置的券后价的商品
    private Integer priceMax;// 券后价筛选,筛选小于等于所设置的券后价的商品
    private Integer saleMin;// 销量筛选,筛选大于等于所设置的销量的商品
    private Integer saleMax;// 销量筛选,筛选小于等于所设置的销量的商品
    private Integer couponMin;// 券金额筛选,筛选大于等于所设置的券金额的商品
    private Integer couponMax;// 券金额筛选,筛选小于等于所设置的券金额的商品
    private Integer tkratesMin;// 佣金比例筛选,筛选大于等于所设置的佣金比例的商品
    private Integer tkratesMax;// 佣金比例筛选,筛选小于所设置的佣金比例的商品
    private Integer tkmoneyMin;// 佣金筛选,筛选大于等于所设置的佣金的商品
    private Integer itemType;// 是否只获取营销返利商品,1是,0否
    private String cid;// 商品类目: 商品类目:
    //0全部,1女装,2男装,3内衣,4美妆,5配饰,6鞋品,7箱包,8儿童,9母婴,10居家,11美食,12数码,13家电,14其他,15车品,16文体,17宠物(支持多类目筛选,如1,2获取类目为女装、男装的商品,逗号仅限英文逗号)
    public Integer getMinId() {
        return minId;
    }
    public void setMinId(Integer minId) {
        this.minId = minId;
    }
    public Integer getBack() {
        return back;
    }
    public void setBack(Integer back) {
        this.back = back;
    }
    public Integer getNav() {
        return nav;
    }
    public void setNav(Integer nav) {
        this.nav = nav;
    }
    public String getCid() {
        return cid;
    }
    public void setCid(String cid) {
        this.cid = cid;
    }
    public Integer getSort() {
        return sort;
    }
    public void setSort(Integer sort) {
        this.sort = sort;
    }
    public Integer getPriceMin() {
        return priceMin;
    }
    public void setPriceMin(Integer priceMin) {
        this.priceMin = priceMin;
    }
    public Integer getPriceMax() {
        return priceMax;
    }
    public void setPriceMax(Integer priceMax) {
        this.priceMax = priceMax;
    }
    public Integer getSaleMin() {
        return saleMin;
    }
    public void setSaleMin(Integer saleMin) {
        this.saleMin = saleMin;
    }
    public Integer getSaleMax() {
        return saleMax;
    }
    public void setSaleMax(Integer saleMax) {
        this.saleMax = saleMax;
    }
    public Integer getCouponMin() {
        return couponMin;
    }
    public void setCouponMin(Integer couponMin) {
        this.couponMin = couponMin;
    }
    public Integer getCouponMax() {
        return couponMax;
    }
    public void setCouponMax(Integer couponMax) {
        this.couponMax = couponMax;
    }
    public Integer getTkratesMin() {
        return tkratesMin;
    }
    public void setTkratesMin(Integer tkratesMin) {
        this.tkratesMin = tkratesMin;
    }
    public Integer getTkratesMax() {
        return tkratesMax;
    }
    public void setTkratesMax(Integer tkratesMax) {
        this.tkratesMax = tkratesMax;
    }
    public Integer getTkmoneyMin() {
        return tkmoneyMin;
    }
    public void setTkmoneyMin(Integer tkmoneyMin) {
        this.tkmoneyMin = tkmoneyMin;
    }
    public Integer getItemType() {
        return itemType;
    }
    public void setItemType(Integer itemType) {
        this.itemType = itemType;
    }
}
fanli/src/main/java/com/yeshi/fanli/dto/user/PullNewRuleTerm.java
New file
@@ -0,0 +1,33 @@
package com.yeshi.fanli.dto.user;
import java.math.BigDecimal;
public class PullNewRuleTerm {
    private Long min;
    private Long max;
    private BigDecimal money;
    public Long getMin() {
        return min;
    }
    public void setMin(Long min) {
        this.min = min;
    }
    public Long getMax() {
        return max;
    }
    public void setMax(Long max) {
        this.max = max;
    }
    public BigDecimal getMoney() {
        return money;
    }
    public void setMoney(BigDecimal money) {
        this.money = money;
    }
}
fanli/src/main/java/com/yeshi/fanli/entity/bus/user/UserSystemCoupon.java
@@ -45,6 +45,7 @@
    public final static String SOURCE_DAILY_REBATE = "天天抽";
    public final static String SOURCE_EXCHANGE = "金币兑换";
    public final static String SOURCE_GIVE = "好友赠送";
    public final static String SOURCE_PULL_NEW = "拉新奖励";
    
    @Expose
    @Column(name = "usc_id")
fanli/src/main/java/com/yeshi/fanli/entity/goods/FreeGoodsCoupon.java
New file
@@ -0,0 +1,83 @@
package com.yeshi.fanli.entity.goods;
import java.util.Date;
import org.springframework.data.annotation.Id;
import org.springframework.data.mongodb.core.index.Indexed;
import org.springframework.data.mongodb.core.mapping.Document;
import org.springframework.data.mongodb.core.mapping.Field;
import com.yeshi.fanli.vo.goods.GoodsDetailVO;
/**
 * 免单券商品
 *
 * @author Administrator
 *
 */
@Document(collection = "FreeGoodsCoupon")
public class FreeGoodsCoupon {
    @Id
    private String id;// 自增ID
    @Field
    @Indexed
    private String goodsId;// 商品id--搜索
    @Field
    @Indexed
    private Integer goodsType;// 商品类型--搜索
    @Field
    private GoodsDetailVO goods; // 商品信息
    @Field
    private Date createTime;// 创建时间
    @Field
    private Date updateTime;// 更新时间
    public String getId() {
        return id;
    }
    public void setId(String id) {
        this.id = id;
    }
    public String getGoodsId() {
        return goodsId;
    }
    public void setGoodsId(String goodsId) {
        this.goodsId = goodsId;
    }
    public Integer getGoodsType() {
        return goodsType;
    }
    public void setGoodsType(Integer goodsType) {
        this.goodsType = goodsType;
    }
    public GoodsDetailVO getGoods() {
        return goods;
    }
    public void setGoods(GoodsDetailVO goods) {
        this.goods = goods;
    }
    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;
    }
}
fanli/src/main/java/com/yeshi/fanli/entity/goods/PullNewGoods.java
New file
@@ -0,0 +1,510 @@
package com.yeshi.fanli.entity.goods;
import java.util.Date;
import org.springframework.data.annotation.Id;
import org.springframework.data.mongodb.core.index.Indexed;
import org.springframework.data.mongodb.core.mapping.Document;
import org.springframework.data.mongodb.core.mapping.Field;
/**
 *  拉新商品
 *
 * @author Administrator
 *
 */
@Document(collection = "pullNewGoods")
public class PullNewGoods {
    @Id
    private Integer product_id;// 自增ID
    @Field
    @Indexed
    private Long itemid;// 宝贝ID
    @Field
    private String itemtitle;// 宝贝标题
    @Field
    private String itemshorttitle;// 宝贝短标题
    @Field
    private String itemdesc;// 宝贝推荐语
    @Field
    private Double itemprice;// 在售价
    @Field
    private Integer itemsale;// 宝贝月销量
    @Field
    private Integer itemsale2;// 宝贝近2小时跑单
    @Field
    private Integer todaysale;// 当天销量
    @Field
    private String itempic;// 宝贝主图原始图像
    @Field
    private String itempic_copy;// 推广长图
    @Field
    private String taobao_image;// 轮播主图,用英文逗号分隔开来
    @Field
    private Integer fqcat;// 商品类目
    @Field
    private Double itemendprice;// 宝贝券后价
    @Field
    private String shoptype;// 店铺类型
    @Field
    private String couponurl;// 优惠券链接
    @Field
    private Double couponmoney;// 优惠券金额
    @Field
    private Integer is_brand;// 是否为品牌产品
    @Field
    private Integer is_live;// 是否为直播
    @Field
    private String guide_article;// 推广导购文案
    @Field
    private String videoid;// 商品视频ID
    @Field
    private String activity_type;// 活动类型
    @Field
    private String planlink;// 营销计划链接
    @Field
    private String userid;// 店主的userid
    @Field
    private String sellernick;// 店铺掌柜名
    @Field
    private String shopname;// 店铺名
    @Field
    private String tktype;// 佣金计划:隐藏 ,营销
    @Field
    private Double tkrates;// 佣金比例
    @Field
    private Integer cuntao;// 是否村淘(1是)
    @Field
    private Double tkmoney;// 预计可得(宝贝价格 * 佣金比例 / 100)
    @Field
    private Integer couponreceive2;// 当天优惠券领取量
    @Field
    private Integer couponsurplus;// 优惠券剩余量
    @Field
    private Integer couponnum;// 优惠券总数量
    @Field
    private String coupon_condition;// 优惠券使用条件
    @Field
    private String couponexplain;// 优惠券使用条件
    @Field
    private Integer couponstarttime;// 优惠券开始时间
    @Field
    private Integer couponendtime;// 优惠券结束时间
    @Field
    private Integer start_time;// 活动开始时间
    @Field
    private Integer end_time;// 活动结束时间
    @Field
    private Integer starttime;// 发布时间
    @Field
    private Integer report_status;// 举报处理条件 0未举报 1为待处理 2为忽略 3为下架
    @Field
    private Integer general_index;// 好单指数
    @Field
    private String seller_name;// 放单人名号
    @Field
    private Double discount;// 折扣力度
    @Field
    private Double deposit;// 双十一定金
    @Field
    private Double deposit_deduct;// 双十一定金抵扣金额
    @Field
    private Date createTime;// 创建时间
    @Field
    private Date updateTime;// 更新时间
    @Field
    private String activityid;
    public String getActivityid() {
        return activityid;
    }
    public void setActivityid(String activityid) {
        this.activityid = activityid;
    }
    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 Integer getProduct_id() {
        return product_id;
    }
    public void setProduct_id(Integer product_id) {
        this.product_id = product_id;
    }
    public Long getItemid() {
        return itemid;
    }
    public void setItemid(Long itemid) {
        this.itemid = itemid;
    }
    public String getItemtitle() {
        return itemtitle;
    }
    public void setItemtitle(String itemtitle) {
        this.itemtitle = itemtitle;
    }
    public String getItemshorttitle() {
        return itemshorttitle;
    }
    public void setItemshorttitle(String itemshorttitle) {
        this.itemshorttitle = itemshorttitle;
    }
    public String getItemdesc() {
        return itemdesc;
    }
    public void setItemdesc(String itemdesc) {
        this.itemdesc = itemdesc;
    }
    public Double getItemprice() {
        return itemprice;
    }
    public void setItemprice(Double itemprice) {
        this.itemprice = itemprice;
    }
    public Integer getItemsale() {
        return itemsale;
    }
    public void setItemsale(Integer itemsale) {
        this.itemsale = itemsale;
    }
    public Integer getItemsale2() {
        return itemsale2;
    }
    public void setItemsale2(Integer itemsale2) {
        this.itemsale2 = itemsale2;
    }
    public Integer getTodaysale() {
        return todaysale;
    }
    public void setTodaysale(Integer todaysale) {
        this.todaysale = todaysale;
    }
    public String getItempic() {
        return itempic;
    }
    public void setItempic(String itempic) {
        this.itempic = itempic;
    }
    public String getItempic_copy() {
        return itempic_copy;
    }
    public void setItempic_copy(String itempic_copy) {
        this.itempic_copy = itempic_copy;
    }
    public String getTaobao_image() {
        return taobao_image;
    }
    public void setTaobao_image(String taobao_image) {
        this.taobao_image = taobao_image;
    }
    public Integer getFqcat() {
        return fqcat;
    }
    public void setFqcat(Integer fqcat) {
        this.fqcat = fqcat;
    }
    public Double getItemendprice() {
        return itemendprice;
    }
    public void setItemendprice(Double itemendprice) {
        this.itemendprice = itemendprice;
    }
    public String getShoptype() {
        return shoptype;
    }
    public void setShoptype(String shoptype) {
        this.shoptype = shoptype;
    }
    public String getCouponurl() {
        return couponurl;
    }
    public void setCouponurl(String couponurl) {
        this.couponurl = couponurl;
    }
    public Double getCouponmoney() {
        return couponmoney;
    }
    public void setCouponmoney(Double couponmoney) {
        this.couponmoney = couponmoney;
    }
    public Integer getIs_brand() {
        return is_brand;
    }
    public void setIs_brand(Integer is_brand) {
        this.is_brand = is_brand;
    }
    public Integer getIs_live() {
        return is_live;
    }
    public void setIs_live(Integer is_live) {
        this.is_live = is_live;
    }
    public String getGuide_article() {
        return guide_article;
    }
    public void setGuide_article(String guide_article) {
        this.guide_article = guide_article;
    }
    public String getVideoid() {
        return videoid;
    }
    public void setVideoid(String videoid) {
        this.videoid = videoid;
    }
    public String getActivity_type() {
        return activity_type;
    }
    public void setActivity_type(String activity_type) {
        this.activity_type = activity_type;
    }
    public String getPlanlink() {
        return planlink;
    }
    public void setPlanlink(String planlink) {
        this.planlink = planlink;
    }
    public String getUserid() {
        return userid;
    }
    public void setUserid(String userid) {
        this.userid = userid;
    }
    public String getSellernick() {
        return sellernick;
    }
    public void setSellernick(String sellernick) {
        this.sellernick = sellernick;
    }
    public String getShopname() {
        return shopname;
    }
    public void setShopname(String shopname) {
        this.shopname = shopname;
    }
    public String getTktype() {
        return tktype;
    }
    public void setTktype(String tktype) {
        this.tktype = tktype;
    }
    public Double getTkrates() {
        return tkrates;
    }
    public void setTkrates(Double tkrates) {
        this.tkrates = tkrates;
    }
    public Integer getCuntao() {
        return cuntao;
    }
    public void setCuntao(Integer cuntao) {
        this.cuntao = cuntao;
    }
    public Double getTkmoney() {
        return tkmoney;
    }
    public void setTkmoney(Double tkmoney) {
        this.tkmoney = tkmoney;
    }
    public Integer getCouponreceive2() {
        return couponreceive2;
    }
    public void setCouponreceive2(Integer couponreceive2) {
        this.couponreceive2 = couponreceive2;
    }
    public Integer getCouponsurplus() {
        return couponsurplus;
    }
    public void setCouponsurplus(Integer couponsurplus) {
        this.couponsurplus = couponsurplus;
    }
    public Integer getCouponnum() {
        return couponnum;
    }
    public void setCouponnum(Integer couponnum) {
        this.couponnum = couponnum;
    }
    public String getCouponexplain() {
        return couponexplain;
    }
    public void setCouponexplain(String couponexplain) {
        this.couponexplain = couponexplain;
    }
    public Integer getCouponstarttime() {
        return couponstarttime;
    }
    public void setCouponstarttime(Integer couponstarttime) {
        this.couponstarttime = couponstarttime;
    }
    public Integer getCouponendtime() {
        return couponendtime;
    }
    public void setCouponendtime(Integer couponendtime) {
        this.couponendtime = couponendtime;
    }
    public Integer getStart_time() {
        return start_time;
    }
    public void setStart_time(Integer start_time) {
        this.start_time = start_time;
    }
    public Integer getEnd_time() {
        return end_time;
    }
    public void setEnd_time(Integer end_time) {
        this.end_time = end_time;
    }
    public Integer getStarttime() {
        return starttime;
    }
    public void setStarttime(Integer starttime) {
        this.starttime = starttime;
    }
    public Integer getReport_status() {
        return report_status;
    }
    public void setReport_status(Integer report_status) {
        this.report_status = report_status;
    }
    public Integer getGeneral_index() {
        return general_index;
    }
    public void setGeneral_index(Integer general_index) {
        this.general_index = general_index;
    }
    public String getSeller_name() {
        return seller_name;
    }
    public void setSeller_name(String seller_name) {
        this.seller_name = seller_name;
    }
    public Double getDiscount() {
        return discount;
    }
    public void setDiscount(Double discount) {
        this.discount = discount;
    }
    public Double getDeposit() {
        return deposit;
    }
    public void setDeposit(Double deposit) {
        this.deposit = deposit;
    }
    public Double getDeposit_deduct() {
        return deposit_deduct;
    }
    public void setDeposit_deduct(Double deposit_deduct) {
        this.deposit_deduct = deposit_deduct;
    }
    public String getCoupon_condition() {
        return coupon_condition;
    }
    public void setCoupon_condition(String coupon_condition) {
        this.coupon_condition = coupon_condition;
    }
}
fanli/src/main/java/com/yeshi/fanli/job/RedPackJob.java
New file
@@ -0,0 +1,89 @@
package com.yeshi.fanli.job;
import java.lang.reflect.Type;
import java.math.BigDecimal;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
import javax.annotation.Resource;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;
import com.google.gson.Gson;
import com.google.gson.reflect.TypeToken;
import com.yeshi.fanli.dto.user.PullNewRuleTerm;
import com.yeshi.fanli.log.LogHelper;
import com.yeshi.fanli.service.inter.redpack.RedPackConfigService;
import com.yeshi.fanli.service.inter.redpack.RedPackWinInviteService;
import com.yeshi.fanli.util.StringUtil;
@Component
public class RedPackJob {
    @Resource
    private RedPackWinInviteService redPackWinInviteService;
    @Resource
    private RedPackConfigService redPackConfigService;
    /**
     * 红包每月26到账
     */
    @Scheduled(cron = "0 20 0 26 * ? ")
    public void arriveMoney() {
        try {
            String value = redPackConfigService.getValueByKey("win_redpack_term");
            if (StringUtil.isNullOrEmpty(value)) {
                return;
            }
            Type type = new TypeToken<ArrayList<PullNewRuleTerm>>() {
            }.getType();
            List<PullNewRuleTerm> listRule = new Gson().fromJson(value, type);
            if (listRule == null || listRule.size() == 0) {
                return;
            }
            int start = 0;
            Date date = new Date();
            while(true) {
                // 上月存在邀请的用用户id
                List<Long> list = redPackWinInviteService.listWinUid(start, 1000);
                if (list == null || list.size() == 0) {
                    break;
                }
                for (Long uid: list) {
                    // 统计上月邀请成功数量
                    long count = redPackWinInviteService.countLastMonthByUid(uid);
                    if (count == 0)
                        continue;
                    BigDecimal money = null;
                    for (PullNewRuleTerm term: listRule) {
                        if (count >= term.getMin() && (term.getMax() != null && count <= term.getMax())) {
                            money = term.getMoney();
                        }
                    }
                    if (money == null) {
                        LogHelper.test("红包奖励未匹配到规则count =" + count + " uid =" + uid);
                        continue;
                    }
                    try {
                        redPackWinInviteService.arriveMoney(uid, money, date);
                    } catch (Exception e) {
                        LogHelper.errorDetailInfo(e);
                    }
                }
            }
        } catch (Exception e) {
            LogHelper.errorDetailInfo(e);
        }
    }
}
fanli/src/main/java/com/yeshi/fanli/job/goods/FreeGoodsCouponJob.java
New file
@@ -0,0 +1,397 @@
package com.yeshi.fanli.job.goods;
import java.math.BigDecimal;
import java.util.ArrayList;
import java.util.List;
import javax.annotation.Resource;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;
import com.yeshi.fanli.dto.ConfigParamsDTO;
import com.yeshi.fanli.dto.jd.JDCommissionInfo;
import com.yeshi.fanli.dto.jd.JDFilter;
import com.yeshi.fanli.dto.jd.JDSearchResult;
import com.yeshi.fanli.dto.pdd.PDDGoodsDetail;
import com.yeshi.fanli.dto.pdd.PDDGoodsResult;
import com.yeshi.fanli.dto.pdd.PDDSearchFilter;
import com.yeshi.fanli.dto.pdd.PDDSearchRange;
import com.yeshi.fanli.dto.taobao.haodanku.HDKGoodsListResultDTO;
import com.yeshi.fanli.dto.taobao.haodanku.HDKSearchFilter;
import com.yeshi.fanli.entity.goods.FreeGoodsCoupon;
import com.yeshi.fanli.entity.jd.JDGoods;
import com.yeshi.fanli.entity.taobao.TaoBaoGoodsBrief;
import com.yeshi.fanli.entity.taobao.haodanku.HDKGoodsDetail;
import com.yeshi.fanli.service.inter.goods.FreeGoodsCouponService;
import com.yeshi.fanli.service.inter.order.OrderHongBaoMoneyComputeService;
import com.yeshi.fanli.service.inter.order.config.HongBaoManageService;
import com.yeshi.fanli.util.Constant;
import com.yeshi.fanli.util.MoneyBigDecimalUtil;
import com.yeshi.fanli.util.cache.JDGoodsCacheUtil;
import com.yeshi.fanli.util.cache.PinDuoDuoCacheUtil;
import com.yeshi.fanli.util.factory.goods.GoodsDetailVOFactory;
import com.yeshi.fanli.util.factory.goods.TaoBaoGoodsFactory;
import com.yeshi.fanli.util.jd.JDApiUtil;
import com.yeshi.fanli.util.pinduoduo.PinDuoDuoApiUtil;
import com.yeshi.fanli.util.taobao.HaoDanKuApiUtil;
import com.yeshi.fanli.vo.goods.GoodsDetailVO;
@Component
public class FreeGoodsCouponJob {
    @Resource
    private FreeGoodsCouponService freeGoodsCouponService;
    @Resource
    private OrderHongBaoMoneyComputeService orderHongBaoMoneyComputeService;
    @Resource
    private HongBaoManageService hongBaoManageService;
    @Resource
    private JDGoodsCacheUtil jdGoodsCacheUtil;
    @Resource
    private PinDuoDuoCacheUtil pinDuoDuoCacheUtil;
    @Scheduled(cron = "0 5 0/1 * * ? ")
    public void addFreeGoods() {
        if (!Constant.IS_TASK) {
            return;
        }
        updateGoodsTB();
        updateGoodsPDD();
    }
    /**
     * 更新淘宝商品-免单
     */
    private void updateGoodsTB() {
        int maxNum = 5;
        BigDecimal limitPrice = new BigDecimal(2);
        List<FreeGoodsCoupon> listExist = freeGoodsCouponService.listByType(0, 100, Constant.SOURCE_TYPE_TAOBAO);
        ConfigParamsDTO params = orderHongBaoMoneyComputeService.getShowComputeRate("android", "55");
        params.setBaseFanliRate(hongBaoManageService.getBaseFanliRate());
        // 信息更新
        List<GoodsDetailVO> listNew = new ArrayList<GoodsDetailVO>();
        List<FreeGoodsCoupon> listdel = new ArrayList<FreeGoodsCoupon>();
        if (listExist != null && listExist.size() > 0) {
            for (FreeGoodsCoupon freeGood : listExist) {
                HDKGoodsDetail itemDetail = HaoDanKuApiUtil.getInstance().getItemDetail(freeGood.getGoodsId());
                if (itemDetail == null) {
                    listdel.add(freeGood);
                } else {
                    if (listNew.size() >= 5) {
                        listdel.add(freeGood);
                        continue;
                    }
                    // 比例限制: 金比高于60%
                    if (itemDetail.getTkrates() == null || itemDetail.getTkrates() < 60) {
                        listdel.add(freeGood);
                        continue;
                    }
                    TaoBaoGoodsBrief tbGoods = TaoBaoGoodsFactory.create(itemDetail);
                    GoodsDetailVO detailVO = GoodsDetailVOFactory.convertTaoBao(tbGoods, params);
                    if (detailVO.getCouponPrice() == null) {
                        if (detailVO.getCouponPrice().compareTo(limitPrice) > 0)
                            continue;
                    } else if (detailVO.getZkPrice().compareTo(limitPrice) > 0) {
                        continue;
                    }
                    boolean saveResult = freeGoodsCouponService.saveFreeGoods(detailVO);
                    if (saveResult) {
                        listNew.add(detailVO);
                    }
                }
            }
        }
        if (listNew.size() < 5) {
            Integer minId = 1;
            HDKSearchFilter filter = new HDKSearchFilter();
            filter.setBack(100);
            filter.setPriceMax(2);
            filter.setTkratesMin(60);
            while (minId != null) {
                filter.setMinId(minId);
                HDKGoodsListResultDTO dto = HaoDanKuApiUtil.getInstance().queryList(filter);
                if (dto == null) {
                    break;
                }
                minId = dto.getMinId();
                List<HDKGoodsDetail> goodsList = dto.getGoodsList();
                if (goodsList == null || goodsList.size() == 0) {
                    break;
                }
                for (HDKGoodsDetail goods : goodsList) {
                    // 比例限制: 金比高于60%
                    if (goods.getTkrates() == null || goods.getTkrates() < 60)
                        continue;
                    boolean exist = false;
                    if (listNew.size() > 0) {
                        for (GoodsDetailVO goodsDetailVO : listNew) {
                            if (goodsDetailVO.getGoodsId().equalsIgnoreCase(goods.getItemid() + "")) {
                                exist = true;
                                break;
                            }
                        }
                    }
                    if (exist)
                        continue;
                    TaoBaoGoodsBrief tbGoods = TaoBaoGoodsFactory.create(goods);
                    GoodsDetailVO detailVO = GoodsDetailVOFactory.convertTaoBao(tbGoods, params);
                    boolean saveResult = freeGoodsCouponService.saveFreeGoods(detailVO);
                    if (saveResult) {
                        listNew.add(detailVO);
                    }
                    if (listNew.size() >= maxNum)
                        break;
                }
                if (listNew.size() >= maxNum)
                    break;
            }
        }
        // 删除不满足条件
        if (listdel.size() > 0) {
            for (FreeGoodsCoupon freeGoods : listdel) {
                freeGoodsCouponService.delete(freeGoods.getGoodsId(), freeGoods.getGoodsType());
            }
        }
    }
    /**
     * 更新京东商品-免单
     */
    private void updateGoodsJD() {
        int maxNum = 5;
        BigDecimal limitPrice = new BigDecimal(2);
        List<FreeGoodsCoupon> listExist = freeGoodsCouponService.listByType(0, 100, Constant.SOURCE_TYPE_JD);
        ConfigParamsDTO params = orderHongBaoMoneyComputeService.getShowComputeRate("android", "55");
        params.setBaseFanliRate(hongBaoManageService.getBaseFanliRate());
        // 信息更新
        List<GoodsDetailVO> listNew = new ArrayList<GoodsDetailVO>();
        List<FreeGoodsCoupon> listdel = new ArrayList<FreeGoodsCoupon>();
        if (listExist != null && listExist.size() > 0) {
            for (FreeGoodsCoupon freeGood : listExist) {
                JDGoods goodsInfo = jdGoodsCacheUtil.getGoodsInfo(Long.parseLong(freeGood.getGoodsId()));
                if (goodsInfo == null) {
                    listdel.add(freeGood);
                } else {
                    if (listNew.size() >= 5) {
                        listdel.add(freeGood);
                        continue;
                    }
                    // 比例限制: 金比高于60%
                    JDCommissionInfo commissionInfo = goodsInfo.getCommissionInfo();
                    if (commissionInfo == null) {
                        continue;
                    }
                    if (commissionInfo.getCommissionShare().compareTo(BigDecimal.valueOf(60)) < 0) {
                        continue;
                    }
                    GoodsDetailVO detailVO = GoodsDetailVOFactory.convertJDGoods(goodsInfo, params);
                    if (detailVO.getCouponPrice() == null) {
                        if (detailVO.getCouponPrice().compareTo(limitPrice) > 0)
                            continue;
                    } else if (detailVO.getZkPrice().compareTo(limitPrice) > 0) {
                        continue;
                    }
                    boolean saveResult = freeGoodsCouponService.saveFreeGoods(detailVO);
                    if (saveResult) {
                        listNew.add(detailVO);
                    }
                }
            }
        }
        // 不足补齐
        if (listNew.size() < maxNum) {
            JDFilter filterAPI = new JDFilter();
            filterAPI.setPageSize(Constant.PAGE_SIZE);
            filterAPI.setPriceto(2.0);
            filterAPI.setCommissionShareStart(60);
            for (int page = 1; page < 1000; page++) {
                filterAPI.setPageIndex(page);
                JDSearchResult result = JDApiUtil.queryByKey(filterAPI);
                if (result == null) {
                    break;
                }
                List<JDGoods> goodsList = result.getGoodsList();
                if (goodsList == null || goodsList.size() == 0) {
                    break;
                }
                for (JDGoods goods : goodsList) {
                    // 比例限制: 金比高于60%
                    JDCommissionInfo commissionInfo = goods.getCommissionInfo();
                    if (commissionInfo == null) {
                        continue;
                    }
                    if (commissionInfo.getCommissionShare().compareTo(BigDecimal.valueOf(60)) < 0) {
                        continue;
                    }
                    boolean exist = false;
                    if (listNew.size() > 0) {
                        for (GoodsDetailVO goodsDetailVO : listNew) {
                            if (goodsDetailVO.getGoodsId().equalsIgnoreCase(goods.getSkuId() + "")) {
                                exist = true;
                                break;
                            }
                        }
                    }
                    if (exist)
                        continue;
                    GoodsDetailVO detailVO = GoodsDetailVOFactory.convertJDGoods(goods, params);
                    boolean saveResult = freeGoodsCouponService.saveFreeGoods(detailVO);
                    if (saveResult) {
                        listNew.add(detailVO);
                    }
                    if (listNew.size() >= maxNum)
                        break;
                }
                if (listNew.size() >= maxNum)
                    break;
            }
        }
        // 删除不满足条件
        if (listdel.size() > 0) {
            for (FreeGoodsCoupon freeGoods : listdel) {
                freeGoodsCouponService.delete(freeGoods.getGoodsId(), freeGoods.getGoodsType());
            }
        }
    }
    /**
     * 更新京东商品-免单
     */
    private void updateGoodsPDD() {
        int maxNum = 5;
        BigDecimal limitPrice = new BigDecimal(2);
        List<FreeGoodsCoupon> listExist = freeGoodsCouponService.listByType(0, 100, Constant.SOURCE_TYPE_PDD);
        ConfigParamsDTO params = orderHongBaoMoneyComputeService.getShowComputeRate("android", "55");
        params.setBaseFanliRate(hongBaoManageService.getBaseFanliRate());
        // 信息更新
        List<GoodsDetailVO> listNew = new ArrayList<GoodsDetailVO>();
        List<FreeGoodsCoupon> listdel = new ArrayList<FreeGoodsCoupon>();
        if (listExist != null && listExist.size() > 0) {
            for (FreeGoodsCoupon freeGood : listExist) {
                PDDGoodsDetail goodsInfo = pinDuoDuoCacheUtil.getGoodsInfo(Long.parseLong(freeGood.getGoodsId()));
                if (goodsInfo == null) {
                    listdel.add(freeGood);
                } else {
                    if (listNew.size() >= 5) {
                        listdel.add(freeGood);
                        continue;
                    }
                    // 比例限制: 金比高于60%
                    BigDecimal promotionRate =     new BigDecimal(goodsInfo.getPromotionRate());
                    if (promotionRate.compareTo(BigDecimal.valueOf(600)) < 0)
                        continue;
                    GoodsDetailVO detailVO = GoodsDetailVOFactory.convertPDDGoods(goodsInfo, params);
                    if (detailVO.getCouponPrice() == null) {
                        if (detailVO.getCouponPrice().compareTo(limitPrice) > 0)
                            continue;
                    } else if (detailVO.getZkPrice().compareTo(limitPrice) > 0) {
                        continue;
                    }
                    boolean saveResult = freeGoodsCouponService.saveFreeGoods(detailVO);
                    if (saveResult) {
                        listNew.add(detailVO);
                    }
                }
            }
        }
        // 不足补齐
        if (listNew.size() < maxNum) {
            // 筛选范围列表
            List<PDDSearchRange> rangeList = new ArrayList<>();
            // 券后价小于2元
            rangeList.add(new PDDSearchRange(0L,0, 200L));
            // 比例60%以上
            rangeList.add(new PDDSearchRange(600L, 2, 1000L));
            PDDSearchFilter pddfilter = new PDDSearchFilter();
            pddfilter.setRangeList(rangeList);
            for (int page = 1; page < 1000; page++) {
                pddfilter.setPage(page);
                PDDGoodsResult result = PinDuoDuoApiUtil.searchGoods(pddfilter);
                if (result == null) {
                    break;
                }
                List<PDDGoodsDetail> goodsList = result.getGoodsList();
                if (goodsList == null || goodsList.size() == 0) {
                    break;
                }
                for (PDDGoodsDetail goods : goodsList) {
                    boolean exist = false;
                    if (listNew.size() > 0) {
                        for (GoodsDetailVO goodsDetailVO : listNew) {
                            if (goodsDetailVO.getGoodsId().equalsIgnoreCase(goods.getGoodsId()+ "")) {
                                exist = true;
                                break;
                            }
                        }
                    }
                    if (exist)
                        continue;
                    GoodsDetailVO detailVO = GoodsDetailVOFactory.convertPDDGoods(goods, params);
                    boolean saveResult = freeGoodsCouponService.saveFreeGoods(detailVO);
                    if (saveResult) {
                        listNew.add(detailVO);
                    }
                    if (listNew.size() >= maxNum)
                        break;
                }
                if (listNew.size() >= maxNum)
                    break;
            }
        }
        // 删除不满足条件
        if (listdel.size() > 0) {
            for (FreeGoodsCoupon freeGoods : listdel) {
                freeGoodsCouponService.delete(freeGoods.getGoodsId(), freeGoods.getGoodsType());
            }
        }
    }
}
fanli/src/main/java/com/yeshi/fanli/job/goods/PullNewGoodsJob.java
New file
@@ -0,0 +1,73 @@
package com.yeshi.fanli.job.goods;
import java.util.List;
import javax.annotation.Resource;
import org.apache.commons.beanutils.PropertyUtils;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;
import com.yeshi.fanli.dto.taobao.haodanku.HDKGoodsListResultDTO;
import com.yeshi.fanli.entity.goods.PullNewGoods;
import com.yeshi.fanli.entity.taobao.haodanku.HDKGoodsDetail;
import com.yeshi.fanli.service.inter.goods.PullNewGoodsService;
import com.yeshi.fanli.util.Constant;
import com.yeshi.fanli.util.taobao.HaoDanKuApiUtil;
@Component
public class PullNewGoodsJob {
    @Resource
    private PullNewGoodsService pullNewGoodsService;
    /**
     * 拉新商品
     */
    @Scheduled(cron = "0 30 1 * * ? ")
    private void addPullNewGoods() {
        if (!Constant.IS_TASK) {
            return;
        }
        Integer array[] = {1,2,3,4,5,6,7,8,9,10,11,12,15};
        for (Integer catId: array) {
            Integer minId = 1;
            while (minId != null) {
                HDKGoodsListResultDTO dto = HaoDanKuApiUtil.getInstance().getHighitems(minId, 100, catId);
                if (dto == null || dto.getMinId() == null) {
                    break;
                }
                minId = dto.getMinId();
                List<HDKGoodsDetail> goodsList = dto.getGoodsList();
                if (goodsList == null || goodsList.size() == 0) {
                    break;
                }
                for (HDKGoodsDetail goods : goodsList) {
                    // 佣金比例大于50%
                    if (goods.getTkrates() == null || goods.getTkrates() < 50)
                        continue;
                    // 是否存在券
                    if (goods.getCouponmoney() == null || goods.getCouponmoney() <= 0)
                        continue;
                    // 商品券后价大于9.9元
                    if (goods.getItemendprice() == null || goods.getItemendprice() <= 9.9)
                        continue;
                    PullNewGoods pullNewGoods = new PullNewGoods();
                    try {
                        PropertyUtils.copyProperties(pullNewGoods, goods);
                    } catch (Exception e) {
                        e.printStackTrace();
                        continue;
                    }
                    pullNewGoodsService.saveGoods(pullNewGoods);
                }
            }
        }
    }
}
fanli/src/main/java/com/yeshi/fanli/service/impl/goods/FreeGoodsCouponServiceImpl.java
New file
@@ -0,0 +1,69 @@
package com.yeshi.fanli.service.impl.goods;
import java.util.Date;
import java.util.List;
import javax.annotation.Resource;
import org.springframework.stereotype.Service;
import com.yeshi.fanli.dao.goods.FreeGoodsCouponDao;
import com.yeshi.fanli.entity.goods.FreeGoodsCoupon;
import com.yeshi.fanli.service.inter.goods.FreeGoodsCouponService;
import com.yeshi.fanli.service.inter.order.OrderHongBaoMoneyComputeService;
import com.yeshi.fanli.service.inter.order.config.HongBaoManageService;
import com.yeshi.fanli.util.RedisManager;
import com.yeshi.fanli.vo.goods.GoodsDetailVO;
@Service
public class FreeGoodsCouponServiceImpl implements FreeGoodsCouponService {
    @Resource
    private FreeGoodsCouponDao freeGoodsCouponDao;
    @Resource
    private RedisManager redisManager;
    @Resource
    private HongBaoManageService hongBaoManageService;
    @Resource
    private OrderHongBaoMoneyComputeService orderHongBaoMoneyComputeService;
    @Override
    public boolean saveFreeGoods(GoodsDetailVO detailVO) {
        if (detailVO == null) {
            return false;
        }
        String id = detailVO.getGoodsType() + "#_#" + detailVO.getGoodsId();
        FreeGoodsCoupon freeGoods = new FreeGoodsCoupon();
        freeGoods.setId(id);
        freeGoods.setGoodsId(detailVO.getGoodsId());
        freeGoods.setGoodsType(detailVO.getGoodsType());
        freeGoods.setGoods(detailVO);
        freeGoods.setCreateTime(new Date());
        freeGoods.setUpdateTime(new Date());
        freeGoodsCouponDao.save(freeGoods);
        return true;
    }
    @Override
    public void delete(String goodsId, Integer goodsType) {
        freeGoodsCouponDao.delete(goodsId + "#_#" + goodsType);
    }
    @Override
    public List<FreeGoodsCoupon> listByType(int start, int count, Integer goodsType) {
        return freeGoodsCouponDao.listByType(start,count, goodsType);
    }
    @Override
    public long countByType(Integer goodsType) {
        return freeGoodsCouponDao.countByType(goodsType);
    }
}
fanli/src/main/java/com/yeshi/fanli/service/impl/goods/PullNewGoodsServiceImpl.java
New file
@@ -0,0 +1,81 @@
package com.yeshi.fanli.service.impl.goods;
import java.util.List;
import javax.annotation.Resource;
import org.apache.commons.beanutils.PropertyUtils;
import org.springframework.stereotype.Service;
import com.yeshi.fanli.dao.goods.PullNewGoodsDao;
import com.yeshi.fanli.entity.goods.PullNewGoods;
import com.yeshi.fanli.entity.taobao.haodanku.HDKGoodsDetail;
import com.yeshi.fanli.service.inter.goods.PullNewGoodsService;
import com.yeshi.fanli.util.taobao.HaoDanKuApiUtil;
@Service
public class PullNewGoodsServiceImpl implements PullNewGoodsService {
    @Resource
    private PullNewGoodsDao pullNewGoodsDao;
    @Override
    public void saveGoods(PullNewGoods pullNewGoods) {
        if (pullNewGoods == null) {
            return;
        }
        pullNewGoodsDao.save(pullNewGoods);
    }
    @Override
    public List<PullNewGoods> listQuery(int start, int count) {
        return pullNewGoodsDao.listQuery(start, count);
    }
    @Override
    public long countQuery() {
        return pullNewGoodsDao.countQuery();
    }
    @Override
    public void updateGoods(HDKGoodsDetail goods) {
        if (goods == null)
            return;
        List<PullNewGoods> list = pullNewGoodsDao.getByItemid(goods.getItemid());
        if (list == null || list.size() == 0)
            return;
        // 佣金比例大于50%
        if (goods.getTkrates() == null || goods.getTkrates() < 50)
            return;
        // 是否存在券
        if (goods.getCouponmoney() == null || goods.getCouponmoney() <= 0)
            return;
        // 商品券后价大于9.9元
        if (goods.getItemendprice() == null || goods.getItemendprice() <= 9.9)
            return;
        PullNewGoods pullNewGoods = new PullNewGoods();
        try {
            PropertyUtils.copyProperties(pullNewGoods, goods);
        } catch (Exception e) {
            e.printStackTrace();
            return;
        }
        pullNewGoodsDao.save(pullNewGoods);
    }
    @Override
    public void deleteGoods(List<Long> list) {
        if (list == null || list.size() == 0)
            return;
        for (Long itemid: list) {
            pullNewGoodsDao.deleteByItemid(itemid);
        }
    }
}
fanli/src/main/java/com/yeshi/fanli/service/impl/redpack/RedPackWinInviteServiceImpl.java
@@ -467,7 +467,7 @@
    @Override
    @RequestSerializableByKeyService(key = "#orderUid")
    @Transactional(rollbackFor = Exception.class)
    public void winRedPackByOrder(Long orderUid, String orderNo, Integer source) {
    public void winRedPackByOrder(Long orderUid, String orderNo, Integer source, Date downTime) {
        if (orderUid == null || StringUtil.isNullOrEmpty(orderNo)) {
            return;
        }
@@ -476,20 +476,29 @@
        UserInfoRegister register = userInfoRegisterService.selectByPrimaryKey(orderUid);
        if (register == null) 
            return;
        // 注册48小时 + 以内
        // 注册48小时 以内 :新人
        long registerTime = register.getCreateTime().getTime();
        // 48小时限制
        if (downTime.getTime() < registerTime || downTime.getTime() > registerTime + 1000*60*60*48)
            return;
        
        // 是否存在上下级关系
        ThreeSale threeSale = threeSaleSerivce.getByWorkerId(orderUid);
        if (threeSale == null)
            return;
        Long bossId = threeSale.getBoss().getId();
        if (bossId == null)
            return;
        
        // 该邀请是否已领取
        // 小于2.1.3版本不增加
        UserActiveLog activeLog = userActiveLogService.getUserLatestActiveInfo(bossId);
        if (activeLog == null)
            return;
        if (!VersionUtil.greaterThan_2_1_3("appstore".equalsIgnoreCase(activeLog.getChannel()) ? "ios" : "android",
                activeLog.getVersionCode()))
            return;
        // 该邀请是否已添加
        RedPackWinInvite threeStage = redPackWinInviteMapper.getByUidAndTeamUid(bossId, orderUid);
        if (threeStage != null)
            return;
@@ -500,27 +509,15 @@
            return;
        }
        
        // 48小时内订单
        long spaceTime = 1000 * 60 * 48;
        Long succeedTime = threeSale.getSucceedTime();
        Date thirdCreateTime = list.get(0).getThirdCreateTime();
        if (thirdCreateTime == null || thirdCreateTime.getTime() > succeedTime + spaceTime) {
            return;
        }
        // 商品比例限制
        BigDecimal limitRate = new BigDecimal(redPackConfigService.getValueByKey("goods_reate_limit"));
        BigDecimal limitPayMent = new BigDecimal(redPackConfigService.getValueByKey("goods_pay_ment_limit"));
        boolean satisfy = false;
        // 遍历是否存在符合相应商品
        for (CommonOrder commonOrder: list) {
            // 邀请关系之后
            long downTime = commonOrder.getThirdCreateTime().getTime();
            if (downTime < threeSale.getCreateTime())
                continue;
            // 48小时限制
            if (downTime < registerTime || downTime > registerTime + 1000*60*60*48)
            long thirdTime = commonOrder.getThirdCreateTime().getTime();
            if (thirdTime < threeSale.getCreateTime())
                continue;
            // 付款金额限制
            BigDecimal payment = commonOrder.getPayment();
@@ -556,19 +553,148 @@
        winInvite.setType(RedPackWinInviteTypeEnum.inviteDownOrder);
        winInvite.setIdentifyCode(StringUtil.Md5(RedPackWinInviteTypeEnum.inviteDownOrder.name() + ":" + orderUid));
        redPackWinInviteMapper.insertSelective(winInvite);
    }
    @Override
    @RequestSerializableByKeyService(key = "#orderUid")
    public boolean verifyOrder(Long orderUid, String orderNo, Integer source, Date downTime) {
        boolean satisfy = false;
        // 注册时间
        UserInfoRegister register = userInfoRegisterService.selectByPrimaryKey(orderUid);
        if (register == null)
            return satisfy;
        // 注册48小时 以内:新人
        long registerTime = register.getCreateTime().getTime();
        // 48小时限制
        if (downTime.getTime() < registerTime || downTime.getTime() > registerTime + 1000*60*60*48)
            return satisfy;
        
        // 是否已奖励
        List<UserSystemCoupon> coupons = userSystemCouponService.getUserCouponBySource(orderUid, UserSystemCoupon.SOURCE_PULL_NEW);
        if (coupons != null && coupons.size() > 0) {
            return satisfy;
        }
        // 是否存在上下级关系
        ThreeSale threeSale = threeSaleSerivce.getByWorkerId(orderUid);
        if (threeSale == null)
            return satisfy;
        Long bossId = threeSale.getBoss().getId();
        if (bossId == null)
            return satisfy;
        // 小于2.1.3版本不增加
        UserActiveLog activeLog = userActiveLogService.getUserLatestActiveInfo(orderUid);
        if (activeLog == null)
            return satisfy;
        if (!VersionUtil.greaterThan_2_1_3("appstore".equalsIgnoreCase(activeLog.getChannel()) ? "ios" : "android",
                activeLog.getVersionCode()))
            return satisfy;
        // 查询订单
        List<CommonOrder> list = commonOrderService.getByOrderNo(orderUid, orderNo);
        if (list == null || list.size() ==0)
            return satisfy;
        // 商品比例限制
        BigDecimal limitRate = new BigDecimal(redPackConfigService.getValueByKey("goods_reate_limit"));
        BigDecimal limitPayMent = new BigDecimal(redPackConfigService.getValueByKey("goods_pay_ment_limit"));
        // 遍历是否存在符合相应商品
        for (CommonOrder commonOrder: list) {
            // 邀请关系之后
            long thirdTime = commonOrder.getThirdCreateTime().getTime();
            if (thirdTime < threeSale.getCreateTime())
                continue;
            // 付款金额限制
            BigDecimal payment = commonOrder.getPayment();
            if (payment == null || payment.compareTo(limitPayMent) < 0)
                continue;
            // 商品佣金比例限制
            BigDecimal eIncome = commonOrder.geteIncome();
            BigDecimal settlement = commonOrder.getSettlement();
            if(eIncome == null || settlement == null) {
                continue;
            }
            BigDecimal rete = MoneyBigDecimalUtil.div(eIncome, settlement);
            if (rete.compareTo(limitRate) >= 0) {
                satisfy = true;
                break;
            }
        }
        return satisfy;
    }
    @Override
    @RequestSerializableByKeyService(key = "#orderUid")
    @Transactional(rollbackFor = Exception.class)
    public void winFreeCoupon(Long orderUid, String orderNo, Integer source, Date downTime) {
        if (orderUid == null || StringUtil.isNullOrEmpty(orderNo)) {
            return;
        }
        // 注册时间
        UserInfoRegister register = userInfoRegisterService.selectByPrimaryKey(orderUid);
        if (register == null)
            return;
        // 注册48小时 以内:新人
        long registerTime = register.getCreateTime().getTime();
        // 48小时限制
        if (downTime.getTime() < registerTime || downTime.getTime() > registerTime + 1000*60*60*48)
            return;
        // 是否已奖励
        List<UserSystemCoupon> coupons = userSystemCouponService.getUserCouponBySource(orderUid, UserSystemCoupon.SOURCE_PULL_NEW);
        if (coupons != null && coupons.size() > 0) {
            return;
        }
        // 查询订单
        List<CommonOrder> list = commonOrderService.getByOrderNo(orderUid, orderNo);
        if (list == null || list.size() ==0) {
            return;
        }
        // 商品比例限制
        BigDecimal limitRate = new BigDecimal(redPackConfigService.getValueByKey("goods_reate_limit"));
        BigDecimal limitPayMent = new BigDecimal(redPackConfigService.getValueByKey("goods_pay_ment_limit"));
        boolean satisfy = false;
        // 遍历是否存在符合相应商品
        for (CommonOrder commonOrder: list) {
            // 付款金额限制
            BigDecimal payment = commonOrder.getPayment();
            if (payment == null || payment.compareTo(limitPayMent) < 0)
                continue;
            // 商品佣金比例限制
            BigDecimal eIncome = commonOrder.geteIncome();
            BigDecimal settlement = commonOrder.getSettlement();
            if(eIncome == null || settlement == null) {
                continue;
            }
            BigDecimal rete = MoneyBigDecimalUtil.div(eIncome, settlement);
            if (rete.compareTo(limitRate) >= 0) {
                satisfy = true;
                break;
            }
        }
        if (!satisfy) {
            return;
        }
        
        // 赠送购买者一张免单券
        try {
            userSystemCouponService.freeCouponWinBySystem(orderUid, CouponTypeEnum.freeCouponBuy, UserSystemCoupon.SOURCE_EXCHANGE,
                    1, true, 2);
            userSystemCouponService.freeCouponWinBySystem(orderUid, CouponTypeEnum.freeCouponBuy,
                    UserSystemCoupon.SOURCE_PULL_NEW, 1, true, 2);
        } catch (UserSystemCouponException e) {
            e.printStackTrace();
        } catch (Exception e) {
            e.printStackTrace();
        }
    }
    
    @Override
    public List<Long> listWinUid(int start, int count) {
fanli/src/main/java/com/yeshi/fanli/service/inter/goods/FreeGoodsCouponService.java
New file
@@ -0,0 +1,38 @@
package com.yeshi.fanli.service.inter.goods;
import java.util.List;
import com.yeshi.fanli.entity.goods.FreeGoodsCoupon;
import com.yeshi.fanli.vo.goods.GoodsDetailVO;
public interface FreeGoodsCouponService {
    /**
     * 保存或更新
     * @param detailVO
     * @return
     */
    public boolean saveFreeGoods(GoodsDetailVO detailVO);
    /**
     * 根据类型进行查询
     * @param start
     * @param count
     * @param goodsType
     * @return
     */
    public List<FreeGoodsCoupon> listByType(int start, int count, Integer goodsType);
    /**
     * 删除商品
     * @param goodsId
     * @param goodsType
     */
    public void delete(String goodsId, Integer goodsType);
    public long countByType(Integer goodsType);
}
fanli/src/main/java/com/yeshi/fanli/service/inter/goods/PullNewGoodsService.java
New file
@@ -0,0 +1,29 @@
package com.yeshi.fanli.service.inter.goods;
import java.util.List;
import com.yeshi.fanli.entity.goods.PullNewGoods;
import com.yeshi.fanli.entity.taobao.haodanku.HDKGoodsDetail;
public interface PullNewGoodsService {
    public void saveGoods(PullNewGoods pullNewGoods);
    public List<PullNewGoods> listQuery(int start, int count);
    public long countQuery();
    /**
     * 更新商品
     * @param itemid 商品id
     */
    public void updateGoods(HDKGoodsDetail goods);
    /**
     * 删除商品
     * @param itemid 商品id
     */
    public void deleteGoods(List<Long> list);
}
fanli/src/main/java/com/yeshi/fanli/service/inter/redpack/RedPackWinInviteService.java
@@ -100,7 +100,7 @@
     * @param orderNo
     * @param source
     */
    public void winRedPackByOrder(Long orderUid, String orderNo, Integer source);
    public void winRedPackByOrder(Long orderUid, String orderNo, Integer source, Date downTime);
    /**
     * 查询上月用户id
@@ -118,7 +118,7 @@
     * @return
     */
    long countLastMonthByUid(Long uid);
    public long countLastMonthByUid(Long uid);
    
    /**
     * 查询上月数据
@@ -126,7 +126,7 @@
     * @param count
     * @return
     */
    List<RedPackWinInvite> listLastMonthByUid(int start, int count, Long uid);
    public List<RedPackWinInvite> listLastMonthByUid(int start, int count, Long uid);
    /**
     * 红包到账
@@ -134,6 +134,25 @@
     * @param money
     * @param date
     */
    void arriveMoney(Long uid, BigDecimal money, Date date) throws Exception;
    public void arriveMoney(Long uid, BigDecimal money, Date date) throws Exception;
    /**
     * 活动免单券
     * @param orderUid
     * @param orderNo
     * @param source
     * @param downTime
     */
    public void winFreeCoupon(Long orderUid, String orderNo, Integer source, Date downTime);
    /**
     * 验证是否满足延迟消息
     * @param orderUid
     * @param orderNo
     * @param source
     * @param downTime
     * @return
     */
    public boolean verifyOrder(Long orderUid, String orderNo, Integer source, Date downTime);
    
}
fanli/src/main/java/com/yeshi/fanli/util/rocketmq/consumer/redpack/RedPackMessageListener.java
@@ -50,21 +50,30 @@
        if (MQTopicName.TOPIC_ORDER.name().equalsIgnoreCase(message.getTopic())) {
            if (tag.equalsIgnoreCase(OrderTopicTagEnum.orderStatistic.name())) {// 订单统
                OrderMQMsg orderMQMsg = new Gson().fromJson(new String(message.getBody()), OrderMQMsg.class);
                // 发送24小时延时消息
                // 测试时发送
                int hour = 48;
                if (Constant.IS_TEST) {
                    hour = 1;
                OrderMQMsg mqMsg = new Gson().fromJson(new String(message.getBody()), OrderMQMsg.class);
                try {// 邀请奖励
                    redPackWinInviteService.winRedPackByOrder(mqMsg.getUid(), mqMsg.getOrderId(), mqMsg.getType(), mqMsg.getPlaceTime());
                } catch (Exception e) {
                    LogHelper.errorDetailInfo(e);
                }
                orderMQMsg.setDelayHour(hour);
                Message msg = new Message(message.getTopic(), OrderTopicTagEnum.orderStatisticDelay.name(),
                        new Gson().toJson(orderMQMsg).getBytes());
                if (orderMQMsg.getStaticticDate().getTime() + 1000 * 60 * 60L * hour > System.currentTimeMillis())// 时间是否已经过了
                    msg.setStartDeliverTime(orderMQMsg.getStaticticDate().getTime() + 1000 * 60 * 60L * hour);
                else
                    msg.setStartDeliverTime(System.currentTimeMillis() + 1000 * 60);
                producer.send(msg);
                boolean verifyOrder = redPackWinInviteService.verifyOrder(mqMsg.getUid(), mqMsg.getOrderId(), mqMsg.getType(), mqMsg.getPlaceTime());
                if (verifyOrder) {
                    // 发送48小时延时消息
                    int hour = 48;
                    if (Constant.IS_TEST) {
                        hour = 1;
                    }
                    mqMsg.setDelayHour(hour);
                    Message msg = new Message(message.getTopic(), OrderTopicTagEnum.orderStatisticDelay.name(),
                            new Gson().toJson(mqMsg).getBytes());
                    if (mqMsg.getStaticticDate().getTime() + 1000 * 60 * 60L * hour > System.currentTimeMillis())// 时间是否已经过了
                        msg.setStartDeliverTime(mqMsg.getStaticticDate().getTime() + 1000 * 60 * 60L * hour);
                    else
                        msg.setStartDeliverTime(System.currentTimeMillis() + 1000 * 60);
                    producer.send(msg);
                }
                return Action.CommitMessage;
            } else if (tag.equalsIgnoreCase(OrderTopicTagEnum.orderStatisticDelay.name())) {// 订单统计
                OrderMQMsg mqMsg = new Gson().fromJson(new String(message.getBody()), OrderMQMsg.class);
@@ -74,8 +83,8 @@
                }
                if (mqMsg.getDelayHour() == hour) {
                    try {// 邀请奖励
                        redPackWinInviteService.winRedPackByOrder(mqMsg.getUid(), mqMsg.getOrderId(), mqMsg.getType());
                    try {
                        redPackWinInviteService.winFreeCoupon(mqMsg.getUid(), mqMsg.getOrderId(), mqMsg.getType(), mqMsg.getPlaceTime());
                    } catch (Exception e) {
                        LogHelper.errorDetailInfo(e);
                        return Action.ReconsumeLater;
fanli/src/main/java/com/yeshi/fanli/vo/user/PullNewRuleNumVO.java
New file
@@ -0,0 +1,32 @@
package com.yeshi.fanli.vo.user;
public class PullNewRuleNumVO {
    private String numRange;
    private String rewardDesc;
    public PullNewRuleNumVO() {}
    public PullNewRuleNumVO(String numRange, String rewardDesc) {
        this.numRange = numRange;
        this.rewardDesc = rewardDesc;
    }
    public String getNumRange() {
        return numRange;
    }
    public void setNumRange(String numRange) {
        this.numRange = numRange;
    }
    public String getRewardDesc() {
        return rewardDesc;
    }
    public void setRewardDesc(String rewardDesc) {
        this.rewardDesc = rewardDesc;
    }
}
fanli/src/main/java/com/yeshi/fanli/vo/user/PullNewRuleVO.java
New file
@@ -0,0 +1,63 @@
package com.yeshi.fanli.vo.user;
import java.util.List;
public class PullNewRuleVO {
    private String ruleName;
    private String newTitle;
    private String newRule;
    private String inviterTitle;
    private String inviterRule;
    private List<PullNewRuleNumVO> list;
    public String getNewTitle() {
        return newTitle;
    }
    public void setNewTitle(String newTitle) {
        this.newTitle = newTitle;
    }
    public String getNewRule() {
        return newRule;
    }
    public void setNewRule(String newRule) {
        this.newRule = newRule;
    }
    public String getInviterTitle() {
        return inviterTitle;
    }
    public void setInviterTitle(String inviterTitle) {
        this.inviterTitle = inviterTitle;
    }
    public String getInviterRule() {
        return inviterRule;
    }
    public void setInviterRule(String inviterRule) {
        this.inviterRule = inviterRule;
    }
    public List<PullNewRuleNumVO> getList() {
        return list;
    }
    public void setList(List<PullNewRuleNumVO> list) {
        this.list = list;
    }
    public String getRuleName() {
        return ruleName;
    }
    public void setRuleName(String ruleName) {
        this.ruleName = ruleName;
    }
}
fanli/src/main/resource/image/invite/blks_ico.png
fanli/src/main/resource/image/invite/pull_new.png
fanli/src/main/resource/image/invite/qr_code_frame.png
utils/src/main/java/org/yeshi/utils/DateUtil.java
@@ -635,9 +635,53 @@
        SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
        return sdf.format(cal.getTime());
    }
    public static int getCurrentDate() {
        Calendar cal = Calendar.getInstance();
        return cal.get(Calendar.DATE);
    }
    public static int getCurrentMonth() {
        Calendar cal = Calendar.getInstance();
        return cal.get(Calendar.MONTH) + 1;
    }
    public static String getCurrentMonthChinese() {
        Calendar cal = Calendar.getInstance();
        int month = cal.get(Calendar.MONTH) + 1;
        switch(month) {
            case 1:
                return "一";
            case 2:
                return "二";
            case 3:
                return "三";
            case 4:
                return "四";
            case 5:
                return "五";
            case 6:
                return "六";
            case 7:
                return "七";
            case 8:
                return "八";
            case 9:
                return "九";
            case 10:
                return "十";
            case 11:
                return "十一";
            case 12:
                return "十二";
            default:
                return "一";
        }
    }
    public static void main(String[] args) throws ParseException {
        System.out.println(getMonthSpace("2012-02", "2012-02"));
        System.out.println(getCurrentDate());
    }
}