记得上下班打卡 | 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
1
Merge Requests
1
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
6f30af6e
Commit
6f30af6e
authored
Feb 16, 2022
by
zhengfuxin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修改 店铺列表 告警、 是否展示商品
parent
fe49a8e7
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
56 additions
and
16 deletions
+56
-16
GoblinGoodsSkuInfoDetailVo.java
...net/service/goblin/dto/vo/GoblinGoodsSkuInfoDetailVo.java
+2
-0
GoblinFrontServiceImpl.java
...t/service/goblin/service/impl/GoblinFrontServiceImpl.java
+54
-16
No files found.
liquidnet-bus-api/liquidnet-service-goblin-api/src/main/java/com/liquidnet/service/goblin/dto/vo/GoblinGoodsSkuInfoDetailVo.java
View file @
6f30af6e
...
@@ -32,6 +32,8 @@ public class GoblinGoodsSkuInfoDetailVo implements Serializable, Cloneable {
...
@@ -32,6 +32,8 @@ 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没有告警"
)
private
boolean
stockLess
;
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 @
6f30af6e
...
@@ -9,6 +9,7 @@ import com.liquidnet.service.goblin.constant.GoblinRedisConst;
...
@@ -9,6 +9,7 @@ import com.liquidnet.service.goblin.constant.GoblinRedisConst;
import
com.liquidnet.service.goblin.constant.GoblinStatusConst
;
import
com.liquidnet.service.goblin.constant.GoblinStatusConst
;
import
com.liquidnet.service.goblin.dto.vo.*
;
import
com.liquidnet.service.goblin.dto.vo.*
;
import
com.liquidnet.service.goblin.entity.*
;
import
com.liquidnet.service.goblin.entity.*
;
import
com.liquidnet.service.goblin.enums.GoblinStoreConf
;
import
com.liquidnet.service.goblin.service.GoblinFrontService
;
import
com.liquidnet.service.goblin.service.GoblinFrontService
;
import
com.liquidnet.service.goblin.util.GoblinMongoUtils
;
import
com.liquidnet.service.goblin.util.GoblinMongoUtils
;
import
com.liquidnet.service.goblin.util.GoblinRedisUtils
;
import
com.liquidnet.service.goblin.util.GoblinRedisUtils
;
...
@@ -257,6 +258,23 @@ public class GoblinFrontServiceImpl implements GoblinFrontService {
...
@@ -257,6 +258,23 @@ public class GoblinFrontServiceImpl implements GoblinFrontService {
}
}
return
goblinFrontSeckillVo
;
return
goblinFrontSeckillVo
;
}
}
//获取库存设置的报警数量
public
int
getStockCount
(
String
storeId
){
String
configVal
=
""
;
List
<
GoblinStoreConfigVo
>
listVo
=
goblinRedisUtils
.
getStoreConfigVos
(
storeId
);
//ONOFF_SOLD_OUT_SHOW ON 开启
for
(
GoblinStoreConfigVo
goblinStoreConfigVo:
listVo
){
//获取是 售罄是否开启
if
(
goblinStoreConfigVo
.
getConfigKey
().
equals
(
GoblinStoreConf
.
LIMIT_WARNING_STOCK
)){
configVal
=
goblinStoreConfigVo
.
getConfigVal
();
}
}
if
(
StringUtil
.
isNotBlank
(
configVal
)){
return
Integer
.
parseInt
(
configVal
);
}
else
{
return
-
1
;
}
}
/**
/**
* 获得商品详情
* 获得商品详情
*/
*/
...
@@ -268,13 +286,23 @@ public class GoblinFrontServiceImpl implements GoblinFrontService {
...
@@ -268,13 +286,23 @@ public class GoblinFrontServiceImpl implements GoblinFrontService {
goblinFrontGoodDetailVo
.
setGoblinGoodsInfoVo
(
goblinGoodsInfoDetailVo
);
goblinFrontGoodDetailVo
.
setGoblinGoodsInfoVo
(
goblinGoodsInfoDetailVo
);
//skuIdList
//skuIdList
if
(
null
!=
goblinGoodsInfoVo
){
if
(
null
!=
goblinGoodsInfoVo
){
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
){
GoblinGoodsSkuInfoVo
goblinGoodsSkuInfoVo
=
goblinRedisUtils
.
getGoodsSkuInfoVo
(
sku
);
GoblinGoodsSkuInfoVo
goblinGoodsSkuInfoVo
=
goblinRedisUtils
.
getGoodsSkuInfoVo
(
sku
);
GoblinGoodsSkuInfoDetailVo
goblinGoodsSkuInfoDetailVo
=
GoblinGoodsSkuInfoDetailVo
.
getNew
();
if
(
null
!=
goblinGoodsSkuInfoVo
){
BeanUtils
.
copyProperties
(
goblinGoodsSkuInfoVo
,
goblinGoodsSkuInfoDetailVo
);
//获取 sku 库存数量
list
.
add
(
goblinGoodsSkuInfoDetailVo
);
int
stock
=
goblinRedisUtils
.
getSkuStock
(
null
,
goblinGoodsSkuInfoVo
.
getSkuId
());
GoblinGoodsSkuInfoDetailVo
goblinGoodsSkuInfoDetailVo
=
GoblinGoodsSkuInfoDetailVo
.
getNew
();
BeanUtils
.
copyProperties
(
goblinGoodsSkuInfoVo
,
goblinGoodsSkuInfoDetailVo
);
if
(
limit
>=
stock
){
goblinGoodsSkuInfoDetailVo
.
setStockLess
(
true
);
}
else
{
goblinGoodsSkuInfoDetailVo
.
setStockLess
(
false
);
}
list
.
add
(
goblinGoodsSkuInfoDetailVo
);
}
}
}
//goblinGoodsInfoVo
//goblinGoodsInfoVo
GoblinStoreInfoVo
goblinStoreInfoVo
=
this
.
getStore
(
goblinGoodsInfoVo
.
getStoreId
());
GoblinStoreInfoVo
goblinStoreInfoVo
=
this
.
getStore
(
goblinGoodsInfoVo
.
getStoreId
());
...
@@ -444,6 +472,15 @@ public class GoblinFrontServiceImpl implements GoblinFrontService {
...
@@ -444,6 +472,15 @@ public class GoblinFrontServiceImpl implements GoblinFrontService {
return
list1
;
return
list1
;
}
}
public
GoblinFrontCategoryListVo
getStoreGoodes
(
String
storeId
,
String
categoryId
,
String
name
){
public
GoblinFrontCategoryListVo
getStoreGoodes
(
String
storeId
,
String
categoryId
,
String
name
){
String
configVal
=
""
;
List
<
GoblinStoreConfigVo
>
listVo
=
goblinRedisUtils
.
getStoreConfigVos
(
storeId
);
//ONOFF_SOLD_OUT_SHOW ON 开启
for
(
GoblinStoreConfigVo
goblinStoreConfigVo:
listVo
){
//获取是 售罄是否开启
if
(
goblinStoreConfigVo
.
getConfigKey
().
equals
(
GoblinStoreConf
.
ONOFF_SOLD_OUT_SHOW
)){
configVal
=
goblinStoreConfigVo
.
getConfigVal
();
}
}
//
//
Query
query
=
new
Query
();
Query
query
=
new
Query
();
query
.
addCriteria
(
Criteria
.
where
(
"storeId"
).
is
(
storeId
).
and
(
"spuAppear"
).
is
(
"0"
).
and
(
"delFlg"
).
is
(
"0"
).
and
(
"shelvesStatus"
).
is
(
"3"
));
query
.
addCriteria
(
Criteria
.
where
(
"storeId"
).
is
(
storeId
).
and
(
"spuAppear"
).
is
(
"0"
).
and
(
"delFlg"
).
is
(
"0"
).
and
(
"shelvesStatus"
).
is
(
"3"
));
...
@@ -461,21 +498,22 @@ public class GoblinFrontServiceImpl implements GoblinFrontService {
...
@@ -461,21 +498,22 @@ public class GoblinFrontServiceImpl implements GoblinFrontService {
query
.
with
(
Sort
.
by
(
Sort
.
Direction
.
DESC
,
"count"
));
query
.
with
(
Sort
.
by
(
Sort
.
Direction
.
DESC
,
"count"
));
// 查询总数
// 查询总数
List
<
GoblinGoodsInfoVo
>
list
=
mongoTemplate
.
find
(
query
,
GoblinGoodsInfoVo
.
class
,
GoblinGoodsInfoVo
.
class
.
getSimpleName
());
List
<
GoblinGoodsInfoVo
>
list
=
mongoTemplate
.
find
(
query
,
GoblinGoodsInfoVo
.
class
,
GoblinGoodsInfoVo
.
class
.
getSimpleName
());
/*if(list.size()>0){
// 计算库存
//找到 销量
Iterator
<
GoblinGoodsInfoVo
>
iterator
=
list
.
iterator
();
for(GoblinGoodsInfoVo goblinGoodsInfoVo:list){
//删掉库存没有的商品
Integer counts=goblinRedisUtils.getSpuSaleCount(goblinGoodsInfoVo.getSpuId());
while
(
iterator
.
hasNext
()){
if(counts==null){
GoblinGoodsInfoVo
goblinGoodsInfoVo
=
iterator
.
next
();
goblinGoodsInfoVo.setCount(0);
List
<
String
>
skuIdList
=
goblinGoodsInfoVo
.
getSkuIdList
();
}else{
int
count
=
0
;
goblinGoodsInfoVo.setCount(counts);
for
(
String
skuId:
skuIdList
){
count
=
count
+
goblinRedisUtils
.
getSkuStock
(
null
,
skuId
);
}
if
(
StringUtil
.
isNotBlank
(
configVal
)&&!
configVal
.
equals
(
"ON"
)){
if
(
count
==
0
){
iterator
.
remove
();
}
}
}
}
Collections.sort(list, new Comparator<GoblinGoodsInfoVo>() {
}
public int compare(GoblinGoodsInfoVo arg0, GoblinGoodsInfoVo arg1) {
return -(arg0.getCount().compareTo(arg1.getCount()));
}});
}*/
ArrayList
<
GoblinGoodsInfoListVo
>
listVos
=
ObjectUtil
.
getGoblinGoodsInfoListVo
();
ArrayList
<
GoblinGoodsInfoListVo
>
listVos
=
ObjectUtil
.
getGoblinGoodsInfoListVo
();
for
(
GoblinGoodsInfoVo
goblinGoodsInfoVo:
list
){
for
(
GoblinGoodsInfoVo
goblinGoodsInfoVo:
list
){
GoblinGoodsInfoListVo
goblinGoodsInfoListVo
=
GoblinGoodsInfoListVo
.
getNew
();
GoblinGoodsInfoListVo
goblinGoodsInfoListVo
=
GoblinGoodsInfoListVo
.
getNew
();
...
...
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