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
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
haoban3.0
haoban-manage3.0
Commits
30a9df3c
Commit
30a9df3c
authored
Aug 10, 2023
by
王祖波
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
内容四期
parent
6d67bb8c
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
17 additions
and
13 deletions
+17
-13
ContentMaterialController.java
...age/web/controller/content/ContentMaterialController.java
+17
-13
No files found.
haoban-manage3-wx/src/main/java/com/gic/haoban/manage/web/controller/content/ContentMaterialController.java
View file @
30a9df3c
...
...
@@ -6,11 +6,14 @@ import com.gic.api.base.commons.Page;
import
com.gic.api.base.commons.ServiceResponse
;
import
com.gic.commons.webapi.reponse.RestResponse
;
import
com.gic.content.api.dto.column.ContentColumnListDTO
;
import
com.gic.content.api.dto.material.ContentMaterialDTO
;
import
com.gic.content.api.dto.material.ContentMaterialFrontDTO
;
import
com.gic.content.api.dto.material.ContentMaterialShareInfoDTO
;
import
com.gic.content.api.enums.ColumnEnum
;
import
com.gic.content.api.enums.MaterialSearchSceneEnum
;
import
com.gic.content.api.qdto.column.ContentColumnClerkQDTO
;
import
com.gic.content.api.qdto.material.ContentMaterialPageFrontQDTO
;
import
com.gic.content.api.qdto.material.ContentMaterialPageQDTO
;
import
com.gic.content.api.qdto.material.ContentMaterialShareQDTO
;
import
com.gic.content.api.service.ContentColumnApiService
;
import
com.gic.content.api.service.ContentMaterialApiService
;
...
...
@@ -105,44 +108,45 @@ public class ContentMaterialController {
return
RestResponse
.
failure
(
"-777"
,
"参数异常"
);
}
List
<
Integer
>
goodsShowStatus
=
goodsInfoAdaptor
.
getGoodsShowStatus
(
contentMaterialQO
.
getEnterpriseId
());
ContentMaterialPageFrontQDTO
contentMaterialPageFrontQDTO
=
new
ContentMaterialPageFrontQDTO
();
contentMaterialPageFrontQDTO
.
setEnterpriseId
(
contentMaterialQO
.
getEnterpriseId
());
contentMaterialPageFrontQDTO
.
setKeyWord
(
contentMaterialQO
.
getSearch
());
contentMaterialPageFrontQDTO
.
setContentColumnId
(
contentMaterialQO
.
getContentColumnId
());
contentMaterialPageFrontQDTO
.
setMaterialType
(
contentMaterialQO
.
getMaterialType
());
ContentMaterialPageQDTO
pageQDTO
=
new
ContentMaterialPageQDTO
();
pageQDTO
.
setQueryScene
(
MaterialSearchSceneEnum
.
HAOBAN_MARKETING
.
value
);
pageQDTO
.
setEnterpriseId
(
contentMaterialQO
.
getEnterpriseId
());
pageQDTO
.
setSearch
(
contentMaterialQO
.
getSearch
());
pageQDTO
.
setContentColumnId
(
contentMaterialQO
.
getContentColumnId
());
pageQDTO
.
setMaterialType
(
contentMaterialQO
.
getMaterialType
());
if
(
contentMaterialQO
.
getSortType
()
!=
null
)
{
if
(
contentMaterialQO
.
getSortType
()
==
2
)
{
contentMaterialPageFront
QDTO
.
setHotFlag
(
1
);
page
QDTO
.
setHotFlag
(
1
);
}
}
if
(
StringUtils
.
isBlank
(
contentMaterialQO
.
getStoreId
()))
{
// 区经 获取管辖的权限
List
<
String
>
storeIds
=
this
.
clerkStoreAdaptor
.
queryClerkStoreIds
(
contentMaterialQO
.
getClerkId
(),
contentMaterialQO
.
getWxEnterpriseId
());
contentMaterialPageFront
QDTO
.
setStoreIdList
(
storeIds
);
page
QDTO
.
setStoreIdList
(
storeIds
);
}
else
{
contentMaterialPageFront
QDTO
.
setStoreIdList
(
Collections
.
singletonList
(
contentMaterialQO
.
getStoreId
()));
page
QDTO
.
setStoreIdList
(
Collections
.
singletonList
(
contentMaterialQO
.
getStoreId
()));
}
if
(
contentMaterialQO
.
getSearchType
()
!=
null
&&
contentMaterialQO
.
getSearchType
().
equals
(
1
))
{
if
(
StringUtils
.
isNotBlank
(
contentMaterialQO
.
getSearch
()))
{
// 搜索条件需要置为空
contentMaterialPageFrontQDTO
.
setKeyWord
(
null
);
pageQDTO
.
setSearch
(
null
);
List
<
String
>
goodsIds
=
goodsInfoAdaptor
.
queryGoodsIdWithSearch
(
contentMaterialQO
.
getEnterpriseId
(),
contentMaterialQO
.
getSearch
());
if
(
CollectionUtils
.
isEmpty
(
goodsIds
))
{
log
.
info
(
"搜索商品不存在 {}"
,
contentMaterialQO
.
getSearch
());
return
RestResponse
.
successResult
(
new
Page
<>());
}
contentMaterialPageFront
QDTO
.
setGoodsIdList
(
goodsIds
);
page
QDTO
.
setGoodsIdList
(
goodsIds
);
}
}
BasePageInfo
pageInfo
=
new
BasePageInfo
();
pageInfo
.
setPageNum
(
contentMaterialQO
.
getPageNum
());
pageInfo
.
setPageSize
(
contentMaterialQO
.
getPageSize
());
ServiceResponse
<
Page
<
ContentMaterial
FrontDTO
>>
serviceResponse
=
contentMaterialApiService
.
pageMaterialFront
(
contentMaterialPageFront
QDTO
,
pageInfo
);
ServiceResponse
<
Page
<
ContentMaterial
DTO
>>
serviceResponse
=
contentMaterialApiService
.
pageMaterial
(
page
QDTO
,
pageInfo
);
if
(!
serviceResponse
.
isSuccess
()
||
CollectionUtils
.
isEmpty
(
serviceResponse
.
getResult
().
getResult
()))
{
return
RestResponse
.
successResult
(
new
Page
<>());
}
Page
<
ContentMaterial
Front
DTO
>
responseResult
=
serviceResponse
.
getResult
();
Page
<
ContentMaterialDTO
>
responseResult
=
serviceResponse
.
getResult
();
Page
<
ContentMaterialInfoVO
>
result
=
new
Page
<>();
result
.
setTotalCount
(
responseResult
.
getTotalCount
());
List
<
String
>
goodsIds
=
responseResult
.
getResult
()
...
...
@@ -168,7 +172,7 @@ public class ContentMaterialController {
* @param item
* @return
*/
private
ContentMaterialInfoVO
getContentMaterialInfoVO
(
List
<
Integer
>
goodsShowStatus
,
ContentMaterial
Front
DTO
item
,
Map
<
String
,
BigDecimal
>
commissionMap
)
{
private
ContentMaterialInfoVO
getContentMaterialInfoVO
(
List
<
Integer
>
goodsShowStatus
,
ContentMaterialDTO
item
,
Map
<
String
,
BigDecimal
>
commissionMap
)
{
ContentMaterialInfoVO
contentMaterialInfoVO
=
new
ContentMaterialInfoVO
();
BeanUtils
.
copyProperties
(
item
,
contentMaterialInfoVO
);
if
(
CollectionUtils
.
isNotEmpty
(
item
.
getContentGoodsList
()))
{
...
...
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