Skip to content
项目
群组
代码片段
帮助
正在加载...
帮助
为 GitLab 提交贡献
登录/注册
切换导航
Z
zion
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分枝图
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
1
合并请求
1
CI / CD
CI / CD
流水线
作业
计划
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
分枝图
统计图
创建新议题
作业
提交
议题看板
打开侧边栏
zhengfg
zion
Commits
afedf0a1
提交
afedf0a1
authored
11月 22, 2019
作者:
zgy
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
完成优惠券发放功能(修改前面遗留的bug)
上级
be23cf5f
显示空白字符变更
内嵌
并排
正在显示
11 个修改的文件
包含
285 行增加
和
325 行删除
+285
-325
LoginController.java
...m/diaoyun/zion/chinafrica/controller/LoginController.java
+3
-5
TbCfIssueCouponDao.java
...a/com/diaoyun/zion/chinafrica/dao/TbCfIssueCouponDao.java
+3
-2
TbCfToiCouponDao.java
...ava/com/diaoyun/zion/chinafrica/dao/TbCfToiCouponDao.java
+5
-4
TbCfToiCouponEntityExtends.java
...un/zion/chinafrica/entity/TbCfToiCouponEntityExtends.java
+1
-1
TbCfToicouponEntity.java
...m/diaoyun/zion/chinafrica/entity/TbCfToicouponEntity.java
+27
-10
TbCfToiCouponService.java
...diaoyun/zion/chinafrica/service/TbCfToiCouponService.java
+8
-9
PayPalServiceImpl.java
...aoyun/zion/chinafrica/service/impl/PayPalServiceImpl.java
+1
-1
TbCfToiCouponServiceImpl.java
...ion/chinafrica/service/impl/TbCfToiCouponServiceImpl.java
+8
-20
TbCfUserInfoServiceImpl.java
...zion/chinafrica/service/impl/TbCfUserInfoServiceImpl.java
+30
-48
TbCfCouponDao.xml
src/main/resources/mapper/TbCfCouponDao.xml
+135
-135
TbCfToiCouponDao.xml
src/main/resources/mapper/TbCfToiCouponDao.xml
+64
-90
没有找到文件。
src/main/java/com/diaoyun/zion/chinafrica/controller/LoginController.java
浏览文件 @
afedf0a1
...
@@ -4,8 +4,6 @@ import com.diaoyun.zion.chinafrica.service.TbCfUserInfoService;
...
@@ -4,8 +4,6 @@ import com.diaoyun.zion.chinafrica.service.TbCfUserInfoService;
import
com.diaoyun.zion.chinafrica.vo.TbCfUserInfoVo
;
import
com.diaoyun.zion.chinafrica.vo.TbCfUserInfoVo
;
import
com.diaoyun.zion.master.base.BaseController
;
import
com.diaoyun.zion.master.base.BaseController
;
import
com.diaoyun.zion.master.base.Result
;
import
com.diaoyun.zion.master.base.Result
;
import
com.diaoyun.zion.master.validator.Validator
;
import
com.diaoyun.zion.master.validator.annotation.ValidateParam
;
import
io.swagger.annotations.Api
;
import
io.swagger.annotations.Api
;
import
io.swagger.annotations.ApiOperation
;
import
io.swagger.annotations.ApiOperation
;
import
io.swagger.annotations.ApiParam
;
import
io.swagger.annotations.ApiParam
;
...
@@ -51,8 +49,8 @@ public class LoginController extends BaseController {
...
@@ -51,8 +49,8 @@ public class LoginController extends BaseController {
@ApiOperation
(
"登录"
)
@ApiOperation
(
"登录"
)
@PostMapping
@PostMapping
public
Result
<
TbCfUserInfoVo
>
login
(
@ApiParam
(
value
=
"登录名"
)
@ValidateParam
({
Validator
.
NOT_BLANK
})
String
account
,
public
Result
<
TbCfUserInfoVo
>
login
(
@ApiParam
(
value
=
"登录名"
)
String
account
,
@ApiParam
(
value
=
"密码"
)
@ValidateParam
({
Validator
.
NOT_BLANK
})
String
password
)
{
@ApiParam
(
value
=
"密码"
)
String
password
)
{
return
tbCfUserInfoService
.
login
(
getIpAddr
(
request
),
account
,
password
);
return
tbCfUserInfoService
.
login
(
getIpAddr
(
request
),
account
,
password
);
}
}
...
@@ -74,7 +72,7 @@ public class LoginController extends BaseController {
...
@@ -74,7 +72,7 @@ public class LoginController extends BaseController {
*/
*/
@ApiOperation
(
value
=
"获取短信验证码"
)
@ApiOperation
(
value
=
"获取短信验证码"
)
@GetMapping
(
value
=
"/register/identifyCode/{phone}"
)
@GetMapping
(
value
=
"/register/identifyCode/{phone}"
)
public
Result
getUserPhoneCode
(
@ApiParam
(
"手机号"
)
@PathVariable
(
"phone"
)
@ValidateParam
({
Validator
.
NOT_BLANK
})
String
phone
)
throws
IOException
{
public
Result
getUserPhoneCode
(
@ApiParam
(
"手机号"
)
@PathVariable
(
"phone"
)
String
phone
)
throws
IOException
{
tbCfUserInfoService
.
getUserPhoneCode
(
phone
);
tbCfUserInfoService
.
getUserPhoneCode
(
phone
);
return
new
Result
(
"Verification code has been sent"
);
return
new
Result
(
"Verification code has been sent"
);
}
}
...
...
src/main/java/com/diaoyun/zion/chinafrica/dao/TbCfIssueCouponDao.java
浏览文件 @
afedf0a1
...
@@ -2,7 +2,8 @@ package com.diaoyun.zion.chinafrica.dao;
...
@@ -2,7 +2,8 @@ package com.diaoyun.zion.chinafrica.dao;
import
com.diaoyun.zion.chinafrica.entity.TbCfIssueCouponEntity
;
import
com.diaoyun.zion.chinafrica.entity.TbCfIssueCouponEntity
;
import
com.diaoyun.zion.chinafrica.entity.TbCfIssueCouponEntityExtends
;
import
com.diaoyun.zion.chinafrica.entity.TbCfIssueCouponEntityExtends
;
import
com.diaoyun.zion.chinafrica.entity.TbCfToiCouponEntity
;
import
com.diaoyun.zion.chinafrica.entity.TbCfToicouponEntity
;
import
com.diaoyun.zion.master.dao.BaseDao
;
import
com.diaoyun.zion.master.dao.BaseDao
;
import
java.util.List
;
import
java.util.List
;
...
@@ -20,5 +21,5 @@ public interface TbCfIssueCouponDao extends BaseDao<TbCfIssueCouponEntity> {
...
@@ -20,5 +21,5 @@ public interface TbCfIssueCouponDao extends BaseDao<TbCfIssueCouponEntity> {
void
changeCoupnStatus
(
String
userId
,
String
couponId
);
void
changeCoupnStatus
(
String
userId
,
String
couponId
);
int
saves
(
TbCfToi
C
ouponEntity
toiCouponEntity
);
int
saves
(
TbCfToi
c
ouponEntity
toiCouponEntity
);
}
}
src/main/java/com/diaoyun/zion/chinafrica/dao/TbCfToiCouponDao.java
浏览文件 @
afedf0a1
package
com
.
diaoyun
.
zion
.
chinafrica
.
dao
;
package
com
.
diaoyun
.
zion
.
chinafrica
.
dao
;
import
com.diaoyun.zion.chinafrica.entity.TbCfToiCouponEntity
;
import
com.diaoyun.zion.chinafrica.entity.TbCfToiCouponEntityExtends
;
import
com.diaoyun.zion.chinafrica.entity.TbCfToiCouponEntityExtends
;
import
com.diaoyun.zion.chinafrica.entity.TbCfToicouponEntity
;
import
com.diaoyun.zion.master.dao.BaseDao
;
import
com.diaoyun.zion.master.dao.BaseDao
;
import
java.util.List
;
import
java.util.List
;
...
@@ -13,11 +15,10 @@ import java.util.List;
...
@@ -13,11 +15,10 @@ import java.util.List;
* @author lipengjun
* @author lipengjun
* @date 2019-11-20 19:37:20
* @date 2019-11-20 19:37:20
*/
*/
public
interface
TbCfToiCouponDao
extends
BaseDao
<
TbCfToiCouponEntity
>
{
public
interface
TbCfToiCouponDao
extends
BaseDao
<
TbCfToicouponEntity
>
{
int
saveAndSubmit
(
TbCfToiCouponEntity
tbCfToiCoupon
);
int
saves
(
TbCfToiCouponEntity
toi
);
List
<
TbCfToiCouponEntityExtends
>
queryCouponByUserId
(
String
userId
);
List
<
TbCfToiCouponEntityExtends
>
queryCouponByUserId
(
String
userId
);
int
changeCoupnStatus
(
String
userId
,
String
couponId
);
int
changeCoupnStatus
(
String
userId
,
String
couponId
);
...
...
src/main/java/com/diaoyun/zion/chinafrica/entity/TbCfToiCouponEntityExtends.java
浏览文件 @
afedf0a1
...
@@ -4,7 +4,7 @@ import java.math.BigDecimal;
...
@@ -4,7 +4,7 @@ import java.math.BigDecimal;
import
java.text.SimpleDateFormat
;
import
java.text.SimpleDateFormat
;
import
java.util.Date
;
import
java.util.Date
;
public
class
TbCfToiCouponEntityExtends
extends
TbCfToi
C
ouponEntity
{
public
class
TbCfToiCouponEntityExtends
extends
TbCfToi
c
ouponEntity
{
private
BigDecimal
amount
;
private
BigDecimal
amount
;
private
BigDecimal
money
;
private
BigDecimal
money
;
...
...
src/main/java/com/diaoyun/zion/chinafrica/entity/TbCfToi
C
ouponEntity.java
→
src/main/java/com/diaoyun/zion/chinafrica/entity/TbCfToi
c
ouponEntity.java
浏览文件 @
afedf0a1
...
@@ -8,9 +8,9 @@ import java.util.Date;
...
@@ -8,9 +8,9 @@ import java.util.Date;
* 表名 tb_cf_toicoupon
* 表名 tb_cf_toicoupon
*
*
* @author lipengjun
* @author lipengjun
* @date 2019-11-2
0 19:37:20
* @date 2019-11-2
2 19:32:08
*/
*/
public
class
TbCfToi
C
ouponEntity
implements
Serializable
{
public
class
TbCfToi
c
ouponEntity
implements
Serializable
{
private
static
final
long
serialVersionUID
=
1L
;
private
static
final
long
serialVersionUID
=
1L
;
/**
/**
...
@@ -26,9 +26,13 @@ public class TbCfToiCouponEntity implements Serializable {
...
@@ -26,9 +26,13 @@ public class TbCfToiCouponEntity implements Serializable {
*/
*/
private
String
userId
;
private
String
userId
;
/**
/**
*
创建
时间
*
开始
时间
*/
*/
private
Date
createTime
;
private
Date
startTime
;
/**
* 结束时间
*/
private
Date
endTime
;
/**
/**
* 标识(1发放,2领取,3注册)
* 标识(1发放,2领取,3注册)
*/
*/
...
@@ -78,17 +82,30 @@ public class TbCfToiCouponEntity implements Serializable {
...
@@ -78,17 +82,30 @@ public class TbCfToiCouponEntity implements Serializable {
return
userId
;
return
userId
;
}
}
/**
/**
* 设置:创建时间
* 设置:开始时间
*/
public
void
setStartTime
(
Date
startTime
)
{
this
.
startTime
=
startTime
;
}
/**
* 获取:开始时间
*/
public
Date
getStartTime
()
{
return
startTime
;
}
/**
* 设置:结束时间
*/
*/
public
void
set
CreateTime
(
Date
create
Time
)
{
public
void
set
EndTime
(
Date
end
Time
)
{
this
.
createTime
=
create
Time
;
this
.
endTime
=
end
Time
;
}
}
/**
/**
* 获取:
创建
时间
* 获取:
结束
时间
*/
*/
public
Date
get
Create
Time
()
{
public
Date
get
End
Time
()
{
return
create
Time
;
return
end
Time
;
}
}
/**
/**
* 设置:标识(1发放,2领取,3注册)
* 设置:标识(1发放,2领取,3注册)
...
...
src/main/java/com/diaoyun/zion/chinafrica/service/TbCfToiCouponService.java
浏览文件 @
afedf0a1
...
@@ -3,7 +3,7 @@ package com.diaoyun.zion.chinafrica.service;
...
@@ -3,7 +3,7 @@ package com.diaoyun.zion.chinafrica.service;
import
com.diaoyun.zion.chinafrica.entity.CouponItem
;
import
com.diaoyun.zion.chinafrica.entity.CouponItem
;
import
com.diaoyun.zion.chinafrica.entity.TbCfCouponIssueEntity
;
import
com.diaoyun.zion.chinafrica.entity.TbCfCouponIssueEntity
;
import
com.diaoyun.zion.chinafrica.entity.TbCfToi
C
ouponEntity
;
import
com.diaoyun.zion.chinafrica.entity.TbCfToi
c
ouponEntity
;
import
com.diaoyun.zion.master.base.Result
;
import
com.diaoyun.zion.master.base.Result
;
import
java.util.List
;
import
java.util.List
;
...
@@ -22,10 +22,10 @@ public interface TbCfToiCouponService {
...
@@ -22,10 +22,10 @@ public interface TbCfToiCouponService {
/**
/**
* 根据主键查询实体
* 根据主键查询实体
*
*
* @param
id 主键
* @param
* @return 实体
* @return 实体
*/
*/
TbCfToi
C
ouponEntity
queryObject
(
String
toitableId
);
TbCfToi
c
ouponEntity
queryObject
(
String
toitableId
);
/**
/**
* 分页查询
* 分页查询
...
@@ -33,7 +33,7 @@ public interface TbCfToiCouponService {
...
@@ -33,7 +33,7 @@ public interface TbCfToiCouponService {
* @param map 参数
* @param map 参数
* @return list
* @return list
*/
*/
List
<
TbCfToi
C
ouponEntity
>
queryList
(
Map
<
String
,
Object
>
map
);
List
<
TbCfToi
c
ouponEntity
>
queryList
(
Map
<
String
,
Object
>
map
);
/**
/**
* 分页统计总数
* 分页统计总数
...
@@ -49,7 +49,7 @@ public interface TbCfToiCouponService {
...
@@ -49,7 +49,7 @@ public interface TbCfToiCouponService {
* @param tbCfToicoupon 实体
* @param tbCfToicoupon 实体
* @return 保存条数
* @return 保存条数
*/
*/
int
save
(
TbCfToi
C
ouponEntity
tbCfToicoupon
);
int
save
(
TbCfToi
c
ouponEntity
tbCfToicoupon
);
/**
/**
* 根据主键更新实体
* 根据主键更新实体
...
@@ -57,7 +57,7 @@ public interface TbCfToiCouponService {
...
@@ -57,7 +57,7 @@ public interface TbCfToiCouponService {
* @param tbCfToicoupon 实体
* @param tbCfToicoupon 实体
* @return 更新条数
* @return 更新条数
*/
*/
int
update
(
TbCfToi
C
ouponEntity
tbCfToicoupon
);
int
update
(
TbCfToi
c
ouponEntity
tbCfToicoupon
);
/**
/**
* 根据主键删除
* 根据主键删除
...
@@ -77,12 +77,11 @@ public interface TbCfToiCouponService {
...
@@ -77,12 +77,11 @@ public interface TbCfToiCouponService {
/**
/**
* 保存用户的优惠券
* 保存用户的优惠券
*
* @param tbCfCouponIssue
* @param tbCfCouponIssue
* @param tbCfToiCoupon
* @param tbCfToiCoupon
* @param userId
* @param userId
* @return
* @return
*/
*/
int
saveAndSubmit
(
TbCfCouponIssueEntity
tbCfCouponIssue
,
TbCfToiCouponEntity
tbCfToiCoupon
,
String
userId
);
int
saves
(
TbCfToiCouponEntity
toi
);
}
}
src/main/java/com/diaoyun/zion/chinafrica/service/impl/PayPalServiceImpl.java
浏览文件 @
afedf0a1
...
@@ -139,7 +139,7 @@ public class PayPalServiceImpl implements PayPalService {
...
@@ -139,7 +139,7 @@ public class PayPalServiceImpl implements PayPalService {
//修改订单状态
//修改订单状态
changeOrderState
(
paymentId
,
tbCfOrderVo
);
changeOrderState
(
paymentId
,
tbCfOrderVo
);
//修改优惠券状态
//修改优惠券状态
if
(
tbCfOrderVo
.
getCouponId
()
!=
null
&&
tbCfOrderVo
.
getPayStatus
()
==
20
)
{
if
(
tbCfOrderVo
.
getCouponId
()
!=
null
&&
"20"
.
equals
(
tbCfOrderVo
.
getPayStatus
())
)
{
tbCfToiCouponDao
.
changeCoupnStatus
(
tbCfOrderVo
.
getUserId
(),
tbCfOrderVo
.
getCouponId
());
tbCfToiCouponDao
.
changeCoupnStatus
(
tbCfOrderVo
.
getUserId
(),
tbCfOrderVo
.
getCouponId
());
}
}
//生成支付流水
//生成支付流水
...
...
src/main/java/com/diaoyun/zion/chinafrica/service/impl/TbCfToiCouponServiceImpl.java
浏览文件 @
afedf0a1
...
@@ -4,7 +4,8 @@ package com.diaoyun.zion.chinafrica.service.impl;
...
@@ -4,7 +4,8 @@ package com.diaoyun.zion.chinafrica.service.impl;
import
com.diaoyun.zion.chinafrica.dao.TbCfToiCouponDao
;
import
com.diaoyun.zion.chinafrica.dao.TbCfToiCouponDao
;
import
com.diaoyun.zion.chinafrica.entity.CouponItem
;
import
com.diaoyun.zion.chinafrica.entity.CouponItem
;
import
com.diaoyun.zion.chinafrica.entity.TbCfCouponIssueEntity
;
import
com.diaoyun.zion.chinafrica.entity.TbCfCouponIssueEntity
;
import
com.diaoyun.zion.chinafrica.entity.TbCfToiCouponEntity
;
import
com.diaoyun.zion.chinafrica.entity.TbCfToiCouponEntityExtends
;
import
com.diaoyun.zion.chinafrica.entity.TbCfToicouponEntity
;
import
com.diaoyun.zion.chinafrica.entity.TbCfToiCouponEntityExtends
;
import
com.diaoyun.zion.chinafrica.entity.TbCfToiCouponEntityExtends
;
import
com.diaoyun.zion.chinafrica.service.TbCfToiCouponService
;
import
com.diaoyun.zion.chinafrica.service.TbCfToiCouponService
;
import
com.diaoyun.zion.master.base.Result
;
import
com.diaoyun.zion.master.base.Result
;
...
@@ -36,12 +37,12 @@ public class TbCfToiCouponServiceImpl implements TbCfToiCouponService {
...
@@ -36,12 +37,12 @@ public class TbCfToiCouponServiceImpl implements TbCfToiCouponService {
}
}
@Override
@Override
public
TbCfToi
C
ouponEntity
queryObject
(
String
toitableId
)
{
public
TbCfToi
c
ouponEntity
queryObject
(
String
toitableId
)
{
return
tbCfToiCouponDao
.
queryObject
(
toitableId
);
return
tbCfToiCouponDao
.
queryObject
(
toitableId
);
}
}
@Override
@Override
public
List
<
TbCfToi
C
ouponEntity
>
queryList
(
Map
<
String
,
Object
>
map
)
{
public
List
<
TbCfToi
c
ouponEntity
>
queryList
(
Map
<
String
,
Object
>
map
)
{
return
tbCfToiCouponDao
.
queryList
(
map
);
return
tbCfToiCouponDao
.
queryList
(
map
);
}
}
...
@@ -51,18 +52,14 @@ public class TbCfToiCouponServiceImpl implements TbCfToiCouponService {
...
@@ -51,18 +52,14 @@ public class TbCfToiCouponServiceImpl implements TbCfToiCouponService {
}
}
@Override
@Override
public
int
save
(
TbCfToi
C
ouponEntity
tbCfToicoupon
)
{
public
int
save
(
TbCfToi
c
ouponEntity
tbCfToicoupon
)
{
tbCfToicoupon
.
setToitableId
(
IdUtil
.
createIdbyUUID
());
tbCfToicoupon
.
setToitableId
(
IdUtil
.
createIdbyUUID
());
return
tbCfToiCouponDao
.
save
(
tbCfToicoupon
);
return
tbCfToiCouponDao
.
save
(
tbCfToicoupon
);
}
}
@Override
public
int
saves
(
TbCfToiCouponEntity
toi
)
{
toi
.
setToitableId
(
IdUtil
.
createIdbyUUID
());
return
tbCfToiCouponDao
.
saves
(
toi
);
}
@Override
@Override
public
int
update
(
TbCfToi
C
ouponEntity
tbCfToicoupon
)
{
public
int
update
(
TbCfToi
c
ouponEntity
tbCfToicoupon
)
{
return
tbCfToiCouponDao
.
update
(
tbCfToicoupon
);
return
tbCfToiCouponDao
.
update
(
tbCfToicoupon
);
}
}
...
@@ -76,14 +73,5 @@ public class TbCfToiCouponServiceImpl implements TbCfToiCouponService {
...
@@ -76,14 +73,5 @@ public class TbCfToiCouponServiceImpl implements TbCfToiCouponService {
return
tbCfToiCouponDao
.
deleteBatch
(
toitableIds
);
return
tbCfToiCouponDao
.
deleteBatch
(
toitableIds
);
}
}
@Override
public
int
saveAndSubmit
(
TbCfCouponIssueEntity
tbCfCouponIssue
,
TbCfToiCouponEntity
tbCfToiCoupon
,
String
userId
)
{
tbCfToiCoupon
.
setToitableId
(
IdUtil
.
createIdbyUUID
());
tbCfToiCoupon
.
setCouponId
(
tbCfCouponIssue
.
getCouponId
());
tbCfToiCoupon
.
setUserId
(
userId
);
tbCfToiCoupon
.
setCreateTime
(
new
Date
());
tbCfToiCoupon
.
setIdentification
(
1
);
tbCfToiCoupon
.
setEnableFlag
(
1
);
return
tbCfToiCouponDao
.
saveAndSubmit
(
tbCfToiCoupon
);
}
}
}
src/main/java/com/diaoyun/zion/chinafrica/service/impl/TbCfUserInfoServiceImpl.java
浏览文件 @
afedf0a1
...
@@ -3,9 +3,10 @@ package com.diaoyun.zion.chinafrica.service.impl;
...
@@ -3,9 +3,10 @@ package com.diaoyun.zion.chinafrica.service.impl;
import
com.diaoyun.zion.chinafrica.constant.EmailTemplateConstant
;
import
com.diaoyun.zion.chinafrica.constant.EmailTemplateConstant
;
import
com.diaoyun.zion.chinafrica.constant.KeyConstant
;
import
com.diaoyun.zion.chinafrica.constant.KeyConstant
;
import
com.diaoyun.zion.chinafrica.dao.TbCfCouponDao
;
import
com.diaoyun.zion.chinafrica.dao.TbCfCouponDao
;
import
com.diaoyun.zion.chinafrica.dao.TbCfToiCouponDao
;
import
com.diaoyun.zion.chinafrica.dao.TbCfUserInfoDao
;
import
com.diaoyun.zion.chinafrica.dao.TbCfUserInfoDao
;
import
com.diaoyun.zion.chinafrica.entity.TbCfCouponEntity
;
import
com.diaoyun.zion.chinafrica.entity.TbCfCouponEntity
;
import
com.diaoyun.zion.chinafrica.entity.TbCfToi
C
ouponEntity
;
import
com.diaoyun.zion.chinafrica.entity.TbCfToi
c
ouponEntity
;
import
com.diaoyun.zion.chinafrica.entity.TbCfUserInfoEntity
;
import
com.diaoyun.zion.chinafrica.entity.TbCfUserInfoEntity
;
import
com.diaoyun.zion.chinafrica.service.TbCfCouponService
;
import
com.diaoyun.zion.chinafrica.service.TbCfCouponService
;
import
com.diaoyun.zion.chinafrica.service.TbCfIssueCouponService
;
import
com.diaoyun.zion.chinafrica.service.TbCfIssueCouponService
;
...
@@ -72,11 +73,6 @@ public class TbCfUserInfoServiceImpl implements TbCfUserInfoService {
...
@@ -72,11 +73,6 @@ public class TbCfUserInfoServiceImpl implements TbCfUserInfoService {
@Autowired
@Autowired
private
JwtTokenProvider
jwtTokenProvider
;
private
JwtTokenProvider
jwtTokenProvider
;
@Autowired
private
TbCfIssueCouponService
tbCfIssueCouponService
;
@Autowired
private
TbCfToiCouponService
tbCfToiCouponService
;
@Autowired
@Autowired
private
AuthenticationManager
authenticationManager
;
private
AuthenticationManager
authenticationManager
;
...
@@ -99,6 +95,9 @@ public class TbCfUserInfoServiceImpl implements TbCfUserInfoService {
...
@@ -99,6 +95,9 @@ public class TbCfUserInfoServiceImpl implements TbCfUserInfoService {
@Autowired
@Autowired
private
RedisCache
<
Object
>
captchaRedisCache
;
private
RedisCache
<
Object
>
captchaRedisCache
;
@Autowired
private
TbCfToiCouponDao
tbCfToiCouponDao
;
@Override
@Override
public
TbCfUserInfoEntity
queryObject
(
String
userId
)
{
public
TbCfUserInfoEntity
queryObject
(
String
userId
)
{
...
@@ -179,36 +178,27 @@ public class TbCfUserInfoServiceImpl implements TbCfUserInfoService {
...
@@ -179,36 +178,27 @@ public class TbCfUserInfoServiceImpl implements TbCfUserInfoService {
tbCfUserInfoVo
.
setPassword
(
password
);
tbCfUserInfoVo
.
setPassword
(
password
);
BeanUtils
.
copyProperties
(
tbCfUserInfoVo
,
tbCfUserInfoEntity
);
BeanUtils
.
copyProperties
(
tbCfUserInfoVo
,
tbCfUserInfoEntity
);
tbCfUserInfoDao
.
save
(
tbCfUserInfoEntity
);
tbCfUserInfoDao
.
save
(
tbCfUserInfoEntity
);
//赠送用户优惠券
tbCfIssueCouponService
//赠送用户优惠券
List
<
TbCfCouponEntity
>
couponVailList
=
tbCfCouponService
.
getCouponAndVaildAll
();
List
<
TbCfCouponEntity
>
couponVailList
=
tbCfCouponService
.
getCouponAndVaildAll
();
for
(
int
i
=
0
;
i
<
couponVailList
.
size
();
i
++)
{
//获取当前时间的时分秒
TbCfCouponEntity
TbCfCoupon
=
new
TbCfCouponEntity
();
SimpleDateFormat
sdf
=
new
SimpleDateFormat
(
"yyyy-MM-dd 00:00:00"
);
//设置日期格式
SimpleDateFormat
sdf
=
new
SimpleDateFormat
(
"yyyy-MM-dd 00:00:00"
);
//设置日期格式
Calendar
c
=
Calendar
.
getInstance
();
Calendar
c
=
Calendar
.
getInstance
();
c
.
add
(
Calendar
.
DATE
,
+
7
);
c
.
add
(
Calendar
.
DATE
,
+
7
);
Date
time
=
c
.
getTime
();
Date
time
=
c
.
getTime
();
Date
startDate
=
sdf
.
parse
(
sdf
.
format
(
new
Date
()));
Date
startDate
=
sdf
.
parse
(
sdf
.
format
(
new
Date
()));
Date
endDate
=
sdf
.
parse
(
sdf
.
format
(
time
));
Date
endDate
=
sdf
.
parse
(
sdf
.
format
(
time
));
TbCfCoupon
.
setCouponId
(
couponVailList
.
get
(
i
).
getCouponId
());
TbCfCoupon
.
setStatus
(
1
);
TbCfCoupon
.
setCouponVaild
(
1
);
TbCfCoupon
.
setValidStartTime
(
startDate
);
TbCfCoupon
.
setValidEndTime
(
endDate
);
tbCfCouponService
.
updates
(
TbCfCoupon
);
}
//获取当前时间的时分秒
SimpleDateFormat
df
=
new
SimpleDateFormat
(
"yyyy-MM-dd HH:mm:ss"
);
//设置日期格式
String
date
=
df
.
format
(
new
Date
());
for
(
int
i
=
0
;
i
<
couponVailList
.
size
();
i
++)
{
for
(
int
i
=
0
;
i
<
couponVailList
.
size
();
i
++)
{
TbCfToi
CouponEntity
toi
=
new
TbCfToiC
ouponEntity
();
TbCfToi
couponEntity
toi
=
new
TbCfToic
ouponEntity
();
String
coupon_id
=
couponVailList
.
get
(
i
).
getCouponId
();
String
coupon_id
=
couponVailList
.
get
(
i
).
getCouponId
();
//把上面获取到的值,赋值到实体类中
//把上面获取到的值,赋值到实体类中
toi
.
setToitableId
(
IdUtil
.
createIdbyUUID
());
toi
.
setCouponId
(
coupon_id
);
toi
.
setCouponId
(
coupon_id
);
toi
.
setUserId
(
userid
);
toi
.
setUserId
(
userid
);
toi
.
set
CreateTime
(
df
.
parse
(
date
)
);
toi
.
set
StartTime
(
startDate
);
toi
.
setIdentification
(
3
);
toi
.
setIdentification
(
3
);
toi
.
setEnableFlag
(
1
);
toi
.
setEnableFlag
(
1
);
tbCfToiCouponService
.
saves
(
toi
);
toi
.
setEndTime
(
endDate
);
tbCfToiCouponDao
.
save
(
toi
);
}
}
//注册成功 创建token
//注册成功 创建token
String
token
=
jwtTokenProvider
.
createToken
(
tbCfUserInfoVo
.
getAccount
());
String
token
=
jwtTokenProvider
.
createToken
(
tbCfUserInfoVo
.
getAccount
());
...
@@ -262,34 +252,24 @@ public class TbCfUserInfoServiceImpl implements TbCfUserInfoService {
...
@@ -262,34 +252,24 @@ public class TbCfUserInfoServiceImpl implements TbCfUserInfoService {
BeanUtils
.
copyProperties
(
tbCfUserInfoVo
,
tbCfUserInfoEntity
);
BeanUtils
.
copyProperties
(
tbCfUserInfoVo
,
tbCfUserInfoEntity
);
tbCfUserInfoDao
.
save
(
tbCfUserInfoEntity
);
tbCfUserInfoDao
.
save
(
tbCfUserInfoEntity
);
List
<
TbCfCouponEntity
>
couponVailList
=
tbCfCouponService
.
getCouponAndVaildAll
();
List
<
TbCfCouponEntity
>
couponVailList
=
tbCfCouponService
.
getCouponAndVaildAll
();
for
(
int
i
=
0
;
i
<
couponVailList
.
size
();
i
++)
{
TbCfCouponEntity
TbCfCoupon
=
new
TbCfCouponEntity
();
SimpleDateFormat
sdf
=
new
SimpleDateFormat
(
"yyyy-MM-dd 00:00:00"
);
//设置日期格式
SimpleDateFormat
sdf
=
new
SimpleDateFormat
(
"yyyy-MM-dd 00:00:00"
);
//设置日期格式
Calendar
c
=
Calendar
.
getInstance
();
Calendar
c
=
Calendar
.
getInstance
();
c
.
add
(
Calendar
.
DATE
,
+
7
);
c
.
add
(
Calendar
.
DATE
,
+
7
);
Date
time
=
c
.
getTime
();
Date
time
=
c
.
getTime
();
Date
startDate
=
sdf
.
parse
(
sdf
.
format
(
new
Date
()));
Date
startDate
=
sdf
.
parse
(
sdf
.
format
(
new
Date
()));
Date
endDate
=
sdf
.
parse
(
sdf
.
format
(
time
));
Date
endDate
=
sdf
.
parse
(
sdf
.
format
(
time
));
TbCfCoupon
.
setCouponId
(
couponVailList
.
get
(
i
).
getCouponId
());
TbCfCoupon
.
setStatus
(
1
);
TbCfCoupon
.
setCouponVaild
(
1
);
TbCfCoupon
.
setValidStartTime
(
startDate
);
TbCfCoupon
.
setValidEndTime
(
endDate
);
tbCfCouponService
.
updates
(
TbCfCoupon
);
}
//获取当前时间的时分秒
SimpleDateFormat
df
=
new
SimpleDateFormat
(
"yyyy-MM-dd HH:mm:ss"
);
//设置日期格式
String
date
=
df
.
format
(
new
Date
());
for
(
int
i
=
0
;
i
<
couponVailList
.
size
();
i
++)
{
for
(
int
i
=
0
;
i
<
couponVailList
.
size
();
i
++)
{
TbCfToi
CouponEntity
toi
=
new
TbCfToiC
ouponEntity
();
TbCfToi
couponEntity
toi
=
new
TbCfToic
ouponEntity
();
String
coupon_id
=
couponVailList
.
get
(
i
).
getCouponId
();
String
coupon_id
=
couponVailList
.
get
(
i
).
getCouponId
();
//把上面获取到的值,赋值到实体类中
//把上面获取到的值,赋值到实体类中
toi
.
setToitableId
(
IdUtil
.
createIdbyUUID
());
toi
.
setCouponId
(
coupon_id
);
toi
.
setCouponId
(
coupon_id
);
toi
.
setUserId
(
userid
);
toi
.
setUserId
(
userid
);
toi
.
setCreateTime
(
df
.
parse
(
date
));
toi
.
setStartTime
(
startDate
);
toi
.
setEndTime
(
endDate
);
toi
.
setIdentification
(
3
);
toi
.
setIdentification
(
3
);
toi
.
setEnableFlag
(
1
);
toi
.
setEnableFlag
(
1
);
tbCfToiCoupon
Service
.
saves
(
toi
);
tbCfToiCoupon
Dao
.
save
(
toi
);
}
}
//注册成功 创建token
//注册成功 创建token
String
token
=
jwtTokenProvider
.
createToken
(
tbCfUserInfoVo
.
getAccount
());
String
token
=
jwtTokenProvider
.
createToken
(
tbCfUserInfoVo
.
getAccount
());
...
@@ -390,6 +370,7 @@ public class TbCfUserInfoServiceImpl implements TbCfUserInfoService {
...
@@ -390,6 +370,7 @@ public class TbCfUserInfoServiceImpl implements TbCfUserInfoService {
TbCfUserInfoEntity
tbCfUserInfoEntity
=
tbCfUserInfoDao
.
findAccount
(
account
);
TbCfUserInfoEntity
tbCfUserInfoEntity
=
tbCfUserInfoDao
.
findAccount
(
account
);
return
tbCfUserInfoEntity
;
return
tbCfUserInfoEntity
;
}
}
@Override
@Override
public
Result
updatePassWord
(
String
newPassword
,
String
oldPassword
)
{
public
Result
updatePassWord
(
String
newPassword
,
String
oldPassword
)
{
Result
result
=
new
Result
();
Result
result
=
new
Result
();
...
@@ -536,6 +517,7 @@ public class TbCfUserInfoServiceImpl implements TbCfUserInfoService {
...
@@ -536,6 +517,7 @@ public class TbCfUserInfoServiceImpl implements TbCfUserInfoService {
}
}
return
result
;
return
result
;
}
}
@Override
@Override
public
Result
<
TbCfUserInfoVo
>
getUserInfo
()
{
public
Result
<
TbCfUserInfoVo
>
getUserInfo
()
{
String
token
=
jwtTokenProvider
.
resolveToken
(
request
);
String
token
=
jwtTokenProvider
.
resolveToken
(
request
);
...
...
src/main/resources/mapper/TbCfCouponDao.xml
浏览文件 @
afedf0a1
...
@@ -199,24 +199,24 @@
...
@@ -199,24 +199,24 @@
<update
id=
"update"
parameterType=
"com.diaoyun.zion.chinafrica.entity.TbCfCouponEntity"
>
<update
id=
"update"
parameterType=
"com.diaoyun.zion.chinafrica.entity.TbCfCouponEntity"
>
update tb_cf_coupon
update tb_cf_coupon
<set>
<set>
<if
test=
"couponCategoryId != null"
>
`coupon_category_id` = #{couponCategoryId},
</if>
<if
test=
"couponCategoryId != null"
>
`coupon_category_id` = #{couponCategoryId},
</if>
<if
test=
"couponUse != null"
>
`coupon_use` = #{couponUse},
</if>
<if
test=
"couponUse != null"
>
`coupon_use` = #{couponUse},
</if>
<if
test=
"couponTitle != null"
>
`coupon_title` = #{couponTitle},
</if>
<if
test=
"couponTitle != null"
>
`coupon_title` = #{couponTitle},
</if>
<if
test=
"couponIcon != null"
>
`coupon_icon` = #{couponIcon},
</if>
<if
test=
"couponIcon != null"
>
`coupon_icon` = #{couponIcon},
</if>
<if
test=
"withStationId != null"
>
`with_station_id` = #{withStationId},
</if>
<if
test=
"withStationId != null"
>
`with_station_id` = #{withStationId},
</if>
<if
test=
"withAmount != null"
>
`with_amount` = #{withAmount},
</if>
<if
test=
"withAmount != null"
>
`with_amount` = #{withAmount},
</if>
<if
test=
"deductAmount != null"
>
`deduct_amount` = #{deductAmount},
</if>
<if
test=
"deductAmount != null"
>
`deduct_amount` = #{deductAmount},
</if>
<if
test=
"quato != null"
>
`quato` = #{quato},
</if>
<if
test=
"quato != null"
>
`quato` = #{quato},
</if>
<if
test=
"takeCount != null"
>
`take_count` = #{takeCount},
</if>
<if
test=
"takeCount != null"
>
`take_count` = #{takeCount},
</if>
<if
test=
"usedCount != null"
>
`used_count` = #{usedCount},
</if>
<if
test=
"usedCount != null"
>
`used_count` = #{usedCount},
</if>
<if
test=
"startTime != null"
>
`start_time` = #{startTime},
</if>
<if
test=
"startTime != null"
>
`start_time` = #{startTime},
</if>
<if
test=
"endTime != null"
>
`end_time` = #{endTime},
</if>
<if
test=
"endTime != null"
>
`end_time` = #{endTime},
</if>
<if
test=
"validStartTime != null"
>
`valid_start_time` = #{validStartTime},
</if>
<if
test=
"validStartTime != null"
>
`valid_start_time` = #{validStartTime},
</if>
<if
test=
"validEndTime != null"
>
`valid_end_time` = #{validEndTime},
</if>
<if
test=
"validEndTime != null"
>
`valid_end_time` = #{validEndTime},
</if>
<if
test=
"status != null"
>
`status` = #{status},
</if>
<if
test=
"status != null"
>
`status` = #{status},
</if>
<if
test=
"createUserId != null"
>
`create_user_id` = #{createUserId},
</if>
<if
test=
"createUserId != null"
>
`create_user_id` = #{createUserId},
</if>
<if
test=
"createTime != null"
>
`create_time` = #{createTime},
</if>
<if
test=
"createTime != null"
>
`create_time` = #{createTime},
</if>
<if
test=
"updateUserId != null"
>
`update_user_id` = #{updateUserId},
</if>
<if
test=
"updateUserId != null"
>
`update_user_id` = #{updateUserId},
</if>
<if
test=
"updateTime != null"
>
`update_time` = #{updateTime}
</if>
<if
test=
"updateTime != null"
>
`update_time` = #{updateTime}
</if>
<if
test=
"couponVaild != null"
>
`coupon_vaild` = #{couponVaild}
</if>
<if
test=
"couponVaild != null"
>
`coupon_vaild` = #{couponVaild}
</if>
</set>
</set>
...
@@ -226,24 +226,24 @@
...
@@ -226,24 +226,24 @@
<update
id=
"updates"
parameterType=
"com.diaoyun.zion.chinafrica.entity.TbCfCouponEntity"
>
<update
id=
"updates"
parameterType=
"com.diaoyun.zion.chinafrica.entity.TbCfCouponEntity"
>
update tb_cf_coupon
update tb_cf_coupon
<set>
<set>
<if
test=
"couponCategoryId != null"
>
`coupon_category_id` = #{couponCategoryId},
</if>
<if
test=
"couponCategoryId != null"
>
`coupon_category_id` = #{couponCategoryId},
</if>
<if
test=
"couponUse != null"
>
`coupon_use` = #{couponUse},
</if>
<if
test=
"couponUse != null"
>
`coupon_use` = #{couponUse},
</if>
<if
test=
"couponTitle != null"
>
`coupon_title` = #{couponTitle},
</if>
<if
test=
"couponTitle != null"
>
`coupon_title` = #{couponTitle},
</if>
<if
test=
"couponIcon != null"
>
`coupon_icon` = #{couponIcon},
</if>
<if
test=
"couponIcon != null"
>
`coupon_icon` = #{couponIcon},
</if>
<if
test=
"withStationId != null"
>
`with_station_id` = #{withStationId},
</if>
<if
test=
"withStationId != null"
>
`with_station_id` = #{withStationId},
</if>
<if
test=
"withAmount != null"
>
`with_amount` = #{withAmount},
</if>
<if
test=
"withAmount != null"
>
`with_amount` = #{withAmount},
</if>
<if
test=
"deductAmount != null"
>
`deduct_amount` = #{deductAmount},
</if>
<if
test=
"deductAmount != null"
>
`deduct_amount` = #{deductAmount},
</if>
<if
test=
"quato != null"
>
`quato` = #{quato},
</if>
<if
test=
"quato != null"
>
`quato` = #{quato},
</if>
<if
test=
"takeCount != null"
>
`take_count` = #{takeCount},
</if>
<if
test=
"takeCount != null"
>
`take_count` = #{takeCount},
</if>
<if
test=
"usedCount != null"
>
`used_count` = #{usedCount},
</if>
<if
test=
"usedCount != null"
>
`used_count` = #{usedCount},
</if>
<if
test=
"startTime != null"
>
`start_time` = #{startTime},
</if>
<if
test=
"startTime != null"
>
`start_time` = #{startTime},
</if>
<if
test=
"endTime != null"
>
`end_time` = #{endTime},
</if>
<if
test=
"endTime != null"
>
`end_time` = #{endTime},
</if>
<if
test=
"validStartTime != null"
>
`valid_start_time` = #{validStartTime},
</if>
<if
test=
"validStartTime != null"
>
`valid_start_time` = #{validStartTime},
</if>
<if
test=
"validEndTime != null"
>
`valid_end_time` = #{validEndTime},
</if>
<if
test=
"validEndTime != null"
>
`valid_end_time` = #{validEndTime},
</if>
<if
test=
"status != null"
>
`status` = #{status},
</if>
<if
test=
"status != null"
>
`status` = #{status},
</if>
<if
test=
"createUserId != null"
>
`create_user_id` = #{createUserId},
</if>
<if
test=
"createUserId != null"
>
`create_user_id` = #{createUserId},
</if>
<if
test=
"createTime != null"
>
`create_time` = #{createTime},
</if>
<if
test=
"createTime != null"
>
`create_time` = #{createTime},
</if>
<if
test=
"updateUserId != null"
>
`update_user_id` = #{updateUserId},
</if>
<if
test=
"updateUserId != null"
>
`update_user_id` = #{updateUserId},
</if>
<if
test=
"updateTime != null"
>
`update_time` = #{updateTime}
</if>
<if
test=
"updateTime != null"
>
`update_time` = #{updateTime}
</if>
<if
test=
"couponVaild != null"
>
`coupon_vaild` = #{couponVaild}
</if>
<if
test=
"couponVaild != null"
>
`coupon_vaild` = #{couponVaild}
</if>
</set>
</set>
...
@@ -289,7 +289,7 @@
...
@@ -289,7 +289,7 @@
t2.coupon_vaild
t2.coupon_vaild
from tb_cf_coupon t2 left join tb_cf_toicoupon t3 on t3.coupon_id=t2.coupon_id
from tb_cf_coupon t2 left join tb_cf_toicoupon t3 on t3.coupon_id=t2.coupon_id
where t3.user_id=#{userId} and t3.enable_flag=1 and t2.status=1
where t3.user_id=#{userId} and t3.enable_flag=1 and t2.status=1
and (
<![CDATA[ t
2.valid_start_time<=#{nowTime}]]>
and
<![CDATA[t2.valid_
end_time>=#{nowTime}]]>
)
and (
<![CDATA[ t
3.start_time<=#{nowTime}]]>
and
<![CDATA[t3.
end_time>=#{nowTime}]]>
)
</select>
</select>
...
@@ -353,7 +353,7 @@
...
@@ -353,7 +353,7 @@
t2.update_time,
t2.update_time,
t2.coupon_vaild
t2.coupon_vaild
from tb_cf_coupon t2 left join tb_cf_toicoupon t3 on t3.coupon_id=t2.coupon_id
from tb_cf_coupon t2 left join tb_cf_toicoupon t3 on t3.coupon_id=t2.coupon_id
where t3.user_id=#{userId} and
<![CDATA[ t
2.valid_
end_time<#{nowTime}]]>
and t3.enable_flag=1
where t3.user_id=#{userId} and
<![CDATA[ t
3.
end_time<#{nowTime}]]>
and t3.enable_flag=1
</select>
</select>
<select
id=
"getCouponAndVaildAll"
resultType=
"com.diaoyun.zion.chinafrica.entity.TbCfCouponEntity"
>
<select
id=
"getCouponAndVaildAll"
resultType=
"com.diaoyun.zion.chinafrica.entity.TbCfCouponEntity"
>
...
...
src/main/resources/mapper/TbCfToiCouponDao.xml
浏览文件 @
afedf0a1
...
@@ -3,33 +3,36 @@
...
@@ -3,33 +3,36 @@
<mapper
namespace=
"com.diaoyun.zion.chinafrica.dao.TbCfToiCouponDao"
>
<mapper
namespace=
"com.diaoyun.zion.chinafrica.dao.TbCfToiCouponDao"
>
<resultMap
type=
"com.diaoyun.zion.chinafrica.entity.TbCfToi
C
ouponEntity"
id=
"tbCfToiCouponMap"
>
<resultMap
type=
"com.diaoyun.zion.chinafrica.entity.TbCfToi
c
ouponEntity"
id=
"tbCfToiCouponMap"
>
<result
property=
"toitableId"
column=
"toitable_id"
/>
<result
property=
"toitableId"
column=
"toitable_id"
/>
<result
property=
"couponId"
column=
"coupon_id"
/>
<result
property=
"couponId"
column=
"coupon_id"
/>
<result
property=
"userId"
column=
"user_id"
/>
<result
property=
"userId"
column=
"user_id"
/>
<result
property=
"createTime"
column=
"create_time"
/>
<result
property=
"startTime"
column=
"start_time"
/>
<result
property=
"endTime"
column=
"end_time"
/>
<result
property=
"identification"
column=
"identification"
/>
<result
property=
"identification"
column=
"identification"
/>
<result
property=
"enableFlag"
column=
"enable_flag"
/>
<result
property=
"enableFlag"
column=
"enable_flag"
/>
</resultMap>
</resultMap>
<select
id=
"queryObject"
resultType=
"com.diaoyun.zion.chinafrica.entity.TbCfToiC
ouponEntity"
>
<select
id=
"queryObject"
resultType=
"com.diaoyun.zion.chinafrica.entity.TbCfToic
ouponEntity"
>
select
select
`toitable_id`,
`toitable_id`,
`coupon_id`,
`coupon_id`,
`user_id`,
`user_id`,
`create_time`,
`start_time`,
`end_time`,
`identification`,
`identification`,
`enable_flag`
`enable_flag`
from tb_cf_toicoupon
from tb_cf_toicoupon
where toitable_id = #{id}
where toitable_id = #{id}
</select>
</select>
<select
id=
"queryList"
resultType=
"com.diaoyun.zion.chinafrica.entity.TbCfToiC
ouponEntity"
>
<select
id=
"queryList"
resultType=
"com.diaoyun.zion.chinafrica.entity.TbCfToic
ouponEntity"
>
select
select
`toitable_id`,
`toitable_id`,
`coupon_id`,
`coupon_id`,
`user_id`,
`user_id`,
`create_time`,
`start_time`,
`end_time`,
`identification`,
`identification`,
`enable_flag`
`enable_flag`
from tb_cf_toicoupon
from tb_cf_toicoupon
...
@@ -75,71 +78,42 @@
...
@@ -75,71 +78,42 @@
a.enable_flag
a.enable_flag
from tb_cf_toicoupon a LEFT join tb_cf_coupon b ON a.coupon_id=b.coupon_id
from tb_cf_toicoupon a LEFT join tb_cf_coupon b ON a.coupon_id=b.coupon_id
WHERE a.user_id = #{userId} and a.enable_flag=1 and b.status=1
WHERE a.user_id = #{userId} and a.enable_flag=1 and b.status=1
</select>
</select>
<!--修改优惠券为已使用-->
<!--修改优惠券为已使用-->
<update
id=
"changeCoupnStatus"
parameterType=
"com.diaoyun.zion.chinafrica.entity.TbCfToiC
ouponEntity"
>
<update
id=
"changeCoupnStatus"
parameterType=
"com.diaoyun.zion.chinafrica.entity.TbCfToic
ouponEntity"
>
update tb_cf_toicoupon t set enable_flag = 0 where t.user_id=#{userId} and t.coupon_id=#{couponId}
update tb_cf_toicoupon t set enable_flag = 0 where t.user_id=#{userId} and t.coupon_id=#{couponId}
</update>
</update>
<!--修改优惠券领取发放记录-->
<!--修改优惠券领取发放记录-->
<update
id=
"updateEnableFlag"
>
<update
id=
"updateEnableFlag"
>
update tb_cf_toicoupon set enable_flag=#{enableFlag} where user_id=#{userId} and coupon_id=#{couponId}
update tb_cf_toicoupon set enable_flag=#{enableFlag} where user_id=#{userId} and coupon_id=#{couponId}
</update>
</update>
<insert
id=
"save"
parameterType=
"com.diaoyun.zion.chinafrica.entity.TbCfToiCouponEntity"
>
<insert
id=
"save"
parameterType=
"com.diaoyun.zion.chinafrica.entity.TbCfToicouponEntity"
>
insert into tb_cf_toicoupon(
`toitable_id`,
`coupon_id`,
`user_id`,
`create_time`,
`identification`,
`enable_flag`)
values(
#{toitableId},
#{couponId},
#{userId},
#{createTime},
#{identification},
#{enableFlag})
</insert>
<insert
id=
"saves"
parameterType=
"com.diaoyun.zion.chinafrica.entity.TbCfToiCouponEntity"
>
insert into tb_cf_toicoupon(
insert into tb_cf_toicoupon(
`toitable_id`,
`toitable_id`,
`coupon_id`,
`coupon_id`,
`user_id`,
`user_id`,
`create_time`,
`start_time`,
`end_time`,
`identification`,
`identification`,
`enable_flag`)
`enable_flag`)
values(
values(
#{toitableId},
#{toitableId},
#{couponId},
#{couponId},
#{userId},
#{userId},
#{createTime},
#{startTime},
#{endTime},
#{identification},
#{identification},
#{enableFlag})
#{enableFlag})
</insert>
</insert>
<insert
id=
"saveAndSubmit"
parameterType=
"com.diaoyun.zion.chinafrica.entity.TbCfToiCouponEntity"
>
insert into tb_cf_toicoupon(
<update
id=
"update"
parameterType=
"com.diaoyun.zion.chinafrica.entity.TbCfToicouponEntity"
>
`toitable_id`,
`coupon_id`,
`user_id`,
`create_time`,
`identification`,
`enable_flag`)
values(
#{toitableId},
#{couponId},
#{userId},
#{createTime},
#{identification},
#{enableFlag})
</insert>
<update
id=
"update"
parameterType=
"com.diaoyun.zion.chinafrica.entity.TbCfToiCouponEntity"
>
update tb_cf_toicoupon
update tb_cf_toicoupon
<set>
<set>
<if
test=
"couponId != null"
>
`coupon_id` = #{couponId},
</if>
<if
test=
"couponId != null"
>
`coupon_id` = #{couponId},
</if>
<if
test=
"userId != null"
>
`user_id` = #{userId},
</if>
<if
test=
"userId != null"
>
`user_id` = #{userId},
</if>
<if
test=
"createTime != null"
>
`create_time` = #{createTime},
</if>
<if
test=
"startTime != null"
>
`start_time` = #{startTime},
</if>
<if
test=
"identification != null"
>
`identification` = #{identification},
</if>
<if
test=
"endTime != null"
>
`end_time` = #{endTime},
</if>
<if
test=
"identification != null"
>
`identification` = #{identification},
</if>
<if
test=
"enableFlag != null"
>
`enable_flag` = #{enableFlag}
</if>
<if
test=
"enableFlag != null"
>
`enable_flag` = #{enableFlag}
</if>
</set>
</set>
where toitable_id = #{toitableId}
where toitable_id = #{toitableId}
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论