Browse Source

tomcat升级

wangb 6 hours ago
parent
commit
5606db533d

+ 11 - 16
generationXK-service/src/main/java/com/gyee/generation/service/WindPowerInfo1Service.java

@@ -1,6 +1,6 @@
 package com.gyee.generation.service;
 
-import cn.hutool.core.date.DateTime;
+import cn.hutool.core.util.NumberUtil;
 import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
 import com.gyee.common.model.PointData;
 import com.gyee.common.model.StringUtils;
@@ -15,12 +15,8 @@ import com.gyee.generation.service.auto.*;
 import com.gyee.generation.util.DateUtils;
 import com.gyee.generation.util.realtimesource.IEdosUtil;
 import com.gyee.generation.util.statisticcs.Initial;
-import com.xxl.job.core.util.DateUtil;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
-import org.springframework.beans.factory.annotation.Value;
-import org.springframework.boot.ApplicationArguments;
-import org.springframework.boot.ApplicationRunner;
 import org.springframework.stereotype.Service;
 
 import javax.annotation.Resource;
@@ -29,7 +25,6 @@ import java.net.URI;
 import java.text.SimpleDateFormat;
 import java.time.*;
 import java.time.format.DateTimeFormatter;
-import java.time.temporal.ChronoUnit;
 import java.util.*;
 import java.util.stream.Collectors;
 
