记得上下班打卡 | 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
56016f55
Commit
56016f55
authored
Sep 16, 2021
by
胡佳晨
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
提交 导入 初步测试
parent
8df400b3
Changes
5
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
498 additions
and
52 deletions
+498
-52
OrderOutLineVo.java
...idnet/client/admin/zhengzai/kylin/dto/OrderOutLineVo.java
+8
-4
ImportServiceImpl.java
.../admin/zhengzai/kylin/service/impl/ImportServiceImpl.java
+281
-47
DataUtils.java
...iquidnet/client/admin/zhengzai/kylin/utils/DataUtils.java
+36
-0
OrderUtils.java
...quidnet/client/admin/zhengzai/kylin/utils/OrderUtils.java
+170
-0
RedisUtil.java
...java/com.liquidnet.common.cache/redis/util/RedisUtil.java
+3
-1
No files found.
liquidnet-bus-client/liquidnet-client-admin/liquidnet-client-admin-zhengzai/src/main/java/com/liquidnet/client/admin/zhengzai/kylin/dto/OrderOutLineVo.java
View file @
56016f55
...
...
@@ -12,11 +12,15 @@ public class OrderOutLineVo {
@Excel
(
name
=
"身份证"
,
cellType
=
Excel
.
ColumnType
.
STRING
)
private
String
enterIdCode
;
@Excel
(
name
=
"购票数量"
,
cellType
=
Excel
.
ColumnType
.
NUMERIC
)
private
String
number
;
private
Integer
number
;
@Excel
(
name
=
"票种名称"
,
cellType
=
Excel
.
ColumnType
.
STRING
)
private
String
ticketTitle
;
@Excel
(
name
=
"票种适用时间"
,
cellType
=
Excel
.
ColumnType
.
STRING
,
dateFormat
=
"yyyy-MM-dd"
)
private
String
useTime
;
@Excel
(
name
=
"票种类型(电子票)"
,
cellType
=
Excel
.
ColumnType
.
STRING
)
@Excel
(
name
=
"票种适用开始时间"
,
cellType
=
Excel
.
ColumnType
.
STRING
,
dateFormat
=
"yyyy-MM-dd"
)
private
String
useStart
;
@Excel
(
name
=
"票种适用结束时间"
,
cellType
=
Excel
.
ColumnType
.
STRING
,
dateFormat
=
"yyyy-MM-dd"
)
private
String
useEnd
;
@Excel
(
name
=
"票种类型(电子票,快递票)"
,
cellType
=
Excel
.
ColumnType
.
STRING
)
private
String
ticketType
;
@Excel
(
name
=
"快递票地址"
,
cellType
=
Excel
.
ColumnType
.
STRING
)
private
String
address
;
}
liquidnet-bus-client/liquidnet-client-admin/liquidnet-client-admin-zhengzai/src/main/java/com/liquidnet/client/admin/zhengzai/kylin/service/impl/ImportServiceImpl.java
View file @
56016f55
This diff is collapsed.
Click to expand it.
liquidnet-bus-client/liquidnet-client-admin/liquidnet-client-admin-zhengzai/src/main/java/com/liquidnet/client/admin/zhengzai/kylin/utils/DataUtils.java
View file @
56016f55
...
...
@@ -352,4 +352,40 @@ public class DataUtils {
}
return
ret
;
}
// 获取 用户维度 演出购买数量
public
int
getUserPBuyCount
(
String
userId
,
String
performanceId
)
{
try
{
return
(
int
)
redisUtil
.
get
(
KylinRedisConst
.
USERID_BUY_INFO
+
userId
+
":"
+
KylinRedisConst
.
PERFORMANCE_ID
+
":"
+
performanceId
);
}
catch
(
Exception
e
)
{
return
0
;
}
}
// 获取 用户维度 票种购买数量
public
int
getUserTBuyCount
(
String
userId
,
String
ticketId
)
{
try
{
return
(
int
)
redisUtil
.
get
(
KylinRedisConst
.
USERID_BUY_INFO
+
userId
+
":"
+
KylinRedisConst
.
TICKET_ID
+
":"
+
ticketId
);
}
catch
(
Exception
e
)
{
return
0
;
}
}
// 获取 证件维度 演出购买数量
public
int
getIdCardPBuyCount
(
String
idCard
,
String
performanceId
)
{
try
{
return
(
int
)
redisUtil
.
get
(
KylinRedisConst
.
IDCARD_BUY_INFO
+
idCard
+
":"
+
KylinRedisConst
.
PERFORMANCE_ID
+
":"
+
performanceId
);
}
catch
(
Exception
e
)
{
return
0
;
}
}
// 获取 证件维度 票种购买数量
public
int
getIdCardTBuyCount
(
String
idCard
,
String
ticketId
)
{
try
{
return
(
int
)
redisUtil
.
get
(
KylinRedisConst
.
IDCARD_BUY_INFO
+
idCard
+
":"
+
KylinRedisConst
.
TICKET_ID
+
":"
+
ticketId
);
}
catch
(
Exception
e
)
{
return
0
;
}
}
}
liquidnet-bus-client/liquidnet-client-admin/liquidnet-client-admin-zhengzai/src/main/java/com/liquidnet/client/admin/zhengzai/kylin/utils/OrderUtils.java
0 → 100644
View file @
56016f55
package
com
.
liquidnet
.
client
.
admin
.
zhengzai
.
kylin
.
utils
;
import
com.liquidnet.commons.lang.util.CollectionUtil
;
import
com.liquidnet.service.kylin.dto.vo.mongo.KylinOrderTicketVo
;
import
com.liquidnet.service.kylin.dto.vo.returns.KylinOrderListVo
;
import
org.springframework.beans.BeanUtils
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Component
;
import
java.util.ArrayList
;
import
java.util.List
;
@Component
public
class
OrderUtils
{
@Autowired
private
DataUtils
dataUtils
;
public
String
judgeOrderLimit
(
int
type
,
String
userId
,
String
idCard
,
String
performanceId
,
String
ticketId
,
int
performanceLimitCount
,
int
performanceMemberLimitCount
,
int
ticketLimitCount
,
int
ticketMemberLimitCount
,
int
performanceBuyCount
,
int
ticketBuyCount
,
int
memberType
,
int
isTrueName
)
{
Integer
[]
integers
;
if
(
101
==
type
)
{
integers
=
festivalOrderLimit
(
userId
,
idCard
,
performanceId
,
ticketId
,
performanceBuyCount
,
ticketBuyCount
,
isTrueName
);
}
else
{
integers
=
roadShowOrderLimit
(
userId
,
idCard
,
performanceId
,
ticketId
,
performanceBuyCount
,
ticketBuyCount
,
isTrueName
);
}
return
judgeMemberType
(
performanceLimitCount
,
performanceMemberLimitCount
,
ticketLimitCount
,
ticketMemberLimitCount
,
memberType
,
integers
[
0
],
integers
[
1
],
isTrueName
);
}
public
Integer
[]
roadShowOrderLimit
(
String
userId
,
String
idCard
,
String
performanceId
,
String
ticketId
,
int
performanceBuyCount
,
int
ticketBuyCount
,
int
isTrueName
)
{
if
(
1
==
isTrueName
)
{
//实名
performanceBuyCount
+=
dataUtils
.
getIdCardPBuyCount
(
idCard
,
performanceId
);
ticketBuyCount
+=
dataUtils
.
getIdCardTBuyCount
(
idCard
,
ticketId
);
}
else
{
//非实名
performanceBuyCount
+=
dataUtils
.
getUserPBuyCount
(
userId
,
performanceId
);
ticketBuyCount
+=
dataUtils
.
getUserTBuyCount
(
userId
,
ticketId
);
}
Integer
[]
array
=
new
Integer
[
2
];
array
[
0
]
=
performanceBuyCount
;
array
[
1
]
=
ticketBuyCount
;
return
array
;
}
public
Integer
[]
festivalOrderLimit
(
String
userId
,
String
idCard
,
String
performanceId
,
String
ticketId
,
int
performanceBuyCount
,
int
ticketBuyCount
,
int
isTrueName
)
{
if
(
1
==
isTrueName
)
{
//实名
performanceBuyCount
+=
dataUtils
.
getIdCardPBuyCount
(
idCard
,
performanceId
);
ticketBuyCount
+=
dataUtils
.
getIdCardTBuyCount
(
idCard
,
ticketId
);
}
else
{
//非实名
performanceBuyCount
+=
dataUtils
.
getUserPBuyCount
(
userId
,
performanceId
);
ticketBuyCount
+=
dataUtils
.
getUserTBuyCount
(
userId
,
ticketId
);
}
Integer
[]
array
=
new
Integer
[
2
];
array
[
0
]
=
performanceBuyCount
;
array
[
1
]
=
ticketBuyCount
;
return
array
;
}
public
String
judgeMemberType
(
int
performanceLimitCount
,
int
performanceMemberLimitCount
,
int
ticketLimitCount
,
int
ticketMemberLimitCount
,
int
memberType
,
int
performanceBuyCount
,
int
ticketBuyCount
,
int
isTrueName
)
{
if
(
memberType
==
1
||
memberType
==
2
)
{
if
(
performanceBuyCount
>
performanceMemberLimitCount
&&
performanceMemberLimitCount
!=
0
)
{
return
(
1
==
isTrueName
?
"实名制"
:
"本场"
)
+
"演出限购"
+
performanceMemberLimitCount
+
"张,已超出"
;
//超过演出维度购买量
}
if
(
ticketBuyCount
>
ticketMemberLimitCount
&&
ticketMemberLimitCount
!=
0
)
{
return
(
1
==
isTrueName
?
"实名制"
:
"该"
)
+
"票种限购"
+
ticketMemberLimitCount
+
"张,已超出"
;
//超过票维度购买量
}
}
else
{
//非会员区间
if
(
performanceBuyCount
>
performanceLimitCount
&&
performanceLimitCount
!=
0
)
{
return
(
1
==
isTrueName
?
"实名制"
:
"本场"
)
+
"演出限购"
+
performanceLimitCount
+
"张,已超出"
;
//超过演出维度购买量
}
if
(
ticketBuyCount
>
ticketLimitCount
&&
ticketLimitCount
!=
0
)
{
return
(
1
==
isTrueName
?
"实名制"
:
"该"
)
+
"票种限购"
+
ticketLimitCount
+
"张,已超出"
;
//超过票维度购买量
}
}
return
""
;
}
/**
* @param userId 用户id
* @param type 1新增 2修改
* @param orderId 订单id [需要新增或者修改的订单id]
*/
public
Boolean
resetOrderListVo
(
String
userId
,
Integer
type
,
String
orderId
,
KylinOrderTicketVo
dataSingle
)
{
List
<
KylinOrderListVo
>
vo
=
new
ArrayList
();
List
<
KylinOrderListVo
>
redisVo
=
new
ArrayList
();
KylinOrderListVo
voItem
=
KylinOrderListVo
.
getNew
();
KylinOrderTicketVo
data
;
if
(
dataSingle
==
null
)
{
data
=
dataUtils
.
getOrderTicketVo
(
orderId
);
}
else
{
data
=
dataSingle
;
}
BeanUtils
.
copyProperties
(
data
,
voItem
);
List
<
KylinOrderListVo
>
redisData
=
dataUtils
.
getOrderList
(
userId
);
if
(
type
==
1
)
{
redisVo
.
add
(
voItem
);
if
(
redisData
.
size
()
>
0
)
{
if
(
redisData
.
get
(
0
).
getOrderTicketsId
().
equals
(
orderId
))
{
redisData
.
remove
(
0
);
}
}
}
redisVo
.
addAll
(
redisData
);
switch
(
type
)
{
case
1
:
for
(
int
i
=
0
;
i
<
redisVo
.
size
();
i
++)
{
if
(
i
==
40
)
{
break
;
}
if
(
i
==
0
)
{
vo
.
add
(
voItem
);
}
else
{
vo
.
add
(
redisVo
.
get
(
i
));
}
}
if
(
redisVo
.
size
()
==
0
)
{
vo
.
add
(
voItem
);
}
dataUtils
.
setOrderList
(
userId
,
vo
);
return
true
;
case
2
:
for
(
int
i
=
0
;
i
<
redisVo
.
size
();
i
++)
{
if
(
i
==
40
)
{
break
;
}
if
(
redisVo
.
get
(
i
).
getOrderTicketsId
().
equals
(
orderId
))
{
vo
.
add
(
voItem
);
}
else
{
vo
.
add
(
redisVo
.
get
(
i
));
}
}
dataUtils
.
setOrderList
(
userId
,
vo
);
return
true
;
default
:
return
false
;
}
}
}
liquidnet-bus-common/liquidnet-common-cache/liquidnet-common-cache-redis/src/main/java/com.liquidnet.common.cache/redis/util/RedisUtil.java
View file @
56016f55
...
...
@@ -755,7 +755,9 @@ public final class RedisUtil {
public
static
void
main
(
String
[]
args
)
{
String
[]
keys
=
{
"adam:identity:mobile:18518013286"
"kylin:order:id:302624032735805444241994"
,
"kylin:order:id:302739844787937288909968"
,
"kylin:order:id:302739847197122562214368"
};
for
(
String
key
:
keys
)
{
long
value
=
key
.
hashCode
();
...
...
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