记得上下班打卡 | 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
ae3b8689
Commit
ae3b8689
authored
Jun 20, 2021
by
胡佳晨
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修改 脚本库存脚本
parent
ac56770e
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
15 deletions
+7
-15
KylinOrderTicketsServiceImpl.java
...vice/kylin/service/impl/KylinOrderTicketsServiceImpl.java
+7
-15
No files found.
liquidnet-bus-service/liquidnet-service-kylin/liquidnet-service-kylin-impl/src/main/java/com/liquidnet/service/kylin/service/impl/KylinOrderTicketsServiceImpl.java
View file @
ae3b8689
...
...
@@ -1032,9 +1032,7 @@ public class KylinOrderTicketsServiceImpl extends ServiceImpl<KylinOrderTicketsM
// KylinOrderTicketVo vo = dataUtils.getOrderTicketVo(item.getOrderTicketsId());
// if (vo.getStatus() != 0) {
// continue;
// }
//mysql
// }//mysql
// KylinOrderTickets orderTickets = new KylinOrderTickets();
// orderTickets.setOrderTicketsId(item.getOrderTicketsId());
// orderTickets.setUpdatedAt(now);
...
...
@@ -1043,7 +1041,6 @@ public class KylinOrderTicketsServiceImpl extends ServiceImpl<KylinOrderTicketsM
// orderTicketStatus.setOrderId(item.getOrderTicketsId());
// orderTicketStatus.setStatus(KylinTableStatusConst.ORDER_STATUS2);
// orderTicketStatus.setUpdatedAt(now);
//vo
mapMongo
.
put
(
"status"
,
KylinTableStatusConst
.
ORDER_STATUS2
);
mapMongo
.
put
(
"updatedAt"
,
DateUtil
.
Formatter
.
yyyyMMddHHmmssSSS
.
format
(
now
));
...
...
@@ -1053,16 +1050,12 @@ public class KylinOrderTicketsServiceImpl extends ServiceImpl<KylinOrderTicketsM
// Query.query(Criteria.where("orderTicketsId").is(orderTickets.getOrderTicketsId())).getQueryObject(),
// new BasicDBObject("$set", mongoConverter.convertToMongoType(map))
// );
// vo.setChangeDate(now);
// vo.setStatus(KylinTableStatusConst.ORDER_STATUS2);
// vo.setUpdatedAt(DateUtil.Formatter.yyyyMMddHHmmssSSS.format(now));
// redisUtil.set(KylinRedisConst.ORDER + orderTickets.getOrderTicketsId(), vo);
mapSurplusGeneral
.
put
(
item
.
getTicketId
(),
mapSurplusGeneral
.
get
(
item
.
getTicketId
())
==
null
?
item
.
getNumber
()
:
mapSurplusGeneral
.
get
(
item
.
getTicketId
())
+
item
.
getNumber
());
// mongoVoUtils.resetOrderListVo(item.getUserId(), 2, item.getOrderTicketsId(), vo);
// List<KylinOrderTicketEntitiesVo> entities = vo.getEntitiesVoList();
// for (int i = 0; i < entities.size(); i++) {
// KylinOrderTicketEntitiesVo items = entities.get(i);
...
...
@@ -1085,16 +1078,15 @@ public class KylinOrderTicketsServiceImpl extends ServiceImpl<KylinOrderTicketsM
}
currentTime
=
System
.
currentTimeMillis
()
-
currentTime
;
log
.
debug
(
"redis 库存 -> time:"
+
(
currentTime
)
+
"毫秒"
);
LinkedList
<
String
>
sqls
=
new
LinkedList
<>();
//mysql
LinkedList
<
String
>
sqls
=
new
LinkedList
<>();
String
orderStr
=
""
;
for
(
int
i
=
0
;
i
<
orderIdList
.
size
();
i
++)
{
String
orderTicketId
=
orderIdList
.
get
(
i
).
split
(
","
)[
0
];
orderStr
=
orderStr
+
"'"
+
orderTicketId
+
"',"
;
}
orderStr
=
orderStr
.
substring
(
0
,
orderStr
.
length
()
-
1
);
sqls
.
add
(
"UPDATE kylin_order_tickets SET updated_at = '"
+
now
+
"'
WHERE
order_tickets_id in ("
+
orderStr
+
") "
);
sqls
.
add
(
"UPDATE kylin_order_tickets SET updated_at = '"
+
now
+
"'
WHERE
order_tickets_id in ("
+
orderStr
+
") "
);
sqls
.
add
(
"UPDATE kylin_order_ticket_status SET `status` = 2,updated_at = '"
+
now
+
"' WHERE order_id in ("
+
orderStr
+
") "
);
sqls
.
add
(
"UPDATE kylin_order_ticket_relations SET updated_at = '"
+
now
+
"' WHERE order_id in ("
+
orderStr
+
")"
);
rabbitTemplate
.
convertAndSend
(
MQConst
.
EXCHANGES_LIQUIDNET_SQL_ORDER_CLOSE
,
MQConst
.
ROUTING_KEY_SQL_ORDER_CLOSE
,
SqlMapping
.
gets
(
sqls
));
...
...
@@ -1102,14 +1094,14 @@ public class KylinOrderTicketsServiceImpl extends ServiceImpl<KylinOrderTicketsM
log
.
debug
(
"mysql -> time:"
+
(
currentTime
)
+
"毫秒"
);
//mongo
mongoTemplate
.
getCollection
(
KylinOrderTicketVo
.
class
.
getSimpleName
()).
update
One
(
mongoTemplate
.
getCollection
(
KylinOrderTicketVo
.
class
.
getSimpleName
()).
update
Many
(
Query
.
query
(
Criteria
.
where
(
"orderTicketsId"
).
in
(
orderIdList
)).
getQueryObject
(),
new
BasicDBObject
(
"$set"
,
mongoConverter
.
convertToMongoType
(
mapMongo
))
);
currentTime
=
System
.
currentTimeMillis
()
-
currentTime
;
log
.
debug
(
"mongo -> time:"
+
(
currentTime
)
+
"毫秒"
);
redisLockUtil
.
unlock
(
lock
);
//
redisLockUtil.unlock(lock);
Thread
thread
=
new
Thread
(()
->
{
//redis 列表
...
...
@@ -1133,7 +1125,7 @@ public class KylinOrderTicketsServiceImpl extends ServiceImpl<KylinOrderTicketsM
}
catch
(
Exception
e
)
{
e
.
printStackTrace
();
}
finally
{
redisLockUtil
.
unlock
(
lock
);
//
redisLockUtil.unlock(lock);
}
}
else
{
log
.
debug
(
"WARNING LOCKING"
);
...
...
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