记得上下班打卡 | git大法好,push需谨慎
Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
L
liquidnet-bus-v1
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
董敬伟
liquidnet-bus-v1
Commits
58b99874
Commit
58b99874
authored
Sep 13, 2022
by
Administrator
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'pre' into 'master'
Pre See merge request
!314
parents
341ec8d2
a8fc233b
Changes
23
Hide whitespace changes
Inline
Side-by-side
Showing
23 changed files
with
363 additions
and
71 deletions
+363
-71
20210927_member_voucher_refund.sql
docu/20210927_member_voucher_refund.sql
+2
-2
AdamMemberOrderVo.java
.../com/liquidnet/service/adam/dto/vo/AdamMemberOrderVo.java
+2
-0
CandyMgtCouponBuildParam.java
...net/service/candy/dto/admin/CandyMgtCouponBuildParam.java
+1
-1
CandyMgtCouponAdminController.java
...troller/zhengzai/candy/CandyMgtCouponAdminController.java
+3
-0
add1.html
...n/resources/templates/zhengzai/candy/coupon/mgt/add1.html
+2
-2
add101.html
...resources/templates/zhengzai/candy/coupon/mgt/add101.html
+2
-2
add2.html
...n/resources/templates/zhengzai/candy/coupon/mgt/add2.html
+2
-2
add4.html
...n/resources/templates/zhengzai/candy/coupon/mgt/add4.html
+2
-2
detail1.html
...esources/templates/zhengzai/candy/coupon/mgt/detail1.html
+5
-1
detail101.html
...ources/templates/zhengzai/candy/coupon/mgt/detail101.html
+5
-1
detail2.html
...esources/templates/zhengzai/candy/coupon/mgt/detail2.html
+5
-1
detail4.html
...esources/templates/zhengzai/candy/coupon/mgt/detail4.html
+5
-1
CandyCommonCoupon.java
...com/liquidnet/service/candy/entity/CandyCommonCoupon.java
+1
-1
CandyUserCoupon.java
...a/com/liquidnet/service/candy/entity/CandyUserCoupon.java
+1
-1
db_ln_candy_initialdata.sql
...idnet-service-candy-impl/docu/db_ln_candy_initialdata.sql
+2
-2
CandyCouponServiceImpl.java
...et/service/candy/service/impl/CandyCouponServiceImpl.java
+1
-1
RedisDataUtils.java
...java/com/liquidnet/service/candy/util/RedisDataUtils.java
+27
-15
pom.xml
...ice-consumer-all/liquidnet-service-consumer-order/pom.xml
+26
-26
KylinOrderUtils.java
...quidnet/service/consumer/order/utils/KylinOrderUtils.java
+1
-1
PlatformTaskHandler.java
...et/service/executor/main/handler/PlatformTaskHandler.java
+28
-0
CandyCouponDueTaskController.java
...m/controller/candy/task/CandyCouponDueTaskController.java
+48
-6
PlatformCandyCommonCouponService.java
.../service/impl/candy/PlatformCandyCommonCouponService.java
+96
-0
PlatformCandyUserCouponService.java
...rm/service/impl/candy/PlatformCandyUserCouponService.java
+96
-3
No files found.
docu/20210927_member_voucher_refund.sql
View file @
58b99874
...
@@ -280,7 +280,7 @@ create table candy_user_coupon
...
@@ -280,7 +280,7 @@ create table candy_user_coupon
mcoupon_id
varchar
(
64
)
comment
'~candy_mgt_coupon.mcoupon_id'
,
mcoupon_id
varchar
(
64
)
comment
'~candy_mgt_coupon.mcoupon_id'
,
uid
varchar
(
64
)
not
null
comment
'~adam_user.uid'
,
uid
varchar
(
64
)
not
null
comment
'~adam_user.uid'
,
coupon_id
varchar
(
64
)
not
null
comment
'~candy_coupon.coupon_id'
,
coupon_id
varchar
(
64
)
not
null
comment
'~candy_coupon.coupon_id'
,
state
tinyint
comment
'用户券状态[1-可用|2-无效
|3-已过期|5-已使用
]'
,
state
tinyint
comment
'用户券状态[1-可用|2-无效
|3-已过期|5-已使用|9-移除不展示(过期或已使用)
]'
,
ccode
varchar
(
64
)
comment
'券码~candy_coupon_code.ccode'
,
ccode
varchar
(
64
)
comment
'券码~candy_coupon_code.ccode'
,
bind_at
datetime
(
3
)
comment
'激活时间'
,
bind_at
datetime
(
3
)
comment
'激活时间'
,
...
@@ -306,7 +306,7 @@ create table candy_common_coupon
...
@@ -306,7 +306,7 @@ create table candy_common_coupon
ccoupon_id
varchar
(
64
)
not
null
,
ccoupon_id
varchar
(
64
)
not
null
,
mcoupon_id
varchar
(
64
)
not
null
comment
'~candy_mgt_coupon.mcoupon_id'
,
mcoupon_id
varchar
(
64
)
not
null
comment
'~candy_mgt_coupon.mcoupon_id'
,
coupon_id
varchar
(
64
)
not
null
comment
'~candy_coupon.coupon_id'
,
coupon_id
varchar
(
64
)
not
null
comment
'~candy_coupon.coupon_id'
,
state
tinyint
comment
'公有券状态[1-可用|2-无效
|3-已过期
]'
,
state
tinyint
comment
'公有券状态[1-可用|2-无效
|3-已过期|9-移除不展示(过期)
]'
,
ranged
tinyint
comment
'公有券范围(~candy_mgt_coupon.event_type)'
,
ranged
tinyint
comment
'公有券范围(~candy_mgt_coupon.event_type)'
,
operator
varchar
(
64
)
not
null
comment
'操作人'
,
operator
varchar
(
64
)
not
null
comment
'操作人'
,
...
...
liquidnet-bus-api/liquidnet-service-adam-api/src/main/java/com/liquidnet/service/adam/dto/vo/AdamMemberOrderVo.java
View file @
58b99874
...
@@ -136,9 +136,11 @@ public class AdamMemberOrderVo implements Serializable, Cloneable {
...
@@ -136,9 +136,11 @@ public class AdamMemberOrderVo implements Serializable, Cloneable {
this
.
setState
(
source
.
getState
());
this
.
setState
(
source
.
getState
());
this
.
setMemberNo
(
source
.
getMemberNo
());
this
.
setMemberNo
(
source
.
getMemberNo
());
this
.
setBirthday
(
source
.
getBirthday
());
this
.
setBirthday
(
source
.
getBirthday
());
this
.
setArea
(
source
.
getArea
());
this
.
setDeviceFrom
(
source
.
getDeviceFrom
());
this
.
setDeviceFrom
(
source
.
getDeviceFrom
());
this
.
setPayType
(
source
.
getPayType
());
this
.
setPayType
(
source
.
getPayType
());
this
.
setPayNo
(
source
.
getPayNo
());
this
.
setPayNo
(
source
.
getPayNo
());
this
.
setPaymentId
(
source
.
getPaymentId
());
this
.
setPaymentAt
(
source
.
getPaymentAt
());
this
.
setPaymentAt
(
source
.
getPaymentAt
());
this
.
setCreatedAt
(
source
.
getCreatedAt
());
this
.
setCreatedAt
(
source
.
getCreatedAt
());
this
.
setUpdatedAt
(
source
.
getUpdatedAt
());
this
.
setUpdatedAt
(
source
.
getUpdatedAt
());
...
...
liquidnet-bus-api/liquidnet-service-candy-api/src/main/java/com/liquidnet/service/candy/dto/admin/CandyMgtCouponBuildParam.java
View file @
58b99874
...
@@ -72,7 +72,7 @@ public class CandyMgtCouponBuildParam {
...
@@ -72,7 +72,7 @@ public class CandyMgtCouponBuildParam {
@Min
(
value
=
1
,
message
=
"发放量不能小于1"
)
@Min
(
value
=
1
,
message
=
"发放量不能小于1"
)
@ApiModelProperty
(
required
=
true
,
value
=
"发放量"
,
example
=
"1"
)
@ApiModelProperty
(
required
=
true
,
value
=
"发放量"
,
example
=
"1"
)
private
Integer
eventAmt
;
private
Integer
eventAmt
;
@ApiModelProperty
(
required
=
false
,
value
=
"发放类型[0-保留
|1-会员|2-手机号|
10-全体用户]"
,
allowableValues
=
"0,1,2,10"
)
@ApiModelProperty
(
required
=
false
,
value
=
"发放类型[0-保留
|1-会员|2-手机号|
10-全体用户]"
,
allowableValues
=
"0,1,2,10"
)
private
Integer
eventType
;
private
Integer
eventType
;
@ApiModelProperty
(
required
=
false
,
value
=
"`发放类型`为2-手机号时发放手机号以,分隔"
,
example
=
"18510957291,17701223310"
)
@ApiModelProperty
(
required
=
false
,
value
=
"`发放类型`为2-手机号时发放手机号以,分隔"
,
example
=
"18510957291,17701223310"
)
private
String
eventLimit
;
private
String
eventLimit
;
...
...
liquidnet-bus-client/liquidnet-client-admin/liquidnet-client-admin-web/src/main/java/com/liquidnet/client/admin/web/controller/zhengzai/candy/CandyMgtCouponAdminController.java
View file @
58b99874
...
@@ -315,6 +315,9 @@ public class CandyMgtCouponAdminController extends BaseController {
...
@@ -315,6 +315,9 @@ public class CandyMgtCouponAdminController extends BaseController {
break
;
break
;
case
3
:
// 新增券领取类型(3-发放需领取)处理逻辑同(1-发放至用户)
case
3
:
// 新增券领取类型(3-发放需领取)处理逻辑同(1-发放至用户)
case
1
:
case
1
:
if
(!
Arrays
.
asList
(
1
,
2
,
10
).
contains
(
buildParam
.
getEventType
()))
{
return
AjaxResult
.
warn
(
"发送类型无效"
);
}
if
(
buildParam
.
getEventType
()
==
2
)
{
// 指定用户手机号
if
(
buildParam
.
getEventType
()
==
2
)
{
// 指定用户手机号
if
(
StringUtils
.
isBlank
(
buildParam
.
getEventLimit
()))
{
if
(
StringUtils
.
isBlank
(
buildParam
.
getEventLimit
()))
{
return
AjaxResult
.
warn
(
"请指定手机号"
);
return
AjaxResult
.
warn
(
"请指定手机号"
);
...
...
liquidnet-bus-client/liquidnet-client-admin/liquidnet-client-admin-web/src/main/resources/templates/zhengzai/candy/coupon/mgt/add1.html
View file @
58b99874
...
@@ -205,7 +205,7 @@
...
@@ -205,7 +205,7 @@
<span
class=
"labelName"
>
发送类型:
</span>
<span
class=
"labelName"
>
发送类型:
</span>
<div
class=
"layui-input-block"
style=
"display: flex"
>
<div
class=
"layui-input-block"
style=
"display: flex"
>
<!-- <input type="radio" value="10" class="sendType" name="sendType" checked><span>全体用户</span>-->
<!-- <input type="radio" value="10" class="sendType" name="sendType" checked><span>全体用户</span>-->
<input
type=
"radio"
value=
"1"
class=
"sendType"
name=
"sendType"
><span>
会员
</span>
<input
type=
"radio"
value=
"1"
class=
"sendType"
name=
"sendType"
checked
><span>
会员
</span>
<input
type=
"radio"
value=
"2"
class=
"sendType"
name=
"sendType"
><span>
手机号
</span>
<input
type=
"radio"
value=
"2"
class=
"sendType"
name=
"sendType"
><span>
手机号
</span>
</div>
</div>
</div>
</div>
...
@@ -254,7 +254,7 @@
...
@@ -254,7 +254,7 @@
let
prefix
=
ctx
;
let
prefix
=
ctx
;
let
typeOne
=
'0'
;
// 类别
let
typeOne
=
'0'
;
// 类别
let
typeTwo
=
'0'
;
// 类型
let
typeTwo
=
'0'
;
// 类型
let
sendType
=
'1
0
'
;
// 发送类型
let
sendType
=
'1'
;
// 发送类型
let
searchVal
=
''
;
// 输入框内数据
let
searchVal
=
''
;
// 输入框内数据
let
searchData
=
[];
// 搜索总数据
let
searchData
=
[];
// 搜索总数据
let
showId
=
''
;
// 选中演出id
let
showId
=
''
;
// 选中演出id
...
...
liquidnet-bus-client/liquidnet-client-admin/liquidnet-client-admin-web/src/main/resources/templates/zhengzai/candy/coupon/mgt/add101.html
View file @
58b99874
...
@@ -201,7 +201,7 @@
...
@@ -201,7 +201,7 @@
<span
class=
"labelName"
>
发送类型:
</span>
<span
class=
"labelName"
>
发送类型:
</span>
<div
class=
"layui-input-block"
style=
"display: flex"
>
<div
class=
"layui-input-block"
style=
"display: flex"
>
<!-- <input type="radio" value="10" class="sendType" name="sendType" checked><span>全体用户</span>-->
<!-- <input type="radio" value="10" class="sendType" name="sendType" checked><span>全体用户</span>-->
<input
type=
"radio"
value=
"1"
class=
"sendType"
name=
"sendType"
><span>
会员
</span>
<input
type=
"radio"
value=
"1"
class=
"sendType"
name=
"sendType"
checked
><span>
会员
</span>
<input
type=
"radio"
value=
"2"
class=
"sendType"
name=
"sendType"
><span>
手机号
</span>
<input
type=
"radio"
value=
"2"
class=
"sendType"
name=
"sendType"
><span>
手机号
</span>
</div>
</div>
</div>
</div>
...
@@ -249,7 +249,7 @@
...
@@ -249,7 +249,7 @@
let
prefix
=
ctx
;
let
prefix
=
ctx
;
let
typeOne
=
'3'
;
// 类别
let
typeOne
=
'3'
;
// 类别
let
typeTwo
=
'0'
;
// 类型
let
typeTwo
=
'0'
;
// 类型
let
sendType
=
'1
0
'
;
// 发送类型
let
sendType
=
'1'
;
// 发送类型
let
searchVal
=
''
;
// 输入框内数据
let
searchVal
=
''
;
// 输入框内数据
let
searchData
=
[];
// 搜索总数据
let
searchData
=
[];
// 搜索总数据
let
showId
=
''
;
// 选中演出id
let
showId
=
''
;
// 选中演出id
...
...
liquidnet-bus-client/liquidnet-client-admin/liquidnet-client-admin-web/src/main/resources/templates/zhengzai/candy/coupon/mgt/add2.html
View file @
58b99874
...
@@ -208,7 +208,7 @@
...
@@ -208,7 +208,7 @@
<span
class=
"labelName"
>
发送类型:
</span>
<span
class=
"labelName"
>
发送类型:
</span>
<div
class=
"layui-input-block"
style=
"display: flex"
>
<div
class=
"layui-input-block"
style=
"display: flex"
>
<!-- <input type="radio" value="10" class="sendType" name="sendType" checked><span>全体用户</span>-->
<!-- <input type="radio" value="10" class="sendType" name="sendType" checked><span>全体用户</span>-->
<input
type=
"radio"
value=
"1"
class=
"sendType"
name=
"sendType"
><span>
会员
</span>
<input
type=
"radio"
value=
"1"
class=
"sendType"
name=
"sendType"
checked
><span>
会员
</span>
<input
type=
"radio"
value=
"2"
class=
"sendType"
name=
"sendType"
><span>
手机号
</span>
<input
type=
"radio"
value=
"2"
class=
"sendType"
name=
"sendType"
><span>
手机号
</span>
</div>
</div>
</div>
</div>
...
@@ -257,7 +257,7 @@
...
@@ -257,7 +257,7 @@
let
prefix
=
ctx
;
let
prefix
=
ctx
;
let
typeOne
=
'0'
;
// 类别
let
typeOne
=
'0'
;
// 类别
let
typeTwo
=
'0'
;
// 类型
let
typeTwo
=
'0'
;
// 类型
let
sendType
=
'1
0
'
;
// 发送类型
let
sendType
=
'1'
;
// 发送类型
let
searchVal
=
''
;
// 输入框内数据
let
searchVal
=
''
;
// 输入框内数据
let
searchData
=
[];
// 搜索总数据
let
searchData
=
[];
// 搜索总数据
let
showId
=
''
;
// 选中演出id
let
showId
=
''
;
// 选中演出id
...
...
liquidnet-bus-client/liquidnet-client-admin/liquidnet-client-admin-web/src/main/resources/templates/zhengzai/candy/coupon/mgt/add4.html
View file @
58b99874
...
@@ -198,7 +198,7 @@
...
@@ -198,7 +198,7 @@
<span
class=
"labelName"
>
发送类型:
</span>
<span
class=
"labelName"
>
发送类型:
</span>
<div
class=
"layui-input-block"
style=
"display: flex"
>
<div
class=
"layui-input-block"
style=
"display: flex"
>
<!-- <input type="radio" value="10" class="sendType" name="sendType" checked><span>全体用户</span>-->
<!-- <input type="radio" value="10" class="sendType" name="sendType" checked><span>全体用户</span>-->
<input
type=
"radio"
value=
"1"
class=
"sendType"
name=
"sendType"
><span>
会员
</span>
<input
type=
"radio"
value=
"1"
class=
"sendType"
name=
"sendType"
checked
><span>
会员
</span>
<input
type=
"radio"
value=
"2"
class=
"sendType"
name=
"sendType"
><span>
手机号
</span>
<input
type=
"radio"
value=
"2"
class=
"sendType"
name=
"sendType"
><span>
手机号
</span>
</div>
</div>
</div>
</div>
...
@@ -230,7 +230,7 @@
...
@@ -230,7 +230,7 @@
let
prefix
=
ctx
;
let
prefix
=
ctx
;
let
typeOne
=
'2'
;
// 类别
let
typeOne
=
'2'
;
// 类别
let
typeTwo
=
'0'
;
// 类型
let
typeTwo
=
'0'
;
// 类型
let
sendType
=
'1
0
'
;
// 发送类型
let
sendType
=
'1'
;
// 发送类型
let
searchVal
=
''
;
// 输入框内数据
let
searchVal
=
''
;
// 输入框内数据
let
searchData
=
[];
// 搜索总数据
let
searchData
=
[];
// 搜索总数据
let
showId
=
''
;
// 选中演出id
let
showId
=
''
;
// 选中演出id
...
...
liquidnet-bus-client/liquidnet-client-admin/liquidnet-client-admin-web/src/main/resources/templates/zhengzai/candy/coupon/mgt/detail1.html
View file @
58b99874
...
@@ -36,9 +36,13 @@
...
@@ -36,9 +36,13 @@
</div>
</div>
<div
class=
"form-group"
>
<div
class=
"form-group"
>
<label
class=
"col-sm-3 control-label"
>
类型:
</label>
<label
class=
"col-sm-3 control-label"
>
类型:
</label>
<div
class=
"form-control-static col-sm-
9
"
>
<div
class=
"form-control-static col-sm-
2
"
>
[[${@dict.getLabel('zhengzai_coupon_bind_type', mgtCouponInfoDto?.bindType)}]]
[[${@dict.getLabel('zhengzai_coupon_bind_type', mgtCouponInfoDto?.bindType)}]]
</div>
</div>
<label
class=
"col-sm-3 control-label"
th:if=
"${mgtCouponInfoDto?.bindType == 1 || mgtCouponInfoDto?.bindType == 3}"
>
发送类型:
</label>
<div
class=
"form-control-static col-sm-4"
th:if=
"${mgtCouponInfoDto?.bindType == 1 || mgtCouponInfoDto?.bindType == 3}"
>
[[${@dict.getLabel('zhengzai_coupon_event_type', mgtCouponInfoDto?.eventType)}]]
</div>
</div>
</div>
<div
class=
"form-group"
>
<div
class=
"form-group"
>
<label
class=
"col-sm-3 control-label"
>
金额:
</label>
<label
class=
"col-sm-3 control-label"
>
金额:
</label>
...
...
liquidnet-bus-client/liquidnet-client-admin/liquidnet-client-admin-web/src/main/resources/templates/zhengzai/candy/coupon/mgt/detail101.html
View file @
58b99874
...
@@ -36,9 +36,13 @@
...
@@ -36,9 +36,13 @@
</div>
</div>
<div
class=
"form-group"
>
<div
class=
"form-group"
>
<label
class=
"col-sm-3 control-label"
>
类型:
</label>
<label
class=
"col-sm-3 control-label"
>
类型:
</label>
<div
class=
"form-control-static col-sm-
9
"
>
<div
class=
"form-control-static col-sm-
2
"
>
[[${@dict.getLabel('zhengzai_coupon_bind_type', mgtCouponInfoDto?.bindType)}]]
[[${@dict.getLabel('zhengzai_coupon_bind_type', mgtCouponInfoDto?.bindType)}]]
</div>
</div>
<label
class=
"col-sm-3 control-label"
th:if=
"${mgtCouponInfoDto?.bindType == 1 || mgtCouponInfoDto?.bindType == 3}"
>
发送类型:
</label>
<div
class=
"form-control-static col-sm-4"
th:if=
"${mgtCouponInfoDto?.bindType == 1 || mgtCouponInfoDto?.bindType == 3}"
>
[[${@dict.getLabel('zhengzai_coupon_event_type', mgtCouponInfoDto?.eventType)}]]
</div>
</div>
</div>
<div
class=
"form-group"
>
<div
class=
"form-group"
>
<label
class=
"col-sm-3 control-label"
>
数量:
</label>
<label
class=
"col-sm-3 control-label"
>
数量:
</label>
...
...
liquidnet-bus-client/liquidnet-client-admin/liquidnet-client-admin-web/src/main/resources/templates/zhengzai/candy/coupon/mgt/detail2.html
View file @
58b99874
...
@@ -36,9 +36,13 @@
...
@@ -36,9 +36,13 @@
</div>
</div>
<div
class=
"form-group"
>
<div
class=
"form-group"
>
<label
class=
"col-sm-3 control-label"
>
类型:
</label>
<label
class=
"col-sm-3 control-label"
>
类型:
</label>
<div
class=
"form-control-static col-sm-
9
"
>
<div
class=
"form-control-static col-sm-
2
"
>
[[${@dict.getLabel('zhengzai_coupon_bind_type', mgtCouponInfoDto?.bindType)}]]
[[${@dict.getLabel('zhengzai_coupon_bind_type', mgtCouponInfoDto?.bindType)}]]
</div>
</div>
<label
class=
"col-sm-3 control-label"
th:if=
"${mgtCouponInfoDto?.bindType == 1 || mgtCouponInfoDto?.bindType == 3}"
>
发送类型:
</label>
<div
class=
"form-control-static col-sm-4"
th:if=
"${mgtCouponInfoDto?.bindType == 1 || mgtCouponInfoDto?.bindType == 3}"
>
[[${@dict.getLabel('zhengzai_coupon_event_type', mgtCouponInfoDto?.eventType)}]]
</div>
</div>
</div>
<div
class=
"form-group"
>
<div
class=
"form-group"
>
<label
class=
"col-sm-3 control-label"
>
金额:
</label>
<label
class=
"col-sm-3 control-label"
>
金额:
</label>
...
...
liquidnet-bus-client/liquidnet-client-admin/liquidnet-client-admin-web/src/main/resources/templates/zhengzai/candy/coupon/mgt/detail4.html
View file @
58b99874
...
@@ -36,9 +36,13 @@
...
@@ -36,9 +36,13 @@
</div>
</div>
<div
class=
"form-group"
>
<div
class=
"form-group"
>
<label
class=
"col-sm-3 control-label"
>
类型:
</label>
<label
class=
"col-sm-3 control-label"
>
类型:
</label>
<div
class=
"form-control-static col-sm-
9
"
>
<div
class=
"form-control-static col-sm-
2
"
>
[[${@dict.getLabel('zhengzai_coupon_bind_type', mgtCouponInfoDto?.bindType)}]]
[[${@dict.getLabel('zhengzai_coupon_bind_type', mgtCouponInfoDto?.bindType)}]]
</div>
</div>
<label
class=
"col-sm-3 control-label"
th:if=
"${mgtCouponInfoDto?.bindType == 1 || mgtCouponInfoDto?.bindType == 3}"
>
发送类型:
</label>
<div
class=
"form-control-static col-sm-4"
th:if=
"${mgtCouponInfoDto?.bindType == 1 || mgtCouponInfoDto?.bindType == 3}"
>
[[${@dict.getLabel('zhengzai_coupon_event_type', mgtCouponInfoDto?.eventType)}]]
</div>
</div>
</div>
<div
class=
"form-group"
>
<div
class=
"form-group"
>
<label
class=
"col-sm-3 control-label"
>
折扣:
</label>
<label
class=
"col-sm-3 control-label"
>
折扣:
</label>
...
...
liquidnet-bus-do/liquidnet-service-candy-do/src/main/java/com/liquidnet/service/candy/entity/CandyCommonCoupon.java
View file @
58b99874
...
@@ -50,7 +50,7 @@ public class CandyCommonCoupon implements Serializable {
...
@@ -50,7 +50,7 @@ public class CandyCommonCoupon implements Serializable {
private
Integer
exclusive
;
private
Integer
exclusive
;
/**
/**
* 公有券状态[1-可用|2-无效
|3-已过期
]
* 公有券状态[1-可用|2-无效
|3-已过期|9-移除不展示(过期)
]
*/
*/
private
Integer
state
;
private
Integer
state
;
...
...
liquidnet-bus-do/liquidnet-service-candy-do/src/main/java/com/liquidnet/service/candy/entity/CandyUserCoupon.java
View file @
58b99874
...
@@ -56,7 +56,7 @@ public class CandyUserCoupon implements Serializable,Cloneable {
...
@@ -56,7 +56,7 @@ public class CandyUserCoupon implements Serializable,Cloneable {
private
Integer
exclusive
;
private
Integer
exclusive
;
/**
/**
* 用户券状态[1-可用|2-无效
|3-已过期|5-已使用
]
* 用户券状态[1-可用|2-无效
|3-已过期|5-已使用|9-移除不展示(过期或已使用)
]
*/
*/
private
Integer
state
;
private
Integer
state
;
...
...
liquidnet-bus-service/liquidnet-service-candy/liquidnet-service-candy-impl/docu/db_ln_candy_initialdata.sql
View file @
58b99874
...
@@ -116,7 +116,7 @@ create table candy_user_coupon
...
@@ -116,7 +116,7 @@ create table candy_user_coupon
mcoupon_id
varchar
(
64
)
comment
'~candy_mgt_coupon.mcoupon_id'
,
mcoupon_id
varchar
(
64
)
comment
'~candy_mgt_coupon.mcoupon_id'
,
uid
varchar
(
64
)
not
null
comment
'~adam_user.uid'
,
uid
varchar
(
64
)
not
null
comment
'~adam_user.uid'
,
coupon_id
varchar
(
64
)
not
null
comment
'~candy_coupon.coupon_id'
,
coupon_id
varchar
(
64
)
not
null
comment
'~candy_coupon.coupon_id'
,
state
tinyint
comment
'用户券状态[1-可用|2-无效
|3-已过期|5-已使用
]'
,
state
tinyint
comment
'用户券状态[1-可用|2-无效
|3-已过期|5-已使用|9-移除不展示(过期或已使用)
]'
,
ccode
varchar
(
64
)
comment
'券码~candy_coupon_code.ccode'
,
ccode
varchar
(
64
)
comment
'券码~candy_coupon_code.ccode'
,
bind_at
datetime
(
3
)
comment
'激活时间'
,
bind_at
datetime
(
3
)
comment
'激活时间'
,
...
@@ -142,7 +142,7 @@ create table candy_common_coupon
...
@@ -142,7 +142,7 @@ create table candy_common_coupon
ccoupon_id
varchar
(
64
)
not
null
,
ccoupon_id
varchar
(
64
)
not
null
,
mcoupon_id
varchar
(
64
)
not
null
comment
'~candy_mgt_coupon.mcoupon_id'
,
mcoupon_id
varchar
(
64
)
not
null
comment
'~candy_mgt_coupon.mcoupon_id'
,
coupon_id
varchar
(
64
)
not
null
comment
'~candy_coupon.coupon_id'
,
coupon_id
varchar
(
64
)
not
null
comment
'~candy_coupon.coupon_id'
,
state
tinyint
comment
'公有券状态[1-可用|2-无效
|3-已过期
]'
,
state
tinyint
comment
'公有券状态[1-可用|2-无效
|3-已过期|9-移除不展示(过期)
]'
,
ranged
tinyint
comment
'公有券范围(~candy_mgt_coupon.event_type)'
,
ranged
tinyint
comment
'公有券范围(~candy_mgt_coupon.event_type)'
,
operator
varchar
(
64
)
not
null
comment
'操作人'
,
operator
varchar
(
64
)
not
null
comment
'操作人'
,
...
...
liquidnet-bus-service/liquidnet-service-candy/liquidnet-service-candy-impl/src/main/java/com/liquidnet/service/candy/service/impl/CandyCouponServiceImpl.java
View file @
58b99874
...
@@ -576,7 +576,7 @@ public class CandyCouponServiceImpl implements ICandyCouponService {
...
@@ -576,7 +576,7 @@ public class CandyCouponServiceImpl implements ICandyCouponService {
params
.
add
(
"uid"
,
uid
);
params
.
add
(
"uid"
,
uid
);
MultiValueMap
<
String
,
String
>
headers
=
CollectionUtil
.
linkedMultiValueMapStringString
();
MultiValueMap
<
String
,
String
>
headers
=
CollectionUtil
.
linkedMultiValueMapStringString
();
headers
.
add
(
"Accept"
,
"application/json;charset=UTF-8"
);
headers
.
add
(
"Accept"
,
"application/json;charset=UTF-8"
);
String
returnData
=
HttpUtil
.
pos
t
(
adamUrl
.
concat
(
"/adam/rsc/inquire/createdAt"
),
params
,
headers
);
String
returnData
=
HttpUtil
.
ge
t
(
adamUrl
.
concat
(
"/adam/rsc/inquire/createdAt"
),
params
,
headers
);
return
JsonUtils
.
fromJson
(
returnData
,
new
TypeReference
<
ResponseDto
<
LocalDateTime
>>()
{
return
JsonUtils
.
fromJson
(
returnData
,
new
TypeReference
<
ResponseDto
<
LocalDateTime
>>()
{
}).
getData
();
}).
getData
();
}
}
...
...
liquidnet-bus-service/liquidnet-service-candy/liquidnet-service-candy-impl/src/main/java/com/liquidnet/service/candy/util/RedisDataUtils.java
View file @
58b99874
...
@@ -63,24 +63,36 @@ public class RedisDataUtils {
...
@@ -63,24 +63,36 @@ public class RedisDataUtils {
pubDto
=
(
List
<
CandyCommonCouponBasicDto
>)
obj2
;
pubDto
=
(
List
<
CandyCommonCouponBasicDto
>)
obj2
;
}
}
boolean
needSet
=
false
;
// boolean needSet = false;
// if (userCreateTime == null) {
// userCreateTime = LocalDateTime.of(2222,1,1,0,0,0);
// }
// List<String> userCcouponIdList = userDto.stream().map(CandyUserCouponBasicDto::getCcouponId).collect(Collectors.toList());
// if (userCcouponIdList.size() > 0) {
// for (CandyCommonCouponBasicDto item : pubDto) {
// if (userCcouponIdList.contains(item.getCcouponId()) || userCreateTime.isAfter(item.getCreatedAt())) {
// continue;
// } else {
// CandyUserCouponBasicDto userCouponBasicDto = CandyUserCouponBasicDto.getNew().copyToRedisCommonBaseCoupon(IDGenerator.get32UUID(), uid, item);
// userDto.add(userCouponBasicDto);
// needSet = true;
// }
// }
// }
// if (needSet) {
// setCouponByUid(uid, userDto);
// }
if
(
userCreateTime
==
null
)
{
if
(
userCreateTime
==
null
)
{
userCreateTime
=
LocalDateTime
.
of
(
2222
,
1
,
1
,
0
,
0
,
0
);
userCreateTime
=
LocalDateTime
.
of
(
2222
,
1
,
1
,
0
,
0
,
0
);
}
}
List
<
String
>
userIds
=
userDto
.
stream
().
map
(
CandyUserCouponBasicDto:
:
getCcouponId
).
collect
(
Collectors
.
toList
());
List
<
String
>
userCcouponIdList
=
userDto
.
stream
().
map
(
CandyUserCouponBasicDto:
:
getCcouponId
).
collect
(
Collectors
.
toList
());
if
(
userIds
!=
null
&&
userIds
.
size
()
>
0
)
{
for
(
CandyCommonCouponBasicDto
item
:
pubDto
)
{
for
(
CandyCommonCouponBasicDto
item
:
pubDto
)
{
if
(
userCcouponIdList
.
contains
(
item
.
getCcouponId
())
||
userCreateTime
.
isAfter
(
item
.
getCreatedAt
()))
{
if
(
userIds
.
contains
(
item
.
getCcouponId
())
||
userCreateTime
.
isAfter
(
item
.
getCreatedAt
()))
{
continue
;
continue
;
}
else
{
CandyUserCouponBasicDto
userCouponBasicDto
=
CandyUserCouponBasicDto
.
getNew
().
copyToRedisCommonBaseCoupon
(
IDGenerator
.
get32UUID
(),
uid
,
item
);
userDto
.
add
(
userCouponBasicDto
);
needSet
=
true
;
}
}
}
}
String
ucouponId
=
item
.
getCcouponId
().
concat
(
"-"
).
concat
(
uid
);
if
(
needSet
)
{
CandyUserCouponBasicDto
userCouponBasicDto
=
CandyUserCouponBasicDto
.
getNew
().
copyToRedisCommonBaseCoupon
(
ucouponId
,
uid
,
item
);
setCouponByUid
(
uid
,
user
Dto
);
userDto
.
add
(
userCouponBasic
Dto
);
}
}
return
userDto
;
return
userDto
;
}
}
...
...
liquidnet-bus-service/liquidnet-service-consumer-all/liquidnet-service-consumer-order/pom.xml
View file @
58b99874
...
@@ -58,32 +58,32 @@
...
@@ -58,32 +58,32 @@
<artifactId>
liquidnet-common-sms
</artifactId>
<artifactId>
liquidnet-common-sms
</artifactId>
<version>
1.0-SNAPSHOT
</version>
<version>
1.0-SNAPSHOT
</version>
</dependency>
</dependency>
<dependency
>
<!-- <dependency>--
>
<groupId>
com.liquidnet
</groupId
>
<!-- <groupId>com.liquidnet</groupId>--
>
<artifactId>
liquidnet-common-third-zxlnft
</artifactId
>
<!-- <artifactId>liquidnet-common-third-zxlnft</artifactId>--
>
<version>
1.0-SNAPSHOT
</version
>
<!-- <version>1.0-SNAPSHOT</version>--
>
</dependency
>
<!-- </dependency>--
>
<dependency
>
<!-- <dependency>--
>
<groupId>
com.liquidnet
</groupId
>
<!-- <groupId>com.liquidnet</groupId>--
>
<artifactId>
liquidnet-common-third-antchain
</artifactId
>
<!-- <artifactId>liquidnet-common-third-antchain</artifactId>--
>
<version>
1.0-SNAPSHOT
</version
>
<!-- <version>1.0-SNAPSHOT</version>--
>
</dependency
>
<!-- </dependency>--
>
<dependency
>
<!-- <dependency>--
>
<groupId>
com.liquidnet
</groupId
>
<!-- <groupId>com.liquidnet</groupId>--
>
<artifactId>
liquidnet-service-galaxy-api
</artifactId
>
<!-- <artifactId>liquidnet-service-galaxy-api</artifactId>--
>
<version>
1.0-SNAPSHOT
</version
>
<!-- <version>1.0-SNAPSHOT</version>--
>
</dependency
>
<!-- </dependency>--
>
<dependency
>
<!-- <dependency>--
>
<groupId>
com.liquidnet
</groupId
>
<!-- <groupId>com.liquidnet</groupId>--
>
<artifactId>
liquidnet-service-goblin-common
</artifactId
>
<!-- <artifactId>liquidnet-service-goblin-common</artifactId>--
>
<version>
1.0-SNAPSHOT
</version
>
<!-- <version>1.0-SNAPSHOT</version>--
>
<exclusions
>
<!-- <exclusions>--
>
<exclusion
>
<!-- <exclusion>--
>
<groupId>
com.liquidnet
</groupId
>
<!-- <groupId>com.liquidnet</groupId>--
>
<artifactId>
liquidnet-common-web
</artifactId
>
<!-- <artifactId>liquidnet-common-web</artifactId>--
>
</exclusion
>
<!-- </exclusion>--
>
</exclusions
>
<!-- </exclusions>--
>
</dependency
>
<!-- </dependency>--
>
</dependencies>
</dependencies>
<build>
<build>
...
...
liquidnet-bus-service/liquidnet-service-consumer-all/liquidnet-service-consumer-order/src/main/java/com/liquidnet/service/consumer/order/utils/KylinOrderUtils.java
View file @
58b99874
...
@@ -228,7 +228,7 @@ public class KylinOrderUtils {
...
@@ -228,7 +228,7 @@ public class KylinOrderUtils {
param
.
setUid
(
uid
);
param
.
setUid
(
uid
);
MultiValueMap
<
String
,
String
>
header
=
CollectionUtil
.
linkedMultiValueMapStringString
();
MultiValueMap
<
String
,
String
>
header
=
CollectionUtil
.
linkedMultiValueMapStringString
();
header
.
add
(
"Authorization"
,
"Bearer "
+
CurrentUtil
.
getToken
());
//
header.add("Authorization", "Bearer " + CurrentUtil.getToken());
ArrayList
<
BackCouponParam
>
params
=
new
ArrayList
();
ArrayList
<
BackCouponParam
>
params
=
new
ArrayList
();
params
.
add
(
param
);
params
.
add
(
param
);
...
...
liquidnet-bus-service/liquidnet-service-executor-all/liquidnet-service-executor-main/src/main/java/com/liquidnet/service/executor/main/handler/PlatformTaskHandler.java
View file @
58b99874
package
com
.
liquidnet
.
service
.
executor
.
main
.
handler
;
package
com
.
liquidnet
.
service
.
executor
.
main
.
handler
;
import
com.liquidnet.commons.lang.util.CollectionUtil
;
import
com.liquidnet.commons.lang.util.DESUtils
;
import
com.liquidnet.commons.lang.util.HttpUtil
;
import
com.liquidnet.service.feign.kylin.task.FeignPlatformAlipayBackClient
;
import
com.liquidnet.service.feign.kylin.task.FeignPlatformAlipayBackClient
;
import
com.liquidnet.service.feign.platform.api.FeignPlatformApiClient
;
import
com.liquidnet.service.feign.platform.api.FeignPlatformApiClient
;
import
com.liquidnet.service.feign.platform.kylin.FeignPlatformFreightClient
;
import
com.liquidnet.service.feign.platform.kylin.FeignPlatformFreightClient
;
import
com.liquidnet.service.feign.platform.task.FeignPlatformCandyTaskClient
;
import
com.liquidnet.service.feign.platform.task.FeignPlatformCandyTaskClient
;
import
com.xxl.job.core.context.XxlJobHelper
;
import
com.xxl.job.core.context.XxlJobHelper
;
import
com.xxl.job.core.handler.annotation.XxlJob
;
import
com.xxl.job.core.handler.annotation.XxlJob
;
import
org.apache.commons.lang3.StringUtils
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Value
;
import
org.springframework.http.MediaType
;
import
org.springframework.stereotype.Component
;
import
org.springframework.stereotype.Component
;
import
org.springframework.util.LinkedMultiValueMap
;
/**
/**
* Platform
* Platform
*/
*/
@Component
@Component
public
class
PlatformTaskHandler
{
public
class
PlatformTaskHandler
{
@Value
(
"${liquidnet.service.platform.url}"
)
private
String
sevPlatformUrl
;
@Autowired
@Autowired
private
FeignPlatformAlipayBackClient
feignPlatformAlipayBackClient
;
private
FeignPlatformAlipayBackClient
feignPlatformAlipayBackClient
;
@Autowired
@Autowired
...
@@ -106,6 +116,24 @@ public class PlatformTaskHandler {
...
@@ -106,6 +116,24 @@ public class PlatformTaskHandler {
}
}
}
}
@XxlJob
(
value
=
"sev-platform:candyUserCouponRmvProcessing"
)
public
void
candyUserCouponRmvProcessing
()
{
// 券中心:券移除处理
try
{
String
url
=
sevPlatformUrl
.
concat
(
"/platform/ccoupon/task/due/rmv"
);
LinkedMultiValueMap
<
String
,
String
>
paramsMap
=
CollectionUtil
.
linkedMultiValueMapStringString
();
String
jobParam
=
XxlJobHelper
.
getJobParam
();
paramsMap
.
add
(
"displaySeconds"
,
DESUtils
.
DES
().
encrypt
(
StringUtils
.
isNotBlank
(
jobParam
)
?
jobParam
:
"2678400"
));
LinkedMultiValueMap
<
String
,
String
>
headersMap
=
CollectionUtil
.
linkedMultiValueMapStringString
();
headersMap
.
add
(
"Accept"
,
MediaType
.
APPLICATION_JSON_UTF8_VALUE
);
headersMap
.
add
(
"Content-Type"
,
MediaType
.
APPLICATION_FORM_URLENCODED_VALUE
);
XxlJobHelper
.
handleSuccess
(
"结果:"
+
HttpUtil
.
post
(
url
,
paramsMap
,
headersMap
));
}
catch
(
Exception
e
)
{
XxlJobHelper
.
log
(
e
);
XxlJobHelper
.
handleFail
();
}
}
@XxlJob
(
value
=
"sev-platform:getFreightChargeHandler"
)
@XxlJob
(
value
=
"sev-platform:getFreightChargeHandler"
)
public
void
getFreightChargeHandler
()
{
//运费
public
void
getFreightChargeHandler
()
{
//运费
try
{
try
{
...
...
liquidnet-bus-service/liquidnet-service-platform/liquidnet-service-platform-impl/src/main/java/com/liquidnet/service/platform/controller/candy/task/CandyCouponDueTaskController.java
View file @
58b99874
...
@@ -5,6 +5,8 @@ import com.baomidou.mybatisplus.core.toolkit.Wrappers;
...
@@ -5,6 +5,8 @@ import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import
com.liquidnet.common.cache.redis.util.AbstractRedisUtil
;
import
com.liquidnet.common.cache.redis.util.AbstractRedisUtil
;
import
com.liquidnet.common.cache.redis.util.RedisDataSourceUtil
;
import
com.liquidnet.common.cache.redis.util.RedisDataSourceUtil
;
import
com.liquidnet.common.exception.LiquidnetServiceException
;
import
com.liquidnet.common.exception.LiquidnetServiceException
;
import
com.liquidnet.common.exception.constant.ErrorCode
;
import
com.liquidnet.commons.lang.util.DESUtils
;
import
com.liquidnet.service.base.ResponseDto
;
import
com.liquidnet.service.base.ResponseDto
;
import
com.liquidnet.service.candy.constant.CandyRedisConst
;
import
com.liquidnet.service.candy.constant.CandyRedisConst
;
import
com.liquidnet.service.candy.dto.CandyCommonCouponBasicDto
;
import
com.liquidnet.service.candy.dto.CandyCommonCouponBasicDto
;
...
@@ -19,12 +21,12 @@ import com.liquidnet.service.platform.service.impl.candy.PlatformCandyCouponCode
...
@@ -19,12 +21,12 @@ import com.liquidnet.service.platform.service.impl.candy.PlatformCandyCouponCode
import
com.liquidnet.service.platform.service.impl.candy.PlatformCandyCouponService
;
import
com.liquidnet.service.platform.service.impl.candy.PlatformCandyCouponService
;
import
com.liquidnet.service.platform.service.impl.candy.PlatformCandyUserCouponService
;
import
com.liquidnet.service.platform.service.impl.candy.PlatformCandyUserCouponService
;
import
com.liquidnet.service.platform.utils.ObjectUtil
;
import
com.liquidnet.service.platform.utils.ObjectUtil
;
import
io.swagger.annotations.ApiOperation
;
import
lombok.extern.slf4j.Slf4j
;
import
lombok.extern.slf4j.Slf4j
;
import
org.apache.commons.lang3.StringUtils
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.util.CollectionUtils
;
import
org.springframework.util.CollectionUtils
;
import
org.springframework.web.bind.annotation.PutMapping
;
import
org.springframework.web.bind.annotation.*
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.RestController
;
import
java.time.LocalDateTime
;
import
java.time.LocalDateTime
;
import
java.util.ArrayList
;
import
java.util.ArrayList
;
...
@@ -80,7 +82,7 @@ public class CandyCouponDueTaskController {
...
@@ -80,7 +82,7 @@ public class CandyCouponDueTaskController {
// 查取状态可用的到期兑换码
// 查取状态可用的到期兑换码
LambdaQueryWrapper
<
CandyCouponCode
>
couponCodeQueryWrapper
=
Wrappers
.
lambdaQuery
(
CandyCouponCode
.
class
);
LambdaQueryWrapper
<
CandyCouponCode
>
couponCodeQueryWrapper
=
Wrappers
.
lambdaQuery
(
CandyCouponCode
.
class
);
couponCodeQueryWrapper
.
eq
(
CandyCouponCode:
:
getState
,
0
);
couponCodeQueryWrapper
.
eq
(
CandyCouponCode:
:
getState
,
0
);
couponCodeQueryWrapper
.
le
(
CandyCouponCode:
:
getRedeemStop
,
now
);
couponCodeQueryWrapper
.
le
(
CandyCouponCode:
:
getRedeemStop
,
now
.
minusSeconds
(
30
)
);
int
totalCount
=
platformCandyCouponCodeService
.
count
(
couponCodeQueryWrapper
);
int
totalCount
=
platformCandyCouponCodeService
.
count
(
couponCodeQueryWrapper
);
AtomicInteger
pl
=
new
AtomicInteger
();
AtomicInteger
pl
=
new
AtomicInteger
();
int
remainCount
=
totalCount
;
int
remainCount
=
totalCount
;
...
@@ -172,7 +174,7 @@ public class CandyCouponDueTaskController {
...
@@ -172,7 +174,7 @@ public class CandyCouponDueTaskController {
// 查取状态可用的公有券 - 对应的到期券列表
// 查取状态可用的公有券 - 对应的到期券列表
LambdaQueryWrapper
<
CandyCoupon
>
couponQueryWrapper
=
Wrappers
.
lambdaQuery
(
CandyCoupon
.
class
);
LambdaQueryWrapper
<
CandyCoupon
>
couponQueryWrapper
=
Wrappers
.
lambdaQuery
(
CandyCoupon
.
class
);
couponQueryWrapper
.
in
(
CandyCoupon:
:
getCouponId
,
commonCouponIdArr
);
couponQueryWrapper
.
in
(
CandyCoupon:
:
getCouponId
,
commonCouponIdArr
);
couponQueryWrapper
.
le
(
CandyCoupon:
:
getExpireAt
,
now
);
couponQueryWrapper
.
le
(
CandyCoupon:
:
getExpireAt
,
now
.
minusSeconds
(
30
)
);
int
totalCount
=
platformCandyCouponService
.
count
(
couponQueryWrapper
),
remainCount
=
totalCount
,
num
=
0
,
pSize
=
1000
;
int
totalCount
=
platformCandyCouponService
.
count
(
couponQueryWrapper
),
remainCount
=
totalCount
,
num
=
0
,
pSize
=
1000
;
log
.
info
(
"券到期检查处理:公有券[可用券总数:{},其中到期券ID数:{}]"
,
commonCouponList
.
size
(),
totalCount
);
log
.
info
(
"券到期检查处理:公有券[可用券总数:{},其中到期券ID数:{}]"
,
commonCouponList
.
size
(),
totalCount
);
...
@@ -245,7 +247,7 @@ public class CandyCouponDueTaskController {
...
@@ -245,7 +247,7 @@ public class CandyCouponDueTaskController {
// 查取状态可用的到期券
// 查取状态可用的到期券
LambdaQueryWrapper
<
CandyUserCoupon
>
userCouponQueryWrapper
=
Wrappers
.
lambdaQuery
(
CandyUserCoupon
.
class
);
LambdaQueryWrapper
<
CandyUserCoupon
>
userCouponQueryWrapper
=
Wrappers
.
lambdaQuery
(
CandyUserCoupon
.
class
);
userCouponQueryWrapper
.
eq
(
CandyUserCoupon:
:
getState
,
1
);
userCouponQueryWrapper
.
eq
(
CandyUserCoupon:
:
getState
,
1
);
userCouponQueryWrapper
.
le
(
CandyUserCoupon:
:
getDuedAt
,
now
);
userCouponQueryWrapper
.
le
(
CandyUserCoupon:
:
getDuedAt
,
now
.
minusSeconds
(
30
)
);
int
totalCount
=
platformCandyUserCouponService
.
count
(
userCouponQueryWrapper
);
int
totalCount
=
platformCandyUserCouponService
.
count
(
userCouponQueryWrapper
);
AtomicInteger
pl
=
new
AtomicInteger
();
AtomicInteger
pl
=
new
AtomicInteger
();
int
remainCount
=
totalCount
;
int
remainCount
=
totalCount
;
...
@@ -311,4 +313,44 @@ public class CandyCouponDueTaskController {
...
@@ -311,4 +313,44 @@ public class CandyCouponDueTaskController {
log
.
info
(
"券到期检查处理:私有券[到期总记录数:{},处理总数:{}] >>> END END END"
,
totalCount
,
pl
.
get
());
log
.
info
(
"券到期检查处理:私有券[到期总记录数:{},处理总数:{}] >>> END END END"
,
totalCount
,
pl
.
get
());
return
ResponseDto
.
success
();
return
ResponseDto
.
success
();
}
}
/**
* 券移除-`过期券/已用券`超过指定时长移除不展示
* - 过期券:更新MySQL用户券状态,删除Redis用户指定过期时段的券
* - 已用券:暂不处理
* 同步REDIS.DTO
*
* @param displaySeconds 有效展示秒数,例如:"2678400,31622400",其中2678400为过期券对应有效展示秒数(31天),31622400为已用券对应有效展示秒数(366天),其中31622400可以不传即不处理已用券,2678400必传,否则执行无效
* @return ResponseDto<String>
*/
@PostMapping
(
"rmv"
)
public
ResponseDto
<
String
>
processForRmv
(
@RequestParam
String
displaySeconds
)
{
int
displayDaysIntVal1
=
31
,
displayDaysIntVal2
=
0
;
ErrorCode
paramError
=
ErrorCode
.
HTTP_PARAM_ERROR
;
if
(
StringUtils
.
isNotBlank
(
displaySeconds
))
{
try
{
String
decrypt
=
DESUtils
.
DES
().
decrypt
(
displaySeconds
);
String
[]
decryptArr
=
decrypt
.
split
(
","
);
displayDaysIntVal1
=
Integer
.
parseInt
(
decryptArr
[
0
]);
displayDaysIntVal2
=
decryptArr
.
length
>
1
&&
StringUtils
.
isNotBlank
(
decryptArr
[
1
])
?
Integer
.
parseInt
(
decryptArr
[
1
])
:
0
;
}
catch
(
NumberFormatException
ignored
)
{
}
catch
(
Exception
e
)
{
return
ResponseDto
.
failure
(
paramError
.
getCode
(),
paramError
.
getMessage
());
}
if
(
displayDaysIntVal1
<=
0
)
{
return
ResponseDto
.
failure
(
paramError
.
getCode
(),
paramError
.
getMessage
());
}
}
else
{
return
ResponseDto
.
failure
(
paramError
.
getCode
(),
paramError
.
getMessage
());
}
LocalDateTime
currentDateTime
=
LocalDateTime
.
now
();
int
plCommonCoupon
=
platformCandyCommonCouponService
.
rmvForCommonCouponProcessing
(
currentDateTime
,
displayDaysIntVal1
);
int
plUserCouponDue
=
platformCandyUserCouponService
.
rmvForUserCouponProcessing
(
currentDateTime
,
displayDaysIntVal1
,
false
);
int
plUserCouponUse
=
0
;
if
(
displayDaysIntVal2
>
31536000
)
{
// 31536000秒对应365天
plUserCouponUse
=
platformCandyUserCouponService
.
rmvForUserCouponProcessing
(
currentDateTime
,
displayDaysIntVal2
,
true
);
}
return
ResponseDto
.
success
(
String
.
format
(
"结果[%s,%d,%d,过期公有券:%d,过期私有券:%d,已用券:%d"
,
currentDateTime
,
displayDaysIntVal1
,
displayDaysIntVal2
,
plCommonCoupon
,
plUserCouponDue
,
plUserCouponUse
));
}
}
}
liquidnet-bus-service/liquidnet-service-platform/liquidnet-service-platform-impl/src/main/java/com/liquidnet/service/platform/service/impl/candy/PlatformCandyCommonCouponService.java
View file @
58b99874
package
com
.
liquidnet
.
service
.
platform
.
service
.
impl
.
candy
;
package
com
.
liquidnet
.
service
.
platform
.
service
.
impl
.
candy
;
import
com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper
;
import
com.baomidou.mybatisplus.core.toolkit.Wrappers
;
import
com.baomidou.mybatisplus.extension.service.impl.ServiceImpl
;
import
com.baomidou.mybatisplus.extension.service.impl.ServiceImpl
;
import
com.liquidnet.common.cache.redis.util.AbstractRedisUtil
;
import
com.liquidnet.common.cache.redis.util.RedisDataSourceUtil
;
import
com.liquidnet.common.exception.LiquidnetServiceException
;
import
com.liquidnet.service.candy.constant.CandyRedisConst
;
import
com.liquidnet.service.candy.dto.CandyCommonCouponBasicDto
;
import
com.liquidnet.service.candy.entity.CandyCommonCoupon
;
import
com.liquidnet.service.candy.entity.CandyCommonCoupon
;
import
com.liquidnet.service.candy.mapper.CandyCommonCouponMapper
;
import
com.liquidnet.service.candy.mapper.CandyCommonCouponMapper
;
import
com.liquidnet.service.platform.utils.ObjectUtil
;
import
lombok.extern.slf4j.Slf4j
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
import
org.springframework.stereotype.Service
;
import
org.springframework.util.CollectionUtils
;
import
java.time.LocalDateTime
;
import
java.util.ArrayList
;
import
java.util.List
;
import
java.util.concurrent.atomic.AtomicInteger
;
import
java.util.stream.Collectors
;
@Slf4j
@Service
@Service
public
class
PlatformCandyCommonCouponService
extends
ServiceImpl
<
CandyCommonCouponMapper
,
CandyCommonCoupon
>
{
public
class
PlatformCandyCommonCouponService
extends
ServiceImpl
<
CandyCommonCouponMapper
,
CandyCommonCoupon
>
{
@Autowired
private
RedisDataSourceUtil
redisDataSourceUtil
;
/**
* 移除公有券
* - 处理已过期且过期天数超过`displayDays`的券
*
* @param currentDateTime 当前时间
* @param displayDays 展示天数
*/
public
int
rmvForCommonCouponProcessing
(
LocalDateTime
currentDateTime
,
int
displayDays
)
{
AtomicInteger
pl
=
new
AtomicInteger
();
try
{
LambdaQueryWrapper
<
CandyCommonCoupon
>
commonCouponQueryWrapper
=
Wrappers
.
lambdaQuery
(
CandyCommonCoupon
.
class
);
commonCouponQueryWrapper
.
eq
(
CandyCommonCoupon:
:
getState
,
3
);
commonCouponQueryWrapper
.
le
(
CandyCommonCoupon:
:
getUpdatedAt
,
currentDateTime
.
minusSeconds
(
displayDays
));
int
totalCount
=
this
.
count
(
commonCouponQueryWrapper
);
int
remainCount
=
totalCount
,
pSize
=
1000
;
if
(
totalCount
>
0
)
{
log
.
info
(
"券移除处理:公有券[总数:{},AT:{} - {} = {}] >>> BEGIN BEGIN BEGIN"
,
totalCount
,
currentDateTime
,
displayDays
,
currentDateTime
.
minusDays
(
displayDays
));
}
ArrayList
<
CandyCommonCoupon
>
updateCommonCouponList
=
ObjectUtil
.
getCandyCommonCouponArrayList
();
commonCouponQueryWrapper
.
select
(
CandyCommonCoupon:
:
getMid
,
CandyCommonCoupon:
:
getCcouponId
);
commonCouponQueryWrapper
.
orderByAsc
(
CandyCommonCoupon:
:
getMid
);
while
(
remainCount
>
0
)
{
updateCommonCouponList
.
clear
();
LambdaQueryWrapper
<
CandyCommonCoupon
>
commonCouponLambdaQueryWrapper
=
commonCouponQueryWrapper
.
clone
();
String
lastLimitSql
=
"LIMIT "
+
0
+
","
+
pSize
;
commonCouponLambdaQueryWrapper
.
last
(
lastLimitSql
);
List
<
CandyCommonCoupon
>
commonCouponList
=
this
.
list
(
commonCouponLambdaQueryWrapper
);
for
(
int
i
=
0
,
listSize
=
CollectionUtils
.
isEmpty
(
commonCouponList
)
?
-
1
:
commonCouponList
.
size
();
i
<
listSize
;
i
++)
{
CandyCommonCoupon
commonCoupon
=
commonCouponList
.
get
(
i
);
commonCoupon
.
setState
(
9
);
commonCoupon
.
setOperator
(
"RMV-DUED"
);
commonCoupon
.
setUpdatedAt
(
currentDateTime
);
updateCommonCouponList
.
add
(
commonCoupon
);
}
if
(!
CollectionUtils
.
isEmpty
(
updateCommonCouponList
))
{
if
(
this
.
updateBatchById
(
updateCommonCouponList
,
updateCommonCouponList
.
size
()))
{
AbstractRedisUtil
redisCandyUtil
=
redisDataSourceUtil
.
getRedisCandyUtil
();
List
<
CandyCommonCouponBasicDto
>
vos
=
(
List
<
CandyCommonCouponBasicDto
>)
redisCandyUtil
.
get
(
CandyRedisConst
.
BASIC_COMMON_COUPON
);
if
(!
CollectionUtils
.
isEmpty
(
vos
))
{
List
<
String
>
updateCommonCouponIdList
=
updateCommonCouponList
.
stream
().
map
(
CandyCommonCoupon:
:
getCcouponId
).
collect
(
Collectors
.
toList
());
int
beforeSizeVos
=
vos
.
size
();
vos
.
removeIf
(
r
->
updateCommonCouponIdList
.
contains
(
r
.
getCcouponId
()));
if
(
beforeSizeVos
-
vos
.
size
()
>
0
)
{
pl
.
getAndAdd
(
beforeSizeVos
-
vos
.
size
());
if
(
vos
.
size
()
>
0
)
{
redisCandyUtil
.
set
(
CandyRedisConst
.
BASIC_COMMON_COUPON
,
vos
);
}
else
{
redisCandyUtil
.
del
(
CandyRedisConst
.
BASIC_COMMON_COUPON
);
}
}
}
}
else
{
throw
new
LiquidnetServiceException
(
"-1"
,
"券移除数据更新失败"
);
}
}
remainCount
=
Math
.
max
(
remainCount
-
pSize
,
0
);
log
.
info
(
"券移除处理中:公有券[总数:{},单次处理:{}|{},剩余:{}]"
,
totalCount
,
lastLimitSql
,
pl
.
get
(),
remainCount
);
}
if
(
totalCount
>
0
)
{
log
.
info
(
"券移除处理:公有券[总数:{},处理总数:{}] >>> END END END"
,
totalCount
,
pl
.
get
());
}
}
catch
(
Exception
e
)
{
log
.
error
(
"Ex.券移除处理异常:公有券[currentDateTime={},displayDays={}]"
,
currentDateTime
,
displayDays
,
e
);
}
return
pl
.
get
();
}
}
}
liquidnet-bus-service/liquidnet-service-platform/liquidnet-service-platform-impl/src/main/java/com/liquidnet/service/platform/service/impl/candy/PlatformCandyUserCouponService.java
View file @
58b99874
package
com
.
liquidnet
.
service
.
platform
.
service
.
impl
.
candy
;
package
com
.
liquidnet
.
service
.
platform
.
service
.
impl
.
candy
;
import
com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper
;
import
com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper
;
import
com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper
;
import
com.baomidou.mybatisplus.core.toolkit.Wrappers
;
import
com.baomidou.mybatisplus.extension.service.impl.ServiceImpl
;
import
com.baomidou.mybatisplus.extension.service.impl.ServiceImpl
;
import
com.liquidnet.common.cache.redis.util.AbstractRedisUtil
;
import
com.liquidnet.common.cache.redis.util.AbstractRedisUtil
;
import
com.liquidnet.common.cache.redis.util.RedisDataSourceUtil
;
import
com.liquidnet.common.cache.redis.util.RedisDataSourceUtil
;
import
com.liquidnet.common.exception.LiquidnetServiceException
;
import
com.liquidnet.service.adam.constant.AdamRedisConst
;
import
com.liquidnet.service.adam.constant.AdamRedisConst
;
import
com.liquidnet.service.base.OrderCloseMapping
;
import
com.liquidnet.service.base.OrderCloseMapping
;
import
com.liquidnet.service.base.constant.MQConst
;
import
com.liquidnet.service.base.constant.MQConst
;
...
@@ -15,7 +18,9 @@ import com.liquidnet.service.candy.entity.CandyUserCoupon;
...
@@ -15,7 +18,9 @@ import com.liquidnet.service.candy.entity.CandyUserCoupon;
import
com.liquidnet.service.candy.mapper.CandyCommonCouponMapper
;
import
com.liquidnet.service.candy.mapper.CandyCommonCouponMapper
;
import
com.liquidnet.service.candy.mapper.CandyCouponRuleMapper
;
import
com.liquidnet.service.candy.mapper.CandyCouponRuleMapper
;
import
com.liquidnet.service.candy.mapper.CandyUserCouponMapper
;
import
com.liquidnet.service.candy.mapper.CandyUserCouponMapper
;
import
com.liquidnet.service.platform.utils.ObjectUtil
;
import
com.liquidnet.service.platform.utils.QueueUtils
;
import
com.liquidnet.service.platform.utils.QueueUtils
;
import
lombok.extern.slf4j.Slf4j
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
import
org.springframework.stereotype.Service
;
import
org.springframework.util.CollectionUtils
;
import
org.springframework.util.CollectionUtils
;
...
@@ -25,8 +30,10 @@ import java.util.ArrayList;
...
@@ -25,8 +30,10 @@ import java.util.ArrayList;
import
java.util.LinkedList
;
import
java.util.LinkedList
;
import
java.util.List
;
import
java.util.List
;
import
java.util.Map
;
import
java.util.Map
;
import
java.util.concurrent.atomic.AtomicInteger
;
import
java.util.stream.Collectors
;
import
java.util.stream.Collectors
;
@Slf4j
@Service
@Service
public
class
PlatformCandyUserCouponService
extends
ServiceImpl
<
CandyUserCouponMapper
,
CandyUserCoupon
>
{
public
class
PlatformCandyUserCouponService
extends
ServiceImpl
<
CandyUserCouponMapper
,
CandyUserCoupon
>
{
@Autowired
@Autowired
...
@@ -35,8 +42,7 @@ public class PlatformCandyUserCouponService extends ServiceImpl<CandyUserCouponM
...
@@ -35,8 +42,7 @@ public class PlatformCandyUserCouponService extends ServiceImpl<CandyUserCouponM
private
CandyCouponRuleMapper
candyCouponRuleMapper
;
private
CandyCouponRuleMapper
candyCouponRuleMapper
;
@Autowired
@Autowired
private
CandyCommonCouponMapper
candyCommonCouponMapper
;
private
CandyCommonCouponMapper
candyCommonCouponMapper
;
@Autowired
private
PlatformCandyUserCouponService
platformCandyUserCouponService
;
@Autowired
@Autowired
private
QueueUtils
queueUtils
;
private
QueueUtils
queueUtils
;
@Autowired
@Autowired
...
@@ -51,7 +57,7 @@ public class PlatformCandyUserCouponService extends ServiceImpl<CandyUserCouponM
...
@@ -51,7 +57,7 @@ public class PlatformCandyUserCouponService extends ServiceImpl<CandyUserCouponM
//修改数据库
//修改数据库
CandyUserCoupon
userCoupon
=
CandyUserCoupon
.
getNew
();
CandyUserCoupon
userCoupon
=
CandyUserCoupon
.
getNew
();
userCoupon
.
setState
(
1
);
userCoupon
.
setState
(
1
);
platformCandyUserCouponService
.
update
(
userCoupon
,
new
UpdateWrapper
<
CandyUserCoupon
>().
in
(
"ucoupon_id"
,
uCouponIdList
));
this
.
update
(
userCoupon
,
new
UpdateWrapper
<
CandyUserCoupon
>().
in
(
"ucoupon_id"
,
uCouponIdList
));
//sendRedis
//sendRedis
int
forSize
=
500
;
int
forSize
=
500
;
int
forCount
=
uCouponUidList
.
size
()
%
forSize
==
0
?
uCouponUidList
.
size
()
/
forSize
:
(
uCouponUidList
.
size
()
/
forSize
)
+
1
;
int
forCount
=
uCouponUidList
.
size
()
%
forSize
==
0
?
uCouponUidList
.
size
()
/
forSize
:
(
uCouponUidList
.
size
()
/
forSize
)
+
1
;
...
@@ -112,4 +118,91 @@ public class PlatformCandyUserCouponService extends ServiceImpl<CandyUserCouponM
...
@@ -112,4 +118,91 @@ public class PlatformCandyUserCouponService extends ServiceImpl<CandyUserCouponM
}
}
return
basicDtoList
;
return
basicDtoList
;
}
}
/**
* 移除私有券
* - 处理已过期且过期天数超过`displayDays`的券
*
* @param currentDateTime 当前时间
* @param displayDays 展示天数
* @param usedDisplayFlg 已使用券逻辑处理
*/
public
int
rmvForUserCouponProcessing
(
LocalDateTime
currentDateTime
,
int
displayDays
,
boolean
usedDisplayFlg
)
{
AtomicInteger
pl
=
new
AtomicInteger
();
try
{
LambdaQueryWrapper
<
CandyUserCoupon
>
userCouponQueryWrapper
=
Wrappers
.
lambdaQuery
(
CandyUserCoupon
.
class
);
if
(
usedDisplayFlg
)
{
userCouponQueryWrapper
.
eq
(
CandyUserCoupon:
:
getState
,
5
);
userCouponQueryWrapper
.
le
(
CandyUserCoupon:
:
getUsedAt
,
currentDateTime
.
minusSeconds
(
displayDays
));
}
else
{
userCouponQueryWrapper
.
eq
(
CandyUserCoupon:
:
getState
,
3
);
userCouponQueryWrapper
.
le
(
CandyUserCoupon:
:
getDuedAt
,
currentDateTime
.
minusSeconds
(
displayDays
));
}
int
totalCount
=
this
.
count
(
userCouponQueryWrapper
);
int
remainCount
=
totalCount
,
pSize
=
1000
;
if
(
totalCount
>
0
)
{
log
.
info
(
"券移除处理:私有券[总数:{},AT:{} - {} = {}] >>> BEGIN BEGIN BEGIN"
,
totalCount
,
currentDateTime
,
displayDays
,
currentDateTime
.
minusDays
(
displayDays
));
}
ArrayList
<
CandyUserCoupon
>
updateUserCouponList
=
ObjectUtil
.
getCandyUserCouponArrayList
();
userCouponQueryWrapper
.
select
(
CandyUserCoupon:
:
getMid
,
CandyUserCoupon:
:
getUcouponId
,
CandyUserCoupon:
:
getUid
);
userCouponQueryWrapper
.
orderByAsc
(
CandyUserCoupon:
:
getMid
);
String
operator
=
usedDisplayFlg
?
"RMV-USED"
:
"RMV-DUED"
;
while
(
remainCount
>
0
)
{
updateUserCouponList
.
clear
();
LambdaQueryWrapper
<
CandyUserCoupon
>
userCouponLambdaQueryWrapper
=
userCouponQueryWrapper
.
clone
();
String
lastLimitSql
=
"LIMIT "
+
0
+
","
+
pSize
;
userCouponLambdaQueryWrapper
.
last
(
lastLimitSql
);
List
<
CandyUserCoupon
>
userCouponList
=
this
.
list
(
userCouponLambdaQueryWrapper
);
for
(
int
i
=
0
,
listSize
=
CollectionUtils
.
isEmpty
(
userCouponList
)
?
-
1
:
userCouponList
.
size
();
i
<
listSize
;
i
++)
{
CandyUserCoupon
userCoupon
=
userCouponList
.
get
(
i
);
userCoupon
.
setState
(
9
);
userCoupon
.
setOperator
(
operator
);
userCoupon
.
setUpdatedAt
(
currentDateTime
);
updateUserCouponList
.
add
(
userCoupon
);
}
if
(!
CollectionUtils
.
isEmpty
(
updateUserCouponList
))
{
if
(
this
.
updateBatchById
(
updateUserCouponList
,
updateUserCouponList
.
size
()))
{
AbstractRedisUtil
redisCandyUtil
=
redisDataSourceUtil
.
getRedisCandyUtil
();
// 需要更新的用户券记录按UID分组处理
Map
<
String
,
List
<
CandyUserCoupon
>>
userCouponListByUidMap
=
updateUserCouponList
.
stream
().
collect
(
Collectors
.
groupingBy
(
CandyUserCoupon:
:
getUid
));
userCouponListByUidMap
.
forEach
((
uid
,
updateUserCouponListByUid
)
->
{
String
uckey
=
CandyRedisConst
.
BASIC_USER_COUPON
.
concat
(
uid
);
List
<
CandyUserCouponBasicDto
>
vos
=
(
List
<
CandyUserCouponBasicDto
>)
redisCandyUtil
.
get
(
uckey
);
if
(!
CollectionUtils
.
isEmpty
(
vos
))
{
List
<
String
>
updateUserCouponIdListByUid
=
updateUserCouponListByUid
.
stream
().
map
(
CandyUserCoupon:
:
getUcouponId
).
collect
(
Collectors
.
toList
());
int
beforeSizeVos
=
vos
.
size
();
vos
.
removeIf
(
r
->
updateUserCouponIdListByUid
.
contains
(
r
.
getUcouponId
()));
if
(
beforeSizeVos
-
vos
.
size
()
>
0
)
{
pl
.
getAndAdd
(
beforeSizeVos
-
vos
.
size
());
if
(
vos
.
size
()
>
0
)
{
redisCandyUtil
.
set
(
uckey
,
vos
);
}
else
{
redisCandyUtil
.
del
(
uckey
);
}
}
}
});
}
else
{
throw
new
LiquidnetServiceException
(
"-1"
,
"券移除数据更新失败"
);
}
}
remainCount
=
Math
.
max
(
remainCount
-
pSize
,
0
);
log
.
info
(
"券移除处理中:私有券[总数:{},单次处理:{}|{},剩余:{}]"
,
totalCount
,
lastLimitSql
,
pl
.
get
(),
remainCount
);
}
if
(
totalCount
>
0
)
{
log
.
info
(
"券移除处理:私有券[总数:{},处理总数:{}] >>> END END END"
,
totalCount
,
pl
.
get
());
}
}
catch
(
Exception
e
)
{
log
.
error
(
"Ex.券移除处理异常:私有券[currentDateTime={},displayDays={},usedDisplayFlg={}]"
,
currentDateTime
,
displayDays
,
usedDisplayFlg
,
e
);
}
return
pl
.
get
();
}
}
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment