记得上下班打卡 | 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
04e7491c
Commit
04e7491c
authored
Nov 26, 2021
by
张国柄
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
+API:加入会员;
parent
f69c193d
Changes
5
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
103 additions
and
5 deletions
+103
-5
AdamRedisConst.java
...a/com/liquidnet/service/adam/constant/AdamRedisConst.java
+3
-0
AdamMemberJoinusVo.java
...com/liquidnet/service/adam/dto/vo/AdamMemberJoinusVo.java
+36
-0
AdamMemberVo.java
.../java/com/liquidnet/service/adam/dto/vo/AdamMemberVo.java
+1
-2
AdamMemberController.java
...quidnet/service/adam/controller/AdamMemberController.java
+47
-1
AdamRdmService.java
...va/com/liquidnet/service/adam/service/AdamRdmService.java
+16
-2
No files found.
liquidnet-bus-api/liquidnet-service-adam-api/src/main/java/com/liquidnet/service/adam/constant/AdamRedisConst.java
View file @
04e7491c
...
@@ -26,6 +26,7 @@ public class AdamRedisConst {
...
@@ -26,6 +26,7 @@ public class AdamRedisConst {
*/
*/
public
static
final
String
INFO_CERTIFICATION_JUNK
=
PREFIX
.
concat
(
"info:certification_junk:"
);
public
static
final
String
INFO_CERTIFICATION_JUNK
=
PREFIX
.
concat
(
"info:certification_junk:"
);
public
static
final
String
INFO_MEMBER_CARDFACE
=
PREFIX
.
concat
(
"info:member:cardface"
);
public
static
final
String
INFO_MEMBER_SIMPLE
=
PREFIX
.
concat
(
"info:member:simple"
);
public
static
final
String
INFO_MEMBER_SIMPLE
=
PREFIX
.
concat
(
"info:member:simple"
);
public
static
final
String
INFO_MEMBER_CATEGORY
=
PREFIX
.
concat
(
"info:member:category:"
);
public
static
final
String
INFO_MEMBER_CATEGORY
=
PREFIX
.
concat
(
"info:member:category:"
);
public
static
final
String
INFO_MEMBER_PRICE
=
PREFIX
.
concat
(
"info:member:price:"
);
public
static
final
String
INFO_MEMBER_PRICE
=
PREFIX
.
concat
(
"info:member:price:"
);
...
@@ -55,6 +56,8 @@ public class AdamRedisConst {
...
@@ -55,6 +56,8 @@ public class AdamRedisConst {
public
static
final
String
SWITCH_BUY_MEMBER
=
PREFIX
.
concat
(
"switch:buy:member"
);
public
static
final
String
SWITCH_BUY_MEMBER
=
PREFIX
.
concat
(
"switch:buy:member"
);
public
static
final
String
SERIAL_NUMBER_MEMBER
=
PREFIX
.
concat
(
"serial_no:"
);
/* ----------------------------------------------------------------- */
/* ----------------------------------------------------------------- */
// public static final String LOCK_KEY_UMEMBER_NO = "adam:lk:member:no";
// public static final String LOCK_KEY_UMEMBER_NO = "adam:lk:member:no";
...
...
liquidnet-bus-api/liquidnet-service-adam-api/src/main/java/com/liquidnet/service/adam/dto/vo/AdamMemberJoinusVo.java
0 → 100644
View file @
04e7491c
package
com
.
liquidnet
.
service
.
adam
.
dto
.
vo
;
import
io.swagger.annotations.ApiModel
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.Data
;
@ApiModel
(
value
=
"AdamMemberJoinusVo"
,
description
=
"领取的会员卡详情"
)
@Data
public
class
AdamMemberJoinusVo
implements
java
.
io
.
Serializable
,
Cloneable
{
private
static
final
long
serialVersionUID
=
-
2346451755376200201L
;
@ApiModelProperty
(
position
=
10
,
value
=
""
)
private
String
qrCode
;
@ApiModelProperty
(
position
=
11
,
value
=
"标题[50]"
,
example
=
"摩登天空会员卡"
)
private
String
title
;
@ApiModelProperty
(
position
=
12
,
value
=
"副标题[50]"
,
example
=
"摩登天空会员卡副标题"
)
private
String
subTitle
;
@ApiModelProperty
(
position
=
13
,
value
=
"卡面[200]"
,
example
=
"https://img.zhengzai.tv/member_card/member1.png"
)
private
String
cardface
;
@ApiModelProperty
(
position
=
14
,
value
=
"卡类型[0-非会员|10-普通会员|50-VIP会员]"
,
example
=
"0"
)
private
Integer
type
;
@ApiModelProperty
(
position
=
15
,
value
=
"卡状态[0-未领取|1-已领取]"
,
example
=
"0"
)
private
Integer
state
;
@ApiModelProperty
(
position
=
16
,
value
=
"权益详情[200]"
,
example
=
"加入摩登天空会员您可享受到....."
)
private
String
interestsDetail
;
private
static
final
AdamMemberJoinusVo
obj
=
new
AdamMemberJoinusVo
();
public
static
AdamMemberJoinusVo
getNew
()
{
try
{
return
(
AdamMemberJoinusVo
)
obj
.
clone
();
}
catch
(
CloneNotSupportedException
e
)
{
return
new
AdamMemberJoinusVo
();
}
}
}
liquidnet-bus-api/liquidnet-service-adam-api/src/main/java/com/liquidnet/service/adam/dto/vo/AdamMemberVo.java
View file @
04e7491c
...
@@ -120,10 +120,9 @@ public class AdamMemberVo implements java.io.Serializable, Cloneable {
...
@@ -120,10 +120,9 @@ public class AdamMemberVo implements java.io.Serializable, Cloneable {
try
{
try
{
return
(
AdamMemberVo
)
obj
.
clone
();
return
(
AdamMemberVo
)
obj
.
clone
();
}
catch
(
CloneNotSupportedException
e
)
{
}
catch
(
CloneNotSupportedException
e
)
{
e
.
printStackTrace
();
}
return
new
AdamMemberVo
();
return
new
AdamMemberVo
();
}
}
}
public
AdamMemberVo
copy
(
AdamMember
source
)
{
public
AdamMemberVo
copy
(
AdamMember
source
)
{
if
(
null
==
source
)
return
this
;
if
(
null
==
source
)
return
this
;
...
...
liquidnet-bus-service/liquidnet-service-adam/liquidnet-service-adam-impl/src/main/java/com/liquidnet/service/adam/controller/AdamMemberController.java
View file @
04e7491c
...
@@ -80,7 +80,7 @@ public class AdamMemberController {
...
@@ -80,7 +80,7 @@ public class AdamMemberController {
return
ResponseDto
.
success
(
adamRdmService
.
getMemberRightsDetailVoByRightsId
(
memberId
,
mrightsId
));
return
ResponseDto
.
success
(
adamRdmService
.
getMemberRightsDetailVoByRightsId
(
memberId
,
mrightsId
));
}
}
@ApiOperationSupport
(
order
=
1
)
@ApiOperationSupport
(
order
=
4
)
@ApiOperation
(
value
=
"会员开售状态"
)
@ApiOperation
(
value
=
"会员开售状态"
)
@GetMapping
(
"onsale"
)
@GetMapping
(
"onsale"
)
public
ResponseDto
<
Integer
>
onsale
()
{
public
ResponseDto
<
Integer
>
onsale
()
{
...
@@ -92,6 +92,52 @@ public class AdamMemberController {
...
@@ -92,6 +92,52 @@ public class AdamMemberController {
return
ResponseDto
.
success
(
1
);
return
ResponseDto
.
success
(
1
);
}
}
@ApiOperationSupport
(
order
=
5
)
@ApiOperation
(
value
=
"加入会员信息"
)
@GetMapping
(
"joininfo"
)
public
ResponseDto
<
AdamMemberJoinusVo
>
joininfo
()
{
String
currentUid
=
CurrentUtil
.
getCurrentUid
();
AdamMemberJoinusVo
memberJoinusVo
=
AdamMemberJoinusVo
.
getNew
();
// AdamMemberSimpleVo memberSimpleVo = adamRdmService.getMemberSimpleVo();
// if (null != memberSimpleVo) {
// memberJoinusVo.setTitle(memberSimpleVo.getTitle());
// memberJoinusVo.setSubTitle(memberSimpleVo.getSubTitle());
// }
AdamUserInfoVo
userInfoVo
=
adamRdmService
.
getUserInfoVoByUid
(
currentUid
);
boolean
lN
=
StringUtils
.
startsWithIgnoreCase
(
userInfoVo
.
getQrCode
(),
"lN"
);
memberJoinusVo
.
setState
(
lN
?
0
:
1
);
memberJoinusVo
.
setType
(
lN
?
0
:
10
);
memberJoinusVo
.
setQrCode
(
userInfoVo
.
getQrCode
());
memberJoinusVo
.
setCardface
(
adamRdmService
.
getMemberCardface
(
memberJoinusVo
.
getType
()));
return
ResponseDto
.
success
(
memberJoinusVo
);
}
@ApiOperationSupport
(
order
=
6
)
@ApiOperation
(
value
=
"加入会员"
)
@GetMapping
(
"joinus"
)
public
ResponseDto
<
AdamMemberJoinusVo
>
joinus
()
{
AdamMemberJoinusVo
memberJoinusVo
=
AdamMemberJoinusVo
.
getNew
();
String
currentUid
=
CurrentUtil
.
getCurrentUid
();
AdamMemberSimpleVo
memberSimpleVo
=
adamRdmService
.
getMemberSimpleVo
();
if
(
null
!=
memberSimpleVo
)
{
memberJoinusVo
.
setTitle
(
memberSimpleVo
.
getTitle
());
memberJoinusVo
.
setSubTitle
(
memberSimpleVo
.
getSubTitle
());
}
AdamUserInfoVo
userInfoVo
=
adamRdmService
.
getUserInfoVoByUid
(
currentUid
);
if
(
StringUtils
.
startsWithIgnoreCase
(
userInfoVo
.
getQrCode
(),
"lN"
))
{
// `lN`开头即未领取,这里做领取操作
userInfoVo
.
setQrCode
(
adamRdmService
.
generateMemberUniqueSerialNumber
(
userInfoVo
.
getMobile
()));
adamRdmService
.
setUserInfoVoByUid
(
currentUid
,
userInfoVo
);
}
memberJoinusVo
.
setState
(
1
);
memberJoinusVo
.
setQrCode
(
userInfoVo
.
getQrCode
());
memberJoinusVo
.
setCardface
(
adamRdmService
.
getMemberCardface
(
memberJoinusVo
.
getType
()));
return
ResponseDto
.
success
(
memberJoinusVo
);
}
/* ------------------------------------------------------------|@API:RSC */
/* ------------------------------------------------------------|@API:RSC */
@ApiOperationSupport
(
order
=
99
)
@ApiOperationSupport
(
order
=
99
)
...
...
liquidnet-bus-service/liquidnet-service-adam/liquidnet-service-adam-impl/src/main/java/com/liquidnet/service/adam/service/AdamRdmService.java
View file @
04e7491c
...
@@ -17,6 +17,8 @@ import org.springframework.util.CollectionUtils;
...
@@ -17,6 +17,8 @@ import org.springframework.util.CollectionUtils;
import
org.springframework.util.StringUtils
;
import
org.springframework.util.StringUtils
;
import
java.time.LocalDateTime
;
import
java.time.LocalDateTime
;
import
java.time.temporal.ChronoField
;
import
java.time.temporal.TemporalField
;
import
java.util.ArrayList
;
import
java.util.ArrayList
;
import
java.util.Arrays
;
import
java.util.Arrays
;
import
java.util.List
;
import
java.util.List
;
...
@@ -816,15 +818,27 @@ public class AdamRdmService {
...
@@ -816,15 +818,27 @@ public class AdamRdmService {
return
vo
;
return
vo
;
}
}
/* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - | */
public
String
generateMemberUniqueSerialNumber
(
String
mobile
)
{
LocalDateTime
now
=
LocalDateTime
.
now
();
/* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - | */
String
sn
=
String
.
format
(
"%s%sMS%s"
,
now
.
getYear
(),
now
.
getMonthValue
(),
mobile
.
substring
(
7
)).
substring
(
2
);
Object
o
=
redisUtil
.
get
(
AdamRedisConst
.
SERIAL_NUMBER_MEMBER
.
concat
(
sn
.
replace
(
"MS"
,
String
.
valueOf
(
now
.
getLong
(
ChronoField
.
MICRO_OF_SECOND
)))));
while
(
null
!=
o
)
{
String
nano
=
String
.
valueOf
(
System
.
nanoTime
());
o
=
redisUtil
.
get
(
AdamRedisConst
.
SERIAL_NUMBER_MEMBER
.
concat
(
sn
.
replace
(
"MS"
,
nano
.
substring
(
nano
.
length
()
-
3
))));
}
return
sn
;
}
/* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - | */
/* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - | */
public
String
getMemberCardface
(
int
type
)
{
return
(
String
)
redisUtil
.
get
(
AdamRedisConst
.
INFO_MEMBER_CARDFACE
.
concat
(
String
.
valueOf
(
type
)));
}
/* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - | */
/* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - | */
...
...
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