Pārlūkot izejas kodu

发货前优化提交

wangt 1 gadu atpakaļ
vecāks
revīzija
6498339c4e

+ 3 - 3
wrdep-biz/src/main/java/com/jiayue/biz/job/FileAnalysisJob.java

@@ -58,12 +58,12 @@ public class FileAnalysisJob {
         this.emailImpl = emailImpl;
     }
 
-   // @Scheduled(fixedDelay = 60000)
-    public void fileAnalysis(String str) {
+    @Scheduled(fixedDelay = 60000)
+    public void fileAnalysis() {
 
         log.debug("文件解析定时任务执行开始");
 
-        this.emailImpl.readMail(str);
+        this.emailImpl.readMail();
 
         log.debug("文件解析定时任务执行完成");
 

+ 4 - 12
wrdep-biz/src/main/java/com/jiayue/biz/service/impl/EmailImpl.java

@@ -73,7 +73,7 @@ public class EmailImpl extends ServiceImpl<EmailMapper, Email> implements EmailS
         return emailService.list();
     }
 
-    public void readMail(String str) {
+    public void readMail() {
         List<Email> emails = this.selectEmail();
         for (Email email : emails) {
 
@@ -114,17 +114,9 @@ public class EmailImpl extends ServiceImpl<EmailMapper, Email> implements EmailS
                 log.warn("总邮件个数: {}", folder.getMessageCount());
                 Message[] messages1 = null;
                 FlagTerm ft = new FlagTerm(new Flags(Flags.Flag.SEEN), false); //false代表未读,true代表已读
-                if (!"all".equals(str)) {
-                    log.info("读取近10天的未读邮件 str:{}",str);
-                    Calendar cal = Calendar.getInstance();
-                    cal.add(Calendar.DAY_OF_MONTH, -10);
-                    SearchTerm term = new SentDateTerm(ComparisonTerm.GE, cal.getTime());
-                    SearchTerm comparisonAndTerm = new AndTerm(term, ft);
-                    messages1 = folder.search(comparisonAndTerm);
-                } else {
-                    log.info("读取所有时间的未读邮件 str:{}",str);
-                    messages1 = folder.search(ft);
-                }
+
+                messages1 = folder.search(ft);
+
                 for (Message message : messages1) {
                     //存在附件返回true 不存在返回false
                     Flags flags = message.getFlags();

+ 19 - 62
wrdep-biz/src/main/java/com/jiayue/biz/service/impl/HomePageServiceImpl.java

@@ -1,5 +1,6 @@
 package com.jiayue.biz.service.impl;
 
+import cn.hutool.core.convert.Convert;
 import cn.hutool.core.date.DateTime;
 import cn.hutool.core.util.StrUtil;
 import cn.hutool.db.Entity;
@@ -96,6 +97,14 @@ public class HomePageServiceImpl extends ServiceImpl<WindTowerDataParentTableMap
         ArrayList<String> heightList = new ArrayList<>();
         //循环层高
         for (String height : heights) {
+            //毛武平 在2024年5月7日提出修改需求,项目2 相关的声雷达数据,首页满发小时数据显示100米层高计算结果
+            String xiangmu2WindTower = "202101034,202101047,202101055,202301008,202301016,202101029,202101009";
+            if(xiangmu2WindTower.contains(equipmentId)){
+               int heightTemp = Convert.toInt(height);
+               if(heightTemp>130){
+                   continue;
+               }
+            }
             //获取风速风功率的统计id
             List<EquipmentAttribute> equipmentAttributeWpd = equipmentAttributeList.stream().filter(e -> e.getFieldName().equals(height + "wpdMonth")).collect(Collectors.toList());
             List<EquipmentAttribute> equipmentAttributeWs = equipmentAttributeList.stream().filter(e -> e.getFieldName().equals(height + "awsMonth")).collect(Collectors.toList());
@@ -148,7 +157,7 @@ public class HomePageServiceImpl extends ServiceImpl<WindTowerDataParentTableMap
         Map<String, Long> startAndEnd = prophaseWeatherDataService.getDataTimeStartAndEnd(equipmentId);
 
         if (beginTime.getTime() < startAndEnd.get("startTime")) {
-            beginTime = new Date(startAndEnd.get("startTime"));
+            beginTime = DateUtil.parse(DateUtil.format(new Date(startAndEnd.get("startTime")),"yyyy-MM-dd 00:00:00"));
         }
         Date endTime = lastDataCalculation.getTime();
 
@@ -160,6 +169,14 @@ public class HomePageServiceImpl extends ServiceImpl<WindTowerDataParentTableMap
         ArrayList<String> timeList = new ArrayList();
         boolean type = true;
         for (String height : heights) {
+            //毛武平 在2024年5月7日提出修改需求,项目2 相关的声雷达数据,首页满发小时数据显示100米层高计算结果
+            String xiangmu2WindTower = "202101034,202101047,202101055,202301008,202301016,202101029,202101009";
+            if(xiangmu2WindTower.contains(equipmentId)){
+                int heightTemp = Convert.toInt(height);
+                if(heightTemp>130){
+                    continue;
+                }
+            }
             List<EquipmentAttribute> equipmentAttributes = equipmentAttributeList.stream().filter(e -> e.getFieldName().equals(height + "awsDay")).collect(Collectors.toList());
 
             ArrayList<Object> hList = new ArrayList();
@@ -183,50 +200,6 @@ public class HomePageServiceImpl extends ServiceImpl<WindTowerDataParentTableMap
         everyMap.put("chart", everyData);
         everyMap.put("time", timeList);
 
-//        List<ProphaseAnemometryData> mapList = new ArrayList<>();
-//        if (!month.equals("")) {
-//            SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM");
-//            try {
-//                Date startDate = sdf.parse(month);
-//                Date endDate = DateTimeUtil.endOfMonth(startDate);
-//                mapList = prophaseAnemometryDataService.selectWsAve(equipmentId, new Timestamp(startDate.getTime()), new Timestamp(endDate.getTime()));
-//            } catch (ParseException e) {
-//                e.printStackTrace();
-//            }
-//        } else {
-//            // 最新一天数据
-//            List<Entity> lastData = prophaseWeatherDataService.getLastData(equipmentId);
-//            Timestamp timeEnd = (Timestamp) lastData.get(0).get("last (ts)");
-//            DateTime startTime = DateUtil.beginOfDay(new Date(timeEnd.getTime()));
-//            mapList = prophaseAnemometryDataService.selectWsAve(equipmentId, new Timestamp(startTime.getTime()), timeEnd);
-//
-//        }
-////        HashMap<String, Object> everyMap = new HashMap();
-//        //获取风速层高
-//        List<WindTowerInfo> windTowerInfos = windTowerInfoService.getByEquipmentNo(equipmentId);
-//        String height = windTowerInfos.get(0).getHeights();
-//        String[] heightAll = height.split(",");
-//
-//        // 时间list
-////        ArrayList<String> timeList = new ArrayList();
-////        ArrayList<Object> everyData = new ArrayList<>();
-//
-//        for (String h : heightAll) {
-//            timeList = new ArrayList();
-//            ArrayList<Object> hList = new ArrayList();
-//            HashMap<String, Object> hMap = new HashMap();
-//            //根据层高过滤时间和风速
-//            TreeMap<Long, Float> heightForTimeAndWs = new TreeMap<>(mapList.stream().filter(p -> p.getLayerHeight().equals(h))
-//                    .collect(Collectors.toMap(prophaseAnemometryData -> prophaseAnemometryData != null ? prophaseAnemometryData.getTs().getTime() : null, prophaseAnemometryData1 -> prophaseAnemometryData1 != null ? prophaseAnemometryData1.getWsAve() : null)));
-//            for (Map.Entry<Long, Float> entry : heightForTimeAndWs.entrySet()) {
-//                String time = DateUtil.format(new Date(entry.getKey()), "yyyy-MM-dd HH:mm:ss");
-//                timeList.add(time);
-//                hList.add(entry.getValue());
-//            }
-//            hMap.put("height", h);
-//            hMap.put("value", hList);
-//            everyData.add(hMap);
-//        }
 
 
         return everyMap;
@@ -275,22 +248,6 @@ public class HomePageServiceImpl extends ServiceImpl<WindTowerDataParentTableMap
                     StatisticsSituation statisticsSituation = statisticsSituations.get(0);
                     String[] split = statisticsSituation.getStartTimeAndEndTime().split(",");
                     info = info + "数据起止时间:" + sdf.format(new Date(Long.parseLong(split[0]))) + " - " + sdf.format(new Date(Long.parseLong(split[1])));
-//                    if (statisticsSituation.getWsAve140() != null)
-//                        info = info + ";140米风速:" + statisticsSituation.getWsAve140().setScale(2, RoundingMode.HALF_UP);
-//                    if (statisticsSituation.getWsAve120() != null)
-//                        info = info + ";120米风速:" + statisticsSituation.getWsAve120().setScale(2, RoundingMode.HALF_UP);
-//                    if (statisticsSituation.getWsAve100() != null)
-//                        info = info + ";100米风速:" + statisticsSituation.getWsAve100().setScale(2, RoundingMode.HALF_UP);
-//                    if (statisticsSituation.getWsAve80() != null)
-//                        info = info + ";80米风速:" + statisticsSituation.getWsAve80().setScale(2, RoundingMode.HALF_UP);
-//                    if (statisticsSituation.getWsAve70() != null)
-//                        info = info + ";70米风速:" + statisticsSituation.getWsAve70().setScale(2, RoundingMode.HALF_UP);
-//                    if (statisticsSituation.getWsAve50() != null)
-//                        info = info + ";50米风速:" + statisticsSituation.getWsAve50().setScale(2, RoundingMode.HALF_UP);
-//                    if (statisticsSituation.getWsAve30() != null)
-//                        info = info + ";30米风速:" + statisticsSituation.getWsAve30().setScale(2, RoundingMode.HALF_UP);
-//                    if (statisticsSituation.getWsAve10() != null)
-//                        info = info + ";10米风速:" + statisticsSituation.getWsAve10().setScale(2, RoundingMode.HALF_UP);
                 }
                 if (!maps.isEmpty()) {
                     defectCount = new BigDecimal(maps.get(0).get("num").toString()).subtract(new BigDecimal(144));
@@ -594,7 +551,7 @@ public class HomePageServiceImpl extends ServiceImpl<WindTowerDataParentTableMap
     public BigDecimal getDataForCalculationByEb(List<EquipmentAttribute> equipmentAttributeList, List<WindTowerCalculationData> windTowerCalculationDataList, String fieldName) {
         List<String> ebId = equipmentAttributeList.stream().filter(e -> e.getFieldName().equals(fieldName)).map(EquipmentAttribute::getId).collect(Collectors.toList());
 
-        List<BigDecimal> dataList = windTowerCalculationDataList.stream().filter(w -> w.getEbId().equals(ebId.get(0)) && w.getValue().doubleValue()>=0).map(WindTowerCalculationData::getValue).collect(Collectors.toList());
+        List<BigDecimal> dataList = windTowerCalculationDataList.stream().filter(w -> w.getEbId().equals(ebId.get(0))).map(WindTowerCalculationData::getValue).collect(Collectors.toList());
 
         return dataList.size() > 0 ? CalculationUtil.getAvgWind(dataList) : BigDecimal.ZERO;
 

+ 1 - 1
wrdep-biz/src/main/resources/application-prod.yml

@@ -21,7 +21,7 @@ spring:
         mysql:
           url: jdbc:mysql://127.0.0.1:3306/wrdep_db?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8&autoReconnect=true&rewriteBatchedStatements=true
           username: root
-          password: 'eDYlNXLZGDz0ovpg'
+          password: '!QAZ2root'
           driver-class-name: com.mysql.cj.jdbc.Driver
           type: com.alibaba.druid.pool.DruidDataSource
           druid:

+ 1 - 1
wrdep-ui/src/views/largeScreenPage/Subpage/emailResourcesInfo.vue

@@ -195,7 +195,7 @@
             <!--  标题-->
             <div class="rightTiltleTextBg">
               <div class="tiltle">
-                <span class="mainTitle">风能玫瑰图1</span>
+                <span class="mainTitle">风能玫瑰图</span>
               </div>
             </div>
             <!-- 内容  -->