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
f5c2ea2f
Commit
f5c2ea2f
authored
May 22, 2024
by
guojx
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
流失数据接口
parent
0ce3dd7c
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
8 additions
and
92 deletions
+8
-92
WechatWorkController.java
...ic/haoban/manage/web/controller/WechatWorkController.java
+0
-1
WechatWorkLostClerkHandle.java
...c/haoban/manage/web/handle/WechatWorkLostClerkHandle.java
+0
-1
StoreAuthUtils.java
.../com/gic/haoban/manage/web/utils/data/StoreAuthUtils.java
+8
-90
No files found.
haoban-manage3-web/src/main/java/com/gic/haoban/manage/web/controller/WechatWorkController.java
View file @
f5c2ea2f
...
...
@@ -229,7 +229,6 @@ public class WechatWorkController extends NewBaseController {
}
if
(
total
!=
null
)
{
total
.
put
(
"clerkName"
,
"合计("
+
list
.
size
()
+
")"
);
storeAuthUtils
.
setChannelGroupList
(
total
);
list
.
add
(
0
,
total
);
}
vo
.
setRows
(
list
);
...
...
haoban-manage3-web/src/main/java/com/gic/haoban/manage/web/handle/WechatWorkLostClerkHandle.java
View file @
f5c2ea2f
...
...
@@ -45,7 +45,6 @@ public class WechatWorkLostClerkHandle extends DownloadHandlerAbstract<WechatWor
}
if
(
total
!=
null
)
{
total
.
put
(
"clerkName"
,
"合计("
+
list
.
size
()
+
")"
);
storeAuthUtils
.
setChannelGroupList
(
total
);
list
.
add
(
0
,
total
);
}
if
(
CollectionUtils
.
isNotEmpty
(
list
))
{
...
...
haoban-manage3-web/src/main/java/com/gic/haoban/manage/web/utils/data/StoreAuthUtils.java
View file @
f5c2ea2f
...
...
@@ -187,14 +187,12 @@ public class StoreAuthUtils {
}
recycle
.
put
(
"storeGroupId"
,
"all"
);
List
<
JSONObject
>
list
=
new
ArrayList
<>();
setChannelGroupList
(
recycle
);
list
.
add
(
recycle
);
JSONObject
temp
=
JSONObject
.
parseObject
(
recycle
.
toJSONString
());
temp
.
remove
(
"channelGroupList"
);
temp
.
put
(
"storeGroupName"
,
"回收站门店"
);
temp
.
put
(
"storeGroupId"
,
"-3"
);
setChannelGroupList
(
temp
);
list
.
add
(
temp
);
vo
.
setRows
(
list
);
...
...
@@ -208,59 +206,13 @@ public class StoreAuthUtils {
getRecycleStore
=
(
List
<
String
>)
jsonObject
.
get
(
"recycleStoreIdList"
);
}
jsonObject
.
put
(
"pageSize"
,
Integer
.
MAX_VALUE
);
jsonObject
.
put
(
"pageNum"
,
1
);
Map
<
String
,
Object
>
res
=
DataApiUtils
.
http
(
jsonObject
.
toJSONString
(),
apolloKey
);
List
<
JSONObject
>
list
=
DataApiUtils
.
getCirclePageData
(
jsonObject
,
apolloKey
,
true
);
Integer
totalCount
=
(
CollectionUtils
.
isEmpty
(
list
)
?
0
:
list
.
size
());
Page
page
=
DataApiUtils
.
getPageData
(
res
);
List
<
JSONObject
>
list
=
DataApiUtils
.
getPageList
(
res
);
Integer
totalCount
=
page
.
getTotalCount
();
vo
.
setTotalNum
(
totalCount
);
vo
.
setPageSize
(
pageSize
);
vo
.
setPageNum
(
currentPage
);
String
channelMapKey
=
jsonObject
.
containsKey
(
"orderChannel"
)
?
"orderChannel"
:
"mbrChannel"
;
if
(
CollectionUtils
.
isNotEmpty
(
list
))
{
vo
.
setPageSize
(
pageSize
);
vo
.
setPageNum
(
currentPage
);
Map
<
String
,
List
<
JSONObject
>>
jsonGroup
=
new
HashMap
<>();
List
<
String
>
idList
=
new
ArrayList
<>();
for
(
JSONObject
tempMap
:
list
)
{
String
id
=
tempMap
.
getString
(
isStore
?
"storeId"
:
"storeGroupId"
);
if
(
jsonGroup
.
containsKey
(
id
))
{
jsonGroup
.
get
(
id
).
add
(
tempMap
);
}
else
{
idList
.
add
(
id
);
List
<
JSONObject
>
mapJson
=
new
ArrayList
<>();
mapJson
.
add
(
tempMap
);
jsonGroup
.
put
(
id
,
mapJson
);
}
}
vo
.
setTotalNum
(
jsonGroup
.
size
());
int
totalPage
=
(
vo
.
getTotalNum
()
%
pageSize
!=
0
?
(
vo
.
getTotalNum
()
/
pageSize
+
1
)
:
(
vo
.
getTotalNum
()
/
pageSize
));
int
start
=
(
currentPage
-
1
)
*
pageSize
;
int
end
=
currentPage
*
pageSize
;
if
(
end
>
idList
.
size
())
{
end
=
idList
.
size
();
}
List
<
JSONObject
>
tempList
=
new
ArrayList
<>();
Set
<
String
>
tempSet
=
new
HashSet
<>();
for
(
int
i
=
start
;
i
<
end
;
i
++)
{
String
indexId
=
idList
.
get
(
i
);
if
(
tempSet
.
contains
(
indexId
))
{
continue
;
}
List
<
JSONObject
>
channelGroupList
=
jsonGroup
.
get
(
indexId
);
JSONObject
copyJson
=
JSONObject
.
parseObject
(
channelGroupList
.
get
(
0
).
toJSONString
());
copyJson
.
put
(
"channelGroupList"
,
sortChannel
(
channelGroupList
,
(
List
<
String
>)
jsonObject
.
get
(
channelMapKey
)));
tempSet
.
add
(
indexId
);
tempList
.
add
(
copyJson
);
}
list
=
tempList
;
}
//调用一次合计
if
(
hasCountPerPage
||
(
isFirst
&&
CollectionUtils
.
isNotEmpty
(
list
)))
{
if
(
hasCountPerPage
&&
CollectionUtils
.
isEmpty
(
list
))
{
...
...
@@ -282,12 +234,12 @@ public class StoreAuthUtils {
total
=
new
JSONObject
();
}
if
(
isStore
)
{
total
.
put
(
"storeName"
,
"合计("
+
(
hasCountPerPage
?
vo
.
getTotalNum
()
:
totalCount
)
+
")"
);
total
.
put
(
"storeName"
,
"合计("
+
totalCount
+
")"
);
}
else
{
total
.
put
(
"storeGroupName"
,
"合计("
+
(
hasCountPerPage
?
vo
.
getTotalNum
()
:
totalCount
)
+
")"
);
total
.
put
(
"storeGroupName"
,
"合计("
+
totalCount
+
")"
);
}
total
.
put
(
"storeGroupId"
,
"all"
);
setChannelGroupList
(
total
);
list
.
add
(
0
,
total
);
if
(
hasRecycle
)
{
...
...
@@ -299,7 +251,6 @@ public class StoreAuthUtils {
recycle
.
put
(
"storeGroupName"
,
"回收站门店"
);
recycle
.
put
(
"storeGroupId"
,
"-3"
);
setChannelGroupList
(
recycle
);
list
.
add
(
1
,
recycle
);
}
}
...
...
@@ -393,10 +344,6 @@ public class StoreAuthUtils {
return
list
;
}
public
void
setChannelGroupList
(
JSONObject
jsonObject
)
{
jsonObject
.
put
(
"channelGroupList"
,
Arrays
.
asList
(
JSONObject
.
parseObject
(
jsonObject
.
toJSONString
())));
}
public
JSONObject
getTotalJson
(
JSONObject
param
,
String
apolloKey
)
{
Map
<
String
,
Object
>
totalRes
=
DataApiUtils
.
http
(
param
.
toJSONString
(),
apolloKey
);
List
<
JSONObject
>
totalList
=
DataApiUtils
.
getPageList
(
totalRes
);
...
...
@@ -406,33 +353,4 @@ public class StoreAuthUtils {
JSONObject
total
=
totalList
.
get
(
0
);
return
total
;
}
public
static
List
<
JSONObject
>
sortChannel
(
List
<
JSONObject
>
channelGroupList
,
List
<
String
>
mbrChannel
)
{
if
(
CollectionUtils
.
isNotEmpty
(
channelGroupList
))
{
for
(
JSONObject
temp
:
channelGroupList
)
{
if
(
"c_all"
.
equals
(
temp
.
getString
(
"channelCode"
))
&&
StringUtils
.
isBlank
(
temp
.
getString
(
"channelName"
)))
{
temp
.
put
(
"channelName"
,
"全渠道"
);
}
else
if
(!
temp
.
containsKey
(
"channelCode"
))
{
temp
.
put
(
"channelName"
,
"全渠道"
);
}
}
if
(
channelGroupList
.
stream
().
noneMatch
(
e
->
e
.
containsKey
(
"channelCode"
)))
{
return
channelGroupList
;
}
}
if
(
CollectionUtils
.
isEmpty
(
mbrChannel
))
{
return
channelGroupList
;
}
List
<
JSONObject
>
result
=
new
ArrayList
<>();
for
(
String
str
:
mbrChannel
)
{
for
(
JSONObject
jsonObject
:
channelGroupList
)
{
if
(
str
.
equals
(
jsonObject
.
getString
(
"channelCode"
)))
{
result
.
add
(
jsonObject
);
}
}
}
return
result
;
}
}
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