Commit 381a66ca authored by tangwei's avatar tangwei

解决冲突

parents a46f6c93 5d2a94e0
...@@ -63,4 +63,9 @@ public class JpCollectorDto extends BaseDto { ...@@ -63,4 +63,9 @@ public class JpCollectorDto extends BaseDto {
@ApiModelProperty(value = "第三方厂商标识") @ApiModelProperty(value = "第三方厂商标识")
private String thirdCode; private String thirdCode;
@ApiModelProperty(value = "所属电站")
private String stationName;
@ApiModelProperty(value = "电站地址")
private String addr;
} }
...@@ -91,4 +91,7 @@ public class JpInverterDto extends BaseDto { ...@@ -91,4 +91,7 @@ public class JpInverterDto extends BaseDto {
@ApiModelProperty(value = "累计发电量") @ApiModelProperty(value = "累计发电量")
private Double totalPowerGeneration; private Double totalPowerGeneration;
@ApiModelProperty(value = "所属电站")
private String stationName;
} }
...@@ -14,12 +14,11 @@ import java.util.Date; ...@@ -14,12 +14,11 @@ import java.util.Date;
* @date 2023-09-19 * @date 2023-09-19
*/ */
@Data @Data
@ApiModel(value="TdHygfJpCollectorHistoryDto", description="户用光伏监盘采集器历史表") @ApiModel(value = "TdHygfJpCollectorHistoryDto", description = "户用光伏监盘采集器历史表")
public class TdHygfJpCollectorHistoryDto { public class TdHygfJpCollectorHistoryDto {
private static final long serialVersionUID = 1L; private static final long serialVersionUID = 1L;
@ApiModelProperty(value = "sn编码") @ApiModelProperty(value = "sn编码")
private String snCode; private String snCode;
...@@ -35,4 +34,6 @@ public class TdHygfJpCollectorHistoryDto { ...@@ -35,4 +34,6 @@ public class TdHygfJpCollectorHistoryDto {
@ApiModelProperty(value = "第三方厂商标识") @ApiModelProperty(value = "第三方厂商标识")
private String thirdCode; private String thirdCode;
private String timeFormat;
} }
...@@ -15,12 +15,11 @@ import java.util.Date; ...@@ -15,12 +15,11 @@ import java.util.Date;
* @date 2023-09-19 * @date 2023-09-19
*/ */
@Data @Data
@ApiModel(value="TdHygfJpInvertorElecHistoryDto", description="户用光伏监盘逆变器电能历史表") @ApiModel(value = "TdHygfJpInvertorElecHistoryDto", description = "户用光伏监盘逆变器电能历史表")
public class TdHygfJpInvertorElecHistoryDto { public class TdHygfJpInvertorElecHistoryDto {
private static final long serialVersionUID = 1L; private static final long serialVersionUID = 1L;
@ApiModelProperty(value = "sn编码") @ApiModelProperty(value = "sn编码")
private String snCode; private String snCode;
...@@ -53,4 +52,6 @@ public class TdHygfJpInvertorElecHistoryDto { ...@@ -53,4 +52,6 @@ public class TdHygfJpInvertorElecHistoryDto {
private Long createdTime; private Long createdTime;
private String timeFormat;
} }
...@@ -106,4 +106,16 @@ public class JpCollector extends BaseEntity { ...@@ -106,4 +106,16 @@ public class JpCollector extends BaseEntity {
@TableField("third_code") @TableField("third_code")
private String thirdCode; private String thirdCode;
/**
* 所属电站
*/
@TableField("station_name")
private String stationName;
/**
* 电站地址
*/
@TableField("addr")
private String addr;
} }
...@@ -160,4 +160,16 @@ public class JpInverter extends BaseEntity { ...@@ -160,4 +160,16 @@ public class JpInverter extends BaseEntity {
@TableField("total_power_generation") @TableField("total_power_generation")
private Double totalPowerGeneration; private Double totalPowerGeneration;
/**
* 所属电站
*/
@TableField("station_name")
private String stationName;
/**
* 电站地址
*/
@TableField("addr")
private String addr;
} }
...@@ -30,6 +30,11 @@ public class TimeUtil { ...@@ -30,6 +30,11 @@ public class TimeUtil {
return dateFormat.format(new Date(time)); return dateFormat.format(new Date(time));
} }
public static String minuteFormat(Long time) {
SimpleDateFormat dateFormat = new SimpleDateFormat("HH:mm");
return dateFormat.format(new Date(time));
}
public static String longFormat(Long time) { public static String longFormat(Long time) {
if (time < 1000) { if (time < 1000) {
return "0" + "秒"; return "0" + "秒";
......
...@@ -2,6 +2,7 @@ package com.yeejoin.amos.boot.module.hygf.biz.service.impl; ...@@ -2,6 +2,7 @@ package com.yeejoin.amos.boot.module.hygf.biz.service.impl;
import java.util.List; import java.util.List;
import org.apache.commons.lang3.StringUtils;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import org.typroject.tyboot.core.foundation.utils.Bean; import org.typroject.tyboot.core.foundation.utils.Bean;
import org.typroject.tyboot.core.foundation.utils.ValidationUtil; import org.typroject.tyboot.core.foundation.utils.ValidationUtil;
...@@ -32,6 +33,10 @@ public class JpInverterServiceImpl extends BaseService<JpInverterDto, JpInverter ...@@ -32,6 +33,10 @@ public class JpInverterServiceImpl extends BaseService<JpInverterDto, JpInverter
if (jpInverterDto.getState() != null) { if (jpInverterDto.getState() != null) {
wrapper.eq(JpInverter::getState, jpInverterDto.getState()); wrapper.eq(JpInverter::getState, jpInverterDto.getState());
} }
if(StringUtils.isNotEmpty(jpInverterDto.getSnCode())) {
wrapper.likeRight(JpInverter::getSnCode, jpInverterDto.getSnCode());
}
wrapper.orderByDesc(JpInverter::getUpdateTime);
entiryPage = (Page<JpInverter>) this.page(entiryPage, wrapper); entiryPage = (Page<JpInverter>) this.page(entiryPage, wrapper);
if (!ValidationUtil.isEmpty(entiryPage.getRecords())) { if (!ValidationUtil.isEmpty(entiryPage.getRecords())) {
page.setTotal(entiryPage.getTotal()); page.setTotal(entiryPage.getTotal());
......
...@@ -54,8 +54,14 @@ public class TdHygfJpCollectorHistoryServiceImpl ...@@ -54,8 +54,14 @@ public class TdHygfJpCollectorHistoryServiceImpl
JpCollector collector = jpCollectorServiceImpl.getById(id); JpCollector collector = jpCollectorServiceImpl.getById(id);
if (collector != null) { if (collector != null) {
return this.baseMapper.dayList(collector.getSnCode(), collector.getThirdStationId(), List<TdHygfJpCollectorHistoryDto> list = this.baseMapper.dayList(collector.getSnCode(),
TimeUtil.getStartTimeOfDay(day), TimeUtil.getEndTimeOfDay(day)); collector.getThirdStationId(), TimeUtil.getStartTimeOfDay(day), TimeUtil.getEndTimeOfDay(day));
if (!list.isEmpty()) {
list.forEach(i -> {
i.setTimeFormat(TimeUtil.minuteFormat(i.getTime()));
});
}
return list;
} }
return new ArrayList<>(); return new ArrayList<>();
} }
......
...@@ -53,6 +53,20 @@ public class TdHygfJpInverterWarnServiceImpl ...@@ -53,6 +53,20 @@ public class TdHygfJpInverterWarnServiceImpl
tdHygfJpInverterWarnDto.setStates(Arrays.asList(s)); tdHygfJpInverterWarnDto.setStates(Arrays.asList(s));
} }
List<TdHygfJpInverterWarnDto> list = this.baseMapper.list(tdHygfJpInverterWarnDto); List<TdHygfJpInverterWarnDto> list = this.baseMapper.list(tdHygfJpInverterWarnDto);
if (!list.isEmpty()) {
list.forEach(i -> {
JpStation jpStation = jpStationServiceImpl.getOne(new LambdaQueryWrapper<JpStation>()
.eq(JpStation::getThirdStationId, i.getThirdStationId()));
if (jpStation != null) {
i.setAddress(jpStation.getAddress());
i.setStationName(jpStation.getName());
i.setArea(jpStation.getArea());
}
if (i.getStartTime() != null) {
i.setStartTimeFormat(TimeUtil.dateFormat(i.getStartTime()));
}
});
}
PageInfo<TdHygfJpInverterWarnDto> page = new PageInfo(list); PageInfo<TdHygfJpInverterWarnDto> page = new PageInfo(list);
com.baomidou.mybatisplus.extension.plugins.pagination.Page<TdHygfJpInverterWarnDto> pagenew = new com.baomidou.mybatisplus.extension.plugins.pagination.Page<TdHygfJpInverterWarnDto>(); com.baomidou.mybatisplus.extension.plugins.pagination.Page<TdHygfJpInverterWarnDto> pagenew = new com.baomidou.mybatisplus.extension.plugins.pagination.Page<TdHygfJpInverterWarnDto>();
pagenew.setCurrent(pageNum); pagenew.setCurrent(pageNum);
...@@ -89,8 +103,10 @@ public class TdHygfJpInverterWarnServiceImpl ...@@ -89,8 +103,10 @@ public class TdHygfJpInverterWarnServiceImpl
tdHygfJpInverterWarnDto.setTimeLongFormat(TimeUtil tdHygfJpInverterWarnDto.setTimeLongFormat(TimeUtil
.longFormat(tdHygfJpInverterWarnDto.getRecoverTime() - tdHygfJpInverterWarnDto.getStartTime())); .longFormat(tdHygfJpInverterWarnDto.getRecoverTime() - tdHygfJpInverterWarnDto.getStartTime()));
} }
if (tdHygfJpInverterWarnDto.getStartTime() != null) {
tdHygfJpInverterWarnDto.setStartTimeFormat(TimeUtil.dateFormat(tdHygfJpInverterWarnDto.getStartTime())); tdHygfJpInverterWarnDto.setStartTimeFormat(TimeUtil.dateFormat(tdHygfJpInverterWarnDto.getStartTime()));
} }
}
return tdHygfJpInverterWarnDto; return tdHygfJpInverterWarnDto;
} }
......
...@@ -51,8 +51,14 @@ public class TdHygfJpInvertorElecHistoryServiceImpl extends ...@@ -51,8 +51,14 @@ public class TdHygfJpInvertorElecHistoryServiceImpl extends
public List<TdHygfJpInvertorElecHistoryDto> dayList(long id, Date day) { public List<TdHygfJpInvertorElecHistoryDto> dayList(long id, Date day) {
JpInverter invertor = jpInvertorServiceImpl.getById(id); JpInverter invertor = jpInvertorServiceImpl.getById(id);
if (invertor != null) { if (invertor != null) {
return this.baseMapper.dayList(invertor.getSnCode(), invertor.getThirdStationId(), List<TdHygfJpInvertorElecHistoryDto> list = this.baseMapper.dayList(invertor.getSnCode(),
TimeUtil.getStartTimeOfDay(day), TimeUtil.getEndTimeOfDay(day)); invertor.getThirdStationId(), TimeUtil.getStartTimeOfDay(day), TimeUtil.getEndTimeOfDay(day));
if (!list.isEmpty()) {
list.forEach(i -> {
i.setTimeFormat(TimeUtil.minuteFormat(i.getTime()));
});
}
return list;
} }
return new ArrayList<>(); return new ArrayList<>();
} }
...@@ -128,7 +134,8 @@ public class TdHygfJpInvertorElecHistoryServiceImpl extends ...@@ -128,7 +134,8 @@ public class TdHygfJpInvertorElecHistoryServiceImpl extends
&& map.get("third_station_id") != null && map.get("sn_code") != null && map.get("third_station_id") != null && map.get("sn_code") != null
&& map.get("month") != null && map.get("year") != null && map.get("month") != null && map.get("year") != null
&& dto.getThirdStationId().equals(map.get("third_station_id").toString()) && dto.getThirdStationId().equals(map.get("third_station_id").toString())
&& dto.getSnCode().equals(map.get("sn_code").toString()) && dto.getYear().equals(map.get("year").toString()) && dto.getSnCode().equals(map.get("sn_code").toString())
&& dto.getYear().equals(map.get("year").toString())
&& dto.getMonth().equals(map.get("month").toString())) { && dto.getMonth().equals(map.get("month").toString())) {
time = dto.getCreatedTime(); time = dto.getCreatedTime();
break; break;
......
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