DrugConsumptionDisplayVO.java
4.5 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
package com.skua.modules.equipment.vo;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.math.BigDecimal;
@Data
@ApiModel(value="药耗分析:数据展示", description="药耗分析:数据展示(药耗分析)")
public class DrugConsumptionDisplayVO {
@ApiModelProperty(value = "药剂code")
private String drugCode;
@ApiModelProperty(value = "药剂名称")
private String drugName;
@ApiModelProperty(value = "出水量")
private Double CSL;
@ApiModelProperty(value = "同比去年出水量")
private Double tbqnCsl;
@ApiModelProperty(value = "环比上月出水量")
private Double hbsyCsl;
@ApiModelProperty(value = "总药耗")
private Double zyh;
@ApiModelProperty(value = "同比去年总药耗")
private Double tbqnzyh;
@ApiModelProperty(value = "同比去年总药耗")
private Double tbqnzyhsl;
@ApiModelProperty(value = "同比去年总药耗比例")
private Double tbqnzyhbl;
@ApiModelProperty(value = "环比上月总药耗")
private Double hbsyzyh;
@ApiModelProperty(value = "环比上月总药耗")
private Double hbsyzyhsl;
@ApiModelProperty(value = "环比上月总药耗比例")
private Double hbsyzyhbl;
@ApiModelProperty(value = "目标吨水药耗")
private Double mbdsyh = 0.65d;
@ApiModelProperty(value = "月吨水药耗")
private Double dsyh;
@ApiModelProperty(value = "同比去年吨水药耗")
private Double tbqndsyh;
@ApiModelProperty(value = "同比去年吨水药耗")
private Double tbqndsyhsl;
@ApiModelProperty(value = "同比去年吨水药耗比例")
private Double tbqndsyhbl;
@ApiModelProperty(value = "环比上月吨水药耗")
private Double hbsydsyh;
@ApiModelProperty(value = "环比上月吨水药耗")
private Double hbsydsyhsl;
@ApiModelProperty(value = "环比上月吨水药耗比例")
private Double hbsydsyhbl;
@ApiModelProperty(value = "历史最低吨水药耗")
private String lszddsyh;
@ApiModelProperty(value = "历史最低吨水药耗--月份")
private String lszddsyhyf;
public DrugConsumptionDisplayVO() {
}
public DrugConsumptionDisplayVO(String drugCode, String drugName) {
this.drugCode = drugCode;
this.drugName = drugName;
}
public DrugConsumptionDisplayVO(Double CSL, Double tbqnCsl, Double hbsyCsl, Double zyh, Double hbsyzyh, Double tbqnzyh) {
this.CSL = CSL;
this.tbqnCsl = tbqnCsl;
this.hbsyCsl = hbsyCsl;
this.zyh = zyh;
this.hbsyzyh = hbsyzyh;
this.tbqnzyh = tbqnzyh;
if(this.zyh != null ){
//计算吨水药耗
//药耗量[kg] / 处理水量[吨]
if(this.CSL != null && Double.compare(this.CSL, 0.0) != 0) this.dsyh = this.getValue(this.zyh /this.CSL );
//同比总药耗
if(this.tbqnzyh != null){
this.tbqnzyhsl = this.getValue(this.zyh - this.tbqnzyh);
this.tbqnzyhbl = this.getValue(((this.zyh - this.tbqnzyh)/this.tbqnzyh)*100) ;
//计算吨水药耗 //同比吨水药耗
if(this.tbqnCsl != null && Double.compare(this.tbqnCsl, 0.0) != 0) this.tbqndsyh = this.getValue(this.tbqnzyh /this.tbqnCsl );
if(this.tbqndsyh != null ){
this.tbqndsyhsl = this.getValue(dsyh-tbqndsyh);
this.tbqndsyhbl = this.getValue((dsyh-tbqndsyh)/tbqndsyh*100);
}
}
//环比总药耗
if(this.hbsyzyh != null ){
this.hbsyzyhsl = this.getValue(this.zyh - this.hbsyzyh);
this.hbsyzyhbl = this.getValue(((this.zyh - this.hbsyzyh)/this.hbsyzyh)*100) ;
//环比-吨水药耗
if(this.hbsyCsl != null && Double.compare(this.hbsyCsl, 0.0) != 0) this.hbsydsyh = this.getValue(this.hbsyzyh /this.hbsyCsl );
if(this.hbsydsyh != null){
this.hbsydsyhsl = this.getValue(this.dsyh - this.hbsydsyh);
this.hbsydsyhbl = this.getValue((this.dsyh - this.hbsydsyh) / this.hbsydsyh*100);
}
}
}
}
private Double getValue(Double d) {
try{
BigDecimal two = new BigDecimal(d);
double three = two.setScale(2,BigDecimal.ROUND_HALF_UP).doubleValue();
return three;
}catch(Exception e){
//e.printStackTrace();
}
return null;
}
}