Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
G
gic-data-cloud
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
base_platform_enterprise
gic-data-cloud
Commits
a7540b11
Commit
a7540b11
authored
Apr 20, 2021
by
陶光胜
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
门店控件修复
parent
e56782ce
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
81 additions
and
20 deletions
+81
-20
DataAuthUtils.java
...p/src/main/java/com/gic/cloud/web/auth/DataAuthUtils.java
+9
-2
BaseSalesController.java
...ava/com/gic/cloud/web/controller/BaseSalesController.java
+11
-13
StoreSearchUtils.java
...n/java/com/gic/cloud/web/controller/StoreSearchUtils.java
+61
-5
No files found.
gic-data-cloud-wxapp/src/main/java/com/gic/cloud/web/auth/DataAuthUtils.java
View file @
a7540b11
...
...
@@ -109,7 +109,8 @@ public class DataAuthUtils {
Integer
resourceGroupId
=
dto
.
getResourceGroupId
();
ResourceGroupDTO
resourceGroupDTO
=
resourceGroupApiService
.
getResourceGroup
(
resourceGroupId
).
getResult
();
//线上店铺ids
String
weimobStoreIds
=
resourceGroupDTO
.
getWeimobStoreId
();
String
weimobStoreIds
=
(
StringUtils
.
isBlank
(
resourceGroupDTO
.
getWeimobStoreIdOwn
())
?
""
:
resourceGroupDTO
.
getWeimobStoreIdOwn
())
+
(
StringUtils
.
isBlank
(
resourceGroupDTO
.
getWeimobStoreIdShare
())
?
""
:
resourceGroupDTO
.
getWeimobStoreIdShare
());
if
(
StringUtils
.
isNotBlank
(
weimobStoreIds
)){
storeIdList
.
addAll
(
Arrays
.
asList
(
weimobStoreIds
.
split
(
","
)));
}
...
...
@@ -125,7 +126,13 @@ public class DataAuthUtils {
onLineAuth
.
setList
(
list
);
return
onLineAuth
;
}
List
<
Long
>
weimobStoreIdList
=
customUserAreaDTO
.
getWeimobStoreId
();
List
<
Long
>
weimobStoreIdList
=
new
ArrayList
<>();
if
(
CollectionUtils
.
isNotEmpty
(
customUserAreaDTO
.
getWeimobStoreIdOwn
())){
weimobStoreIdList
.
addAll
(
customUserAreaDTO
.
getWeimobStoreIdOwn
());
}
if
(
CollectionUtils
.
isNotEmpty
(
customUserAreaDTO
.
getWeimobStoreIdShare
())){
weimobStoreIdList
.
addAll
(
customUserAreaDTO
.
getWeimobStoreIdShare
());
}
if
(
CollectionUtils
.
isEmpty
(
weimobStoreIdList
)){
if
(
weimobStoreIdList
==
null
)
{
weimobStoreIdList
=
new
ArrayList
<>(
1
);
...
...
gic-data-cloud-wxapp/src/main/java/com/gic/cloud/web/controller/BaseSalesController.java
View file @
a7540b11
...
...
@@ -53,12 +53,16 @@ public class BaseSalesController {
public
RestResponse
baseSales
(
BaseSalesParamQo
qo
){
log
.
info
(
"base-sales 参数:{}"
,
JSON
.
toJSONString
(
qo
));
BaseSalesVo
vo
=
new
BaseSalesVo
();
BaseSalesParamsDTO
dto
=
new
BaseSalesParamsDTO
();
List
<
Integer
>
list
=
this
.
storeSearchUtils
.
storeSearch
(
qo
.
getUserId
(),
qo
.
getEnterpriseId
(),
qo
.
getSearchJson
());
List
<
String
>
onLine
=
this
.
storeSearchUtils
.
onLineStoreSearch
(
qo
.
getUserId
(),
qo
.
getEnterpriseId
(),
qo
.
getSearchJson
());
dto
.
setStoreInfoIdList
(
list
);
dto
.
setOnLine
(
onLine
);
Integer
maxLevel
=
0
;
/******线下渠道需要点击下钻,该值只会在线下时才会使用********/
LevelVo
levelVo
=
this
.
storeSearchUtils
.
getLevel
(
qo
.
getUserId
(),
qo
.
getEnterpriseId
(),
qo
.
getSearchJson
());
maxLevel
=
levelVo
.
getMaxLevel
();
if
(
qo
.
getLevel
()
==
Constants
.
ZERO
){
if
(
qo
.
getLevel
()
.
equals
(
Constants
.
ZERO
)
){
qo
.
setLevel
(
levelVo
.
getLevel
());
}
if
(
qo
.
getLevel
()
>
levelVo
.
getMaxLevel
()){
...
...
@@ -68,14 +72,14 @@ public class BaseSalesController {
}
List
<
Integer
>
childrenStoreGroupIdList
=
this
.
storeSearchUtils
.
getChildrenStoreGroupIdList
(
qo
.
getEnterpriseId
(),
qo
.
getParentId
(),
qo
.
getLevel
(),
qo
.
getChannel
());
/****首页进入基础页面时,如果渠道为空,根据当前条件判断渠道,channel==0表示多渠道***/
if
(
qo
.
getChannel
()
==
StoreChannelEnum
.
ALL
.
getChannel
(
)){
if
(
qo
.
getChannel
()
.
equals
(
StoreChannelEnum
.
ALL
.
getChannel
()
)){
/**********设置层级名称,只有在首次进入页面会展示,下钻均显示返回上一级*********/
Integer
newChannel
=
this
.
storeSearchUtils
.
getChannel
(
qo
.
getUserId
(),
qo
.
getEnterpriseId
(),
qo
.
getSearchJson
());
qo
.
setChannel
(
newChannel
);
}
/***********如果是线下的第一层级或者门店导购层级,需要展示切换层级按钮*************/
boolean
isFirstLevel
=
(
StoreChannelEnum
.
OFFLINE
.
getChannel
().
equals
(
qo
.
getChannel
())
&&
qo
.
getLevel
()
==
levelVo
.
getLevel
(
))
||
(
qo
.
getLevel
()
==
Constants
.
SEV
||
qo
.
getLevel
()
==
Constants
.
EIGHT
);
boolean
isFirstLevel
=
(
StoreChannelEnum
.
OFFLINE
.
getChannel
().
equals
(
qo
.
getChannel
())
&&
qo
.
getLevel
()
.
equals
(
levelVo
.
getLevel
()
))
||
(
qo
.
getLevel
()
.
equals
(
Constants
.
SEV
)
||
qo
.
getLevel
().
equals
(
Constants
.
EIGHT
)
);
if
(
isFirstLevel
){
vo
.
setChangeLevel
(
1
);
}
...
...
@@ -86,9 +90,7 @@ public class BaseSalesController {
}
else
{
vo
.
setLevelName
(
"店铺层级"
);
}
BaseSalesParamsDTO
dto
=
new
BaseSalesParamsDTO
();
setCommonBaseDTO
(
dto
,
qo
,
childrenStoreGroupIdList
);
ServiceResponse
<
Page
<
BaseSalesDTO
>>
response
=
this
.
baseSalesApiService
.
pageBaseSales
(
dto
);
log
.
info
(
"response:{}"
,
JSON
.
toJSONString
(
response
));
vo
.
setPage
(
this
.
goDownComponent
.
parseData
(
response
.
getResult
(),
qo
.
getChannel
(),
qo
.
getEnterpriseId
(),
qo
.
getLevel
(),
maxLevel
));
...
...
@@ -96,7 +98,7 @@ public class BaseSalesController {
dto
.
setCountType
(
2
);
Integer
wgs
=
storeSearchUtils
.
isWgs
(
qo
.
getUserId
(),
qo
.
getEnterpriseId
(),
qo
.
getSearchJson
());
/**所有渠道或者线下渠道第一层级 合计算上无归属数据**/
boolean
isContainNoOwnership
=
(
qo
.
getChannel
()
==
StoreChannelEnum
.
ALL
.
getChannel
(
)
||
(
StoreChannelEnum
.
OFFLINE
.
getChannel
().
equals
(
qo
.
getChannel
())
&&
qo
.
getLevel
()
==
levelVo
.
getLevel
()))
&&
wgs
==
1
;
boolean
isContainNoOwnership
=
(
qo
.
getChannel
()
.
equals
(
StoreChannelEnum
.
ALL
.
getChannel
()
)
||
(
StoreChannelEnum
.
OFFLINE
.
getChannel
().
equals
(
qo
.
getChannel
())
&&
qo
.
getLevel
()
==
levelVo
.
getLevel
()))
&&
wgs
==
1
;
if
(
isContainNoOwnership
){
dto
.
getStoreInfoIdList
().
add
(-
1
);
dto
.
getOnLine
().
add
(
"-1"
);
...
...
@@ -104,7 +106,7 @@ public class BaseSalesController {
ServiceResponse
<
Page
<
BaseSalesDTO
>>
totalResponse
=
this
.
baseSalesApiService
.
pageBaseSales
(
dto
);
log
.
info
(
"totalResponse:{}"
,
JSON
.
toJSONString
(
totalResponse
));
this
.
goDownComponent
.
parseTotal
(
totalResponse
,
vo
);
if
(
qo
.
getChannel
()
==
StoreChannelEnum
.
OFFLINE
.
getChannel
()
&&
qo
.
getLevel
()
==
levelVo
.
getLevel
(
)
&&
wgs
==
1
){
if
(
qo
.
getChannel
()
.
equals
(
StoreChannelEnum
.
OFFLINE
.
getChannel
())
&&
qo
.
getLevel
().
equals
(
levelVo
.
getLevel
()
)
&&
wgs
==
1
){
//无归属
dto
.
setCountType
(
3
);
dto
.
setChannel
(
StoreChannelEnum
.
ALL
.
getChannel
());
...
...
@@ -120,14 +122,10 @@ public class BaseSalesController {
}
private
void
setCommonBaseDTO
(
BaseSalesParamsDTO
dto
,
BaseSalesParamQo
qo
,
List
<
Integer
>
childrenStoreGroupIdList
)
{
List
<
Integer
>
list
=
this
.
storeSearchUtils
.
storeSearch
(
qo
.
getUserId
(),
qo
.
getEnterpriseId
(),
qo
.
getSearchJson
());
List
<
String
>
onLine
=
this
.
storeSearchUtils
.
onLineStoreSearch
(
qo
.
getUserId
(),
qo
.
getEnterpriseId
(),
qo
.
getSearchJson
());
List
<
Long
>
mbrAreaIdList
=
this
.
dataAuthUtils
.
getMbrAreaId
(
qo
.
getUserId
(),
qo
.
getEnterpriseId
());
dto
.
setChannel
(
qo
.
getChannel
());
dto
.
setEnterpriseId
(
qo
.
getEnterpriseId
());
dto
.
setStoreInfoIdList
(
list
);
dto
.
setOnLine
(
onLine
);
dto
.
setMbrAreaId
(
StringUtils
.
isBlank
(
qo
.
getMbrAreaId
())
?
null
:
Long
.
valueOf
(
qo
.
getMbrAreaId
()));
dto
.
setMbrAreaIdList
(
mbrAreaIdList
);
dto
.
setType
(
qo
.
getType
());
...
...
gic-data-cloud-wxapp/src/main/java/com/gic/cloud/web/controller/StoreSearchUtils.java
View file @
a7540b11
...
...
@@ -18,6 +18,8 @@ import com.gic.cloud.web.constant.Constants;
import
com.gic.cloud.web.constant.StoreChannelEnum
;
import
com.gic.cloud.web.qo.StoreSearchQo
;
import
com.gic.cloud.web.vo.LevelVo
;
import
com.gic.enterprise.dto.WmStoreDTO
;
import
com.gic.enterprise.service.WmStoreApiService
;
import
com.gic.redis.data.util.RedisUtil
;
import
com.gic.store.dto.StoreDTO
;
import
com.gic.store.dto.StoreGroupDTO
;
...
...
@@ -64,6 +66,8 @@ public class StoreSearchUtils {
private
DataAuthApiService
dataAuthApiService
;
@Autowired
private
WeimobStoreSiteApiService
weimobStoreSiteApiService
;
@Autowired
private
WmStoreApiService
wmStoreApiService
;
public
Integer
isWgs
(
Integer
userId
,
Integer
enterpriseId
,
String
searchJson
){
ServiceResponse
<
DataAuthDTO
>
response
=
this
.
dataAuthApiService
.
ggetDataAuthByUserId
(
enterpriseId
,
userId
);
...
...
@@ -107,6 +111,16 @@ public class StoreSearchUtils {
storeSearchDTO
.
setRealStatuss
(
StringUtils
.
isBlank
(
storeSearchQo
.
getErpStatus
())
?
null
:
storeSearchQo
.
getErpStatus
().
replaceAll
(
","
,
" "
));
storeSearchDTO
.
setStoreTags
(
StringUtils
.
isBlank
(
storeSearchQo
.
getStoreTag
())
?
null
:
storeSearchQo
.
getStoreTag
().
replaceAll
(
","
,
" "
));
storeSearchDTO
.
setStoreBrandIds
(
StringUtils
.
isBlank
(
storeSearchQo
.
getStoreBrand
())
?
null
:
storeSearchQo
.
getStoreBrand
().
replaceAll
(
","
,
" "
));
String
resourceType
=
storeSearchQo
.
getResourceType
();
Integer
ownType
=
null
;
if
(
StringUtils
.
isNotBlank
(
resourceType
)){
if
(
"1"
.
equals
(
resourceType
)){
ownType
=
0
;
}
if
(
"2"
.
equals
(
resourceType
)){
ownType
=
1
;
}
}
if
(
storeSearchQo
.
getAttentionStore
()
==
1
){
List
<
AttentionStoreDTO
>
result
=
this
.
storeAttentionApiService
.
pageStoreAttention
(
userId
,
enterpriseId
,
1
,
Integer
.
MAX_VALUE
).
getResult
().
getResult
();
List
<
Integer
>
list
=
result
.
stream
().
filter
(
t
->
{
...
...
@@ -123,10 +137,20 @@ public class StoreSearchUtils {
log
.
info
(
"storeResule:{}"
,
JSON
.
toJSONString
(
pageServiceResponse
));
if
(
pageServiceResponse
.
isSuccess
()
&&
pageServiceResponse
.
getResult
()
!=
null
&&
CollectionUtils
.
isNotEmpty
(
pageServiceResponse
.
getResult
().
getResult
())){
List
<
StoreDTO
>
storeDTOList
=
pageServiceResponse
.
getResult
().
getResult
();
List
<
Integer
>
storeInfoIdList
=
storeDTOList
.
stream
().
map
(
storeDTO
->
storeDTO
.
getStoreInfoId
()).
collect
(
Collectors
.
toList
());
Integer
finalOwnType
=
ownType
;
List
<
Integer
>
storeInfoIdList
=
storeDTOList
.
stream
().
filter
(
storeDTO
->
{
if
(
finalOwnType
!=
null
){
//按资源类型进行过滤
if
(
storeDTO
.
getOwnType
().
equals
(
finalOwnType
)){
return
true
;
}
else
{
return
false
;
}
}
return
true
;
}).
map
(
storeDTO
->
storeDTO
.
getStoreInfoId
()).
collect
(
Collectors
.
toList
());
if
(
CollectionUtils
.
isNotEmpty
(
storeAuth
.
getStoreInfoIdList
())){
resultList
=
storeInfoIdList
.
stream
().
filter
(
s
->
{
for
(
Integer
storeInfoId
:
storeAuth
.
getStoreInfoIdList
())
{
for
(
Integer
storeInfoId
:
storeAuth
.
getStoreInfoIdList
())
{
//按权限门店进行过滤
if
(
s
!=
null
&&
s
.
intValue
()
==
storeInfoId
.
intValue
())
{
return
true
;
}
...
...
@@ -273,10 +297,41 @@ public class StoreSearchUtils {
StoreSearchQo
searchQo
=
JSON
.
parseObject
(
searchJson
).
getObject
(
channel
.
toString
(),
StoreSearchQo
.
class
);
log
.
info
(
"getOnlineStoreIds:{},{}"
,
searchJson
,
JSON
.
toJSONString
(
searchQo
));
if
(
searchQo
!=
null
){
if
(
searchQo
.
getAll
()
!=
1
){
if
(
searchQo
.
getAll
()
!=
1
){
//todo
if
(
StringUtils
.
isNotBlank
(
searchQo
.
getStoreGroupIds
())){
RedisUtil
.
setCache
(
key
,
1
,
10L
,
TimeUnit
.
MINUTES
);
list
.
addAll
(
Arrays
.
asList
(
searchQo
.
getStoreGroupIds
().
split
(
","
)));
//资源类型
//店招品牌
List
<
String
>
onLineStoreList
=
new
ArrayList
<>();
if
(
StoreChannelEnum
.
WMMALL
.
getChannel
().
equals
(
channel
)){
List
<
WmStoreDTO
>
wmStoreDTOList
=
this
.
wmStoreApiService
.
listWmStore
(
Arrays
.
asList
(
searchQo
.
getStoreGroupIds
().
split
(
","
)),
null
).
getResult
();
onLineStoreList
=
wmStoreDTOList
.
stream
().
filter
(
wmStoreDTO
->
{
boolean
resourceFlag
=
true
;
if
(
StringUtils
.
isNotBlank
(
searchQo
.
getResourceType
())){
if
(
"1"
.
equals
(
searchQo
.
getResourceType
())){
//自有资源
if
(
enterpriseId
.
equals
(
wmStoreDTO
.
getEnterpriseId
())){
resourceFlag
=
true
;
}
}
if
(
"2"
.
equals
(
searchQo
.
getStoreBrand
())){
//共享资源
if
(!
enterpriseId
.
equals
(
wmStoreDTO
.
getEnterpriseId
())){
resourceFlag
=
true
;
}
}
}
boolean
brandFlag
=
true
;
if
(
StringUtils
.
isNotBlank
(
searchQo
.
getStoreBrand
())){
List
<
String
>
strings
=
Arrays
.
asList
(
searchQo
.
getStoreBrand
().
split
(
","
));
if
(
strings
.
contains
(
wmStoreDTO
.
getStoreBrandId
().
toString
())){
brandFlag
=
true
;
}
}
return
resourceFlag
||
brandFlag
;
}).
map
(
wmStoreDTO
->
wmStoreDTO
.
getWmMallStoreId
().
toString
()).
collect
(
Collectors
.
toList
());
list
.
addAll
(
onLineStoreList
);
if
(
CollectionUtils
.
isNotEmpty
(
onLineStoreList
)){
RedisUtil
.
setCache
(
key
,
1
,
10L
,
TimeUnit
.
MINUTES
);
}
}
}
}
}
...
...
@@ -293,4 +348,5 @@ public class StoreSearchUtils {
}
}
}
}
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