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
9b06779f
Commit
9b06779f
authored
Sep 29, 2021
by
xugaojun
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
优化:运营平台企业列表查询优化
parent
e3a6df29
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
70 deletions
+3
-70
EnterpriseController.java
...ic/haoban/manage/web/controller/EnterpriseController.java
+3
-70
No files found.
haoban-manage3-operation-web/src/main/java/com/gic/haoban/manage/web/controller/EnterpriseController.java
View file @
9b06779f
...
...
@@ -66,7 +66,6 @@ public class EnterpriseController extends WebBaseController {
private
static
final
int
CLOSE
=
0
;
private
static
final
int
ALL
=
2
;
/**
* 查询企业列表
* <p>
...
...
@@ -75,7 +74,7 @@ public class EnterpriseController extends WebBaseController {
* 1、开启-无条件搜索:in(cache中id列表) - 展示状态全部为开启
* 2、开启-有条件搜索:in(cache中列表与查询出的id取交集) - 展示状态全部为开启
* 3、关闭-无条件搜索:not in(cache中id列表) - 展示状态全部为关闭
* 4、关闭-有条件搜索:展示状态全部为关闭
* 4、关闭-有条件搜索:
not in(cache中id列表) in (查询结果id列表) -
展示状态全部为关闭
* 5、所有-无条件搜索:cache中id列表不参与sql - 展示状态通过判断得出
* 6、所有-有条件搜索:cache中id列表不参与sql - 展示状态通过判断得出
*
...
...
@@ -87,13 +86,8 @@ public class EnterpriseController extends WebBaseController {
* @param version 版本
* @return res
*/
@RequestMapping
(
"wx-enterprise-list-new"
)
public
HaobanResponse
wxEnterpriseListNew
(
BasePageInfo
pageInfo
,
String
keyword
,
Integer
openTagFlag
,
String
gicEnterpriseName
,
Integer
gicContactHelper
,
String
version
)
{
@RequestMapping
(
"wx-enterprise-list"
)
public
HaobanResponse
wxEnterpriseListNew
(
BasePageInfo
pageInfo
,
String
keyword
,
Integer
openTagFlag
,
String
gicEnterpriseName
,
Integer
gicContactHelper
,
String
version
)
{
List
<
String
>
wxEnterpriseIdInList
=
Lists
.
newArrayList
();
...
...
@@ -216,67 +210,6 @@ public class EnterpriseController extends WebBaseController {
return
StringUtils
.
isNotEmpty
(
gicEnterpriseName
);
}
//企业列表
// openTagFlag 0 未开启 1 开启 2 所有
@RequestMapping
(
"wx-enterprise-list"
)
public
HaobanResponse
wxEnterpriseList
(
BasePageInfo
pageInfo
,
String
keyword
,
Integer
openTagFlag
,
String
gicEnterpriseName
,
Integer
gicContactHelper
,
String
version
)
{
List
<
String
>
wxEnterpriseIds
=
new
ArrayList
<
String
>();
if
(!
StringUtils
.
isEmpty
(
gicEnterpriseName
))
{
List
<
EnterpriseDTO
>
enterpriseNames
=
enterpriseService
.
getEnterpriseByName
(
gicEnterpriseName
);
if
(
CollectionUtil
.
isNotEmpty
(
enterpriseNames
))
{
List
<
String
>
enterpriseIds
=
enterpriseNames
.
stream
().
map
(
s
->
s
.
getEnterpriseId
()).
collect
(
Collectors
.
toList
());
List
<
EnterpriseDetailDTO
>
wxEnterpriseIdDTOs
=
wxEnterpriseRelatedApiService
.
listEnterpriseByEnterpriseIds
(
enterpriseIds
);
if
(
CollectionUtil
.
isNotEmpty
(
wxEnterpriseIdDTOs
))
{
wxEnterpriseIds
=
wxEnterpriseIdDTOs
.
stream
().
map
(
s
->
s
.
getWxEnterpriseId
()).
collect
(
Collectors
.
toList
());
}
}
if
(
CollectionUtil
.
isEmpty
(
wxEnterpriseIds
))
{
wxEnterpriseIds
=
Arrays
.
asList
(
"-9999"
);
}
}
// 查询开启标签同步缓存-详情在 /tag/open-tag 接口
String
wxEntIdStr
=
(
String
)
RedisUtil
.
getCache
(
QYWX_TAG_OPRN_KEY
);
Set
<
String
>
wxEntIdSet
=
Sets
.
newHashSet
();
if
(
StringUtils
.
isNotEmpty
(
wxEntIdStr
))
{
wxEntIdSet
=
Arrays
.
stream
(
wxEntIdStr
.
split
(
","
)).
collect
(
Collectors
.
toSet
());
}
Page
<
YwWxEnterpriseDTO
>
page
=
wxEnterpriseApiService
.
list
(
pageInfo
,
keyword
,
wxEnterpriseIds
,
gicContactHelper
,
version
,
null
);
PageResult
<
YwWxEnterpriseDTO
>
pageVo
=
new
PageResult
<>();
List
<
YwWxEnterpriseDTO
>
list
=
EntityUtil
.
changeEntityListByJSON
(
YwWxEnterpriseDTO
.
class
,
page
.
getResult
());
List
<
YwWxEnterpriseDTO
>
resList
=
Lists
.
newArrayListWithCapacity
(
list
.
size
());
for
(
YwWxEnterpriseDTO
dto
:
list
)
{
dto
.
setVersion
(
"3.0"
);
dto
.
setBuyDate
(
new
Date
());
dto
.
setBuyStatus
(
"1"
);
List
<
EnterpriseDetailDTO
>
counts
=
wxEnterpriseRelatedApiService
.
listEnterpriseByWxEnterpriseId
(
dto
.
getWxEnterpriseId
());
dto
.
setRelationCount
(
counts
.
size
());
if
(
openTagFlag
==
0
&&
!
wxEntIdSet
.
contains
(
dto
.
getWxEnterpriseId
()))
{
dto
.
setTagOpenFlag
(
0
);
resList
.
add
(
dto
);
}
else
if
(
openTagFlag
==
1
&&
wxEntIdSet
.
contains
(
dto
.
getWxEnterpriseId
()))
{
dto
.
setTagOpenFlag
(
1
);
resList
.
add
(
dto
);
}
else
if
(
openTagFlag
==
2
)
{
dto
.
setTagOpenFlag
(
wxEntIdSet
.
contains
(
dto
.
getWxEnterpriseId
())
?
1
:
0
);
resList
.
add
(
dto
);
}
}
pageVo
.
setList
(
resList
);
pageVo
.
setPageNum
(
page
.
getCurrentPage
());
pageVo
.
setPages
(
page
.
getPages
());
// 因为过滤了此处取list长度
pageVo
.
setPageSize
(
page
.
getPageSize
());
pageVo
.
setTotal
(
page
.
getTotalCount
());
return
resultResponse
(
HaoBanErrCode
.
ERR_1
,
pageVo
);
}
/**
* 开启关闭标签同步
*
...
...
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