Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
A
amos-boot-zx-biz
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
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
Jobs
Commits
Open sidebar
项目统一框架
一体化_户用光伏项目代码
amos-boot-zx-biz
Commits
6288883e
Commit
6288883e
authored
Oct 31, 2024
by
chenzhao
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
统计首页开发
parent
ec210524
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
218 additions
and
0 deletions
+218
-0
JpStationMapper.java
...oin/amos/boot/module/hygf/api/mapper/JpStationMapper.java
+2
-0
StatisticsHomepageMapper.java
...boot/module/hygf/api/mapper/StatisticsHomepageMapper.java
+26
-0
JpStationMapper.xml
...f-api/src/main/resources/mapper/mysql/JpStationMapper.xml
+22
-0
StatisticsHomepageMapper.xml
.../main/resources/mapper/mysql/StatisticsHomepageMapper.xml
+0
-0
CommonController.java
...mos/boot/module/hygf/biz/controller/CommonController.java
+23
-0
StatisticsHomepageServiceImpl.java
.../hygf/biz/service/impl/StatisticsHomepageServiceImpl.java
+145
-0
No files found.
amos-boot-system-jxiop/amos-boot-module-hygf-api/src/main/java/com/yeejoin/amos/boot/module/hygf/api/mapper/JpStationMapper.java
View file @
6288883e
...
...
@@ -45,6 +45,8 @@ public interface JpStationMapper extends BaseMapper<JpStation> {
List
<
String
>
getRegionNode
(
String
province
);
List
<
String
>
getRegionNodeByCode
(
String
code
);
List
<
DropDown
>
getRegionAll
();
@UserEmpower
(
field
={
"hygf_regional_companies.regional_companies_code"
}
,
dealerField
={
"hygf_unit_info.amos_company_code"
,
"hygf_regional_companies.regional_companies_code"
}
,
fieldConditions
={
"eq"
,
"in"
}
,
relationship
=
"and"
)
...
...
amos-boot-system-jxiop/amos-boot-module-hygf-api/src/main/java/com/yeejoin/amos/boot/module/hygf/api/mapper/StatisticsHomepageMapper.java
0 → 100644
View file @
6288883e
package
com
.
yeejoin
.
amos
.
boot
.
module
.
hygf
.
api
.
mapper
;
import
org.springframework.web.bind.annotation.RequestParam
;
import
java.util.List
;
import
java.util.Map
;
public
interface
StatisticsHomepageMapper
{
public
List
<
Map
<
String
,
Object
>>
surveyStatusTotal
(
@RequestParam
(
value
=
"developerCode"
)
String
developerCode
,
@RequestParam
(
value
=
"regionalCompaniesCode"
)
String
regionalCompaniesCode
,
@RequestParam
(
value
=
"province"
)
String
province
,
@RequestParam
(
value
=
"city"
)
String
city
,
@RequestParam
(
value
=
"district"
)
String
district
);
public
List
<
Map
<
String
,
Object
>>
contractStatusTotal
(
@RequestParam
(
value
=
"developerCode"
)
String
developerCode
,
@RequestParam
(
value
=
"regionalCompaniesCode"
)
String
regionalCompaniesCode
,
@RequestParam
(
value
=
"province"
)
String
province
,
@RequestParam
(
value
=
"city"
)
String
city
,
@RequestParam
(
value
=
"district"
)
String
district
);
public
List
<
Map
<
String
,
Object
>>
desionTotal
(
@RequestParam
(
value
=
"developerCode"
)
String
developerCode
,
@RequestParam
(
value
=
"regionalCompaniesCode"
)
String
regionalCompaniesCode
,
@RequestParam
(
value
=
"province"
)
String
province
,
@RequestParam
(
value
=
"city"
)
String
city
,
@RequestParam
(
value
=
"district"
)
String
district
);
public
List
<
Map
<
String
,
Object
>>
preparationMoneyTotal
(
@RequestParam
(
value
=
"developerCode"
)
String
developerCode
,
@RequestParam
(
value
=
"regionalCompaniesCode"
)
String
regionalCompaniesCode
,
@RequestParam
(
value
=
"province"
)
String
province
,
@RequestParam
(
value
=
"city"
)
String
city
,
@RequestParam
(
value
=
"district"
)
String
district
);
public
List
<
Map
<
String
,
Object
>>
workOrderTotal
(
@RequestParam
(
value
=
"developerCode"
)
String
developerCode
,
@RequestParam
(
value
=
"regionalCompaniesCode"
)
String
regionalCompaniesCode
,
@RequestParam
(
value
=
"province"
)
String
province
,
@RequestParam
(
value
=
"city"
)
String
city
,
@RequestParam
(
value
=
"district"
)
String
district
);
public
List
<
Map
<
String
,
Object
>>
gridStatusTotal
(
@RequestParam
(
value
=
"developerCode"
)
String
developerCode
,
@RequestParam
(
value
=
"regionalCompaniesCode"
)
String
regionalCompaniesCode
,
@RequestParam
(
value
=
"province"
)
String
province
,
@RequestParam
(
value
=
"city"
)
String
city
,
@RequestParam
(
value
=
"district"
)
String
district
);
public
List
<
Map
<
String
,
Object
>>
acceptanceStatusTotal
(
@RequestParam
(
value
=
"developerCode"
)
String
developerCode
,
@RequestParam
(
value
=
"regionalCompaniesCode"
)
String
regionalCompaniesCode
,
@RequestParam
(
value
=
"province"
)
String
province
,
@RequestParam
(
value
=
"city"
)
String
city
,
@RequestParam
(
value
=
"district"
)
String
district
);
public
List
<
Map
<
String
,
Object
>>
financingStatusTotal
(
@RequestParam
(
value
=
"developerCode"
)
String
developerCode
,
@RequestParam
(
value
=
"regionalCompaniesCode"
)
String
regionalCompaniesCode
,
@RequestParam
(
value
=
"province"
)
String
province
,
@RequestParam
(
value
=
"city"
)
String
city
,
@RequestParam
(
value
=
"district"
)
String
district
);
public
List
<
Map
<
String
,
Object
>>
inverterTotal
(
@RequestParam
(
value
=
"developerCode"
)
String
developerCode
,
@RequestParam
(
value
=
"regionalCompaniesCode"
)
String
regionalCompaniesCode
,
@RequestParam
(
value
=
"province"
)
String
province
,
@RequestParam
(
value
=
"city"
)
String
city
,
@RequestParam
(
value
=
"district"
)
String
district
,
@RequestParam
(
value
=
"regions"
)
List
<
String
>
regions
);
}
amos-boot-system-jxiop/amos-boot-module-hygf-api/src/main/resources/mapper/mysql/JpStationMapper.xml
View file @
6288883e
...
...
@@ -273,6 +273,28 @@
Subtree;
</select>
<select
id=
"getRegionNodeByCode"
resultType=
"string"
>
WITH RECURSIVE Subtree AS (
SELECT
SEQUENCE_NBR
FROM
systemctl_region sr
WHERE
sr.REGION_CODE = #{code}
UNION ALL
SELECT
h.SEQUENCE_NBR
FROM
systemctl_region h
JOIN
Subtree s ON h.PARENT_ID = s.SEQUENCE_NBR
)
SELECT
*
FROM
Subtree;
</select>
<select
id=
"getRegionByProvince"
resultType=
"com.yeejoin.amos.boot.module.hygf.api.dto.DropDown"
>
SELECT privilege_company.ORG_CODE orgCode,
...
...
amos-boot-system-jxiop/amos-boot-module-hygf-api/src/main/resources/mapper/mysql/StatisticsHomepageMapper.xml
0 → 100644
View file @
6288883e
This diff is collapsed.
Click to expand it.
amos-boot-system-jxiop/amos-boot-module-hygf-biz/src/main/java/com/yeejoin/amos/boot/module/hygf/biz/controller/CommonController.java
View file @
6288883e
...
...
@@ -5,6 +5,7 @@ import com.yeejoin.amos.boot.module.hygf.api.dto.CommerceInfoDto;
import
com.yeejoin.amos.boot.module.hygf.api.util.CommonResponseNewUtil
;
import
com.yeejoin.amos.boot.module.hygf.biz.service.impl.CommonServiceImpl
;
import
com.yeejoin.amos.boot.module.hygf.biz.service.impl.FinancingInfoServiceImpl
;
import
com.yeejoin.amos.boot.module.hygf.biz.service.impl.StatisticsHomepageServiceImpl
;
import
io.swagger.annotations.Api
;
import
io.swagger.annotations.ApiOperation
;
import
org.springframework.beans.factory.annotation.Autowired
;
...
...
@@ -28,6 +29,8 @@ public class CommonController {
FinancingInfoServiceImpl
financingInfoService
;
@Autowired
CommonServiceImpl
commonService
;
@Autowired
StatisticsHomepageServiceImpl
statisticsHomepageService
;
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@GetMapping
(
value
=
"/selectRegion"
)
...
...
@@ -95,4 +98,24 @@ public class CommonController {
}
/**
* 统计首页环形图
*
* @return
*/
@GetMapping
(
value
=
"/statisticsHomepage"
)
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@ApiOperation
(
httpMethod
=
"GET"
,
value
=
"资料下载进度获取"
,
notes
=
"资料下载进度获取"
)
public
ResponseModel
<
Map
<
String
,
Object
>>
getSchedule
(
@RequestParam
(
required
=
false
)
String
developerCode
,
@RequestParam
(
required
=
false
)
String
regionalCompaniesCode
,
@RequestParam
(
required
=
false
)
String
province
,
@RequestParam
(
required
=
false
)
String
city
,
@RequestParam
(
required
=
false
)
String
district
)
{
return
ResponseHelper
.
buildResponse
(
statisticsHomepageService
.
statisticsHomepage
(
developerCode
,
regionalCompaniesCode
,
province
,
city
,
district
));
}
}
amos-boot-system-jxiop/amos-boot-module-hygf-biz/src/main/java/com/yeejoin/amos/boot/module/hygf/biz/service/impl/StatisticsHomepageServiceImpl.java
0 → 100644
View file @
6288883e
package
com
.
yeejoin
.
amos
.
boot
.
module
.
hygf
.
biz
.
service
.
impl
;
import
cn.hutool.core.collection.CollectionUtil
;
import
cn.hutool.core.map.MapBuilder
;
import
com.sun.org.apache.bcel.internal.generic.SWITCH
;
import
com.yeejoin.amos.boot.module.hygf.api.mapper.JpStationMapper
;
import
com.yeejoin.amos.boot.module.hygf.api.mapper.StatisticsHomepageMapper
;
import
org.apache.activemq.util.MapHelper
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
import
org.springframework.web.bind.annotation.RequestParam
;
import
java.math.BigDecimal
;
import
java.util.ArrayList
;
import
java.util.Iterator
;
import
java.util.List
;
import
java.util.Map
;
@Service
public
class
StatisticsHomepageServiceImpl
{
@Autowired
StatisticsHomepageMapper
statisticsHomepageMapper
;
@Autowired
JpStationMapper
jpStationMapper
;
public
Map
<
String
,
Object
>
statisticsHomepage
(
String
developerCode
,
String
regionalCompaniesCode
,
String
province
,
String
city
,
String
district
){
Map
<
String
,
Object
>
resultMap
=
MapBuilder
.<
String
,
Object
>
create
().
build
();
List
<
Map
<
String
,
Object
>>
surveyMaps
=
statisticsHomepageMapper
.
surveyStatusTotal
(
developerCode
,
regionalCompaniesCode
,
province
,
city
,
district
);
this
.
resuleMapBuild
(
resultMap
,
surveyMaps
,
"surey"
);
List
<
Map
<
String
,
Object
>>
desionMaps
=
statisticsHomepageMapper
.
desionTotal
(
developerCode
,
regionalCompaniesCode
,
province
,
city
,
district
);
this
.
resuleMapBuild
(
resultMap
,
desionMaps
,
"desion"
);
List
<
Map
<
String
,
Object
>>
contractMaps
=
statisticsHomepageMapper
.
contractStatusTotal
(
developerCode
,
regionalCompaniesCode
,
province
,
city
,
district
);
this
.
resuleMapBuild
(
resultMap
,
contractMaps
,
"contract"
);
List
<
Map
<
String
,
Object
>>
preparationMoneyMaps
=
statisticsHomepageMapper
.
preparationMoneyTotal
(
developerCode
,
regionalCompaniesCode
,
province
,
city
,
district
);
this
.
resuleMapBuild
(
resultMap
,
preparationMoneyMaps
,
"preparationMoney"
);
List
<
Map
<
String
,
Object
>>
workOrderMaps
=
statisticsHomepageMapper
.
workOrderTotal
(
developerCode
,
regionalCompaniesCode
,
province
,
city
,
district
);
this
.
resuleMapBuild
(
resultMap
,
workOrderMaps
,
"workOrder"
);
List
<
Map
<
String
,
Object
>>
gridMaps
=
statisticsHomepageMapper
.
gridStatusTotal
(
developerCode
,
regionalCompaniesCode
,
province
,
city
,
district
);
this
.
resuleMapBuild
(
resultMap
,
gridMaps
,
"grid"
);
List
<
Map
<
String
,
Object
>>
acceptanceMaps
=
statisticsHomepageMapper
.
acceptanceStatusTotal
(
developerCode
,
regionalCompaniesCode
,
province
,
city
,
district
);
this
.
resuleMapBuild
(
resultMap
,
acceptanceMaps
,
"acceptance"
);
List
<
Map
<
String
,
Object
>>
financingMaps
=
statisticsHomepageMapper
.
financingStatusTotal
(
developerCode
,
regionalCompaniesCode
,
province
,
city
,
district
);
this
.
resuleMapBuild
(
resultMap
,
financingMaps
,
"financing"
);
List
<
String
>
regionNodeByCode
=
jpStationMapper
.
getRegionNodeByCode
(
province
);
List
<
Map
<
String
,
Object
>>
inverterMaps
=
statisticsHomepageMapper
.
inverterTotal
(
developerCode
,
regionalCompaniesCode
,
province
,
city
,
district
,
regionNodeByCode
);
this
.
resuleMapBuild
(
resultMap
,
inverterMaps
,
"inverter"
);
return
resultMap
;
}
Map
<
String
,
Object
>
resuleMapBuild
(
Map
<
String
,
Object
>
resultMap
,
List
<
Map
<
String
,
Object
>>
maps
,
String
type
){
long
total
=
0
;
double
realScale
=
0.00
;
List
<
Map
<
String
,
Object
>>
list
=
new
ArrayList
<>();
switch
(
type
){
case
"surey"
:
Map
<
String
,
Object
>
surey
=
maps
.
get
(
0
);
surey
.
keySet
().
forEach
(
e
->{
if
(!
e
.
equals
(
"审核完成"
)){
list
.
add
(
MapBuilder
.<
String
,
Object
>
create
().
put
(
"statusText"
,
e
).
put
(
"total"
,
surey
.
get
(
e
)).
build
());
}
});
resultMap
.
put
(
"surey"
,
list
);
resultMap
.
put
(
"sureyComplete"
,
surey
.
get
(
"completeTotal"
));
break
;
case
"desion"
:
Map
<
String
,
Object
>
desion
=
maps
.
get
(
0
);
desion
.
keySet
().
forEach
(
e
->{
list
.
add
(
MapBuilder
.<
String
,
Object
>
create
().
put
(
"statusText"
,
e
).
put
(
"total"
,
desion
.
get
(
e
)).
build
());
});
if
(
resultMap
.
containsKey
(
"sureyComplete"
)){
list
.
add
(
MapBuilder
.<
String
,
Object
>
create
().
put
(
"statusText"
,
"审核完成"
).
put
(
"total"
,
resultMap
.
get
(
"sureyComplete"
)).
build
());
resultMap
.
remove
(
"sureyComplete"
);
}
else
{
list
.
add
(
MapBuilder
.<
String
,
Object
>
create
().
put
(
"statusText"
,
"审核完成"
).
put
(
"total"
,
0
).
build
());
}
resultMap
.
put
(
"desion"
,
list
);
break
;
case
"contract"
:
Map
<
String
,
Object
>
contract
=
maps
.
get
(
0
);
contract
.
keySet
().
forEach
(
e
->{
list
.
add
(
MapBuilder
.<
String
,
Object
>
create
().
put
(
"statusText"
,
e
).
put
(
"total"
,
contract
.
get
(
e
)).
build
());
});
resultMap
.
put
(
"contract"
,
list
);
break
;
case
"preparationMoney"
:
Map
<
String
,
Object
>
preparationMoney
=
maps
.
get
(
0
);
preparationMoney
.
keySet
().
forEach
(
e
->{
list
.
add
(
MapBuilder
.<
String
,
Object
>
create
().
put
(
"statusText"
,
e
).
put
(
"total"
,
preparationMoney
.
get
(
e
)).
build
());
});
resultMap
.
put
(
"preparationMoney"
,
list
);
break
;
case
"workOrder"
:
Iterator
<
Map
<
String
,
Object
>>
iterator
=
maps
.
iterator
();
while
(
iterator
.
hasNext
())
{
Map
<
String
,
Object
>
map
=
iterator
.
next
();
if
(
"审核中"
.
equals
(
map
.
get
(
"statusText"
)))
{
total
+=
(
long
)
map
.
get
(
"total"
);
realScale
+=
(
double
)
map
.
get
(
"realScale"
);
iterator
.
remove
();
}
}
maps
.
add
(
MapBuilder
.<
String
,
Object
>
create
().
put
(
"statusText"
,
"审核中"
).
put
(
"total"
,
total
).
put
(
"realScale"
,
realScale
).
build
());
resultMap
.
put
(
"workOrder"
,
maps
);
break
;
case
"grid"
:
Iterator
<
Map
<
String
,
Object
>>
iterator1
=
maps
.
iterator
();
while
(
iterator1
.
hasNext
())
{
Map
<
String
,
Object
>
map
=
iterator1
.
next
();
if
(
"审核中"
.
equals
(
map
.
get
(
"statusText"
)))
{
total
+=(
long
)
map
.
get
(
"total"
);
realScale
+=
(
double
)
map
.
get
(
"realScale"
);
iterator1
.
remove
();
}
}
maps
.
add
(
MapBuilder
.<
String
,
Object
>
create
().
put
(
"statusText"
,
"审核中"
).
put
(
"total"
,
total
).
put
(
"realScale"
,
realScale
).
build
());
resultMap
.
put
(
"grid"
,
maps
);
break
;
case
"acceptance"
:
Iterator
<
Map
<
String
,
Object
>>
iterator2
=
maps
.
iterator
();
while
(
iterator2
.
hasNext
())
{
Map
<
String
,
Object
>
map
=
iterator2
.
next
();
if
(
"审核中"
.
equals
(
map
.
get
(
"statusText"
)))
{
total
+=
(
long
)
map
.
get
(
"total"
);
realScale
+=
(
double
)
map
.
get
(
"realScale"
);
iterator2
.
remove
();
}
}
maps
.
add
(
MapBuilder
.<
String
,
Object
>
create
().
put
(
"statusText"
,
"审核中"
).
put
(
"total"
,
total
).
put
(
"realScale"
,
realScale
).
build
());
resultMap
.
put
(
"acceptance"
,
maps
);
break
;
case
"financing"
:
resultMap
.
put
(
"financing"
,
maps
);
break
;
default
:
resultMap
.
put
(
"inverter"
,
maps
);
break
;
}
return
resultMap
;
}
}
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