提交 fde3f807 authored 作者: luojie's avatar luojie

修改优惠券字段

上级 bab214c4
...@@ -154,6 +154,9 @@ public class TbCfUserInfoServiceImpl implements TbCfUserInfoService { ...@@ -154,6 +154,9 @@ public class TbCfUserInfoServiceImpl implements TbCfUserInfoService {
String password = passwordEncoder.encode(tbCfUserInfoVo.getPassword()); String password = passwordEncoder.encode(tbCfUserInfoVo.getPassword());
tbCfUserInfoVo.setPassword(password); tbCfUserInfoVo.setPassword(password);
BeanUtils.copyProperties(tbCfUserInfoVo, tbCfUserInfoEntity); BeanUtils.copyProperties(tbCfUserInfoVo, tbCfUserInfoEntity);
//赠送用户优惠券
String couponId=tbCfCouponDao.getCouponId();
tbCfUserInfoVo.setCouponId(couponId);
tbCfUserInfoDao.save(tbCfUserInfoEntity); tbCfUserInfoDao.save(tbCfUserInfoEntity);
//注册成功 创建token //注册成功 创建token
...@@ -163,21 +166,12 @@ public class TbCfUserInfoServiceImpl implements TbCfUserInfoService { ...@@ -163,21 +166,12 @@ public class TbCfUserInfoServiceImpl implements TbCfUserInfoService {
tokenManager.addToken(token, tbCfUserInfoVo); tokenManager.addToken(token, tbCfUserInfoVo);
result.setMessage(ResultCodeEnum.SUCCESS.getDesc()); result.setMessage(ResultCodeEnum.SUCCESS.getDesc());
result.setData(tbCfUserInfoVo); result.setData(tbCfUserInfoVo);
//赠送用户优惠券
String couponId=tbCfCouponDao.getCouponId();
tbCfUserInfoVo.setCouponId(couponId);
//获取购物返券
List<TbCfCouponEntity> couponList = tbCfCouponDao.getCouponByCategory(CouponCategoryEnum.REGISTER.getValue(),new Date());
if(!couponList.isEmpty()) {
//领取优惠券
tbCfCouponService.takeCoupon(couponList.get(0).getCouponId(),tbCfUserInfoVo.getUserId());
}
} else { } else {
result.setCode(ResultCodeEnum.VALIDATE_ERROR.getCode()); result.setCode(ResultCodeEnum.VALIDATE_ERROR.getCode());
result.setMessage("The mailbox or nick has been registered"); result.setMessage("The mailbox or nick has been registered");
} }
tbCfUserInfoVo.setEnableFlag(StateConstant.VALID); tbCfUserInfoVo.setEnableFlag(StateConstant.VALID);
} }
return result; return result;
} }
......
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.platform.dao.TbCfCommentsInfoDao"> <mapper namespace="com.diaoyun.zion.chinafrica.dao.TbCfCommentsInfoDao">
<resultMap type="com.platform.entity.TbCfCommentsInfoEntity" id="tbCfCommentsInfoMap"> <resultMap type="com.diaoyun.zion.chinafrica.entity.TbCfCommentsInfoEntity" id="tbCfCommentsInfoMap">
<result property="commentId" column="comment_id"/> <result property="commentId" column="comment_id"/>
<result property="commentOwnerId" column="comment_owner_id"/> <result property="commentOwnerId" column="comment_owner_id"/>
<result property="commentFromId" column="comment_from_id"/> <result property="commentFromId" column="comment_from_id"/>
<result property="commentFromName" column="comment_from_name"/> <result property="commentFromName" column="comment_from_name"/>
<result property="commentFromAvatar" column="comment_from_avatar"/> <result property="commentFromAvatar" column="comment_from_avatar"/>
<result property="likeNum" column="like_num"/> <result property="likeNum" column="like_num"/>
...@@ -15,7 +15,7 @@ ...@@ -15,7 +15,7 @@
<result property="updateTime" column="update_time"/> <result property="updateTime" column="update_time"/>
</resultMap> </resultMap>
<select id="queryObject" resultType="com.platform.entity.TbCfCommentsInfoEntity"> <select id="queryObject" resultType="com.diaoyun.zion.chinafrica.entity.TbCfCommentsInfoEntity">
select select
`comment_id`, `comment_id`,
`comment_owner_id`, `comment_owner_id`,
...@@ -30,7 +30,7 @@ ...@@ -30,7 +30,7 @@
where comment_id = #{id} where comment_id = #{id}
</select> </select>
<select id="queryList" resultType="com.platform.entity.TbCfCommentsInfoEntity"> <select id="queryList" resultType="com.diaoyun.zion.chinafrica.entity.TbCfCommentsInfoEntity">
select select
`comment_id`, `comment_id`,
`comment_owner_id`, `comment_owner_id`,
...@@ -67,7 +67,7 @@ ...@@ -67,7 +67,7 @@
</if> </if>
</select> </select>
<insert id="save" parameterType="com.platform.entity.TbCfCommentsInfoEntity"> <insert id="save" parameterType="com.diaoyun.zion.chinafrica.entity.TbCfCommentsInfoEntity">
insert into tb_cf_comments_info( insert into tb_cf_comments_info(
`comment_id`, `comment_id`,
`comment_owner_id`, `comment_owner_id`,
...@@ -90,7 +90,7 @@ ...@@ -90,7 +90,7 @@
#{updateTime}) #{updateTime})
</insert> </insert>
<update id="update" parameterType="com.platform.entity.TbCfCommentsInfoEntity"> <update id="update" parameterType="com.diaoyun.zion.chinafrica.entity.TbCfCommentsInfoEntity">
update tb_cf_comments_info update tb_cf_comments_info
<set> <set>
<if test="commentOwnerId != null">`comment_owner_id` = #{commentOwnerId}, </if> <if test="commentOwnerId != null">`comment_owner_id` = #{commentOwnerId}, </if>
......
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.platform.dao.TbCfCommentsReplyDao"> <mapper namespace="com.diaoyun.zion.chinafrica.dao.TbCfCommentsReplyDao">
<resultMap type="com.platform.entity.TbCfCommentsReplyEntity" id="tbCfCommentsReplyMap"> <resultMap type="com.diaoyun.zion.chinafrica.entity.TbCfCommentsReplyEntity" id="tbCfCommentsReplyMap">
<result property="commentsId" column="comments_id"/> <result property="commentsId" column="comments_id"/>
<result property="commentId" column="comment_id"/> <result property="commentId" column="comment_id"/>
<result property="commentFromId" column="comment_from_id"/> <result property="commentFromId" column="comment_from_id"/>
...@@ -17,7 +17,7 @@ ...@@ -17,7 +17,7 @@
<result property="updateTime" column="update_time"/> <result property="updateTime" column="update_time"/>
</resultMap> </resultMap>
<select id="queryObject" resultType="com.platform.entity.TbCfCommentsReplyEntity"> <select id="queryObject" resultType="com.diaoyun.zion.chinafrica.entity.TbCfCommentsReplyEntity">
select select
`comments_id`, `comments_id`,
`comment_id`, `comment_id`,
...@@ -34,7 +34,7 @@ ...@@ -34,7 +34,7 @@
where comments_id = #{id} where comments_id = #{id}
</select> </select>
<select id="queryList" resultType="com.platform.entity.TbCfCommentsReplyEntity"> <select id="queryList" resultType="com.diaoyun.zion.chinafrica.entity.TbCfCommentsReplyEntity">
select select
`comments_id`, `comments_id`,
`comment_id`, `comment_id`,
...@@ -73,7 +73,7 @@ ...@@ -73,7 +73,7 @@
</if> </if>
</select> </select>
<insert id="save" parameterType="com.platform.entity.TbCfCommentsReplyEntity"> <insert id="save" parameterType="com.diaoyun.zion.chinafrica.entity.TbCfCommentsReplyEntity">
insert into tb_cf_comments_reply( insert into tb_cf_comments_reply(
`comments_id`, `comments_id`,
`comment_id`, `comment_id`,
...@@ -100,7 +100,7 @@ ...@@ -100,7 +100,7 @@
#{updateTime}) #{updateTime})
</insert> </insert>
<update id="update" parameterType="com.platform.entity.TbCfCommentsReplyEntity"> <update id="update" parameterType="com.diaoyun.zion.chinafrica.entity.TbCfCommentsReplyEntity">
update tb_cf_comments_reply update tb_cf_comments_reply
<set> <set>
<if test="commentId != null">`comment_id` = #{commentId}, </if> <if test="commentId != null">`comment_id` = #{commentId}, </if>
......
...@@ -5,7 +5,7 @@ ...@@ -5,7 +5,7 @@
<resultMap type="com.diaoyun.zion.chinafrica.entity.TbCfCouponEntity" id="tbCfCouponMap"> <resultMap type="com.diaoyun.zion.chinafrica.entity.TbCfCouponEntity" id="tbCfCouponMap">
<result property="couponId" column="coupon_id"/> <result property="couponId" column="coupon_id"/>
<result property="couponCategoryId" column="coupon_category_name"/> <result property="couponCategoryId" column="coupon_category_id"/>
<result property="couponUse" column="coupon_use"/> <result property="couponUse" column="coupon_use"/>
<result property="couponTitle" column="coupon_title"/> <result property="couponTitle" column="coupon_title"/>
<result property="couponIcon" column="coupon_icon"/> <result property="couponIcon" column="coupon_icon"/>
...@@ -188,7 +188,7 @@ ...@@ -188,7 +188,7 @@
<!--查询用户所有有效的优惠券--> <!--查询用户所有有效的优惠券-->
<select id="queryUserAvailableCoupon" resultType="com.diaoyun.zion.chinafrica.entity.TbCfCouponEntity"> <select id="queryUserAvailableCoupon" resultType="com.diaoyun.zion.chinafrica.entity.TbCfCouponEntity">
select DISTINCT t2.* from tb_cf_take_coupon t1,tb_cf_coupon t2,tb_cf_issue_coupon t3 ,tb_cf_user_info t4 select DISTINCT t2.* from tb_cf_take_coupon t1,tb_cf_coupon t2,tb_cf_issue_coupon t3 ,tb_cf_user_info t4
where where
(t1.user_id=#{userId} or t3.user_id=#{userId} or t4.user_id=#{userId}) (t1.user_id=#{userId} or t3.user_id=#{userId} or t4.user_id=#{userId})
and t1.coupon_id=t2.coupon_id and t2.coupon_id=t3.coupon_id or t2.coupon_id=t4.coupon_id and t1.coupon_id=t2.coupon_id and t2.coupon_id=t3.coupon_id or t2.coupon_id=t4.coupon_id
and <![CDATA[ t2.valid_start_time<=#{nowTime}]]> and <![CDATA[t2.valid_end_time>=#{nowTime}]]> and t2.status=1 and <![CDATA[ t2.valid_start_time<=#{nowTime}]]> and <![CDATA[t2.valid_end_time>=#{nowTime}]]> and t2.status=1
...@@ -205,7 +205,7 @@ ...@@ -205,7 +205,7 @@
select t2.* from tb_cf_take_coupon t1,tb_cf_coupon t2 ,tb_cf_issue_coupon t3 ,tb_cf_user_info t4 select t2.* from tb_cf_take_coupon t1,tb_cf_coupon t2 ,tb_cf_issue_coupon t3 ,tb_cf_user_info t4
where (t1.user_id=#{userId} and t1.coupon_id=t2.coupon_id and t2.coupon_id=t3.coupon_id) where (t1.user_id=#{userId} and t1.coupon_id=t2.coupon_id and t2.coupon_id=t3.coupon_id)
and t1.enable_flag=0 and t3.enable_flag=0 and t1.enable_flag=0 and t3.enable_flag=0
</select> </select>
<!--获取已过期的优惠券--> <!--获取已过期的优惠券-->
<select id="queryUserExpiredoupon" resultType="com.diaoyun.zion.chinafrica.entity.TbCfCouponEntity"> <select id="queryUserExpiredoupon" resultType="com.diaoyun.zion.chinafrica.entity.TbCfCouponEntity">
select t2.* from tb_cf_take_coupon t1,tb_cf_coupon t2 ,tb_cf_issue_coupon t3 where t1.user_id=#{userId} and t1.coupon_id=t2.coupon_id and t1.coupon_id=t2.coupon_id and t2.coupon_id=t3.coupon_id select t2.* from tb_cf_take_coupon t1,tb_cf_coupon t2 ,tb_cf_issue_coupon t3 where t1.user_id=#{userId} and t1.coupon_id=t2.coupon_id and t1.coupon_id=t2.coupon_id and t2.coupon_id=t3.coupon_id
......
...@@ -133,7 +133,7 @@ ...@@ -133,7 +133,7 @@
</delete> </delete>
<!--获取店铺独立站--> <!--获取店铺独立站-->
<select id="getStoreStationList" resultType="com.diaoyun.zion.chinafrica.entity.TbCfStoreEntity"> <select id="getStoreStationList" resultType="com.diaoyun.zion.chinafrica.entity.TbCfStoreEntity">
select * from tb_cf_store where enable_flag=1 order by create_time desc select * from tb_cf_store where enable_flag!=0 order by create_time desc
</select> </select>
</mapper> </mapper>
\ No newline at end of file
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论