Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Y
yichengstreet-be
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
yichengstreet
yichengstreet-be
Commits
ab2039fd
Commit
ab2039fd
authored
May 19, 2025
by
lixuan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat: 房源
parent
4126242c
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
27 additions
and
62 deletions
+27
-62
HouseResourceServiceImpl.java
...i/system/service/house/impl/HouseResourceServiceImpl.java
+27
-62
No files found.
ruoyi-system/src/main/java/com/ruoyi/system/service/house/impl/HouseResourceServiceImpl.java
View file @
ab2039fd
...
...
@@ -356,69 +356,19 @@ public class HouseResourceServiceImpl implements HouseResourceService {
}
businessEntityStatisticsDetail
.
setZtCount
(
businessEntityInfos
.
size
());
List
<
String
>
gyIds
=
businessEntityInfos
.
stream
().
filter
(
x
->
StringUtils
.
hasText
(
x
.
getIndustryClassification
())
&&
x
.
getIndustryClassification
().
equals
(
"工业"
)).
map
(
BusinessEntityInfo:
:
getId
).
collect
(
Collectors
.
toList
());
if
(!
CollectionUtils
.
isEmpty
(
gyIds
))
{
List
<
BusinessEntitySell
>
businessEntitySells
=
businessEntitySellMapper
.
selectBusinessEntitySellByEntityIds
(
gyIds
);
if
(!
CollectionUtils
.
isEmpty
(
businessEntitySells
))
{
businessEntityStatisticsDetail
.
setGyCount
(
businessEntitySells
.
stream
().
map
(
BusinessEntitySell:
:
getYearSell
).
filter
(
Objects:
:
nonNull
).
reduce
(
BigDecimal
.
ZERO
,
BigDecimal:
:
add
));
}
}
List
<
String
>
jzyIds
=
businessEntityInfos
.
stream
().
filter
(
x
->
StringUtils
.
hasText
(
x
.
getIndustryClassification
())
&&
x
.
getIndustryClassification
().
equals
(
"建筑业"
)).
map
(
BusinessEntityInfo:
:
getId
).
collect
(
Collectors
.
toList
());
if
(!
CollectionUtils
.
isEmpty
(
jzyIds
))
{
List
<
BusinessEntitySell
>
businessEntitySells
=
businessEntitySellMapper
.
selectBusinessEntitySellByEntityIds
(
jzyIds
);
if
(!
CollectionUtils
.
isEmpty
(
businessEntitySells
))
{
businessEntityStatisticsDetail
.
setJzyCount
(
businessEntitySells
.
stream
().
map
(
BusinessEntitySell:
:
getYearSell
).
filter
(
Objects:
:
nonNull
).
reduce
(
BigDecimal
.
ZERO
,
BigDecimal:
:
add
));
}
}
List
<
String
>
pfIds
=
businessEntityInfos
.
stream
().
filter
(
x
->
StringUtils
.
hasText
(
x
.
getIndustryClassification
())
&&
x
.
getIndustryClassification
().
equals
(
"批发"
)).
map
(
BusinessEntityInfo:
:
getId
).
collect
(
Collectors
.
toList
());
if
(!
CollectionUtils
.
isEmpty
(
pfIds
))
{
List
<
BusinessEntitySell
>
businessEntitySells
=
businessEntitySellMapper
.
selectBusinessEntitySellByEntityIds
(
pfIds
);
if
(!
CollectionUtils
.
isEmpty
(
businessEntitySells
))
{
businessEntityStatisticsDetail
.
setPfCount
(
businessEntitySells
.
stream
().
map
(
BusinessEntitySell:
:
getYearSell
).
filter
(
Objects:
:
nonNull
).
reduce
(
BigDecimal
.
ZERO
,
BigDecimal:
:
add
));
}
}
List
<
String
>
lsIds
=
businessEntityInfos
.
stream
().
filter
(
x
->
StringUtils
.
hasText
(
x
.
getIndustryClassification
())
&&
x
.
getIndustryClassification
().
equals
(
"零售"
)).
map
(
BusinessEntityInfo:
:
getId
).
collect
(
Collectors
.
toList
());
if
(!
CollectionUtils
.
isEmpty
(
lsIds
))
{
List
<
BusinessEntitySell
>
businessEntitySells
=
businessEntitySellMapper
.
selectBusinessEntitySellByEntityIds
(
lsIds
);
if
(!
CollectionUtils
.
isEmpty
(
businessEntitySells
))
{
businessEntityStatisticsDetail
.
setLsCount
(
businessEntitySells
.
stream
().
map
(
BusinessEntitySell:
:
getYearSell
).
filter
(
Objects:
:
nonNull
).
reduce
(
BigDecimal
.
ZERO
,
BigDecimal:
:
add
));
}
}
List
<
String
>
zsIds
=
businessEntityInfos
.
stream
().
filter
(
x
->
StringUtils
.
hasText
(
x
.
getIndustryClassification
())
&&
x
.
getIndustryClassification
().
equals
(
"住宿"
)).
map
(
BusinessEntityInfo:
:
getId
).
collect
(
Collectors
.
toList
());
if
(!
CollectionUtils
.
isEmpty
(
zsIds
))
{
List
<
BusinessEntitySell
>
businessEntitySells
=
businessEntitySellMapper
.
selectBusinessEntitySellByEntityIds
(
zsIds
);
if
(!
CollectionUtils
.
isEmpty
(
businessEntitySells
))
{
businessEntityStatisticsDetail
.
setZsCount
(
businessEntitySells
.
stream
().
map
(
BusinessEntitySell:
:
getYearSell
).
filter
(
Objects:
:
nonNull
).
reduce
(
BigDecimal
.
ZERO
,
BigDecimal:
:
add
));
}
}
List
<
String
>
cyIds
=
businessEntityInfos
.
stream
().
filter
(
x
->
StringUtils
.
hasText
(
x
.
getIndustryClassification
())
&&
x
.
getIndustryClassification
().
equals
(
"餐饮"
)).
map
(
BusinessEntityInfo:
:
getId
).
collect
(
Collectors
.
toList
());
if
(!
CollectionUtils
.
isEmpty
(
cyIds
))
{
List
<
BusinessEntitySell
>
businessEntitySells
=
businessEntitySellMapper
.
selectBusinessEntitySellByEntityIds
(
cyIds
);
if
(!
CollectionUtils
.
isEmpty
(
businessEntitySells
))
{
businessEntityStatisticsDetail
.
setCyCount
(
businessEntitySells
.
stream
().
map
(
BusinessEntitySell:
:
getYearSell
).
filter
(
Objects:
:
nonNull
).
reduce
(
BigDecimal
.
ZERO
,
BigDecimal:
:
add
));
}
}
List
<
String
>
fwyIds
=
businessEntityInfos
.
stream
().
filter
(
x
->
StringUtils
.
hasText
(
x
.
getIndustryClassification
())
&&
x
.
getIndustryClassification
().
equals
(
"服务业"
)).
map
(
BusinessEntityInfo:
:
getId
).
collect
(
Collectors
.
toList
());
if
(!
CollectionUtils
.
isEmpty
(
fwyIds
))
{
List
<
BusinessEntitySell
>
businessEntitySells
=
businessEntitySellMapper
.
selectBusinessEntitySellByEntityIds
(
fwyIds
);
if
(!
CollectionUtils
.
isEmpty
(
businessEntitySells
))
{
businessEntityStatisticsDetail
.
setFwyCount
(
businessEntitySells
.
stream
().
map
(
BusinessEntitySell:
:
getYearSell
).
filter
(
Objects:
:
nonNull
).
reduce
(
BigDecimal
.
ZERO
,
BigDecimal:
:
add
));
}
}
Map
<
String
,
BigDecimal
>
industrySellMap
=
Arrays
.
asList
(
"工业"
,
"建筑业"
,
"批发"
,
"零售"
,
"住宿"
,
"餐饮"
,
"服务业"
,
"其他"
)
.
parallelStream
()
.
collect
(
Collectors
.
toMap
(
industry
->
industry
,
industry
->
getIndustrySellCount
(
businessEntityInfos
,
industry
,
businessEntitySellMapper
)));
businessEntityStatisticsDetail
.
setGyCount
(
industrySellMap
.
getOrDefault
(
"工业"
,
BigDecimal
.
ZERO
));
businessEntityStatisticsDetail
.
setJzyCount
(
industrySellMap
.
getOrDefault
(
"建筑业"
,
BigDecimal
.
ZERO
));
businessEntityStatisticsDetail
.
setPfCount
(
industrySellMap
.
getOrDefault
(
"批发"
,
BigDecimal
.
ZERO
));
businessEntityStatisticsDetail
.
setLsCount
(
industrySellMap
.
getOrDefault
(
"零售"
,
BigDecimal
.
ZERO
));
businessEntityStatisticsDetail
.
setZsCount
(
industrySellMap
.
getOrDefault
(
"住宿"
,
BigDecimal
.
ZERO
));
businessEntityStatisticsDetail
.
setCyCount
(
industrySellMap
.
getOrDefault
(
"餐饮"
,
BigDecimal
.
ZERO
));
businessEntityStatisticsDetail
.
setFwyCount
(
industrySellMap
.
getOrDefault
(
"服务业"
,
BigDecimal
.
ZERO
));
businessEntityStatisticsDetail
.
setQtjjfzCount
(
industrySellMap
.
getOrDefault
(
"其他"
,
BigDecimal
.
ZERO
));
List
<
String
>
qtIds
=
businessEntityInfos
.
stream
().
filter
(
x
->
StringUtils
.
hasText
(
x
.
getIndustryClassification
())
&&
x
.
getIndustryClassification
().
equals
(
"其他"
)).
map
(
BusinessEntityInfo:
:
getId
).
collect
(
Collectors
.
toList
());
if
(!
CollectionUtils
.
isEmpty
(
qtIds
))
{
List
<
BusinessEntitySell
>
businessEntitySells
=
businessEntitySellMapper
.
selectBusinessEntitySellByEntityIds
(
qtIds
);
if
(!
CollectionUtils
.
isEmpty
(
businessEntitySells
))
{
businessEntityStatisticsDetail
.
setQtjjfzCount
(
businessEntitySells
.
stream
().
map
(
BusinessEntitySell:
:
getYearSell
).
filter
(
Objects:
:
nonNull
).
reduce
(
BigDecimal
.
ZERO
,
BigDecimal:
:
add
));
}
}
businessEntityStatisticsDetail
.
setJjzl
(
businessEntityStatisticsDetail
.
getGyCount
()
.
add
(
businessEntityStatisticsDetail
.
getJzyCount
())
.
add
(
businessEntityStatisticsDetail
.
getPfCount
())
...
...
@@ -512,4 +462,19 @@ public class HouseResourceServiceImpl implements HouseResourceService {
});
return
list
.
stream
().
sorted
(
Comparator
.
comparing
(
HouseResourcePage:
:
getHouseNumber
,
Comparator
.
nullsLast
(
String:
:
compareTo
))).
collect
(
Collectors
.
toList
());
}
private
BigDecimal
getIndustrySellCount
(
List
<
BusinessEntityInfo
>
infos
,
String
industry
,
BusinessEntitySellMapper
sellMapper
)
{
List
<
String
>
ids
=
infos
.
stream
()
.
filter
(
x
->
StringUtils
.
hasText
(
x
.
getIndustryClassification
())
&&
x
.
getIndustryClassification
().
equals
(
industry
))
.
map
(
BusinessEntityInfo:
:
getId
)
.
collect
(
Collectors
.
toList
());
if
(
CollectionUtils
.
isEmpty
(
ids
))
{
return
BigDecimal
.
ZERO
;
}
List
<
BusinessEntitySell
>
sells
=
sellMapper
.
selectBusinessEntitySellByEntityIds
(
ids
);
if
(
CollectionUtils
.
isEmpty
(
sells
))
{
return
BigDecimal
.
ZERO
;
}
return
sells
.
stream
().
map
(
BusinessEntitySell:
:
getYearSell
).
filter
(
Objects:
:
nonNull
).
reduce
(
BigDecimal
.
ZERO
,
BigDecimal:
:
add
);
}
}
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