yujian
2019-03-01 352164073f057646568e02ccb2f1eada42890707
图片路径修改+添加券失效图片字段
5个文件已修改
71 ■■■■ 已修改文件
fanli/src/main/java/com/yeshi/fanli/entity/system/SystemCoupon.java 14 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/mapping/SystemCouponMapper.xml 18 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/service/impl/order/CommonOrderServiceImpl.java 8 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/service/impl/user/UserSystemCouponServiceImpl.java 19 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/vo/user/UserSystemCouponVO.java 12 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/entity/system/SystemCoupon.java
@@ -36,9 +36,13 @@
    @Column(name = "sc_name")
    private String name;
    // 图片
    // 图片-有效
    @Column(name = "sc_picture")
    private String picture;
    // 图片-失效
    @Column(name = "sc_picture_invalid")
    private String pictureInvalid;
    
    // 简介作用:任性0元购、再返10%
    @Column(name = "sc_effect")
@@ -202,5 +206,13 @@
    public void setEffect(String effect) {
        this.effect = effect;
    }
    public String getPictureInvalid() {
        return pictureInvalid;
    }
    public void setPictureInvalid(String pictureInvalid) {
        this.pictureInvalid = pictureInvalid;
    }
    
}
fanli/src/main/java/com/yeshi/fanli/mapping/SystemCouponMapper.xml
@@ -6,8 +6,12 @@
    <id column="sc_id" property="id" jdbcType="BIGINT"/>
    <result column="sc_name" property="name" jdbcType="VARCHAR"/>
    <result column="sc_picture" property="picture" jdbcType="VARCHAR"/>
    <result column="sc_picture_invalid" property="pictureInvalid" jdbcType="VARCHAR"/>
    <result column="sc_effect" property="effect" jdbcType="VARCHAR"/>
    <result column="sc_type" property="type" jdbcType="VARCHAR"/>
    <result column="sc_type" property="type"
            typeHandler="com.yeshi.fanli.util.mybatishandler.CouponTypeEnumHandler" />
    <result column="sc_percent" property="percent" jdbcType="DECIMAL"/>
    <result column="sc_amount" property="amount" jdbcType="VARCHAR"/>
    <result column="sc_expiry_day" property="expiryDay" jdbcType="INTEGER"/>
