Commit 612187c7 authored by chenzhao's avatar chenzhao

电站整体发电历史及功率曲线增加每日

parent 85a121f7
package com.yeejoin.amos.boot.module.hygf.api.tdenginemapper; package com.yeejoin.amos.boot.module.hygf.api.tdenginemapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper; import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.yeejoin.amos.boot.module.hygf.api.config.UserEmpower;
import com.yeejoin.amos.boot.module.hygf.api.dto.PowerCurveDto; import com.yeejoin.amos.boot.module.hygf.api.dto.PowerCurveDto;
import com.yeejoin.amos.boot.module.hygf.api.entity.AllPower; import com.yeejoin.amos.boot.module.hygf.api.entity.AllPower;
import com.yeejoin.amos.boot.module.hygf.api.entity.MonthPower; import com.yeejoin.amos.boot.module.hygf.api.entity.MonthPower;
...@@ -30,7 +31,7 @@ public interface MonthPowerMapper extends BaseMapper<MonthPower> { ...@@ -30,7 +31,7 @@ public interface MonthPowerMapper extends BaseMapper<MonthPower> {
List<PowerCurveDto> getYearPower(@Param("date") String month,@Param("dto")List<String> statioId); List<PowerCurveDto> getYearPower(@Param("date") String month,@Param("dto")List<String> statioId);
List<PowerCurveDto> getAllPower(@Param("date") String month,@Param("dto")List<String> statioId); List<PowerCurveDto> getAllPower(@Param("date") String month,@Param("dto")List<String> statioId);
@UserEmpower(field = {"regional_companies_code"}, dealerField = {"amos_company_code", "regional_companies_code"}, fieldConditions = {"eq", "in"}, relationship = "and")
List<PowerCurveDto> getDayPowercount(@Param("date") String month,@Param("dto")List<String> statioId,@Param("thirdStationId") String thirdStationId); List<PowerCurveDto> getDayPowercount(@Param("date") String month,@Param("regionalCompaniesCode") String regionalCompaniesCode, @Param("amosCompanyCode") String amosCompanyCode,@Param("dto")List<String> statioId,@Param("thirdStationId") String thirdStationId);
} }
...@@ -90,12 +90,17 @@ ...@@ -90,12 +90,17 @@
<if test="thirdStationId!=null and thirdStationId != ''"> <if test="thirdStationId!=null and thirdStationId != ''">
and third_station_id = #{thirdStationId} and third_station_id = #{thirdStationId}
</if> </if>
<if test="regionalCompaniesCode!=null and regionalCompaniesCode != ''">
and regional_companies_code = #{regionalCompaniesCode}
</if>
<if test="amosCompanyCode!=null and amosCompanyCode != ''">
and amos_company_code = #{amosCompanyCode}
</if>
<if test="date!=null and date != ''">
and year_month_day = #{date}
</if>
</where> </where>
and year_month_day = #{date}
GROUP BY `hour` GROUP BY `hour`
</select> </select>
......
...@@ -383,6 +383,7 @@ public class JpStationController extends BaseController { ...@@ -383,6 +383,7 @@ public class JpStationController extends BaseController {
@TycloudOperation(needAuth = false, ApiLevel = UserType.AGENCY) @TycloudOperation(needAuth = false, ApiLevel = UserType.AGENCY)
@ApiOperation(httpMethod = "GET", value = "工率曲线", notes = "电站监控电量收益") @ApiOperation(httpMethod = "GET", value = "工率曲线", notes = "电站监控电量收益")
@GetMapping(value = "/getPowerqx") @GetMapping(value = "/getPowerqx")
@UserLimits
public ResponseModel<Map<String, List<Object>>> getPowerqx(JpStationDto reviewDto, String date, String type) { public ResponseModel<Map<String, List<Object>>> getPowerqx(JpStationDto reviewDto, String date, String type) {
//获取当前人管理场站 //获取当前人管理场站
List<String> data = new ArrayList(); List<String> data = new ArrayList();
...@@ -795,6 +796,7 @@ public class JpStationController extends BaseController { ...@@ -795,6 +796,7 @@ public class JpStationController extends BaseController {
@TycloudOperation(needAuth = false, ApiLevel = UserType.AGENCY) @TycloudOperation(needAuth = false, ApiLevel = UserType.AGENCY)
@ApiOperation(httpMethod = "GET", value = "发电量曲线", notes = "发电量曲线") @ApiOperation(httpMethod = "GET", value = "发电量曲线", notes = "发电量曲线")
@GetMapping(value = "/getGenerateqx") @GetMapping(value = "/getGenerateqx")
@UserLimits
public ResponseModel<Map<String, List<Object>>> getGenerateqx(JpStationDto reviewDto, String date, String type) { public ResponseModel<Map<String, List<Object>>> getGenerateqx(JpStationDto reviewDto, String date, String type) {
Map<String, List<Object>> map = jpStationServiceImpl.getGenerateqx(date, type, reviewDto); Map<String, List<Object>> map = jpStationServiceImpl.getGenerateqx(date, type, reviewDto);
...@@ -806,6 +808,7 @@ public class JpStationController extends BaseController { ...@@ -806,6 +808,7 @@ public class JpStationController extends BaseController {
@TycloudOperation(ApiLevel = UserType.AGENCY) @TycloudOperation(ApiLevel = UserType.AGENCY)
@ApiOperation(httpMethod = "GET", value = "工率曲线", notes = "电站监控电量收益") @ApiOperation(httpMethod = "GET", value = "工率曲线", notes = "电站监控电量收益")
@GetMapping(value = "/getPowerqxnew") @GetMapping(value = "/getPowerqxnew")
@UserLimits
public ResponseModel<Map<String, List<Object>>> getPowerqxnew(JpStationDto reviewDto, String date) { public ResponseModel<Map<String, List<Object>>> getPowerqxnew(JpStationDto reviewDto, String date) {
Map<String, List<Object>> map = jpStationServiceImpl.getPowerqxnew(date, reviewDto); Map<String, List<Object>> map = jpStationServiceImpl.getPowerqxnew(date, reviewDto);
......
...@@ -33,6 +33,7 @@ import org.typroject.tyboot.core.rdbms.service.BaseService; ...@@ -33,6 +33,7 @@ import org.typroject.tyboot.core.rdbms.service.BaseService;
import org.typroject.tyboot.core.restful.exception.instance.BadRequest; import org.typroject.tyboot.core.restful.exception.instance.BadRequest;
import java.nio.charset.StandardCharsets; import java.nio.charset.StandardCharsets;
import java.time.format.DateTimeFormatter;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.Date; import java.util.Date;
import java.util.HashMap; import java.util.HashMap;
......
...@@ -122,7 +122,7 @@ public class JpStationServiceImpl extends BaseService<JpStationDto, JpStation, J ...@@ -122,7 +122,7 @@ public class JpStationServiceImpl extends BaseService<JpStationDto, JpStation, J
if(type.equals("day")){ if(type.equals("day")){
map= gethourList(); map= gethourList();
data =monthPowerMapper.getDayPowercount(date, statioId,null); data =monthPowerMapper.getDayPowercount(date,null,null, statioId,null);
}else if(type.equals("month")){ }else if(type.equals("month")){
map= getDayListOfMonth(date); map= getDayListOfMonth(date);
data=monthPowerMapper.getMonthPower(date, statioId); data=monthPowerMapper.getMonthPower(date, statioId);
...@@ -242,8 +242,12 @@ public class JpStationServiceImpl extends BaseService<JpStationDto, JpStation, J ...@@ -242,8 +242,12 @@ public class JpStationServiceImpl extends BaseService<JpStationDto, JpStation, J
Map<String, List<Object>> map = new HashMap<>(); Map<String, List<Object>> map = new HashMap<>();
Map<String, List<Object>> map1 = new HashMap<>(); Map<String, List<Object>> map1 = new HashMap<>();
try { try {
if(type.equals("day")){
if(type.equals("month")){ map= gethourList();
listx =map.get("x");
data =monthPowerMapper.getDayPowercount(date,reviewDto.getRegionalCompaniesCode(), reviewDto.getAmosCompanyCode(), null,reviewDto.getThirdStationId());
// }
}else if(type.equals("month")){
map= getDayListOfMonth(reviewDto.getTimeDateMonth()); map= getDayListOfMonth(reviewDto.getTimeDateMonth());
// if(statioId!=null&&!statioId.isEmpty()) { // if(statioId!=null&&!statioId.isEmpty()) {
...@@ -291,7 +295,9 @@ public class JpStationServiceImpl extends BaseService<JpStationDto, JpStation, J ...@@ -291,7 +295,9 @@ public class JpStationServiceImpl extends BaseService<JpStationDto, JpStation, J
@Override @Override
@UserLimits @UserLimits
public Map<String, List<Object>> getPowerqxnew(String date,JpStationDto reviewDto) { public Map<String, List<Object>> getPowerqxnew(String date,JpStationDto reviewDto) {
if (StringUtils.isEmpty(date)){
date = DateUtil.format(new Date(), "yyyy-MM-dd"); date = DateUtil.format(new Date(), "yyyy-MM-dd");
}
// List<String> statioId=new ArrayList(); // List<String> statioId=new ArrayList();
// List<JpStation> dataJpStation= jpStationMapper.getJpStation(reviewDto); // List<JpStation> dataJpStation= jpStationMapper.getJpStation(reviewDto);
// for (JpStation jpStation : dataJpStation) { // for (JpStation jpStation : dataJpStation) {
...@@ -302,7 +308,7 @@ public class JpStationServiceImpl extends BaseService<JpStationDto, JpStation, J ...@@ -302,7 +308,7 @@ public class JpStationServiceImpl extends BaseService<JpStationDto, JpStation, J
List<Object> listy =new ArrayList<>(); List<Object> listy =new ArrayList<>();
Map<String, List<Object>> map =new HashMap<>(); Map<String, List<Object>> map =new HashMap<>();
map= gethourList(); map= gethourList();
data =monthPowerMapper.getDayPowercount(date, null,reviewDto.getThirdStationId()); data =monthPowerMapper.getDayPowercount(date,null,null, null,reviewDto.getThirdStationId());
listx =map.get("x"); listx =map.get("x");
listy =map.get("y"); listy =map.get("y");
if(data!=null&&!data.isEmpty()){ if(data!=null&&!data.isEmpty()){
......
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