| | |
| | | @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")
|
| | |
| | | public void setEffect(String effect) {
|
| | | this.effect = effect;
|
| | | }
|
| | |
|
| | | public String getPictureInvalid() {
|
| | | return pictureInvalid;
|
| | | }
|
| | |
|
| | | public void setPictureInvalid(String pictureInvalid) {
|
| | | this.pictureInvalid = pictureInvalid;
|
| | | }
|
| | |
|
| | | }
|
| | |
| | | <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"/> |
| | |
| | | <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> |
| | |
| | | <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> |
| | |
| | | <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> |
| | |
| | | </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> |
| | |
| | | WHERE sc_type = #{type} |
| | | limit 1 |
| | | </select> |
| | | |
| | | |
| | | </mapper> |
| | |
| | |
|
| | |
|
| | | // 奖励订单图片
|
| | | 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
|
| | |
| | | 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);
|
| | |
| | | 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;
|
| | |
|
| | |
| | | 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) {
|
| | | // 免单券、 福利免单券
|
| | |
|
| | |
| | |
|
| | | // 券失效图片替换
|
| | | if (UserSystemCoupon.STATE_END_USE == state || UserSystemCoupon.STATE_OVERDUE == state) {
|
| | | userCouponVO.setCouponPicture(PIC_INVALID);
|
| | | }
|
| | | userCouponVO.setCouponPicture(systemCoupon.getPictureInvalid());
|
| | | } |
| | |
|
| | | userCouponVO.setJumpBtn(jumpBtn);
|
| | |
|
| | |
| | | userCouponVO.setCouponName(systemCoupon.getName());
|
| | | userCouponVO.setCouponEffect(systemCoupon.getEffect());
|
| | | userCouponVO.setCouponRule(systemCoupon.getRule());
|
| | | userCouponVO.setCouponPictureInvalid(systemCoupon.getPictureInvalid());
|
| | |
|
| | |
|
| | | int differentDays = 0;
|
| | |
| | | if (stateActivated == null || stateActivated == 0) {
|
| | | userCouponVO.setState(0);
|
| | | userCouponVO.setCouponEffect("待激活");
|
| | | userCouponVO.setCouponPicture(PIC_INVALID); // 未激活图片
|
| | | userCouponVO.setCouponPicture(systemCoupon.getPictureInvalid());
|
| | |
|
| | | remainDaysFontColor = "#CCCCCC";
|
| | |
|
| | |
| | | for (UserSystemCouponVO userCouponVO: list) {
|
| | | // 显示不能使用
|
| | | userCouponVO.setState(0);
|
| | | userCouponVO.setCouponPicture(PIC_INVALID);
|
| | | userCouponVO.setCouponPicture(userCouponVO.getCouponPictureInvalid());
|
| | |
|
| | | Map<String, Object> map = userCouponVO.getRemainDays();
|
| | | if (map != null) {
|
| | |
| | | // 券图片
|
| | | @Expose
|
| | | private String couponPicture;
|
| | | |
| | | // 券图片- 失效
|
| | | private String couponPictureInvalid;
|
| | | |
| | | // 券作用
|
| | | @Expose
|
| | | private String couponEffect;
|
| | |
| | | this.inUseExplain = inUseExplain;
|
| | | }
|
| | |
|
| | | public String getCouponPictureInvalid() {
|
| | | return couponPictureInvalid;
|
| | | }
|
| | |
|
| | | public void setCouponPictureInvalid(String couponPictureInvalid) {
|
| | | this.couponPictureInvalid = couponPictureInvalid;
|
| | | }
|
| | |
|
| | | }
|