记得上下班打卡 | 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
5fa3b82a
Commit
5fa3b82a
authored
Mar 06, 2022
by
胡佳晨
Browse files
Options
Browse Files
Download
Plain Diff
Merge remote-tracking branch 'origin/dev_goblin' into dev_goblin
parents
cf9c59b1
8746ddf8
Changes
10
Hide whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
152 additions
and
36 deletions
+152
-36
GoblinFrontSelectGoodsServiceImpl.java
...oblin/service/impl/GoblinFrontSelectGoodsServiceImpl.java
+8
-0
MQConst.java
...ain/java/com/liquidnet/service/base/constant/MQConst.java
+1
-0
TestAdam.java
...m/liquidnet-service-adam-impl/src/test/java/TestAdam.java
+9
-2
ConsumerGoblinSqlUstoreRedisStreamConfig.java
...blin/config/ConsumerGoblinSqlUstoreRedisStreamConfig.java
+94
-19
ConsumerGoblinSqlCouponRdsReceiver.java
...r/goblin/receiver/ConsumerGoblinSqlCouponRdsReceiver.java
+17
-0
redis_queue_create.txt
...liquidnet-service-goblin-impl/docu/redis_queue_create.txt
+3
-0
GoblinCouponImpl.java
...quidnet/service/goblin/service/impl/GoblinCouponImpl.java
+4
-4
GoblinStoreMgtCouponServiceImpl.java
.../service/impl/manage/GoblinStoreMgtCouponServiceImpl.java
+5
-5
GoblinMongoUtils.java
...a/com/liquidnet/service/goblin/util/GoblinMongoUtils.java
+4
-2
GoblinRedisUtils.java
...a/com/liquidnet/service/goblin/util/GoblinRedisUtils.java
+7
-4
No files found.
liquidnet-bus-client/liquidnet-client-admin/liquidnet-client-admin-zhengzai/src/main/java/com/liquidnet/client/admin/zhengzai/goblin/service/impl/GoblinFrontSelectGoodsServiceImpl.java
View file @
5fa3b82a
...
...
@@ -92,6 +92,14 @@ public class GoblinFrontSelectGoodsServiceImpl extends ServiceImpl<GoblinFrontSe
goblinFrontSelectGoods1
.
setOrderType
(
goblinFrontSelectGoods
.
getOrderType
());
goblinFrontSelectGoodsMapper
.
insert
(
goblinFrontSelectGoods1
);
}
}
else
{
GoblinFrontSelectGoods
goblinFrontSelectGoods1
=
new
GoblinFrontSelectGoods
();
goblinFrontSelectGoods1
.
setUpdateTime
(
LocalDateTime
.
now
());
goblinFrontSelectGoods1
.
setDelTag
(
0
);
goblinFrontSelectGoods1
.
setCreateTime
(
LocalDateTime
.
now
());
goblinFrontSelectGoods1
.
setSelectGoodsId
(
IDGenerator
.
nextSnowId
());
goblinFrontSelectGoods1
.
setOrderType
(
goblinFrontSelectGoods
.
getOrderType
());
goblinFrontSelectGoodsMapper
.
insert
(
goblinFrontSelectGoods1
);
}
/* if(goblinFrontSelectGoods.getMid()>0){
goblinFrontSelectGoods.setUpdateTime(LocalDateTime.now());
...
...
liquidnet-bus-common/liquidnet-common-service-base/src/main/java/com/liquidnet/service/base/constant/MQConst.java
View file @
5fa3b82a
...
...
@@ -238,6 +238,7 @@ public class MQConst {
public
enum
GoblinQueue
{
SQL_STORE
(
"goblin:stream:sql.store"
,
"group.sql.ustore"
,
"店铺相关"
),
SQL_GOODS
(
"goblin:stream:sql.goods"
,
"group.sql.ustore"
,
"商品相关"
),
SQL_COUPON
(
"goblin:stream:sql.coupon"
,
"group.sql.ustore"
,
"店铺优惠券相关"
),
GOBLIN_STORE_MARKET
(
"goblin:stream:store.market"
,
"group.store.market"
,
"店铺活动"
),
GOBLIN_SELF_MARKET
(
"goblin:stream:self.market"
,
"group.self.market"
,
"平台活动"
),
GOBLIN_ORDER_CREATE_PAY
(
"goblin:stream:order:create_pay"
,
"group.order:create_pay"
,
"订单创建&支付"
),
...
...
liquidnet-bus-service/liquidnet-service-adam/liquidnet-service-adam-impl/src/test/java/TestAdam.java
View file @
5fa3b82a
...
...
@@ -39,9 +39,10 @@ public class TestAdam {
"adam:info:member:code:GMRGBUQB30"
,
"adam:info:certification:1141181199209160192"
,
"adam:identity:mobile:1
5529282737
"
,
"adam:identity:mobile:1
8548596019
"
,
"adam:identity:sso:882883"
,
"adam:info:user:882883"
,
"adam:info:user:809406"
,
"adam:info:user:922833055536291845022973"
,
"adam:morder:2283655"
,
"adam:info:umember:1957341"
,
"adam:info:morder:331587681810022407979836"
,
...
...
@@ -66,6 +67,12 @@ public class TestAdam {
"sweet:manual:pushList"
,
"goblin:sku:relation:226416501783461229"
,
"goblin:bsc:goods:2264185547679ZZ87427"
,
"goblin:bsc:goods_sku:226418554767964895ZZ87427"
,
"goblin:bsc:ustore:809406"
,
"goblin:bsc:ustore:922833055536291845022973"
,
"goblin:bsc:store:839fa8dde17b5bf248575370f1249eab"
,
};
for
(
String
key
:
keys
)
{
long
value
=
key
.
hashCode
();
...
...
liquidnet-bus-service/liquidnet-service-consumer-all/liquidnet-service-consumer-goblin/src/main/java/com/liquidnet/service/consumer/goblin/config/ConsumerGoblinSqlUstoreRedisStreamConfig.java
View file @
5fa3b82a
package
com
.
liquidnet
.
service
.
consumer
.
goblin
.
config
;
import
com.liquidnet.service.base.constant.MQConst
;
import
com.liquidnet.service.consumer.goblin.receiver.ConsumerGoblinSqlCouponRdsReceiver
;
import
com.liquidnet.service.consumer.goblin.receiver.ConsumerGoblinSqlGoodsRdsReceiver
;
import
com.liquidnet.service.consumer.goblin.receiver.ConsumerGoblinSqlStoreRdsReceiver
;
import
lombok.var
;
...
...
@@ -17,14 +18,14 @@ import org.springframework.data.redis.stream.Subscription;
import
java.time.Duration
;
import
static
com
.
liquidnet
.
service
.
base
.
constant
.
MQConst
.
AdamQueue
;
@Configuration
public
class
ConsumerGoblinSqlUstoreRedisStreamConfig
{
@Autowired
ConsumerGoblinSqlStoreRdsReceiver
consumerGoblinSqlStoreRdsReceiver
;
@Autowired
ConsumerGoblinSqlGoodsRdsReceiver
consumerGoblinSqlGoodsRdsReceiver
;
@Autowired
ConsumerGoblinSqlCouponRdsReceiver
consumerGoblinSqlCouponRdsReceiver
;
private
StreamMessageListenerContainer
<
String
,
MapRecord
<
String
,
String
,
String
>>
buildStreamMessageListenerContainer
(
RedisConnectionFactory
factory
)
{
var
options
=
StreamMessageListenerContainer
...
...
@@ -43,10 +44,8 @@ public class ConsumerGoblinSqlUstoreRedisStreamConfig {
* @return Subscription
*/
private
Subscription
receiveSqlStore
(
StreamMessageListenerContainer
<
String
,
MapRecord
<
String
,
String
,
String
>>
listenerContainer
,
int
t
)
{
return
listenerContainer
.
receiveAutoAck
(
Consumer
.
from
(
MQConst
.
GoblinQueue
.
SQL_STORE
.
getGroup
(),
MQConst
.
GoblinQueue
.
SQL_STORE
.
name
()
+
t
),
StreamOffset
.
create
(
MQConst
.
GoblinQueue
.
SQL_STORE
.
getKey
(),
ReadOffset
.
lastConsumed
()),
consumerGoblinSqlStoreRdsReceiver
);
return
listenerContainer
.
receiveAutoAck
(
Consumer
.
from
(
MQConst
.
GoblinQueue
.
SQL_STORE
.
getGroup
(),
MQConst
.
GoblinQueue
.
SQL_STORE
.
name
()
+
t
),
StreamOffset
.
create
(
MQConst
.
GoblinQueue
.
SQL_STORE
.
getKey
(),
ReadOffset
.
lastConsumed
()),
consumerGoblinSqlStoreRdsReceiver
);
}
/**
...
...
@@ -57,10 +56,20 @@ public class ConsumerGoblinSqlUstoreRedisStreamConfig {
* @return Subscription
*/
private
Subscription
receiveSqlGoods
(
StreamMessageListenerContainer
<
String
,
MapRecord
<
String
,
String
,
String
>>
listenerContainer
,
int
t
)
{
return
listenerContainer
.
receiveAutoAck
(
Consumer
.
from
(
MQConst
.
GoblinQueue
.
SQL_GOODS
.
getGroup
(),
MQConst
.
GoblinQueue
.
SQL_GOODS
.
name
()
+
t
),
StreamOffset
.
create
(
MQConst
.
GoblinQueue
.
SQL_GOODS
.
getKey
(),
ReadOffset
.
lastConsumed
()),
consumerGoblinSqlGoodsRdsReceiver
);
return
listenerContainer
.
receiveAutoAck
(
Consumer
.
from
(
MQConst
.
GoblinQueue
.
SQL_GOODS
.
getGroup
(),
MQConst
.
GoblinQueue
.
SQL_GOODS
.
name
()
+
t
),
StreamOffset
.
create
(
MQConst
.
GoblinQueue
.
SQL_GOODS
.
getKey
(),
ReadOffset
.
lastConsumed
()),
consumerGoblinSqlGoodsRdsReceiver
);
}
/**
* 店铺优惠券相关
*
* @param listenerContainer StreamMessageListenerContainer
* @param t 消费者序号
* @return Subscription
*/
private
Subscription
receiveSqlCoupon
(
StreamMessageListenerContainer
<
String
,
MapRecord
<
String
,
String
,
String
>>
listenerContainer
,
int
t
)
{
return
listenerContainer
.
receiveAutoAck
(
Consumer
.
from
(
MQConst
.
GoblinQueue
.
SQL_COUPON
.
getGroup
(),
MQConst
.
GoblinQueue
.
SQL_COUPON
.
name
()
+
t
),
StreamOffset
.
create
(
MQConst
.
GoblinQueue
.
SQL_COUPON
.
getKey
(),
ReadOffset
.
lastConsumed
()),
consumerGoblinSqlCouponRdsReceiver
);
}
/* —————————————————————————— | —————————————————————————— | —————————————————————————— */
...
...
@@ -83,36 +92,102 @@ public class ConsumerGoblinSqlUstoreRedisStreamConfig {
return
subscription
;
}
/* -------------------------------------------------------- | 用户中心 */
@Bean
public
Subscription
subscriptionSql
Store3
(
RedisConnectionFactory
factory
)
{
public
Subscription
subscriptionSql
Goods1
(
RedisConnectionFactory
factory
)
{
var
listenerContainer
=
this
.
buildStreamMessageListenerContainer
(
factory
);
var
subscription
=
receiveSql
Store
(
listenerContainer
,
3
);
var
subscription
=
receiveSql
Goods
(
listenerContainer
,
1
);
listenerContainer
.
start
();
return
subscription
;
}
/* -------------------------------------------------------- | 用户中心 */
@Bean
public
Subscription
subscriptionSqlGoods2
(
RedisConnectionFactory
factory
)
{
var
listenerContainer
=
this
.
buildStreamMessageListenerContainer
(
factory
);
var
subscription
=
receiveSqlGoods
(
listenerContainer
,
2
);
listenerContainer
.
start
();
return
subscription
;
}
/* -------------------------------------------------------- | 店铺优惠券相关 */
@Bean
public
Subscription
subscriptionSql
Goods
1
(
RedisConnectionFactory
factory
)
{
public
Subscription
subscriptionSql
Coupon
1
(
RedisConnectionFactory
factory
)
{
var
listenerContainer
=
this
.
buildStreamMessageListenerContainer
(
factory
);
var
subscription
=
receiveSql
Goods
(
listenerContainer
,
1
);
var
subscription
=
receiveSql
Coupon
(
listenerContainer
,
1
);
listenerContainer
.
start
();
return
subscription
;
}
@Bean
public
Subscription
subscriptionSql
Goods
2
(
RedisConnectionFactory
factory
)
{
public
Subscription
subscriptionSql
Coupon
2
(
RedisConnectionFactory
factory
)
{
var
listenerContainer
=
this
.
buildStreamMessageListenerContainer
(
factory
);
var
subscription
=
receiveSqlGoods
(
listenerContainer
,
2
);
var
subscription
=
receiveSqlCoupon
(
listenerContainer
,
2
);
listenerContainer
.
start
();
return
subscription
;
}
@Bean
public
Subscription
subscriptionSqlCoupon3
(
RedisConnectionFactory
factory
)
{
var
listenerContainer
=
this
.
buildStreamMessageListenerContainer
(
factory
);
var
subscription
=
receiveSqlCoupon
(
listenerContainer
,
3
);
listenerContainer
.
start
();
return
subscription
;
}
@Bean
public
Subscription
subscriptionSqlCoupon4
(
RedisConnectionFactory
factory
)
{
var
listenerContainer
=
this
.
buildStreamMessageListenerContainer
(
factory
);
var
subscription
=
receiveSqlCoupon
(
listenerContainer
,
4
);
listenerContainer
.
start
();
return
subscription
;
}
@Bean
public
Subscription
subscriptionSqlCoupon5
(
RedisConnectionFactory
factory
)
{
var
listenerContainer
=
this
.
buildStreamMessageListenerContainer
(
factory
);
var
subscription
=
receiveSqlCoupon
(
listenerContainer
,
5
);
listenerContainer
.
start
();
return
subscription
;
}
@Bean
public
Subscription
subscriptionSqlCoupon6
(
RedisConnectionFactory
factory
)
{
var
listenerContainer
=
this
.
buildStreamMessageListenerContainer
(
factory
);
var
subscription
=
receiveSqlCoupon
(
listenerContainer
,
6
);
listenerContainer
.
start
();
return
subscription
;
}
@Bean
public
Subscription
subscriptionSqlCoupon7
(
RedisConnectionFactory
factory
)
{
var
listenerContainer
=
this
.
buildStreamMessageListenerContainer
(
factory
);
var
subscription
=
receiveSqlCoupon
(
listenerContainer
,
7
);
listenerContainer
.
start
();
return
subscription
;
}
@Bean
public
Subscription
subscriptionSqlCoupon8
(
RedisConnectionFactory
factory
)
{
var
listenerContainer
=
this
.
buildStreamMessageListenerContainer
(
factory
);
var
subscription
=
receiveSqlCoupon
(
listenerContainer
,
8
);
listenerContainer
.
start
();
return
subscription
;
}
@Bean
public
Subscription
subscriptionSqlCoupon9
(
RedisConnectionFactory
factory
)
{
var
listenerContainer
=
this
.
buildStreamMessageListenerContainer
(
factory
);
var
subscription
=
receiveSqlCoupon
(
listenerContainer
,
9
);
listenerContainer
.
start
();
return
subscription
;
}
@Bean
public
Subscription
subscriptionSql
Goods3
(
RedisConnectionFactory
factory
)
{
public
Subscription
subscriptionSql
Coupon10
(
RedisConnectionFactory
factory
)
{
var
listenerContainer
=
this
.
buildStreamMessageListenerContainer
(
factory
);
var
subscription
=
receiveSql
Goods
(
listenerContainer
,
3
);
var
subscription
=
receiveSql
Coupon
(
listenerContainer
,
10
);
listenerContainer
.
start
();
return
subscription
;
}
...
...
liquidnet-bus-service/liquidnet-service-consumer-all/liquidnet-service-consumer-goblin/src/main/java/com/liquidnet/service/consumer/goblin/receiver/ConsumerGoblinSqlCouponRdsReceiver.java
0 → 100644
View file @
5fa3b82a
package
com
.
liquidnet
.
service
.
consumer
.
goblin
.
receiver
;
import
com.liquidnet.service.base.constant.MQConst
;
import
org.springframework.stereotype.Component
;
@Component
public
class
ConsumerGoblinSqlCouponRdsReceiver
extends
AbstractSqlRedisReceiver
{
@Override
protected
String
getRedisStreamKey
()
{
return
MQConst
.
GoblinQueue
.
SQL_COUPON
.
getKey
();
}
@Override
protected
String
getRedisStreamGroup
()
{
return
MQConst
.
GoblinQueue
.
SQL_COUPON
.
getGroup
();
}
}
liquidnet-bus-service/liquidnet-service-goblin/liquidnet-service-goblin-impl/docu/redis_queue_create.txt
View file @
5fa3b82a
...
...
@@ -4,6 +4,9 @@ XGROUP CREATE goblin:stream:sql.store group.sql.ustore 0
#---- 商品相关
XADD goblin:stream:sql.goods * 0 0
XGROUP CREATE goblin:stream:sql.goods group.sql.ustore 0
#---- 店铺优惠券相关
XADD goblin:stream:sql.coupon * 0 0
XGROUP CREATE goblin:stream:sql.coupon group.sql.ustore 0
#---- #
XADD goblin:stream:store.market * 0 0
XGROUP CREATE goblin:stream:store.market group.store.market 0
...
...
liquidnet-bus-service/liquidnet-service-goblin/liquidnet-service-goblin-impl/src/main/java/com/liquidnet/service/goblin/service/impl/GoblinCouponImpl.java
View file @
5fa3b82a
...
...
@@ -97,7 +97,7 @@ public class GoblinCouponImpl implements GoblinCouponService {
receiveUserCouponBasicVo
.
getState
(),
receiveUserCouponBasicVo
.
getBindAt
(),
receiveUserCouponBasicVo
.
getDuedAt
(),
receiveUserCouponBasicVo
.
getOperator
(),
receiveUserCouponBasicVo
.
getCreatedAt
()
});
queueUtils
.
sendMsgByRedis
(
MQConst
.
GoblinQueue
.
SQL_
STORE
.
getKey
(),
queueUtils
.
sendMsgByRedis
(
MQConst
.
GoblinQueue
.
SQL_
COUPON
.
getKey
(),
SqlMapping
.
get
(
"goblin_user_coupon.insert"
,
initUserCouponObjs
));
return
true
;
}
...
...
@@ -240,7 +240,7 @@ public class GoblinCouponImpl implements GoblinCouponService {
vo
.
setState
(
5
);
vo
.
setUsedFor
(
content
);
goblinMongoUtils
.
changeCouponVos
(
vo
.
getUcouponId
(),
vo
);
queueUtils
.
sendMsgByRedis
(
MQConst
.
GoblinQueue
.
SQL_
STORE
.
getKey
(),
queueUtils
.
sendMsgByRedis
(
MQConst
.
GoblinQueue
.
SQL_
COUPON
.
getKey
(),
SqlMapping
.
get
(
"goblin_user_coupon.updateState"
,
vo
.
getState
(),
vo
.
getUsedFor
(),
LocalDateTime
.
now
(),
vo
.
getUcouponId
()));
break
;
}
else
{
...
...
@@ -269,7 +269,7 @@ public class GoblinCouponImpl implements GoblinCouponService {
vo
.
setState
(
5
);
vo
.
setUsedFor
(
content
);
goblinMongoUtils
.
changeCouponVos
(
vo
.
getUcouponId
(),
vo
);
queueUtils
.
sendMsgByRedis
(
MQConst
.
GoblinQueue
.
SQL_
STORE
.
getKey
(),
queueUtils
.
sendMsgByRedis
(
MQConst
.
GoblinQueue
.
SQL_
COUPON
.
getKey
(),
SqlMapping
.
get
(
"goblin_user_coupon.updateState"
,
vo
.
getState
(),
vo
.
getUsedFor
(),
LocalDateTime
.
now
(),
vo
.
getUcouponId
()));
}
break
;
...
...
@@ -297,7 +297,7 @@ public class GoblinCouponImpl implements GoblinCouponService {
vo
.
setUsedFor
(
""
);
goblinRedisUtils
.
setUserCouponVos
(
item
.
getUid
(),
voList
);
goblinMongoUtils
.
changeCouponVos
(
vo
.
getUcouponId
(),
vo
);
queueUtils
.
sendMsgByRedis
(
MQConst
.
GoblinQueue
.
SQL_
STORE
.
getKey
(),
queueUtils
.
sendMsgByRedis
(
MQConst
.
GoblinQueue
.
SQL_
COUPON
.
getKey
(),
SqlMapping
.
get
(
"goblin_user_coupon.updateState"
,
vo
.
getState
(),
vo
.
getUsedFor
(),
LocalDateTime
.
now
(),
vo
.
getUcouponId
()));
}
break
;
...
...
liquidnet-bus-service/liquidnet-service-goblin/liquidnet-service-goblin-impl/src/main/java/com/liquidnet/service/goblin/service/impl/manage/GoblinStoreMgtCouponServiceImpl.java
View file @
5fa3b82a
...
...
@@ -100,7 +100,7 @@ public class GoblinStoreMgtCouponServiceImpl implements IGoblinstoreMgtCouponSer
LinkedList
<
Object
[]>
activityStoreCouponObjs
=
CollectionUtil
.
linkedListObjectArr
();
storeCouponIdList
.
forEach
(
storeCouponId
->
activityStoreCouponObjs
.
add
(
new
Object
[]{
state
,
uid
,
now
,
storeCouponId
}));
queueUtils
.
sendMsgByRedis
(
MQConst
.
GoblinQueue
.
SQL_
STORE
.
getKey
(),
queueUtils
.
sendMsgByRedis
(
MQConst
.
GoblinQueue
.
SQL_
COUPON
.
getKey
(),
SqlMapping
.
get
(
"goblin_store_coupon.activity"
,
activityStoreCouponObjs
));
}
}
...
...
@@ -126,7 +126,7 @@ public class GoblinStoreMgtCouponServiceImpl implements IGoblinstoreMgtCouponSer
LinkedList
<
Object
[]>
deleteStoreCouponObjs
=
CollectionUtil
.
linkedListObjectArr
();
storeCouponIdList
.
forEach
(
storeCouponId
->
deleteStoreCouponObjs
.
add
(
new
Object
[]{
uid
,
now
,
storeCouponId
}));
queueUtils
.
sendMsgByRedis
(
MQConst
.
GoblinQueue
.
SQL_
STORE
.
getKey
(),
queueUtils
.
sendMsgByRedis
(
MQConst
.
GoblinQueue
.
SQL_
COUPON
.
getKey
(),
SqlMapping
.
get
(
"goblin_store_coupon.delete"
,
deleteStoreCouponObjs
));
}
}
...
...
@@ -178,7 +178,7 @@ public class GoblinStoreMgtCouponServiceImpl implements IGoblinstoreMgtCouponSer
storeCouponBasicVo
.
getSpuIdList
().
forEach
(
spuId
->
initStoreCouponRuleObjs
.
add
(
new
Object
[]{
storeCouponId
,
spuId
,
uid
,
now
}));
}
queueUtils
.
sendMsgByRedis
(
MQConst
.
GoblinQueue
.
SQL_
STORE
.
getKey
(),
queueUtils
.
sendMsgByRedis
(
MQConst
.
GoblinQueue
.
SQL_
COUPON
.
getKey
(),
SqlMapping
.
gets
(
toMqSqls
,
initStoreCouponObjs
,
initStoreCouponRuleObjs
));
}
...
...
@@ -259,7 +259,7 @@ public class GoblinStoreMgtCouponServiceImpl implements IGoblinstoreMgtCouponSer
storeCouponBasicVo
.
getSpuIdList
().
forEach
(
spuId
->
initStoreCouponRuleObjs
.
add
(
new
Object
[]{
storeCouponId
,
spuId
,
uid
,
now
}));
}
queueUtils
.
sendMsgByRedis
(
MQConst
.
GoblinQueue
.
SQL_
STORE
.
getKey
(),
queueUtils
.
sendMsgByRedis
(
MQConst
.
GoblinQueue
.
SQL_
COUPON
.
getKey
(),
SqlMapping
.
gets
(
toMqSqls
,
updateStoreCouponObjs
,
delStoreCouponRuleObjs
,
initStoreCouponRuleObjs
));
return
true
;
}
...
...
@@ -292,7 +292,7 @@ public class GoblinStoreMgtCouponServiceImpl implements IGoblinstoreMgtCouponSer
}
goblinRedisUtils
.
del
(
GoblinRedisConst
.
STORE_COUPON
.
concat
(
storeCouponId
));
// 删除REDIS缓存
queueUtils
.
sendMsgByRedis
(
MQConst
.
GoblinQueue
.
SQL_
STORE
.
getKey
(),
queueUtils
.
sendMsgByRedis
(
MQConst
.
GoblinQueue
.
SQL_
COUPON
.
getKey
(),
SqlMapping
.
get
(
"goblin_store_coupon.update_stock"
,
stock
,
uid
,
now
,
storeCouponId
));
return
true
;
}
...
...
liquidnet-bus-service/liquidnet-service-goblin/liquidnet-service-goblin-impl/src/main/java/com/liquidnet/service/goblin/util/GoblinMongoUtils.java
View file @
5fa3b82a
...
...
@@ -294,8 +294,10 @@ public class GoblinMongoUtils {
return
list
;
}
public
GoblinStoreInfoVo
getStoreInfoVoByUid
(
String
uid
)
{
return
mongoTemplate
.
findOne
(
Query
.
query
(
Criteria
.
where
(
"uid"
).
is
(
uid
).
and
(
"delFlg"
).
is
(
"0"
)),
public
List
<
GoblinStoreInfoVo
>
getStoreInfoVoByUid
(
String
uid
)
{
// return mongoTemplate.findOne(Query.query(Criteria.where("uid").is(uid).and("delFlg").is("0")),
// GoblinStoreInfoVo.class, GoblinStoreInfoVo.class.getSimpleName());
return
mongoTemplate
.
find
(
Query
.
query
(
Criteria
.
where
(
"uid"
).
is
(
uid
).
and
(
"delFlg"
).
is
(
"0"
)),
GoblinStoreInfoVo
.
class
,
GoblinStoreInfoVo
.
class
.
getSimpleName
());
}
...
...
liquidnet-bus-service/liquidnet-service-goblin/liquidnet-service-goblin-impl/src/main/java/com/liquidnet/service/goblin/util/GoblinRedisUtils.java
View file @
5fa3b82a
...
...
@@ -343,13 +343,16 @@ public class GoblinRedisUtils {
public
GoblinStoreInfoVo
getStoreInfoVoByUid
(
String
uid
)
{
List
<
String
>
storeIds
=
this
.
getStoreIds
(
uid
);
GoblinStoreInfoVo
storeInfoVo
;
GoblinStoreInfoVo
storeInfoVo
=
null
;
if
(
CollectionUtils
.
isEmpty
(
storeIds
))
{
storeInfoVo
=
goblinMongoUtils
.
getStoreInfoVoByUid
(
uid
);
if
(
null
!=
storeInfoVo
)
{
List
<
GoblinStoreInfoVo
>
vos
=
goblinMongoUtils
.
getStoreInfoVoByUid
(
uid
);
if
(
!
CollectionUtils
.
isEmpty
(
vos
)
)
{
storeIds
=
CollectionUtil
.
arrayListString
();
storeIds
.
add
(
storeInfoVo
.
getStoreId
());
for
(
GoblinStoreInfoVo
vo
:
vos
)
{
storeIds
.
add
(
vo
.
getStoreId
());
}
this
.
setStoreIds
(
uid
,
storeIds
);
storeInfoVo
=
vos
.
get
(
0
);
}
}
else
{
storeInfoVo
=
this
.
getStoreInfoVo
(
storeIds
.
get
(
0
));
...
...
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