记得上下班打卡 | 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
92ca6089
Commit
92ca6089
authored
Jul 23, 2022
by
anjiabin
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'pre' of
http://gitlab.zhengzai.tv/dongjingwei/liquidnet-bus-v1
into pre
parents
0573faeb
3cd7fec5
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
66 additions
and
28 deletions
+66
-28
AbstractOrderCloseReceiver.java
...e/consumer/kylin/receiver/AbstractOrderCloseReceiver.java
+12
-6
AbstractOrderCloseReceiver.java
...e/consumer/order/receiver/AbstractOrderCloseReceiver.java
+12
-6
GoblinCouponImpl.java
...quidnet/service/goblin/service/impl/GoblinCouponImpl.java
+12
-3
GoblinMongoUtils.java
...a/com/liquidnet/service/goblin/util/GoblinMongoUtils.java
+7
-5
GoblinMongoUtils.java
...a/com/liquidnet/service/order/utils/GoblinMongoUtils.java
+11
-5
GoblinOrderUtils.java
...a/com/liquidnet/service/order/utils/GoblinOrderUtils.java
+12
-3
No files found.
liquidnet-bus-service/liquidnet-service-consumer-all/liquidnet-service-consumer-kylin/src/main/java/com/liquidnet/service/consumer/kylin/receiver/AbstractOrderCloseReceiver.java
View file @
92ca6089
...
...
@@ -23,6 +23,7 @@ import org.springframework.data.mongodb.core.MongoTemplate;
import
org.springframework.data.mongodb.core.convert.MongoConverter
;
import
org.springframework.data.mongodb.core.query.Criteria
;
import
org.springframework.data.mongodb.core.query.Query
;
import
org.springframework.data.mongodb.core.query.Update
;
import
org.springframework.data.redis.connection.stream.MapRecord
;
import
org.springframework.data.redis.connection.stream.StreamRecords
;
import
org.springframework.data.redis.core.StringRedisTemplate
;
...
...
@@ -293,7 +294,10 @@ public abstract class AbstractOrderCloseReceiver implements StreamListener<Strin
vo
.
setState
(
1
);
vo
.
setUsedFor
(
""
);
setUserCouponVos
(
params
.
getUid
(),
voList
);
changeCouponVos
(
vo
.
getUcouponId
(),
vo
);
GoblinUserCouponBasicVo
basicVo
=
GoblinUserCouponBasicVo
.
getNew
();
basicVo
.
setState
(
1
);
basicVo
.
setUsedFor
(
""
);
changeCouponVos
(
vo
.
getUcouponId
(),
basicVo
);
sendMsgByRedis
(
MQConst
.
GoblinQueue
.
SQL_COUPON
.
getKey
(),
SqlMapping
.
get
(
"goblin_user_coupon.updateState"
,
vo
.
getState
(),
vo
.
getUsedFor
(),
LocalDateTime
.
now
(),
vo
.
getUcouponId
()));
}
...
...
@@ -337,11 +341,13 @@ public abstract class AbstractOrderCloseReceiver implements StreamListener<Strin
return
vos
;
}
public
Boolean
changeCouponVos
(
String
ucouponId
,
GoblinUserCouponVo
vo
)
{
return
mongoTemplate
.
getCollection
(
GoblinUserCouponVo
.
class
.
getSimpleName
())
.
updateOne
(
Query
.
query
(
Criteria
.
where
(
"ucouponId"
).
is
(
ucouponId
)).
getQueryObject
(),
cloneBasicDBObject
().
append
(
"$set"
,
mongoConverter
.
convertToMongoType
(
vo
))
).
getModifiedCount
()
>
0
;
public
Boolean
changeCouponVos
(
String
ucouponId
,
GoblinUserCouponBasicVo
vo
)
{
return
mongoTemplate
.
getCollection
(
GoblinUserCouponBasicVo
.
class
.
getSimpleName
()).
updateOne
(
Query
.
query
(
Criteria
.
where
(
"ucouponId"
).
is
(
ucouponId
)).
getQueryObject
(),
Update
.
update
(
"state"
,
vo
.
getState
())
.
set
(
"usedFor"
,
vo
.
getUsedFor
())
.
getUpdateObject
()
).
getModifiedCount
()
>
0
;
}
public
boolean
setUserCouponVos
(
String
uid
,
List
<
GoblinUserCouponVo
>
vos
)
{
...
...
liquidnet-bus-service/liquidnet-service-consumer-all/liquidnet-service-consumer-order/src/main/java/com/liquidnet/service/consumer/order/receiver/AbstractOrderCloseReceiver.java
View file @
92ca6089
...
...
@@ -32,6 +32,7 @@ import org.springframework.data.mongodb.core.MongoTemplate;
import
org.springframework.data.mongodb.core.convert.MongoConverter
;
import
org.springframework.data.mongodb.core.query.Criteria
;
import
org.springframework.data.mongodb.core.query.Query
;
import
org.springframework.data.mongodb.core.query.Update
;
import
org.springframework.data.redis.connection.stream.MapRecord
;
import
org.springframework.data.redis.connection.stream.StreamRecords
;
import
org.springframework.data.redis.core.StringRedisTemplate
;
...
...
@@ -495,7 +496,10 @@ public abstract class AbstractOrderCloseReceiver implements StreamListener<Strin
vo
.
setState
(
1
);
vo
.
setUsedFor
(
""
);
setUserCouponVos
(
params
.
getUid
(),
voList
);
changeCouponVos
(
vo
.
getUcouponId
(),
vo
);
GoblinUserCouponBasicVo
basicVo
=
GoblinUserCouponBasicVo
.
getNew
();
basicVo
.
setState
(
1
);
basicVo
.
setUsedFor
(
""
);
changeCouponVos
(
vo
.
getUcouponId
(),
basicVo
);
sendMsgByRedis
(
MQConst
.
GoblinQueue
.
SQL_COUPON
.
getKey
(),
SqlMapping
.
get
(
"goblin_user_coupon.updateState"
,
vo
.
getState
(),
vo
.
getUsedFor
(),
LocalDateTime
.
now
(),
vo
.
getUcouponId
()));
}
...
...
@@ -545,11 +549,13 @@ public abstract class AbstractOrderCloseReceiver implements StreamListener<Strin
return
(
int
)
redisUtil
.
decr
(
rdk
,
1
);
}
public
Boolean
changeCouponVos
(
String
ucouponId
,
GoblinUserCouponVo
vo
)
{
return
mongoTemplate
.
getCollection
(
GoblinUserCouponVo
.
class
.
getSimpleName
())
.
updateOne
(
Query
.
query
(
Criteria
.
where
(
"ucouponId"
).
is
(
ucouponId
)).
getQueryObject
(),
cloneBasicDBObject
().
append
(
"$set"
,
mongoConverter
.
convertToMongoType
(
vo
))
).
getModifiedCount
()
>
0
;
public
Boolean
changeCouponVos
(
String
ucouponId
,
GoblinUserCouponBasicVo
vo
)
{
return
mongoTemplate
.
getCollection
(
GoblinUserCouponBasicVo
.
class
.
getSimpleName
()).
updateOne
(
Query
.
query
(
Criteria
.
where
(
"ucouponId"
).
is
(
ucouponId
)).
getQueryObject
(),
Update
.
update
(
"state"
,
vo
.
getState
())
.
set
(
"usedFor"
,
vo
.
getUsedFor
())
.
getUpdateObject
()
).
getModifiedCount
()
>
0
;
}
public
boolean
setUserCouponVos
(
String
uid
,
List
<
GoblinUserCouponVo
>
vos
)
{
...
...
liquidnet-bus-service/liquidnet-service-goblin/liquidnet-service-goblin-impl/src/main/java/com/liquidnet/service/goblin/service/impl/GoblinCouponImpl.java
View file @
92ca6089
...
...
@@ -345,7 +345,10 @@ public class GoblinCouponImpl implements GoblinCouponService {
}
vo
.
setState
(
5
);
vo
.
setUsedFor
(
content
);
goblinMongoUtils
.
changeCouponVos
(
vo
.
getUcouponId
(),
vo
);
GoblinUserCouponBasicVo
basicVo
=
GoblinUserCouponBasicVo
.
getNew
();
basicVo
.
setState
(
5
);
basicVo
.
setUsedFor
(
content
);
goblinMongoUtils
.
changeCouponVos
(
vo
.
getUcouponId
(),
basicVo
);
queueUtils
.
sendMsgByRedis
(
MQConst
.
GoblinQueue
.
SQL_COUPON
.
getKey
(),
SqlMapping
.
get
(
"goblin_user_coupon.updateState"
,
vo
.
getState
(),
vo
.
getUsedFor
(),
LocalDateTime
.
now
(),
vo
.
getUcouponId
()));
break
;
...
...
@@ -374,7 +377,10 @@ public class GoblinCouponImpl implements GoblinCouponService {
}
vo
.
setState
(
5
);
vo
.
setUsedFor
(
content
);
goblinMongoUtils
.
changeCouponVos
(
vo
.
getUcouponId
(),
vo
);
GoblinUserCouponBasicVo
basicVo
=
GoblinUserCouponBasicVo
.
getNew
();
basicVo
.
setState
(
5
);
basicVo
.
setUsedFor
(
content
);
goblinMongoUtils
.
changeCouponVos
(
vo
.
getUcouponId
(),
basicVo
);
queueUtils
.
sendMsgByRedis
(
MQConst
.
GoblinQueue
.
SQL_COUPON
.
getKey
(),
SqlMapping
.
get
(
"goblin_user_coupon.updateState"
,
vo
.
getState
(),
vo
.
getUsedFor
(),
LocalDateTime
.
now
(),
vo
.
getUcouponId
()));
}
...
...
@@ -402,7 +408,10 @@ public class GoblinCouponImpl implements GoblinCouponService {
vo
.
setState
(
1
);
vo
.
setUsedFor
(
""
);
goblinRedisUtils
.
setUserCouponVos
(
item
.
getUid
(),
voList
);
goblinMongoUtils
.
changeCouponVos
(
vo
.
getUcouponId
(),
vo
);
GoblinUserCouponBasicVo
basicVo
=
GoblinUserCouponBasicVo
.
getNew
();
basicVo
.
setState
(
1
);
basicVo
.
setUsedFor
(
""
);
goblinMongoUtils
.
changeCouponVos
(
vo
.
getUcouponId
(),
basicVo
);
queueUtils
.
sendMsgByRedis
(
MQConst
.
GoblinQueue
.
SQL_COUPON
.
getKey
(),
SqlMapping
.
get
(
"goblin_user_coupon.updateState"
,
vo
.
getState
(),
vo
.
getUsedFor
(),
LocalDateTime
.
now
(),
vo
.
getUcouponId
()));
}
...
...
liquidnet-bus-service/liquidnet-service-goblin/liquidnet-service-goblin-impl/src/main/java/com/liquidnet/service/goblin/util/GoblinMongoUtils.java
View file @
92ca6089
...
...
@@ -1567,11 +1567,13 @@ public class GoblinMongoUtils {
return
mongoTemplate
.
insert
(
vo
,
GoblinUserCouponBasicVo
.
class
.
getSimpleName
());
}
public
Boolean
changeCouponVos
(
String
ucouponId
,
GoblinUserCouponVo
vo
)
{
return
mongoTemplate
.
getCollection
(
GoblinUserCouponVo
.
class
.
getSimpleName
())
.
updateOne
(
Query
.
query
(
Criteria
.
where
(
"ucouponId"
).
is
(
ucouponId
)).
getQueryObject
(),
ObjectUtil
.
cloneBasicDBObject
().
append
(
"$set"
,
mongoConverter
.
convertToMongoType
(
vo
))
).
getModifiedCount
()
>
0
;
public
Boolean
changeCouponVos
(
String
ucouponId
,
GoblinUserCouponBasicVo
vo
)
{
return
mongoTemplate
.
getCollection
(
GoblinUserCouponBasicVo
.
class
.
getSimpleName
()).
updateOne
(
Query
.
query
(
Criteria
.
where
(
"ucouponId"
).
is
(
ucouponId
)).
getQueryObject
(),
Update
.
update
(
"state"
,
vo
.
getState
())
.
set
(
"usedFor"
,
vo
.
getUsedFor
())
.
getUpdateObject
()
).
getModifiedCount
()
>
0
;
}
/* ---------------------------------------- 我的藏品 ---------------------------------------- */
...
...
liquidnet-bus-service/liquidnet-service-order/liquidnet-service-order-impl/src/main/java/com/liquidnet/service/order/utils/GoblinMongoUtils.java
View file @
92ca6089
...
...
@@ -8,6 +8,7 @@ import org.springframework.data.mongodb.core.MongoTemplate;
import
org.springframework.data.mongodb.core.convert.MongoConverter
;
import
org.springframework.data.mongodb.core.query.Criteria
;
import
org.springframework.data.mongodb.core.query.Query
;
import
org.springframework.data.mongodb.core.query.Update
;
import
org.springframework.stereotype.Component
;
import
java.util.HashMap
;
...
...
@@ -43,6 +44,7 @@ public class GoblinMongoUtils {
public
GoblinStoreOrderVo
insertGoblinStoreOrderVo
(
GoblinStoreOrderVo
vo
)
{
return
mongoTemplate
.
insert
(
vo
,
GoblinStoreOrderVo
.
class
.
getSimpleName
());
}
public
void
insertGoblinStoreOrderVos
(
List
<
GoblinStoreOrderVo
>
vos
)
{
mongoTemplate
.
insert
(
vos
,
GoblinStoreOrderVo
.
class
.
getSimpleName
());
}
...
...
@@ -89,11 +91,13 @@ public class GoblinMongoUtils {
return
mongoTemplate
.
findOne
(
Query
.
query
(
Criteria
.
where
(
"backCode"
).
is
(
backCode
)),
GoblinBackOrderVo
.
class
,
GoblinBackOrderVo
.
class
.
getSimpleName
());
}
public
Boolean
changeCouponVos
(
String
ucouponId
,
GoblinUserCouponVo
vo
)
{
return
mongoTemplate
.
getCollection
(
GoblinUserCouponVo
.
class
.
getSimpleName
())
.
updateOne
(
Query
.
query
(
Criteria
.
where
(
"ucouponId"
).
is
(
ucouponId
)).
getQueryObject
(),
ObjectUtil
.
cloneBasicDBObject
().
append
(
"$set"
,
mongoConverter
.
convertToMongoType
(
vo
))
).
getModifiedCount
()
>
0
;
public
Boolean
changeCouponVos
(
String
ucouponId
,
GoblinUserCouponBasicVo
vo
)
{
return
mongoTemplate
.
getCollection
(
GoblinUserCouponBasicVo
.
class
.
getSimpleName
()).
updateOne
(
Query
.
query
(
Criteria
.
where
(
"ucouponId"
).
is
(
ucouponId
)).
getQueryObject
(),
Update
.
update
(
"state"
,
vo
.
getState
())
.
set
(
"usedFor"
,
vo
.
getUsedFor
())
.
getUpdateObject
()
).
getModifiedCount
()
>
0
;
}
public
GoblinStoreCouponBasicVo
getMgtStoreCouponBasicVo
(
String
storeCouponId
)
{
...
...
@@ -126,10 +130,12 @@ public class GoblinMongoUtils {
public
GoblinNftOrderRefundVo
insertGoblinNftOrderRefundVo
(
GoblinNftOrderRefundVo
vo
)
{
return
mongoTemplate
.
insert
(
vo
,
GoblinNftOrderRefundVo
.
class
.
getSimpleName
());
}
//获取 订单退款数据
public
GoblinNftOrderRefundVo
getGoblinNftOrderRefundVo
(
String
refundCode
)
{
return
mongoTemplate
.
findOne
(
Query
.
query
(
Criteria
.
where
(
"refundCode"
).
is
(
refundCode
)),
GoblinNftOrderRefundVo
.
class
,
GoblinNftOrderRefundVo
.
class
.
getSimpleName
());
}
//修改 订单退款数据
public
UpdateResult
updateGoblinNftOrderRefundVo
(
String
orderRefundId
,
HashMap
<
String
,
Object
>
data
)
{
return
mongoTemplate
.
getCollection
(
GoblinNftOrderRefundVo
.
class
.
getSimpleName
()).
updateOne
(
...
...
liquidnet-bus-service/liquidnet-service-order/liquidnet-service-order-impl/src/main/java/com/liquidnet/service/order/utils/GoblinOrderUtils.java
View file @
92ca6089
...
...
@@ -273,7 +273,10 @@ public class GoblinOrderUtils {
}
vo
.
setState
(
5
);
vo
.
setUsedFor
(
content
);
goblinMongoUtils
.
changeCouponVos
(
vo
.
getUcouponId
(),
vo
);
GoblinUserCouponBasicVo
basicVo
=
GoblinUserCouponBasicVo
.
getNew
();
basicVo
.
setState
(
5
);
basicVo
.
setUsedFor
(
content
);
goblinMongoUtils
.
changeCouponVos
(
vo
.
getUcouponId
(),
basicVo
);
queueUtils
.
sendMsgByRedis
(
MQConst
.
GoblinQueue
.
SQL_COUPON
.
getKey
(),
SqlMapping
.
get
(
"goblin_user_coupon.updateState"
,
vo
.
getState
(),
vo
.
getUsedFor
(),
LocalDateTime
.
now
(),
vo
.
getUcouponId
()));
break
;
...
...
@@ -321,7 +324,10 @@ public class GoblinOrderUtils {
}
vo
.
setState
(
5
);
vo
.
setUsedFor
(
content
);
goblinMongoUtils
.
changeCouponVos
(
vo
.
getUcouponId
(),
vo
);
GoblinUserCouponBasicVo
basicVo
=
GoblinUserCouponBasicVo
.
getNew
();
basicVo
.
setState
(
5
);
basicVo
.
setUsedFor
(
content
);
goblinMongoUtils
.
changeCouponVos
(
vo
.
getUcouponId
(),
basicVo
);
queueUtils
.
sendMsgByRedis
(
MQConst
.
GoblinQueue
.
SQL_COUPON
.
getKey
(),
SqlMapping
.
get
(
"goblin_user_coupon.updateState"
,
vo
.
getState
(),
vo
.
getUsedFor
(),
LocalDateTime
.
now
(),
vo
.
getUcouponId
()));
}
...
...
@@ -352,7 +358,10 @@ public class GoblinOrderUtils {
vo
.
setState
(
1
);
vo
.
setUsedFor
(
""
);
redisUtils
.
setUserCouponVos
(
item
.
getUid
(),
voList
);
goblinMongoUtils
.
changeCouponVos
(
vo
.
getUcouponId
(),
vo
);
GoblinUserCouponBasicVo
basicVo
=
GoblinUserCouponBasicVo
.
getNew
();
basicVo
.
setState
(
1
);
basicVo
.
setUsedFor
(
""
);
goblinMongoUtils
.
changeCouponVos
(
vo
.
getUcouponId
(),
basicVo
);
queueUtils
.
sendMsgByRedis
(
MQConst
.
GoblinQueue
.
SQL_COUPON
.
getKey
(),
SqlMapping
.
get
(
"goblin_user_coupon.updateState"
,
vo
.
getState
(),
vo
.
getUsedFor
(),
LocalDateTime
.
now
(),
vo
.
getUcouponId
()));
}
...
...
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