记得上下班打卡 | 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
712b5780
Commit
712b5780
authored
Jun 01, 2021
by
张国柄
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
验票API:
+刷新验票数据API; 登录返回+UID、MOBILE、NAME; 演出列表+城市、场地;
parent
91f31742
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
106 additions
and
19 deletions
+106
-19
KylinStationLoginVo.java
...m/liquidnet/service/kylin/dto/vo/KylinStationLoginVo.java
+31
-0
KylinStationPerformanceVo.java
...idnet/service/kylin/dto/vo/KylinStationPerformanceVo.java
+6
-2
KylinStationController.java
...dnet/service/kylin/controller/KylinStationController.java
+67
-17
KylinOrderTicketEntitiesServiceImpl.java
...lin/service/impl/KylinOrderTicketEntitiesServiceImpl.java
+2
-0
No files found.
liquidnet-bus-api/liquidnet-service-kylin-api/src/main/java/com/liquidnet/service/kylin/dto/vo/KylinStationLoginVo.java
0 → 100644
View file @
712b5780
package
com
.
liquidnet
.
service
.
kylin
.
dto
.
vo
;
import
io.swagger.annotations.ApiModel
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.Data
;
import
java.io.Serializable
;
@ApiModel
(
value
=
"KylinStationLoginVo"
,
description
=
"专业版登录成功响应数据"
)
@Data
public
class
KylinStationLoginVo
implements
Serializable
,
Cloneable
{
private
static
final
long
serialVersionUID
=
9097515630202255297L
;
@ApiModelProperty
(
position
=
10
,
value
=
"ID[64]"
)
private
String
uid
;
@ApiModelProperty
(
position
=
11
,
value
=
"手机号[11]"
)
private
String
mobile
;
@ApiModelProperty
(
position
=
12
,
value
=
"姓名[20]"
)
private
String
name
;
@ApiModelProperty
(
position
=
13
,
value
=
"TOKEN[255]"
)
private
String
token
;
private
static
final
KylinStationLoginVo
obj
=
new
KylinStationLoginVo
();
public
static
KylinStationLoginVo
getNew
()
{
try
{
return
(
KylinStationLoginVo
)
obj
.
clone
();
}
catch
(
CloneNotSupportedException
e
)
{
return
new
KylinStationLoginVo
();
}
}
}
liquidnet-bus-api/liquidnet-service-kylin-api/src/main/java/com/liquidnet/service/kylin/dto/vo/KylinStationPerformanceVo.java
View file @
712b5780
...
@@ -21,9 +21,13 @@ public class KylinStationPerformanceVo implements Serializable, Cloneable {
...
@@ -21,9 +21,13 @@ public class KylinStationPerformanceVo implements Serializable, Cloneable {
private
String
timeStart
;
private
String
timeStart
;
@ApiModelProperty
(
position
=
14
,
value
=
"结束时间[yyyy/MM/dd]"
)
@ApiModelProperty
(
position
=
14
,
value
=
"结束时间[yyyy/MM/dd]"
)
private
String
timeEnd
;
private
String
timeEnd
;
@ApiModelProperty
(
position
=
15
,
value
=
"票种列表信息"
)
@ApiModelProperty
(
position
=
15
,
value
=
"城市名称"
)
private
String
cityName
;
@ApiModelProperty
(
position
=
16
,
value
=
"场地名称"
)
private
String
fieldName
;
@ApiModelProperty
(
position
=
17
,
value
=
"票种列表信息"
)
private
List
<
KylinStationTicketVo
>
ticketVoList
;
private
List
<
KylinStationTicketVo
>
ticketVoList
;
@ApiModelProperty
(
position
=
1
6
,
value
=
"可下载时间"
)
@ApiModelProperty
(
position
=
1
8
,
value
=
"可下载时间"
)
private
String
canDownTime
;
private
String
canDownTime
;
private
static
final
KylinStationPerformanceVo
obj
=
new
KylinStationPerformanceVo
();
private
static
final
KylinStationPerformanceVo
obj
=
new
KylinStationPerformanceVo
();
...
...
liquidnet-bus-service/liquidnet-service-kylin/liquidnet-service-kylin-impl/src/main/java/com/liquidnet/service/kylin/controller/KylinStationController.java
View file @
712b5780
...
@@ -2,10 +2,7 @@ package com.liquidnet.service.kylin.controller;
...
@@ -2,10 +2,7 @@ package com.liquidnet.service.kylin.controller;
import
com.liquidnet.common.cache.redis.util.RedisUtil
;
import
com.liquidnet.common.cache.redis.util.RedisUtil
;
import
com.liquidnet.commons.lang.core.JwtValidator
;
import
com.liquidnet.commons.lang.core.JwtValidator
;
import
com.liquidnet.commons.lang.util.CurrentUtil
;
import
com.liquidnet.commons.lang.util.*
;
import
com.liquidnet.commons.lang.util.DateUtil
;
import
com.liquidnet.commons.lang.util.HttpUtil
;
import
com.liquidnet.commons.lang.util.JsonUtils
;
import
com.liquidnet.service.base.ErrorMapping
;
import
com.liquidnet.service.base.ErrorMapping
;
import
com.liquidnet.service.base.ResponseDto
;
import
com.liquidnet.service.base.ResponseDto
;
import
com.liquidnet.service.kylin.dto.param.CheckPerformanceRelationParam
;
import
com.liquidnet.service.kylin.dto.param.CheckPerformanceRelationParam
;
...
@@ -65,7 +62,7 @@ public class KylinStationController {
...
@@ -65,7 +62,7 @@ public class KylinStationController {
@ApiImplicitParam
(
type
=
"form"
,
dataType
=
"String"
,
name
=
"passwd"
,
value
=
"密码"
,
example
=
"123456"
),
@ApiImplicitParam
(
type
=
"form"
,
dataType
=
"String"
,
name
=
"passwd"
,
value
=
"密码"
,
example
=
"123456"
),
})
})
@PostMapping
(
"login"
)
@PostMapping
(
"login"
)
public
ResponseDto
<
String
>
login
(
@RequestParam
String
mobile
,
@RequestParam
String
passwd
)
{
public
ResponseDto
<
KylinStationLoginVo
>
login
(
@RequestParam
String
mobile
,
@RequestParam
String
passwd
)
{
log
.
info
(
"mobile:{},passwd:{}"
,
mobile
,
passwd
);
log
.
info
(
"mobile:{},passwd:{}"
,
mobile
,
passwd
);
return
this
.
loginVerification
(
mobile
,
passwd
,
true
);
return
this
.
loginVerification
(
mobile
,
passwd
,
true
);
...
@@ -77,7 +74,7 @@ public class KylinStationController {
...
@@ -77,7 +74,7 @@ public class KylinStationController {
@ApiImplicitParam
(
type
=
"body"
,
required
=
true
,
dataType
=
"String"
,
name
=
"code"
,
value
=
"验证码"
,
example
=
"111111"
),
@ApiImplicitParam
(
type
=
"body"
,
required
=
true
,
dataType
=
"String"
,
name
=
"code"
,
value
=
"验证码"
,
example
=
"111111"
),
})
})
@PostMapping
(
"login/sms"
)
@PostMapping
(
"login/sms"
)
public
ResponseDto
<
String
>
loginBySms
(
@RequestParam
String
mobile
,
@RequestParam
String
code
)
{
public
ResponseDto
<
KylinStationLoginVo
>
loginBySms
(
@RequestParam
String
mobile
,
@RequestParam
String
code
)
{
log
.
info
(
"mobile:{},code:{}"
,
mobile
,
code
);
log
.
info
(
"mobile:{},code:{}"
,
mobile
,
code
);
return
this
.
loginVerification
(
mobile
,
code
,
false
);
return
this
.
loginVerification
(
mobile
,
code
,
false
);
...
@@ -105,7 +102,7 @@ public class KylinStationController {
...
@@ -105,7 +102,7 @@ public class KylinStationController {
@ApiOperation
(
value
=
"演出列表"
)
@ApiOperation
(
value
=
"演出列表"
)
@ApiImplicitParams
({
@ApiImplicitParams
({
@ApiImplicitParam
(
type
=
"body"
,
required
=
true
,
dataType
=
"String"
,
name
=
"mod"
,
value
=
"模块[recent-近期的
,down-已下载,over-历史]"
,
allowableValues
=
"recent,down,over
"
),
@ApiImplicitParam
(
type
=
"body"
,
required
=
true
,
dataType
=
"String"
,
name
=
"mod"
,
value
=
"模块[recent-近期的
]"
,
allowableValues
=
"recent
"
),
})
})
@GetMapping
(
"performances/{mod}"
)
@GetMapping
(
"performances/{mod}"
)
public
ResponseDto
<
List
<
KylinStationPerformanceVo
>>
performances
(
@PathVariable
String
mod
)
{
public
ResponseDto
<
List
<
KylinStationPerformanceVo
>>
performances
(
@PathVariable
String
mod
)
{
...
@@ -208,15 +205,12 @@ public class KylinStationController {
...
@@ -208,15 +205,12 @@ public class KylinStationController {
@ApiOperation
(
value
=
"下载验票数据"
)
@ApiOperation
(
value
=
"下载验票数据"
)
@ApiImplicitParams
({
@ApiImplicitParams
({
@ApiImplicitParam
(
type
=
"
body
"
,
required
=
true
,
dataType
=
"String"
,
name
=
"type"
,
value
=
"类型[101-音乐节,102小型演出(livehouse演出),103巡演]"
,
allowableValues
=
"101,102,103"
),
@ApiImplicitParam
(
type
=
"
path
"
,
required
=
true
,
dataType
=
"String"
,
name
=
"type"
,
value
=
"类型[101-音乐节,102小型演出(livehouse演出),103巡演]"
,
allowableValues
=
"101,102,103"
),
@ApiImplicitParam
(
type
=
"
body
"
,
required
=
true
,
dataType
=
"String"
,
name
=
"performanceId"
,
value
=
"演出ID[64]"
),
@ApiImplicitParam
(
type
=
"
path
"
,
required
=
true
,
dataType
=
"String"
,
name
=
"performanceId"
,
value
=
"演出ID[64]"
),
})
})
@GetMapping
(
"download/{type}/{performanceId}"
)
@GetMapping
(
"download/{type}/{performanceId}"
)
public
ResponseDto
<
List
<
KylinStationCheckOrderVo
>>
downloadTicketData
(
@PathVariable
String
type
,
@PathVariable
String
performanceId
)
{
public
ResponseDto
<
List
<
KylinStationCheckOrderVo
>>
downloadTicketData
(
@PathVariable
String
type
,
@PathVariable
String
performanceId
)
{
log
.
info
(
"type:{},performanceId:{}"
,
type
,
performanceId
);
log
.
info
(
"type:{},performanceId:{}"
,
type
,
performanceId
);
List
<
KylinStationCheckOrderVo
>
voList
=
new
ArrayList
<>();
String
currentUid
=
CurrentUtil
.
getCurrentUid
();
String
currentUid
=
CurrentUtil
.
getCurrentUid
();
// 查取当前用户下关联演出ID列表
// 查取当前用户下关联演出ID列表
...
@@ -235,6 +229,8 @@ public class KylinStationController {
...
@@ -235,6 +229,8 @@ public class KylinStationController {
return
ResponseDto
.
failure
(
ErrorMapping
.
get
(
"20608"
));
return
ResponseDto
.
failure
(
ErrorMapping
.
get
(
"20608"
));
}
}
List
<
KylinStationCheckOrderVo
>
voList
=
new
ArrayList
<>();
// 查取演出对应的订单票明细
// 查取演出对应的订单票明细
Query
orderTicketEntitiesVoQuery
=
Query
.
query
(
Criteria
.
where
(
"performanceId"
).
is
(
performanceId
).
and
(
"isPayment"
).
is
(
1
));
Query
orderTicketEntitiesVoQuery
=
Query
.
query
(
Criteria
.
where
(
"performanceId"
).
is
(
performanceId
).
and
(
"isPayment"
).
is
(
1
));
voList
=
mongoTemplate
.
find
(
orderTicketEntitiesVoQuery
,
KylinStationCheckOrderVo
.
class
,
KylinOrderTicketEntitiesVo
.
class
.
getSimpleName
());
voList
=
mongoTemplate
.
find
(
orderTicketEntitiesVoQuery
,
KylinStationCheckOrderVo
.
class
,
KylinOrderTicketEntitiesVo
.
class
.
getSimpleName
());
...
@@ -254,17 +250,66 @@ public class KylinStationController {
...
@@ -254,17 +250,66 @@ public class KylinStationController {
@ApiOperation
(
value
=
"上载验票数据"
)
@ApiOperation
(
value
=
"上载验票数据"
)
@PostMapping
(
"upload"
)
@PostMapping
(
"upload"
)
public
ResponseDto
<
Boolean
>
uploadTicketData
(
@RequestBody
KylinStationCheckOrderParam
checkDataParam
)
{
public
ResponseDto
<
Object
>
uploadTicketData
(
@RequestBody
KylinStationCheckOrderParam
checkDataParam
)
{
log
.
info
(
"checkDataParams:{}"
,
JsonUtils
.
toJson
(
checkDataParam
));
log
.
info
(
"checkDataParams:{}"
,
JsonUtils
.
toJson
(
checkDataParam
));
kylinOrderTicketEntitiesService
.
updateByStation
(
checkDataParam
);
kylinOrderTicketEntitiesService
.
updateByStation
(
checkDataParam
);
return
ResponseDto
.
success
(
true
);
return
ResponseDto
.
success
();
}
@ApiOperation
(
value
=
"刷新验票数据"
)
@ApiImplicitParams
({
@ApiImplicitParam
(
type
=
"body"
,
required
=
true
,
dataType
=
"String"
,
name
=
"type"
,
value
=
"类型[101-音乐节,102小型演出(livehouse演出),103巡演]"
,
allowableValues
=
"101,102,103"
),
@ApiImplicitParam
(
type
=
"body"
,
required
=
true
,
dataType
=
"String"
,
name
=
"performanceId"
,
value
=
"演出ID[64]"
),
@ApiImplicitParam
(
type
=
"body"
,
required
=
true
,
dataType
=
"String"
,
name
=
"latestUpdateAt"
,
value
=
"最近更新时间[yyyy-MM-dd HH:mm:ss]"
),
})
@PostMapping
(
"refresh"
)
public
ResponseDto
<
List
<
KylinStationCheckOrderVo
>>
refreshTicketData
(
@PathVariable
String
type
,
@PathVariable
String
performanceId
,
@PathVariable
String
latestUpdateAt
)
{
log
.
info
(
"refresh type:{},performanceId:{},latestUpdateAt:{}"
,
type
,
performanceId
,
latestUpdateAt
);
String
currentUid
=
CurrentUtil
.
getCurrentUid
();
// 查取当前用户下关联演出ID列表
KylinCheckUserPerformanceVo
checkUserRelationVo
=
dataUtils
.
getCheckUserRelationVo
(
currentUid
);
List
<
CheckPerformanceRelationParam
>
relationParams
;
if
(
null
==
checkUserRelationVo
||
CollectionUtils
.
isEmpty
(
relationParams
=
checkUserRelationVo
.
getRelationParams
()))
{
return
ResponseDto
.
failure
(
ErrorMapping
.
get
(
"20606"
));
}
Optional
<
CheckPerformanceRelationParam
>
optional
=
relationParams
.
stream
().
findFirst
().
filter
(
r
->
r
.
getPerformanceId
().
equals
(
performanceId
));
if
(!
optional
.
isPresent
())
{
return
ResponseDto
.
failure
(
ErrorMapping
.
get
(
"20607"
));
}
CheckPerformanceRelationParam
relationParam
=
optional
.
get
();
LocalDateTime
canDownDt
=
DateUtil
.
Formatter
.
yyyyMMddHHmmss
.
parse
(
relationParam
.
getCanDownTime
());
if
(
canDownDt
.
isAfter
(
LocalDateTime
.
now
()))
{
return
ResponseDto
.
failure
(
ErrorMapping
.
get
(
"20608"
));
}
List
<
KylinStationCheckOrderVo
>
voList
=
new
ArrayList
<>();
// 查取演出对应的订单票明细
Query
orderTicketEntitiesVoQuery
=
Query
.
query
(
Criteria
.
where
(
"performanceId"
).
is
(
performanceId
).
and
(
"updatedAt"
).
gte
(
latestUpdateAt
)
);
voList
=
mongoTemplate
.
find
(
orderTicketEntitiesVoQuery
,
KylinStationCheckOrderVo
.
class
,
KylinOrderTicketEntitiesVo
.
class
.
getSimpleName
());
Query
query
=
Query
.
query
(
Criteria
.
where
(
"orderTicketsId"
).
in
(
voList
.
stream
().
map
(
KylinStationCheckOrderVo:
:
getOrderId
).
toArray
()
));
query
.
fields
().
include
(
"orderTicketsId"
).
include
(
"qrCode"
);
List
<
KylinOrderTicketVo
>
orderTicketVoList
=
mongoTemplate
.
find
(
query
,
KylinOrderTicketVo
.
class
,
KylinOrderTicketVo
.
class
.
getSimpleName
());
for
(
KylinOrderTicketVo
t
:
orderTicketVoList
)
for
(
KylinStationCheckOrderVo
r
:
voList
)
if
(
r
.
getOrderId
().
equals
(
t
.
getOrderTicketsId
()))
r
.
setQrCode
(
t
.
getQrCode
());
return
ResponseDto
.
success
(
voList
);
}
}
/* ------------------------------------------------------------------ */
/* ------------------------------------------------------------------ */
private
ResponseDto
<
String
>
loginVerification
(
String
mobile
,
String
identity
,
boolean
isPasswd
)
{
private
ResponseDto
<
KylinStationLoginVo
>
loginVerification
(
String
mobile
,
String
identity
,
boolean
isPasswd
)
{
KylinCheckUserVo
checkUserVo
=
mongoTemplate
.
findOne
(
Query
.
query
(
Criteria
.
where
(
"mobile"
).
is
(
mobile
)),
KylinCheckUserVo
checkUserVo
=
mongoTemplate
.
findOne
(
Query
.
query
(
Criteria
.
where
(
"mobile"
).
is
(
mobile
)),
KylinCheckUserVo
.
class
,
KylinCheckUserVo
.
class
.
getSimpleName
());
KylinCheckUserVo
.
class
,
KylinCheckUserVo
.
class
.
getSimpleName
());
...
@@ -309,7 +354,7 @@ public class KylinStationController {
...
@@ -309,7 +354,7 @@ public class KylinStationController {
}
}
}
}
private
ResponseDto
<
String
>
loginAuthentication
(
KylinCheckUserVo
checkUserVo
)
{
private
ResponseDto
<
KylinStationLoginVo
>
loginAuthentication
(
KylinCheckUserVo
checkUserVo
)
{
String
uid
=
checkUserVo
.
getCheckUserId
();
String
uid
=
checkUserVo
.
getCheckUserId
();
String
ssoKeyUid
=
jwtValidator
.
getSsoRedisKey
().
concat
(
uid
);
String
ssoKeyUid
=
jwtValidator
.
getSsoRedisKey
().
concat
(
uid
);
...
@@ -325,7 +370,12 @@ public class KylinStationController {
...
@@ -325,7 +370,12 @@ public class KylinStationController {
redisUtil
.
set
(
ssoKeyUidM5Token
,
true
,
jwtValidator
.
getExpireTtl
()
*
60
);
redisUtil
.
set
(
ssoKeyUidM5Token
,
true
,
jwtValidator
.
getExpireTtl
()
*
60
);
return
ResponseDto
.
success
(
token
);
KylinStationLoginVo
stationLoginVo
=
KylinStationLoginVo
.
getNew
();
stationLoginVo
.
setUid
(
checkUserVo
.
getCheckUserId
());
stationLoginVo
.
setMobile
(
SensitizeUtil
.
custom
(
checkUserVo
.
getMobile
(),
3
,
4
));
stationLoginVo
.
setName
(
SensitizeUtil
.
chineseName
(
checkUserVo
.
getName
()));
stationLoginVo
.
setToken
(
token
);
return
ResponseDto
.
success
(
stationLoginVo
);
}
}
private
static
<
T
>
Predicate
<
T
>
distinctByKey
(
Function
<?
super
T
,
Object
>
keyExtractor
)
{
private
static
<
T
>
Predicate
<
T
>
distinctByKey
(
Function
<?
super
T
,
Object
>
keyExtractor
)
{
...
...
liquidnet-bus-service/liquidnet-service-kylin/liquidnet-service-kylin-impl/src/main/java/com/liquidnet/service/kylin/service/impl/KylinOrderTicketEntitiesServiceImpl.java
View file @
712b5780
package
com
.
liquidnet
.
service
.
kylin
.
service
.
impl
;
package
com
.
liquidnet
.
service
.
kylin
.
service
.
impl
;
import
com.liquidnet.common.mq.constant.MQConst
;
import
com.liquidnet.common.mq.constant.MQConst
;
import
com.liquidnet.commons.lang.util.DateUtil
;
import
com.liquidnet.service.base.SqlMapping
;
import
com.liquidnet.service.base.SqlMapping
;
import
com.liquidnet.service.kylin.dto.param.KylinStationCheckOrderParam
;
import
com.liquidnet.service.kylin.dto.param.KylinStationCheckOrderParam
;
import
com.liquidnet.service.kylin.dto.vo.KylinOrderTicketEntitiesVo
;
import
com.liquidnet.service.kylin.dto.vo.KylinOrderTicketEntitiesVo
;
...
@@ -48,6 +49,7 @@ public class KylinOrderTicketEntitiesServiceImpl extends ServiceImpl<KylinOrderT
...
@@ -48,6 +49,7 @@ public class KylinOrderTicketEntitiesServiceImpl extends ServiceImpl<KylinOrderT
KylinOrderTicketEntitiesVo
updateVo
=
new
KylinOrderTicketEntitiesVo
();
KylinOrderTicketEntitiesVo
updateVo
=
new
KylinOrderTicketEntitiesVo
();
updateVo
.
setCheckClient
(
checkDataParam
.
getCheckClient
());
updateVo
.
setCheckClient
(
checkDataParam
.
getCheckClient
());
updateVo
.
setUpdatedAt
(
DateUtil
.
getNowTime
());
updateVo
.
setStatus
(
1
);
// 1-已出票
updateVo
.
setStatus
(
1
);
// 1-已出票
List
<
String
>
checkedEntitiesIdList
=
checkDataParam
.
getCheckedEntitiesIdList
();
List
<
String
>
checkedEntitiesIdList
=
checkDataParam
.
getCheckedEntitiesIdList
();
mongoTemplate
.
getCollection
(
KylinOrderTicketEntitiesVo
.
class
.
getSimpleName
()).
updateMany
(
mongoTemplate
.
getCollection
(
KylinOrderTicketEntitiesVo
.
class
.
getSimpleName
()).
updateMany
(
...
...
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