| | |
| | | import javax.annotation.Resource;
|
| | |
|
| | | import org.springframework.data.mongodb.core.MongoTemplate;
|
| | | import org.springframework.data.mongodb.core.mapping.Document;
|
| | | 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 java.util.List;
|
| | |
|
| | | import org.apache.ibatis.annotations.Param;
|
| | |
|
| | | import com.yeshi.fanli.dao.BaseMapper;
|
| | | import com.yeshi.fanli.entity.bus.user.vip.UserVIPInfo;
|
| | | import com.yeshi.fanli.entity.bus.user.vip.UserVIPPreInfo;
|
| | |
|
| | | public interface UserVIPPreInfoMapper extends BaseMapper<UserVIPPreInfo> {
|
| | |
| | | * @param procress
|
| | | * @return
|
| | | */
|
| | | UserVIPPreInfo selectByUidAndProcess(Long uid, int procress);
|
| | | UserVIPPreInfo selectByUidAndProcess(@Param("uid") Long uid, @Param("process") int process);
|
| | |
|
| | | /**
|
| | | * 根据用户ID检索
|
| | |
| | | * @param uid
|
| | | * @return
|
| | | */
|
| | | List<UserVIPPreInfo> listByUid(Long uid);
|
| | | List<UserVIPPreInfo> listByUid(@Param("uid") Long uid);
|
| | |
|
| | | } |
| | |
| | | // 天猫
|
| | | public final static String TYPE_TMALL = "TM";
|
| | |
|
| | |
|
| | | @Column(name = "cog_id")
|
| | | private Long id;
|
| | |
|
| | |
| | | @Expose
|
| | | @Column(name = "cog_price")
|
| | | private BigDecimal price;
|
| | |
|
| | | @Column(name = "cog_actual_price")
|
| | | private BigDecimal actualPrice;
|
| | |
|
| | | // 店铺id
|
| | | @Expose
|
| | |
| | | this.updateTime = updateTime;
|
| | | }
|
| | |
|
| | | public BigDecimal getActualPrice() {
|
| | | return actualPrice;
|
| | | }
|
| | |
|
| | | public void setActualPrice(BigDecimal actualPrice) {
|
| | | this.actualPrice = actualPrice;
|
| | | }
|
| | |
|
| | | }
|
| | |
| | | jdbcType="TIMESTAMP" />
|
| | | <result column="cog_update_time" property="updateTime"
|
| | | jdbcType="TIMESTAMP" />
|
| | | <result column="cog_actual_price" property="actualPrice" |
| | | jdbcType="DECIMAL" /> |
| | | </resultMap>
|
| | |
|
| | | <sql id="Base_Column_List">cog_id,cog_goods_id,cog_goods_type,cog_title,cog_picture,cog_price,cog_shop_id,cog_shop_name,cog_shop_type,cog_state,cog_create_time,cog_update_time
|
| | | <sql id="Base_Column_List">cog_id,cog_goods_id,cog_goods_type,cog_title,cog_picture,cog_price,cog_shop_id,cog_shop_name,cog_shop_type,cog_state,cog_create_time,cog_update_time,cog_actual_price |
| | | </sql>
|
| | |
|
| | | <select id="selectByPrimaryKey" resultMap="BaseResultMap"
|
| | | parameterType="java.lang.Long">
|
| | | select
|
| | | <include refid="Base_Column_List" />
|
| | | from yeshi_ec_common_order_goods where cog_id = #{id,jdbcType=BIGINT}
|
| | | </select>
|
| | |
|
| | |
|
| | | <select id="listByGoodsIdAndGoodsType" resultMap="BaseResultMap">
|
| | | select
|
| | | <include refid="Base_Column_List" />
|
| | | from yeshi_ec_common_order_goods where cog_goods_id = #{goodsId} and
|
| | | cog_goods_type=#{goodsType}
|
| | | </select>
|
| | |
|
| | |
|
| | |
|
| | | <select id="listNoTitle" resultMap="BaseResultMap">
|
| | | select
|
| | | <include refid="Base_Column_List" />
|
| | | from yeshi_ec_common_order_goods where cog_title is null limit #{start},#{count}
|
| | | from yeshi_ec_common_order_goods where cog_title is null limit |
| | | #{start},#{count} |
| | | </select>
|
| | |
|
| | | <delete id="deleteByPrimaryKey" parameterType="java.lang.Long">delete from
|
| | | yeshi_ec_common_order_goods where cog_id = #{id,jdbcType=BIGINT}
|
| | | </delete>
|
| | | <insert id="insert" parameterType="com.yeshi.fanli.entity.order.CommonOrderGoods"
|
| | | useGeneratedKeys="true" keyProperty="id">insert into
|
| | | yeshi_ec_common_order_goods
|
| | | (cog_id,cog_goods_id,cog_goods_type,cog_title,cog_picture,cog_price,cog_shop_id,cog_shop_name,cog_shop_type,cog_state,cog_create_time,cog_update_time)
|
| | | (cog_id,cog_goods_id,cog_goods_type,cog_title,cog_picture,cog_price,cog_shop_id,cog_shop_name,cog_shop_type,cog_state,cog_create_time,cog_update_time,cog_actual_price) |
| | | values
|
| | | (#{id,jdbcType=BIGINT},#{goodsId,jdbcType=VARCHAR},#{goodsType,jdbcType=INTEGER},#{title,jdbcType=VARCHAR},#{picture,jdbcType=VARCHAR},#{price,jdbcType=DECIMAL},#{shopId,jdbcType=BIGINT},#{shopName,jdbcType=VARCHAR},#{shopType,jdbcType=VARCHAR},#{state,jdbcType=INTEGER},#{createTime,jdbcType=TIMESTAMP},#{updateTime,jdbcType=TIMESTAMP})
|
| | | (#{id,jdbcType=BIGINT},#{goodsId,jdbcType=VARCHAR},#{goodsType,jdbcType=INTEGER},#{title,jdbcType=VARCHAR},#{picture,jdbcType=VARCHAR},#{price,jdbcType=DECIMAL},#{shopId,jdbcType=BIGINT},#{shopName,jdbcType=VARCHAR},#{shopType,jdbcType=VARCHAR},#{state,jdbcType=INTEGER},#{createTime,jdbcType=TIMESTAMP},#{updateTime,jdbcType=TIMESTAMP},#{actualPrice,jdbcType=DECIMAL}) |
| | | </insert>
|
| | | <insert id="insertSelective" parameterType="com.yeshi.fanli.entity.order.CommonOrderGoods"
|
| | | useGeneratedKeys="true" keyProperty="id">
|
| | |
| | | <if test="state != null">cog_state,</if>
|
| | | <if test="createTime != null">cog_create_time,</if>
|
| | | <if test="updateTime != null">cog_update_time,</if>
|
| | | <if test="actualPrice != null">cog_actual_price</if> |
| | | </trim>
|
| | | values
|
| | | <trim prefix="(" suffix=")" suffixOverrides=",">
|
| | |
| | | <if test="state != null">#{state,jdbcType=INTEGER},</if>
|
| | | <if test="createTime != null">#{createTime,jdbcType=TIMESTAMP},</if>
|
| | | <if test="updateTime != null">#{updateTime,jdbcType=TIMESTAMP},</if>
|
| | | <if test="actualPrice != null">#{actualPrice,jdbcType=DECIMAL}</if> |
| | | </trim>
|
| | | </insert>
|
| | | <update id="updateByPrimaryKey" parameterType="com.yeshi.fanli.entity.order.CommonOrderGoods">update
|
| | |
| | | #{shopType,jdbcType=VARCHAR},cog_state =
|
| | | #{state,jdbcType=INTEGER},cog_create_time =
|
| | | #{createTime,jdbcType=TIMESTAMP},cog_update_time =
|
| | | #{updateTime,jdbcType=TIMESTAMP} where cog_id = #{id,jdbcType=BIGINT}
|
| | | #{updateTime,jdbcType=TIMESTAMP} ,cog_actual_price |
| | | =#{actualPrice,jdbcType=DECIMAL} where cog_id = #{id,jdbcType=BIGINT} |
| | | </update>
|
| | | <update id="updateByPrimaryKeySelective" parameterType="com.yeshi.fanli.entity.order.CommonOrderGoods">
|
| | | update yeshi_ec_common_order_goods
|
| | |
| | | <if test="state != null">cog_state=#{state,jdbcType=INTEGER},</if>
|
| | | <if test="createTime != null">cog_create_time=#{createTime,jdbcType=TIMESTAMP},</if>
|
| | | <if test="updateTime != null">cog_update_time=#{updateTime,jdbcType=TIMESTAMP},</if>
|
| | | <if test="actualPrice !=null">cog_actual_price =#{actualPrice,jdbcType=DECIMAL}</if> |
| | | </set>
|
| | | where cog_id = #{id,jdbcType=BIGINT}
|
| | | </update>
|
| | |
|
| | | </mapper>
|
| | |
| | |
|
| | | import javax.annotation.Resource;
|
| | |
|
| | | import org.springframework.stereotype.Service;
|
| | |
|
| | | import com.yeshi.fanli.dao.mybatis.user.vip.UserVIPPreInfoMapper;
|
| | | import com.yeshi.fanli.entity.bus.user.vip.UserVIPPreInfo;
|
| | | import com.yeshi.fanli.exception.user.vip.UserVIPInfoException;
|
| | | import com.yeshi.fanli.exception.user.vip.UserVIPPreInfoException;
|
| | | import com.yeshi.fanli.service.inter.user.vip.UserVIPPreInfoService;
|
| | |
|
| | | @Service
|
| | | public class UserVIPPreInfoServiceImpl implements UserVIPPreInfoService {
|
| | |
|
| | | @Resource
|
| | | private UserVIPPreInfoMapper userVIPPreInfoMapper;
|
| | |
|
| | | @Override
|
| | | public void addUserVIPPreInfo(UserVIPPreInfo info) throws UserVIPInfoException {
|
| | | public void addUserVIPPreInfo(UserVIPPreInfo info) throws UserVIPPreInfoException {
|
| | | if (info == null || info.getUid() == null || info.getProcess() == null)
|
| | | throw new UserVIPInfoException(1, "信息不完整");
|
| | | throw new UserVIPPreInfoException(1, "信息不完整");
|
| | |
|
| | | UserVIPPreInfo oldInfo = userVIPPreInfoMapper.selectByUidAndProcess(info.getUid(), info.getProcess());
|
| | | if (oldInfo != null)
|
| | | throw new UserVIPInfoException(2, "进度已存在");
|
| | | throw new UserVIPPreInfoException(2, "进度已存在");
|
| | | if (info.getCreateTime() == null)
|
| | | info.setCreateTime(new Date());
|
| | | userVIPPreInfoMapper.insertSelective(info);
|
| | |
| | |
|
| | | import com.yeshi.fanli.entity.bus.user.vip.UserVIPPreInfo;
|
| | | import com.yeshi.fanli.exception.user.vip.UserVIPInfoException;
|
| | | import com.yeshi.fanli.exception.user.vip.UserVIPPreInfoException;
|
| | |
|
| | | /**
|
| | | * 阶段VIP用户服务
|
| | |
| | | * @param info
|
| | | * @throws UserVIPInfoException
|
| | | */
|
| | | public void addUserVIPPreInfo(UserVIPPreInfo info) throws UserVIPInfoException;
|
| | | public void addUserVIPPreInfo(UserVIPPreInfo info) throws UserVIPPreInfoException;
|
| | |
|
| | | /**
|
| | | * 获取最近的进度
|
| | | * 获取最新的进度
|
| | | *
|
| | | * @param uid
|
| | | * @return
|