Skip to content
项目
群组
代码片段
帮助
正在加载...
帮助
为 GitLab 提交贡献
登录/注册
切换导航
Z
zion
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分枝图
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
1
合并请求
1
CI / CD
CI / CD
流水线
作业
计划
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
分枝图
统计图
创建新议题
作业
提交
议题看板
打开侧边栏
zhengfg
zion
Commits
f291b0d9
提交
f291b0d9
authored
10月 27, 2019
作者:
luojie
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
修改优惠券接口
上级
aa6cff1c
隐藏空白字符变更
内嵌
并排
正在显示
8 个修改的文件
包含
373 行增加
和
12 行删除
+373
-12
TbCfCouponCategoryDao.java
...om/diaoyun/zion/chinafrica/dao/TbCfCouponCategoryDao.java
+21
-0
TbCfCouponCategoryEntity.java
...oyun/zion/chinafrica/entity/TbCfCouponCategoryEntity.java
+50
-0
TbCfCouponEntity.java
.../com/diaoyun/zion/chinafrica/entity/TbCfCouponEntity.java
+6
-6
TbCfCouponCategoryService.java
...un/zion/chinafrica/service/TbCfCouponCategoryService.java
+78
-0
TbCfCouponCategoryServiceImpl.java
...hinafrica/service/impl/TbCfCouponCategoryServiceImpl.java
+64
-0
TbCfUserInfoServiceImpl.java
...zion/chinafrica/service/impl/TbCfUserInfoServiceImpl.java
+2
-2
TbCfCouponCategoryDao.xml
src/main/resources/mapper/TbCfCouponCategoryDao.xml
+83
-0
TbCfCouponDao.xml
src/main/resources/mapper/TbCfCouponDao.xml
+69
-4
没有找到文件。
src/main/java/com/diaoyun/zion/chinafrica/dao/TbCfCouponCategoryDao.java
0 → 100644
浏览文件 @
f291b0d9
package
com
.
diaoyun
.
zion
.
chinafrica
.
dao
;
import
com.diaoyun.zion.chinafrica.entity.TbCfCouponCategoryEntity
;
import
com.diaoyun.zion.master.dao.BaseDao
;
import
java.util.List
;
/**
* 优惠券发放Dao
*
* @author lipengjun
* @date 2019-10-22 10:23:49
*/
public
interface
TbCfCouponCategoryDao
extends
BaseDao
<
TbCfCouponCategoryEntity
>
{
/**
* 获取优惠券类型
* @param categoryId
* @return
*/
List
<
TbCfCouponCategoryEntity
>
queryByCouponCategoryId
(
String
categoryId
);
}
src/main/java/com/diaoyun/zion/chinafrica/entity/TbCfCouponCategoryEntity.java
0 → 100644
浏览文件 @
f291b0d9
package
com
.
diaoyun
.
zion
.
chinafrica
.
entity
;
import
java.io.Serializable
;
/**
* 优惠券类型表实体
* 表名 tb_cf_coupon_category
*
* @author lipengjun
* @date 2019-10-22 10:23:49
*/
public
class
TbCfCouponCategoryEntity
implements
Serializable
{
private
static
final
long
serialVersionUID
=
1L
;
/**
* 优惠券类型id
*/
private
String
couponCategoryId
;
/**
* 优惠券类型名称
*/
private
String
couponCategoryName
;
/**
* 设置:优惠券类型id
*/
public
void
setCouponCategoryId
(
String
couponCategoryId
)
{
this
.
couponCategoryId
=
couponCategoryId
;
}
/**
* 获取:优惠券类型id
*/
public
String
getCouponCategoryId
()
{
return
couponCategoryId
;
}
/**
* 设置:优惠券类型名称
*/
public
void
setCouponCategoryName
(
String
couponCategoryName
)
{
this
.
couponCategoryName
=
couponCategoryName
;
}
/**
* 获取:优惠券类型名称
*/
public
String
getCouponCategoryName
()
{
return
couponCategoryName
;
}
}
src/main/java/com/diaoyun/zion/chinafrica/entity/TbCfCouponEntity.java
浏览文件 @
f291b0d9
...
@@ -27,12 +27,12 @@ public class TbCfCouponEntity implements Serializable {
...
@@ -27,12 +27,12 @@ public class TbCfCouponEntity implements Serializable {
* 优惠券类型
* 优惠券类型
*/
*/
@ApiModelProperty
(
"优惠券类型"
)
@ApiModelProperty
(
"优惠券类型"
)
private
Integer
couponCategoryId
;
private
String
couponCategoryId
;
/**
/**
* 优惠券类型
* 优惠券类型
*/
*/
@ApiModelProperty
(
"优惠券类型名称"
)
@ApiModelProperty
(
"优惠券类型名称"
)
private
Integer
couponCategoryName
;
private
String
couponCategoryName
;
/**
/**
* 可用于类目
* 可用于类目
*/
*/
...
@@ -140,22 +140,22 @@ public class TbCfCouponEntity implements Serializable {
...
@@ -140,22 +140,22 @@ public class TbCfCouponEntity implements Serializable {
/**
/**
* 设置:优惠券类型
* 设置:优惠券类型
*/
*/
public
void
setCouponCategoryId
(
Integer
couponCategoryId
)
{
public
void
setCouponCategoryId
(
String
couponCategoryId
)
{
this
.
couponCategoryId
=
couponCategoryId
;
this
.
couponCategoryId
=
couponCategoryId
;
}
}
/**
/**
* 获取:优惠券类型
* 获取:优惠券类型
*/
*/
public
Integer
getCouponCategoryId
()
{
public
String
getCouponCategoryId
()
{
return
couponCategoryId
;
return
couponCategoryId
;
}
}
public
Integer
getCouponCategoryName
()
{
public
String
getCouponCategoryName
()
{
return
couponCategoryName
;
return
couponCategoryName
;
}
}
public
void
setCouponCategoryName
(
Integer
couponCategoryName
)
{
public
void
setCouponCategoryName
(
String
couponCategoryName
)
{
this
.
couponCategoryName
=
couponCategoryName
;
this
.
couponCategoryName
=
couponCategoryName
;
}
}
...
...
src/main/java/com/diaoyun/zion/chinafrica/service/TbCfCouponCategoryService.java
0 → 100644
浏览文件 @
f291b0d9
package
com
.
diaoyun
.
zion
.
chinafrica
.
service
;
import
com.diaoyun.zion.chinafrica.entity.TbCfCouponCategoryEntity
;
import
java.util.List
;
import
java.util.Map
;
/**
* 优惠券类型表Service接口
*
* @author lipengjun
* @date 2019-10-22 10:23:49
*/
public
interface
TbCfCouponCategoryService
{
/**
* 根据主键查询实体
*
* @param
* @return 实体
*/
TbCfCouponCategoryEntity
queryObject
(
String
couponCategoryId
);
/**
* 分页查询
*
* @param map 参数
* @return list
*/
List
<
TbCfCouponCategoryEntity
>
queryList
(
Map
<
String
,
Object
>
map
);
/**
* 分页统计总数
*
* @param map 参数
* @return 总数
*/
int
queryTotal
(
Map
<
String
,
Object
>
map
);
/**
* 保存实体
*
* @param tbCfCouponCategory 实体
* @return 保存条数
*/
int
save
(
TbCfCouponCategoryEntity
tbCfCouponCategory
);
/**
* 根据主键更新实体
*
* @param tbCfCouponCategory 实体
* @return 更新条数
*/
int
update
(
TbCfCouponCategoryEntity
tbCfCouponCategory
);
/**
* 根据主键删除
*
* @param couponCategoryId
* @return 删除条数
*/
int
delete
(
String
couponCategoryId
);
/**
* 根据主键批量删除
*
* @param couponCategoryIds
* @return 删除条数
*/
int
deleteBatch
(
String
[]
couponCategoryIds
);
/**
* 根据优惠券类型id查询
* @param categoryId
* @return
*/
List
<
TbCfCouponCategoryEntity
>
queryByCouponCategoryId
(
String
categoryId
);
}
src/main/java/com/diaoyun/zion/chinafrica/service/impl/TbCfCouponCategoryServiceImpl.java
0 → 100644
浏览文件 @
f291b0d9
package
com
.
diaoyun
.
zion
.
chinafrica
.
service
.
impl
;
import
com.diaoyun.zion.chinafrica.dao.TbCfCouponCategoryDao
;
import
com.diaoyun.zion.chinafrica.entity.TbCfCouponCategoryEntity
;
import
com.diaoyun.zion.chinafrica.service.TbCfCouponCategoryService
;
import
com.diaoyun.zion.master.util.IdUtil
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
import
java.util.List
;
import
java.util.Map
;
/**
* 优惠券类型Service实现类
*
* @author lipengjun
* @date 2019-10-22 10:23:49
*/
@Service
(
"tbCfCouponCategoryService"
)
public
class
TbCfCouponCategoryServiceImpl
implements
TbCfCouponCategoryService
{
@Autowired
private
TbCfCouponCategoryDao
tbCfCouponCategoryDao
;
@Override
public
TbCfCouponCategoryEntity
queryObject
(
String
couponCategoryId
)
{
return
tbCfCouponCategoryDao
.
queryObject
(
couponCategoryId
);
}
@Override
public
List
<
TbCfCouponCategoryEntity
>
queryList
(
Map
<
String
,
Object
>
map
)
{
return
tbCfCouponCategoryDao
.
queryList
(
map
);
}
@Override
public
int
queryTotal
(
Map
<
String
,
Object
>
map
)
{
return
tbCfCouponCategoryDao
.
queryTotal
(
map
);
}
@Override
public
int
save
(
TbCfCouponCategoryEntity
tbCfCouponCategory
)
{
tbCfCouponCategory
.
setCouponCategoryId
(
IdUtil
.
createIdbyUUID
());
return
tbCfCouponCategoryDao
.
save
(
tbCfCouponCategory
);
}
@Override
public
int
update
(
TbCfCouponCategoryEntity
tbCfCouponCategory
)
{
return
tbCfCouponCategoryDao
.
update
(
tbCfCouponCategory
);
}
@Override
public
int
delete
(
String
couponCategoryId
)
{
return
tbCfCouponCategoryDao
.
delete
(
couponCategoryId
);
}
@Override
public
int
deleteBatch
(
String
[]
couponCategoryIds
)
{
return
tbCfCouponCategoryDao
.
deleteBatch
(
couponCategoryIds
);
}
@Override
public
List
<
TbCfCouponCategoryEntity
>
queryByCouponCategoryId
(
String
categoryId
)
{
return
tbCfCouponCategoryDao
.
queryByCouponCategoryId
(
categoryId
);
}
}
src/main/java/com/diaoyun/zion/chinafrica/service/impl/TbCfUserInfoServiceImpl.java
浏览文件 @
f291b0d9
...
@@ -164,13 +164,13 @@ public class TbCfUserInfoServiceImpl implements TbCfUserInfoService {
...
@@ -164,13 +164,13 @@ 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
);
/*
//获取购物返券
//获取购物返券
List<TbCfCouponEntity> couponList = tbCfCouponDao.getCouponByCategory(CouponCategoryEnum.REGISTER.getValue(),new Date());
List<TbCfCouponEntity> couponList = tbCfCouponDao.getCouponByCategory(CouponCategoryEnum.REGISTER.getValue(),new Date());
if(!couponList.isEmpty()) {
if(!couponList.isEmpty()) {
//领取优惠券
//领取优惠券
tbCfCouponService.takeCoupon(couponList.get(0).getCouponId(),tbCfUserInfoVo.getUserId());
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"
);
...
...
src/main/resources/mapper/TbCfCouponCategoryDao.xml
0 → 100644
浏览文件 @
f291b0d9
<?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">
<mapper
namespace=
"com.platform.dao.TbCfCouponCategoryDao"
>
<resultMap
type=
"com.diaoyun.zion.chinafrica.entity.TbCfCouponCategoryEntity"
id=
"tbCfCouponCategoryMap"
>
<result
property=
"couponCategoryId"
column=
"coupon_category_id"
/>
<result
property=
"couponCategoryName"
column=
"coupon_category_name"
/>
</resultMap>
<select
id=
"queryObject"
resultType=
"com.diaoyun.zion.chinafrica.entity.TbCfCouponCategoryEntity"
>
select
`coupon_category_id`,
`coupon_category_name`
from tb_cf_coupon_category
where coupon_category_id = #{id}
</select>
<select
id=
"queryByCouponCategoryId"
resultType=
"com.diaoyun.zion.chinafrica.entity.TbCfCouponCategoryEntity"
>
select
`coupon_category_id`,
`coupon_category_name`
from tb_cf_coupon_category
where coupon_category_id = #{id}
</select>
<select
id=
"queryList"
resultType=
"com.diaoyun.zion.chinafrica.entity.TbCfCouponCategoryEntity"
>
select
`coupon_category_id`,
`coupon_category_name`
from tb_cf_coupon_category
WHERE 1=1
<if
test=
"name != null and name.trim() != ''"
>
AND name LIKE concat('%',#{name},'%')
</if>
<choose>
<when
test=
"sidx != null and sidx.trim() != ''"
>
order by ${sidx} ${order}
</when>
<otherwise>
order by coupon_category_id desc
</otherwise>
</choose>
<if
test=
"offset != null and limit != null"
>
limit #{offset}, #{limit}
</if>
</select>
<select
id=
"queryTotal"
resultType=
"int"
>
select count(*) from tb_cf_coupon_category
WHERE 1=1
<if
test=
"name != null and name.trim() != ''"
>
AND name LIKE concat('%',#{name},'%')
</if>
</select>
<insert
id=
"save"
parameterType=
"com.diaoyun.zion.chinafrica.entity.TbCfCouponCategoryEntity"
>
insert into tb_cf_coupon_category(
`coupon_category_id`,
`coupon_category_name`)
values(
#{couponCategoryId},
#{couponCategoryName})
</insert>
<update
id=
"update"
parameterType=
"com.diaoyun.zion.chinafrica.entity.TbCfCouponCategoryEntity"
>
update tb_cf_coupon_category
<set>
<if
test=
"couponCategoryName != null"
>
`coupon_category_name` = #{couponCategoryName}
</if>
</set>
where coupon_category_id = #{couponCategoryId}
</update>
<delete
id=
"delete"
>
delete from tb_cf_coupon_category where coupon_category_id = #{value}
</delete>
<delete
id=
"deleteBatch"
>
delete from tb_cf_coupon_category where coupon_category_id in
<foreach
item=
"couponCategoryId"
collection=
"array"
open=
"("
separator=
","
close=
")"
>
#{couponCategoryId}
</foreach>
</delete>
</mapper>
\ No newline at end of file
src/main/resources/mapper/TbCfCouponDao.xml
浏览文件 @
f291b0d9
...
@@ -187,7 +187,29 @@
...
@@ -187,7 +187,29 @@
</delete>
</delete>
<!--查询用户所有有效的优惠券-->
<!--查询用户所有有效的优惠券-->
<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
select DISTINCT
t2.coupon_id,
t2.coupon_category_id,
t4.coupon_category_name,
t2.coupon_use,
t2.coupon_title,
t2.coupon_icon,
t2.with_station_id,
t2.with_amount,
t2.deduct_amount,
t2.quato,
t2.take_count,
t2.used_count,
t2.start_time,
t2.end_time,
t2.valid_start_time,
t2.valid_end_time,
t2.status,
t2.create_user_id,
t2.create_time,
t2.update_user_id,
t2.update_time
from tb_cf_take_coupon t1,tb_cf_coupon t2,tb_cf_issue_coupon t3,tb_cf_coupon_category t4
where ((t3.user_id=#{userId} and t3.coupon_id=t2.coupon_id and t2.status=1 and t3.enable_flag=1)
where ((t3.user_id=#{userId} and t3.coupon_id=t2.coupon_id and t2.status=1 and t3.enable_flag=1)
or (t1.user_id=#{userId} and t1.coupon_id=t2.coupon_id and t2.status=1 and t1.enable_flag=1))
or (t1.user_id=#{userId} and t1.coupon_id=t2.coupon_id and t2.status=1 and t1.enable_flag=1))
and
<![CDATA[ t2.valid_start_time<=#{nowTime}]]>
and
<![CDATA[t2.valid_end_time>=#{nowTime}]]>
and
<![CDATA[ t2.valid_start_time<=#{nowTime}]]>
and
<![CDATA[t2.valid_end_time>=#{nowTime}]]>
...
@@ -200,13 +222,56 @@
...
@@ -200,13 +222,56 @@
<!--获取已使用的优惠券-->
<!--获取已使用的优惠券-->
<select
id=
"queryUserUsedCoupon"
resultType=
"com.diaoyun.zion.chinafrica.entity.TbCfCouponEntity"
>
<select
id=
"queryUserUsedCoupon"
resultType=
"com.diaoyun.zion.chinafrica.entity.TbCfCouponEntity"
>
select t2.* from tb_cf_take_coupon t1,tb_cf_coupon t2 ,tb_cf_issue_coupon t3
select DISTINCT
t2.coupon_id,
t2.coupon_category_id,
t4.coupon_category_name,
t2.coupon_use,
t2.coupon_title,
t2.coupon_icon,
t2.with_station_id,
t2.with_amount,
t2.deduct_amount,
t2.quato,
t2.take_count,
t2.used_count,
t2.start_time,
t2.end_time,
t2.valid_start_time,
t2.valid_end_time,
t2.status,
t2.create_user_id,
t2.create_time,
t2.update_user_id,
t2.update_time
from tb_cf_take_coupon t1,tb_cf_coupon t2 ,tb_cf_issue_coupon t3,tb_cf_coupon_category t4
where ((t1.user_id=#{userId} and t1.coupon_id=t2.coupon_id and t1.enable_flag=0)
where ((t1.user_id=#{userId} and t1.coupon_id=t2.coupon_id and t1.enable_flag=0)
or (t3.user_id=#{userId} and t3.coupon_id=t2.coupon_id and t3.enable_flag=0))
or (t3.user_id=#{userId} and t3.coupon_id=t2.coupon_id 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
select DISTINCT
t2.coupon_id,
t2.coupon_category_id,
t4.coupon_category_name,
t2.coupon_use,
t2.coupon_title,
t2.coupon_icon,
t2.with_station_id,
t2.with_amount,
t2.deduct_amount,
t2.quato,
t2.take_count,
t2.used_count,
t2.start_time,
t2.end_time,
t2.valid_start_time,
t2.valid_end_time,
t2.status,
t2.create_user_id,
t2.create_time,
t2.update_user_id,
t2.update_time from tb_cf_take_coupon t1,tb_cf_coupon t2 ,tb_cf_issue_coupon t3,tb_cf_coupon_category t4
where ((t1.user_id=#{userId} and t1.coupon_id=t2.coupon_id and
<![CDATA[ t2.valid_end_time<#{nowTime}]]>
and t1.enable_flag=1)
where ((t1.user_id=#{userId} and t1.coupon_id=t2.coupon_id and
<![CDATA[ t2.valid_end_time<#{nowTime}]]>
and t1.enable_flag=1)
or (t1.user_id=#{userId} and t1.coupon_id=t2.coupon_id and
<![CDATA[ t2.valid_end_time<#{nowTime}]]>
and t1.enable_flag=1))
or (t1.user_id=#{userId} and t1.coupon_id=t2.coupon_id and
<![CDATA[ t2.valid_end_time<#{nowTime}]]>
and t1.enable_flag=1))
</select>
</select>
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论