记得上下班打卡 | 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
45269602
Commit
45269602
authored
Dec 07, 2021
by
张国柄
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
~创建券-领取方式[2-积分商品|4-会员专属]不生成券有效期,实际发放时计算;
parent
44b46d26
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
35 additions
and
12 deletions
+35
-12
PlatformCandyCouponService.java
...atform/service/impl/candy/PlatformCandyCouponService.java
+35
-12
No files found.
liquidnet-bus-service/liquidnet-service-platform/liquidnet-service-platform-impl/src/main/java/com/liquidnet/service/platform/service/impl/candy/PlatformCandyCouponService.java
View file @
45269602
...
...
@@ -56,7 +56,7 @@ public class PlatformCandyCouponService extends ServiceImpl<CandyCouponMapper, C
// String couponInfoDtoKey = CandyRedisConst.BASIC_COUPON_INFO.concat(couponInfoDto.getCouponId());
// redisDataSourceUtil.getRedisCandyUtil().set(couponInfoDtoKey, couponInfoDto);
switch
(
coupon
.
getBindType
())
{
// 领取方式[0-用户输入兑换|1-发放至用户|2-积分
商品
|3-发放需领取|4-会员专属]
switch
(
coupon
.
getBindType
())
{
// 领取方式[0-用户输入兑换|1-发放至用户|2-积分
兑换
|3-发放需领取|4-会员专属]
case
0
:
this
.
processingCouponCode
(
mgtCoupon
,
coupon
);
break
;
...
...
@@ -213,6 +213,11 @@ public class PlatformCandyCouponService extends ServiceImpl<CandyCouponMapper, C
int
totalCount
=
userMemberCount
,
eventAmt
=
mgtCoupon
.
getEventAmt
();
log
.
info
(
"发放券处理中:目标全体会员[总数:{},发放量:{}]"
,
userMemberCount
,
eventAmt
);
String
mcouponId
=
mgtCoupon
.
getMcouponId
();
String
couponId
=
coupon
.
getCouponId
();
LocalDateTime
couponEffectAt
=
coupon
.
getEffectAt
();
LocalDateTime
couponExpireAt
=
coupon
.
getExpireAt
();
// 会员权益券失效时间duedAt需要同步会员到期时间expiryAt
Integer
exclusively
=
mgtCoupon
.
getExclusively
();
boolean
isMemberRightsCoupon
=
exclusively
==
1
;
...
...
@@ -232,17 +237,18 @@ public class PlatformCandyCouponService extends ServiceImpl<CandyCouponMapper, C
CandyUserCoupon
userCoupon
=
new
CandyUserCoupon
();
userCoupon
.
setUcouponId
(
IDGenerator
.
get32UUID
());
userCoupon
.
setMcouponId
(
m
gtCoupon
.
getMcouponId
()
);
userCoupon
.
setMcouponId
(
m
couponId
);
userCoupon
.
setUid
(
userMember
.
getUid
());
userCoupon
.
setCouponId
(
coupon
.
getCouponId
()
);
userCoupon
.
setCouponId
(
coupon
Id
);
userCoupon
.
setExclusive
(
exclusively
);
userCoupon
.
setState
(
1
);
userCoupon
.
setBindAt
(
coupon
.
getEffectAt
());
// userCoupon.setDuedAt(coupon.getExpireAt());
// userCoupon.setBindAt(couponEffectAt);
// userCoupon.setDuedAt(couponExpireAt);
userCoupon
.
setBindAt
(
null
==
couponEffectAt
?
now
:
couponEffectAt
);
if
(
isMemberRightsCoupon
)
{
userCoupon
.
setDuedAt
(
userMember
.
getExpiryAt
());
}
else
{
userCoupon
.
setDuedAt
(
coupon
.
getExpireAt
()
);
userCoupon
.
setDuedAt
(
coupon
ExpireAt
);
}
userCoupon
.
setCreatedAt
(
now
);
...
...
@@ -301,6 +307,12 @@ public class PlatformCandyCouponService extends ServiceImpl<CandyCouponMapper, C
coupon
.
setExpireAt
(
coupon
.
getEffectAt
().
plusDays
(
coupon
.
getValidity
()).
withHour
(
23
).
withMinute
(
59
).
withSecond
(
59
));
}
String
mcouponId
=
mgtCoupon
.
getMcouponId
();
String
operator
=
mgtCoupon
.
getOperator
();
String
couponId
=
coupon
.
getCouponId
();
LocalDateTime
couponEffectAt
=
coupon
.
getEffectAt
();
LocalDateTime
couponExpireAt
=
coupon
.
getExpireAt
();
// 指定手机号发放券中,会员权益券失效时间duedAt需要同步会员到期时间expiryAt
Integer
exclusively
=
mgtCoupon
.
getExclusively
();
boolean
isMemberRightsCoupon
=
exclusively
==
1
;
...
...
@@ -311,19 +323,30 @@ public class PlatformCandyCouponService extends ServiceImpl<CandyCouponMapper, C
if
(
StringUtils
.
isNotEmpty
(
uid
))
{
CandyUserCoupon
userCoupon
=
new
CandyUserCoupon
();
userCoupon
.
setUcouponId
(
IDGenerator
.
get32UUID
());
userCoupon
.
setMcouponId
(
m
gtCoupon
.
getMcouponId
()
);
userCoupon
.
setMcouponId
(
m
couponId
);
userCoupon
.
setUid
(
uid
);
userCoupon
.
setCouponId
(
coupon
.
getCouponId
()
);
userCoupon
.
setCouponId
(
coupon
Id
);
userCoupon
.
setExclusive
(
exclusively
);
userCoupon
.
setState
(
1
);
userCoupon
.
setBindAt
(
coupon
.
getEffectAt
()
);
// userCoupon.setBindAt(couponEffectAt
);
if
(
isMemberRightsCoupon
)
{
AdamUserMemberVo
vo
=
(
AdamUserMemberVo
)
redisAdamUtil
.
get
(
AdamRedisConst
.
INFO_USER_MEMBER
.
concat
(
uid
));
if
(
null
!=
vo
&&
vo
.
isActive
())
{
userCoupon
.
setBindAt
(
now
);
userCoupon
.
setDuedAt
(
vo
.
getExpiryAt
());
}
else
{
// 非会员(或无效会员)跳过
log
.
warn
(
"发放券处理中:目标指定手机号,该用户非会员或会员已过期[mcouponId:{},couponId:{},uid:{}]"
,
mcouponId
,
couponId
,
uid
);
continue
;
}
}
else
if
(
null
!=
couponExpireAt
&&
couponExpireAt
.
isAfter
(
now
))
{
userCoupon
.
setBindAt
(
null
==
couponEffectAt
?
now
:
couponEffectAt
);
userCoupon
.
setDuedAt
(
couponExpireAt
);
}
else
{
userCoupon
.
setDuedAt
(
coupon
.
getExpireAt
());
log
.
warn
(
"发放券处理中:目标指定手机号,该券生效日期或失效日期无效[mcouponId:{},couponId:{},effectAt:{},expireAt:{}]"
,
mcouponId
,
couponId
,
couponEffectAt
,
couponExpireAt
);
continue
;
}
userCoupon
.
setOperator
(
operator
);
userCoupon
.
setCreatedAt
(
now
);
initUserCouponList
.
add
(
userCoupon
);
...
...
@@ -349,7 +372,7 @@ public class PlatformCandyCouponService extends ServiceImpl<CandyCouponMapper, C
redisCandyUtil
.
set
(
uckey
,
vos
);
});
}
else
{
throw
new
LiquidnetServiceException
(
"-1"
,
String
.
format
(
"券发放失败[mcouponId=%s]"
,
m
gtCoupon
.
getMcouponId
()
));
throw
new
LiquidnetServiceException
(
"-1"
,
String
.
format
(
"券发放失败[mcouponId=%s]"
,
m
couponId
));
}
}
log
.
info
(
"发放券处理中:目标指定手机号[总数:{},发放量:{},实际处理:{}]"
,
limitSize
,
eventAmt
,
pl
);
...
...
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