Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
H
haoban-manage3.0
Overview
Overview
Details
Activity
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
haoban3.0
haoban-manage3.0
Commits
0a171ddc
Commit
0a171ddc
authored
Nov 21, 2022
by
songyinghui
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat: 素材关联商品过滤后台配置的状态
parent
930ab9cf
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
32 additions
and
0 deletions
+32
-0
ContentMaterialController.java
...age/web/controller/content/ContentMaterialController.java
+32
-0
No files found.
haoban-manage3-wx/src/main/java/com/gic/haoban/manage/web/controller/content/ContentMaterialController.java
View file @
0a171ddc
...
...
@@ -13,6 +13,7 @@ import com.gic.content.api.qdto.material.ContentMaterialShareQDTO;
import
com.gic.content.api.service.ContentColumnApiService
;
import
com.gic.content.api.service.ContentMaterialApiService
;
import
com.gic.content.api.service.ContentMaterialShareApiService
;
import
com.gic.haoban.app.aggregation.api.dto.GoodsSettingDTO
;
import
com.gic.haoban.app.aggregation.api.service.SettingApiService
;
import
com.gic.haoban.common.utils.EntityUtil
;
import
com.gic.haoban.manage.api.service.StaffApiService
;
...
...
@@ -32,6 +33,7 @@ import org.springframework.web.bind.annotation.RequestBody;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.RestController
;
import
java.util.ArrayList
;
import
java.util.Arrays
;
import
java.util.Collections
;
import
java.util.List
;
...
...
@@ -89,6 +91,7 @@ public class ContentMaterialController {
log
.
info
(
"企业id未传 {}"
,
JSON
.
toJSONString
(
contentMaterialQO
));
return
RestResponse
.
failure
(
"-777"
,
"参数异常"
);
}
List
<
Integer
>
goodsShowStatus
=
this
.
getGoodsShowStatus
(
contentMaterialQO
);
ContentMaterialPageFrontQDTO
contentMaterialPageFrontQDTO
=
new
ContentMaterialPageFrontQDTO
();
contentMaterialPageFrontQDTO
.
setEnterpriseId
(
contentMaterialQO
.
getEnterpriseId
());
contentMaterialPageFrontQDTO
.
setKeyWord
(
contentMaterialQO
.
getSearch
());
...
...
@@ -123,6 +126,7 @@ public class ContentMaterialController {
if
(
CollectionUtils
.
isNotEmpty
(
item
.
getContentGoodsList
())){
List
<
SimpleGoodsInfoVO
>
goodsInfoVOS
=
item
.
getContentGoodsList
()
.
stream
()
.
filter
(
temp
->
goodsShowStatus
.
contains
(
temp
.
getStatus
()))
.
map
(
temp
->
{
SimpleGoodsInfoVO
simpleGoodsInfoVO
=
new
SimpleGoodsInfoVO
();
BeanUtils
.
copyProperties
(
temp
,
simpleGoodsInfoVO
);
...
...
@@ -148,6 +152,34 @@ public class ContentMaterialController {
return
RestResponse
.
successResult
(
result
);
}
private
List
<
Integer
>
getGoodsShowStatus
(
ContentMaterialQO
contentMaterialQO
)
{
GoodsSettingDTO
goodsSettingDTO
=
settingApiService
.
getSetting
(
contentMaterialQO
.
getEnterpriseId
());
List
<
Integer
>
showStatus
=
new
ArrayList
<>();
if
(
goodsSettingDTO
!=
null
){
int
salesGoodsFlag
=
goodsSettingDTO
.
getSalesGoodsFlag
();
int
notSalesGoodsFlag
=
goodsSettingDTO
.
getNotSalesGoodsFlag
();
if
(
salesGoodsFlag
==
1
&&
notSalesGoodsFlag
==
1
)
{
//已上架和未上架
showStatus
.
add
(
1
);
showStatus
.
add
(
2
);
}
else
if
(
salesGoodsFlag
==
1
)
{
//已上架
showStatus
.
add
(
1
);
}
else
if
(
notSalesGoodsFlag
==
1
)
{
//未上架
showStatus
.
add
(
2
);
}
else
{
//啥都未打开
showStatus
.
add
(-
99
);
}
}
else
{
// 默认展示已上架和未上架的数据
showStatus
.
add
(
1
);
showStatus
.
add
(
2
);
}
return
showStatus
;
}
/**
* 分享商品素材
* @param contentMaterialShareQO
...
...
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