记得上下班打卡 | 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
e8bbda7d
Commit
e8bbda7d
authored
Jun 22, 2021
by
张国柄
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
opt;
parent
c60d136e
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
20 additions
and
25 deletions
+20
-25
AdamCollectionServiceImpl.java
.../service/adam/service/impl/AdamCollectionServiceImpl.java
+10
-12
AdamDisposedServiceImpl.java
...et/service/adam/service/impl/AdamDisposedServiceImpl.java
+10
-13
No files found.
liquidnet-bus-service/liquidnet-service-adam/liquidnet-service-adam-impl/src/main/java/com/liquidnet/service/adam/service/impl/AdamCollectionServiceImpl.java
View file @
e8bbda7d
...
@@ -11,6 +11,7 @@ import com.liquidnet.service.base.ResponseDto;
...
@@ -11,6 +11,7 @@ import com.liquidnet.service.base.ResponseDto;
import
com.liquidnet.service.base.SqlMapping
;
import
com.liquidnet.service.base.SqlMapping
;
import
com.liquidnet.service.feign.kylin.api.FeignKylinPerformanceClient
;
import
com.liquidnet.service.feign.kylin.api.FeignKylinPerformanceClient
;
import
com.liquidnet.service.kylin.dto.vo.mongo.KylinPerformanceVo
;
import
com.liquidnet.service.kylin.dto.vo.mongo.KylinPerformanceVo
;
import
com.mongodb.client.result.DeleteResult
;
import
com.mongodb.client.result.UpdateResult
;
import
com.mongodb.client.result.UpdateResult
;
import
lombok.extern.slf4j.Slf4j
;
import
lombok.extern.slf4j.Slf4j
;
import
org.bson.Document
;
import
org.bson.Document
;
...
@@ -78,15 +79,11 @@ public class AdamCollectionServiceImpl implements IAdamCollectionService {
...
@@ -78,15 +79,11 @@ public class AdamCollectionServiceImpl implements IAdamCollectionService {
public
void
del
(
String
uid
,
String
type
,
String
...
contentIds
)
{
public
void
del
(
String
uid
,
String
type
,
String
...
contentIds
)
{
LocalDateTime
now
=
LocalDateTime
.
now
();
LocalDateTime
now
=
LocalDateTime
.
now
();
// AdamCollectBaseVo delVo = AdamCollectBaseVo.getNew();
DeleteResult
deleteResult
=
mongoTemplate
.
remove
(
// delVo.setState(2);
Query
.
query
(
Criteria
.
where
(
"uid"
).
is
(
uid
).
and
(
"type"
).
is
(
type
).
and
(
"contentId"
).
in
(
contentIds
)),
// delVo.setUpdatedAt(now);
AdamCollectBaseVo
.
class
.
getSimpleName
()
);
UpdateResult
updateResult
=
mongoTemplate
.
getCollection
(
AdamCollectBaseVo
.
class
.
getSimpleName
()).
updateMany
(
if
(
deleteResult
.
getDeletedCount
()
>
0
)
{
Query
.
query
(
Criteria
.
where
(
"uid"
).
is
(
uid
).
and
(
"type"
).
is
(
type
)
.
and
(
"contentId"
).
in
(
contentIds
).
and
(
"state"
).
is
(
1
)).
getQueryObject
(),
new
Document
(
"$set"
,
new
Document
(
"state"
,
2
).
append
(
"updatedAt"
,
now
)));
if
(
updateResult
.
getModifiedCount
()
>
0
)
{
LinkedList
<
Object
[]>
toMqObjs
=
new
LinkedList
<>();
LinkedList
<
Object
[]>
toMqObjs
=
new
LinkedList
<>();
for
(
String
c
:
contentIds
)
{
for
(
String
c
:
contentIds
)
{
toMqObjs
.
add
(
new
Object
[]{
now
,
uid
,
c
});
toMqObjs
.
add
(
new
Object
[]{
now
,
uid
,
c
});
...
@@ -98,9 +95,10 @@ public class AdamCollectionServiceImpl implements IAdamCollectionService {
...
@@ -98,9 +95,10 @@ public class AdamCollectionServiceImpl implements IAdamCollectionService {
@Override
@Override
public
boolean
queryState
(
String
uid
,
String
type
,
String
contentId
)
{
public
boolean
queryState
(
String
uid
,
String
type
,
String
contentId
)
{
long
count
=
mongoTemplate
.
count
(
Query
.
query
(
Criteria
.
where
(
"uid"
).
is
(
uid
).
and
(
"type"
).
is
(
type
)
return
mongoTemplate
.
exists
(
.
and
(
"contentId"
).
is
(
contentId
).
and
(
"state"
).
is
(
1
)),
AdamCollectBaseVo
.
class
.
getSimpleName
());
Query
.
query
(
Criteria
.
where
(
"uid"
).
is
(
uid
).
and
(
"contentId"
).
is
(
contentId
).
and
(
"type"
).
is
(
type
).
and
(
"state"
).
is
(
1
)),
return
count
>
0
;
AdamCollectBaseVo
.
class
.
getSimpleName
()
);
}
}
@Override
@Override
...
...
liquidnet-bus-service/liquidnet-service-adam/liquidnet-service-adam-impl/src/main/java/com/liquidnet/service/adam/service/impl/AdamDisposedServiceImpl.java
View file @
e8bbda7d
...
@@ -13,6 +13,7 @@ import com.liquidnet.service.base.ResponseDto;
...
@@ -13,6 +13,7 @@ import com.liquidnet.service.base.ResponseDto;
import
com.liquidnet.service.base.SqlMapping
;
import
com.liquidnet.service.base.SqlMapping
;
import
com.liquidnet.service.feign.kylin.api.FeignKylinPerformanceClient
;
import
com.liquidnet.service.feign.kylin.api.FeignKylinPerformanceClient
;
import
com.liquidnet.service.kylin.dto.vo.mongo.KylinPerformanceVo
;
import
com.liquidnet.service.kylin.dto.vo.mongo.KylinPerformanceVo
;
import
com.mongodb.client.result.DeleteResult
;
import
com.mongodb.client.result.UpdateResult
;
import
com.mongodb.client.result.UpdateResult
;
import
lombok.extern.slf4j.Slf4j
;
import
lombok.extern.slf4j.Slf4j
;
import
org.bson.Document
;
import
org.bson.Document
;
...
@@ -80,17 +81,12 @@ public class AdamDisposedServiceImpl implements IAdamDisposedService {
...
@@ -80,17 +81,12 @@ public class AdamDisposedServiceImpl implements IAdamDisposedService {
@Override
@Override
public
void
del
(
String
uid
,
String
type
,
String
...
contentIds
)
{
public
void
del
(
String
uid
,
String
type
,
String
...
contentIds
)
{
LocalDateTime
now
=
LocalDateTime
.
now
();
LocalDateTime
now
=
LocalDateTime
.
now
();
String
nowStr
=
DateUtil
.
format
(
now
,
DateUtil
.
Formatter
.
yyyyMMddHHmmss
);
// AdamDisposedBaseVo delVo = AdamDisposedBaseVo.getNew();
DeleteResult
deleteResult
=
mongoTemplate
.
remove
(
// delVo.setState(2);
Query
.
query
(
Criteria
.
where
(
"uid"
).
is
(
uid
).
and
(
"type"
).
is
(
type
).
and
(
"contentId"
).
in
(
contentIds
)),
// delVo.setUpdatedAt(now);
AdamDisposedBaseVo
.
class
.
getSimpleName
()
);
UpdateResult
updateResult
=
mongoTemplate
.
getCollection
(
AdamDisposedBaseVo
.
class
.
getSimpleName
()).
updateMany
(
if
(
deleteResult
.
getDeletedCount
()
>
0
)
{
Query
.
query
(
Criteria
.
where
(
"uid"
).
is
(
uid
).
and
(
"type"
).
is
(
type
)
.
and
(
"contentId"
).
in
(
contentIds
).
and
(
"state"
).
is
(
1
)).
getQueryObject
(),
new
Document
(
"$set"
,
new
Document
(
"state"
,
2
).
append
(
"updatedAt"
,
now
)));
if
(
updateResult
.
getModifiedCount
()
>
0
)
{
LinkedList
<
Object
[]>
toMqObjs
=
new
LinkedList
<>();
LinkedList
<
Object
[]>
toMqObjs
=
new
LinkedList
<>();
for
(
String
c
:
contentIds
)
{
for
(
String
c
:
contentIds
)
{
toMqObjs
.
add
(
new
Object
[]{
now
,
uid
,
c
});
toMqObjs
.
add
(
new
Object
[]{
now
,
uid
,
c
});
...
@@ -102,9 +98,10 @@ public class AdamDisposedServiceImpl implements IAdamDisposedService {
...
@@ -102,9 +98,10 @@ public class AdamDisposedServiceImpl implements IAdamDisposedService {
@Override
@Override
public
boolean
queryState
(
String
uid
,
String
type
,
String
contentId
)
{
public
boolean
queryState
(
String
uid
,
String
type
,
String
contentId
)
{
long
count
=
mongoTemplate
.
count
(
Query
.
query
(
Criteria
.
where
(
"uid"
).
is
(
uid
).
and
(
"type"
).
is
(
type
)
return
mongoTemplate
.
exists
(
.
and
(
"contentId"
).
is
(
contentId
).
and
(
"state"
).
is
(
1
)),
AdamDisposedBaseVo
.
class
.
getSimpleName
());
Query
.
query
(
Criteria
.
where
(
"uid"
).
is
(
uid
).
and
(
"contentId"
).
is
(
contentId
).
and
(
"type"
).
is
(
type
).
and
(
"state"
).
is
(
1
)),
return
count
>
0
;
AdamDisposedBaseVo
.
class
.
getSimpleName
()
);
}
}
@Override
@Override
...
...
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