@@ -18,17 +22,18 @@
    <result column="sc_create_time" property="createTime" jdbcType="TIMESTAMP"/>
    <result column="sc_update_time" property="updateTime" jdbcType="TIMESTAMP"/>
  </resultMap>
  <sql id="Base_Column_List">sc_id,sc_name,sc_picture,sc_effect,sc_type,sc_percent,sc_amount,sc_expiry_day,sc_rule,sc_remark,sc_receive_count,sc_state,sc_create_time,sc_update_time</sql>
  <sql id="Base_Column_List">sc_id,sc_name,sc_picture,sc_picture_invalid,sc_effect,sc_type,sc_percent,sc_amount,sc_expiry_day,sc_rule,sc_remark,sc_receive_count,sc_state,sc_create_time,sc_update_time</sql>
  <select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.Long">select
    <include refid="Base_Column_List"/>from yeshi_ec_system_coupon where sc_id = #{id,jdbcType=BIGINT}
  </select>
  <delete id="deleteByPrimaryKey" parameterType="java.lang.Long">delete from yeshi_ec_system_coupon where sc_id = #{id,jdbcType=BIGINT}</delete>
  <insert id="insert" parameterType="com.yeshi.fanli.entity.system.SystemCoupon" useGeneratedKeys="true" keyProperty="id">insert into yeshi_ec_system_coupon (sc_id,sc_name,sc_picture,sc_effect,sc_type,sc_percent,sc_amount,sc_expiry_day,sc_rule,sc_remark,sc_receive_count,sc_state,sc_create_time,sc_update_time) values (#{id,jdbcType=BIGINT},#{name,jdbcType=VARCHAR},#{picture,jdbcType=VARCHAR},#{effect,jdbcType=VARCHAR},#{type,jdbcType=VARCHAR},#{percent,jdbcType=DECIMAL},#{amount,jdbcType=VARCHAR},#{expiryDay,jdbcType=INTEGER},#{rule,jdbcType=VARCHAR},#{remark,jdbcType=VARCHAR},#{receiveCount,jdbcType=INTEGER},#{state,jdbcType=INTEGER},#{createTime,jdbcType=TIMESTAMP},#{updateTime,jdbcType=TIMESTAMP})</insert>
  <insert id="insert" parameterType="com.yeshi.fanli.entity.system.SystemCoupon" useGeneratedKeys="true" keyProperty="id">insert into yeshi_ec_system_coupon (sc_id,sc_name,sc_picture,sc_picture_invalid,sc_effect,sc_type,sc_percent,sc_amount,sc_expiry_day,sc_rule,sc_remark,sc_receive_count,sc_state,sc_create_time,sc_update_time) values (#{id,jdbcType=BIGINT},#{name,jdbcType=VARCHAR},#{picture,jdbcType=VARCHAR},#{pictureInvalid,jdbcType=VARCHAR},#{effect,jdbcType=VARCHAR},#{type,jdbcType=VARCHAR},#{percent,jdbcType=DECIMAL},#{amount,jdbcType=VARCHAR},#{expiryDay,jdbcType=INTEGER},#{rule,jdbcType=VARCHAR},#{remark,jdbcType=VARCHAR},#{receiveCount,jdbcType=INTEGER},#{state,jdbcType=INTEGER},#{createTime,jdbcType=TIMESTAMP},#{updateTime,jdbcType=TIMESTAMP})</insert>
  <insert id="insertSelective" parameterType="com.yeshi.fanli.entity.system.SystemCoupon" useGeneratedKeys="true" keyProperty="id">insert into yeshi_ec_system_coupon
    <trim prefix="(" suffix=")" suffixOverrides=",">
      <if test="id != null">sc_id,</if>
      <if test="name != null">sc_name,</if>
      <if test="picture != null">sc_picture,</if>
      <if test="pictureInvalid != null">sc_picture_invalid,</if>
      <if test="effect != null">sc_effect,</if>
      <if test="type != null">sc_type,</if>
      <if test="percent != null">sc_percent,</if>
@@ -45,6 +50,7 @@
      <if test="id != null">#{id,jdbcType=BIGINT},</if>
      <if test="name != null">#{name,jdbcType=VARCHAR},</if>
      <if test="picture != null">#{picture,jdbcType=VARCHAR},</if>
      <if test="pictureInvalid != null">#{pictureInvalid,jdbcType=VARCHAR},</if>
      <if test="effect != null">#{effect,jdbcType=VARCHAR},</if>
      <if test="type != null">#{type,jdbcType=VARCHAR},</if>
      <if test="percent != null">#{percent,jdbcType=DECIMAL},</if>
@@ -58,11 +64,12 @@
      <if test="updateTime != null">#{updateTime,jdbcType=TIMESTAMP},</if>
    </trim>
  </insert>
  <update id="updateByPrimaryKey" parameterType="com.yeshi.fanli.entity.system.SystemCoupon">update yeshi_ec_system_coupon set sc_name = #{name,jdbcType=VARCHAR},sc_picture = #{picture,jdbcType=VARCHAR},sc_effect = #{effect,jdbcType=VARCHAR},sc_type = #{type,jdbcType=VARCHAR},sc_percent = #{percent,jdbcType=DECIMAL},sc_amount = #{amount,jdbcType=VARCHAR},sc_expiry_day = #{expiryDay,jdbcType=INTEGER},sc_rule = #{rule,jdbcType=VARCHAR},sc_remark = #{remark,jdbcType=VARCHAR},sc_receive_count = #{receiveCount,jdbcType=INTEGER},sc_state = #{state,jdbcType=INTEGER},sc_create_time = #{createTime,jdbcType=TIMESTAMP},sc_update_time = #{updateTime,jdbcType=TIMESTAMP} where sc_id = #{id,jdbcType=BIGINT}</update>
  <update id="updateByPrimaryKey" parameterType="com.yeshi.fanli.entity.system.SystemCoupon">update yeshi_ec_system_coupon set sc_name = #{name,jdbcType=VARCHAR},sc_picture = #{picture,jdbcType=VARCHAR},sc_picture_invalid = #{pictureInvalid,jdbcType=VARCHAR},sc_effect = #{effect,jdbcType=VARCHAR},sc_type = #{type,jdbcType=VARCHAR},sc_percent = #{percent,jdbcType=DECIMAL},sc_amount = #{amount,jdbcType=VARCHAR},sc_expiry_day = #{expiryDay,jdbcType=INTEGER},sc_rule = #{rule,jdbcType=VARCHAR},sc_remark = #{remark,jdbcType=VARCHAR},sc_receive_count = #{receiveCount,jdbcType=INTEGER},sc_state = #{state,jdbcType=INTEGER},sc_create_time = #{createTime,jdbcType=TIMESTAMP},sc_update_time = #{updateTime,jdbcType=TIMESTAMP} where sc_id = #{id,jdbcType=BIGINT}</update>
  <update id="updateByPrimaryKeySelective" parameterType="com.yeshi.fanli.entity.system.SystemCoupon">update yeshi_ec_system_coupon
    <set>
      <if test="name != null">sc_name=#{name,jdbcType=VARCHAR},</if>
      <if test="picture != null">sc_picture=#{picture,jdbcType=VARCHAR},</if>
      <if test="pictureInvalid != null">sc_picture_invalid=#{pictureInvalid,jdbcType=VARCHAR},</if>
      <if test="effect != null">sc_effect=#{effect,jdbcType=VARCHAR},</if>
      <if test="type != null">sc_type=#{type,jdbcType=VARCHAR},</if>
      <if test="percent != null">sc_percent=#{percent,jdbcType=DECIMAL},</if>
@@ -77,7 +84,7 @@
    </set> where sc_id = #{id,jdbcType=BIGINT}
  </update>
  
  <delete id="deleteBatchByPrimaryKey"  parameterType="java.util.List">
   <delete id="deleteBatchByPrimaryKey"  parameterType="java.util.List">
    delete FROM yeshi_ec_system_coupon WHERE sc_id in
    <foreach collection="list" item="item" open="(" close=")"
        separator=",">#{item}</foreach>
@@ -96,6 +103,5 @@
    WHERE sc_type = #{type}
    limit 1
  </select>
  
</mapper>
fanli/src/main/java/com/yeshi/fanli/service/impl/order/CommonOrderServiceImpl.java
@@ -76,12 +76,12 @@
    
    
    // 奖励订单图片
    public final static String PIC_REWARD= "http://192.168.1.200/icon/jl.png";
    public final static String PIC_REWARD= "http://img.flqapp.com/resource/order/order_state_reward.png";
    
    // 免单状态图片
    public final static String PIC_FREE_ON = "http://192.168.1.200/icon/state1.png";
    public final static String PIC_FREE_FAIL =  "http://192.168.1.200/icon/state2.png";
    public final static String PIC_FREE_SUCCEED =  "http://192.168.1.200/icon/state3.png";
    public final static String PIC_FREE_ON = "http://img.flqapp.com/resource/order/order_state_freeing.png";
    public final static String PIC_FREE_FAIL =  "http://img.flqapp.com/resource/order/order_state_free_fail.png";
    public final static String PIC_FREE_SUCCEED =  "http://img.flqapp.com/resource/order/order_state_free_suc.png";
    @Override
fanli/src/main/java/com/yeshi/fanli/service/impl/user/UserSystemCouponServiceImpl.java
@@ -118,9 +118,6 @@
    private UserOtherMsgNotificationService userOtherMsgNotificationService;
    
    // 券失效图片
    public final static String PIC_INVALID = "http://192.168.1.200/icon/mian_invalid.png";
    @Override
    public int insertSelective(UserSystemCoupon record) {
        return userSystemCouponMapper.insertSelective(record);
@@ -283,10 +280,14 @@
            userCouponVO.setCouponPicture(systemCoupon.getPicture());
            userCouponVO.setCouponEffect(systemCoupon.getEffect());
            userCouponVO.setCouponRule(systemCoupon.getRule());
            userCouponVO.setCouponPictureInvalid(systemCoupon.getPictureInvalid());
            // 使用状态
            Integer state = userCouponVO.getState();
            // 券类型
            CouponTypeEnum type = systemCoupon.getType();
            // 按钮跳转
            Map<String, Object> jumpBtn = null;
            
@@ -327,7 +328,6 @@
                if (UserSystemCoupon.STATE_CAN_USE == state) {
                    Map<String, Object> jumpLink = new HashMap<String, Object>();
                    CouponTypeEnum type = systemCoupon.getType();
                    if (CouponTypeEnum.freeCoupon == type || CouponTypeEnum.welfareFreeCoupon == type) {
                        // 免单券、 福利免单券
                        
@@ -356,8 +356,8 @@
            
            // 券失效图片替换
            if (UserSystemCoupon.STATE_END_USE == state || UserSystemCoupon.STATE_OVERDUE == state) {
                userCouponVO.setCouponPicture(PIC_INVALID);
            }
                userCouponVO.setCouponPicture(systemCoupon.getPictureInvalid());
            }
            
            userCouponVO.setJumpBtn(jumpBtn);
@@ -423,6 +423,7 @@
            userCouponVO.setCouponName(systemCoupon.getName());
            userCouponVO.setCouponEffect(systemCoupon.getEffect());
            userCouponVO.setCouponRule(systemCoupon.getRule());
            userCouponVO.setCouponPictureInvalid(systemCoupon.getPictureInvalid());
            int differentDays = 0;
@@ -451,7 +452,7 @@
            if (stateActivated == null || stateActivated == 0) {
                userCouponVO.setState(0);
                userCouponVO.setCouponEffect("待激活");
                userCouponVO.setCouponPicture(PIC_INVALID); // 未激活图片
                userCouponVO.setCouponPicture(systemCoupon.getPictureInvalid());
                
                remainDaysFontColor = "#CCCCCC";
                
@@ -549,7 +550,7 @@
                    for (UserSystemCouponVO userCouponVO: list) {
                        // 显示不能使用
                        userCouponVO.setState(0);
                        userCouponVO.setCouponPicture(PIC_INVALID);
                        userCouponVO.setCouponPicture(userCouponVO.getCouponPictureInvalid());
                        
                        Map<String, Object> map = userCouponVO.getRemainDays();
                        if (map != null) {
fanli/src/main/java/com/yeshi/fanli/vo/user/UserSystemCouponVO.java
@@ -20,6 +20,10 @@
    // 券图片
    @Expose
     private String couponPicture;
    // 券图片- 失效
     private String couponPictureInvalid;
    // 券作用
    @Expose
     private String couponEffect;
@@ -113,4 +117,12 @@
        this.inUseExplain = inUseExplain;
    }
    public String getCouponPictureInvalid() {
        return couponPictureInvalid;
    }
    public void setCouponPictureInvalid(String couponPictureInvalid) {
        this.couponPictureInvalid = couponPictureInvalid;
    }
}