admin
2020-03-14 3f608b492ce3c010322009916f462e3a70c7fb61
会员阶段完善,订单商品添加券后价
6个文件已修改
62 ■■■■■ 已修改文件
fanli/src/main/java/com/yeshi/fanli/dao/MongodbBaseDao.java 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/dao/mybatis/user/vip/UserVIPPreInfoMapper.java 7 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/entity/order/CommonOrderGoods.java 12 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/mapping/order/CommonOrderGoodsMapper.xml 26 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/service/impl/user/vip/UserVIPPreInfoServiceImpl.java 11 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/service/inter/user/vip/UserVIPPreInfoService.java 5 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/dao/MongodbBaseDao.java
@@ -6,7 +6,6 @@
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;
fanli/src/main/java/com/yeshi/fanli/dao/mybatis/user/vip/UserVIPPreInfoMapper.java
@@ -2,8 +2,9 @@
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> {
@@ -15,7 +16,7 @@
     * @param procress
     * @return
     */
    UserVIPPreInfo selectByUidAndProcess(Long uid, int procress);
    UserVIPPreInfo selectByUidAndProcess(@Param("uid") Long uid, @Param("process") int process);
    /**
     * 根据用户ID检索
@@ -23,6 +24,6 @@
     * @param uid
     * @return
     */
    List<UserVIPPreInfo> listByUid(Long uid);
    List<UserVIPPreInfo> listByUid(@Param("uid") Long uid);
}
fanli/src/main/java/com/yeshi/fanli/entity/order/CommonOrderGoods.java
@@ -27,7 +27,6 @@
    // 天猫
    public final static String TYPE_TMALL = "TM";
        
    @Column(name = "cog_id")
    private Long id;
@@ -54,6 +53,9 @@
    @Expose
    @Column(name = "cog_price")
    private BigDecimal price;
    @Column(name = "cog_actual_price")
    private BigDecimal actualPrice;
    // 店铺id
    @Expose
@@ -187,4 +189,12 @@
        this.updateTime = updateTime;
    }
    public BigDecimal getActualPrice() {
        return actualPrice;
    }
    public void setActualPrice(BigDecimal actualPrice) {
        this.actualPrice = actualPrice;
    }
}
fanli/src/main/java/com/yeshi/fanli/mapping/order/CommonOrderGoodsMapper.xml
@@ -17,43 +17,38 @@
            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">
@@ -71,6 +66,7 @@
            <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=",">
@@ -86,6 +82,7 @@
            <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
@@ -100,7 +97,8 @@
        #{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
@@ -116,8 +114,8 @@
            <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>
fanli/src/main/java/com/yeshi/fanli/service/impl/user/vip/UserVIPPreInfoServiceImpl.java
@@ -7,24 +7,27 @@
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);
fanli/src/main/java/com/yeshi/fanli/service/inter/user/vip/UserVIPPreInfoService.java
@@ -2,6 +2,7 @@
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用户服务
@@ -17,10 +18,10 @@
     * @param info
     * @throws UserVIPInfoException
     */
    public void addUserVIPPreInfo(UserVIPPreInfo info) throws UserVIPInfoException;
    public void addUserVIPPreInfo(UserVIPPreInfo info) throws UserVIPPreInfoException;
    /**
     * 获取最近的进度
     * 获取最新的进度
     * 
     * @param uid
     * @return