记得上下班打卡 | 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
53751100
Commit
53751100
authored
Feb 18, 2022
by
张国柄
Browse files
Options
Browse Files
Download
Plain Diff
Merge remote-tracking branch 'origin/dev_goblin' into dev_goblin
parents
561c2c8a
72993dc4
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
47 additions
and
14 deletions
+47
-14
GoblinGoodsSkuInfoDetailVo.java
...net/service/goblin/dto/vo/GoblinGoodsSkuInfoDetailVo.java
+6
-1
GoblinFrontServiceImpl.java
...t/service/goblin/service/impl/GoblinFrontServiceImpl.java
+14
-2
GoblinOrderServiceImpl.java
...t/service/goblin/service/impl/GoblinOrderServiceImpl.java
+3
-3
GoblinZhengzaiServiceImpl.java
...goblin/service/impl/manage/GoblinZhengzaiServiceImpl.java
+2
-0
GoblinMongoUtils.java
...a/com/liquidnet/service/goblin/util/GoblinMongoUtils.java
+11
-4
DMCheckGoblinOrderTimeImpl.java
...tform/service/impl/goblin/DMCheckGoblinOrderTimeImpl.java
+11
-4
No files found.
liquidnet-bus-api/liquidnet-service-goblin-api/src/main/java/com/liquidnet/service/goblin/dto/vo/GoblinGoodsSkuInfoDetailVo.java
View file @
53751100
...
@@ -32,8 +32,13 @@ public class GoblinGoodsSkuInfoDetailVo implements Serializable, Cloneable {
...
@@ -32,8 +32,13 @@ public class GoblinGoodsSkuInfoDetailVo implements Serializable, Cloneable {
private
String
skuAppear
;
private
String
skuAppear
;
@ApiModelProperty
(
position
=
11
,
value
=
"商品ID[64]"
)
@ApiModelProperty
(
position
=
11
,
value
=
"商品ID[64]"
)
private
String
spuId
;
private
String
spuId
;
@ApiModelProperty
(
position
=
12
,
value
=
"
库存是否告警,true 告警,false没有告警
"
)
@ApiModelProperty
(
position
=
12
,
value
=
"
true 没有库存了, false 有库存
"
)
private
boolean
stockLess
;
private
boolean
stockLess
;
@ApiModelProperty
(
position
=
13
,
value
=
"可以购买数量"
)
private
int
canBuy
;
@ApiModelProperty
(
position
=
26
,
value
=
"限量[0-无限制|X:限购数量]"
)
private
Integer
buyLimit
;
private
static
final
GoblinGoodsSkuInfoDetailVo
obj
=
new
GoblinGoodsSkuInfoDetailVo
();
private
static
final
GoblinGoodsSkuInfoDetailVo
obj
=
new
GoblinGoodsSkuInfoDetailVo
();
...
...
liquidnet-bus-service/liquidnet-service-goblin/liquidnet-service-goblin-impl/src/main/java/com/liquidnet/service/goblin/service/impl/GoblinFrontServiceImpl.java
View file @
53751100
...
@@ -17,6 +17,7 @@ import com.liquidnet.service.goblin.util.ObjectUtil;
...
@@ -17,6 +17,7 @@ import com.liquidnet.service.goblin.util.ObjectUtil;
import
com.liquidnet.service.goblin.util.QueueUtils
;
import
com.liquidnet.service.goblin.util.QueueUtils
;
import
com.mongodb.BasicDBObject
;
import
com.mongodb.BasicDBObject
;
import
lombok.extern.slf4j.Slf4j
;
import
lombok.extern.slf4j.Slf4j
;
import
org.apache.commons.lang3.StringUtils
;
import
org.springframework.beans.BeanUtils
;
import
org.springframework.beans.BeanUtils
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.data.domain.PageRequest
;
import
org.springframework.data.domain.PageRequest
;
...
@@ -279,6 +280,7 @@ public class GoblinFrontServiceImpl implements GoblinFrontService {
...
@@ -279,6 +280,7 @@ public class GoblinFrontServiceImpl implements GoblinFrontService {
* 获得商品详情
* 获得商品详情
*/
*/
public
GoblinFrontGoodDetailVo
getGoodsDetail
(
String
spuId
){
public
GoblinFrontGoodDetailVo
getGoodsDetail
(
String
spuId
){
Integer
buyCount
=
0
;
GoblinFrontGoodDetailVo
goblinFrontGoodDetailVo
=
GoblinFrontGoodDetailVo
.
getNew
();
GoblinFrontGoodDetailVo
goblinFrontGoodDetailVo
=
GoblinFrontGoodDetailVo
.
getNew
();
GoblinGoodsInfoVo
goblinGoodsInfoVo
=
goblinRedisUtils
.
getGoodsInfoVo
(
spuId
);
GoblinGoodsInfoVo
goblinGoodsInfoVo
=
goblinRedisUtils
.
getGoodsInfoVo
(
spuId
);
GoblinGoodsInfoDetailVo
goblinGoodsInfoDetailVo
=
GoblinGoodsInfoDetailVo
.
getNew
();
GoblinGoodsInfoDetailVo
goblinGoodsInfoDetailVo
=
GoblinGoodsInfoDetailVo
.
getNew
();
...
@@ -286,17 +288,27 @@ public class GoblinFrontServiceImpl implements GoblinFrontService {
...
@@ -286,17 +288,27 @@ public class GoblinFrontServiceImpl implements GoblinFrontService {
goblinFrontGoodDetailVo
.
setGoblinGoodsInfoVo
(
goblinGoodsInfoDetailVo
);
goblinFrontGoodDetailVo
.
setGoblinGoodsInfoVo
(
goblinGoodsInfoDetailVo
);
//skuIdList
//skuIdList
if
(
null
!=
goblinGoodsInfoVo
){
if
(
null
!=
goblinGoodsInfoVo
){
int
limit
=
getStockCount
(
goblinGoodsInfoVo
.
getStoreId
());
//
int limit= getStockCount(goblinGoodsInfoVo.getStoreId());
List
<
String
>
skuIdList
=
goblinGoodsInfoVo
.
getSkuIdList
();
List
<
String
>
skuIdList
=
goblinGoodsInfoVo
.
getSkuIdList
();
ArrayList
<
GoblinGoodsSkuInfoDetailVo
>
list
=
ObjectUtil
.
goblinGoodsSkuInfoDetailVos
();
ArrayList
<
GoblinGoodsSkuInfoDetailVo
>
list
=
ObjectUtil
.
goblinGoodsSkuInfoDetailVos
();
for
(
String
sku:
skuIdList
){
for
(
String
sku:
skuIdList
){
String
userId
=
CurrentUtil
.
getCurrentUid
();
if
(
StringUtils
.
isNotBlank
(
userId
)){
buyCount
=
goblinRedisUtils
.
getSkuCountByUid
(
userId
,
sku
);
}
GoblinGoodsSkuInfoVo
goblinGoodsSkuInfoVo
=
goblinRedisUtils
.
getGoodsSkuInfoVo
(
sku
);
GoblinGoodsSkuInfoVo
goblinGoodsSkuInfoVo
=
goblinRedisUtils
.
getGoodsSkuInfoVo
(
sku
);
if
(
null
!=
goblinGoodsSkuInfoVo
){
if
(
null
!=
goblinGoodsSkuInfoVo
){
//获取 sku 库存数量
//获取 sku 库存数量
int
stock
=
goblinRedisUtils
.
getSkuStock
(
null
,
goblinGoodsSkuInfoVo
.
getSkuId
());
int
stock
=
goblinRedisUtils
.
getSkuStock
(
null
,
goblinGoodsSkuInfoVo
.
getSkuId
());
GoblinGoodsSkuInfoDetailVo
goblinGoodsSkuInfoDetailVo
=
GoblinGoodsSkuInfoDetailVo
.
getNew
();
GoblinGoodsSkuInfoDetailVo
goblinGoodsSkuInfoDetailVo
=
GoblinGoodsSkuInfoDetailVo
.
getNew
();
BeanUtils
.
copyProperties
(
goblinGoodsSkuInfoVo
,
goblinGoodsSkuInfoDetailVo
);
BeanUtils
.
copyProperties
(
goblinGoodsSkuInfoVo
,
goblinGoodsSkuInfoDetailVo
);
if
(
limit
>=
stock
){
if
(
null
!=
goblinGoodsSkuInfoDetailVo
.
getBuyLimit
()){
if
(
null
==
buyCount
){
buyCount
=
0
;
}
goblinGoodsSkuInfoDetailVo
.
setCanBuy
(
goblinGoodsSkuInfoDetailVo
.
getBuyLimit
()-
buyCount
);
}
if
(
stock
<=
0
){
goblinGoodsSkuInfoDetailVo
.
setStockLess
(
true
);
goblinGoodsSkuInfoDetailVo
.
setStockLess
(
true
);
}
else
{
}
else
{
goblinGoodsSkuInfoDetailVo
.
setStockLess
(
false
);
goblinGoodsSkuInfoDetailVo
.
setStockLess
(
false
);
...
...
liquidnet-bus-service/liquidnet-service-goblin/liquidnet-service-goblin-impl/src/main/java/com/liquidnet/service/goblin/service/impl/GoblinOrderServiceImpl.java
View file @
53751100
...
@@ -116,7 +116,7 @@ public class GoblinOrderServiceImpl implements IGoblinOrderService {
...
@@ -116,7 +116,7 @@ public class GoblinOrderServiceImpl implements IGoblinOrderService {
String
skuId
=
skuParam
.
getSkuId
();
String
skuId
=
skuParam
.
getSkuId
();
int
number
=
skuParam
.
getNumber
();
int
number
=
skuParam
.
getNumber
();
GoblinGoodsSkuInfoVo
skuVo
=
redisUtils
.
getGoodsSkuInfoVo
(
skuId
);
GoblinGoodsSkuInfoVo
skuVo
=
redisUtils
.
getGoodsSkuInfoVo
(
skuId
);
if
(!(
skuVo
.
getStatus
().
equals
(
"3"
)
&&
skuVo
.
getShelvesStatus
().
equals
(
"3"
)))
{
if
(!(
skuVo
.
getStatus
().
equals
(
"3"
)
&&
skuVo
.
getShelvesStatus
().
equals
(
"3"
))
||
skuVo
.
getDelFlg
().
equals
(
"1"
)
)
{
throw
new
Exception
(
"不可购买"
);
throw
new
Exception
(
"不可购买"
);
}
}
// 判断库存
// 判断库存
...
@@ -144,7 +144,7 @@ public class GoblinOrderServiceImpl implements IGoblinOrderService {
...
@@ -144,7 +144,7 @@ public class GoblinOrderServiceImpl implements IGoblinOrderService {
skuAndPreListAndNumber
.
add
(
skuId
+
","
+
pre
+
","
+
number
);
skuAndPreListAndNumber
.
add
(
skuId
+
","
+
pre
+
","
+
number
);
//库存回滚
//库存回滚
if
(
surplusGeneral
<
0
)
{
if
(
surplusGeneral
<
0
)
{
throw
new
Exception
(
"
已售罄
"
);
throw
new
Exception
(
"
库存不足
"
);
}
}
}
//GoblinOrderSkuParam
}
//GoblinOrderSkuParam
//下单
//下单
...
@@ -195,7 +195,7 @@ public class GoblinOrderServiceImpl implements IGoblinOrderService {
...
@@ -195,7 +195,7 @@ public class GoblinOrderServiceImpl implements IGoblinOrderService {
return
ResponseDto
.
failure
(
e
.
getMessage
());
return
ResponseDto
.
failure
(
e
.
getMessage
());
}
else
if
(
e
.
getMessage
().
equals
(
"参数异常"
))
{
}
else
if
(
e
.
getMessage
().
equals
(
"参数异常"
))
{
return
ResponseDto
.
failure
(
e
.
getMessage
());
return
ResponseDto
.
failure
(
e
.
getMessage
());
}
else
if
(
e
.
getMessage
().
equals
(
"
已售罄
"
))
{
}
else
if
(
e
.
getMessage
().
equals
(
"
库存不足
"
))
{
return
ResponseDto
.
failure
(
e
.
getMessage
());
return
ResponseDto
.
failure
(
e
.
getMessage
());
}
else
if
(
e
.
getMessage
().
equals
(
"已超出限购数量"
))
{
}
else
if
(
e
.
getMessage
().
equals
(
"已超出限购数量"
))
{
return
ResponseDto
.
failure
(
e
.
getMessage
());
return
ResponseDto
.
failure
(
e
.
getMessage
());
...
...
liquidnet-bus-service/liquidnet-service-goblin/liquidnet-service-goblin-impl/src/main/java/com/liquidnet/service/goblin/service/impl/manage/GoblinZhengzaiServiceImpl.java
View file @
53751100
...
@@ -319,6 +319,8 @@ public class GoblinZhengzaiServiceImpl implements IGoblinZhengzaiService {
...
@@ -319,6 +319,8 @@ public class GoblinZhengzaiServiceImpl implements IGoblinZhengzaiService {
int
restStock
=
redisUtils
.
getSkuStock
(
GoblinStatusConst
.
MarketPreStatus
.
MARKET_PRE_ZHENGZAI
.
getValue
(),
marketSkuId
);
int
restStock
=
redisUtils
.
getSkuStock
(
GoblinStatusConst
.
MarketPreStatus
.
MARKET_PRE_ZHENGZAI
.
getValue
(),
marketSkuId
);
int
restStockDe
=
redisUtils
.
decrSkuStock
(
GoblinStatusConst
.
MarketPreStatus
.
MARKET_PRE_ZHENGZAI
.
getValue
(),
marketSkuId
,
restStock
);
int
restStockDe
=
redisUtils
.
decrSkuStock
(
GoblinStatusConst
.
MarketPreStatus
.
MARKET_PRE_ZHENGZAI
.
getValue
(),
marketSkuId
,
restStock
);
redisUtils
.
incrSkuStock
(
null
,
skuId
,
restStock
+
restStockDe
);
redisUtils
.
incrSkuStock
(
null
,
skuId
,
restStock
+
restStockDe
);
mongoUtils
.
delGoodsSkuInfoVo
(
marketSkuId
);
redisUtils
.
delGoodsSkuInfoVo
(
marketSkuId
);
}
}
//mongo
//mongo
mongoUtils
.
delGoodsInfoVo
(
marketSpuId
);
mongoUtils
.
delGoodsInfoVo
(
marketSpuId
);
...
...
liquidnet-bus-service/liquidnet-service-goblin/liquidnet-service-goblin-impl/src/main/java/com/liquidnet/service/goblin/util/GoblinMongoUtils.java
View file @
53751100
...
@@ -279,12 +279,12 @@ public class GoblinMongoUtils {
...
@@ -279,12 +279,12 @@ public class GoblinMongoUtils {
GoblinStoreInfoVo
.
class
,
GoblinStoreInfoVo
.
class
.
getSimpleName
());
GoblinStoreInfoVo
.
class
,
GoblinStoreInfoVo
.
class
.
getSimpleName
());
}
}
public
ArrayList
<
String
>
getStoreInfoVoRegexName
(
String
storeName
)
{
public
ArrayList
<
String
>
getStoreInfoVoRegexName
(
String
storeName
)
{
Query
query
=
Query
.
query
(
Criteria
.
where
(
"storeName"
).
regex
(
"^.*"
+
storeName
+
".*$"
).
and
(
"delFlg"
).
is
(
"0"
).
and
(
"status"
).
in
(
"3"
,
"5"
));
Query
query
=
Query
.
query
(
Criteria
.
where
(
"storeName"
).
regex
(
"^.*"
+
storeName
+
".*$"
).
and
(
"delFlg"
).
is
(
"0"
).
and
(
"status"
).
in
(
"3"
,
"5"
));
query
.
fields
().
include
(
"storeId"
);
query
.
fields
().
include
(
"storeId"
);
List
<
GoblinStoreInfoVo
>
voList
=
mongoTemplate
.
find
(
query
,
GoblinStoreInfoVo
.
class
,
GoblinStoreInfoVo
.
class
.
getSimpleName
());
List
<
GoblinStoreInfoVo
>
voList
=
mongoTemplate
.
find
(
query
,
GoblinStoreInfoVo
.
class
,
GoblinStoreInfoVo
.
class
.
getSimpleName
());
ArrayList
<
String
>
list
=
CollectionUtil
.
arrayListString
();
ArrayList
<
String
>
list
=
CollectionUtil
.
arrayListString
();
for
(
GoblinStoreInfoVo
goblinStoreInfoVo:
voList
)
{
for
(
GoblinStoreInfoVo
goblinStoreInfoVo
:
voList
)
{
list
.
add
(
goblinStoreInfoVo
.
getStoreId
());
list
.
add
(
goblinStoreInfoVo
.
getStoreId
());
}
}
return
list
;
return
list
;
...
@@ -303,14 +303,19 @@ public class GoblinMongoUtils {
...
@@ -303,14 +303,19 @@ public class GoblinMongoUtils {
}
}
public
boolean
delGoodsInfoVo
(
String
spuId
)
{
public
boolean
delGoodsInfoVo
(
String
spuId
)
{
// return mongoTemplate.remove(Query.query(Criteria.where("spuId").is(spuId).and("delFlg").is("0")),
// GoblinGoodsInfoVo.class, GoblinGoodsInfoVo.class.getSimpleName()).getDeletedCount() > 0;
return
mongoTemplate
.
getCollection
(
GoblinGoodsInfoVo
.
class
.
getSimpleName
()).
updateOne
(
return
mongoTemplate
.
getCollection
(
GoblinGoodsInfoVo
.
class
.
getSimpleName
()).
updateOne
(
Query
.
query
(
Criteria
.
where
(
"spuId"
).
is
(
spuId
).
and
(
"delFlg"
).
is
(
"0"
)).
getQueryObject
(),
Query
.
query
(
Criteria
.
where
(
"spuId"
).
is
(
spuId
).
and
(
"delFlg"
).
is
(
"0"
)).
getQueryObject
(),
Update
.
update
(
"delFlg"
,
"1"
).
getUpdateObject
()
Update
.
update
(
"delFlg"
,
"1"
).
getUpdateObject
()
).
getModifiedCount
()
>
0
;
).
getModifiedCount
()
>
0
;
}
}
public
boolean
delGoodsSkuInfoVo
(
String
spuId
)
{
return
mongoTemplate
.
getCollection
(
GoblinGoodsSkuInfoVo
.
class
.
getSimpleName
()).
updateOne
(
Query
.
query
(
Criteria
.
where
(
"skuId"
).
is
(
spuId
).
and
(
"delFlg"
).
is
(
"0"
)).
getQueryObject
(),
Update
.
update
(
"delFlg"
,
"1"
).
getUpdateObject
()
).
getModifiedCount
()
>
0
;
}
public
boolean
delGoodsInfoVoBySpuIds
(
String
storeId
,
List
<
String
>
spuIdList
,
String
uid
,
LocalDateTime
time
)
{
public
boolean
delGoodsInfoVoBySpuIds
(
String
storeId
,
List
<
String
>
spuIdList
,
String
uid
,
LocalDateTime
time
)
{
return
mongoTemplate
.
updateMulti
(
return
mongoTemplate
.
updateMulti
(
Query
.
query
(
Criteria
.
where
(
"storeId"
).
is
(
storeId
).
and
(
"spuId"
).
in
(
spuIdList
.
toArray
()).
and
(
"delFlg"
).
is
(
"0"
)),
Query
.
query
(
Criteria
.
where
(
"storeId"
).
is
(
storeId
).
and
(
"spuId"
).
in
(
spuIdList
.
toArray
()).
and
(
"delFlg"
).
is
(
"0"
)),
...
@@ -897,11 +902,13 @@ public class GoblinMongoUtils {
...
@@ -897,11 +902,13 @@ public class GoblinMongoUtils {
query
.
skip
(
skipCount
).
limit
(
size
).
with
(
Sort
.
by
(
Sort
.
Order
.
desc
(
"createdAt"
)));
query
.
skip
(
skipCount
).
limit
(
size
).
with
(
Sort
.
by
(
Sort
.
Order
.
desc
(
"createdAt"
)));
return
mongoTemplate
.
find
(
query
,
GoblinStoreOrderVo
.
class
,
GoblinStoreOrderVo
.
class
.
getSimpleName
());
return
mongoTemplate
.
find
(
query
,
GoblinStoreOrderVo
.
class
,
GoblinStoreOrderVo
.
class
.
getSimpleName
());
}
}
public
List
<
GoblinFrontBanner
>
getListBanner
()
{
public
List
<
GoblinFrontBanner
>
getListBanner
()
{
Query
query
=
Query
.
query
(
Criteria
.
where
(
"delTag"
).
is
(
0
).
and
(
"bannerType"
).
is
(
1
));
Query
query
=
Query
.
query
(
Criteria
.
where
(
"delTag"
).
is
(
0
).
and
(
"bannerType"
).
is
(
1
));
return
mongoTemplate
.
find
(
query
,
return
mongoTemplate
.
find
(
query
,
GoblinFrontBanner
.
class
,
GoblinFrontBanner
.
class
.
getSimpleName
());
GoblinFrontBanner
.
class
,
GoblinFrontBanner
.
class
.
getSimpleName
());
}
}
public
List
<
GoblinFrontBanner
>
getMiddleBanner
()
{
public
List
<
GoblinFrontBanner
>
getMiddleBanner
()
{
Query
query
=
Query
.
query
(
Criteria
.
where
(
"delTag"
).
is
(
0
).
and
(
"bannerType"
).
is
(
2
));
Query
query
=
Query
.
query
(
Criteria
.
where
(
"delTag"
).
is
(
0
).
and
(
"bannerType"
).
is
(
2
));
return
mongoTemplate
.
find
(
query
,
return
mongoTemplate
.
find
(
query
,
...
...
liquidnet-bus-service/liquidnet-service-platform/liquidnet-service-platform-impl/src/main/java/com/liquidnet/service/platform/service/impl/goblin/DMCheckGoblinOrderTimeImpl.java
View file @
53751100
...
@@ -69,6 +69,7 @@ public class DMCheckGoblinOrderTimeImpl extends ServiceImpl<GoblinStoreOrderMapp
...
@@ -69,6 +69,7 @@ public class DMCheckGoblinOrderTimeImpl extends ServiceImpl<GoblinStoreOrderMapp
goblinRedisUtils
.
removeGoblinOrder
(
i
+
""
,
orderId
);
goblinRedisUtils
.
removeGoblinOrder
(
i
+
""
,
orderId
);
continue
;
continue
;
}
}
log
.
debug
(
"ORDERDATA = "
+
orderVo
);
LocalDateTime
expireTime
=
LocalDateTime
.
parse
(
orderVo
.
getCreatedAt
(),
DTF_YMD_HMS
).
plusMinutes
(
orderVo
.
getPayCountdownMinute
()
+
1
);
LocalDateTime
expireTime
=
LocalDateTime
.
parse
(
orderVo
.
getCreatedAt
(),
DTF_YMD_HMS
).
plusMinutes
(
orderVo
.
getPayCountdownMinute
()
+
1
);
if
(
now
.
isAfter
(
expireTime
)
&&
orderVo
.
getStatus
()
==
GoblinStatusConst
.
Status
.
ORDER_STATUS_0
.
getValue
())
{
//过期
if
(
now
.
isAfter
(
expireTime
)
&&
orderVo
.
getStatus
()
==
GoblinStatusConst
.
Status
.
ORDER_STATUS_0
.
getValue
())
{
//过期
LinkedList
<
String
>
sqls
=
CollectionUtil
.
linkedListString
();
LinkedList
<
String
>
sqls
=
CollectionUtil
.
linkedListString
();
...
@@ -76,14 +77,20 @@ public class DMCheckGoblinOrderTimeImpl extends ServiceImpl<GoblinStoreOrderMapp
...
@@ -76,14 +77,20 @@ public class DMCheckGoblinOrderTimeImpl extends ServiceImpl<GoblinStoreOrderMapp
LinkedList
<
Object
[]>
sqlDataSku
=
CollectionUtil
.
linkedListObjectArr
();
LinkedList
<
Object
[]>
sqlDataSku
=
CollectionUtil
.
linkedListObjectArr
();
sqls
.
add
(
SqlMapping
.
get
(
"goblin_order.close.order"
));
sqls
.
add
(
SqlMapping
.
get
(
"goblin_order.close.order"
));
sqls
.
add
(
SqlMapping
.
get
(
"goblin_order.close.sku"
));
sqls
.
add
(
SqlMapping
.
get
(
"goblin_order.close.sku"
));
for
(
String
s
kuId
:
orderVo
.
getOrderSkuVoIds
())
{
for
(
String
orderS
kuId
:
orderVo
.
getOrderSkuVoIds
())
{
GoblinOrderSkuVo
skuVo
=
goblinRedisUtils
.
getGoblinOrderSkuVo
(
s
kuId
);
GoblinOrderSkuVo
skuVo
=
goblinRedisUtils
.
getGoblinOrderSkuVo
(
orderS
kuId
);
//订单详情
//订单详情
skuVo
.
setStatus
(
GoblinStatusConst
.
Status
.
ORDER_STATUS_5
.
getValue
());
skuVo
.
setStatus
(
GoblinStatusConst
.
Status
.
ORDER_STATUS_5
.
getValue
());
updateGoblinOrderSkuVo
(
skuVo
.
getOrderSkuId
(),
skuVo
);
updateGoblinOrderSkuVo
(
skuVo
.
getOrderSkuId
(),
skuVo
);
goblinRedisUtils
.
setGoblinOrderSku
(
skuVo
.
getOrderSkuId
(),
skuVo
);
goblinRedisUtils
.
setGoblinOrderSku
(
skuVo
.
getOrderSkuId
(),
skuVo
);
//库存&限购&&待支付订单
//库存&限购&&待支付订单
goblinRedisUtils
.
incrSkuStock
(
"pre"
,
skuVo
.
getSkuId
(),
skuVo
.
getNum
());
String
pre
=
GoblinStatusConst
.
MarketPreStatus
.
getPre
(
skuVo
.
getSkuId
());
if
(
pre
==
null
)
{
goblinRedisUtils
.
incrSkuStock
(
pre
,
skuVo
.
getSkuId
(),
skuVo
.
getNum
());
}
else
{
goblinRedisUtils
.
incrSkuStock
(
pre
,
skuVo
.
getSkuId
().
split
(
pre
)[
0
],
skuVo
.
getNum
());
}
goblinRedisUtils
.
decrSkuCountByUid
(
orderVo
.
getUserId
(),
skuVo
.
getSkuId
(),
skuVo
.
getNum
());
goblinRedisUtils
.
decrSkuCountByUid
(
orderVo
.
getUserId
(),
skuVo
.
getSkuId
(),
skuVo
.
getNum
());
//mysql
//mysql
sqlDataSku
.
add
(
new
Object
[]{
sqlDataSku
.
add
(
new
Object
[]{
...
@@ -102,7 +109,7 @@ public class DMCheckGoblinOrderTimeImpl extends ServiceImpl<GoblinStoreOrderMapp
...
@@ -102,7 +109,7 @@ public class DMCheckGoblinOrderTimeImpl extends ServiceImpl<GoblinStoreOrderMapp
//执行sql
//执行sql
queueUtils
.
sendMsgByGoblinRedis
(
MQConst
.
KylinQueue
.
SQL_ORDER_CLOSE
.
getKey
(),
queueUtils
.
sendMsgByGoblinRedis
(
MQConst
.
KylinQueue
.
SQL_ORDER_CLOSE
.
getKey
(),
SqlMapping
.
gets
(
sqls
,
sqlDataOrder
,
sqlDataSku
));
SqlMapping
.
gets
(
sqls
,
sqlDataOrder
,
sqlDataSku
));
}
else
if
(
orderVo
.
getStatus
()
==
GoblinStatusConst
.
Status
.
ORDER_STATUS_5
.
getValue
()||
orderVo
.
getStatus
()
==
GoblinStatusConst
.
Status
.
ORDER_STATUS_2
.
getValue
())
{
}
else
if
(
orderVo
.
getStatus
()
==
GoblinStatusConst
.
Status
.
ORDER_STATUS_5
.
getValue
()
||
orderVo
.
getStatus
()
==
GoblinStatusConst
.
Status
.
ORDER_STATUS_2
.
getValue
())
{
goblinRedisUtils
.
removeGoblinOrder
(
i
+
""
,
orderVo
.
getOrderId
());
goblinRedisUtils
.
removeGoblinOrder
(
i
+
""
,
orderVo
.
getOrderId
());
}
}
}
}
...
...
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