123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432 |
- package com.gyee.generation.task;
- import com.gyee.generation.service.AnalysisNewService;
- import com.gyee.generation.service.Irradiationinput.IrradiationinputService;
- import com.gyee.generation.service.PVSystemEfficiencyCalculator;
- import com.gyee.generation.service.StationPower.StationPowerService;
- import com.gyee.generation.service.realtimelibrary.*;
- import com.xxl.job.core.context.XxlJobHelper;
- import com.xxl.job.core.handler.annotation.XxlJob;
- import org.slf4j.Logger;
- import org.slf4j.LoggerFactory;
- import org.springframework.stereotype.Component;
- import javax.annotation.Resource;
- /**
- * @ClassName : SaticScheduleTask
- * @Description : 调度
- */
- @Component
- public class SaticScheduleCALTask {
- private static Logger logger = LoggerFactory.getLogger(SaticScheduleCALTask.class);
- @Resource
- private AccessStatusService accessStatusService;
- @Resource
- private CalculationService calculationService;
- @Resource
- private CycleCalculationService cycleCalculationService;
- @Resource
- private ElectricityMeteringService electricityMeteringService;
- @Resource
- private RealtimeService realtimeService;
- @Resource
- private StatusService statusService;
- @Resource
- private TheoreticalPowerService theoreticalPowerService;
- @Resource
- private RegionCalreService regionCalreService;
- @Resource
- private RegionCalService regionCalService;
- @Resource
- private SafetyDayService safetyDayService;
- @Resource
- private StationPowerService powerService;
- @Resource
- private AnalysisNewService analysisNewService;
- @Resource
- private PVSystemEfficiencyCalculator calculator;
- @Resource
- private IrradiationinputService irradiationinputService;
- /**
- * 全场状态,接入状态,总预测功率
- * 每秒执行一次
- */
- @XxlJob("accessStatus_CAL")
- public void accessStatus_CAL() {
- XxlJobHelper.log("全场状态调度程序执行开始!........");
- try {
- //场站接入状态,总预测功率
- accessStatusService.accessStatus();
- //全场状态
- accessStatusService.fullFieldState();
- } catch (Exception e) {
- e.printStackTrace();
- }
- XxlJobHelper.log("全场状态调度任务处理完成!........");
- }
- /**
- * 后新增计算指标 节约煤,水,二氧化碳,二氧化硫,月利用小时,年利用小时,设备可利用率,等效可用系数,风能利用率
- * 每15分钟执行一次
- */
- @XxlJob("calculation_CAL")
- public void calculation_CAL() {
- XxlJobHelper.log("计算指标调度程序执行开始!........");
- try {
- calculationService.calWp();
- } catch (Exception e) {
- e.printStackTrace();
- }
- XxlJobHelper.log("计算指标调度任务处理完成!........");
- }
- /**
- * 日,月,年,15分钟计算指标
- * 每15分钟执行一次
- */
- @XxlJob("cycleCalculation_CAL")
- public void cycleCalculation_CAL() {
- XxlJobHelper.log("日月年计算指标调度程序执行开始!........");
- try {
- cycleCalculationService.saveCyle();
- } catch (Exception e) {
- e.printStackTrace();
- }
- XxlJobHelper.log("日月年计算指标调度任务处理完成!........");
- }
- /**
- * 日,月,年,15分钟计算指标
- * 每15分钟执行一次
- */
- @XxlJob("cycleCalculation_All_CAL")
- public void cycleCalculation_All_CAL() {
- XxlJobHelper.log("日月年计算指标调度程序执行开始!........");
- try {
- while(true)
- {
- cycleCalculationService.saveCyle();
- Thread.sleep(200);
- }
- } catch (Exception e) {
- e.printStackTrace();
- }
- XxlJobHelper.log("日月年计算指标调度任务处理完成!........");
- }
- /**
- * 电计量计算指标
- * 每15分钟执行一次
- */
- @XxlJob("electricityMetering_CAL")
- public void electricityMetering_CAL() {
- XxlJobHelper.log("电计量指标调度程序执行开始!........");
- try {
- electricityMeteringService.saveGenerationDatas();
- } catch (Exception e) {
- e.printStackTrace();
- }
- XxlJobHelper.log("电计量计算指标调度任务处理完成!........");
- }
- /**
- * 实时计算指标
- * 每秒执行一次
- */
- @XxlJob("realtime_CAL")
- public void realtime_CAL() {
- XxlJobHelper.log("实时指标调度程序执行开始!........");
- try {
- while(true)
- {
- realtimeService.savaRealtimeTarget();
- Thread.sleep(200);
- }
- } catch (Exception e) {
- e.printStackTrace();
- }
- XxlJobHelper.log("实时指标调度任务处理完成!........");
- }
- /**
- * 实时场站计算指标合计
- * 每秒执行一次
- */
- @XxlJob("realtime_Wp_CAL")
- public void realtime_Wp_CAL() {
- XxlJobHelper.log("实时指标调度程序执行开始!........");
- try {
- while(true)
- {
- realtimeService.savaRealtimeTargetWp();
- Thread.sleep(200);
- }
- } catch (Exception e) {
- e.printStackTrace();
- System.out.println( e.getMessage());
- }
- XxlJobHelper.log("实时指标调度任务处理完成!........");
- }
- /**
- * 中间状态计算
- * 执行一次
- */
- @XxlJob("status_middleStatusReal")
- public void status_powerRationing() {
- XxlJobHelper.log("中间状态计算调度程序执行开始!........");
- try {
- statusService.startMiddleStatusReal();
- } catch (Exception e) {
- e.printStackTrace();
- }
- XxlJobHelper.log("中间状态计算调度任务处理完成!........");
- }
- @XxlJob("status_statusReal")
- public void status_statusReal() {
- XxlJobHelper.log("状态调度程序执行开始!........");
- try {
- statusService.startStatusReal();
- } catch (Exception e) {
- e.printStackTrace();
- }
- XxlJobHelper.log("状态调度任务处理完成!........");
- }
- /**
- * 场站状态计算
- * 执行一次
- */
- /**
- * 状态计算
- * 执行一次
- */
- @XxlJob("calculate_powerRationing")
- public void calculate_powerRationing() {
- XxlJobHelper.log("场站状态计算调度程序执行开始!........");
- try {
- statusService.startPowerRationing();
- } catch (Exception e) {
- e.printStackTrace();
- }
- XxlJobHelper.log("场站状态计算调度任务处理完成!........");
- }
- /**
- * 状态数量计算
- * 执行一次
- */
- @XxlJob("calculate_StatusNumber")
- public void calculateStatusNumber() {
- XxlJobHelper.log("状态数量调度程序执行开始!........");
- try {
- statusService.startStatusNumber();
- } catch (Exception e) {
- e.printStackTrace();
- }
- XxlJobHelper.log("状态数量调度任务处理完成!........");
- }
- /**
- * 自算功率,最优功率更新缓存
- * 每月执行一次
- */
- @XxlJob("theoreticalPower_CAL")
- public void theoreticalPower_CAL() {
- XxlJobHelper.log("自算功率更新程序执行开始!........");
- try {
- theoreticalPowerService.updateCachePower();
- } catch (Exception e) {
- e.printStackTrace();
- }
- XxlJobHelper.log("自算功率更新调度任务处理完成!........");
- }
- /**
- * 安全天数
- * 每天执行一次
- */
- @XxlJob("safetyday_CAL")
- public void safetyday_CAL() {
- XxlJobHelper.log("安全天数程序执行开始!........");
- try {
- safetyDayService.saveSafetyday();
- } catch (Exception e) {
- e.printStackTrace();
- }
- XxlJobHelper.log("安全天数调度任务处理完成!........");
- }
- /**
- * 区域公司实时指标
- * 每秒执行一次
- */
- @XxlJob("regionCalre_CAL")
- public void regionCalre_CAL() {
- XxlJobHelper.log("区域公司实时程序执行开始!........");
- try {
- while(true)
- {
- regionCalreService.companyCal();
- regionCalreService.RegionCal();
- regionCalreService.groupCal();
- }
- } catch (Exception e) {
- e.printStackTrace();
- }
- XxlJobHelper.log("区域公司实时程序处理完成!........");
- }
- /**
- * 区域公司历史指标
- * 每5分钟执行一次
- * 59 14/15 * * * ?
- */
- @XxlJob("regionCal_CAL")
- public void regionCal_CAL() {
- XxlJobHelper.log("区域公司历史程序执行开始!........");
- try {
- while(true)
- {
- regionCalService.companyCal();
- regionCalService.RegionCal();
- regionCalService.groupCal();
- }
- } catch (Exception e) {
- e.printStackTrace();
- }
- XxlJobHelper.log("区域公司历史程序处理完成!........");
- }
- /**
- * 区域公司安全天数
- * 每天0点执行
- * 59 14/15 * * * ?
- */
- @XxlJob(value = "yourJobHandler")
- public void regionCal_aqts() {
- XxlJobHelper.log("区域公司安全天数程序执行开始!........");
- try {
- regionCalreService.aqts();
- } catch (Exception e) {
- e.printStackTrace();
- }
- XxlJobHelper.log("区域公司安全天数程序处理完成!........");
- }
- @XxlJob("PredictedPowerccuracy")
- public void Powerccuracy() {
- XxlJobHelper.log("预测功率准确率计算执行开始!........");
- try {
- powerService.predictedPower();
- } catch (Exception e) {
- e.printStackTrace();
- }
- XxlJobHelper.log("预测功率准确率计算执行开始!........");
- }
- @XxlJob("planvaluejs")
- public void planvalue() {
- XxlJobHelper.log("系统效率计算执行开始!........");
- try {
- calculator.planvalue();
- } catch (Exception e) {
- e.printStackTrace();
- }
- XxlJobHelper.log("系统效率计算执行开始!........");
- }
- @XxlJob("companysjs")
- public void companysjs() {
- XxlJobHelper.log("底码计算执行开始!........");
- try {
- analysisNewService.companys();
- } catch (Exception e) {
- e.printStackTrace();
- }
- XxlJobHelper.log("底码计算计算执行开始!........");
- }
- @XxlJob("saveWindProjectjs")
- public void saveWindProjectjs() {
- XxlJobHelper.log("底码电量计算执行开始!........");
- try {
- analysisNewService.saveWindProject();
- } catch (Exception e) {
- e.printStackTrace();
- }
- XxlJobHelper.log("底码电量计算执行开始!........");
- }
- @XxlJob("irradiationjs")
- public void irradiation() {
- XxlJobHelper.log("日照强度替换计算执行开始!........");
- try {
- irradiationinputService.getcockpit();
- } catch (Exception e) {
- e.printStackTrace();
- }
- XxlJobHelper.log("日照强度替换计算执行开始!........");
- }
- }
|