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