d8f9987d 康伟

kangwei :药耗分析接口,对外集团展示大屏接口

1 个父辈 c2c1cbd9
正在显示 18 个修改的文件 包含 508 行增加39 行删除
...@@ -85,6 +85,8 @@ public class ReportViewUtil { ...@@ -85,6 +85,8 @@ public class ReportViewUtil {
85 return sb.toString(); 85 return sb.toString();
86 } 86 }
87 87
88
89
88 /** 90 /**
89 * <pre> 91 * <pre>
90 * 构造填报报表视图,时间模糊搜索 92 * 构造填报报表视图,时间模糊搜索
...@@ -230,7 +232,6 @@ public class ReportViewUtil { ...@@ -230,7 +232,6 @@ public class ReportViewUtil {
230 * @return 232 * @return
231 */ 233 */
232 public static String buildViewLike(String reportId,String fields,String departIds,String startTime,String endTime,String operatorSign) { 234 public static String buildViewLike(String reportId,String fields,String departIds,String startTime,String endTime,String operatorSign) {
233
234 //运算符号operatorSign 235 //运算符号operatorSign
235 if(StringUtils.isEmpty(operatorSign)) operatorSign = "sum"; 236 if(StringUtils.isEmpty(operatorSign)) operatorSign = "sum";
236 String inSqlPart = ""; 237 String inSqlPart = "";
......
1 package com.skua.modules.common.vo; 1 package com.skua.modules.common.vo;
2 2
3 import com.skua.core.util.DateUtils; 3 import com.skua.tool.util.DateUtils;
4 import io.swagger.annotations.ApiModelProperty; 4 import io.swagger.annotations.ApiModelProperty;
5 import lombok.Data; 5 import lombok.Data;
6 import org.apache.commons.lang3.StringUtils;
7
8 import java.text.ParseException;
9 import java.text.SimpleDateFormat;
10 import java.util.Calendar;
11 import java.util.Date;
12 6
13 @Data 7 @Data
14 public class DateVO { 8 public class DateVO {
...@@ -22,13 +16,21 @@ public class DateVO { ...@@ -22,13 +16,21 @@ public class DateVO {
22 private String lastYearStartDate; 16 private String lastYearStartDate;
23 @ApiModelProperty(value = "去年(yyyy-MM-dd)") 17 @ApiModelProperty(value = "去年(yyyy-MM-dd)")
24 private String lastYearEndDate; 18 private String lastYearEndDate;
19 @ApiModelProperty(value = "去年月开始时间(yyyy-MM-dd)")
20 private String lastYearMonthStartTime;
21 @ApiModelProperty(value = "上月结束时间(yyyy-MM-dd)")
22 private String lastYearMonthEndTime;
25 23
26 24
27 @ApiModelProperty(value = "上月(yyyy-MM)") 25 @ApiModelProperty(value = "上月(yyyy-MM)")
28 private String lastMonth; 26 private String lastMonth;
29
30 @ApiModelProperty(value = "上月(yyyy-MM-dd)") 27 @ApiModelProperty(value = "上月(yyyy-MM-dd)")
31 private String lastMonthDay; 28 private String lastMonthDay;
29 @ApiModelProperty(value = "上月开始时间(yyyy-MM-dd)")
30 private String lastMonthStartTime;
31 @ApiModelProperty(value = "上月结束时间(yyyy-MM-dd)")
32 private String lastMonthEndTime;
33
32 34
33 35
34 @ApiModelProperty(value = "昨天") 36 @ApiModelProperty(value = "昨天")
...@@ -56,17 +58,26 @@ public class DateVO { ...@@ -56,17 +58,26 @@ public class DateVO {
56 this.nowMonth = DateUtils.dateformat(currentDate,"yyyy-MM"); 58 this.nowMonth = DateUtils.dateformat(currentDate,"yyyy-MM");
57 this.nowMonthStartDate = nowMonth+"-01"; 59 this.nowMonthStartDate = nowMonth+"-01";
58 this.nowMonthEndDate = nowMonth+"-31"; 60 this.nowMonthEndDate = nowMonth+"-31";
59 61 this.nowYearStartDate = nowYear + "-01-01";
60 62 this.nowYearEndDate = nowYear + "-12-31";
61 //this.lastYear = getYear(nowMonth,"yyyy-MM")-1; 63
62 //this.lastMonth = DateUtils.getLastMonthOfMonth(nowMonth); 64 this.nowYear = Integer.parseInt(DateUtils.dateformat(currentDate,"yyyy"));
63 nowYear = Integer.parseInt( DateUtils.dateformat(currentDate,"yyyy") ) ; 65 //同比时间
64 nowYearStartDate = nowYear + "-01-01"; 66 this.lastYear = nowYear -1 ;//去年
65 nowYearEndDate = nowYear + "-12-31"; 67 this.lastYearMonth = DateUtils.getHbMonth(currentDate);
66 /* this.lastMonthStartTime = lastMonth+"-01"; 68 System.out.println(" lastYearMonth "+lastYearMonth);
69 this.lastYearMonthStartTime = lastYearMonth+"-01";
70 this.lastYearMonthStartTime = lastYearMonth+"-31";
71 this.lastYearStartDate = this.lastYear+"-01-01";
72 this.lastYearEndDate = this.lastYear+"-12-31";
73
74 //环比时间
75 this.lastMonth = DateUtils.getHbMonth(currentDate);//
76 this.lastMonthStartTime = lastMonth+"-01";
67 this.lastMonthEndTime = lastMonth+"-31"; 77 this.lastMonthEndTime = lastMonth+"-31";
68 78
69 this.lastYearStartTime = lastYear+"-01"; 79 //this.lastYearStartTime = lastYear+"-01";
70 this.lastYearEndTime = lastYear +"-31";*/ 80 // this.lastYearEndTime = lastYear +"-31";
71 } 81 }
72 } 82 }
83
......
...@@ -21,6 +21,37 @@ import java.util.*; ...@@ -21,6 +21,37 @@ import java.util.*;
21 */ 21 */
22 public class DateUtils { 22 public class DateUtils {
23 23
24 public static String dateformat(String date,String format){
25 SimpleDateFormat sdf = new SimpleDateFormat(format);
26 return sdf.format(str2Date(date,format));
27 }
28 public static Date str2Date(String str, String pattern) {
29 Date d = null;
30 SimpleDateFormat sdf = new SimpleDateFormat(pattern);
31 try {
32 d = sdf.parse(str);
33 } catch (Exception e) {
34 e.printStackTrace();
35 }
36 return d;
37 }
38
39 /**
40 * 两个时间相差的天数
41 * @param day1
42 * @param day2
43 * @return
44 */
45 public static long differenceDay(String day1 ,String day2){
46 String format = "yyyy-MM-dd";
47 Date startDay = str2Date(day1,format);
48 Date endDay = str2Date(day2,format);
49
50 long msNum = endDay.getTime() - startDay.getTime();
51 long dayNUm = msNum /(24*60*60*1000);
52
53 return dayNUm;
54 }
24 /** 55 /**
25 * 根据(开始时间, 结束时间)获取每一个时间间隔的数据, 主要用于eCharts图标xData 56 * 根据(开始时间, 结束时间)获取每一个时间间隔的数据, 主要用于eCharts图标xData
26 * 57 *
......
...@@ -129,7 +129,6 @@ public class BaseUtil { ...@@ -129,7 +129,6 @@ public class BaseUtil {
129 return sb.toString(); 129 return sb.toString();
130 } 130 }
131 return str; 131 return str;
132
133 } 132 }
134 133
135 /** 134 /**
......
...@@ -2,9 +2,8 @@ package com.skua.modules.threedimensional.controller; ...@@ -2,9 +2,8 @@ package com.skua.modules.threedimensional.controller;
2 2
3 import com.skua.core.api.vo.Result; 3 import com.skua.core.api.vo.Result;
4 import com.skua.core.aspect.annotation.AutoLog; 4 import com.skua.core.aspect.annotation.AutoLog;
5 import com.skua.modules.report.vo.JnhbReportData;
6 import com.skua.modules.threedimensional.service.IJTDisplayScreenService; 5 import com.skua.modules.threedimensional.service.IJTDisplayScreenService;
7 import com.skua.modules.threedimensional.vo.SysFactoryInfoVO; 6 import com.skua.modules.threedimensional.vo.*;
8 import io.swagger.annotations.Api; 7 import io.swagger.annotations.Api;
9 import io.swagger.annotations.ApiOperation; 8 import io.swagger.annotations.ApiOperation;
10 import lombok.extern.slf4j.Slf4j; 9 import lombok.extern.slf4j.Slf4j;
...@@ -32,4 +31,43 @@ public class JTDisplayScreenController { ...@@ -32,4 +31,43 @@ public class JTDisplayScreenController {
32 result.setResult(list); 31 result.setResult(list);
33 return result; 32 return result;
34 } 33 }
34
35
36 //
37 @AutoLog(value = "项目运营情况")
38 @ApiOperation(value = "项目运营情况", notes = "项目运营情况")
39 @GetMapping("/projectOperationInfo")
40 private Result<ProjectOperationInfoVO> getProjectOperationInfo(String departId, String startTime, String endTime){
41 Result<ProjectOperationInfoVO> result = new Result<>();
42 ProjectOperationInfoVO projectOperationInfoVO = displayScreenService.getProjectOperationInfo(departId ,startTime ,endTime);
43 result.setResult(projectOperationInfoVO);
44 return result;
45 }
46 @AutoLog(value = "水量趋势")
47 @ApiOperation(value = "水量趋势", notes = "水量趋势")
48 @GetMapping("/waterTrend")
49 private Result<List<WaterTrendVO>> waterTrend(String departId, String startTime, String endTime){
50 Result<List<WaterTrendVO>> result = new Result<>();
51 List<WaterTrendVO> list = displayScreenService.queryWaterTrend(departId ,startTime ,endTime);
52 result.setResult(list);
53 return result;
54 }
55 @AutoLog(value = "水质水量:左侧统计数据")
56 @ApiOperation(value = "水质水量:左侧统计数据", notes = "水质水量:左侧统计数据")
57 @GetMapping("/waterQuality")
58 private Result<WaterQualityVO> waterQuality(String departId, String startTime, String endTime){
59 Result<WaterQualityVO> result = new Result<>();
60 WaterQualityVO waterQualityVO = displayScreenService.queryWaterQuality(departId ,startTime ,endTime);
61 result.setResult(waterQualityVO);
62 return result;
63 }
64 @AutoLog(value = "水质水量:右侧图表")
65 @ApiOperation(value = "水质水量:右侧图表", notes = "水质水量:右侧图表")
66 @GetMapping("/waterQualityCchart")
67 private Result<List<WaterQualityChartVO>> waterQualityCchart(String departId, String startTime, String endTime){
68 Result<List<WaterQualityChartVO>> result = new Result<>();
69 List<WaterQualityChartVO> waterTrendVOList = displayScreenService.queryWaterQualityChart(departId ,startTime ,endTime);
70 result.setResult(waterTrendVOList);
71 return result;
72 }
35 } 73 }
......
1 package com.skua.modules.threedimensional.service; 1 package com.skua.modules.threedimensional.service;
2 2
3 import com.skua.modules.threedimensional.vo.ProjectOperationInfoVO; 3
4 import com.skua.modules.threedimensional.vo.SysFactoryInfoVO; 4 import com.skua.modules.threedimensional.vo.*;
5
5 import java.util.List; 6 import java.util.List;
6 7
7 /** 8 /**
...@@ -14,10 +15,38 @@ public interface IJTDisplayScreenService { ...@@ -14,10 +15,38 @@ public interface IJTDisplayScreenService {
14 * @return 15 * @return
15 */ 16 */
16 List<SysFactoryInfoVO> getFactoryList( ); 17 List<SysFactoryInfoVO> getFactoryList( );
17
18 /** 18 /**
19 *对外展示集团大屏 : 项目运营情况 19 * 项目运营情况
20 * @param departId
21 * @param startTime
22 * @param endTime
23 * @return
24 */
25 ProjectOperationInfoVO getProjectOperationInfo(String departId, String startTime, String endTime);
26
27 /***
28 * 水量趋势
29 * @param departId
30 * @param startTime
31 * @param endTime
32 * @return
33 */
34 List<WaterTrendVO> queryWaterTrend(String departId, String startTime, String endTime);
35
36 /***
37 * 水质水量数据
38 * @param departId
39 * @param startTime
40 * @param endTime
41 * @return
42 */
43 WaterQualityVO queryWaterQuality(String departId, String startTime, String endTime);
44 /***
45 * 水质水量图标数据
46 * @param departId
47 * @param startTime
48 * @param endTime
20 * @return 49 * @return
21 */ 50 */
22 ProjectOperationInfoVO getProjectOperationInfo(); 51 List<WaterQualityChartVO> queryWaterQualityChart(String departId, String startTime, String endTime);
23 } 52 }
......
1 package com.skua.modules.threedimensional.vo;
2
3 import io.swagger.annotations.ApiModel;
4 import io.swagger.annotations.ApiModelProperty;
5 import lombok.Data;
6
7 /**
8 * 对外展示集团大屏
9 */
10 @Data
11 @ApiModel(value="对外展示集团大屏:水量趋势", description="对外展示集团大屏:水量趋势")
12 public class WaterQualityChartVO {
13
14 @ApiModelProperty(value = "时间")
15 private String time;
16
17 @ApiModelProperty(value = "处理水量")
18 private String jsl;
19
20 //'CSCOD', 'CSTN', 'CSTP', 'CSNH3N'
21 @ApiModelProperty(value = "出水COD")
22 private String cod;
23
24 @ApiModelProperty(value = "TN消减量(吨)")
25 private String tn;
26
27 @ApiModelProperty(value = "TP消减量(吨)")
28 private String tp;
29
30 @ApiModelProperty(value = "NH3-N消减量(吨)")
31 private String ad;
32 }
1 package com.skua.modules.threedimensional.vo;
2
3 import io.swagger.annotations.ApiModel;
4 import io.swagger.annotations.ApiModelProperty;
5 import lombok.Data;
6
7 import java.math.BigDecimal;
8
9 /**
10 * 对外展示集团大屏
11 */
12 @Data
13 @ApiModel(value="对外展示集团大屏:水量趋势", description="对外展示集团大屏:水量趋势")
14 public class WaterQualityVO {
15 @ApiModelProperty(value = "出水量")
16 private BigDecimal csl;
17 @ApiModelProperty(value = "运行负荷率")
18 private Double yxfhl;
19
20 @ApiModelProperty(value = "cod消减量")
21 private Double codxjl;
22
23 @ApiModelProperty(value = "NH3N消减两")
24 private Double adxjl;
25
26 @ApiModelProperty(value = "脱泥量")
27 private Double tnl;
28
29 @ApiModelProperty(value = "吨水电耗")
30 private Double dsdh;
31 @ApiModelProperty(value = "吨水药消")
32 private Double dsyh;
33 }
1 package com.skua.modules.threedimensional.vo;
2
3 import io.swagger.annotations.ApiModel;
4 import io.swagger.annotations.ApiModelProperty;
5 import lombok.Data;
6
7 /**
8 * 对外展示集团大屏
9 */
10 @Data
11 @ApiModel(value="对外展示集团大屏:水量趋势", description="对外展示集团大屏:水量趋势")
12 public class WaterTrendVO {
13
14 @ApiModelProperty(value = "时间")
15 private String time;
16
17 @ApiModelProperty(value = "进水量")
18 private String jsl;
19
20 @ApiModelProperty(value = "出水量")
21 private String csl;
22 }
...@@ -35,6 +35,8 @@ public class OperationReportServiceImpl implements IOperationReportService { ...@@ -35,6 +35,8 @@ public class OperationReportServiceImpl implements IOperationReportService {
35 SeasonTimeVO seasonTimeVO = new SeasonTimeVO(year ,season ); 35 SeasonTimeVO seasonTimeVO = new SeasonTimeVO(year ,season );
36 SeasonTimeVO lastSeasonTimeVO = new SeasonTimeVO(lastYear ,season ); 36 SeasonTimeVO lastSeasonTimeVO = new SeasonTimeVO(lastYear ,season );
37 37
38 productDataVO.setStartTime(seasonTimeVO.getStartTime());
39 productDataVO.setEndTime( seasonTimeVO.getEndTime());
38 //水务公司总数 40 //水务公司总数
39 String sql = "select count(1) from sys_depart where depart_type = 1"; 41 String sql = "select count(1) from sys_depart where depart_type = 1";
40 String deptartCount = queryForString(sql); 42 String deptartCount = queryForString(sql);
......
...@@ -15,6 +15,12 @@ import java.util.List; ...@@ -15,6 +15,12 @@ import java.util.List;
15 public class ProductDataVO { 15 public class ProductDataVO {
16 @ApiModelProperty(value = "去年") 16 @ApiModelProperty(value = "去年")
17 private String lastYear; 17 private String lastYear;
18
19 @ApiModelProperty(value = "季度开始时间")
20 private String startTime;
21
22 @ApiModelProperty(value = "季度结束时间")
23 private String endTime;
18 @ApiModelProperty(value = "水务厂站数量") 24 @ApiModelProperty(value = "水务厂站数量")
19 private String deptartCount; 25 private String deptartCount;
20 @ApiModelProperty(value = "收费水量") 26 @ApiModelProperty(value = "收费水量")
......
...@@ -2,16 +2,18 @@ package com.skua.modules.equipment.controller; ...@@ -2,16 +2,18 @@ package com.skua.modules.equipment.controller;
2 2
3 import com.skua.core.api.vo.Result; 3 import com.skua.core.api.vo.Result;
4 import com.skua.core.aspect.annotation.AutoLog; 4 import com.skua.core.aspect.annotation.AutoLog;
5 import com.skua.modules.equipment.dto.DrugDto;
6 import com.skua.modules.equipment.service.IDrugConsumptionAnalysisService; 5 import com.skua.modules.equipment.service.IDrugConsumptionAnalysisService;
6 import com.skua.modules.equipment.vo.CorrelationAnalysisVO;
7 import com.skua.modules.equipment.vo.DrugConsumptionDisplayVO;
8 import com.skua.modules.equipment.vo.DrugConsumptionTrendChartVO;
7 import io.swagger.annotations.Api; 9 import io.swagger.annotations.Api;
8 import io.swagger.annotations.ApiOperation; 10 import io.swagger.annotations.ApiOperation;
9 import lombok.extern.slf4j.Slf4j; 11 import lombok.extern.slf4j.Slf4j;
10 import org.springframework.beans.factory.annotation.Autowired; 12 import org.springframework.beans.factory.annotation.Autowired;
13 import org.springframework.web.bind.annotation.GetMapping;
11 import org.springframework.web.bind.annotation.RequestMapping; 14 import org.springframework.web.bind.annotation.RequestMapping;
12 import org.springframework.web.bind.annotation.RequestMethod;
13 import org.springframework.web.bind.annotation.RestController; 15 import org.springframework.web.bind.annotation.RestController;
14 import java.util.Map; 16 import java.util.List;
15 17
16 @Slf4j 18 @Slf4j
17 @Api(tags = "药耗分析") 19 @Api(tags = "药耗分析")
...@@ -24,6 +26,63 @@ public class DrugConsumptionAnalysisController { ...@@ -24,6 +26,63 @@ public class DrugConsumptionAnalysisController {
24 26
25 @AutoLog(value = "数据展示") 27 @AutoLog(value = "数据展示")
26 @ApiOperation(value = "数据展示", notes = "数据展示") 28 @ApiOperation(value = "数据展示", notes = "数据展示")
29 @GetMapping("/data/display")
30 public Result<DrugConsumptionDisplayVO> dataDisplay(String time, String departId) {
31 Result<DrugConsumptionDisplayVO> result = new Result<>();
32 DrugConsumptionDisplayVO data = drugConsumptionAnalysisService.dataDisplay(time,departId);
33 result.setResult(data);
34 return result;
35 }
36 @AutoLog(value = "总药耗趋势")
37 @ApiOperation(value = "总药耗趋势", notes = "总药耗趋势")
38 @GetMapping("/data/drugConsumptionTrend")
39 public Result<List<DrugConsumptionTrendChartVO>> drugConsumptionTrend(String time, String departId) {
40 Result<List<DrugConsumptionTrendChartVO>> result = new Result<>();
41 List<DrugConsumptionTrendChartVO> data = drugConsumptionAnalysisService.drugConsumptionTrend(time,departId);
42 result.setResult(data);
43 return result;
44 }
45 @AutoLog(value = "吨水药耗趋势")
46 @ApiOperation(value = "吨水药耗趋势", notes = "吨水药耗趋势")
47 @GetMapping("/data/consumptionTonOfWaterTrend")
48 public Result<List<DrugConsumptionTrendChartVO>> consumptionTonOfWaterTrend(String time, String departId) {
49 Result<List<DrugConsumptionTrendChartVO>> result = new Result<>();
50 List<DrugConsumptionTrendChartVO> data = drugConsumptionAnalysisService.consumptionTonOfWaterTrend(time,departId);
51 result.setResult(data);
52 return result;
53 }
54 @AutoLog(value = "药剂占比统计")
55 @ApiOperation(value = "药剂占比统计 type 1.按明细 2.按类型", notes = "药剂占比统计 type 1.按明细 2.按类型")
56 @GetMapping("/data/proportionStatistics")
57 public Result<List<DrugConsumptionDisplayVO>> proportionStatistics(String time, String departId) {
58 Result<List<DrugConsumptionDisplayVO>> result = new Result<>();
59 List<DrugConsumptionDisplayVO> data = drugConsumptionAnalysisService.proportionStatistics(time ,departId);
60 result.setResult(data);
61 return result;
62 }
63
64
65 @AutoLog(value = "相关性分析")
66 @ApiOperation(value = "相关性分析 统计类型下拉框", notes = "相关性分析 统计类型下拉框")
67 @GetMapping("/correlation/analysisType")
68 public Result<List<DrugConsumptionDisplayVO>> analysisType() {
69 Result<List<DrugConsumptionDisplayVO>> result = new Result<>();
70 List<DrugConsumptionDisplayVO> data = drugConsumptionAnalysisService.analysisType();
71 result.setResult(data);
72 return result;
73 }
74 @AutoLog(value = "相关性分析")
75 @ApiOperation(value = "相关性分析 type 1.絮凝剂 2.碳源 3.除磷剂", notes = "相关性分析 type 1.絮凝剂 2.碳源 3.除磷剂")
76 @GetMapping("/correlation/analysis")
77 public Result<List<CorrelationAnalysisVO>> correlationAnalysis(String time, String drugCode, String departId) {
78 Result<List<CorrelationAnalysisVO>> result = new Result<>();
79 List<CorrelationAnalysisVO> data = drugConsumptionAnalysisService.correlationAnalysis(time,drugCode ,departId);
80 result.setResult(data);
81 return result;
82 }
83
84 /* @AutoLog(value = "数据展示")
85 @ApiOperation(value = "数据展示", notes = "数据展示")
27 @RequestMapping(value = "/data/display", method = RequestMethod.GET) 86 @RequestMapping(value = "/data/display", method = RequestMethod.GET)
28 public Result<Map<String, Object>> dataDisplay(String time,String departId) { 87 public Result<Map<String, Object>> dataDisplay(String time,String departId) {
29 Result<Map<String, Object>> result = new Result<>(); 88 Result<Map<String, Object>> result = new Result<>();
...@@ -34,6 +93,8 @@ public class DrugConsumptionAnalysisController { ...@@ -34,6 +93,8 @@ public class DrugConsumptionAnalysisController {
34 } 93 }
35 94
36 95
96
97
37 @AutoLog(value = "总药耗趋势") 98 @AutoLog(value = "总药耗趋势")
38 @ApiOperation(value = "总药耗趋势", notes = "总药耗趋势") 99 @ApiOperation(value = "总药耗趋势", notes = "总药耗趋势")
39 @RequestMapping(value = "/drug/consumption/trend", method = RequestMethod.GET) 100 @RequestMapping(value = "/drug/consumption/trend", method = RequestMethod.GET)
...@@ -109,5 +170,5 @@ public class DrugConsumptionAnalysisController { ...@@ -109,5 +170,5 @@ public class DrugConsumptionAnalysisController {
109 result.setResult(data); 170 result.setResult(data);
110 result.setSuccess(true); 171 result.setSuccess(true);
111 return result; 172 return result;
112 } 173 }*/
113 } 174 }
......
...@@ -2,24 +2,31 @@ package com.skua.modules.equipment.service; ...@@ -2,24 +2,31 @@ package com.skua.modules.equipment.service;
2 2
3 3
4 import com.skua.modules.equipment.dto.DrugDto; 4 import com.skua.modules.equipment.dto.DrugDto;
5 import com.skua.modules.equipment.vo.CorrelationAnalysisVO;
6 import com.skua.modules.equipment.vo.DrugConsumptionDisplayVO;
7 import com.skua.modules.equipment.vo.DrugConsumptionTrendChartVO;
5 8
9 import java.util.List;
6 import java.util.Map; 10 import java.util.Map;
7 11
8 public interface IDrugConsumptionAnalysisService { 12 public interface IDrugConsumptionAnalysisService {
9 //数据展示 13 //数据展示
10 Map<String, Object> dataDisplay(String time,String departId); 14 DrugConsumptionDisplayVO dataDisplay(String time, String departId);
15
11 //总药耗趋势 16 //总药耗趋势
12 Map<String, Object> drugConsumptionTrend(String time,String departId); 17 List<DrugConsumptionTrendChartVO> drugConsumptionTrend(String time, String departId);
13 //吨水药耗趋势 18 //吨水药耗趋势
14 Map<String, Object> consumptionTonOfWaterTrend(String time,String departId); 19 List<DrugConsumptionTrendChartVO> consumptionTonOfWaterTrend(String time,String departId);
15 //药剂占比统计 type 1.按明细 2.按类型 20 //药剂占比统计 type 1.按明细 2.按类型
16 Map<String, Object> proportionStatistics(String time, Integer type,String departId); 21 List<DrugConsumptionDisplayVO> proportionStatistics(String time,String departId);
17 //药剂占比统计列表 type 1.按明细 2.按类型 22 //药剂占比统计列表 type 1.按明细 2.按类型
18 Map<String, Object> proportionStatisticsDetail(String time, Integer type,String departId); 23 //Map<String, Object> proportionStatisticsDetail(String time, Integer type,String departId);
19 //相关性分析 type 1.絮凝剂 2.碳源 3.除磷剂 24 //相关性分析 type 1.絮凝剂 2.碳源 3.除磷剂
20 Map<String, Object> correlationAnalysis(String time, Integer type ,String departId); 25 List<CorrelationAnalysisVO> correlationAnalysis(String time, String drugCode , String departId);
26 //相关性分析 统计类型
27 List<DrugConsumptionDisplayVO> analysisType();
21 //总药耗趋势详情 28 //总药耗趋势详情
22 Map<String, Object> drugConsumptionTrendDetail(DrugDto drugDto); 29 // Map<String, Object> drugConsumptionTrendDetail(DrugDto drugDto);
23 //相关性分析药剂明细 type 1.絮凝剂 2.碳源 3.除磷剂 30 //相关性分析药剂明细 type 1.絮凝剂 2.碳源 3.除磷剂
24 Map<String, Object> correlationAnalysisDetail(String time, Integer type ,String departId); 31 // Map<String, Object> correlationAnalysisDetail(String time, Integer type ,String departId);
25 } 32 }
......
1 package com.skua.modules.equipment.vo;
2
3 import com.skua.tool.util.JSUtils;
4 import io.swagger.annotations.ApiModel;
5 import io.swagger.annotations.ApiModelProperty;
6 import lombok.Data;
7 import org.apache.commons.lang.StringUtils;
8
9 @Data
10 @ApiModel(value="药耗分析:相关性分析", description="药耗分析:相关性分析")
11 public class CorrelationAnalysisVO {
12
13 @ApiModelProperty(value = "药剂code")
14 private String drugCode;
15 @ApiModelProperty(value = "药剂名称")
16 private String drugName;
17
18 @ApiModelProperty(value = "时间")
19 private String time;
20
21 @ApiModelProperty(value = "药剂总药耗")
22 private String zyh;
23
24 @ApiModelProperty(value = "吨泥耗量")
25 private String dnhl;
26
27 @ApiModelProperty(value = "进水ss")
28 private String jsss;
29
30 @ApiModelProperty(value = "污泥量")
31 private String wnl;
32
33 @ApiModelProperty(value = "污泥含水量")
34 private String wnhsl;
35
36 ////吨泥耗量=絮凝剂总量/干污泥总量
37 //干污泥量=产泥量*(1-污泥含水率)
38 public String getDnhl() {
39 String expression = null;
40 if(StringUtils.isNotEmpty(this.zyh)){
41 if(StringUtils.isNotEmpty(this.wnhsl)){
42 expression = "("+this.zyh +" * 100 )/ ("+this.wnl+"* (100-"+this.wnhsl+"))";
43 }else{
44 expression = this.zyh +"/ "+this.wnl+"";
45 }
46 dnhl = JSUtils.executeExpression(expression , "0.0");
47 }
48 return dnhl;
49 }
50
51 }
1 package com.skua.modules.equipment.vo;
2
3 import io.swagger.annotations.ApiModel;
4 import io.swagger.annotations.ApiModelProperty;
5 import lombok.Data;
6
7 import java.math.BigDecimal;
8
9 @Data
10 @ApiModel(value="药耗分析:数据展示", description="药耗分析:数据展示(药耗分析)")
11 public class DrugConsumptionDisplayVO {
12
13
14 @ApiModelProperty(value = "药剂code")
15 private String drugCode;
16 @ApiModelProperty(value = "药剂名称")
17 private String drugName;
18
19
20 @ApiModelProperty(value = "出水量")
21 private Double CSL;
22 @ApiModelProperty(value = "同比去年出水量")
23 private Double tbqnCsl;
24 @ApiModelProperty(value = "环比上月出水量")
25 private Double hbsyCsl;
26
27 @ApiModelProperty(value = "总药耗")
28 private Double zyh;
29
30 @ApiModelProperty(value = "同比去年总药耗")
31 private Double tbqnzyh;
32 @ApiModelProperty(value = "同比去年总药耗")
33 private Double tbqnzyhsl;
34 @ApiModelProperty(value = "同比去年总药耗比例")
35 private Double tbqnzyhbl;
36
37
38 @ApiModelProperty(value = "环比上月总药耗")
39 private Double hbsyzyh;
40 @ApiModelProperty(value = "环比上月总药耗")
41 private Double hbsyzyhsl;
42 @ApiModelProperty(value = "环比上月总药耗比例")
43 private Double hbsyzyhbl;
44
45
46 @ApiModelProperty(value = "目标吨水药耗")
47 private Double mbdsyh = 0.65d;
48
49 @ApiModelProperty(value = "月吨水药耗")
50 private Double dsyh;
51
52 @ApiModelProperty(value = "同比去年吨水药耗")
53 private Double tbqndsyh;
54 @ApiModelProperty(value = "同比去年吨水药耗")
55 private Double tbqndsyhsl;
56 @ApiModelProperty(value = "同比去年吨水药耗比例")
57 private Double tbqndsyhbl;
58
59
60 @ApiModelProperty(value = "环比上月吨水药耗")
61 private Double hbsydsyh;
62 @ApiModelProperty(value = "环比上月吨水药耗")
63 private Double hbsydsyhsl;
64 @ApiModelProperty(value = "环比上月吨水药耗比例")
65 private Double hbsydsyhbl;
66
67
68
69 @ApiModelProperty(value = "历史最低吨水药耗")
70 private String lszddsyh;
71 @ApiModelProperty(value = "历史最低吨水药耗--月份")
72 private String lszddsyhyf;
73
74 public DrugConsumptionDisplayVO() {
75 }
76
77 public DrugConsumptionDisplayVO(Double CSL, Double tbqnCsl, Double hbsyCsl, Double zyh, Double hbsyzyh, Double tbqnzyh) {
78 this.CSL = CSL;
79 this.tbqnCsl = tbqnCsl;
80 this.hbsyCsl = hbsyCsl;
81 this.zyh = zyh;
82 this.hbsyzyh = hbsyzyh;
83 this.tbqnzyh = tbqnzyh;
84
85 if(this.zyh != null ){
86 //计算吨水药耗
87 //药耗量[kg] / 处理水量[吨]
88 if(this.CSL != null && Double.compare(this.CSL, 0.0) != 0) this.dsyh = this.getValue(this.zyh /this.CSL );
89 //同比总药耗
90 if(this.tbqnzyh != null){
91 this.tbqnzyhsl = this.getValue(this.zyh - this.tbqnzyh);
92 this.tbqnzyhbl = this.getValue(((this.zyh - this.tbqnzyh)/this.tbqnzyh)*100) ;
93 //计算吨水药耗 //同比吨水药耗
94 if(this.tbqnCsl != null && Double.compare(this.tbqnCsl, 0.0) != 0) this.tbqndsyh = this.getValue(this.tbqnzyh /this.tbqnCsl );
95 if(this.tbqndsyh != null ){
96 this.tbqndsyhsl = this.getValue(dsyh-tbqndsyh);
97 this.tbqndsyhbl = this.getValue((dsyh-tbqndsyh)/tbqndsyh*100);
98 }
99 }
100 //环比总药耗
101 if(this.hbsyzyh != null ){
102 this.hbsyzyhsl = this.getValue(this.zyh - this.hbsyzyh);
103 this.hbsyzyhbl = this.getValue(((this.zyh - this.hbsyzyh)/this.hbsyzyh)*100) ;
104 //环比-吨水药耗
105 if(this.hbsyCsl != null && Double.compare(this.hbsyCsl, 0.0) != 0) this.hbsydsyh = this.getValue(this.hbsyzyh /this.hbsyCsl );
106 if(this.hbsydsyh != null){
107 this.hbsydsyhsl = this.getValue(this.dsyh - this.hbsydsyh);
108 this.hbsydsyhbl = this.getValue((this.dsyh - this.hbsydsyh) / this.hbsydsyh*100);
109 }
110 }
111 }
112 }
113 private Double getValue(Double d) {
114 try{
115 BigDecimal two = new BigDecimal(d);
116 double three = two.setScale(2,BigDecimal.ROUND_HALF_UP).doubleValue();
117 return three;
118 }catch(Exception e){
119 //e.printStackTrace();
120 }
121 return null;
122 }
123 }
1 package com.skua.modules.equipment.vo;
2
3 import io.swagger.annotations.ApiModel;
4 import io.swagger.annotations.ApiModelProperty;
5 import lombok.Data;
6
7 @Data
8 @ApiModel(value="药耗分析:总药耗趋势Charts", description="药耗分析:总药耗趋势Charts")
9 public class DrugConsumptionTrendChartVO {
10 @ApiModelProperty(value = "时间")
11 private String time;
12
13 @ApiModelProperty(value = "总药耗")
14 private Double zyh;
15
16 @ApiModelProperty(value = "同比总药耗")
17 private Double tbzyh;
18
19 @ApiModelProperty(value = "吨水药耗")
20 private String dsyh;
21
22
23 }
支持 Markdown 格式
你添加了 0 到此讨论。请谨慎行事。
Finish editing this message first!