Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
A
amos-boot-biz
Project
Project
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
项目统一框架
amos-boot-biz
Commits
a9a8dc1a
Commit
a9a8dc1a
authored
Apr 25, 2024
by
朱晨阳
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
添加经销商电站数据统计接口
parent
d9f7e61b
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
147 additions
and
0 deletions
+147
-0
JpStationMapper.java
...oin/amos/boot/module/hygf/api/mapper/JpStationMapper.java
+12
-0
IJpStationService.java
.../amos/boot/module/hygf/api/service/IJpStationService.java
+9
-0
JpStationMapper.xml
...f-api/src/main/resources/mapper/mysql/JpStationMapper.xml
+47
-0
JpStationController.java
.../boot/module/hygf/biz/controller/JpStationController.java
+25
-0
JpStationServiceImpl.java
...ot/module/hygf/biz/service/impl/JpStationServiceImpl.java
+54
-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 @
a9a8dc1a
...
@@ -7,6 +7,7 @@ import com.yeejoin.amos.boot.module.hygf.api.config.UserEmpower;
...
@@ -7,6 +7,7 @@ import com.yeejoin.amos.boot.module.hygf.api.config.UserEmpower;
import
com.yeejoin.amos.boot.module.hygf.api.config.UserLimits
;
import
com.yeejoin.amos.boot.module.hygf.api.config.UserLimits
;
import
com.yeejoin.amos.boot.module.hygf.api.dto.DropDown
;
import
com.yeejoin.amos.boot.module.hygf.api.dto.DropDown
;
import
com.yeejoin.amos.boot.module.hygf.api.dto.JpStationDto
;
import
com.yeejoin.amos.boot.module.hygf.api.dto.JpStationDto
;
import
com.yeejoin.amos.boot.module.hygf.api.dto.PowerStationStatistics
;
import
com.yeejoin.amos.boot.module.hygf.api.entity.JpStation
;
import
com.yeejoin.amos.boot.module.hygf.api.entity.JpStation
;
import
org.apache.ibatis.annotations.Param
;
import
org.apache.ibatis.annotations.Param
;
...
@@ -67,4 +68,15 @@ public interface JpStationMapper extends BaseMapper<JpStation> {
...
@@ -67,4 +68,15 @@ public interface JpStationMapper extends BaseMapper<JpStation> {
List
<
JpStationDto
>
queryForDealerReviewPagenew
(
@Param
(
"dto"
)
JpStationDto
reviewDto
);
List
<
JpStationDto
>
queryForDealerReviewPagenew
(
@Param
(
"dto"
)
JpStationDto
reviewDto
);
List
<
DropDown
>
getDealerNew
(
@Param
(
"regionalCompaniesSeq"
)
String
regionalCompaniesSeq
);
List
<
DropDown
>
getDealerNew
(
@Param
(
"regionalCompaniesSeq"
)
String
regionalCompaniesSeq
);
// @UserEmpower(field ={"ORG_CODE"} ,dealerField ={"ORG_CODE"}, fieldConditions ={"in","in"} ,relationship="and",specific=false)
List
<
PowerStationStatistics
>
getRegionPage
(
String
regionName
);
PowerStationStatistics
getRegionStatistics
(
String
code
);
List
<
PowerStationStatistics
>
getDealerPage
(
String
regionCompanyOrgCode
,
String
dealerName
);
}
}
amos-boot-system-jxiop/amos-boot-module-hygf-api/src/main/java/com/yeejoin/amos/boot/module/hygf/api/service/IJpStationService.java
View file @
a9a8dc1a
package
com
.
yeejoin
.
amos
.
boot
.
module
.
hygf
.
api
.
service
;
package
com
.
yeejoin
.
amos
.
boot
.
module
.
hygf
.
api
.
service
;
import
com.github.pagehelper.Page
;
import
com.yeejoin.amos.boot.module.hygf.api.dto.JpStationDto
;
import
com.yeejoin.amos.boot.module.hygf.api.dto.JpStationDto
;
import
com.yeejoin.amos.boot.module.hygf.api.dto.PowerStationStatistics
;
import
com.yeejoin.amos.boot.module.hygf.api.entity.JpStation
;
import
com.yeejoin.amos.boot.module.hygf.api.entity.JpStation
;
import
java.util.List
;
import
java.util.List
;
...
@@ -33,4 +35,11 @@ public interface IJpStationService {
...
@@ -33,4 +35,11 @@ public interface IJpStationService {
Map
<
String
,
List
<
Object
>>
getPowerqxnew
(
String
date
,
JpStationDto
reviewDto
);
Map
<
String
,
List
<
Object
>>
getPowerqxnew
(
String
date
,
JpStationDto
reviewDto
);
com
.
baomidou
.
mybatisplus
.
extension
.
plugins
.
pagination
.
Page
<
PowerStationStatistics
>
getRegionStatistics
(
Integer
current
,
Integer
size
,
String
regionName
);
com
.
baomidou
.
mybatisplus
.
extension
.
plugins
.
pagination
.
Page
<
PowerStationStatistics
>
getDealerStatistics
(
Integer
current
,
Integer
size
,
String
regionCompanyOrgCode
,
String
dealerName
);
}
}
amos-boot-system-jxiop/amos-boot-module-hygf-api/src/main/resources/mapper/mysql/JpStationMapper.xml
View file @
a9a8dc1a
...
@@ -615,4 +615,51 @@
...
@@ -615,4 +615,51 @@
</where>
</where>
</select>
</select>
<!-- ========电站监控区域=======-->
<select
id=
"getRegionPage"
resultType=
"com.yeejoin.amos.boot.module.hygf.api.dto.PowerStationStatistics"
>
SELECT privilege_company.ORG_CODE code ,
privilege_company.COMPANY_NAME name
FROM privilege_company
<where>
IS_DELETED=0 and privilege_company.COMPANY_TYPE = 'region'
<if
test=
"regionName != null and regionName !=''"
>
and privilege_company.COMPANY_NAME like concat("%",#{regionName},"%")
</if>
</where>
</select>
<!-- code参数为区域公司orgCode或经销商orgCode-->
<select
id=
"getRegionStatistics"
resultType=
"com.yeejoin.amos.boot.module.hygf.api.dto.PowerStationStatistics"
>
SELECT COUNT(*) AS powerStationNumber,
ROUND(SUM(capacity), 2) AS totalCapacity,
ROUND(SUM(day_generate), 2) AS totalDayGenerate,
ROUND(SUM(rated_power), 2) AS totalRatedPower,
ROUND(SUM(day_income), 2) AS totalDayIncome
FROM hygf_jp_station hjs
WHERE hjs.regional_companies_code = #{code} or hjs.amos_company_code = #{code}
</select>
<!-- 根据区域orgCode查询经销商-->
<select
id=
"getDealerPage"
resultType=
"com.yeejoin.amos.boot.module.hygf.api.dto.PowerStationStatistics"
>
select hui.name as name, hui.amos_company_code as code
from hygf_regional_companies hrc
RIGHT JOIN hygf_unit_info hui
ON hrc.unit_info_id = hui.sequence_nbr
<where>
hui.blacklist=0 and hui.is_delete=0
<if
test=
"regionCompanyOrgCode != null and regionCompanyOrgCode!=''"
>
and hrc.regional_companies_code = #{regionCompanyOrgCode}
</if>
<if
test=
"dealerName != null and dealerName!=''"
>
and hui.name like concat("%",#{dealerName},"%")
</if>
</where>
</select>
</mapper>
</mapper>
amos-boot-system-jxiop/amos-boot-module-hygf-biz/src/main/java/com/yeejoin/amos/boot/module/hygf/biz/controller/JpStationController.java
View file @
a9a8dc1a
...
@@ -9,6 +9,7 @@ import com.yeejoin.amos.boot.module.hygf.api.config.DealerRestrict;
...
@@ -9,6 +9,7 @@ import com.yeejoin.amos.boot.module.hygf.api.config.DealerRestrict;
import
com.yeejoin.amos.boot.module.hygf.api.config.UserLimits
;
import
com.yeejoin.amos.boot.module.hygf.api.config.UserLimits
;
import
com.yeejoin.amos.boot.module.hygf.api.dto.DropDown
;
import
com.yeejoin.amos.boot.module.hygf.api.dto.DropDown
;
import
com.yeejoin.amos.boot.module.hygf.api.dto.JpStationDto
;
import
com.yeejoin.amos.boot.module.hygf.api.dto.JpStationDto
;
import
com.yeejoin.amos.boot.module.hygf.api.dto.PowerStationStatistics
;
import
com.yeejoin.amos.boot.module.hygf.api.entity.*
;
import
com.yeejoin.amos.boot.module.hygf.api.entity.*
;
import
com.yeejoin.amos.boot.module.hygf.api.mapper.*
;
import
com.yeejoin.amos.boot.module.hygf.api.mapper.*
;
import
com.yeejoin.amos.boot.module.hygf.biz.service.impl.DayGenerateServiceImpl
;
import
com.yeejoin.amos.boot.module.hygf.biz.service.impl.DayGenerateServiceImpl
;
...
@@ -820,5 +821,29 @@ public class JpStationController extends BaseController {
...
@@ -820,5 +821,29 @@ public class JpStationController extends BaseController {
// }
// }
}
}
//查询当前登录人权限区域公司统计数据
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@ApiOperation
(
httpMethod
=
"GET"
,
value
=
"查询当前登录人权限区域公司统计数据"
,
notes
=
"查询当前登录人权限区域公司统计数据"
)
@GetMapping
(
value
=
"/getRegionStatistics"
)
// @UserLimits
public
ResponseModel
<
Page
<
PowerStationStatistics
>>
getRegionStatistics
(
@RequestParam
(
defaultValue
=
"1"
)
Integer
current
,
@RequestParam
(
defaultValue
=
"10"
)
Integer
size
,
@RequestParam
(
required
=
false
)
String
regionName
)
{
Page
<
PowerStationStatistics
>
poserStatisticsData
=
jpStationServiceImpl
.
getRegionStatistics
(
current
,
size
,
regionName
);
return
ResponseHelper
.
buildResponse
(
poserStatisticsData
);
}
//查询经销商统计数据(根据区域公司orgCode)
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@ApiOperation
(
httpMethod
=
"GET"
,
value
=
"查询经销商统计数据"
,
notes
=
"查询经销商统计数据"
)
@GetMapping
(
value
=
"/getDealerStatistics"
)
// @UserLimits
public
ResponseModel
<
Page
<
PowerStationStatistics
>>
getDealerStatistics
(
@RequestParam
(
defaultValue
=
"1"
)
Integer
current
,
@RequestParam
(
defaultValue
=
"10"
)
Integer
size
,
String
regionCompanyOrgCode
,
@RequestParam
(
required
=
false
)
String
dealerName
)
{
Page
<
PowerStationStatistics
>
poserStatisticsData
=
jpStationServiceImpl
.
getDealerStatistics
(
current
,
size
,
regionCompanyOrgCode
,
dealerName
);
return
ResponseHelper
.
buildResponse
(
poserStatisticsData
);
}
}
}
amos-boot-system-jxiop/amos-boot-module-hygf-biz/src/main/java/com/yeejoin/amos/boot/module/hygf/biz/service/impl/JpStationServiceImpl.java
View file @
a9a8dc1a
...
@@ -911,4 +911,57 @@ public class JpStationServiceImpl extends BaseService<JpStationDto,JpStation,JpS
...
@@ -911,4 +911,57 @@ public class JpStationServiceImpl extends BaseService<JpStationDto,JpStation,JpS
e
.
printStackTrace
();
e
.
printStackTrace
();
}
}
}
}
@Override
public
Page
<
PowerStationStatistics
>
getRegionStatistics
(
Integer
current
,
Integer
size
,
String
regionName
)
{
PageHelper
.
startPage
(
current
,
size
);
List
<
PowerStationStatistics
>
regionPage
=
jpStationMapper
.
getRegionPage
(
regionName
);
PageInfo
<
PowerStationStatistics
>
page
=
new
PageInfo
(
regionPage
);
Page
<
PowerStationStatistics
>
pagenew
=
new
Page
<
PowerStationStatistics
>();
List
<
PowerStationStatistics
>
resultPage
=
new
ArrayList
<>();
page
.
getList
().
stream
().
forEach
(
powerStationStatistics
->
{
PowerStationStatistics
regionStatistics
=
jpStationMapper
.
getRegionStatistics
(
powerStationStatistics
.
getCode
());
regionStatistics
.
setName
(
powerStationStatistics
.
getName
());
regionStatistics
.
setCode
(
powerStationStatistics
.
getCode
());
resultPage
.
add
(
regionStatistics
);
});
pagenew
.
setCurrent
(
current
);
pagenew
.
setTotal
(
page
.
getTotal
());
pagenew
.
setSize
(
size
);
pagenew
.
setRecords
(
resultPage
);
return
pagenew
;
}
@Override
public
Page
<
PowerStationStatistics
>
getDealerStatistics
(
Integer
current
,
Integer
size
,
String
regionCompanyOrgCode
,
String
dealerName
)
{
PageHelper
.
startPage
(
current
,
size
);
// 根据区域公司orgCode查询区域公司下所有的经销商
List
<
PowerStationStatistics
>
dealerPage
=
jpStationMapper
.
getDealerPage
(
regionCompanyOrgCode
,
dealerName
);
PageInfo
<
PowerStationStatistics
>
page
=
new
PageInfo
(
dealerPage
);
Page
<
PowerStationStatistics
>
pagenew
=
new
Page
<
PowerStationStatistics
>();
List
<
PowerStationStatistics
>
resultPage
=
new
ArrayList
<>();
page
.
getList
().
stream
().
forEach
(
powerStationStatistics
->
{
PowerStationStatistics
regionStatistics
=
jpStationMapper
.
getRegionStatistics
(
powerStationStatistics
.
getCode
());
regionStatistics
.
setName
(
powerStationStatistics
.
getName
());
regionStatistics
.
setCode
(
powerStationStatistics
.
getCode
());
resultPage
.
add
(
regionStatistics
);
});
pagenew
.
setCurrent
(
current
);
pagenew
.
setTotal
(
page
.
getTotal
());
pagenew
.
setSize
(
size
);
pagenew
.
setRecords
(
resultPage
);
return
pagenew
;
}
}
}
\ No newline at end of file
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