@@ -1437,8 +1432,8 @@ public class WindPowerInfo1Service {
                 pb.setWpid("NX_FGS_HA_FDC_STA");
                 pb.setMeterId(real.getPointName());
                 pb.setMeterName(real.getPointName());
-                pb.setStopCode(real.getPointValueInDouble());
-                pb.setStopCodeModify(real.getPointValueInDouble());
+                pb.setStopCode(NumberUtil.round(real.getPointValueInDouble(),2).doubleValue());
+                pb.setStopCodeModify(NumberUtil.round(real.getPointValueInDouble(),2).doubleValue());
                 ls.add(pb);
             }
         } else {
@@ -1447,8 +1442,8 @@ public class WindPowerInfo1Service {
                     if (real.getPointName().equals(s.getMeterId())) {
                         ProEconAnalysisSubtableBottom pb = new ProEconAnalysisSubtableBottom();
                         pb.setId(s.getId());
-                        pb.setStopCode(real.getPointValueInDouble());
-                        pb.setStopCodeModify(real.getPointValueInDouble());
+                        pb.setStopCode(NumberUtil.round(real.getPointValueInDouble(),2).doubleValue());
+                        pb.setStopCodeModify(NumberUtil.round(real.getPointValueInDouble(),2).doubleValue());
                         pb.setRecordDate(date);
                         pb.setMeterName(real.getPointName());
                         pb.setMeterId(real.getPointName());
@@ -1503,7 +1498,7 @@ public class WindPowerInfo1Service {
         List<String> str = list.stream().map(ProBaseBackfill::getCode).collect(Collectors.toList());
         long time = date.getTime();
 
-        for (long i = time; i < 1751248800000L; i += 86400000) {
+        for (long i = time; i < 1754625600000L; i += 86400000) {
             List<ProEconAnalysisSubtableBottom> ls = new ArrayList<>();
             for (String s : str) {
                 Map<String, PointData2> historySection = adapter.getHistorySection(goldenUri(), s, i);
@@ -1512,8 +1507,8 @@ public class WindPowerInfo1Service {
                 pb.setWpid("NX_FGS_HA_FDC_STA");
                 pb.setMeterId(s);
                 pb.setMeterName(s);
-                pb.setStopCode(historySection.get(s).getDoubleValue());
-                pb.setStopCodeModify(historySection.get(s).getDoubleValue());
+                pb.setStopCode(NumberUtil.round(historySection.get(s).getDoubleValue(),2).doubleValue());
+                pb.setStopCodeModify(NumberUtil.round(historySection.get(s).getDoubleValue(),2).doubleValue());
                 ls.add(pb);
             }
             try {
@@ -1605,7 +1600,7 @@ public class WindPowerInfo1Service {
 
 //    public void writeReportHistory(Date date) throws Exception {
 ////        String[] dateTime = {"2024-12-13 08:00:00","2024-12-13 12:00:00", "2024-12-13 16:00:00", "2024-12-13 20:00:00"};
-//        String[] dateTime = {"2024-12-25 00:00:00", "2024-12-25 04:00:00", "2024-12-25 08:00:00", "2024-12-24 20:00:00"};
+//        String[] dateTime = {"2025-08-04 12:00:00"};
 //        SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
 //        DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss");
 //        String[] split = repInfo1.split(",");
@@ -1682,7 +1677,7 @@ public class WindPowerInfo1Service {
 
     public void writeReportHistory2(Date date) throws Exception {
 //        String[] dateTime = {"2024-12-13 01:00:00", "2024-12-13 05:00:00", "2024-12-13 09:00:00","2024-12-13 13:00:00", "2024-12-13 17:00:00", "2024-12-13 21:00:00"};
-        String[] dateTime = {"2025-03-13 01:00:00", "2025-03-13 05:00:00", "2025-03-13 09:00:00", "2025-03-13 13:00:00", "2025-03-13 17:00:00", "2025-03-13 21:00:00"};
+        String[] dateTime = {"2025-08-04 13:00:00"};
         SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
         DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss");
         QueryWrapper<ProBaseBackfill> qwf = new QueryWrapper<>();
@@ -1697,7 +1692,7 @@ public class WindPowerInfo1Service {
         for (String s : dateTime) {
             Date date1 = simpleDateFormat.parse(s);
             long timestamp = date1.getTime();
-            for (long i = timestamp; i < 1742176332000L; i += 86400000) {
+            for (long i = timestamp; i < 1754290800000L; i += 86400000) {
                 List<StationInfoHour> shs = new ArrayList<>();
                 for (String l : ls) {
                     Map<String, PointData2> historySection = adapter.getHistorySection(goldenUri(), l, timestamp);

+ 1 - 1
pom.xml

@@ -36,7 +36,7 @@
         <mybatis.plus.boot.starter.version>3.5.7</mybatis.plus.boot.starter.version>
         <mybatis.plus.generator.version>3.5.7</mybatis.plus.generator.version>
         <fastjson.version>1.2.17</fastjson.version>
-        <tomcat.version>9.0.52</tomcat.version>
+        <tomcat.version>9.0.107</tomcat.version>
     </properties>
 
     <!-- 子模块继承之后,提供作用:锁定版本+子modlue不用写groupId和version  -->

+ 2 - 2
runeconomy-xk/src/main/java/com/gyee/runeconomy/service/specific/SpecificService.java

@@ -1864,7 +1864,7 @@ public class SpecificService {
             Date date = Date.from(instant);
             vo.setYear(DateUtils.getYear(date));
             vo.setMonth(DateUtils.getMonth(date));
-            vo.setCurrent(DoubleUtils.keepPrecision(i.getRfdlFj().doubleValue() / 1000, 2));
+            vo.setCurrent(NumberUtil.round(i.getRfdlFj().doubleValue() / 1000,2).doubleValue());
             resultList.add(vo);
         });
         resultList.stream().forEach(i -> {
@@ -1873,7 +1873,7 @@ public class SpecificService {
 
             if (optional.isPresent()) {
                 StationInfoDay tqinfoday = optional.get();
-                i.setSameperiod(DoubleUtils.keepPrecision(tqinfoday.getRfdlFj().doubleValue() / 1000, 2));
+                i.setSameperiod(NumberUtil.round(tqinfoday.getRfdlFj().doubleValue() / 1000,2).doubleValue());
                 i.setCompare(i.getCurrent().compareTo(i.getSameperiod()));
             } else {
                 i.setSameperiod(0.0);

+ 54 - 54
runeconomy-xk/src/main/java/com/gyee/runeconomy/util/realtimesource/EdosUtil.java

@@ -392,60 +392,60 @@ public class EdosUtil implements IEdosUtil {
                     JSONArray jsonArray = resp.getBody();
                     if (jsonArray != null) {
                         List<PointData> list = JsonObjectHelper.phrasePointData(jsonArray, tagName.get());
-                        List<PointData> resultList = new ArrayList<>();
-
-                        if (list.isEmpty()) {
-
-                            getHistsnapSameTiem(pointid, beginDate, Long.valueOf(pried), resultList);
-                        } else {
-                            for (PointData snapItem : list) {
-                                long subTime = snapItem.getPointTime() - pried;
-                                //查询时间区间的截面值(截面值为传入时间节点的上一个最近值,返回时间为值的真实时间),
-                                // 再进行比较,若截面值的时间戳在以快照时间节点前推一个单位的时间区间中,
-                                // 则代表该时间节点快照有效,否则为0
-                                String rawUrl = baseURL + "/history/section?null=0&tagNames=" + pointid + "&ts=" + snapItem.getPointTime();
-                                if (pointid.startsWith("GF-")) {
-                                    rawUrl = baseURL2 + "/history/section?null=0&tagNames=" + pointid + "&ts=" + snapItem.getPointTime();
-                                }
-                                ResponseEntity<JSONObject> sectionResp = restTemplate.getForEntity(rawUrl, JSONObject.class);
-                                JSONObject jsonObjectSection = sectionResp.getBody();
-
-                                if (jsonObjectSection != null) {
-                                    List<PointData> sectionlist = JsonObjectHelper.phrasePointData(jsonObjectSection);
-                                    if (sectionlist.size() > 0) {
-                                        if (sectionlist.get(0).getPointTime() <= snapItem.getPointTime()) {
-                                            resultList.add(snapItem);
-                                        } else {
-                                            PointData data = new PointData();
-                                            data.setEdnaId(pointid);
-                                            data.setPointTime(snapItem.getPointTime());
-                                            data.setPointValue("0");
-                                            data.setPointName("1");
-                                            data.setPointValueInDouble(0.0);
-                                            resultList.add(data);
-                                        }
-                                    } else {
-                                        PointData data = new PointData();
-                                        data.setEdnaId(pointid);
-                                        data.setPointTime(0l);
-                                        data.setPointValue("0");
-                                        data.setPointName("1");
-                                        data.setPointValueInDouble(0.0);
-                                        resultList.add(data);
-                                    }
-                                } else {
-                                    PointData data = new PointData();
-                                    data.setEdnaId(pointid);
-                                    data.setPointTime(0l);
-                                    data.setPointValue("0");
-                                    data.setPointName("1");
-                                    data.setPointValueInDouble(0.0);
-                                    resultList.add(data);
-                                }
-                            }
-                        }
-
-                        return resultList;
+//                        List<PointData> resultList = new ArrayList<>();
+//
+//                        if (list.isEmpty()) {
+//
+//                            getHistsnapSameTiem(pointid, beginDate, Long.valueOf(pried), resultList);
+//                        } else {
+//                            for (PointData snapItem : list) {
+//                                long subTime = snapItem.getPointTime() - pried;
+//                                //查询时间区间的截面值(截面值为传入时间节点的上一个最近值,返回时间为值的真实时间),
+//                                // 再进行比较,若截面值的时间戳在以快照时间节点前推一个单位的时间区间中,
+//                                // 则代表该时间节点快照有效,否则为0
+//                                String rawUrl = baseURL + "/history/section?null=0&tagNames=" + pointid + "&ts=" + snapItem.getPointTime();
+//                                if (pointid.startsWith("GF-")) {
+//                                    rawUrl = baseURL2 + "/history/section?null=0&tagNames=" + pointid + "&ts=" + snapItem.getPointTime();
+//                                }
+//                                ResponseEntity<JSONObject> sectionResp = restTemplate.getForEntity(rawUrl, JSONObject.class);
+//                                JSONObject jsonObjectSection = sectionResp.getBody();
+//
+//                                if (jsonObjectSection != null) {
+//                                    List<PointData> sectionlist = JsonObjectHelper.phrasePointData(jsonObjectSection);
+//                                    if (sectionlist.size() > 0) {
+//                                        if (sectionlist.get(0).getPointTime() <= snapItem.getPointTime()) {
+//                                            resultList.add(snapItem);
+//                                        } else {
+//                                            PointData data = new PointData();
+//                                            data.setEdnaId(pointid);
+//                                            data.setPointTime(snapItem.getPointTime());
+//                                            data.setPointValue("0");
+//                                            data.setPointName("1");
+//                                            data.setPointValueInDouble(0.0);
+//                                            resultList.add(data);
+//                                        }
+//                                    } else {
+//                                        PointData data = new PointData();
+//                                        data.setEdnaId(pointid);
+//                                        data.setPointTime(0l);
+//                                        data.setPointValue("0");
+//                                        data.setPointName("1");
+//                                        data.setPointValueInDouble(0.0);
+//                                        resultList.add(data);
+//                                    }
+//                                } else {
+//                                    PointData data = new PointData();
+//                                    data.setEdnaId(pointid);
+//                                    data.setPointTime(0l);
+//                                    data.setPointValue("0");
+//                                    data.setPointName("1");
+//                                    data.setPointValueInDouble(0.0);
+//                                    resultList.add(data);
+//                                }
+//                            }
+//                        }
+
+                        return list;
                     } else {
                         return ErrorRequest.RequestListError(pointid);
                     }