change - add看板接口、小时耗量告警定时任务

main
yinq 3 months ago
parent c247d56deb
commit 2156ec28bb

@ -76,4 +76,9 @@ public interface IEmsRecordAlarmDataService
*/
public void exceedDnbThresholdAlarmsTask();
/**
*
*/
public void hourlyConsumptionAlarmsTask();
}

@ -17,6 +17,8 @@ import com.os.ems.record.domain.EmsRecordAlarmRule;
import com.os.ems.record.domain.EmsRecordDnbInstant;
import com.os.ems.record.mapper.EmsRecordAlarmRuleMapper;
import com.os.ems.record.mapper.EmsRecordDnbInstantMapper;
import com.os.ems.report.domain.EmsReportPointDnb;
import com.os.ems.report.mapper.EmsReportPointDnbMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.os.ems.record.mapper.EmsRecordAlarmDataMapper;
@ -48,6 +50,9 @@ public class EmsRecordAlarmDataServiceImpl implements IEmsRecordAlarmDataService
@Autowired
private EmsBaseMonitorThresholdMapper emsBaseMonitorThresholdMapper;
@Autowired
private EmsReportPointDnbMapper emsReportPointDnbMapper;
/**
*
*
@ -285,4 +290,23 @@ public class EmsRecordAlarmDataServiceImpl implements IEmsRecordAlarmDataService
return null;
}
/**
*
*/
public void hourlyConsumptionAlarmsTask() {
EmsBaseMonitorThreshold monitorThreshold = new EmsBaseMonitorThreshold();
monitorThreshold.setMonitorType(2L);
List<EmsBaseMonitorThreshold> thresholdList = emsBaseMonitorThresholdMapper.selectEmsBaseMonitorThresholdList(monitorThreshold);
for (EmsBaseMonitorThreshold threshold : thresholdList) {
BigDecimal consumption = threshold.getHourConsumption();
if (consumption.equals(new BigDecimal(0))){
continue;
}
EmsReportPointDnb reportPointDnb = new EmsReportPointDnb();
reportPointDnb.setMonitorCode(threshold.getMonitorCode());
List<EmsReportPointDnb> dnbList = emsReportPointDnbMapper.selectEmsReportPointDnbList(reportPointDnb);
}
}
}

@ -1,14 +1,11 @@
package com.os.ems.report.controller;
import com.os.common.annotation.Log;
import com.os.common.core.controller.BaseController;
import com.os.common.core.domain.AjaxResult;
import com.os.common.core.page.TableDataInfo;
import com.os.common.enums.BusinessType;
import com.os.common.utils.poi.ExcelUtil;
import com.os.ems.report.domain.EnergyStatisticalReport;
import com.os.ems.report.domain.PeaksValleysConsumptionReport;
import com.os.ems.report.service.IEmsReportPointDnbService;
import com.os.ems.report.service.IEmsReportService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

@ -0,0 +1,38 @@
package com.os.mes.report.controller;
import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import com.os.common.core.controller.BaseController;
import com.os.common.core.domain.AjaxResult;
import com.os.mes.report.domain.ReportBoardPort;
import com.os.mes.report.service.IReportBoardPortService;
/**
* Controller
*
* @author Yinq
* @date 2024-07-11
*/
@RestController
@RequestMapping("/mes/boardPort")
public class ReportBoardPortController extends BaseController
{
@Autowired
private IReportBoardPortService reportBoardPortService;
/**
*
*/
@GetMapping("/list")
public AjaxResult list(ReportBoardPort reportBoardPort)
{
List<ReportBoardPort> list = reportBoardPortService.selectReportBoardPortList(reportBoardPort);
return success(list);
}
}

@ -0,0 +1,16 @@
package com.os.mes.report.domain;
import com.os.common.core.domain.BaseEntity;
/**
* report_board_port
*
* @author Yinq
* @date 2024-07-11
*/
public class ReportBoardPort extends BaseEntity
{
private static final long serialVersionUID = 1L;
}

@ -0,0 +1,23 @@
package com.os.mes.report.service;
import java.util.List;
import com.os.mes.report.domain.ReportBoardPort;
/**
* Service
*
* @author Yinq
* @date 2024-07-11
*/
public interface IReportBoardPortService
{
/**
*
*
* @param reportBoardPort
* @return
*/
public List<ReportBoardPort> selectReportBoardPortList(ReportBoardPort reportBoardPort);
}

@ -0,0 +1,22 @@
package com.os.mes.report.service.impl;
import java.util.List;
import org.springframework.stereotype.Service;
import com.os.mes.report.domain.ReportBoardPort;
import com.os.mes.report.service.IReportBoardPortService;
/**
* Service
*
* @author Yinq
* @date 2024-07-11
*/
@Service
public class ReportBoardPortServiceImpl implements IReportBoardPortService
{
@Override
public List<ReportBoardPort> selectReportBoardPortList(ReportBoardPort reportBoardPort) {
return null;
}
}

@ -36,4 +36,11 @@ public class EMSTask {
emsRecordAlarmDataService.exceedDnbThresholdAlarmsTask();
}
/**
*
*/
public void hourlyConsumptionAlarmsTask() {
emsRecordAlarmDataService.hourlyConsumptionAlarmsTask();
}
}

Loading…
Cancel
Save