Commit 612187c7 authored by chenzhao's avatar chenzhao

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

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