Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
R
rs-cloud-platform
Project
Project
Details
Activity
Releases
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
周健威
rs-cloud-platform
Commits
4e388281
Commit
4e388281
authored
Jul 08, 2024
by
周健威
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修改代码
parent
da3b9eed
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
62 additions
and
2 deletions
+62
-2
AdminGaindataController.java
...atform/rs/website/controller/AdminGaindataController.java
+62
-2
No files found.
rs-website/rs-website-server/src/main/java/com/upyuns/platform/rs/website/controller/AdminGaindataController.java
View file @
4e388281
...
...
@@ -21,6 +21,7 @@ import com.upyuns.platform.rs.website.dto.GainDataDTO;
import
com.upyuns.platform.rs.website.entity.DataMenu
;
import
com.upyuns.platform.rs.website.entity.FileData
;
import
com.upyuns.platform.rs.website.entity.GainData
;
import
com.upyuns.platform.rs.website.vo.DataMenuTree
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.Data
;
import
lombok.extern.slf4j.Slf4j
;
...
...
@@ -198,7 +199,7 @@ public class AdminGaindataController extends BaseController<GainDataBiz, GainDat
}
Map
<
String
,
Long
>
map
=
CollUtil
.
newHashMap
();
if
(
dto
.
getStatisticsType
()
==
null
||
dto
.
getStatisticsType
()
==
STATISTICSTYPE_SUPPLIER
)
{
map
=
list
.
parallelStream
().
filter
(
o
->
StrUtil
.
isNotBlank
(
o
.
getSupplier
())).
collect
(
Collectors
.
groupingBy
(
GainData:
:
getSupplier
,
Collectors
.
counting
()));
map
=
list
.
parallelStream
().
filter
(
o
->
StrUtil
.
isNotBlank
(
o
.
getSupplier
())).
collect
(
Collectors
.
groupingBy
(
GainData:
:
getSupplier
,
Collectors
.
counting
()));
}
else
if
(
dto
.
getStatisticsType
()
==
STATISTICSTYPE_TOPMENU
)
{
map
=
voList
.
parallelStream
().
filter
(
o
->
(
null
!=
o
.
getMenuId
())).
collect
(
Collectors
.
groupingBy
(
GainDataController
.
GainDataVO
::
getTopMenuName
,
Collectors
.
counting
()));
}
...
...
@@ -206,10 +207,69 @@ public class AdminGaindataController extends BaseController<GainDataBiz, GainDat
return
ObjectRestResponse
.
succ
(
map
);
}
@ApiModelProperty
(
"统计-供应商"
)
@IgnoreUserToken
@RequestMapping
(
value
=
"/app/unauth/statistics/supplier"
,
method
=
RequestMethod
.
GET
)
public
ObjectRestResponse
statisticsSupplier
(
GainDataAdminDTO
dto
)
{
Example
example
=
baseBiz
.
initExample
(
dto
);
List
<
GainData
>
list
=
baseBiz
.
selectByExample
(
example
);
List
<
DataMenu
>
dataMenuList
=
dataMenuBiz
.
selectListAll
();
List
<
GainDataController
.
GainDataVO
>
voList
=
Convert
.
toList
(
GainDataController
.
GainDataVO
.
class
,
list
);
Map
<
Integer
,
DataMenu
>
dataMenuMap
=
dataMenuList
.
parallelStream
().
collect
(
Collectors
.
toMap
(
DataMenu:
:
getId
,
Function
.
identity
()));
for
(
GainDataController
.
GainDataVO
gainDataVO
:
voList
)
{
if
(
null
!=
gainDataVO
.
getMenuId
())
{
DataMenu
topMenu
=
baseBiz
.
getTopMenu
(
dataMenuMap
,
dataMenuMap
.
get
(
gainDataVO
.
getMenuId
()));
if
(
null
!=
topMenu
)
{
gainDataVO
.
setTopMenuId
(
topMenu
.
getId
());
gainDataVO
.
setTopMenuName
(
topMenu
.
getTitle
());
}
}
}
List
<
SupplierStatistics
>
returnList
=
CollUtil
.
newArrayList
();
Map
<
String
,
Long
>
map
=
CollUtil
.
newHashMap
();
map
=
list
.
parallelStream
().
filter
(
o
->
StrUtil
.
isNotBlank
(
o
.
getSupplier
())).
collect
(
Collectors
.
groupingBy
(
GainData:
:
getSupplier
,
Collectors
.
counting
()));
handleTree
(
dto
,
returnList
,
map
);
return
ObjectRestResponse
.
succ
(
returnList
);
}
private
void
handleTree
(
GainDataAdminDTO
dto
,
List
<
SupplierStatistics
>
returnList
,
Map
<
String
,
Long
>
map
)
{
for
(
String
supplierName
:
map
.
keySet
())
{
dto
.
setSupplier
(
supplierName
);
Example
example
=
baseBiz
.
initExample
(
dto
);
List
<
GainData
>
list2
=
baseBiz
.
selectByExample
(
example
);
List
<
DataMenu
>
dataMenuList
=
dataMenuBiz
.
selectListAll
();
List
<
GainDataBiz
.
DataMenuStats
>
dataMenuStatsList
=
Convert
.
toList
(
GainDataBiz
.
DataMenuStats
.
class
,
dataMenuList
);
List
<
GainDataController
.
GainDataVO
>
voList
=
Convert
.
toList
(
GainDataController
.
GainDataVO
.
class
,
list2
);
Map
<
Integer
,
GainDataBiz
.
DataMenuStats
>
dataMenuMap
=
dataMenuStatsList
.
parallelStream
().
collect
(
Collectors
.
toMap
(
DataMenu:
:
getId
,
Function
.
identity
()));
for
(
GainDataController
.
GainDataVO
gainDataVO
:
voList
)
{
if
(
null
!=
gainDataVO
.
getMenuId
())
{
baseBiz
.
handleDataNum
(
dataMenuMap
,
dataMenuMap
.
get
(
gainDataVO
.
getMenuId
()));
}
}
List
<
GainDataBiz
.
DataMenuStats
>
dataMenuStats
=
CollUtil
.
newArrayList
(
dataMenuMap
.
values
());
SupplierStatistics
supplierStatistics
=
new
SupplierStatistics
();
supplierStatistics
.
setSupplierName
(
supplierName
);
supplierStatistics
.
setNum
(
map
.
get
(
supplierName
));
supplierStatistics
.
setDatas
(
dataMenuBiz
.
getImageMenuStatsTree
(
dataMenuStats
,
AdminCommonConstant
.
ROOT
));
returnList
.
add
(
supplierStatistics
);
}
}
@Data
public
static
class
SupplierStatistics
{
private
String
supplierName
;
private
Long
num
;
private
List
<
DataMenuTree
>
datas
;
}
@ApiModelProperty
(
"统计-目录"
)
@IgnoreUserToken
@RequestMapping
(
value
=
"/app/unauth/statistics/menu"
,
method
=
RequestMethod
.
GET
)
public
ObjectRestResponse
<
List
<
GainData
>>
statisticsMenu
(
GainDataAdminDTO
dto
)
{
public
ObjectRestResponse
statisticsMenu
(
GainDataAdminDTO
dto
)
{
Example
example
=
baseBiz
.
initExample
(
dto
);
List
<
GainData
>
list
=
baseBiz
.
selectByExample
(
example
);
...
...
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