mirror of
https://codeup.aliyun.com/64f7d6b8ce01efaafef1e678/coal/coal.git
synced 2026-01-25 15:55:18 +08:00
bugfix
This commit is contained in:
@@ -100,8 +100,6 @@ public class CoalWashingDailyAnalysisEntity extends OrgCommonEntity {
|
||||
inputItems.sort(
|
||||
Comparator.comparing(x -> ObjectUtils.defaultIfNull(x.getTime(), LocalTime.MIN)));
|
||||
|
||||
|
||||
|
||||
for (int i = 0; i < inputItems.size(); i++) {
|
||||
CoalWashingDailyAnalysisItemVo coalWashingDailyAnalysisItemVo = inputItems.get(i);
|
||||
if (StringUtils.equals(type, "2") && i == inputItems.size() - 1) {
|
||||
@@ -115,7 +113,8 @@ public class CoalWashingDailyAnalysisEntity extends OrgCommonEntity {
|
||||
|
||||
Double prevNumber = ObjectUtils.defaultIfNull(initTotalNumber, 0.0);
|
||||
// 总的权重
|
||||
Double totalWeight = 0.0;
|
||||
Double totalWeight1 = 0.0;
|
||||
Double totalWeight2 = 0.0;
|
||||
// 大堆平均之和
|
||||
Double avgSum1 = 0.0;
|
||||
Double avgSum2 = 0.0;
|
||||
@@ -126,12 +125,20 @@ public class CoalWashingDailyAnalysisEntity extends OrgCommonEntity {
|
||||
inputItem.getTotalNumber() == null
|
||||
? 1
|
||||
: Double.max(1, inputItem.getTotalNumber() - prevNumber);
|
||||
totalWeight += currWeight;
|
||||
avgSum1 += ObjectUtils.defaultIfNull(inputItem.getAvgDdp1(), 0.0) * currWeight;
|
||||
avgSum2 += ObjectUtils.defaultIfNull(inputItem.getAvgDdp2(), 0.0) * currWeight;
|
||||
|
||||
inputItem.setRollingAvgDdp1(avgSum1 / totalWeight);
|
||||
inputItem.setRollingAvgDdp2(avgSum2 / totalWeight);
|
||||
if (inputItem.getAvgDdp1() != null) {
|
||||
totalWeight1 += currWeight;
|
||||
|
||||
avgSum1 += ObjectUtils.defaultIfNull(inputItem.getAvgDdp1(), 0.0) * currWeight;
|
||||
|
||||
inputItem.setRollingAvgDdp1(avgSum1 / totalWeight1);
|
||||
}
|
||||
|
||||
if (inputItem.getAvgDdp2() != null) {
|
||||
totalWeight2 += currWeight;
|
||||
avgSum2 += ObjectUtils.defaultIfNull(inputItem.getAvgDdp2(), 0.0) * currWeight;
|
||||
inputItem.setRollingAvgDdp2(avgSum2 / totalWeight2);
|
||||
}
|
||||
}
|
||||
|
||||
for (int i = 0; i < inputItems.size(); i++) {
|
||||
|
||||
Reference in New Issue
Block a user