Commit 1633c285 authored by 朱晨阳's avatar 朱晨阳

添加经销商电站数据统计接口

parent 4867725e
......@@ -13,8 +13,8 @@ import lombok.Data;
*/
@Data
public class PowerStationStatistics {
private String regionCompanyName; // 区域公司
private String regionCompanyOrgCode; // 区域公司orgCode
private String name; // 区域公司/经销商名称
private String code; // 区域公司/经销商code
private Integer powerStationNumber; // 电站总数
private Double totalCapacity; // 装机容量
private Double totalDayGenerate; // 日发电量
......
......@@ -69,5 +69,9 @@ public interface JpStationMapper extends BaseMapper<JpStation> {
List<PowerStationStatistics> getRegionPage(String regionName);
PowerStationStatistics getRegionStatistics(String orgCode);
PowerStationStatistics getRegionStatistics(String code);
List<PowerStationStatistics> getDealerPage(String regionCompanyOrgCode, String dealerName);
}
......@@ -37,4 +37,6 @@ public interface IJpStationService {
Map<String, List<Object>> getPowerqxnew(String date, JpStationDto reviewDto);
Page<PowerStationStatistics> getRegionStatistics(Integer current, Integer size, String regionName);
Page<PowerStationStatistics> getDealerStatistics(Integer current, Integer size, String regionCompanyOrgCode, String dealerName);
}
......@@ -2,12 +2,12 @@
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.yeejoin.amos.boot.module.hygf.api.mapper.JpStationMapper">
<select id="queryForDealerReviewPage" resultType="com.yeejoin.amos.boot.module.hygf.api.dto.JpStationDto">
<select id="queryForDealerReviewPage" resultType="com.yeejoin.amos.boot.module.hygf.api.dto.JpStationDto">
select
select
`sequence_nbr` sequenceNbr,
`rec_date` recDate,
`rec_date` recDate,
`rec_user_id` recUserId,
`rec_user_name` recUserName,
`sn_code` snCode,
......@@ -52,53 +52,53 @@
from hygf_jp_station
<where>
<if test="dto.name!=null">
and hygf_jp_station.name like concat(concat("%",#{dto.name}),"%")
</if>
<if test="dto.userName!=null">
and hygf_jp_station.user_name like concat(concat("%",#{dto.userName}),"%")
</if>
<if test="dto.address!=null">
and hygf_jp_station.address like concat(concat("%",#{dto.address}),"%")
</if>
<if test="dto.area!=null">
and hygf_jp_station.area like concat(concat("%",#{dto.area}),"%")
</if>
<if test="dto.statioId!=null">
and hygf_jp_station.third_station_id in
<foreach collection="dto.statioId" item="item" index="index" open="(" separator="," close=")">
#{item.stationId}
</foreach>
</if>
<if test="dto.thirdStationIds!=null">
and hygf_jp_station.third_station_id in
<foreach collection="dto.thirdStationIds" item="item" index="index" open="(" separator="," close=")">
#{item}
</foreach>
</if>
<if test="dto.thirdStationId!=null">
and hygf_jp_station.third_station_id =#{dto.thirdStationId}
</if>
</where>
<where>
<if test="dto.name!=null">
and hygf_jp_station.name like concat(concat("%",#{dto.name}),"%")
</if>
<if test="dto.userName!=null">
and hygf_jp_station.user_name like concat(concat("%",#{dto.userName}),"%")
</if>
<if test="dto.address!=null">
and hygf_jp_station.address like concat(concat("%",#{dto.address}),"%")
</if>
<if test="dto.area!=null">
and hygf_jp_station.area like concat(concat("%",#{dto.area}),"%")
</if>
<if test="dto.statioId!=null">
and hygf_jp_station.third_station_id in
<foreach collection="dto.statioId" item="item" index="index" open="(" separator="," close=")">
#{item.stationId}
</foreach>
</if>
<if test="dto.thirdStationIds!=null">
and hygf_jp_station.third_station_id in
<foreach collection="dto.thirdStationIds" item="item" index="index" open="(" separator="," close=")">
#{item}
</foreach>
</if>
<if test="dto.thirdStationId!=null">
and hygf_jp_station.third_station_id =#{dto.thirdStationId}
</if>
</where>
</select>
<select id="queryCount" resultType="com.yeejoin.amos.boot.module.hygf.api.dto.JpStationDto">
<select id="queryCount" resultType="com.yeejoin.amos.boot.module.hygf.api.dto.JpStationDto">
select
ROUND(sum(real_time_power),3) realTimePower,
ROUND(sum(capacity)/1000,3) capacity,
ROUND(sum(day_generate)/1000,3) dayGenerate,
ROUND(sum(month_generate)/1000,3) monthGenerate,
ROUND(sum(month_generate)/1000,3) monthGenerate,
ROUND(sum(year_generate)/1000,3) yearGenerate,
ROUND(sum(accumulated_power)/1000,3) accumulatedPower,
ROUND( sum(day_income),3) dayIncome,
ROUND(sum(month_income)/10000,3) monthIncome,
ROUND(sum(year_income)/10000,3) yearIncome,
ROUND(sum(cumulative_income)/10000,3) cumulativeIncome,
ROUND(sum(cumulative_income)/10000,3) cumulativeIncome,
ROUND(sum(day_power_use)/1000,3) dayPowerUse,
ROUND(sum(month_power_use)/1000,3) monthPowerUse,
ROUND(sum(year_power_use)/1000,3) yearPowerUse,
......@@ -125,7 +125,7 @@
</select>
<select id="countState" resultType="map">
<select id="countState" resultType="map">
select
......@@ -151,19 +151,19 @@
#{item.stationId}
</foreach>
</if>
and hygf_jp_station.`state` is not null and hygf_jp_station.`state` in ("在线","报警","离线")
and hygf_jp_station.`state` is not null and hygf_jp_station.`state` in ("在线","报警","离线")
GROUP BY state
GROUP BY state
</where>
</select>
<select id="getJpStation" resultType="com.yeejoin.amos.boot.module.hygf.api.entity.JpStation">
<select id="getJpStation" resultType="com.yeejoin.amos.boot.module.hygf.api.entity.JpStation">
select
*
from hygf_jp_station
<where>
<where>
is_delete=0
<if test="dto.name!=null">
and hygf_jp_station.name like concat(concat("%",#{dto.name}),"%")
......@@ -193,13 +193,13 @@
and hygf_jp_station.amos_company_code =#{dto.amosCompanyCode}
</if>
<if test="dto.state!=null">
and hygf_jp_station.`state` =#{dto.state}
and hygf_jp_station.`state` =#{dto.state}
</if>
</where>
</select>
<select id="getJpStationList" resultType="com.yeejoin.amos.boot.module.hygf.api.entity.JpStation">
<select id="getJpStationList" resultType="com.yeejoin.amos.boot.module.hygf.api.entity.JpStation">
select
*
from hygf_jp_station
......@@ -234,39 +234,43 @@
and hygf_jp_station.amos_company_code =#{dto.amosCompanyCode}
</if>
<if test="dto.state!=null">
and hygf_jp_station.`state` =#{dto.state}
and hygf_jp_station.`state` =#{dto.state}
</if>
</where>
</select>
<select id="getRegion" resultType="com.yeejoin.amos.boot.module.hygf.api.dto.DropDown">
SELECT privilege_company.ORG_CODE orgCode ,
privilege_company.COMPANY_NAME name
FROM privilege_company
WHERE IS_DELETED=0 and privilege_company.COMPANY_TYPE = 'region'
<select id="getRegion" resultType="com.yeejoin.amos.boot.module.hygf.api.dto.DropDown">
SELECT privilege_company.ORG_CODE orgCode,
privilege_company.COMPANY_NAME name
FROM privilege_company
WHERE IS_DELETED = 0
and privilege_company.COMPANY_TYPE = 'region'
</select>
<select id="getRegionAll" resultType="com.yeejoin.amos.boot.module.hygf.api.dto.DropDown">
SELECT privilege_company.ORG_CODE orgCode ,
privilege_company.COMPANY_NAME name
FROM privilege_company
WHERE IS_DELETED=0 and privilege_company.COMPANY_TYPE = 'region'
<select id="getRegionAll" resultType="com.yeejoin.amos.boot.module.hygf.api.dto.DropDown">
SELECT privilege_company.ORG_CODE orgCode,
privilege_company.COMPANY_NAME name
FROM privilege_company
WHERE IS_DELETED = 0
and privilege_company.COMPANY_TYPE = 'region'
</select>
<select id="getDealer" resultType="com.yeejoin.amos.boot.module.hygf.api.dto.DropDown">
SELECT hygf_unit_info.`name`, hygf_unit_info.amos_company_code orgCode FROM hygf_regional_companies LEFT JOIN hygf_unit_info
ON hygf_unit_info.sequence_nbr=hygf_regional_companies.unit_info_id WHERE hygf_unit_info.audit_status='2'
AND hygf_unit_info.blacklist='0' AND hygf_unit_info.is_delete='0'
<select id="getDealer" resultType="com.yeejoin.amos.boot.module.hygf.api.dto.DropDown">
SELECT hygf_unit_info.`name`, hygf_unit_info.amos_company_code orgCode FROM hygf_regional_companies LEFT JOIN
hygf_unit_info
ON hygf_unit_info.sequence_nbr=hygf_regional_companies.unit_info_id WHERE hygf_unit_info.audit_status='2'
AND hygf_unit_info.blacklist='0' AND hygf_unit_info.is_delete='0'
<if test="regionalCompaniesCode!=null">
and hygf_regional_companies.regional_companies_code =#{regionalCompaniesCode}
and hygf_regional_companies.regional_companies_code =#{regionalCompaniesCode}
</if>
and hygf_unit_info.amos_company_code is not null
GROUP BY hygf_unit_info.amos_company_code,hygf_unit_info.`name`
and hygf_unit_info.amos_company_code is not null
GROUP BY hygf_unit_info.amos_company_code,hygf_unit_info.`name`
</select>
<select id="getDealerAll" resultType="com.yeejoin.amos.boot.module.hygf.api.dto.DropDown">
SELECT hygf_unit_info.`name`, hygf_unit_info.amos_company_code orgCode FROM hygf_regional_companies LEFT JOIN hygf_unit_info
ON hygf_unit_info.sequence_nbr=hygf_regional_companies.unit_info_id WHERE hygf_unit_info.audit_status='2'
<select id="getDealerAll" resultType="com.yeejoin.amos.boot.module.hygf.api.dto.DropDown">
SELECT hygf_unit_info.`name`, hygf_unit_info.amos_company_code orgCode FROM hygf_regional_companies LEFT JOIN
hygf_unit_info
ON hygf_unit_info.sequence_nbr=hygf_regional_companies.unit_info_id WHERE hygf_unit_info.audit_status='2'
AND hygf_unit_info.blacklist='0' AND hygf_unit_info.is_delete='0'
<if test="regionalCompaniesCode!=null">
and hygf_regional_companies.regional_companies_code =#{regionalCompaniesCode}
......@@ -275,11 +279,11 @@
GROUP BY hygf_unit_info.amos_company_code,hygf_unit_info.`name`
</select>
<select id="getDealerNew" resultType="com.yeejoin.amos.boot.module.hygf.api.dto.DropDown">
SELECT hygf_unit_info.`name`, hygf_unit_info.sequence_nbr orgCode
<select id="getDealerNew" resultType="com.yeejoin.amos.boot.module.hygf.api.dto.DropDown">
SELECT hygf_unit_info.`name`, hygf_unit_info.sequence_nbr orgCode
FROM hygf_regional_companies LEFT JOIN hygf_unit_info
ON hygf_unit_info.sequence_nbr=hygf_regional_companies.unit_info_id WHERE hygf_unit_info.audit_status='2'
ON hygf_unit_info.sequence_nbr=hygf_regional_companies.unit_info_id WHERE hygf_unit_info.audit_status='2'
AND hygf_unit_info.blacklist='0' AND hygf_unit_info.is_delete='0'
<if test="regionalCompaniesSeq!=null">
and hygf_regional_companies.regional_companies_seq =#{regionalCompaniesSeq}
......@@ -289,22 +293,20 @@
</select>
<select id="getCountJpStationdata" resultType="com.yeejoin.amos.boot.module.hygf.api.dto.JpStationDto">
<select id="getCountJpStationdata" resultType="com.yeejoin.amos.boot.module.hygf.api.dto.JpStationDto">
select
ROUND(sum(real_time_power),3) realTimePower,
ROUND(sum(capacity)/1000,3) capacity,
ROUND(sum(day_generate)/1000,3) dayGenerate,
ROUND(sum(month_generate)/1000,3) monthGenerate,
ROUND(sum(month_generate)/1000,3) monthGenerate,
ROUND(sum(year_generate)/1000,3) yearGenerate,
ROUND(sum(accumulated_power)/1000,3) accumulatedPower,
ROUND( sum(day_income),3) dayIncome,
ROUND(sum(month_income)/10000,3) monthIncome,
ROUND(sum(year_income)/10000,3) yearIncome,
ROUND(sum(cumulative_income)/10000,3) cumulativeIncome,
ROUND(sum(cumulative_income)/10000,3) cumulativeIncome,
ROUND(sum(day_power_use)/1000,3) dayPowerUse,
ROUND(sum(month_power_use)/1000,3) monthPowerUse,
ROUND(sum(year_power_use)/1000,3) yearPowerUse,
......@@ -337,7 +339,7 @@
</select>
<select id="getcountState" resultType="map">
<select id="getcountState" resultType="map">
select
......@@ -372,13 +374,13 @@
<if test="dto.amosCompanyCode!=null">
and hygf_jp_station.amos_company_code =#{dto.amosCompanyCode}
</if>
and hygf_jp_station.`state` is not null and hygf_jp_station.`state` in ("在线","报警","离线")
and hygf_jp_station.`state` is not null and hygf_jp_station.`state` in ("在线","报警","离线")
GROUP BY state
GROUP BY state
</where>
</select>
<select id="getcountStatetc" resultType="map">
<select id="getcountStatetc" resultType="map">
select
......@@ -416,7 +418,7 @@
</where>
</select>
<select id="getcountStatejs" resultType="map">
<select id="getcountStatejs" resultType="map">
select
......@@ -455,7 +457,7 @@
</select>
<select id="getcountStatejr" resultType="map">
<select id="getcountStatejr" resultType="map">
select
......@@ -494,49 +496,49 @@
</select>
<select id="getcount" resultType="map">
<select id="getcount" resultType="map">
select
count(*) num
from hygf_jp_station
<where>
<if test="dto.name!=null">
and hygf_jp_station.name like concat(concat("%",#{dto.name}),"%")
</if>
<if test="dto.userName!=null">
and hygf_jp_station.user_name like concat(concat("%",#{dto.userName}),"%")
</if>
<if test="dto.address!=null">
and hygf_jp_station.address like concat(concat("%",#{dto.address}),"%")
</if>
<if test="dto.area!=null">
and hygf_jp_station.area like concat(concat("%",#{dto.area}),"%")
</if>
<if test="dto.statioId!=null">
and hygf_jp_station.third_station_id in
<foreach collection="dto.statioId" item="item" index="index" open="(" separator="," close=")">
#{item.stationId}
</foreach>
</if>
<if test="dto.thirdStationId!=null">
and hygf_jp_station.third_station_id =#{dto.thirdStationId}
</if>
<if test="dto.regionalCompaniesCode!=null">
and hygf_jp_station.regional_companies_code =#{dto.regionalCompaniesCode}
</if>
<if test="dto.amosCompanyCode!=null">
and hygf_jp_station.amos_company_code =#{dto.amosCompanyCode}
</if>
select
count(*) num
from hygf_jp_station
<where>
<if test="dto.name!=null">
and hygf_jp_station.name like concat(concat("%",#{dto.name}),"%")
</if>
<if test="dto.userName!=null">
and hygf_jp_station.user_name like concat(concat("%",#{dto.userName}),"%")
</if>
<if test="dto.address!=null">
and hygf_jp_station.address like concat(concat("%",#{dto.address}),"%")
</if>
<if test="dto.area!=null">
and hygf_jp_station.area like concat(concat("%",#{dto.area}),"%")
</if>
<if test="dto.statioId!=null">
and hygf_jp_station.third_station_id in
<foreach collection="dto.statioId" item="item" index="index" open="(" separator="," close=")">
#{item.stationId}
</foreach>
</if>
<if test="dto.thirdStationId!=null">
and hygf_jp_station.third_station_id =#{dto.thirdStationId}
</if>
<if test="dto.regionalCompaniesCode!=null">
and hygf_jp_station.regional_companies_code =#{dto.regionalCompaniesCode}
</if>
<if test="dto.amosCompanyCode!=null">
and hygf_jp_station.amos_company_code =#{dto.amosCompanyCode}
</if>
</where>
</where>
</select>
<select id="queryForDealerReviewPagenew" resultType="com.yeejoin.amos.boot.module.hygf.api.dto.JpStationDto">
<select id="queryForDealerReviewPagenew" resultType="com.yeejoin.amos.boot.module.hygf.api.dto.JpStationDto">
select
`sequence_nbr` sequenceNbr,
`rec_date` recDate,
`rec_date` recDate,
`rec_user_id` recUserId,
`rec_user_name` recUserName,
`sn_code` snCode,
......@@ -570,7 +572,7 @@
`is_delete` isDelete,
ROUND(`day_generate`,3) dayGenerate,
ROUND(`month_generate`,3) monthGenerate,
ROUND(`year_generate`,3) yearGenerate,
ROUND(`year_generate`,3) yearGenerate,
`day_income` dayIncome,
`month_income` monthIncome,
`year_income` yearIncome,
......@@ -579,7 +581,8 @@
`email`,
rated_power ratedPower,
ROUND(`day_generate`/capacity,3) fullhour,
(select privilege_company.COMPANY_NAME from privilege_company where privilege_company.ORG_CODE=hygf_jp_station.regional_companies_code) regionalCompaniesName
(select privilege_company.COMPANY_NAME from privilege_company where
privilege_company.ORG_CODE=hygf_jp_station.regional_companies_code) regionalCompaniesName
from hygf_jp_station
<where>
<if test="dto.name!=null">
......@@ -617,9 +620,12 @@
</select>
<select id="getRegionPage" resultType="com.yeejoin.amos.boot.module.hygf.api.dto.PowerStationStatistics">
SELECT privilege_company.ORG_CODE regionCompanyOrgCode ,
privilege_company.COMPANY_NAME regionCompanyName
<!-- ========电站监控区域=======-->
<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'
......@@ -629,13 +635,32 @@
</where>
</select>
<select id="getRegionStatistics" resultType="com.yeejoin.amos.boot.module.hygf.api.dto.PowerStationStatistics">
<!-- 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 = #{orgCode}
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>
......@@ -181,8 +181,7 @@ public class JpStationController extends BaseController {
@TycloudOperation(ApiLevel = UserType.AGENCY)
@GetMapping(value = "/queryPage")
@ApiOperation(httpMethod = "GET", value = "场站列表", notes = "场站列表")
public ResponseModel<Page<JpStationDto>> queryForDealerReviewPage(@RequestParam(value = "current") int current, @RequestParam
(value = "size") int size, JpStationDto reviewDto) {
public ResponseModel<Page<JpStationDto>> queryForDealerReviewPage(@RequestParam(value = "current") int current, @RequestParam(value = "size") int size, JpStationDto reviewDto) {
List<JpPersonStation> pPersonStation = null;
if (reviewDto.getName() != null && !"".equals(reviewDto.getName())) {
......@@ -731,8 +730,7 @@ public class JpStationController extends BaseController {
@GetMapping(value = "/queryPagenew")
@ApiOperation(httpMethod = "GET", value = "场站列表", notes = "场站列表")
@UserLimits
public ResponseModel<Page<JpStationDto>> queryPagenew(@RequestParam(value = "current") int current, @RequestParam
(value = "size") int size, JpStationDto reviewDto) {
public ResponseModel<Page<JpStationDto>> queryPagenew(@RequestParam(value = "current") int current, @RequestParam(value = "size") int size, JpStationDto reviewDto) {
Page<JpStationDto> page = jpStationServiceImpl.queryForJpStationPagenew(current, size, reviewDto);
return ResponseHelper.buildResponse(page);
}
......@@ -740,8 +738,7 @@ public class JpStationController extends BaseController {
@TycloudOperation(ApiLevel = UserType.AGENCY)
@PostMapping(value = "/queryReport")
@ApiOperation(httpMethod = "POST", value = "场站报表", notes = "场站报表")
public ResponseModel<Page<JpStationDto>> queryReport(@RequestParam(value = "current") int current, @RequestParam
(value = "size") int size, @RequestBody JpStationDto reviewDto, @RequestParam(value = "type") String type) {
public ResponseModel<Page<JpStationDto>> queryReport(@RequestParam(value = "current") int current, @RequestParam(value = "size") int size, @RequestBody JpStationDto reviewDto, @RequestParam(value = "type") String type) {
Page<JpStationDto> page = jpStationServiceImpl.queryReport(current, size, reviewDto, type);
......@@ -792,10 +789,22 @@ public class JpStationController extends BaseController {
@ApiOperation(httpMethod = "GET", value = "查询当前登录人权限区域公司统计数据", notes = "查询当前登录人权限区域公司统计数据")
@GetMapping(value = "/getRegionStatistics")
// @UserLimits
public ResponseModel<Page<PowerStationStatistics>> getRegionStatistics(@RequestParam(defaultValue = "1") Integer current, @RequestParam(defaultValue = "10") Integer size, String regionName) {
public ResponseModel<Page<PowerStationStatistics>> getRegionStatistics(@RequestParam(defaultValue = "1") Integer current, @RequestParam(defaultValue = "10") Integer size, @RequestParam(required = false) String regionName) {
Page<PowerStationStatistics> regionStatisticsData = jpStationServiceImpl.getRegionStatistics(current, size, regionName);
Page<PowerStationStatistics> poserStatisticsData = jpStationServiceImpl.getRegionStatistics(current, size, regionName);
return ResponseHelper.buildResponse(regionStatisticsData);
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);
}
}
......@@ -757,9 +757,9 @@ public class JpStationServiceImpl extends BaseService<JpStationDto, JpStation, J
List<PowerStationStatistics> resultPage = new ArrayList<>();
page.getList().stream().forEach(powerStationStatistics -> {
PowerStationStatistics regionStatistics = jpStationMapper.getRegionStatistics(powerStationStatistics.getRegionCompanyOrgCode());
regionStatistics.setRegionCompanyName(powerStationStatistics.getRegionCompanyName());
regionStatistics.setRegionCompanyOrgCode(powerStationStatistics.getRegionCompanyOrgCode());
PowerStationStatistics regionStatistics = jpStationMapper.getRegionStatistics(powerStationStatistics.getCode());
regionStatistics.setName(powerStationStatistics.getName());
regionStatistics.setCode(powerStationStatistics.getCode());
resultPage.add(regionStatistics);
});
......@@ -772,4 +772,30 @@ public class JpStationServiceImpl extends BaseService<JpStationDto, JpStation, J
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
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment