记得上下班打卡 | 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
be8394c6
Commit
be8394c6
authored
Jul 31, 2021
by
胡佳晨
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'dev' into test
parents
d7f68029
32c78e5b
Changes
10
Show whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
153 additions
and
39 deletions
+153
-39
KylinRedisConst.java
...com/liquidnet/service/kylin/constant/KylinRedisConst.java
+1
-0
KylinPerformancesAdminServiceImpl.java
...kylin/service/impl/KylinPerformancesAdminServiceImpl.java
+3
-1
DataUtils.java
...iquidnet/client/admin/zhengzai/kylin/utils/DataUtils.java
+27
-2
HttpUtil.java
...c/main/java/com/liquidnet/commons/lang/util/HttpUtil.java
+2
-1
RestTemplateConfig.java
...iquidnet/commons/lang/util/spring/RestTemplateConfig.java
+68
-0
KylinUtils.java
...om/liquidnet/service/consumer/kylin/Utils/KylinUtils.java
+17
-2
mongo_db_del.sql
...-kylin/liquidnet-service-kylin-impl/docu/mongo_db_del.sql
+1
-1
KylinOrderTicketsServiceImpl.java
...vice/order/service/impl/KylinOrderTicketsServiceImpl.java
+0
-28
DataUtils.java
...ain/java/com/liquidnet/service/order/utils/DataUtils.java
+17
-2
DataUtils.java
.../java/com/liquidnet/service/platform/utils/DataUtils.java
+17
-2
No files found.
liquidnet-bus-api/liquidnet-service-kylin-api/src/main/java/com/liquidnet/service/kylin/constant/KylinRedisConst.java
View file @
be8394c6
...
@@ -3,6 +3,7 @@ package com.liquidnet.service.kylin.constant;
...
@@ -3,6 +3,7 @@ package com.liquidnet.service.kylin.constant;
public
class
KylinRedisConst
{
public
class
KylinRedisConst
{
public
static
final
String
FIELDS
=
"kylin:fields:id"
;
public
static
final
String
FIELDS
=
"kylin:fields:id"
;
public
static
final
String
PERFORMANCES
=
"kylin:performances:id:"
;
public
static
final
String
PERFORMANCES
=
"kylin:performances:id:"
;
public
static
final
String
PERFORMANCES_TRUE_NAME
=
"kylin:performances_true_name:id:"
;
public
static
final
String
PERFORMANCES_LIST_CITYNAME
=
"kylin:performances:cityName:"
;
public
static
final
String
PERFORMANCES_LIST_CITYNAME
=
"kylin:performances:cityName:"
;
public
static
final
String
PERFORMANCES_LIST_ALL
=
"kylin:performances:cityName*"
;
public
static
final
String
PERFORMANCES_LIST_ALL
=
"kylin:performances:cityName*"
;
public
static
final
String
PERFORMANCES_LIST_SYSTEM_RECOMMEND
=
"kylin:performances:systemRecommend"
;
public
static
final
String
PERFORMANCES_LIST_SYSTEM_RECOMMEND
=
"kylin:performances:systemRecommend"
;
...
...
liquidnet-bus-client/liquidnet-client-admin/liquidnet-client-admin-zhengzai/src/main/java/com/liquidnet/client/admin/zhengzai/kylin/service/impl/KylinPerformancesAdminServiceImpl.java
View file @
be8394c6
...
@@ -114,13 +114,14 @@ public class KylinPerformancesAdminServiceImpl extends ServiceImpl<KylinPerforma
...
@@ -114,13 +114,14 @@ public class KylinPerformancesAdminServiceImpl extends ServiceImpl<KylinPerforma
map
.
put
(
"auditStatus"
,
auditStatus
);
map
.
put
(
"auditStatus"
,
auditStatus
);
map
.
put
(
"updatedAt"
,
updatedAt
.
format
(
DateTimeFormatter
.
ofPattern
(
"yyyy-MM-dd HH:mm:ss"
)));
map
.
put
(
"updatedAt"
,
updatedAt
.
format
(
DateTimeFormatter
.
ofPattern
(
"yyyy-MM-dd HH:mm:ss"
)));
BasicDBObject
objectPerformanceVo
=
new
BasicDBObject
(
"$set"
,
mongoConverter
.
convertToMongoType
(
map
));
BasicDBObject
objectPerformanceVo
=
new
BasicDBObject
(
"$set"
,
mongoConverter
.
convertToMongoType
(
map
));
Document
doc
=
mongoTemplate
.
getCollection
(
PerformancePartnerVo
.
class
.
getSimpleName
()).
findOneAndUpdate
(
mongoTemplate
.
getCollection
(
PerformancePartnerVo
.
class
.
getSimpleName
()).
findOneAndUpdate
(
Query
.
query
(
Criteria
.
where
(
"performancesId"
).
is
(
performancesId
)).
getQueryObject
(),
Query
.
query
(
Criteria
.
where
(
"performancesId"
).
is
(
performancesId
)).
getQueryObject
(),
objectPerformanceVo
,
objectPerformanceVo
,
new
FindOneAndUpdateOptions
().
returnDocument
(
ReturnDocument
.
AFTER
)
new
FindOneAndUpdateOptions
().
returnDocument
(
ReturnDocument
.
AFTER
)
);
);
KylinPerformanceStatus
sqlStatus
=
performanceStatusMapper
.
selectOne
(
new
UpdateWrapper
<
KylinPerformanceStatus
>().
eq
(
"performance_id"
,
performancesId
));
KylinPerformanceStatus
sqlStatus
=
performanceStatusMapper
.
selectOne
(
new
UpdateWrapper
<
KylinPerformanceStatus
>().
eq
(
"performance_id"
,
performancesId
));
dataUtils
.
setPerformanceIsTrueName
(
performancesId
,
sqlStatus
.
getIsTrueName
());
if
(
sqlStatus
.
getStatus
()
==
1
)
{
if
(
sqlStatus
.
getStatus
()
==
1
)
{
log
.
info
(
" PERFORMANCE 演出审核 第一次"
);
log
.
info
(
" PERFORMANCE 演出审核 第一次"
);
//修改
//修改
...
@@ -163,6 +164,7 @@ public class KylinPerformancesAdminServiceImpl extends ServiceImpl<KylinPerforma
...
@@ -163,6 +164,7 @@ public class KylinPerformancesAdminServiceImpl extends ServiceImpl<KylinPerforma
performanceVoUtils
.
performanceVoStatus
(
performancesId
);
performanceVoUtils
.
performanceVoStatus
(
performancesId
);
}
}
}
}
dataUtils
.
delPerformanceRedis
(
performancesId
);
dataUtils
.
delPerformanceRedis
(
performancesId
);
}
else
if
(
status
==
4
)
{
}
else
if
(
status
==
4
)
{
log
.
info
(
" PERFORMANCE 演出审核 拒绝"
);
log
.
info
(
" PERFORMANCE 演出审核 拒绝"
);
...
...
liquidnet-bus-client/liquidnet-client-admin/liquidnet-client-admin-zhengzai/src/main/java/com/liquidnet/client/admin/zhengzai/kylin/utils/DataUtils.java
View file @
be8394c6
...
@@ -82,6 +82,16 @@ public class DataUtils {
...
@@ -82,6 +82,16 @@ public class DataUtils {
redisUtil
.
del
(
KylinRedisConst
.
PERFORMANCES
+
performanceId
);
redisUtil
.
del
(
KylinRedisConst
.
PERFORMANCES
+
performanceId
);
}
}
/**
* 演出是否实名
*
* @param performanceId
* @param isTrueName
*/
public
void
setPerformanceIsTrueName
(
String
performanceId
,
int
isTrueName
)
{
redisUtil
.
set
(
KylinRedisConst
.
PERFORMANCES_TRUE_NAME
+
performanceId
,
isTrueName
);
}
/**
/**
* 删除场次redis
* 删除场次redis
*
*
...
@@ -219,6 +229,22 @@ public class DataUtils {
...
@@ -219,6 +229,22 @@ public class DataUtils {
return
(
KylinPerformanceVo
)
redisUtil
.
get
(
KylinRedisConst
.
PERFORMANCES
+
performanceId
);
return
(
KylinPerformanceVo
)
redisUtil
.
get
(
KylinRedisConst
.
PERFORMANCES
+
performanceId
);
}
}
/**
* 演出是否实名
*
* @param performanceId
*/
public
int
getPerformanceIsTrueName
(
String
performanceId
)
{
Object
obj
=
redisUtil
.
get
(
KylinRedisConst
.
PERFORMANCES_TRUE_NAME
+
performanceId
);
if
(
obj
!=
null
)
{
return
(
int
)
obj
;
}
else
{
int
isTrueName
=
getPerformanceVo
(
performanceId
).
getIsTrueName
();
redisUtil
.
set
(
KylinRedisConst
.
PERFORMANCES_TRUE_NAME
+
performanceId
,
isTrueName
);
return
isTrueName
;
}
}
/**
/**
* @param performanceId 演出id
* @param performanceId 演出id
* @param ticketId 票种id
* @param ticketId 票种id
...
@@ -227,8 +253,7 @@ public class DataUtils {
...
@@ -227,8 +253,7 @@ public class DataUtils {
public
void
changeBuyInfo
(
String
userId
,
String
idCard
,
String
performanceId
,
String
ticketId
,
int
buyCount
)
{
public
void
changeBuyInfo
(
String
userId
,
String
idCard
,
String
performanceId
,
String
ticketId
,
int
buyCount
)
{
String
redisKey
;
String
redisKey
;
KylinPerformanceVo
vo
=
getPerformanceVo
(
performanceId
);
int
isTrueName
=
getPerformanceIsTrueName
(
performanceId
);
int
isTrueName
=
vo
.
getIsTrueName
();
// String useTime = "";
// String useTime = "";
// HashMap<String, ArrayList<String>> allTicketId = new HashMap<>();
// HashMap<String, ArrayList<String>> allTicketId = new HashMap<>();
// for (int x = 0; x < vo.getTicketTimeList().size(); x++) {
// for (int x = 0; x < vo.getTicketTimeList().size(); x++) {
...
...
liquidnet-bus-common/liquidnet-common-base/src/main/java/com/liquidnet/commons/lang/util/HttpUtil.java
View file @
be8394c6
package
com
.
liquidnet
.
commons
.
lang
.
util
;
package
com
.
liquidnet
.
commons
.
lang
.
util
;
import
com.liquidnet.commons.lang.util.spring.RestTemplateConfig
;
import
org.springframework.http.*
;
import
org.springframework.http.*
;
import
org.springframework.util.LinkedMultiValueMap
;
import
org.springframework.util.LinkedMultiValueMap
;
import
org.springframework.util.MultiValueMap
;
import
org.springframework.util.MultiValueMap
;
...
@@ -14,7 +15,7 @@ public class HttpUtil {
...
@@ -14,7 +15,7 @@ public class HttpUtil {
private
static
RestTemplate
restTemplate
;
private
static
RestTemplate
restTemplate
;
static
{
static
{
restTemplate
=
new
RestTemplate
();
restTemplate
=
RestTemplateConfig
.
get
RestTemplate
();
}
}
/**
/**
...
...
liquidnet-bus-common/liquidnet-common-base/src/main/java/com/liquidnet/commons/lang/util/spring/RestTemplateConfig.java
0 → 100644
View file @
be8394c6
package
com
.
liquidnet
.
commons
.
lang
.
util
.
spring
;
import
org.apache.http.client.HttpClient
;
import
org.apache.http.impl.client.HttpClientBuilder
;
import
org.apache.http.impl.client.HttpClients
;
import
org.apache.http.impl.conn.PoolingHttpClientConnectionManager
;
import
org.springframework.http.client.HttpComponentsClientHttpRequestFactory
;
import
org.springframework.web.client.DefaultResponseErrorHandler
;
import
org.springframework.web.client.RestTemplate
;
import
java.util.concurrent.TimeUnit
;
/**
* @author AnJiabin <anjiabin@zhengzai.tv>
* @version V1.0
* @Description: TODO
* @class: RestTemplateConfig
* @Package com.liquidnet.commons.lang.util.spring
* @Copyright: LightNet @ Copyright (c) 2021
* @date 2021/7/31 14:57
*/
public
class
RestTemplateConfig
{
private
static
RestTemplate
restTemplate
;
static
{
// 长链接保持时间长度20秒
PoolingHttpClientConnectionManager
poolConnManager
=
new
PoolingHttpClientConnectionManager
(
20
,
TimeUnit
.
SECONDS
);
// 设置最大链接数
poolConnManager
.
setMaxTotal
(
500
*
getMaxCpuCore
()
+
500
);
// 单路由的并发数
poolConnManager
.
setDefaultMaxPerRoute
(
500
*
getMaxCpuCore
());
HttpClientBuilder
httpClientBuilder
=
HttpClients
.
custom
();
httpClientBuilder
.
setConnectionManager
(
poolConnManager
);
// 重试次数3次,并开启
// httpClientBuilder.setRetryHandler(new DefaultHttpRequestRetryHandler(3,true));
HttpClient
httpClient
=
httpClientBuilder
.
build
();
// // 保持长链接配置,keep-alive
// httpClientBuilder.setKeepAliveStrategy(new DefaultConnectionKeepAliveStrategy());
HttpComponentsClientHttpRequestFactory
httpComponentsClientHttpRequestFactory
=
new
HttpComponentsClientHttpRequestFactory
(
httpClient
);
// 链接超时配置 5秒
httpComponentsClientHttpRequestFactory
.
setConnectTimeout
(
5000
);
// 连接读取超时配置
// httpComponentsClientHttpRequestFactory.setReadTimeout(10000);
// 连接池不够用时候等待时间长度设置,分词那边 500毫秒 ,我们这边设置成1秒
httpComponentsClientHttpRequestFactory
.
setConnectionRequestTimeout
(
5000
);
// 缓冲请求数据,POST大量数据,可以设定为true 我们这边机器比较内存较大
httpComponentsClientHttpRequestFactory
.
setBufferRequestBody
(
true
);
restTemplate
=
new
RestTemplate
();
restTemplate
.
setRequestFactory
(
httpComponentsClientHttpRequestFactory
);
restTemplate
.
setErrorHandler
(
new
DefaultResponseErrorHandler
());
}
public
static
RestTemplate
getRestTemplate
(){
return
restTemplate
;
}
private
static
int
getMaxCpuCore
(){
int
cpuCore
=
Runtime
.
getRuntime
().
availableProcessors
();
return
cpuCore
;
}
}
liquidnet-bus-service/liquidnet-service-consumer-all/liquidnet-service-consumer-kylin/src/main/java/com/liquidnet/service/consumer/kylin/Utils/KylinUtils.java
View file @
be8394c6
...
@@ -87,8 +87,7 @@ public class KylinUtils {
...
@@ -87,8 +87,7 @@ public class KylinUtils {
public
void
changeBuyInfo
(
String
userId
,
String
idCard
,
String
performanceId
,
String
ticketId
,
int
buyCount
)
{
public
void
changeBuyInfo
(
String
userId
,
String
idCard
,
String
performanceId
,
String
ticketId
,
int
buyCount
)
{
String
redisKey
;
String
redisKey
;
KylinPerformanceVo
vo
=
getPerformanceVo
(
performanceId
);
int
isTrueName
=
getPerformanceIsTrueName
(
performanceId
);
int
isTrueName
=
vo
.
getIsTrueName
();
// String useTime = "";
// String useTime = "";
// HashMap<String, ArrayList<String>> allTicketId = new HashMap<>();
// HashMap<String, ArrayList<String>> allTicketId = new HashMap<>();
// for (int x = 0; x < vo.getTicketTimeList().size(); x++) {
// for (int x = 0; x < vo.getTicketTimeList().size(); x++) {
...
@@ -141,6 +140,22 @@ public class KylinUtils {
...
@@ -141,6 +140,22 @@ public class KylinUtils {
return
(
KylinPerformanceVo
)
redisUtil
.
get
(
KylinRedisConst
.
PERFORMANCES
+
performanceId
);
return
(
KylinPerformanceVo
)
redisUtil
.
get
(
KylinRedisConst
.
PERFORMANCES
+
performanceId
);
}
}
/**
* 演出是否实名
*
* @param performanceId
*/
public
int
getPerformanceIsTrueName
(
String
performanceId
)
{
Object
obj
=
redisUtil
.
get
(
KylinRedisConst
.
PERFORMANCES_TRUE_NAME
+
performanceId
);
if
(
obj
!=
null
)
{
return
(
int
)
obj
;
}
else
{
int
isTrueName
=
getPerformanceVo
(
performanceId
).
getIsTrueName
();
redisUtil
.
set
(
KylinRedisConst
.
PERFORMANCES_TRUE_NAME
+
performanceId
,
isTrueName
);
return
isTrueName
;
}
}
/**
/**
* 根据订单id 获取 订单vo 详情
* 根据订单id 获取 订单vo 详情
*
*
...
...
liquidnet-bus-service/liquidnet-service-kylin/liquidnet-service-kylin-impl/docu/mongo_db_del.sql
View file @
be8394c6
...
@@ -15,4 +15,4 @@ db.KylinTicketTimesPartnerVo.deleteMany({});
...
@@ -15,4 +15,4 @@ db.KylinTicketTimesPartnerVo.deleteMany({});
db
.
PerformanceMemberAuditParam
.
deleteMany
(
{}
);
db
.
PerformanceMemberAuditParam
.
deleteMany
(
{}
);
db
.
AdminUpushVo
.
deleteMany
(
{}
);
db
.
AdminUpushVo
.
deleteMany
(
{}
);
-- db.KylinOrderTicketVo.deleteMany({createdAt:/^2021-04.*/})
liquidnet-bus-service/liquidnet-service-order/liquidnet-service-order-impl/src/main/java/com/liquidnet/service/order/service/impl/KylinOrderTicketsServiceImpl.java
View file @
be8394c6
...
@@ -74,8 +74,6 @@ public class KylinOrderTicketsServiceImpl implements IKylinOrderTicketsOrderServ
...
@@ -74,8 +74,6 @@ public class KylinOrderTicketsServiceImpl implements IKylinOrderTicketsOrderServ
@Autowired
@Autowired
private
OrderUtils
orderUtils
;
private
OrderUtils
orderUtils
;
@Autowired
@Autowired
private
RedisLockUtil
redisLockUtil
;
@Autowired
private
MongoTemplate
mongoTemplate
;
private
MongoTemplate
mongoTemplate
;
@Autowired
@Autowired
private
MongoConverter
mongoConverter
;
private
MongoConverter
mongoConverter
;
...
@@ -126,20 +124,16 @@ public class KylinOrderTicketsServiceImpl implements IKylinOrderTicketsOrderServ
...
@@ -126,20 +124,16 @@ public class KylinOrderTicketsServiceImpl implements IKylinOrderTicketsOrderServ
}
}
if
(
performanceData
==
null
||
ticketTimesData
==
null
||
ticketData
==
null
)
{
if
(
performanceData
==
null
||
ticketTimesData
==
null
||
ticketData
==
null
)
{
redisLockUtil
.
unlock
(
lock
);
return
ResponseDto
.
failure
(
ErrorMapping
.
get
(
"20004"
));
//参数错误
return
ResponseDto
.
failure
(
ErrorMapping
.
get
(
"20004"
));
//参数错误
}
}
if
(!
ticketData
.
getTimeId
().
equals
(
payOrderParam
.
getTimeId
())
||
!
ticketTimesData
.
getPerformanceId
().
equals
(
payOrderParam
.
getPerformanceId
()))
{
if
(!
ticketData
.
getTimeId
().
equals
(
payOrderParam
.
getTimeId
())
||
!
ticketTimesData
.
getPerformanceId
().
equals
(
payOrderParam
.
getPerformanceId
()))
{
redisLockUtil
.
unlock
(
lock
);
return
ResponseDto
.
failure
(
ErrorMapping
.
get
(
"20004"
));
//参数错误
return
ResponseDto
.
failure
(
ErrorMapping
.
get
(
"20004"
));
//参数错误
}
}
if
(
payOrderParam
.
getNumber
()
%
ticketData
.
getCounts
()
!=
0
)
{
if
(
payOrderParam
.
getNumber
()
%
ticketData
.
getCounts
()
!=
0
)
{
redisLockUtil
.
unlock
(
lock
);
return
ResponseDto
.
failure
(
ErrorMapping
.
get
(
"20007"
));
//数量错误
return
ResponseDto
.
failure
(
ErrorMapping
.
get
(
"20007"
));
//数量错误
}
}
//判断代理
//判断代理
if
(!
checkAgent
(
payOrderParam
.
getAgentId
(),
ticketData
))
{
if
(!
checkAgent
(
payOrderParam
.
getAgentId
(),
ticketData
))
{
redisLockUtil
.
unlock
(
lock
);
return
ResponseDto
.
failure
(
ErrorMapping
.
get
(
"20008"
));
//无权购买
return
ResponseDto
.
failure
(
ErrorMapping
.
get
(
"20008"
));
//无权购买
}
}
...
@@ -157,7 +151,6 @@ public class KylinOrderTicketsServiceImpl implements IKylinOrderTicketsOrderServ
...
@@ -157,7 +151,6 @@ public class KylinOrderTicketsServiceImpl implements IKylinOrderTicketsOrderServ
if
(
ticketData
.
getIsExclusive
()
==
1
)
{
if
(
ticketData
.
getIsExclusive
()
==
1
)
{
memberType
=
2
;
memberType
=
2
;
if
(!
isMember
)
{
if
(!
isMember
)
{
redisLockUtil
.
unlock
(
lock
);
return
ResponseDto
.
failure
(
ErrorMapping
.
get
(
"20009"
));
//没有会员权限
return
ResponseDto
.
failure
(
ErrorMapping
.
get
(
"20009"
));
//没有会员权限
}
}
}
else
{
}
else
{
...
@@ -165,7 +158,6 @@ public class KylinOrderTicketsServiceImpl implements IKylinOrderTicketsOrderServ
...
@@ -165,7 +158,6 @@ public class KylinOrderTicketsServiceImpl implements IKylinOrderTicketsOrderServ
// 会员购买逻辑
// 会员购买逻辑
memberType
=
1
;
memberType
=
1
;
if
(!
isMember
)
{
if
(!
isMember
)
{
redisLockUtil
.
unlock
(
lock
);
return
ResponseDto
.
failure
(
ErrorMapping
.
get
(
"20009"
));
//没有会员权限
return
ResponseDto
.
failure
(
ErrorMapping
.
get
(
"20009"
));
//没有会员权限
}
}
}
else
{
}
else
{
...
@@ -182,50 +174,41 @@ public class KylinOrderTicketsServiceImpl implements IKylinOrderTicketsOrderServ
...
@@ -182,50 +174,41 @@ public class KylinOrderTicketsServiceImpl implements IKylinOrderTicketsOrderServ
int
isTrueName
=
ticketData
.
getIsTrueName
();
//是否演出实名
int
isTrueName
=
ticketData
.
getIsTrueName
();
//是否演出实名
if
(!
canBuyStatus
.
contains
(
performanceData
.
getAppStatus
()))
{
if
(!
canBuyStatus
.
contains
(
performanceData
.
getAppStatus
()))
{
redisLockUtil
.
unlock
(
lock
);
return
ResponseDto
.
failure
(
ErrorMapping
.
get
(
"20010"
));
//当前不可购买
return
ResponseDto
.
failure
(
ErrorMapping
.
get
(
"20010"
));
//当前不可购买
}
}
if
(!
canBuyStatus
.
contains
(
performanceData
.
getAppStatus
()))
{
if
(!
canBuyStatus
.
contains
(
performanceData
.
getAppStatus
()))
{
redisLockUtil
.
unlock
(
lock
);
return
ResponseDto
.
failure
(
ErrorMapping
.
get
(
"20010"
));
//当前不可购买
return
ResponseDto
.
failure
(
ErrorMapping
.
get
(
"20010"
));
//当前不可购买
}
}
//通用判断时间
//通用判断时间
if
(
isMember
)
{
if
(
isMember
)
{
if
(
DateUtil
.
compareStrDay
(
DateUtil
.
getNowTime
(),
memberTimeStart
)
==
-
1
)
{
if
(
DateUtil
.
compareStrDay
(
DateUtil
.
getNowTime
(),
memberTimeStart
)
==
-
1
)
{
redisLockUtil
.
unlock
(
lock
);
return
ResponseDto
.
failure
(
ErrorMapping
.
get
(
"20011"
));
//未开始
return
ResponseDto
.
failure
(
ErrorMapping
.
get
(
"20011"
));
//未开始
}
}
}
else
{
}
else
{
if
(
DateUtil
.
compareStrDay
(
DateUtil
.
getNowTime
(),
timeStart
)
==
-
1
)
{
if
(
DateUtil
.
compareStrDay
(
DateUtil
.
getNowTime
(),
timeStart
)
==
-
1
)
{
redisLockUtil
.
unlock
(
lock
);
return
ResponseDto
.
failure
(
ErrorMapping
.
get
(
"20011"
));
//未开始
return
ResponseDto
.
failure
(
ErrorMapping
.
get
(
"20011"
));
//未开始
}
}
}
}
if
(
DateUtil
.
compareStrDay
(
DateUtil
.
getNowTime
(),
timeEnd
)
==
1
)
{
if
(
DateUtil
.
compareStrDay
(
DateUtil
.
getNowTime
(),
timeEnd
)
==
1
)
{
redisLockUtil
.
unlock
(
lock
);
return
ResponseDto
.
failure
(
ErrorMapping
.
get
(
"20012"
));
//已结束
return
ResponseDto
.
failure
(
ErrorMapping
.
get
(
"20012"
));
//已结束
}
}
//快递票判断
//快递票判断
if
(
payOrderParam
.
getIsExpress
()
!=
null
)
{
if
(
payOrderParam
.
getIsExpress
()
!=
null
)
{
if
(
payOrderParam
.
getIsExpress
()
==
1
&&
DateUtil
.
compareStrDay
(
DateUtil
.
getNowTime
(),
timeExpressEnd
)
==
1
)
{
if
(
payOrderParam
.
getIsExpress
()
==
1
&&
DateUtil
.
compareStrDay
(
DateUtil
.
getNowTime
(),
timeExpressEnd
)
==
1
)
{
redisLockUtil
.
unlock
(
lock
);
return
ResponseDto
.
failure
(
ErrorMapping
.
get
(
"20013"
));
//快递票不卖
return
ResponseDto
.
failure
(
ErrorMapping
.
get
(
"20013"
));
//快递票不卖
}
}
if
(
payOrderParam
.
getIsExpress
()
==
1
&&
payOrderParam
.
getAddressId
().
isEmpty
())
{
if
(
payOrderParam
.
getIsExpress
()
==
1
&&
payOrderParam
.
getAddressId
().
isEmpty
())
{
redisLockUtil
.
unlock
(
lock
);
return
ResponseDto
.
failure
(
ErrorMapping
.
get
(
"20014"
));
//快递票未填写收货地址
return
ResponseDto
.
failure
(
ErrorMapping
.
get
(
"20014"
));
//快递票未填写收货地址
}
}
}
}
//实名判断
//实名判断
if
(
isTrueName
==
1
&&
payOrderParam
.
getEnterIdList
().
size
()
<=
0
)
{
if
(
isTrueName
==
1
&&
payOrderParam
.
getEnterIdList
().
size
()
<=
0
)
{
redisLockUtil
.
unlock
(
lock
);
return
ResponseDto
.
failure
(
ErrorMapping
.
get
(
"20015"
));
//需要实名 未实名
return
ResponseDto
.
failure
(
ErrorMapping
.
get
(
"20015"
));
//需要实名 未实名
}
}
if
(
isTrueName
==
1
&&
payOrderParam
.
getEnterIdList
().
size
()
!=
payOrderParam
.
getNumber
())
{
if
(
isTrueName
==
1
&&
payOrderParam
.
getEnterIdList
().
size
()
!=
payOrderParam
.
getNumber
())
{
redisLockUtil
.
unlock
(
lock
);
return
ResponseDto
.
failure
(
ErrorMapping
.
get
(
"20015"
));
//入场人数量错误
return
ResponseDto
.
failure
(
ErrorMapping
.
get
(
"20015"
));
//入场人数量错误
}
}
...
@@ -243,7 +226,6 @@ public class KylinOrderTicketsServiceImpl implements IKylinOrderTicketsOrderServ
...
@@ -243,7 +226,6 @@ public class KylinOrderTicketsServiceImpl implements IKylinOrderTicketsOrderServ
currentTime
=
System
.
currentTimeMillis
()
-
currentTime
;
currentTime
=
System
.
currentTimeMillis
()
-
currentTime
;
log
.
debug
(
"redis 修改库存 售罄 -> time:"
+
(
currentTime
)
+
"毫秒"
);
log
.
debug
(
"redis 修改库存 售罄 -> time:"
+
(
currentTime
)
+
"毫秒"
);
log
.
debug
(
"TAG_REDIS 售罄 回滚库存1 -> count:"
+
payOrderParam
.
getNumber
());
log
.
debug
(
"TAG_REDIS 售罄 回滚库存1 -> count:"
+
payOrderParam
.
getNumber
());
redisLockUtil
.
unlock
(
lock
);
return
ResponseDto
.
failure
(
ErrorMapping
.
get
(
"20016"
));
//没抢到
return
ResponseDto
.
failure
(
ErrorMapping
.
get
(
"20016"
));
//没抢到
}
else
{
}
else
{
isDownGeneral
=
true
;
isDownGeneral
=
true
;
...
@@ -260,7 +242,6 @@ public class KylinOrderTicketsServiceImpl implements IKylinOrderTicketsOrderServ
...
@@ -260,7 +242,6 @@ public class KylinOrderTicketsServiceImpl implements IKylinOrderTicketsOrderServ
if
(
age
>
25
)
{
if
(
age
>
25
)
{
dataUtils
.
changeSurplusGeneral
(
payOrderParam
.
getTicketId
(),
payOrderParam
.
getNumber
());
dataUtils
.
changeSurplusGeneral
(
payOrderParam
.
getTicketId
(),
payOrderParam
.
getNumber
());
log
.
debug
(
"TAG_REDIS 学生票 回滚库存2 -> count:"
+
payOrderParam
.
getNumber
());
log
.
debug
(
"TAG_REDIS 学生票 回滚库存2 -> count:"
+
payOrderParam
.
getNumber
());
redisLockUtil
.
unlock
(
lock
);
return
ResponseDto
.
failure
(
ErrorMapping
.
get
(
"20017"
));
//年龄超了
return
ResponseDto
.
failure
(
ErrorMapping
.
get
(
"20017"
));
//年龄超了
}
}
}
}
...
@@ -278,7 +259,6 @@ public class KylinOrderTicketsServiceImpl implements IKylinOrderTicketsOrderServ
...
@@ -278,7 +259,6 @@ public class KylinOrderTicketsServiceImpl implements IKylinOrderTicketsOrderServ
if
(!
res1
.
equals
(
""
))
{
if
(!
res1
.
equals
(
""
))
{
dataUtils
.
changeSurplusGeneral
(
payOrderParam
.
getTicketId
(),
payOrderParam
.
getNumber
());
dataUtils
.
changeSurplusGeneral
(
payOrderParam
.
getTicketId
(),
payOrderParam
.
getNumber
());
log
.
debug
(
"TAG_REDIS 限购 回滚库存3 -> count:"
+
payOrderParam
.
getNumber
());
log
.
debug
(
"TAG_REDIS 限购 回滚库存3 -> count:"
+
payOrderParam
.
getNumber
());
redisLockUtil
.
unlock
(
lock
);
return
ResponseDto
.
failure
(
res1
);
//乱七八糟异常
return
ResponseDto
.
failure
(
res1
);
//乱七八糟异常
}
}
}
}
...
@@ -292,7 +272,6 @@ public class KylinOrderTicketsServiceImpl implements IKylinOrderTicketsOrderServ
...
@@ -292,7 +272,6 @@ public class KylinOrderTicketsServiceImpl implements IKylinOrderTicketsOrderServ
if
(!
res1
.
equals
(
""
))
{
if
(!
res1
.
equals
(
""
))
{
dataUtils
.
changeSurplusGeneral
(
payOrderParam
.
getTicketId
(),
payOrderParam
.
getNumber
());
dataUtils
.
changeSurplusGeneral
(
payOrderParam
.
getTicketId
(),
payOrderParam
.
getNumber
());
log
.
debug
(
"TAG_REDIS 限购 回滚库存3 -> count:"
+
payOrderParam
.
getNumber
());
log
.
debug
(
"TAG_REDIS 限购 回滚库存3 -> count:"
+
payOrderParam
.
getNumber
());
redisLockUtil
.
unlock
(
lock
);
return
ResponseDto
.
failure
(
res1
);
//乱七八糟异常
return
ResponseDto
.
failure
(
res1
);
//乱七八糟异常
}
}
currentTime
=
System
.
currentTimeMillis
()
-
currentTime
;
currentTime
=
System
.
currentTimeMillis
()
-
currentTime
;
...
@@ -301,7 +280,6 @@ public class KylinOrderTicketsServiceImpl implements IKylinOrderTicketsOrderServ
...
@@ -301,7 +280,6 @@ public class KylinOrderTicketsServiceImpl implements IKylinOrderTicketsOrderServ
ResponseDto
<
PayInnerResultVo
>
resultData
=
order
(
payOrderParam
,
uid
,
isMember
,
isTrueName
,
performanceData
,
ticketData
,
entersVoList
,
isStudent
,
ticketTimesData
,
currentTime
);
ResponseDto
<
PayInnerResultVo
>
resultData
=
order
(
payOrderParam
,
uid
,
isMember
,
isTrueName
,
performanceData
,
ticketData
,
entersVoList
,
isStudent
,
ticketTimesData
,
currentTime
);
isDownGeneral
=
false
;
isDownGeneral
=
false
;
redisLockUtil
.
unlock
(
lock
);
return
resultData
;
return
resultData
;
}
}
}
catch
(
Exception
e
)
{
}
catch
(
Exception
e
)
{
...
@@ -321,7 +299,6 @@ public class KylinOrderTicketsServiceImpl implements IKylinOrderTicketsOrderServ
...
@@ -321,7 +299,6 @@ public class KylinOrderTicketsServiceImpl implements IKylinOrderTicketsOrderServ
}
}
}
}
}
}
redisLockUtil
.
unlock
(
lock
);
return
ResponseDto
.
failure
(
ErrorMapping
.
get
(
"20018"
));
//乱七八糟异常
return
ResponseDto
.
failure
(
ErrorMapping
.
get
(
"20018"
));
//乱七八糟异常
}
}
}
}
...
@@ -733,27 +710,23 @@ public class KylinOrderTicketsServiceImpl implements IKylinOrderTicketsOrderServ
...
@@ -733,27 +710,23 @@ public class KylinOrderTicketsServiceImpl implements IKylinOrderTicketsOrderServ
String
timePay
=
syncOrderParam
.
getPaymentAt
();
String
timePay
=
syncOrderParam
.
getPaymentAt
();
KylinOrderTicketVo
orderTicketData
=
mongoTemplate
.
findOne
(
Query
.
query
(
Criteria
.
where
(
"orderCode"
).
is
(
syncOrderParam
.
getOrderCode
())),
KylinOrderTicketVo
.
class
,
KylinOrderTicketVo
.
class
.
getSimpleName
());
KylinOrderTicketVo
orderTicketData
=
mongoTemplate
.
findOne
(
Query
.
query
(
Criteria
.
where
(
"orderCode"
).
is
(
syncOrderParam
.
getOrderCode
())),
KylinOrderTicketVo
.
class
,
KylinOrderTicketVo
.
class
.
getSimpleName
());
if
(
orderTicketData
==
null
)
{
if
(
orderTicketData
==
null
)
{
redisLockUtil
.
unlock
(
lock
);
log
.
error
(
"订单不存在"
);
log
.
error
(
"订单不存在"
);
return
"fail"
;
//订单不存在
return
"fail"
;
//订单不存在
}
}
if
(
orderTicketData
.
getStatus
()
!=
KylinTableStatusConst
.
ORDER_STATUS0
)
{
if
(
orderTicketData
.
getStatus
()
!=
KylinTableStatusConst
.
ORDER_STATUS0
)
{
if
(
orderTicketData
.
getPayCode
().
equals
(
syncOrderParam
.
getCode
())
&&
orderTicketData
.
getStatus
()
==
KylinTableStatusConst
.
ORDER_STATUS1
)
{
if
(
orderTicketData
.
getPayCode
().
equals
(
syncOrderParam
.
getCode
())
&&
orderTicketData
.
getStatus
()
==
KylinTableStatusConst
.
ORDER_STATUS1
)
{
redisLockUtil
.
unlock
(
lock
);
log
.
error
(
"已经支付"
);
log
.
error
(
"已经支付"
);
return
"success"
;
//已经支付
return
"success"
;
//已经支付
}
}
if
(!
orderTicketData
.
getPayCode
().
equals
(
syncOrderParam
.
getCode
()))
{
if
(!
orderTicketData
.
getPayCode
().
equals
(
syncOrderParam
.
getCode
()))
{
redisLockUtil
.
unlock
(
lock
);
log
.
error
(
"重复支付"
);
log
.
error
(
"重复支付"
);
return
"fail"
;
//重复支付
return
"fail"
;
//重复支付
}
}
}
}
if
(
orderTicketData
.
getPriceActual
().
compareTo
(
syncOrderParam
.
getPrice
())
!=
0
)
{
if
(
orderTicketData
.
getPriceActual
().
compareTo
(
syncOrderParam
.
getPrice
())
!=
0
)
{
redisLockUtil
.
unlock
(
lock
);
log
.
error
(
"价格不符"
);
log
.
error
(
"价格不符"
);
return
"fail"
;
//价格不符
return
"fail"
;
//价格不符
}
}
...
@@ -883,7 +856,6 @@ public class KylinOrderTicketsServiceImpl implements IKylinOrderTicketsOrderServ
...
@@ -883,7 +856,6 @@ public class KylinOrderTicketsServiceImpl implements IKylinOrderTicketsOrderServ
// 大麦回调
// 大麦回调
sycDamaiOrder
(
orderTickets
.
getOrderTicketsId
());
sycDamaiOrder
(
orderTickets
.
getOrderTicketsId
());
}
}
redisLockUtil
.
unlock
(
lock
);
log
.
info
(
UserPathDto
.
setData
(
"订单支付成功回调"
,
syncOrderParam
,
""
));
log
.
info
(
UserPathDto
.
setData
(
"订单支付成功回调"
,
syncOrderParam
,
""
));
return
"success"
;
return
"success"
;
}
catch
(
Exception
e
)
{
}
catch
(
Exception
e
)
{
...
...
liquidnet-bus-service/liquidnet-service-order/liquidnet-service-order-impl/src/main/java/com/liquidnet/service/order/utils/DataUtils.java
View file @
be8394c6
...
@@ -102,8 +102,7 @@ public class DataUtils {
...
@@ -102,8 +102,7 @@ public class DataUtils {
public
void
changeBuyInfo
(
String
userId
,
String
idCard
,
String
performanceId
,
String
ticketId
,
int
buyCount
)
{
public
void
changeBuyInfo
(
String
userId
,
String
idCard
,
String
performanceId
,
String
ticketId
,
int
buyCount
)
{
String
redisKey
;
String
redisKey
;
KylinPerformanceVo
vo
=
getPerformanceVo
(
performanceId
);
int
isTrueName
=
getPerformanceIsTrueName
(
performanceId
);
int
isTrueName
=
vo
.
getIsTrueName
();
// String useTime = "";
// String useTime = "";
// HashMap<String, ArrayList<String>> allTicketId = new HashMap<>();
// HashMap<String, ArrayList<String>> allTicketId = new HashMap<>();
// for (int x = 0; x < vo.getTicketTimeList().size(); x++) {
// for (int x = 0; x < vo.getTicketTimeList().size(); x++) {
...
@@ -204,6 +203,22 @@ public class DataUtils {
...
@@ -204,6 +203,22 @@ public class DataUtils {
}
}
}
}
/**
* 演出是否实名
*
* @param performanceId
*/
public
int
getPerformanceIsTrueName
(
String
performanceId
)
{
Object
obj
=
redisUtil
.
get
(
KylinRedisConst
.
PERFORMANCES_TRUE_NAME
+
performanceId
);
if
(
obj
!=
null
)
{
return
(
int
)
obj
;
}
else
{
int
isTrueName
=
getPerformanceVo
(
performanceId
).
getIsTrueName
();
redisUtil
.
set
(
KylinRedisConst
.
PERFORMANCES_TRUE_NAME
+
performanceId
,
isTrueName
);
return
isTrueName
;
}
}
public
void
delOrderRefundVoByOrderId
(
String
orderId
)
{
public
void
delOrderRefundVoByOrderId
(
String
orderId
)
{
redisUtil
.
del
(
KylinRedisConst
.
ORDER_REFUND_BY_ORDER_ID
+
orderId
);
redisUtil
.
del
(
KylinRedisConst
.
ORDER_REFUND_BY_ORDER_ID
+
orderId
);
}
}
...
...
liquidnet-bus-service/liquidnet-service-platform/liquidnet-service-platform-impl/src/main/java/com/liquidnet/service/platform/utils/DataUtils.java
View file @
be8394c6
...
@@ -250,8 +250,7 @@ public class DataUtils {
...
@@ -250,8 +250,7 @@ public class DataUtils {
public
void
changeBuyInfo
(
String
userId
,
String
idCard
,
String
performanceId
,
String
ticketId
,
int
buyCount
)
{
public
void
changeBuyInfo
(
String
userId
,
String
idCard
,
String
performanceId
,
String
ticketId
,
int
buyCount
)
{
String
redisKey
;
String
redisKey
;
KylinPerformanceVo
vo
=
getPerformanceVo
(
performanceId
);
int
isTrueName
=
getPerformanceIsTrueName
(
performanceId
);
int
isTrueName
=
vo
.
getIsTrueName
();
// String useTime = "";
// String useTime = "";
// HashMap<String, ArrayList<String>> allTicketId = new HashMap<>();
// HashMap<String, ArrayList<String>> allTicketId = new HashMap<>();
// for (int x = 0; x < vo.getTicketTimeList().size(); x++) {
// for (int x = 0; x < vo.getTicketTimeList().size(); x++) {
...
@@ -354,6 +353,22 @@ public class DataUtils {
...
@@ -354,6 +353,22 @@ public class DataUtils {
}
}
}
}
/**
* 演出是否实名
*
* @param performanceId
*/
public
int
getPerformanceIsTrueName
(
String
performanceId
)
{
Object
obj
=
redisUtil
.
get
(
KylinRedisConst
.
PERFORMANCES_TRUE_NAME
+
performanceId
);
if
(
obj
!=
null
)
{
return
(
int
)
obj
;
}
else
{
int
isTrueName
=
getPerformanceVo
(
performanceId
).
getIsTrueName
();
redisUtil
.
set
(
KylinRedisConst
.
PERFORMANCES_TRUE_NAME
+
performanceId
,
isTrueName
);
return
isTrueName
;
}
}
public
void
delOrderRefundVo
(
String
orderRefundsId
){
public
void
delOrderRefundVo
(
String
orderRefundsId
){
redisUtil
.
del
(
KylinRedisConst
.
ORDER_REFUND
+
orderRefundsId
);
redisUtil
.
del
(
KylinRedisConst
.
ORDER_REFUND
+
orderRefundsId
);
...
...
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