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
838db471
Commit
838db471
authored
Nov 21, 2022
by
songyinghui
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'xgh_内容中台' into developer
parents
6f82263d
609ca365
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
42 additions
and
8 deletions
+42
-8
ContentMaterialController.java
...age/web/controller/content/ContentMaterialController.java
+42
-8
No files found.
haoban-manage3-wx/src/main/java/com/gic/haoban/manage/web/controller/content/ContentMaterialController.java
View file @
838db471
...
...
@@ -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
());
...
...
@@ -99,13 +102,13 @@ public class ContentMaterialController {
contentMaterialPageFrontQDTO
.
setHotFlag
(
1
);
}
}
//
if (StringUtils.isBlank(contentMaterialQO.getStoreId())){
//
// 区经 获取管辖的权限
//
List<String> storeIds = this.queryClerkStoreIds(contentMaterialQO.getClerkId(), contentMaterialQO.getWxEnterpriseId());
//
contentMaterialPageFrontQDTO.setStoreIdList(storeIds);
//
}else {
//
contentMaterialPageFrontQDTO.setStoreIdList(Collections.singletonList(contentMaterialQO.getStoreId()));
//
}
if
(
StringUtils
.
isBlank
(
contentMaterialQO
.
getStoreId
())){
// 区经 获取管辖的权限
List
<
String
>
storeIds
=
this
.
queryClerkStoreIds
(
contentMaterialQO
.
getClerkId
(),
contentMaterialQO
.
getWxEnterpriseId
());
contentMaterialPageFrontQDTO
.
setStoreIdList
(
storeIds
);
}
else
{
contentMaterialPageFrontQDTO
.
setStoreIdList
(
Collections
.
singletonList
(
contentMaterialQO
.
getStoreId
()));
}
BasePageInfo
pageInfo
=
new
BasePageInfo
();
pageInfo
.
setPageNum
(
contentMaterialQO
.
getPageNum
());
pageInfo
.
setPageSize
(
contentMaterialQO
.
getPageSize
());
...
...
@@ -123,13 +126,16 @@ 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
);
simpleGoodsInfoVO
.
setGoodsImg
(
temp
.
getGoodsImageUrl
());
return
simpleGoodsInfoVO
;
}).
collect
(
Collectors
.
toList
());
contentMaterialInfoVO
.
setContentGoodsList
(
goodsInfoVOS
);
if
(
CollectionUtils
.
isNotEmpty
(
goodsInfoVOS
))
{
contentMaterialInfoVO
.
setContentGoodsList
(
goodsInfoVOS
);
}
}
contentMaterialInfoVO
.
setPublishTime
(
item
.
getPublishBeginTime
());
if
(
StringUtils
.
isNotBlank
(
item
.
getMaterialImageUrls
()))
{
...
...
@@ -148,6 +154,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