Compare commits

...

8 Commits

Author SHA1 Message Date
a859c4b649 光伏今日放电统计逻辑修改 2026-02-03 17:57:41 +08:00
2e6cee7f49 光伏收益报表导出 2026-02-03 15:03:13 +08:00
93460199b2 摸版修改 2026-02-03 10:39:30 +08:00
805d7d01fb 光伏mppt收益修改 2026-02-02 09:25:39 +08:00
292a7c7376 远控查询修改 2026-01-29 14:06:21 +08:00
0c4b8b8ca9 Merge remote-tracking branch 'origin/paris' into paris
# Conflicts:
#	common-tools/src/main/java/com/ho/common/tools/util/AliSendSmsUtils.java
2026-01-29 13:42:52 +08:00
7d641db749 短信配置修改 2026-01-29 13:42:00 +08:00
605de0a6cd 短信配置修改 2026-01-29 13:40:56 +08:00
13 changed files with 75 additions and 13 deletions

View File

@ -1611,6 +1611,7 @@ public class EarningsCalculateServiceImpl implements EarningsCalculateService {
LocalDateTime end = mDate.with(TemporalAdjusters.lastDayOfMonth());
String beginTime= DateUtil.format(begin, CommonConstant.DATE_YMD);
String endTime = DateUtil.format(end, CommonConstant.DATE_YMD);
String nowTime = DateUtil.format(new Date(), CommonConstant.DATE_YMD);
//光伏收益
List<PowerGenerateRespVO> pvIncome = earningsCalculateMpptService.countPvIncome(req.getStationId(),beginTime, endTime);
Map<String,List<PowerGenerateRespVO>> mapIncome = pvIncome.stream().collect(Collectors.groupingBy(i ->i.getDate()));
@ -1636,7 +1637,7 @@ public class EarningsCalculateServiceImpl implements EarningsCalculateService {
if(elecs != null){
pv.setPowerGenerate(elecs.stream().map(ElecMeterValue::getDigital).reduce(BigDecimal.ZERO,BigDecimal::add));
}
if(date.equals(endTime)){
if(date.equals(nowTime)){
String key = RedisKeyConstant.PV.STATION_PV_TODAY_PROFIT + req.getStationId();
//获取今日收益
BigDecimal todayIncone = (BigDecimal)redisService.get(key);

View File

@ -146,6 +146,7 @@ public class OpenStationServiceImpl implements OpenStationService {
BigDecimal pvActivePower = new BigDecimal(CommonConstant.ZERO);
BigDecimal totalRelease = new BigDecimal(CommonConstant.ZERO);
BigDecimal dailyReleaseElec = new BigDecimal(CommonConstant.ZERO);
String nowDay = DateUtil.format(new Date(), CommonConstant.DATE_YMD);
if (!pcsList.isEmpty()) {
for (DeviceRespVO deviceRespVO : pcsList) {
//在缓存里拿映射字段
@ -155,11 +156,37 @@ public class OpenStationServiceImpl implements OpenStationService {
if (mpptMap != null) {
MpptVo vo = JSON.parseObject(JSON.toJSONString(mpptMap), MpptVo.class);
if (vo != null) {
BigDecimal pvActivePowerMppt = vo.getPvActivePower() == null ? BigDecimal.ZERO : vo.getPvActivePower().getValue();
// 今日功率
BigDecimal pvActivePowerMppt = BigDecimal.ZERO;
if(vo.getPvActivePower() != null){
if(nowDay.equals(DateUtil.format(vo.getPvActivePower().getUpdateTime(), CommonConstant.DATE_YMD))){
pvActivePowerMppt = vo.getPvActivePower().getValue();
}
}
// 累计发电量
BigDecimal totalReleaseMppt = vo.getTotalRelease() == null ? BigDecimal.ZERO : vo.getTotalRelease().getValue();
BigDecimal pvDailyReleaseStart = vo.getPvDailyReleaseStart() == null ? BigDecimal.ZERO : vo.getPvDailyReleaseStart().getValue();
BigDecimal dailyReleaseElecMppt = totalReleaseMppt.subtract(pvDailyReleaseStart);
// 今日发电起始值
BigDecimal pvDailyReleaseStart = BigDecimal.ZERO;
if(vo.getPvDailyReleaseStart() != null){
if(nowDay.equals(DateUtil.format(vo.getPvDailyReleaseStart().getUpdateTime(), CommonConstant.DATE_YMD))){
pvDailyReleaseStart = vo.getPvDailyReleaseStart().getValue();
}
}
// 今日更新的累计发电量
BigDecimal totalReleaseMppt1 = BigDecimal.ZERO;
if(vo.getTotalRelease() != null){
if(nowDay.equals(DateUtil.format(vo.getTotalRelease().getUpdateTime(), CommonConstant.DATE_YMD))){
totalReleaseMppt1 = vo.getTotalRelease().getValue();
}
}
// 计算今日发电量 = 今日更新的累计发电量 - 今日发电起始值
BigDecimal dailyReleaseElecMppt = BigDecimal.ZERO;
if(totalReleaseMppt1.compareTo(BigDecimal.ZERO)>0&&pvDailyReleaseStart.compareTo(BigDecimal.ZERO)>0){
dailyReleaseElecMppt = totalReleaseMppt1.subtract(pvDailyReleaseStart);
}
// 如果计算到的今日发电量小于0 则设置为0
dailyReleaseElecMppt = dailyReleaseElecMppt.compareTo(BigDecimal.ZERO)<0?BigDecimal.ZERO:dailyReleaseElecMppt;
// 最后组装值
pvActivePower = pvActivePower.add(pvActivePowerMppt);
totalRelease = totalRelease.add(totalReleaseMppt);
dailyReleaseElec = dailyReleaseElec.add(dailyReleaseElecMppt);

View File

@ -199,6 +199,43 @@ public class EarningsCalculateController {
}
return betweenList;
}
@TokenIgnore
@PostMapping("/exportPv")
@ApiOperation(value = "pv导出")
public void exportPv(HttpServletRequest req, HttpServletResponse response, @RequestBody EarningsCalculateReq earningsCalculateReq){
String lang = req.getHeader(CommonConstant.LANG);
earningsCalculateReq.setLang(lang);
EarningsCalculateResp total = earningsCalculateService.getTotal(earningsCalculateReq,PAGE_LIST_TYPE);
ServletOutputStream out = null;
try {
out = response.getOutputStream();
response.setContentType("multipart/form-data");
response.setCharacterEncoding("UTF-8");
//文件名字
String fileName = "demo.xlsx";
response.setHeader("Content-disposition", "attachment;filename=" +fileName);
String path="template/earningsPvTemplate.xlsx";
//文件模板输入流
InputStream inputStream = new ClassPathResource(path).getInputStream();
ExcelWriter writer = EasyExcel.write(out).withTemplate(inputStream).build();
WriteSheet sheet = EasyExcel.writerSheet().build();
FillConfig fillConfig = FillConfig.builder().forceNewRow(true).build();
List<PowerGenerateRespVO> pvList = earningsCalculateService.getPvMonthData(earningsCalculateReq);
for (PowerGenerateRespVO pcsElecData : pvList) {
bigDecimalUtil.keepTwoDecimalPlaces(pcsElecData);
bigDecimalUtil.ifIsNUll(pcsElecData);
}
writer.fill(new FillWrapper("vo", pvList), fillConfig, sheet);
//填充数据
writer.fill(total,fillConfig,sheet);
//填充完成
writer.finish();
out.flush();
} catch (IOException e) {
throw new RuntimeException(e);
}
}
@TokenIgnore
@PostMapping("/export")
@ -207,10 +244,6 @@ public class EarningsCalculateController {
String lang = req.getHeader(CommonConstant.LANG);
earningsCalculateReq.setLang(lang);
EarningsCalculateResp total = earningsCalculateService.getTotal(earningsCalculateReq,PAGE_LIST_TYPE);
if(total.getCharge()==null){
total.setCharge(new ArrayList<>());
total.setDischarge(new ArrayList<>());
}
ServletOutputStream out = null;
try {
out = response.getOutputStream();

View File

@ -63,8 +63,8 @@ public class StationRemoteController {
@PostMapping("search")
@ApiOperation(value = "查询远控电站信息")
public DataResult<StationRemoteControl> search(@RequestBody Integer stationId) {
StationRemoteControl stationRemoteControl=stationRemoteControlService.search(stationId);
public DataResult<StationRemoteControl> search(@RequestBody StationRemoteControlPageVo vo) {
StationRemoteControl stationRemoteControl=stationRemoteControlService.search(vo.getStationId());
return DataResult.success(stationRemoteControl);
}

View File

@ -32,7 +32,7 @@ public class AliSendSmsUtils {
* @throws Exception
*/
public static void sendMessage(String param,String phoneNumbers) throws Exception{
sendMessage("中自科技","SMS_495990996",param,phoneNumbers);
sendMessage("中自科技","SMS_501905058",param,phoneNumbers);
}
/**
@ -42,7 +42,7 @@ public class AliSendSmsUtils {
* @throws Exception
*/
public static void sendFlowMessage(String param,String phoneNumbers) throws Exception{
sendMessage("中自科技","SMS_495990996",param,phoneNumbers);
sendMessage("中自科技","SMS_501905058",param,phoneNumbers);
}
/**
@ -124,7 +124,7 @@ public class AliSendSmsUtils {
// JSONObject param = new JSONObject();
// param.put(CommonConstant.SMS.SITE_NAME,"绿服酒店站");
// param.put(CommonConstant.SMS.CONTENT,CommonConstant.Heartbeat.STATION_FAIL);
// param.put(CommonConstant.SMS.NAME,"邹");
// param.put(CommonConstant.SMS.NAME,"邹杰灵");
// sendMessage(param.toJSONString(),"18583239880");
}

View File

@ -1475,6 +1475,7 @@ public class Device001ApiController {
}
if (stationHomeRespVos != null && stationHomeRespVos.size() > 0) {
BigDecimal startEle = stationHomeRespVos.get(0).getDigital();
query.setBegin(DateUtil.beginOfDay(new Date()));
cacheObj(query, DeviceTypeConstant.PV_DAILY_CHARGE_START, startEle);
}
}