Commit 5ab4831c authored by hezhuozhi's avatar hezhuozhi

优化电站监控 及初始化电站数值

parent 7251cba8
......@@ -7,6 +7,7 @@ import com.yeejoin.amos.api.householdapi.face.orm.mapper.tdengine.*;
import com.yeejoin.amos.api.householdapi.face.service.*;
import com.yeejoin.amos.api.householdapi.face.service.business.*;
import com.yeejoin.amos.api.householdapi.face.service.impl.ImasterDataServiceImpl;
import com.yeejoin.amos.api.householdapi.face.service.impl.JpStationServiceImpl;
import com.yeejoin.amos.api.householdapi.face.service.impl.SofarDataAcquisitionServiceImpl;
import fastjson.JSON;
import io.swagger.annotations.Api;
......@@ -77,6 +78,20 @@ public class HouseholdTestController {
@Autowired
private TanYinDataAcquisitionService tanYinDataAcquisitionService;
@Autowired
private JpStationServiceImpl jpStationService;
/**
* 新增户用光伏-厂商API haders
*
* @return
*/
@TycloudOperation(ApiLevel = UserType.AGENCY, needAuth = false)
@GetMapping(value = "/testInitStation")
@ApiOperation(httpMethod = "GET", value = "测试初始化场站", notes = "测试初始化场站")
public void testInitStation() throws IOException {
jpStationService.initStationValue();
}
/**
* 新增户用光伏-厂商API haders
......
package com.yeejoin.amos.api.householdapi.face.service.impl;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
import com.yeejoin.amos.api.householdapi.face.orm.houseapi.entity.hygf.JpStation;
import com.yeejoin.amos.api.householdapi.face.orm.mapper.hygf.JpStationMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.scheduling.annotation.Async;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Service;
import java.util.Date;
@Service
public class JpStationServiceImpl {
@Autowired
JpStationMapper jpStationMapper;
@Scheduled(cron = "${dataRequstScheduled.initStation:0 0 0 * * ?}")
@Async
public void initStationValue(){
LambdaUpdateWrapper<JpStation> wrapper = new LambdaUpdateWrapper<>();
wrapper.set(JpStation::getCapacity,0.0)
.set(JpStation::getRealTimePower,0.0)
.set(JpStation::getAccumulatedPower,0.0)
.set(JpStation::getDayGenerate,0.0)
.set(JpStation::getMonthGenerate,0.0)
.set(JpStation::getYearGenerate,0.0)
.set(JpStation::getDayIncome,0.0)
.set(JpStation::getMonthIncome,0.0)
.set(JpStation::getYearIncome,0.0)
.set(JpStation::getCumulativeIncome,0.0)
.set(JpStation::getDayPowerUse,0.0)
.set(JpStation::getMonthPowerUse,0.0)
.set(JpStation::getYearPowerUse,0.0)
.set(JpStation::getRatedPower,0.0);
jpStationMapper.update(null,wrapper);
}
}
......@@ -66,12 +66,12 @@ biz.lxyd.lift.url=http://39.106.181.149:8088/elevatorapi
# ??????????
dataRequstScheduled.jinlangyun=0 0/40 8 * *
dataRequstScheduled.huawei=0 0/40 8 * *
dataRequstScheduled.keshida=0 0/40 8 * *
dataRequstScheduled.jinlangyun=0 0/40 * * * *
dataRequstScheduled.huawei=0 0/40 * * * *
dataRequstScheduled.keshida=0 0/40 * * * *
dataRequstScheduled.Sunlight=0 0/40 8 * *
dataRequstScheduled.GoodWe=0 0/40 8 * *
dataRequstScheduled.Sunlight=0 0/40 * * * *
dataRequstScheduled.GoodWe=0 0/40 * * * *
dataRequstScheduled.Sofar=0 0/20 * * * *
......
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