mirror of
https://codeup.aliyun.com/64f7d6b8ce01efaafef1e678/coal/coal.git
synced 2026-01-25 23:57:12 +08:00
添加翻大堆平均
This commit is contained in:
@@ -116,53 +116,49 @@ public class CoalWashingDailyAnalysisEntity extends OrgCommonEntity {
|
||||
for (int i = 0; i < inputItems.size(); i++) {
|
||||
|
||||
CoalWashingDailyAnalysisItemVo item = inputItems.get(i);
|
||||
if (i == 0) {
|
||||
item.setFddAvgP1(item.getFddp1());
|
||||
} else {
|
||||
int nullCount = 0;
|
||||
for (int j = 0; j < i; j++) {
|
||||
if (item.getFddp1() == null) {
|
||||
nullCount++;
|
||||
} else {
|
||||
item.setFddAvgP1(0.0);
|
||||
|
||||
item.setFddAvgP1(
|
||||
ObjectUtils.defaultIfNull(item.getFddp1(), 0.0)
|
||||
+ inputItems.get(j).getFddAvgP1());
|
||||
}
|
||||
}
|
||||
if (i - nullCount > 0) {
|
||||
|
||||
item.setFddAvgP1(item.getFddAvgP1() / (i - nullCount));
|
||||
int nullCount = 0;
|
||||
for (int j = 0; j <= i; j++) {
|
||||
if (inputItems.get(j).getFddp1() == null) {
|
||||
nullCount++;
|
||||
} else {
|
||||
item.setFddAvgP1(null);
|
||||
|
||||
item.setFddAvgP1(
|
||||
ObjectUtils.defaultIfNull(inputItems.get(j).getFddp1(), 0.0)
|
||||
+ item.getFddAvgP1());
|
||||
}
|
||||
}
|
||||
if (i - nullCount + 1 > 0) {
|
||||
|
||||
item.setFddAvgP1(item.getFddAvgP1() / (double) (i - nullCount + 1));
|
||||
} else {
|
||||
item.setFddAvgP1(null);
|
||||
}
|
||||
}
|
||||
|
||||
for (int i = 0; i < inputItems.size(); i++) {
|
||||
|
||||
CoalWashingDailyAnalysisItemVo item = inputItems.get(i);
|
||||
if (i == 0) {
|
||||
item.setFddAvgP2(item.getFddp2());
|
||||
} else {
|
||||
int nullCount = 0;
|
||||
for (int j = 0; j < i; j++) {
|
||||
if (item.getFddp2() == null) {
|
||||
nullCount++;
|
||||
} else {
|
||||
item.setFddAvgP2(0.0);
|
||||
|
||||
item.setFddAvgP2(
|
||||
ObjectUtils.defaultIfNull(item.getFddp2(), 0.0)
|
||||
+ inputItems.get(j).getFddAvgP2());
|
||||
}
|
||||
}
|
||||
if (i - nullCount > 0) {
|
||||
|
||||
item.setFddAvgP2(item.getFddAvgP2() / (i - nullCount));
|
||||
int nullCount = 0;
|
||||
for (int j = 0; j <= i; j++) {
|
||||
if (inputItems.get(j).getFddp2() == null) {
|
||||
nullCount++;
|
||||
} else {
|
||||
item.setFddAvgP2(null);
|
||||
|
||||
item.setFddAvgP2(
|
||||
ObjectUtils.defaultIfNull(inputItems.get(j).getFddp2(), 0.0)
|
||||
+ item.getFddAvgP2());
|
||||
}
|
||||
}
|
||||
if (i - nullCount + 1 > 0) {
|
||||
|
||||
item.setFddAvgP2(item.getFddAvgP2() / (double) (i - nullCount + 1));
|
||||
} else {
|
||||
item.setFddAvgP2(null);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user