DrugConsumptionDisplayVO.java
4.4 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
package com.skua.modules.equipment.vo;
import com.skua.core.util.ConvertUtils;
import com.skua.tool.util.JSUtils;
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 = ConvertUtils.getDouble(zyh,0d);
this.hbsyzyh = hbsyzyh;
this.tbqnzyh = tbqnzyh;
// 计算吨水药耗: 药耗量[kg] / 处理水量[吨]
this.dsyh = Double.parseDouble(JSUtils.divide(zyh, CSL));
//同比总药耗
this.tbqnzyhsl = Double.parseDouble(JSUtils.subtract( zyh, tbqnzyh));
String expression = "100*( "+zyh+" - "+tbqnzyh+") / "+tbqnzyh;
this.tbqnzyhbl = Double.parseDouble(JSUtils.executeExpression(expression,"0") );
//同比吨水药耗
this.tbqndsyh = Double.parseDouble( JSUtils.divide(tbqnzyh ,tbqnCsl));
this.tbqndsyhsl = this.getValue(this.dsyh - this.tbqndsyh);
expression = "100*( "+this.dsyh+" - "+this.tbqndsyh+") / "+this.tbqnzyh;
this.tbqndsyhbl = Double.parseDouble( JSUtils.executeExpression( expression, "0"));
//环比 总药耗
this.hbsyzyhsl = Double.parseDouble(JSUtils.subtract( this.zyh ,this.hbsyzyh));
expression = "100*( "+this.zyh+" - "+this.hbsyzyh+") / "+this.hbsyzyh;
this.hbsyzyhbl = Double.parseDouble(JSUtils.executeExpression(expression,"0") );
//环比 吨水药耗
this.hbsydsyh = Double.parseDouble( JSUtils.divide(this.hbsyzyh ,this.hbsyCsl));
this.hbsydsyhsl = this.getValue(this.dsyh - this.hbsydsyh);
expression = "100*( "+this.dsyh+" - "+this.hbsydsyh+") / "+this.hbsydsyh;
this.hbsydsyhbl = Double.parseDouble( JSUtils.executeExpression( expression, "0"));
}
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;
}
}