7e31164f 张雷

公式功能迁移

1 个父辈 a747d5d8
1 package com.skua.modules.algorithm.controller; 1 package com.skua.modules.dataAnalysis.controller;
2 2
3 3
4 import com.skua.common.constant.ReportConstant; 4 import com.skua.common.constant.ReportConstant;
5 import com.skua.common.report.ReportViewUtil;
6 import com.skua.core.api.vo.Result; 5 import com.skua.core.api.vo.Result;
7 import com.skua.core.aspect.annotation.AutoLog; 6 import com.skua.core.aspect.annotation.AutoLog;
8 import com.skua.core.context.BaseContextHandler; 7 import com.skua.core.context.BaseContextHandler;
9 import com.skua.core.context.SpringContextUtils;
10 import com.skua.core.util.ConvertUtils; 8 import com.skua.core.util.ConvertUtils;
11 import com.skua.modules.algorithm.service.ICommandCentreService; 9 import com.skua.modules.dataAnalysis.service.ICommandCentreService;
12 import com.skua.modules.algorithm.service.impl.ReportItemvService; 10 import com.skua.modules.algorithm.service.impl.ReportItemvService;
13 import com.skua.modules.algorithm.vo.*; 11 import com.skua.modules.algorithm.vo.DepartLoadRateResultVO;
12 import com.skua.modules.algorithm.vo.ReportItemVO;
13 import com.skua.modules.algorithm.vo.StackedAreaChartDataVO;
14 import com.skua.modules.algorithm.vo.WaterTreatmentVO;
14 import com.skua.modules.common.vo.DateVO; 15 import com.skua.modules.common.vo.DateVO;
15 import com.skua.modules.guest.util.DateUtil; 16 import com.skua.modules.guest.util.DateUtil;
16 import com.skua.modules.report.entity.FReportItemv; 17 import com.skua.modules.report.vo.DepartDrugResult;
17 import com.skua.modules.report.vo.*; 18 import com.skua.modules.report.vo.FRportlCommandCenterVO;
18 import com.skua.modules.system.service.ISysConfigService; 19 import com.skua.modules.report.vo.ReportDateTrendVO;
20 import com.skua.modules.report.vo.ReportItemvParam;
19 import com.skua.modules.system.service.ISysFactoryInfoService; 21 import com.skua.modules.system.service.ISysFactoryInfoService;
20 import com.skua.tool.util.DateUtils; 22 import com.skua.tool.util.DateUtils;
21 import com.skua.tool.util.DigitalUtils;
22 import com.skua.tool.util.JSUtils; 23 import com.skua.tool.util.JSUtils;
23 import io.swagger.annotations.Api; 24 import io.swagger.annotations.Api;
24 import io.swagger.annotations.ApiOperation; 25 import io.swagger.annotations.ApiOperation;
25 import lombok.extern.slf4j.Slf4j; 26 import lombok.extern.slf4j.Slf4j;
26 import org.springframework.beans.factory.annotation.Autowired; 27 import org.springframework.beans.factory.annotation.Autowired;
27 import org.springframework.jdbc.core.JdbcTemplate;
28 import org.springframework.web.bind.annotation.GetMapping; 28 import org.springframework.web.bind.annotation.GetMapping;
29 import org.springframework.web.bind.annotation.RequestMapping; 29 import org.springframework.web.bind.annotation.RequestMapping;
30 import org.springframework.web.bind.annotation.RequestParam; 30 import org.springframework.web.bind.annotation.RequestParam;
31 import org.springframework.web.bind.annotation.RestController; 31 import org.springframework.web.bind.annotation.RestController;
32
32 import java.time.LocalDate; 33 import java.time.LocalDate;
33 import java.time.YearMonth; 34 import java.time.YearMonth;
34 import java.time.format.DateTimeFormatter; 35 import java.time.format.DateTimeFormatter;
35 import java.util.*; 36 import java.util.ArrayList;
37 import java.util.List;
36 38
37 /** 39 /**
38 * 统计功能配置表 40 * 统计功能配置表
...@@ -42,6 +44,7 @@ import java.util.*; ...@@ -42,6 +44,7 @@ import java.util.*;
42 @RestController 44 @RestController
43 @RequestMapping("/v1/algorithm/commandCentre") 45 @RequestMapping("/v1/algorithm/commandCentre")
44 public class SysCommandCentreController { 46 public class SysCommandCentreController {
47
45 @Autowired 48 @Autowired
46 private ISysFactoryInfoService factoryInfoService; 49 private ISysFactoryInfoService factoryInfoService;
47 @Autowired 50 @Autowired
...@@ -56,7 +59,7 @@ public class SysCommandCentreController { ...@@ -56,7 +59,7 @@ public class SysCommandCentreController {
56 @AutoLog(value = "指挥中心-水量查询") 59 @AutoLog(value = "指挥中心-水量查询")
57 @ApiOperation(value="指挥中心-水量查询", notes="指挥中心-水量查询") 60 @ApiOperation(value="指挥中心-水量查询", notes="指挥中心-水量查询")
58 @GetMapping(value = "/statisticsByWaterData") 61 @GetMapping(value = "/statisticsByWaterData")
59 public Result<List<FRportlCommandCenterVO>> statisticsByWaterData(ReportItemvParam reportItemvParam)throws Exception{ 62 public Result<List<FRportlCommandCenterVO>> statisticsByWaterData(ReportItemvParam reportItemvParam) throws Exception{
60 Result<List<FRportlCommandCenterVO> > result = new Result<>(); 63 Result<List<FRportlCommandCenterVO> > result = new Result<>();
61 List<FRportlCommandCenterVO> fReportItemvList = new ArrayList<>();//返回集合对象 64 List<FRportlCommandCenterVO> fReportItemvList = new ArrayList<>();//返回集合对象
62 DateVO dateVO = new DateVO(reportItemvParam.getStartDate()); 65 DateVO dateVO = new DateVO(reportItemvParam.getStartDate());
...@@ -70,7 +73,7 @@ public class SysCommandCentreController { ...@@ -70,7 +73,7 @@ public class SysCommandCentreController {
70 long nowDifferDay = DateUtils.differenceDay(dateVO.getNowMonthStartDate(),dateVO.getNowMonthEndDate()); 73 long nowDifferDay = DateUtils.differenceDay(dateVO.getNowMonthStartDate(),dateVO.getNowMonthEndDate());
71 long lastMonthDifferDay = DateUtils.differenceDay(dateVO.getLastMonthStartTime(),dateVO.getLastMonthEndTime()); 74 long lastMonthDifferDay = DateUtils.differenceDay(dateVO.getLastMonthStartTime(),dateVO.getLastMonthEndTime());
72 long lastYearDifferDay = DateUtils.differenceDay(dateVO.getLastYearMonthStartTime(),dateVO.getLastYearMonthEndTime()); 75 long lastYearDifferDay = DateUtils.differenceDay(dateVO.getLastYearMonthStartTime(),dateVO.getLastYearMonthEndTime());
73 //月对象数据String value, String valueTb, String valueHb 76 //月对象数据 value, valueTb, valueHb
74 FRportlCommandCenterVO monthDataVO = new FRportlCommandCenterVO("月汇总数据",JSUtils.divide(monthCSL,10000),JSUtils.divide(lastMonthCSL,10000),JSUtils.divide(lastYearCSL,10000)); 77 FRportlCommandCenterVO monthDataVO = new FRportlCommandCenterVO("月汇总数据",JSUtils.divide(monthCSL,10000),JSUtils.divide(lastMonthCSL,10000),JSUtils.divide(lastYearCSL,10000));
75 //日处理对象 78 //日处理对象
76 FRportlCommandCenterVO avgDayDataVO = new FRportlCommandCenterVO("日均处理水量",JSUtils.divide(monthCSL,nowDifferDay*10000),JSUtils.divide(lastMonthCSL,lastMonthDifferDay*10000),JSUtils.divide(lastYearCSL,lastYearDifferDay*10000)); 79 FRportlCommandCenterVO avgDayDataVO = new FRportlCommandCenterVO("日均处理水量",JSUtils.divide(monthCSL,nowDifferDay*10000),JSUtils.divide(lastMonthCSL,lastMonthDifferDay*10000),JSUtils.divide(lastYearCSL,lastYearDifferDay*10000));
...@@ -80,7 +83,6 @@ public class SysCommandCentreController { ...@@ -80,7 +83,6 @@ public class SysCommandCentreController {
80 //年数据统计: 83 //年数据统计:
81 String total = factoryInfoService.querySumProScale(); 84 String total = factoryInfoService.querySumProScale();
82 total = String.format("%.2f", Double.parseDouble(total)); 85 total = String.format("%.2f", Double.parseDouble(total));
83 // total = DigitalUtils.multiply(total,"10000");
84 fReportItemvList.add( new FRportlCommandCenterVO( total,"0","0")); 86 fReportItemvList.add( new FRportlCommandCenterVO( total,"0","0"));
85 87
86 result.setSuccess(true); 88 result.setSuccess(true);
......
支持 Markdown 格式
你添加了 0 到此讨论。请谨慎行事。
Finish editing this message first!