| | |
| | | package com.ks.lijin.service; |
| | | |
| | | |
| | | import com.ks.lijin.exception.LiJinExpendRecordException; |
| | | import com.ks.lijin.pojo.DO.LiJinExpendRecord; |
| | | |
| | | import java.math.BigDecimal; |
| | |
| | | @Valid |
| | | public class VipCombo implements Serializable { |
| | | |
| | | //启用状态 |
| | | public final static int STATE_VALID = 1; |
| | | //停用状态 |
| | | public final static int STATE_INVALID = 0; |
| | | |
| | | |
| | | @Column(name = "cb_id") |
| | | private Long id; |
| | | |
| | |
| | | import com.ks.vip.pojo.DO.VipGradePotence; |
| | | import com.ks.vip.pojo.Enums.VIPEnum; |
| | | |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | |
| | | public interface VipCenterService { |
| | |
| | | |
| | | /** |
| | | * 添加会员权益 |
| | | * |
| | | * @param uid |
| | | * @param gradeId |
| | | * @param validDays |
| | |
| | | |
| | | /** |
| | | * 获取当前用户会员权益 |
| | | * |
| | | * @param uid |
| | | * @return |
| | | */ |
| | |
| | | |
| | | /** |
| | | * 获取当前用户会员等级信息 |
| | | * |
| | | * @param uid |
| | | * @return |
| | | */ |
| | |
| | | |
| | | /** |
| | | * 获取当前用户会员等级枚举 |
| | | * |
| | | * @param uid |
| | | * @return |
| | | */ |
| | | public VIPEnum getVIPEnumByUid(String uid); |
| | | |
| | | |
| | | /** |
| | | * 获取用户在某个时间点的等级 |
| | | * |
| | | * @param uid |
| | | * @param date |
| | | * @return |
| | | */ |
| | | public VIPEnum getVIPEnumByUid(String uid, Date date); |
| | | |
| | | |
| | | } |
| | |
| | | |
| | | |
| | | import com.ks.vip.pojo.DO.VipCombo; |
| | | import com.ks.vip.pojo.Enums.VIPEnum; |
| | | |
| | | import java.util.List; |
| | | |
| | |
| | | |
| | | public List<VipCombo> listByPage(int page, int pageSize, VipCombo t); |
| | | |
| | | |
| | | /** |
| | | * 获取有效的套餐列表 |
| | | * |
| | | * @param vipGrade |
| | | * @return |
| | | */ |
| | | public List<VipCombo> listValid(VIPEnum vipGrade); |
| | | |
| | | |
| | | public void insertSelective(VipCombo t); |
| | | |
| | | public void updateByPrimaryKeySelective(VipCombo t); |
New file |
| | |
| | | package com.ks.lijin.service.remote; |
| | | |
| | | import com.ks.lijin.pojo.DO.LiJinProviderLink; |
| | | import com.ks.lijin.service.LiJinLinkService; |
| | | import org.apache.dubbo.config.annotation.Service; |
| | | |
| | | import java.util.ArrayList; |
| | | import java.util.List; |
| | | |
| | | @Service(version = "1.0") |
| | | public class LiJinLinkServiceImpl implements LiJinLinkService { |
| | | @Override |
| | | public List<LiJinProviderLink> getValidLijinLink(Long auctionId, int page, int pageSize) { |
| | | return new ArrayList<>(); |
| | | } |
| | | } |
| | |
| | | package com.ks.vip.mapper; |
| | | |
| | | import com.ks.lib.common.dao.BaseMapper; |
| | | import com.ks.lijin.query.BaseDaoQuery; |
| | | import com.ks.vip.pojo.DO.VipCenterRecord; |
| | | import org.apache.ibatis.annotations.Param; |
| | | |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | |
| | | public interface VipCenterRecordMapper extends BaseMapper<VipCenterRecord> { |
| | | |
| | | |
| | | public List<VipCenterRecord> list(@Param("query") DaoQuery daoQuery); |
| | | |
| | | public class DaoQuery extends BaseDaoQuery { |
| | | public String uid; |
| | | public Date date; |
| | | } |
| | | |
| | | } |
| | |
| | | // 名称 |
| | | public String name; |
| | | |
| | | //等级ID |
| | | public Long gradeId; |
| | | |
| | | } |
| | |
| | | |
| | | |
| | | import com.ks.vip.mapper.VipCenterMapper; |
| | | import com.ks.vip.mapper.VipCenterRecordMapper; |
| | | import com.ks.vip.mapper.VipComboMapper; |
| | | import com.ks.vip.pojo.DO.*; |
| | | import com.ks.vip.pojo.Enums.VIPEnum; |
| | |
| | | |
| | | @Resource |
| | | private VipGradePotenceService vipGradePotenceService; |
| | | |
| | | @Resource |
| | | private VipCenterRecordMapper vipCenterRecordMapper; |
| | | |
| | | |
| | | @Override |
| | |
| | | return null; |
| | | } |
| | | } |
| | | |
| | | @Override |
| | | public VIPEnum getVIPEnumByUid(String uid, Date date) { |
| | | VipCenterRecordMapper.DaoQuery daoQuery = new VipCenterRecordMapper.DaoQuery(); |
| | | daoQuery.uid = uid; |
| | | daoQuery.date = date; |
| | | daoQuery.start = 0; |
| | | daoQuery.count = 1; |
| | | List<VipCenterRecord> list = vipCenterRecordMapper.list(daoQuery); |
| | | if (list == null || list.size() == 0) { |
| | | return vipGradeService.getDefaultGrade().getIdentity(); |
| | | } |
| | | return vipGradeService.selectByPrimaryKey(list.get(0).getGradeId()).getIdentity(); |
| | | } |
| | | } |
| | |
| | | |
| | | import com.ks.vip.mapper.VipComboMapper; |
| | | import com.ks.vip.pojo.DO.VipCombo; |
| | | import com.ks.vip.pojo.DO.VipGrade; |
| | | import com.ks.vip.pojo.Enums.VIPEnum; |
| | | import com.ks.vip.query.VipComboQuery; |
| | | import com.ks.vip.service.VipComboService; |
| | | import com.ks.vip.service.VipGradeService; |
| | | import org.apache.dubbo.config.annotation.Service; |
| | | |
| | | import javax.annotation.Resource; |
| | |
| | | |
| | | @Resource |
| | | private VipComboMapper vipComboMapper; |
| | | @Resource |
| | | private VipGradeService vipGradeService; |
| | | |
| | | |
| | | @Override |
| | |
| | | } |
| | | |
| | | |
| | | |
| | | @Override |
| | | public long count(VipCombo t) { |
| | | VipComboQuery query = new VipComboQuery(); |
| | |
| | | return vipComboMapper.listByPage(query); |
| | | } |
| | | |
| | | @Override |
| | | public List<VipCombo> listValid(VIPEnum vipGrade) { |
| | | VipGrade vipGrade1 = vipGradeService.getByVipEnum(vipGrade); |
| | | if (vipGrade1 == null) { |
| | | return null; |
| | | } |
| | | VipComboQuery query = new VipComboQuery(); |
| | | query.gradeId = vipGrade1.getId(); |
| | | query.state = VipCombo.STATE_VALID; |
| | | query.start = 0; |
| | | query.count = 10; |
| | | |
| | | |
| | | |
| | | return vipComboMapper.listByPage(query); |
| | | } |
| | | |
| | | |
| | | } |
| | |
| | | package com.ks.vip.service.remote; |
| | | |
| | | |
| | | import com.ks.vip.mapper.VipComboMapper; |
| | | import com.ks.vip.mapper.VipGradeMapper; |
| | | import com.ks.vip.pojo.DO.VipCombo; |
| | | import com.ks.vip.pojo.DO.VipGrade; |
| | | import com.ks.vip.pojo.Enums.VIPEnum; |
| | | import com.ks.vip.query.VipComboQuery; |
| | | import com.ks.vip.query.VipGradeQuery; |
| | | import com.ks.vip.service.VipComboService; |
| | | import com.ks.vip.service.VipGradeService; |
| | | import org.apache.dubbo.config.annotation.Service; |
| | | |
| | |
| | | <select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.Long">select |
| | | <include refid="Base_Column_List"/>from vip_center_record where r_id = #{id,jdbcType=BIGINT} |
| | | </select> |
| | | <delete id="deleteByPrimaryKey" parameterType="java.lang.Long">delete from vip_center_record where r_id = #{id,jdbcType=BIGINT}</delete> |
| | | <insert id="insert" parameterType="com.ks.vip.pojo.DO.VipCenterRecord" useGeneratedKeys="true" keyProperty="id">insert into vip_center_record (r_id,r_uid,r_order_id,r_grade_id,r_start_time,r_end_time,r_state,r_creator_id,r_create_time,r_updator_id,r_update_time) values (#{id,jdbcType=BIGINT},#{uid,jdbcType=VARCHAR},#{orderId,jdbcType=BIGINT},#{gradeId,jdbcType=BIGINT},#{startTime,jdbcType=TIMESTAMP},#{endTime,jdbcType=TIMESTAMP},#{state,jdbcType=INTEGER},#{creatorId,jdbcType=BIGINT},#{createTime,jdbcType=TIMESTAMP},#{updatorId,jdbcType=BIGINT},#{updateTime,jdbcType=TIMESTAMP})</insert> |
| | | <insert id="insertSelective" parameterType="com.ks.vip.pojo.DO.VipCenterRecord" useGeneratedKeys="true" keyProperty="id">insert into vip_center_record |
| | | |
| | | |
| | | <select id="list" resultMap="BaseResultMap"> |
| | | select |
| | | <include refid="Base_Column_List"/>from vip_center_record where 1=1 |
| | | |
| | | <if test="query.uid!=null"> |
| | | AND r_uid= #{query.uid} |
| | | </if> |
| | | |
| | | <if test="query.date!=null"> |
| | | AND #{query.date}>=r_start_time AND r_end_time>#{query.date}; |
| | | </if> |
| | | </select> |
| | | |
| | | |
| | | <delete id="deleteByPrimaryKey" |
| | | parameterType="java.lang.Long">delete from vip_center_record where r_id = #{id,jdbcType=BIGINT}</delete> |
| | | <insert id="insert" parameterType="com.ks.vip.pojo.DO.VipCenterRecord" useGeneratedKeys="true" |
| | | keyProperty="id">insert into vip_center_record (r_id,r_uid,r_order_id,r_grade_id,r_start_time,r_end_time,r_state,r_creator_id,r_create_time,r_updator_id,r_update_time) values (#{id,jdbcType=BIGINT},#{uid,jdbcType=VARCHAR},#{orderId,jdbcType=BIGINT},#{gradeId,jdbcType=BIGINT},#{startTime,jdbcType=TIMESTAMP},#{endTime,jdbcType=TIMESTAMP},#{state,jdbcType=INTEGER},#{creatorId,jdbcType=BIGINT},#{createTime,jdbcType=TIMESTAMP},#{updatorId,jdbcType=BIGINT},#{updateTime,jdbcType=TIMESTAMP})</insert> |
| | | <insert id="insertSelective" parameterType="com.ks.vip.pojo.DO.VipCenterRecord" useGeneratedKeys="true" |
| | | keyProperty="id">insert into vip_center_record |
| | | <trim prefix="(" suffix=")" suffixOverrides=","> |
| | | <if test="id != null">r_id,</if> |
| | | <if test="uid != null">r_uid,</if> |
| | |
| | | <if test="createTime != null">r_create_time,</if> |
| | | <if test="updatorId != null">r_updator_id,</if> |
| | | <if test="updateTime != null">r_update_time,</if> |
| | | </trim>values |
| | | </trim> |
| | | values |
| | | <trim prefix="(" suffix=")" suffixOverrides=","> |
| | | <if test="id != null">#{id,jdbcType=BIGINT},</if> |
| | | <if test="uid != null">#{uid,jdbcType=VARCHAR},</if> |
| | |
| | | <if test="updateTime != null">#{updateTime,jdbcType=TIMESTAMP},</if> |
| | | </trim> |
| | | </insert> |
| | | <update id="updateByPrimaryKey" parameterType="com.ks.vip.pojo.DO.VipCenterRecord">update vip_center_record set r_uid = #{uid,jdbcType=VARCHAR},r_order_id = #{orderId,jdbcType=BIGINT},r_grade_id = #{gradeId,jdbcType=BIGINT},r_start_time = #{startTime,jdbcType=TIMESTAMP},r_end_time = #{endTime,jdbcType=TIMESTAMP},r_state = #{state,jdbcType=INTEGER},r_creator_id = #{creatorId,jdbcType=BIGINT},r_create_time = #{createTime,jdbcType=TIMESTAMP},r_updator_id = #{updatorId,jdbcType=BIGINT},r_update_time = #{updateTime,jdbcType=TIMESTAMP} where r_id = #{id,jdbcType=BIGINT}</update> |
| | | <update id="updateByPrimaryKey" |
| | | parameterType="com.ks.vip.pojo.DO.VipCenterRecord">update vip_center_record set r_uid = #{uid,jdbcType=VARCHAR},r_order_id = #{orderId,jdbcType=BIGINT},r_grade_id = #{gradeId,jdbcType=BIGINT},r_start_time = #{startTime,jdbcType=TIMESTAMP},r_end_time = #{endTime,jdbcType=TIMESTAMP},r_state = #{state,jdbcType=INTEGER},r_creator_id = #{creatorId,jdbcType=BIGINT},r_create_time = #{createTime,jdbcType=TIMESTAMP},r_updator_id = #{updatorId,jdbcType=BIGINT},r_update_time = #{updateTime,jdbcType=TIMESTAMP} where r_id = #{id,jdbcType=BIGINT}</update> |
| | | <update id="updateByPrimaryKeySelective" parameterType="com.ks.vip.pojo.DO.VipCenterRecord">update vip_center_record |
| | | <set> |
| | | <if test="uid != null">r_uid=#{uid,jdbcType=VARCHAR},</if> |
| | |
| | | <if test="createTime != null">r_create_time=#{createTime,jdbcType=TIMESTAMP},</if> |
| | | <if test="updatorId != null">r_updator_id=#{updatorId,jdbcType=BIGINT},</if> |
| | | <if test="updateTime != null">r_update_time=#{updateTime,jdbcType=TIMESTAMP},</if> |
| | | </set> where r_id = #{id,jdbcType=BIGINT} |
| | | </set> |
| | | where r_id = #{id,jdbcType=BIGINT} |
| | | </update> |
| | | </mapper> |
| | |
| | | <if test="query.id!=null">and cb_id=#{query.id}</if> |
| | | <if test="query.name!=null">and cb_name=#{query.name}</if> |
| | | <if test="query.state!=null">and cb_state=#{query.state}</if> |
| | | <if test="query.gradeId!=null">and cb_grade_id=#{query.gradeId}</if> |
| | | </sql> |
| | | |
| | | |