Procházet zdrojové kódy

数据分析的pdf

zy před 2 roky
rodič
revize
e98e932f5d

+ 20 - 0
wrdep-biz/src/main/java/com/jiayue/biz/controller/dataAnalysisPdfController.java

@@ -0,0 +1,20 @@
+package com.jiayue.biz.controller;
+
+import com.jiayue.common.core.controller.BaseController;
+import lombok.RequiredArgsConstructor;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RestController;
+
+/**
+ * 首页Controller
+ *
+ * @author L.ym
+ * @date 2022-05-11
+ */
+@RequiredArgsConstructor(onConstructor_ = @Autowired)
+@RestController
+@RequestMapping("/dataQuery/dataAnalysisPdf")
+public class dataAnalysisPdfController extends BaseController {
+
+}

+ 18 - 0
wrdep-biz/src/main/java/com/jiayue/biz/service/DataAnalysisPdfService.java

@@ -0,0 +1,18 @@
+package com.jiayue.biz.service;
+
+import com.baomidou.mybatisplus.extension.service.IService;
+import com.jiayue.biz.domain.WindTowerDataParentTable;
+
+import java.util.Date;
+import java.util.List;
+import java.util.Map;
+
+/**
+ * 首页Service接口
+ *
+ * @author L.ym
+ * @date 2022-05-11
+ */
+public interface DataAnalysisPdfService extends IService<WindTowerDataParentTable> {
+    Map<String, Object> generatePDF(String equipmentId, String height, Date startDay, Date endDay);
+}

+ 62 - 0
wrdep-biz/src/main/java/com/jiayue/biz/service/impl/DataAnalysisServiceImpl.java

@@ -0,0 +1,62 @@
+package com.jiayue.biz.service.impl;
+
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import com.jiayue.biz.domain.*;
+import com.jiayue.biz.eunms.WindDirectionEnum;
+import com.jiayue.biz.mapper.WindTowerDataParentTableMapper;
+import com.jiayue.biz.service.*;
+import com.jiayue.biz.util.CalculationUtil;
+import com.jiayue.biz.util.DateMomentUtil;
+import com.jiayue.biz.util.DateTimeUtil;
+import com.jiayue.common.utils.DateUtil;
+import flanagan.analysis.ProbabilityPlot;
+import lombok.AllArgsConstructor;
+import org.apache.commons.lang3.time.DateUtils;
+import org.springframework.stereotype.Service;
+
+import java.math.BigDecimal;
+import java.math.RoundingMode;
+import java.text.SimpleDateFormat;
+import java.util.*;
+import java.util.stream.Collectors;
+
+/**
+ * 首页Service业务层处理
+ *
+ * @author L.ym
+ * @date 2022-05-11
+ */
+@Service
+@AllArgsConstructor
+public class DataAnalysisServiceImpl extends ServiceImpl<WindTowerDataParentTableMapper, WindTowerDataParentTable> implements DataAnalysisPdfService {
+    private final WindTowerInfoServiceImpl windTowerInfoService;
+    private final WindTowerCalculationDataServiceImpl windTowerCalculationDataService;
+    private final EquipmentAttributeService equipmentAttributeService;
+
+
+    private final RealTimeDisplayService realTimeDisplayService;
+
+    private final WindDirectionStatisticsDataServiceImpl windDirectionStatisticsDataService;
+    private final WindTowerDataParentTableService windTowerDataParentTableService;
+
+
+
+    @Override
+    public Map<String, Object> generatePDF(String equipmentId, String height, Date startDay, Date endDay) {
+        //如果结束时间大于现在时间
+        if (DateUtil.date().getTime() < endDay.getTime()) {
+            //将结束时间设置为昨天结束时间
+            endDay = DateUtil.endOfDay(DateUtil.yesterday());
+        }
+        Map<String, Object> map = new HashMap<>();
+        SimpleDateFormat sdfTime = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
+        long realityCount = 0;//数据实际条数
+        // 一年的计算数据
+        startDay = DateUtil.beginOfMonth(startDay);
+        endDay = DateUtil.endOfMonth(endDay);
+
+        return map;
+    }
+
+
+}

binární
wrdep-ui/public/img/background.png


+ 40 - 0
wrdep-ui/src/views/dataAnalysis/index.vue

@@ -0,0 +1,40 @@
+<template>
+  <div>
+    <div class="myCarousel">
+      <span>{{text}}</span>
+    </div>
+    <div>
+      <pdf-home-page :param="info"/>
+    </div>
+  </div>
+
+</template>
+
+<script>
+import pdfHomePage from './pdfHomePage'
+export default {
+  name: "index",
+  components: {pdfHomePage},
+  data(){
+    return{
+      text: '****  生成pdf报告流程:  1.选择测风塔和层高    2.生成报告模板    3.导出  ****',
+      /*pdf数据*/
+      info: {equipmentId:'声雷达6172'},
+    }
+  }
+}
+</script>
+
+<style scoped>
+.myCarousel {
+  width: 600px;
+  height: 30px;
+  background-color: #ffba00;
+  border-radius: 5px;
+  color: #f8f8f8;
+  display: flex;
+  justify-content: center;
+  align-items: center;
+}
+
+</style>

+ 73 - 0
wrdep-ui/src/views/dataAnalysis/pdfHomePage.vue

@@ -0,0 +1,73 @@
+<template>
+  <div class="homePage">
+    <div class="divBox">
+      <span class="pdfTitle">
+        {{this.info.equipmentId}}测风塔测风数据年度报告
+      </span>
+      <span class="dateSpan">{{date}}</span>
+    </div>
+  </div>
+</template>
+
+<script>
+  export default {
+    name: "pdfHomePage",
+    props: {
+      param: {
+        type: Object,
+      }
+    },
+    data() {
+      return {
+        info: this.param,
+        height: null,
+        date:''
+      }
+    },
+    watch: {
+      param: function (newValue, oldValue) { // 根据父组件传过来的场站id来查询对应层高的风速和风向
+        this.info = newValue
+      }
+    },
+    mounted() {
+      this.init()
+    },
+    methods:{
+      init(){
+        let date = new Date()
+        let year = date.getFullYear()
+        let month = date.getMonth()+1
+        let day = date.getDate()
+        this.date = year + ' 年 '+month+' 月 '+day +' 日'
+      }
+    }
+  }
+</script>
+
+<style scoped>
+  .homePage {
+    width: 100%;
+    height: 2246px;
+    background: url("../../../public/img/background.png") no-repeat;
+    background-size: 100% 100%;
+  }
+  .divBox{
+    height: 2246px;
+    display: flex;
+    flex-direction: column;
+  }
+  .pdfTitle{
+    font-weight: bolder;
+    font-size: 50px;
+    margin-top: 50%;
+    display: flex;
+    justify-content: center;
+  }
+  .dateSpan{
+    font-weight: bolder;
+    font-size: 40px;
+    margin-top: 70%;
+    display: flex;
+    justify-content: center;
+  }
+</style>