| | |
| | | return;
|
| | | }
|
| | |
|
| | | if (tb != null) {
|
| | | commonGoods = new CommonGoods();
|
| | | commonGoods.setPrice(tb.getZkPrice());
|
| | | commonGoods.setTitle(tb.getTitle());
|
| | | commonGoods.setGoodsId(tb.getAuctionId());
|
| | | commonGoods.setGoodsType(Constant.SOURCE_TYPE_TAOBAO);
|
| | | commonGoods.setPicture(tb.getPictUrl());
|
| | | }
|
| | |
|
| | | JSONObject data = new JSONObject();
|
| | |
|
| | | if(VersionUtil.greaterThan_1_6_5(acceptData.getPlatform(), acceptData.getVersion())) {
|
| | | if (tb != null) {
|
| | | TaoBaoGoodsBrief goodsBrief = null;
|
| | | try {
|
| | | goodsBrief = TaoKeApiUtil.searchGoodsDetail(tb.getAuctionId());
|
| | | } catch (TaobaoGoodsDownException e) {
|
| | | e.printStackTrace();
|
| | | }
|
| | | if (goodsBrief == null) {
|
| | | out.println(JsonUtil.loadFalseResult("暂未找到该商品,请稍后再试!"));
|
| | | return;
|
| | | }
|
| | | commonGoods = CommonGoodsFactory.create(goodsBrief);
|
| | | }
|
| | | BigDecimal fanLiRate = hongBaoManageService.getFanLiRate();
|
| | | BigDecimal shareRate = hongBaoManageService.getShareRate();
|
| | | Gson gson = JsonUtil.getConvertBigDecimalToStringSubZeroBuilder(new GsonBuilder())
|
| | |
| | | return;
|
| | | }
|
| | |
|
| | | if (tb != null) {
|
| | | commonGoods = new CommonGoods();
|
| | | commonGoods.setPrice(tb.getZkPrice());
|
| | | commonGoods.setTitle(tb.getTitle());
|
| | | commonGoods.setGoodsId(tb.getAuctionId());
|
| | | commonGoods.setGoodsType(Constant.SOURCE_TYPE_TAOBAO);
|
| | | commonGoods.setPicture(tb.getPictUrl());
|
| | | }
|
| | | |
| | | JSONObject taoBaoGoodsJSON = new JSONObject();
|
| | | taoBaoGoodsJSON.put("title", commonGoods.getTitle());
|
| | | taoBaoGoodsJSON.put("zkPrice", commonGoods.getPrice() + "");
|
| | |
| | | import org.yeshi.utils.mybatis.Table;
|
| | |
|
| | | import com.yeshi.fanli.dto.msg.MsgOtherCouponContentDTO;
|
| | | import com.yeshi.fanli.dto.msg.MsgOtherGiveContentDTO;
|
| | | import com.yeshi.fanli.dto.msg.MsgOtherTaoLiJinContentDTO;
|
| | | import com.yeshi.fanli.entity.bus.user.UserInfo;
|
| | |
|
| | |
| | | public class MsgOtherDetail {
|
| | | public enum MsgTypeOtherTypeEnum {
|
| | | couponMianDan("免单券"), couponWelfareMianDan("福利免单券"), couponReward("奖励券"),
|
| | | taoLiJin("推广红包");
|
| | | taoLiJin("推广红包"), give("赠送");
|
| | |
|
| | | private final String desc;
|
| | |
|
| | |
| | |
|
| | | // 淘礼金参数
|
| | | private MsgOtherTaoLiJinContentDTO taoLiJinContent;
|
| | | |
| | | // 赠送信息
|
| | | private MsgOtherGiveContentDTO giveContent;
|
| | |
|
| | |
|
| | | public MsgOtherCouponContentDTO getCoupnContent() {
|
| | |
| | | public void setTaoLiJinContent(MsgOtherTaoLiJinContentDTO taoLiJinContent) {
|
| | | this.taoLiJinContent = taoLiJinContent;
|
| | | }
|
| | |
|
| | | public MsgOtherGiveContentDTO getGiveContent() {
|
| | | return giveContent;
|
| | | }
|
| | |
|
| | | public void setGiveContent(MsgOtherGiveContentDTO giveContent) {
|
| | | this.giveContent = giveContent;
|
| | | }
|
| | | }
|
| | |
| | | // 赠送uid
|
| | | @Column(name = "tgr_give_uid")
|
| | | private Long giveUid;
|
| | | // 领取uid
|
| | | @Column(name = "tgr_receive_uid")
|
| | | private Long receiveUid;
|
| | | // 赠送时间
|
| | | @Column(name = "tgr_give_time")
|
| | | private Date giveTime;
|
| | |
|
| | | // 赠送结束时间
|
| | | @Column(name = "tgr_end_time")
|
| | | private Date endTime;
|
| | | |
| | | // 领取uid
|
| | | @Column(name = "tgr_receive_uid")
|
| | | private Long receiveUid;
|
| | | // 领取时间
|
| | | @Column(name = "tgr_receive_time")
|
| | | private Date receiveTime;
|
| | |
| | | public void setAmount(BigDecimal amount) {
|
| | | this.amount = amount;
|
| | | }
|
| | |
|
| | | public Date getEndTime() {
|
| | | return endTime;
|
| | | }
|
| | |
|
| | | public void setEndTime(Date endTime) {
|
| | | this.endTime = endTime;
|
| | | }
|
| | | |
| | | }
|
| | |
| | |
|
| | | public enum TaoLiJinOriginEnum {
|
| | | newbiesWin("新人红包"), shareWin("推广红包福利"), rankWin("账户等级福利"), inviteWin("邀请队员奖励"),
|
| | | refund("未领取退回"), exchange("金币兑换");
|
| | | refund("未领取退回"), exchange("金币兑换"), friendsGive("好友赠送");
|
| | |
|
| | | private final String desc;
|
| | |
|
| | |
| | | // 赠送uid
|
| | | @Column(name = "cgr_give_uid")
|
| | | private Long giveUid;
|
| | | // 领取uid
|
| | | @Column(name = "cgr_receive_uid")
|
| | | private Long receiveUid;
|
| | | // 赠送时间
|
| | | @Column(name = "cgr_give_time")
|
| | | private Date giveTime;
|
| | | // 赠送结束时间
|
| | | @Column(name = "cgr_end_time")
|
| | | private Date endTime;
|
| | | // 领取uid
|
| | | @Column(name = "cgr_receive_uid")
|
| | | private Long receiveUid;
|
| | | // 领取时间
|
| | | @Column(name = "cgr_receive_time")
|
| | | private Date receiveTime;
|
| | |
| | | public void setReceiveTime(Date receiveTime) {
|
| | | this.receiveTime = receiveTime;
|
| | | }
|
| | | |
| | |
|
| | | public Date getEndTime() {
|
| | | return endTime;
|
| | | }
|
| | |
|
| | | public void setEndTime(Date endTime) {
|
| | | this.endTime = endTime;
|
| | | }
|
| | | }
|
| | |
| | | <id column="tgr_id" property="id" jdbcType="BIGINT"/> |
| | | <result column="tgr_amount" property="amount" jdbcType="DECIMAL"/> |
| | | <result column="tgr_give_uid" property="giveUid" jdbcType="BIGINT"/> |
| | | <result column="tgr_receive_uid" property="receiveUid" jdbcType="BIGINT"/> |
| | | <result column="tgr_give_time" property="giveTime" jdbcType="TIMESTAMP"/> |
| | | <result column="tgr_end_time" property="endTime" jdbcType="TIMESTAMP"/> |
| | | <result column="tgr_receive_uid" property="receiveUid" jdbcType="BIGINT"/> |
| | | <result column="tgr_receive_time" property="receiveTime" jdbcType="TIMESTAMP"/> |
| | | <result column="tgr_state" property="state" jdbcType="INTEGER"/> |
| | | </resultMap> |
| | | <sql id="Base_Column_List">tgr_id,tgr_amount,tgr_give_uid,tgr_receive_uid,tgr_give_time,tgr_receive_time,tgr_state</sql> |
| | | <sql id="Base_Column_List">tgr_id,tgr_amount,tgr_give_uid,tgr_give_time,tgr_end_time,tgr_receive_uid,tgr_receive_time,tgr_state</sql> |
| | | <select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.Long">select |
| | | <include refid="Base_Column_List"/>from yeshi_ec_user_taolijin_give_record where tgr_id = #{id,jdbcType=BIGINT} |
| | | </select> |
| | | <delete id="deleteByPrimaryKey" parameterType="java.lang.Long">delete from yeshi_ec_user_taolijin_give_record where tgr_id = #{id,jdbcType=BIGINT}</delete> |
| | | <insert id="insert" parameterType="com.yeshi.fanli.entity.bus.tlj.UserTaoLiJinGiveRecord" useGeneratedKeys="true" keyProperty="id">insert into yeshi_ec_user_taolijin_give_record (tgr_id,tgr_amount,tgr_give_uid,tgr_receive_uid,tgr_give_time,tgr_receive_time,tgr_state) values (#{id,jdbcType=BIGINT},#{amount,jdbcType=DECIMAL},#{giveUid,jdbcType=BIGINT},#{receiveUid,jdbcType=BIGINT},#{giveTime,jdbcType=TIMESTAMP},#{receiveTime,jdbcType=TIMESTAMP},#{state,jdbcType=INTEGER})</insert> |
| | | <insert id="insert" parameterType="com.yeshi.fanli.entity.bus.tlj.UserTaoLiJinGiveRecord" useGeneratedKeys="true" keyProperty="id">insert into yeshi_ec_user_taolijin_give_record (tgr_id,tgr_amount,tgr_give_uid,tgr_give_time,tgr_end_time,tgr_receive_uid,tgr_receive_time,tgr_state) values (#{id,jdbcType=BIGINT},#{amount,jdbcType=DECIMAL},#{giveUid,jdbcType=BIGINT},#{giveTime,jdbcType=TIMESTAMP},#{endTime,jdbcType=TIMESTAMP},#{receiveUid,jdbcType=BIGINT},#{receiveTime,jdbcType=TIMESTAMP},#{state,jdbcType=INTEGER})</insert> |
| | | <insert id="insertSelective" parameterType="com.yeshi.fanli.entity.bus.tlj.UserTaoLiJinGiveRecord" useGeneratedKeys="true" keyProperty="id">insert into yeshi_ec_user_taolijin_give_record |
| | | <trim prefix="(" suffix=")" suffixOverrides=","> |
| | | <if test="id != null">tgr_id,</if> |
| | | <if test="amount != null">tgr_amount,</if> |
| | | <if test="giveUid != null">tgr_give_uid,</if> |
| | | <if test="receiveUid != null">tgr_receive_uid,</if> |
| | | <if test="giveTime != null">tgr_give_time,</if> |
| | | <if test="endTime != null">tgr_end_time,</if> |
| | | <if test="receiveUid != null">tgr_receive_uid,</if> |
| | | <if test="receiveTime != null">tgr_receive_time,</if> |
| | | <if test="state != null">tgr_state,</if> |
| | | </trim>values |
| | |
| | | <if test="id != null">#{id,jdbcType=BIGINT},</if> |
| | | <if test="amount != null">#{amount,jdbcType=DECIMAL},</if> |
| | | <if test="giveUid != null">#{giveUid,jdbcType=BIGINT},</if> |
| | | <if test="receiveUid != null">#{receiveUid,jdbcType=BIGINT},</if> |
| | | <if test="giveTime != null">#{giveTime,jdbcType=TIMESTAMP},</if> |
| | | <if test="endTime != null">#{endTime,jdbcType=TIMESTAMP},</if> |
| | | <if test="receiveUid != null">#{receiveUid,jdbcType=BIGINT},</if> |
| | | <if test="receiveTime != null">#{receiveTime,jdbcType=TIMESTAMP},</if> |
| | | <if test="state != null">#{state,jdbcType=INTEGER},</if> |
| | | </trim> |
| | | </insert> |
| | | <update id="updateByPrimaryKey" parameterType="com.yeshi.fanli.entity.bus.tlj.UserTaoLiJinGiveRecord">update yeshi_ec_user_taolijin_give_record set tgr_amount = #{amount,jdbcType=DECIMAL},tgr_give_uid = #{giveUid,jdbcType=BIGINT},tgr_receive_uid = #{receiveUid,jdbcType=BIGINT},tgr_give_time = #{giveTime,jdbcType=TIMESTAMP},tgr_receive_time = #{receiveTime,jdbcType=TIMESTAMP},tgr_state = #{state,jdbcType=INTEGER} where tgr_id = #{id,jdbcType=BIGINT}</update> |
| | | <update id="updateByPrimaryKey" parameterType="com.yeshi.fanli.entity.bus.tlj.UserTaoLiJinGiveRecord">update yeshi_ec_user_taolijin_give_record set tgr_amount = #{amount,jdbcType=DECIMAL},tgr_give_uid = #{giveUid,jdbcType=BIGINT},tgr_give_time = #{giveTime,jdbcType=TIMESTAMP},tgr_end_time = #{endTime,jdbcType=TIMESTAMP},tgr_receive_uid = #{receiveUid,jdbcType=BIGINT},tgr_receive_time = #{receiveTime,jdbcType=TIMESTAMP},tgr_state = #{state,jdbcType=INTEGER} where tgr_id = #{id,jdbcType=BIGINT}</update> |
| | | <update id="updateByPrimaryKeySelective" parameterType="com.yeshi.fanli.entity.bus.tlj.UserTaoLiJinGiveRecord">update yeshi_ec_user_taolijin_give_record |
| | | <set> |
| | | <if test="amount != null">tgr_amount=#{amount,jdbcType=DECIMAL},</if> |
| | | <if test="giveUid != null">tgr_give_uid=#{giveUid,jdbcType=BIGINT},</if> |
| | | <if test="receiveUid != null">tgr_receive_uid=#{receiveUid,jdbcType=BIGINT},</if> |
| | | <if test="giveTime != null">tgr_give_time=#{giveTime,jdbcType=TIMESTAMP},</if> |
| | | <if test="endTime != null">tgr_end_time=#{endTime,jdbcType=TIMESTAMP},</if> |
| | | <if test="receiveUid != null">tgr_receive_uid=#{receiveUid,jdbcType=BIGINT},</if> |
| | | <if test="receiveTime != null">tgr_receive_time=#{receiveTime,jdbcType=TIMESTAMP},</if> |
| | | <if test="state != null">tgr_state=#{state,jdbcType=INTEGER},</if> |
| | | </set> where tgr_id = #{id,jdbcType=BIGINT} |
| | |
| | | <id column="cgr_id" property="id" jdbcType="BIGINT"/> |
| | | <result column="cgr_coupon_id" property="couponId" jdbcType="BIGINT"/> |
| | | <result column="cgr_give_uid" property="giveUid" jdbcType="BIGINT"/> |
| | | <result column="cgr_receive_uid" property="receiveUid" jdbcType="BIGINT"/> |
| | | <result column="cgr_give_time" property="giveTime" jdbcType="TIMESTAMP"/> |
| | | <result column="cgr_end_time" property="endTime" jdbcType="TIMESTAMP"/> |
| | | <result column="cgr_receive_uid" property="receiveUid" jdbcType="BIGINT"/> |
| | | <result column="cgr_receive_time" property="receiveTime" jdbcType="TIMESTAMP"/> |
| | | </resultMap> |
| | | <sql id="Base_Column_List">cgr_id,cgr_coupon_id,cgr_give_uid,cgr_receive_uid,cgr_give_time,cgr_receive_time</sql> |
| | | <sql id="Base_Column_List">cgr_id,cgr_coupon_id,cgr_give_uid,cgr_give_time,cgr_end_time,cgr_receive_uid,cgr_receive_time</sql> |
| | | <select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.Long">select |
| | | <include refid="Base_Column_List"/>from yeshi_ec_user_system_coupon_give_record where cgr_id = #{id,jdbcType=BIGINT} |
| | | </select> |
| | | <delete id="deleteByPrimaryKey" parameterType="java.lang.Long">delete from yeshi_ec_user_system_coupon_give_record where cgr_id = #{id,jdbcType=BIGINT}</delete> |
| | | <insert id="insert" parameterType="com.yeshi.fanli.entity.bus.user.UserSystemCouponGiveRecord" useGeneratedKeys="true" keyProperty="id">insert into yeshi_ec_user_system_coupon_give_record (cgr_id,cgr_coupon_id,cgr_give_uid,cgr_receive_uid,cgr_give_time,cgr_receive_time) values (#{id,jdbcType=BIGINT},#{couponId,jdbcType=BIGINT},#{giveUid,jdbcType=BIGINT},#{receiveUid,jdbcType=BIGINT},#{giveTime,jdbcType=TIMESTAMP},#{receiveTime,jdbcType=TIMESTAMP})</insert> |
| | | <insert id="insert" parameterType="com.yeshi.fanli.entity.bus.user.UserSystemCouponGiveRecord" useGeneratedKeys="true" keyProperty="id">insert into yeshi_ec_user_system_coupon_give_record (cgr_id,cgr_coupon_id,cgr_give_uid,cgr_give_time,cgr_end_time,cgr_receive_uid,cgr_receive_time) values (#{id,jdbcType=BIGINT},#{couponId,jdbcType=BIGINT},#{giveUid,jdbcType=BIGINT},#{giveTime,jdbcType=TIMESTAMP},#{endTime,jdbcType=TIMESTAMP},#{receiveUid,jdbcType=BIGINT},#{receiveTime,jdbcType=TIMESTAMP})</insert> |
| | | <insert id="insertSelective" parameterType="com.yeshi.fanli.entity.bus.user.UserSystemCouponGiveRecord" useGeneratedKeys="true" keyProperty="id">insert into yeshi_ec_user_system_coupon_give_record |
| | | <trim prefix="(" suffix=")" suffixOverrides=","> |
| | | <if test="id != null">cgr_id,</if> |
| | | <if test="couponId != null">cgr_coupon_id,</if> |
| | | <if test="giveUid != null">cgr_give_uid,</if> |
| | | <if test="receiveUid != null">cgr_receive_uid,</if> |
| | | <if test="giveTime != null">cgr_give_time,</if> |
| | | <if test="endTime != null">cgr_end_time,</if> |
| | | <if test="receiveUid != null">cgr_receive_uid,</if> |
| | | <if test="receiveTime != null">cgr_receive_time,</if> |
| | | </trim>values |
| | | <trim prefix="(" suffix=")" suffixOverrides=","> |
| | | <if test="id != null">#{id,jdbcType=BIGINT},</if> |
| | | <if test="couponId != null">#{couponId,jdbcType=BIGINT},</if> |
| | | <if test="giveUid != null">#{giveUid,jdbcType=BIGINT},</if> |
| | | <if test="receiveUid != null">#{receiveUid,jdbcType=BIGINT},</if> |
| | | <if test="giveTime != null">#{giveTime,jdbcType=TIMESTAMP},</if> |
| | | <if test="endTime != null">#{endTime,jdbcType=TIMESTAMP},</if> |
| | | <if test="receiveUid != null">#{receiveUid,jdbcType=BIGINT},</if> |
| | | <if test="receiveTime != null">#{receiveTime,jdbcType=TIMESTAMP},</if> |
| | | </trim> |
| | | </insert> |
| | | <update id="updateByPrimaryKey" parameterType="com.yeshi.fanli.entity.bus.user.UserSystemCouponGiveRecord">update yeshi_ec_user_system_coupon_give_record set cgr_coupon_id = #{couponId,jdbcType=BIGINT},cgr_give_uid = #{giveUid,jdbcType=BIGINT},cgr_receive_uid = #{receiveUid,jdbcType=BIGINT},cgr_give_time = #{giveTime,jdbcType=TIMESTAMP},cgr_receive_time = #{receiveTime,jdbcType=TIMESTAMP} where cgr_id = #{id,jdbcType=BIGINT}</update> |
| | | <update id="updateByPrimaryKey" parameterType="com.yeshi.fanli.entity.bus.user.UserSystemCouponGiveRecord">update yeshi_ec_user_system_coupon_give_record set cgr_coupon_id = #{couponId,jdbcType=BIGINT},cgr_give_uid = #{giveUid,jdbcType=BIGINT},cgr_give_time = #{giveTime,jdbcType=TIMESTAMP},cgr_end_time = #{endTime,jdbcType=TIMESTAMP},cgr_receive_uid = #{receiveUid,jdbcType=BIGINT},cgr_receive_time = #{receiveTime,jdbcType=TIMESTAMP} where cgr_id = #{id,jdbcType=BIGINT}</update> |
| | | <update id="updateByPrimaryKeySelective" parameterType="com.yeshi.fanli.entity.bus.user.UserSystemCouponGiveRecord">update yeshi_ec_user_system_coupon_give_record |
| | | <set> |
| | | <if test="couponId != null">cgr_coupon_id=#{couponId,jdbcType=BIGINT},</if> |
| | | <if test="giveUid != null">cgr_give_uid=#{giveUid,jdbcType=BIGINT},</if> |
| | | <if test="receiveUid != null">cgr_receive_uid=#{receiveUid,jdbcType=BIGINT},</if> |
| | | <if test="giveTime != null">cgr_give_time=#{giveTime,jdbcType=TIMESTAMP},</if> |
| | | <if test="endTime != null">cgr_end_time=#{endTime,jdbcType=TIMESTAMP},</if> |
| | | <if test="receiveUid != null">cgr_receive_uid=#{receiveUid,jdbcType=BIGINT},</if> |
| | | <if test="receiveTime != null">cgr_receive_time=#{receiveTime,jdbcType=TIMESTAMP},</if> |
| | | </set> where cgr_id = #{id,jdbcType=BIGINT} |
| | | </update> |
| | | <select id="getRecordByUidAndCouponId"> |
| | | <select id="getRecordByUidAndCouponId"> |
| | | SELECT * FROM yeshi_ec_user_system_coupon_give_record |
| | | WHERE cgr_give_uid = #{uid} AND cgr_coupon_id = #{couponId} |
| | | LIMIT 1 |
| | |
| | | } else if (detail.getType() == MsgTypeOtherTypeEnum.taoLiJin) {
|
| | | msgOtherDetailMapper.insertSelective(detail);
|
| | | userMsgReadStateService.addOtherMsgUnReadCount(detail.getUser().getId(), 1);
|
| | | } else if (detail.getType() == MsgTypeOtherTypeEnum.give) {
|
| | | msgOtherDetailMapper.insertSelective(detail);
|
| | | userMsgReadStateService.addOtherMsgUnReadCount(detail.getUser().getId(), 1);
|
| | | }
|
| | | }
|
| | |
|
| | |
| | | package com.yeshi.fanli.service.impl.msg;
|
| | |
|
| | | import java.math.BigDecimal;
|
| | | import java.text.SimpleDateFormat;
|
| | | import java.util.Date;
|
| | |
|
| | | import javax.annotation.Resource;
|
| | |
| | |
|
| | | import com.google.gson.Gson;
|
| | | import com.yeshi.fanli.dto.msg.MsgOtherCouponContentDTO;
|
| | | import com.yeshi.fanli.dto.msg.MsgOtherGiveContentDTO;
|
| | | import com.yeshi.fanli.dto.msg.MsgOtherTaoLiJinContentDTO;
|
| | | import com.yeshi.fanli.entity.bus.msg.MsgOtherDetail;
|
| | | import com.yeshi.fanli.entity.bus.msg.MsgOtherDetail.MsgTypeOtherTypeEnum;
|
| | |
| | | }
|
| | | }
|
| | |
|
| | | |
| | | @Override
|
| | | public void tokenGiveMsg(Long uid, String beiZhu, MsgOtherGiveContentDTO content) {
|
| | | try {
|
| | | MsgOtherDetail detail = new MsgOtherDetail();
|
| | | detail.setBeiZhu(beiZhu);
|
| | | detail.setCreateTime(new Date());
|
| | | detail.setRead(false);
|
| | | detail.setUser(new UserInfo(uid));
|
| | | detail.setContent(new Gson().toJson(content));
|
| | | detail.setType(MsgTypeOtherTypeEnum.give);
|
| | | msgOtherDetailService.addMsgOtherDetail(detail);
|
| | | } catch (MsgOtherDetailException e) {
|
| | | e.printStackTrace();
|
| | | }
|
| | | }
|
| | | }
|
| | |
| | | // 红包明细
|
| | | userTaoLiJinDetailService.createAddDetail(origin);
|
| | | }
|
| | | |
| | | |
| | | @Override
|
| | | @Transactional
|
| | | public UserTaoLiJinOrigin receiveFriendsGive(Long uid, BigDecimal money) throws UserTaoLiJinOriginException{
|
| | | if (uid == null || money == null) {
|
| | | throw new UserTaoLiJinOriginException(1, "参数不能为空");
|
| | | }
|
| | | |
| | | // 添加红包余额
|
| | | userMoneyExtraService.addTaoLiJin(uid, money, false);
|
| | | // 添加新增记录
|
| | | UserTaoLiJinOrigin origin = saveOrigin(uid, 1, money, TaoLiJinOriginEnum.friendsGive);
|
| | | // 红包明细
|
| | | userTaoLiJinDetailService.createAddDetail(origin);
|
| | | // 消息
|
| | | executor.execute(new Runnable() {
|
| | | @Override
|
| | | public void run() {
|
| | | try {
|
| | | MsgOtherTaoLiJinContentDTO content = new MsgOtherTaoLiJinContentDTO();
|
| | | content.setState("红包增加");
|
| | | content.setSource("好友赠送");
|
| | | content.setMoney(money);
|
| | | userOtherMsgNotificationService.taoLiJinMsg(uid, "", content);
|
| | | } catch (Exception e) {
|
| | | LogHelper.errorDetailInfo(e);
|
| | | }
|
| | | }
|
| | | });
|
| | | return origin;
|
| | | }
|
| | | |
| | | }
|
| | |
| | | package com.yeshi.fanli.service.impl.user;
|
| | |
|
| | | import java.math.BigDecimal;
|
| | | import java.text.SimpleDateFormat;
|
| | | import java.util.ArrayList;
|
| | | import java.util.Date;
|
| | | import java.util.List;
|
| | |
|
| | | import javax.annotation.Resource;
|
| | |
|
| | | import org.springframework.core.task.TaskExecutor;
|
| | | import org.springframework.stereotype.Service;
|
| | |
|
| | | import com.yeshi.fanli.dao.mybatis.user.TokenRecordMapper;
|
| | | import com.yeshi.fanli.dto.msg.MsgOtherGiveContentDTO;
|
| | | import com.yeshi.fanli.entity.bus.tlj.UserTaoLiJinGiveRecord;
|
| | | import com.yeshi.fanli.entity.bus.user.TokenRecord;
|
| | | import com.yeshi.fanli.entity.bus.user.TokenRecord.TokenTypeEnum;
|
| | | import com.yeshi.fanli.entity.bus.user.UserInfo;
|
| | | import com.yeshi.fanli.entity.bus.user.UserInfoExtra;
|
| | | import com.yeshi.fanli.entity.bus.user.UserSystemCoupon;
|
| | | import com.yeshi.fanli.entity.bus.user.UserSystemCouponGiveRecord;
|
| | | import com.yeshi.fanli.entity.system.SystemCoupon.CouponTypeEnum;
|
| | | import com.yeshi.fanli.exception.tlj.UserTaoLiJinOriginException;
|
| | | import com.yeshi.fanli.exception.user.TokenRecordException;
|
| | | import com.yeshi.fanli.exception.user.UserInfoExtraException;
|
| | | import com.yeshi.fanli.log.LogHelper;
|
| | | import com.yeshi.fanli.service.inter.hongbao.ThreeSaleSerivce;
|
| | | import com.yeshi.fanli.service.inter.msg.UserOtherMsgNotificationService;
|
| | | import com.yeshi.fanli.service.inter.tlj.UserTaoLiJinGiveRecordService;
|
| | | import com.yeshi.fanli.service.inter.tlj.UserTaoLiJinOriginService;
|
| | | import com.yeshi.fanli.service.inter.user.TokenRecordService;
|
| | | import com.yeshi.fanli.service.inter.user.UserInfoExtraService;
|
| | | import com.yeshi.fanli.service.inter.user.UserInfoService;
|
| | |
| | | @Service
|
| | | public class TokenRecordServiceImpl implements TokenRecordService {
|
| | |
|
| | | @Resource(name = "taskExecutor")
|
| | | private TaskExecutor executor;
|
| | | |
| | | @Resource
|
| | | private TokenRecordMapper tokenRecordMapper;
|
| | |
|
| | |
| | | @Resource
|
| | | private UserSystemCouponGiveRecordService userSystemCouponGiveRecordService;
|
| | |
|
| | | @Resource
|
| | | private UserTaoLiJinOriginService userTaoLiJinOriginService;
|
| | | |
| | | @Resource
|
| | | private UserOtherMsgNotificationService userOtherMsgNotificationService;
|
| | | |
| | | |
| | | @Override
|
| | | public void insertSelective(TokenRecord record) {
|
| | | record.setCreateTime(new Date());
|
| | |
| | | TokenRecord rokenRecord = tokenRecordMapper.getByToken(token);
|
| | | if (rokenRecord == null)
|
| | | throw new TokenRecordException(1, "口令不存在");
|
| | | |
| | | Date now = new Date();
|
| | | Date endTimeToken = rokenRecord.getEndTime();
|
| | | if (endTimeToken != null && endTimeToken.getTime() < now.getTime())
|
| | | throw new TokenRecordException(1, "口令已失效");
|
| | | |
| | | Integer stateTtoken = rokenRecord.getState();
|
| | | if (stateTtoken != null && stateTtoken == 1)
|
| | | throw new TokenRecordException(1, "口令已失效");
|
| | |
|
| | | String nickName = null;
|
| | | String portrait = null;
|
| | |
| | | nickName = nickName.substring(0, 6) + "...";
|
| | | }
|
| | |
|
| | | Integer stateTtoken = rokenRecord.getState();
|
| | | if (stateTtoken == 1)
|
| | | throw new TokenRecordException(1, "口令已失效");
|
| | |
|
| | | TokenVO tokenVO = new TokenVO();
|
| | | tokenVO.setToken(token);
|
| | | tokenVO.setNickName(nickName);
|
| | | tokenVO.setPortrait(portrait);
|
| | |
|
| | |
| | | throw new TokenRecordException(1, "口令不能为空");
|
| | |
|
| | | TokenRecord rokenRecord = tokenRecordMapper.getByToken(token);
|
| | | if (rokenRecord == null || rokenRecord.getState() == 1)
|
| | | if (rokenRecord == null)
|
| | | throw new TokenRecordException(1, "口令已失效");
|
| | |
|
| | | |
| | | Date now = new Date();
|
| | | Date endTimeToken = rokenRecord.getEndTime();
|
| | | if (endTimeToken != null && endTimeToken.getTime() < now.getTime())
|
| | | throw new TokenRecordException(1, "口令已失效");
|
| | | |
| | | Integer stateTtoken = rokenRecord.getState();
|
| | | if (stateTtoken != null && stateTtoken == 1)
|
| | | throw new TokenRecordException(1, "口令已失效");
|
| | | |
| | | String identify = rokenRecord.getIdentify();
|
| | | if (StringUtil.isNullOrEmpty(identify))
|
| | | throw new TokenRecordException(1, "口令标识不存在");
|
| | |
|
| | | Long giveUid = rokenRecord.getUid();
|
| | |
|
| | | Long giveUid = rokenRecord.getUid();
|
| | | UserInfoExtra userInfoExtra = userInfoExtraService.getUserInfoExtra(uid);
|
| | | if (userInfoExtra == null)
|
| | | throw new TokenRecordException(1, "用户信息缺失");
|
| | |
|
| | | boolean receive = false;
|
| | | TokenTypeEnum tokenType = rokenRecord.getType();
|
| | | if (tokenType == TokenTypeEnum.freeCoupon) {
|
| | | UserSystemCoupon userCoupon = userSystemCouponService.selectByPrimaryKey(Long.parseLong(identify));
|
| | | long couponId = Long.parseLong(identify);
|
| | | UserSystemCoupon userCoupon = userSystemCouponService.selectByPrimaryKey(couponId);
|
| | | if (userCoupon == null)
|
| | | throw new TokenRecordException(1, "该券不存在");
|
| | |
|
| | |
| | | throw new TokenRecordException(1, "口令已失效");
|
| | |
|
| | | if (give && userCoupon.getState() == UserSystemCoupon.STATE_IN_USE) {
|
| | | UserSystemCouponGiveRecord giveRecord = userSystemCouponGiveRecordService.getRecordByUidAndCouponId(giveUid, couponId);
|
| | | if (giveRecord == null ) |
| | | throw new TokenRecordException(1, "口令已失效");
|
| | | |
| | | Date endTime = giveRecord.getEndTime();
|
| | | if (endTime != null && endTime.getTime() < now.getTime())
|
| | | throw new TokenRecordException(1, "哎呀,这张免单券已失效了!");
|
| | | |
| | | try {
|
| | | userSystemCouponService.insertUserCoupon(uid, CouponTypeEnum.freeCoupon.name(), UserSystemCoupon.SOURCE_GIVE);
|
| | | } catch (Exception e) {
|
| | |
| | | throw new TokenRecordException(1, "领取失败");
|
| | | }
|
| | |
|
| | | // 更新记录
|
| | | userSystemCouponGiveRecordService.updateRecord(uid, giveUid, Long.parseLong(identify));
|
| | | // 领取成功
|
| | | receive = true;
|
| | | // 更新赠送券信息
|
| | | userSystemCouponService.updateGiveRecord(uid, couponId, CouponTypeEnum.freeCoupon.name());
|
| | | |
| | | // 更新赠送记录
|
| | | giveRecord.setReceiveUid(uid);
|
| | | giveRecord.setReceiveTime(new Date());
|
| | | userSystemCouponGiveRecordService.updateByPrimaryKeySelective(giveRecord);
|
| | | |
| | | // 消息 + 队员
|
| | | executor.execute(new Runnable() {
|
| | | @Override
|
| | | public void run() {
|
| | | SimpleDateFormat sd = new SimpleDateFormat("yyyy.MM.dd HH.mm");
|
| | | boolean addTeam = addInviteTeam(uid, giveUid, userInfoExtra);
|
| | | String beiZhu = "无";
|
| | | if (addTeam)
|
| | | beiZhu = "领取人已经成为你的一级队员";
|
| | | |
| | | String userName = "无";
|
| | | UserInfo user = userInfoService.selectByPKey(uid);
|
| | | if (user != null && !StringUtil.isNullOrEmpty(user.getNickName()))
|
| | | userName = user.getNickName();
|
| | | |
| | | MsgOtherGiveContentDTO msgOther = new MsgOtherGiveContentDTO();
|
| | | msgOther.setType(MsgOtherGiveContentDTO.TYEP_COUPON);
|
| | | msgOther.setTitle("赠送免单券");
|
| | | msgOther.setGiveType("你赠送的免单券被成功领取");
|
| | | msgOther.setReceiveInfo("昵称: " + userName +" ID:" + uid);
|
| | | msgOther.setGiveTime(sd.format(giveRecord.getGiveTime()));
|
| | | msgOther.setReceiveTime(sd.format(new Date()));
|
| | | userOtherMsgNotificationService.tokenGiveMsg(giveUid, beiZhu, msgOther);
|
| | | }
|
| | | });
|
| | | } else {
|
| | | throw new TokenRecordException(1, "口令已失效");
|
| | | }
|
| | |
|
| | | } else if (tokenType == TokenTypeEnum.rebatePercentCoupon) {
|
| | | UserSystemCoupon userCoupon = userSystemCouponService.selectByPrimaryKey(Long.parseLong(identify));
|
| | |
|
| | | long couponId = Long.parseLong(identify);
|
| | | UserSystemCoupon userCoupon = userSystemCouponService.selectByPrimaryKey(couponId);
|
| | | if (userCoupon == null)
|
| | | throw new TokenRecordException(1, "该券不存在");
|
| | |
|
| | |
| | | throw new TokenRecordException(1, "口令已失效");
|
| | |
|
| | | if (give && userCoupon.getState() == UserSystemCoupon.STATE_IN_USE) {
|
| | | UserSystemCouponGiveRecord giveRecord = userSystemCouponGiveRecordService.getRecordByUidAndCouponId(giveUid, couponId);
|
| | | if (giveRecord == null ) |
| | | throw new TokenRecordException(1, "口令已失效");
|
| | | |
| | | Date endTime = giveRecord.getEndTime();
|
| | | if (endTime != null && endTime.getTime() < now.getTime())
|
| | | throw new TokenRecordException(1, "哎呀,这张返利奖励券已失效了!");
|
| | | |
| | | try {
|
| | | userSystemCouponService.insertUserCoupon(uid, CouponTypeEnum.rebatePercentCoupon.name(), UserSystemCoupon.SOURCE_GIVE);
|
| | | } catch (Exception e) {
|
| | | LogHelper.errorDetailInfo(e);
|
| | | throw new TokenRecordException(1, "领取失败");
|
| | | }
|
| | | // 领取成功
|
| | | receive = true;
|
| | | |
| | | // 更新赠送券信息
|
| | | userSystemCouponService.updateGiveRecord(uid, couponId, CouponTypeEnum.rebatePercentCoupon.name());
|
| | | |
| | | // 更新赠送记录
|
| | | giveRecord.setReceiveUid(uid);
|
| | | giveRecord.setReceiveTime(new Date());
|
| | | userSystemCouponGiveRecordService.updateByPrimaryKeySelective(giveRecord);
|
| | | |
| | | // 消息 + 队员
|
| | | executor.execute(new Runnable() {
|
| | | @Override
|
| | | public void run() {
|
| | | SimpleDateFormat sd = new SimpleDateFormat("yyyy.MM.dd HH.mm");
|
| | | boolean addTeam = addInviteTeam(uid, giveUid, userInfoExtra);
|
| | | String beiZhu = "无";
|
| | | if (addTeam)
|
| | | beiZhu = "领取人已经成为你的一级队员";
|
| | | |
| | | MsgOtherGiveContentDTO msgOther = new MsgOtherGiveContentDTO();
|
| | | msgOther.setType(MsgOtherGiveContentDTO.TYEP_COUPON);
|
| | | msgOther.setTitle("赠送奖励券");
|
| | | msgOther.setGiveType("你赠送的奖励券被成功领取");
|
| | | msgOther.setReceiveInfo("昵称:[昵称昵称昵称/无]ID:[854245]");
|
| | | msgOther.setGiveTime(sd.format(giveRecord.getGiveTime()));
|
| | | msgOther.setReceiveTime(sd.format(new Date()));
|
| | | userOtherMsgNotificationService.tokenGiveMsg(giveUid, beiZhu, msgOther);
|
| | | }
|
| | | });
|
| | | } else {
|
| | | throw new TokenRecordException(1, "口令已失效");
|
| | | }
|
| | |
| | | UserTaoLiJinGiveRecord giveRecord = userTaoLiJinGiveRecordService
|
| | | .selectByPrimaryKey(Long.parseLong(identify));
|
| | | if (giveRecord == null || giveRecord.getState() == UserTaoLiJinGiveRecord.STATE_OVERDUE) {
|
| | | throw new TokenRecordException(1, "哎呀,哎呀,推广红包已失效了!");
|
| | | throw new TokenRecordException(1, "哎呀,推广红包已失效了!");
|
| | | } else if (giveRecord.getState() == UserTaoLiJinGiveRecord.STATE_RECEIVE) {
|
| | | throw new TokenRecordException(1, "哎呀,推广红包已被领取了!");
|
| | | } else {
|
| | |
|
| | | Date endTime = giveRecord.getEndTime();
|
| | | if (endTime != null && endTime.getTime() < now.getTime())
|
| | | throw new TokenRecordException(1, "哎呀,推广红包已失效了!");
|
| | |
|
| | | |
| | | |
| | | BigDecimal amount = giveRecord.getAmount();
|
| | | try {
|
| | | // 领取
|
| | | userTaoLiJinOriginService.receiveFriendsGive(uid, amount);
|
| | | |
| | | // 更新记录
|
| | | UserTaoLiJinGiveRecord updateRecord = new UserTaoLiJinGiveRecord();
|
| | | updateRecord.setId(Long.parseLong(identify));
|
| | | updateRecord.setReceiveTime(new Date());
|
| | | updateRecord.setReceiveUid(uid);
|
| | | updateRecord.setState(UserTaoLiJinGiveRecord.STATE_RECEIVE);
|
| | | userTaoLiJinGiveRecordService.updateByPrimaryKeySelective(updateRecord);
|
| | | } catch (UserTaoLiJinOriginException e) {
|
| | | e.printStackTrace();
|
| | | }
|
| | | }
|
| | | } else {
|
| | | throw new TokenRecordException(1, "无对应类型");
|
| | | }
|
| | |
|
| | | if (receive) |
| | | throw new TokenRecordException(1, "领取失败啦");
|
| | | |
| | | if (StringUtil.isNullOrEmpty(userInfoExtra.getInviteCode())) {
|
| | | // 成为下级
|
| | | |
| | | |
| | | }
|
| | |
|
| | | |
| | | }
|
| | | |
| | | |
| | | /**
|
| | | * 未激活邀请码: 上下级关系确立
|
| | | * @param uid
|
| | | * @param giveUid
|
| | | * @param userInfoExtra
|
| | | * @return
|
| | | */
|
| | | public boolean addInviteTeam(Long uid, Long giveUid, UserInfoExtra userInfoExtra) {
|
| | | boolean invite = false;
|
| | | if (StringUtil.isNullOrEmpty(userInfoExtra.getInviteCode())) {
|
| | | UserInfoExtra userInfoExtraGive = userInfoExtraService.getUserInfoExtra(giveUid);
|
| | | if (userInfoExtraGive != null ) {
|
| | | String inviteCode = userInfoExtraGive.getInviteCode();
|
| | | if(!StringUtil.isNullOrEmpty(inviteCode)) {
|
| | | try {
|
| | | userInfoExtraService.activateInviteCode(uid, inviteCode);
|
| | | invite = true;
|
| | | } catch (UserInfoExtraException e) {
|
| | | e.printStackTrace();
|
| | | }
|
| | | }
|
| | | }
|
| | | }
|
| | | return invite;
|
| | | }
|
| | | |
| | | }
|
| | |
| | | }
|
| | | return inviter;
|
| | | }
|
| | | |
| | | |
| | |
|
| | | @Override
|
| | | public String activateUser(Long uid, String inviteUid) throws UserInfoExtraException{
|
| | | if (uid == null || inviteUid == null) {
|
| | | throw new UserInfoExtraException(1, "传递id不能为空");
|
| | | }
|
| | | |
| | | // 被邀请人信息
|
| | | UserInfo invitee = userInfoService.selectByPKey(uid);
|
| | | if (invitee == null) {
|
| | | throw new UserInfoExtraException(1, "用户不存在");
|
| | | }
|
| | | |
| | | UserInfoExtra extra = userInfoExtraMapper.getInfoExtraByUid(uid);
|
| | | if (extra != null) {
|
| | | String inviteCodeHas = extra.getInviteCode();
|
| | | if (inviteCodeHas != null && inviteCodeHas.trim().length() > 0) {
|
| | | throw new UserInfoExtraException(1, "已存在邀请码,请刷新页面");
|
| | | }
|
| | | }
|
| | | |
| | | // 邀请人信息
|
| | | UserInfo inviter = userInfoService.getInfoByPhoneOrInviteCode(inviteCode, inviteCode);
|
| | | if (inviter == null) {
|
| | | throw new UserInfoExtraException(1, "上级邀请码不存在");
|
| | | }
|
| | | |
| | | // 绑定关系
|
| | | try {
|
| | | threeSaleSerivce.bindRelationshipByInviteCode(invitee, inviter);
|
| | | } catch (ThreeSaleException e) {
|
| | | try {
|
| | | LogHelper.errorDetailInfo(e);
|
| | | } catch (Exception e1) {
|
| | | e1.printStackTrace();
|
| | | }
|
| | | throw new UserInfoExtraException(1, "激活失败");
|
| | | }
|
| | | |
| | | |
| | | // 邀请码有效、生成邀请码
|
| | | String code = UserUtil.getInviteCode(uid); |
| | | if (code == null || code.trim().length() == 0) {
|
| | | throw new UserInfoExtraException(1, "激活码生成失败");
|
| | | }
|
| | | |
| | | UserInfoExtra userInfoExtra = new UserInfoExtra();
|
| | | userInfoExtra.setUserInfo(invitee);
|
| | | userInfoExtra.setInviteCode(code);
|
| | | |
| | | // 保存额外信息
|
| | | saveUserInfoExtra(userInfoExtra);
|
| | | |
| | | |
| | | Long id = userInfoExtra.getId();
|
| | | if (id == null) {
|
| | | throw new UserInfoExtraException(1, "激活码生成失败");
|
| | | }
|
| | | |
| | | return code;
|
| | | }
|
| | | }
|
| | |
| | | package com.yeshi.fanli.service.impl.user;
|
| | |
|
| | | import java.util.Date;
|
| | |
|
| | | import javax.annotation.Resource;
|
| | |
|
| | | import org.springframework.stereotype.Service;
|
| | |
| | | }
|
| | |
|
| | | @Override
|
| | | public void updateRecord(Long receiveUid, Long giveUid, Long couponId) {
|
| | | UserSystemCouponGiveRecord record = userSystemCouponGiveRecordMapper.getRecordByUidAndCouponId(giveUid, couponId);
|
| | | if (record != null) {
|
| | | UserSystemCouponGiveRecord giveRecord = new UserSystemCouponGiveRecord();
|
| | | giveRecord.setId(record.getId());
|
| | | giveRecord.setReceiveUid(receiveUid);
|
| | | giveRecord.setReceiveTime(new Date());
|
| | | userSystemCouponGiveRecordMapper.updateByPrimaryKeySelective(giveRecord);
|
| | | }
|
| | | public UserSystemCouponGiveRecord getRecordByUidAndCouponId(Long giveUid, Long couponId) {
|
| | | return userSystemCouponGiveRecordMapper.getRecordByUidAndCouponId(giveUid, couponId);
|
| | | }
|
| | | |
| | | @Override
|
| | | public void updateByPrimaryKeySelective(UserSystemCouponGiveRecord giveRecord) {
|
| | | userSystemCouponGiveRecordMapper.updateByPrimaryKeySelective(giveRecord);
|
| | | }
|
| | | }
|
| | |
| | | return tips;
|
| | | }
|
| | |
|
| | | |
| | | @Override
|
| | | public void updateGiveRecord(Long uid, Long id, String couponType) {
|
| | | Date date = new Date();
|
| | | // 更新券状态:已使用
|
| | | UserSystemCoupon userCoupon = new UserSystemCoupon();
|
| | | userCoupon.setId(id);
|
| | | userCoupon.setState(UserSystemCoupon.STATE_END_USE);
|
| | | userCoupon.setUseTime(date);
|
| | | userCoupon.setUpdateTime(date);
|
| | | userSystemCouponMapper.updateByPrimaryKeySelective(userCoupon);
|
| | |
|
| | | // 插入使用券记录
|
| | | UserSystemCouponRecord couponRecord = new UserSystemCouponRecord();
|
| | | couponRecord.setState(UserSystemCouponRecord.STATE_SUCCESS);
|
| | | couponRecord.setUserSystemCoupon(userCoupon);
|
| | | couponRecord.setCouponType(couponType);
|
| | | couponRecord.setCreateTime(date);
|
| | | couponRecord.setUpdateTime(date);
|
| | | userSystemCouponRecordService.insertSelective(couponRecord);
|
| | | |
| | | // TODO 赠送消息
|
| | | }
|
| | | |
| | | |
| | | }
|
| | |
| | |
|
| | | import java.math.BigDecimal;
|
| | |
|
| | | import com.yeshi.fanli.dto.msg.MsgOtherGiveContentDTO;
|
| | | import com.yeshi.fanli.dto.msg.MsgOtherTaoLiJinContentDTO;
|
| | | import com.yeshi.fanli.entity.bus.user.UserInfo;
|
| | | import com.yeshi.fanli.entity.bus.user.UserSystemCoupon;
|
| | |
| | | * @param content
|
| | | */
|
| | | public void taoLiJinMsg(Long uid, String beiZhu, MsgOtherTaoLiJinContentDTO content);
|
| | |
|
| | | |
| | | /**
|
| | | * 口令赠送领取
|
| | | * @param uid
|
| | | * @param beiZhu
|
| | | * @param content
|
| | | */
|
| | | public void tokenGiveMsg(Long uid, String beiZhu, MsgOtherGiveContentDTO content);
|
| | | }
|
| | |
| | | * @throws UserTaoLiJinOriginException
|
| | | */
|
| | | public void exchangeMoney(Long uid, BigDecimal money) throws UserTaoLiJinOriginException;
|
| | |
|
| | | /**
|
| | | * 领取淘礼金-好友赠送
|
| | | * @param uid
|
| | | * @param money
|
| | | * @return
|
| | | * @throws UserTaoLiJinOriginException
|
| | | */
|
| | | public UserTaoLiJinOrigin receiveFriendsGive(Long uid, BigDecimal money) throws UserTaoLiJinOriginException;
|
| | | }
|
| | |
| | | * @param giveUid
|
| | | * @param couponId
|
| | | */
|
| | | public void updateRecord(Long receiveUid, Long giveUid, Long couponId);
|
| | | public void updateByPrimaryKeySelective(UserSystemCouponGiveRecord giveRecord);
|
| | |
|
| | | |
| | | /**
|
| | | * 查询赠送记录
|
| | | * @param giveUid
|
| | | * @param couponId
|
| | | * @return
|
| | | */
|
| | | public UserSystemCouponGiveRecord getRecordByUidAndCouponId(Long giveUid, Long couponId);
|
| | |
|
| | | |
| | |
|
| | |
|
| | | }
|
| | |
| | | */
|
| | | public String giveCoupon(Long uid, Long id) throws UserSystemCouponException;
|
| | |
|
| | | /**
|
| | | * 更新赠送记录
|
| | | * @param uid
|
| | | * @param id
|
| | | * @param couponType
|
| | | */
|
| | | public void updateGiveRecord(Long uid, Long id, String couponType);
|
| | |
|
| | | }
|
| | |
| | |
|
| | | goodsInfo.setGoodsType(goodsType);
|
| | | goodsInfo.setZkPrice(goods.getPrice());
|
| | | goodsInfo.setState(goods.getState());
|
| | | Integer state = goods.getState();
|
| | | if (state == null) {
|
| | | goodsInfo.setState(0);
|
| | | } else {
|
| | | goodsInfo.setState(goods.getState());
|
| | | }
|
| | | goodsInfo.setSalesCount(TaoBaoUtil.getSaleCount(goods.getSales()));
|
| | |
|
| | | if (goodsType == Constant.SOURCE_TYPE_TAOBAO) {
|