123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538 |
- package com.ruoyi;
- import cn.hutool.core.collection.CollUtil;
- import cn.hutool.core.date.DateTime;
- import cn.hutool.core.date.DateUtil;
- import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
- import com.ruoyi.quartz.handler.IJobHandler;
- import com.ruoyi.quartz.task.ChangedSave;
- import com.ruoyi.ucp.entity.*;
- import com.ruoyi.ucp.feign.AdapterApi;
- import com.ruoyi.ucp.service.*;
- import com.ruoyi.ucp.util.CalcCache;
- import org.springframework.data.redis.core.RedisTemplate;
- import javax.annotation.Resource;
- import java.net.URI;
- import java.util.*;
- import java.util.function.Function;
- import java.util.stream.Collectors;
- public class JavaFunctionJobHandler extends IJobHandler {
- @Resource
- private AdapterApi adapter;
- @Resource
- private IPointInfoService pointService;
- @Resource
- private IStationInfoHourService stationInfoHourService;
- @Resource
- private IStationInfoDayService stationInfoDayService;
- @Resource
- private ILineInfoDayService lineInfoDayService;
- @Resource
- private IStateAiService stateAiService;
- @Resource
- private RedisTemplate redisTemplate;
- @Resource
- private IEquipmentModelService equipmentModelService;
- @Resource
- private ITurbineInfoDayService turbineInfoDayService;
- @Override
- public void execute() throws Exception {
- }
- @Override
- public IJobHandler getFunctionHandler() {
- return null;
- }
- @Override
- public void setFunctionHandler(IJobHandler jobHandler) {
- }
- public void calcAQTS(Date date) {
- QueryWrapper<StationInfoDay> wrapper = new QueryWrapper<>();
- wrapper.select("min(record_date) record_date");
- StationInfoDay one = stationInfoDayService.getOne(wrapper);
- wrapper = new QueryWrapper<>();
- wrapper.eq("record_date", one.getRecordDate());
- //最早时间的列表
- List<StationInfoDay> list = stationInfoDayService.list(wrapper);
- List<StationInfoDay> today = getStationinfoByDate(date);
- if (today.isEmpty()) {
- for (StationInfoDay infoDay : list) {
- StationInfoDay day = new StationInfoDay();
- day.setStationId(infoDay.getStationId());
- day.setRecordDate(date);
- day.setAqts(infoDay.getAqts() + (int) DateUtil.betweenDay(infoDay.getRecordDate(), date, true));
- today.add(day);
- }
- } else {
- Map<String, StationInfoDay> collect = list.stream().collect(Collectors.toMap(StationInfoDay::getStationId, Function.identity()));
- for (StationInfoDay day : today) {
- StationInfoDay day1 = collect.get(day.getStationId());
- day.setAqts(day1.getAqts() + (int) DateUtil.betweenDay(day1.getRecordDate(), date, true));
- }
- }
- stationInfoDayService.saveOrUpdateBatch(today);
- }
- public List<StationInfoDay> getStationinfoByDate(Date date) {
- QueryWrapper<StationInfoDay> wrapper = new QueryWrapper<>();
- wrapper.eq("record_date", date);
- return stationInfoDayService.list(wrapper);
- }
- public URI taosGoldenUriTest() {
- return URI.create("http://127.0.0.1:8011/ts");
- }
- public URI taosUri() {
- return URI.create("http://172.16.12.101:8012/ts");
- }
- public void calcStationHourRFDL(Date hour) {
- PointInfo pointInfo = new PointInfo();
- pointInfo.setInstitutionType("station");
- pointInfo.setUniformCode("RFDLSYZ");
- List<PointInfo> entity = pointService.getByEntity(pointInfo);
- Map<String, PointData> section = adapter.getHistorySection(taosGoldenUriTest()
- , pointInfos2Keys(entity), hour.getTime());
- List<StationInfoHour> byHours = getStationinfoByHour(hour);
- if (byHours.isEmpty()) {
- for (PointInfo point : entity) {
- StationInfoHour info = new StationInfoHour();
- info.setStationId(point.getStationId());
- info.setRecordDate(DateUtil.beginOfHour(hour));
- info.setRfdl(section.get(point.getPointKey()).getDoubleValue());
- byHours.add(info);
- }
- } else {
- Map<String, String> collect = entity.stream().collect(Collectors.toMap(PointInfo::getStationId, PointInfo::getPointKey));
- for (StationInfoHour byHour : byHours) {
- byHour.setRfdl(section.get(collect.get(byHour.getStationId())).getDoubleValue());
- }
- }
- stationInfoHourService.saveOrUpdateBatch(byHours);
- }
- public List<StationInfoHour> getStationinfoByHour(Date hour) {
- QueryWrapper<StationInfoHour> wrapper = new QueryWrapper<>();
- wrapper.eq("record_date", DateUtil.beginOfHour(hour));
- return stationInfoHourService.list(wrapper);
- }
- public String pointInfos2Keys(List<PointInfo> entity) {
- return entity.stream().map(PointInfo::getPointKey).collect(Collectors.joining(","));
- }
- public void calcStationHourPJGL(Date hour) {
- PointInfo pointInfo = new PointInfo();
- pointInfo.setInstitutionType("station");
- pointInfo.setUniformCode("SSZGL");
- List<PointInfo> entity = pointService.getByEntity(pointInfo);
- List<StationInfoHour> byHours = getStationinfoByHour(hour);
- Map<String, StationInfoHour> collect = new HashMap<>();
- if (byHours.size() > 0) {
- collect = byHours.stream().collect(
- Collectors.toMap(StationInfoHour::getStationId, Function.identity()));
- }
- List<DoubleStatData> stat;
- List<StationInfoHour> byHours2 = new ArrayList<>();
- for (PointInfo point : entity) {
- stat = adapter.getHistoryStat(taosGoldenUriTest(),
- point.getPointKey(), DateUtil.offsetHour(hour, -1).getTime(), hour.getTime());
- if (byHours.isEmpty()) {
- StationInfoHour info = new StationInfoHour();
- info.setStationId(point.getStationId());
- info.setRecordDate(DateUtil.beginOfHour(hour));
- if (stat.isEmpty()) info.setPjgl(0.0);
- info.setPjgl(stat.get(0).getAvg().getDoubleValue());
- byHours2.add(info);
- } else {
- collect.get(point.getStationId()).setPjgl(stat.get(0).getAvg().getDoubleValue());
- }
- }
- stationInfoHourService.saveOrUpdateBatch(byHours.isEmpty() ? byHours2 : byHours);
- }
- public void calcLineDjlRfdl(Date date) {
- //date当天零点
- DateTime time = DateUtil.beginOfDay(date);
- //date昨天零点
- DateTime time0 = DateUtil.offsetDay(time, -1);
- //date当天零点加三分钟
- DateTime time2 = DateUtil.offsetMinute(time, 3);
- //date昨天零点加三分钟
- DateTime time1 = DateUtil.offsetMinute(time0, 3);
- PointInfo pi = new PointInfo();
- pi.setUniformCode("Z-ZXYG-JX");
- pi.setLineId("all");
- List<PointInfo> entity = pointService.getByEntity(pi);
- String keys = pointInfos2Keys(entity);
- Map<String, PointData> latest2 = adapter.getHistorySection(taosGoldenUriTest(), keys, time2.getTime());
- Map<String, PointData> latest1 = adapter.getHistorySection(taosGoldenUriTest(), keys, time1.getTime());
- List<LineInfoDay> byDate = getLineinfoByDate(time0.toJdkDate());
- Map<String, LineInfoDay> collect = new HashMap<>();
- if (byDate.size() > 0) {
- collect = byDate.stream().collect(Collectors.toMap(LineInfoDay::getLineId, Function.identity()));
- }
- List<LineInfoDay> list = new ArrayList<>();
- for (PointInfo info : entity) {
- LineInfoDay day;
- if (byDate.isEmpty()) {
- day = new LineInfoDay();
- day.setStationId(info.getStationId());
- day.setProjectId(info.getProjectId());
- day.setLineId(info.getLineId());
- day.setRecordDate(time0.toJdkDate());
- } else {
- day = collect.get(info.getLineId());
- }
- day.setRfdl((int) ((latest2.get(info.getPointKey()).getDoubleValue() -
- latest1.get(info.getPointKey()).getDoubleValue()) * info.getCoef()));
- list.add(day);
- }
- lineInfoDayService.saveOrUpdateBatch(list);
- }
- public List<LineInfoDay> getLineinfoByDate(Date date) {
- QueryWrapper<LineInfoDay> wrapper = new QueryWrapper<>();
- wrapper.eq("record_date", date);
- return lineInfoDayService.list(wrapper);
- }
- public void calcStationSwGwCyDl(Date date) {
- //date当天零点
- DateTime time = DateUtil.beginOfDay(date);
- //date昨天零点
- DateTime time0 = DateUtil.offsetDay(time, -1);
- //date当天零点加三分钟
- DateTime time2 = DateUtil.offsetMinute(time, 3);
- //date昨天零点加三分钟
- DateTime time1 = DateUtil.offsetMinute(time0, 3);
- PointInfo swdlPi = new PointInfo();
- swdlPi.setUniformCode("Z-ZXYG-CX");
- PointInfo gwdlPi = new PointInfo();
- gwdlPi.setUniformCode("Z-FXYG-CX");
- PointInfo cydlPi = new PointInfo();
- cydlPi.setUniformCode("Z-ZXYG-ZYB");
- List<PointInfo> swdlEt = pointService.getByEntity(swdlPi);
- List<PointInfo> gwdlEt = pointService.getByEntity(gwdlPi);
- Map<String, PointInfo> gwdlMap = gwdlEt.stream().collect(Collectors.toMap(PointInfo::getStationId, Function.identity()));
- List<PointInfo> cydlEt = pointService.getByEntity(cydlPi);
- Map<String, PointInfo> cydlMap = cydlEt.stream().collect(Collectors.toMap(PointInfo::getStationId, Function.identity()));
- String swdlK = pointInfos2Keys(swdlEt);
- String gwdlK = pointInfos2Keys(gwdlEt);
- String cydlK = pointInfos2Keys(cydlEt);
- Map<String, PointData> swdlL2 = adapter.getHistorySection(taosGoldenUriTest(), swdlK, time2.getTime());
- Map<String, PointData> swdlL1 = adapter.getHistorySection(taosGoldenUriTest(), swdlK, time1.getTime());
- Map<String, PointData> gwdlL2 = adapter.getHistorySection(taosGoldenUriTest(), gwdlK, time2.getTime());
- Map<String, PointData> gwdlL1 = adapter.getHistorySection(taosGoldenUriTest(), gwdlK, time1.getTime());
- Map<String, PointData> cydlL2 = adapter.getHistorySection(taosGoldenUriTest(), cydlK, time2.getTime());
- Map<String, PointData> cydlL1 = adapter.getHistorySection(taosGoldenUriTest(), cydlK, time1.getTime());
- List<StationInfoDay> byDate = getStationinfoByDate(time0.toJdkDate());
- Map<String, StationInfoDay> collect = new HashMap<>();
- if (byDate.size() > 0) {
- collect = byDate.stream().collect(Collectors.toMap(StationInfoDay::getStationId, Function.identity()));
- }
- StationInfoDay infoDay;
- String stationId;
- PointInfo gwdlKey, cydlKey;
- List<StationInfoDay> infoDays = new ArrayList<>();
- for (PointInfo info : swdlEt) {
- stationId = info.getStationId();
- if (byDate.isEmpty()) {
- infoDay = new StationInfoDay();
- infoDay.setStationId(stationId);
- infoDay.setRecordDate(time0.toJdkDate());
- } else {
- infoDay = collect.get(stationId);
- }
- infoDay.setSwdl((int) ((swdlL2.get(info.getPointKey()).getDoubleValue() -
- swdlL1.get(info.getPointKey()).getDoubleValue()) * info.getCoef()));
- gwdlKey = gwdlMap.get(stationId);
- infoDay.setGwdl((int) ((gwdlL2.get(gwdlKey.getPointKey()).getDoubleValue() -
- gwdlL1.get(gwdlKey.getPointKey()).getDoubleValue()) * gwdlKey.getCoef()));
- cydlKey = cydlMap.get(stationId);
- infoDay.setCydl((int) ((cydlL2.get(cydlKey.getPointKey()).getDoubleValue() -
- cydlL1.get(cydlKey.getPointKey()).getDoubleValue()) * cydlKey.getCoef()));
- infoDays.add(infoDay);
- }
- stationInfoDayService.saveOrUpdateBatch(infoDays);
- }
- public void calcStationZhcydl(Date date) {
- //date当天零点
- DateTime time = DateUtil.beginOfDay(date);
- //date昨天零点
- DateTime time0 = DateUtil.offsetDay(time, -1);
- QueryWrapper<LineInfoDay> wrapper = new QueryWrapper<>();
- wrapper.select("sum(rfdl) rfdl,station_id").eq("record_date", time0.toJdkDate())
- .groupBy("station_id");
- List<LineInfoDay> list = lineInfoDayService.list(wrapper);
- List<StationInfoDay> byDate = getStationinfoByDate(time0.toJdkDate());
- Map<String, StationInfoDay> collect = new HashMap<>();
- if (byDate.size() > 0) {
- collect = byDate.stream().collect(Collectors.toMap(StationInfoDay::getStationId, Function.identity()));
- }
- StationInfoDay infoDay;
- List<StationInfoDay> infoDays = new ArrayList<>();
- for (LineInfoDay day : list) {
- if (byDate.isEmpty()) {
- infoDay = new StationInfoDay();
- infoDay.setStationId(day.getStationId());
- infoDay.setRecordDate(time0.toJdkDate());
- } else {
- infoDay = collect.get(day.getStationId());
- }
- infoDay.setRfdl(day.getRfdl());
- infoDay.setZhcydl(infoDay.getRfdl() + infoDay.getGwdl() - infoDay.getSwdl());
- infoDays.add(infoDay);
- }
- stationInfoDayService.saveOrUpdateBatch(infoDays);
- }
- public void calcTurbine5s() {
- }
- //此处加公式
- public void calcTurbineSsztAi(Date date) {
- PointInfo pi = new PointInfo();
- pi.setUniformCode("AI422");
- pi.setInstitutionType("state");
- List<PointInfo> entity = pointService.getByEntity(pi);
- Map<String, PointInfo> collect = entity.stream().collect(Collectors.toMap(PointInfo::getTurbineId, Function.identity()));
- String keys = pointInfos2Keys(entity);
- PointInfo pimx = new PointInfo();
- pimx.setUniformCode("MXZT");
- pimx.setInstitutionType("turbine");
- List<PointInfo> entityMx = pointService.getByEntity(pimx);
- Map<String, PointInfo> collectMX = entityMx.stream().collect(Collectors.toMap(PointInfo::getTurbineId, Function.identity()));
- PointInfo pisb = new PointInfo();
- pisb.setUniformCode("SBZT");
- pisb.setInstitutionType("turbine");
- List<PointInfo> entitySB = pointService.getByEntity(pimx);
- Map<String, PointInfo> collectSB = entitySB.stream().collect(Collectors.toMap(PointInfo::getTurbineId, Function.identity()));
- Map<String, PointData> latest = adapter.getLatest(taosGoldenUriTest(), keys);
- List<StateAi> list = stateAiService.list();
- Map<String, Map<Integer, Integer>> collectAi = list.stream().collect(Collectors.groupingBy(StateAi::getModel, Collectors.toMap(StateAi::getOriginalState, StateAi::getMappingState)));
- List<PointData> pointDatas = new ArrayList<>();
- int i1;
- for (PointInfo info : entity) {
- PointData data = latest.get(info.getPointKey());
- data.setTagName(collectMX.get(info.getTurbineId()).getPointKey());
- i1 = (int) data.getDoubleValue();
- //缓存值
- Integer i2 = ChangedSave.map.get(info.getPointKey());
- if (i2 != null && i1 == i2) continue;
- ChangedSave.map.put(info.getPointKey(), i1);
- Integer i = collectAi.get(info.getSpare()).get(i1);
- data.setDoubleValue(i);
- pointDatas.add(data);
- }
- adapter.writeHistoryBatch(taosGoldenUriTest(), pointDatas);
- //redisTemplate.opsForHash().put("state_point",key,value);
- }
- public void calcStationXd(boolean priorRation) {
- //限电状态
- PointInfo piAgc = new PointInfo();
- //AGC
- piAgc.setUniformCode("AGC002");
- piAgc.setInstitutionType("booster");
- List<PointInfo> entityAgc = pointService.getByEntity(piAgc);
- Map<String, PointInfo> collectAgc = entityAgc.stream().collect(Collectors.toMap(PointInfo::getTurbineId, Function.identity()));
- String keysAgc = pointInfos2Keys(entityAgc);
- //出线
- PointInfo piCx = new PointInfo();
- piCx.setUniformCode("AGC001");
- piCx.setInstitutionType("booster");
- List<PointInfo> entityCx = pointService.getByEntity(piCx);
- Map<String, PointInfo> collectCx = entityCx.stream().collect(Collectors.toMap(PointInfo::getTurbineId, Function.identity()));
- String keysCx = pointInfos2Keys(entityCx);
- Map<String, PointData> statAgc = adapter.getLatest(goldenUri(), keysAgc);
- Map<String, PointData> statCx = adapter.getLatest(goldenUri(), keysCx);
- DateTime time5 = DateUtil.offsetMinute(DateUtil.date(), -5);
- List<DoubleStatData> statAgc5 = adapter.getHistoryStat(goldenUri(), keysAgc, time5.getTime(), DateUtil.date().getTime());
- List<DoubleStatData> statCx5 = adapter.getHistoryStat(goldenUri(), keysCx, time5.getTime(), DateUtil.date().getTime());
- //AI066
- for (PointInfo info : entityAgc) {
- //如果场站限电状态为0
- /*if (priorRation) {
- if (zsgl5 >= sub.getCapacity() * 0.4) {
- if (zsgl / agc > 1.15) {
- b = true;
- }
- if (agc5 <= cxgl5) {
- b = true;
- }
- if (zsgl > agc && agc5 - cxgl5 < 4) {
- b = true;
- }
- }
- } else {
- if (zsgl5 >= sub.getCapacity() * 0.4) {
- if (zsgl / agc >= 1.2 && agc - cxgl <= 2) {
- b = true;
- }
- if (agc5 <= cxgl5) {
- b = true;
- }
- } else {
- if (k) {
- if (agc5 <= cxgl5) {
- b = true;
- }
- if (zsgl / agc >= 1.1 && agc5 - cxgl5 <= 2) {
- b = true;
- }
- }
- }
- }*/
- }
- }
- public void calcNhglZs(boolean priorRation) {
- //拟合功率(自算)
- //实时风速
- PointInfo piFs = new PointInfo();
- piFs.setUniformCode("AI066");
- piFs.setInstitutionType("turbine");
- List<PointInfo> entityFs = pointService.getByEntity(piFs);
- Map<String, PointInfo> collectFs = entityFs.stream().collect(Collectors.toMap(PointInfo::getTurbineId, Function.identity()));
- Map<String, List<PointInfo>> collect = entityFs.stream().collect(Collectors.groupingBy(PointInfo::getStationId));
- String keysFs = pointInfos2Keys(entityFs);
- //设备拟合功率(自算)
- PointInfo piFjzsgl = new PointInfo();
- piFjzsgl.setUniformCode("ZSGL");
- piFjzsgl.setInstitutionType("turbine");
- List<PointInfo> entityFjzsgl = pointService.getByEntity(piFjzsgl);
- Map<String, String> collectFjzsgl = entityFjzsgl.stream().collect(Collectors.toMap(PointInfo::getTurbineId, PointInfo::getPointKey));
- String keysFjzsgl = pointInfos2Keys(entityFjzsgl);
- //场站自算功率
- PointInfo piCzzsgl = new PointInfo();
- piCzzsgl.setUniformCode("AGC010");
- piCzzsgl.setInstitutionType("booster");
- List<PointInfo> entityCzzsgl = pointService.getByEntity(piCzzsgl);
- Map<String, String> collectCzzsgl = entityCzzsgl.stream().collect(Collectors.toMap(PointInfo::getStationId, PointInfo::getPointKey));
- String keysCzzsgl = pointInfos2Keys(entityCzzsgl);
- DateTime time = DateUtil.beginOfMinute(DateUtil.date());
- DateTime time5 = DateUtil.offsetMinute(time, -5);
- List<DoubleStatData> statFs5;
- PointData avg;
- List<PointData> avgs = new ArrayList<>();
- double value, v;
- for (Map.Entry<String, List<PointInfo>> entry : collect.entrySet()) {
- double stV = 0;
- for (PointInfo info : entry.getValue()) {
- //todo
- statFs5 = adapter.getHistoryStat(goldenUri(), info.getPointKey(), time5.getTime(), time.getTime());
- if (CollUtil.isNotEmpty(statFs5)) {
- //todo
- value = statFs5.get(0).getAvg().getValue();
- avg = new PointData();
- v = CalcCache.wtMcfMap.get(info.getTurbineId()).get(value);
- stV += v;
- avg.setTs(time.getTime());
- avg.setDoubleValue(v);
- avg.setTagName(collectFjzsgl.get(info.getTurbineId()));
- avgs.add(avg);
- }
- }
- adapter.writeHistoryBatch(taosUri(), avgs);
- PointData data = new PointData();
- data.setTs(time.getTime());
- data.setDoubleValue(stV);
- data.setTagName(collectCzzsgl.get(entry.getKey()));
- adapter.writeHistory(taosUri(), data);
- }
- }
- public URI goldenUri() {
- return URI.create("http://172.16.12.103:8011/ts");
- }
- public void calcTurbineRFDL(Date date) {
- //date当天零点
- DateTime time = DateUtil.beginOfDay(date);
- //date昨天零点
- DateTime time0 = DateUtil.offsetDay(time, -1);
- //date当天零点加三分钟
- DateTime time2 = DateUtil.offsetMinute(time, 3);
- //date昨天零点加三分钟
- DateTime time1 = DateUtil.offsetMinute(time0, 3);
- PointInfo pi = new PointInfo();
- pi.setUniformCode("AI121");
- pi.setInstitutionType("turbine");
- List<PointInfo> entity = pointService.getByEntity(pi);
- Map<String, String> turMap = entity.stream().collect(Collectors.toMap(PointInfo::getTurbineId, PointInfo::getPointKey));
- String keys = pointInfos2Keys(entity);
- Map<String, PointData> swdlL2 = adapter.getHistorySection(goldenUri(), keys, time2.getTime());
- Map<String, PointData> swdlL1 = adapter.getHistorySection(goldenUri(), keys, time1.getTime());
- List<TurbineInfoDay> byDate = getTurbineinfoByDate(time0.toJdkDate());
- Map<String, TurbineInfoDay> collect = new HashMap<>();
- if (byDate.size() > 0) {
- collect = byDate.stream().collect(Collectors.toMap(TurbineInfoDay::getLineId, Function.identity()));
- }
- TurbineInfoDay infoDay;
- String turbineId, key;
- List<TurbineInfoDay> infoDays = new ArrayList<>();
- for (PointInfo info : entity) {
- turbineId = info.getTurbineId();
- if (byDate.isEmpty()) {
- infoDay = new TurbineInfoDay();
- infoDay.setStationId(info.getStationId());
- infoDay.setProjectId(info.getProjectId());
- infoDay.setLineId(info.getLineId());
- infoDay.setTurbineId(turbineId);
- infoDay.setRecordDate(time0.toJdkDate());
- } else {
- infoDay = collect.get(turbineId);
- }
- key = turMap.get(turbineId);
- double v = (swdlL2.get(key).getValue() - swdlL2.get(key).getValue()) * info.getCoef();
- if (v < 0 || v > 1000000) v = 0;
- infoDay.setRfdl(v);
- infoDays.add(infoDay);
- }
- turbineInfoDayService.saveOrUpdateBatch(infoDays);
- }
- public List<TurbineInfoDay> getTurbineinfoByDate(Date date) {
- QueryWrapper<TurbineInfoDay> wrapper = new QueryWrapper<>();
- wrapper.eq("record_date", date);
- return turbineInfoDayService.list(wrapper);
- }
- }
|