|
@@ -205,6 +205,9 @@ public class BusinessServiceImpl implements IBusinessService {
|
|
|
}
|
|
|
}
|
|
|
//处理统计信息
|
|
|
+ //处理总的合格率
|
|
|
+ int totalDeviationRateCounts = 0;
|
|
|
+ int totalpassedDeviationRateCounts = 0;
|
|
|
//高COD
|
|
|
List<ZAssayResult> highCodList = value.stream().filter(zAssayResult -> "1".equals(zAssayResult.getAssayItem())).collect(Collectors.toList());
|
|
|
Double highCodDeviationRate = null;//后续有个总的合格率,这里用null默认,后面计算分别做判断
|
|
@@ -214,6 +217,8 @@ public class BusinessServiceImpl implements IBusinessService {
|
|
|
int highCodPassedCounts = this.getPassedCounts(highCodList);
|
|
|
assayQualityDetailRes.setHighCodPassedCounts(highCodPassedCounts);
|
|
|
highCodDeviationRate = (double) highCodPassedCounts / (double) highCodArrayCounts;
|
|
|
+ totalDeviationRateCounts += highCodArrayCounts;
|
|
|
+ totalpassedDeviationRateCounts += highCodPassedCounts;
|
|
|
assayQualityDetailRes.setHighCodDeviationRate(NumberUtils.getDoublePercentAndNLength(INT_4, highCodDeviationRate, INT_2));
|
|
|
}
|
|
|
//低COD
|
|
@@ -225,6 +230,8 @@ public class BusinessServiceImpl implements IBusinessService {
|
|
|
int lowCodPassedCounts = this.getPassedCounts(lowCodList);
|
|
|
assayQualityDetailRes.setLowCodPassedCounts(lowCodPassedCounts);
|
|
|
lowCodDeviationRate = (double) lowCodPassedCounts / (double) lowCodArrayCounts;
|
|
|
+ totalDeviationRateCounts += lowCodArrayCounts;
|
|
|
+ totalpassedDeviationRateCounts += lowCodPassedCounts;
|
|
|
assayQualityDetailRes.setLowCodDeviationRate(NumberUtils.getDoublePercentAndNLength(INT_4, lowCodDeviationRate, INT_2));
|
|
|
}
|
|
|
//氨氮
|
|
@@ -236,6 +243,8 @@ public class BusinessServiceImpl implements IBusinessService {
|
|
|
int anDanPassedCounts = this.getPassedCounts(anDanList);
|
|
|
assayQualityDetailRes.setAnDanPassedCounts(anDanPassedCounts);
|
|
|
anDanDeviationRate = (double) anDanPassedCounts / (double) anDanArrayCounts;
|
|
|
+ totalDeviationRateCounts += anDanArrayCounts;
|
|
|
+ totalpassedDeviationRateCounts += anDanPassedCounts;
|
|
|
assayQualityDetailRes.setAnDanDeviationRate(NumberUtils.getDoublePercentAndNLength(INT_4, anDanDeviationRate, INT_2));
|
|
|
}
|
|
|
//总氮
|
|
@@ -247,6 +256,8 @@ public class BusinessServiceImpl implements IBusinessService {
|
|
|
int tnPassedCounts = this.getPassedCounts(tnList);
|
|
|
assayQualityDetailRes.setTnPassedCounts(tnPassedCounts);
|
|
|
tnDeviationRate = (double) tnPassedCounts / (double) tnArrayCounts;
|
|
|
+ totalDeviationRateCounts += tnArrayCounts;
|
|
|
+ totalpassedDeviationRateCounts += tnPassedCounts;
|
|
|
assayQualityDetailRes.setTnDeviationRate(NumberUtils.getDoublePercentAndNLength(INT_4, tnDeviationRate, INT_2));
|
|
|
}
|
|
|
//总磷
|
|
@@ -258,6 +269,8 @@ public class BusinessServiceImpl implements IBusinessService {
|
|
|
int tpPassedCounts = this.getPassedCounts(tpList);
|
|
|
assayQualityDetailRes.setTpPassedCounts(tpPassedCounts);
|
|
|
tpDeviationRate = (double) tpPassedCounts / (double) tpArrayCounts;
|
|
|
+ totalDeviationRateCounts += tpArrayCounts;
|
|
|
+ totalpassedDeviationRateCounts += tpPassedCounts;
|
|
|
assayQualityDetailRes.setTpDeviationRate(NumberUtils.getDoublePercentAndNLength(INT_4, tpDeviationRate, INT_2));
|
|
|
}
|
|
|
//正磷酸盐
|
|
@@ -269,6 +282,8 @@ public class BusinessServiceImpl implements IBusinessService {
|
|
|
int zlsyPassedCounts = this.getPassedCounts(zlsyList);
|
|
|
assayQualityDetailRes.setZlsyPassedCounts(zlsyPassedCounts);
|
|
|
zlsyDeviationRate = (double) zlsyPassedCounts / (double) zlsyArrayCounts;
|
|
|
+ totalDeviationRateCounts += zlsyArrayCounts;
|
|
|
+ totalpassedDeviationRateCounts += zlsyPassedCounts;
|
|
|
assayQualityDetailRes.setZlsyDeviationRate(NumberUtils.getDoublePercentAndNLength(INT_4, zlsyDeviationRate, INT_2));
|
|
|
}
|
|
|
//亚硝酸盐氮
|
|
@@ -280,6 +295,8 @@ public class BusinessServiceImpl implements IBusinessService {
|
|
|
int ysxydPassedCounts = this.getPassedCounts(yxsydList);
|
|
|
assayQualityDetailRes.setYxsyPassedCounts(ysxydPassedCounts);
|
|
|
yxsydDeviationRate = (double) ysxydPassedCounts / (double) yxsydArrayCounts;
|
|
|
+ totalDeviationRateCounts += yxsydArrayCounts;
|
|
|
+ totalpassedDeviationRateCounts += ysxydPassedCounts;
|
|
|
assayQualityDetailRes.setYxsyDeviationRate(NumberUtils.getDoublePercentAndNLength(INT_4, yxsydDeviationRate, INT_2));
|
|
|
}
|
|
|
//硝酸盐氮
|
|
@@ -291,44 +308,11 @@ public class BusinessServiceImpl implements IBusinessService {
|
|
|
int xsydPassedCounts = this.getPassedCounts(xsydList);
|
|
|
assayQualityDetailRes.setXsydPassedCounts(xsydPassedCounts);
|
|
|
xsydDeviationRate = (double) xsydPassedCounts / (double) xsydArrayCounts;
|
|
|
+ totalDeviationRateCounts += xsydArrayCounts;
|
|
|
+ totalpassedDeviationRateCounts += xsydPassedCounts;
|
|
|
assayQualityDetailRes.setXsydDeviationRate(NumberUtils.getDoublePercentAndNLength(INT_4, xsydDeviationRate, INT_2));
|
|
|
}
|
|
|
- //处理总的合格率
|
|
|
- Double totalDeviationRate = 0D;
|
|
|
- int index = 0;
|
|
|
- if(!Objects.isNull(highCodDeviationRate)){
|
|
|
- totalDeviationRate += highCodDeviationRate;
|
|
|
- index++;
|
|
|
- }
|
|
|
- if(!Objects.isNull(lowCodDeviationRate)){
|
|
|
- totalDeviationRate += lowCodDeviationRate;
|
|
|
- index++;
|
|
|
- }
|
|
|
- if(!Objects.isNull(anDanDeviationRate)){
|
|
|
- totalDeviationRate += anDanDeviationRate;
|
|
|
- index++;
|
|
|
- }
|
|
|
- if(!Objects.isNull(tnDeviationRate)){
|
|
|
- totalDeviationRate += tnDeviationRate;
|
|
|
- index++;
|
|
|
- }
|
|
|
- if(!Objects.isNull(tpDeviationRate)){
|
|
|
- totalDeviationRate += tpDeviationRate;
|
|
|
- index++;
|
|
|
- }
|
|
|
- if(!Objects.isNull(zlsyDeviationRate)){
|
|
|
- totalDeviationRate += zlsyDeviationRate;
|
|
|
- index++;
|
|
|
- }
|
|
|
- if(!Objects.isNull(yxsydDeviationRate)){
|
|
|
- totalDeviationRate += yxsydDeviationRate;
|
|
|
- index++;
|
|
|
- }
|
|
|
- if(!Objects.isNull(xsydDeviationRate)){
|
|
|
- totalDeviationRate += xsydDeviationRate;
|
|
|
- index++;
|
|
|
- }
|
|
|
- assayQualityDetailRes.setTotalDeviationRate(NumberUtils.getDoublePercentAndNLength(INT_4, totalDeviationRate / index, INT_2));
|
|
|
+ assayQualityDetailRes.setTotalDeviationRate(NumberUtils.getDoublePercentAndNLength(INT_4, (double)totalpassedDeviationRateCounts / (double)totalDeviationRateCounts, INT_2));
|
|
|
result.add(assayQualityDetailRes);
|
|
|
});
|
|
|
}
|