|
@@ -73,32 +73,83 @@ public class TMonthlyQualityReportS6301Controller extends BaseController
|
|
|
BigDecimal C250Sum = new BigDecimal(BigInteger.ZERO);
|
|
|
BigDecimal C4Sum = new BigDecimal(BigInteger.ZERO);
|
|
|
BigDecimal C410Sum = new BigDecimal(BigInteger.ZERO);
|
|
|
+ // 计数
|
|
|
+ int C5ConjugatedDienesDcpd30Count = 0;
|
|
|
+ int C5ConjugatedDienesDcpd40Count = 0;
|
|
|
+ int C250Count = 0;
|
|
|
+ int C4Count = 0;
|
|
|
+ int C410Count = 0;
|
|
|
for (TMonthlyQualityReportS6301 monthlyQualityReportS6301 : tMonthlyQualityReportS6301s) {
|
|
|
- BigDecimal C5ConjugatedDienesDcpd30 = new BigDecimal(StringUtils.isNull(monthlyQualityReportS6301.getC5ConjugatedDienesDcpd30()) ? "0" : monthlyQualityReportS6301.getC5ConjugatedDienesDcpd30());
|
|
|
- BigDecimal C5ConjugatedDienesDcpd40 = new BigDecimal(StringUtils.isNull(monthlyQualityReportS6301.getC5ConjugatedDienesDcpd40()) ? "0" : monthlyQualityReportS6301.getC5ConjugatedDienesDcpd40());
|
|
|
- BigDecimal C250 = new BigDecimal(StringUtils.isNull(monthlyQualityReportS6301.getC250()) ? "0" : monthlyQualityReportS6301.getC250());
|
|
|
- BigDecimal C4 = new BigDecimal(StringUtils.isNull(monthlyQualityReportS6301.getC4()) ? "0" : monthlyQualityReportS6301.getC4());
|
|
|
- BigDecimal C410 = new BigDecimal(StringUtils.isNull(monthlyQualityReportS6301.getC410()) ? "0" : monthlyQualityReportS6301.getC410());
|
|
|
- if (C5ConjugatedDienesDcpd30.compareTo(C5ConjugatedDienesDcpd30Max) > 0) { C5ConjugatedDienesDcpd30Max = C5ConjugatedDienesDcpd30; }
|
|
|
- if (C5ConjugatedDienesDcpd40.compareTo(C5ConjugatedDienesDcpd40Max) > 0) { C5ConjugatedDienesDcpd40Max = C5ConjugatedDienesDcpd40; }
|
|
|
- if (C250.compareTo(C250Max) > 0) { C250Max = C250; }
|
|
|
- if (C4.compareTo(C4Max) > 0) { C4Max = C4; }
|
|
|
- if (C410.compareTo(C410Max) > 0) { C410Max = C410; }
|
|
|
- if (C5ConjugatedDienesDcpd30.compareTo(C5ConjugatedDienesDcpd30Min) < 0) { C5ConjugatedDienesDcpd30 = C5ConjugatedDienesDcpd30; }
|
|
|
- if (C5ConjugatedDienesDcpd40.compareTo(C5ConjugatedDienesDcpd40Min) < 0) { C5ConjugatedDienesDcpd40 = C5ConjugatedDienesDcpd40; }
|
|
|
- if (C250.compareTo(C250Min) < 0) { C250 = C250; }
|
|
|
- if (C4.compareTo(C4Min) < 0) { C4 = C4; }
|
|
|
- if (C410.compareTo(C410Min) < 0) { C410 = C410; }
|
|
|
- C5ConjugatedDienesDcpd30Sum = C5ConjugatedDienesDcpd30Sum.add(C5ConjugatedDienesDcpd30);
|
|
|
- C5ConjugatedDienesDcpd40Sum = C5ConjugatedDienesDcpd40Sum.add(C5ConjugatedDienesDcpd40);
|
|
|
- C250Sum = C250Sum.add(C250);
|
|
|
- C4Sum = C4Sum.add(C4);
|
|
|
- C410Sum = C410Sum.add(C410);
|
|
|
+ String c5ConjugatedDienesDcpd301 = monthlyQualityReportS6301.getC5ConjugatedDienesDcpd30();
|
|
|
+ if (c5ConjugatedDienesDcpd301 != null) {
|
|
|
+ BigDecimal C5ConjugatedDienesDcpd30 = new BigDecimal(c5ConjugatedDienesDcpd301);
|
|
|
+ if (C5ConjugatedDienesDcpd30.compareTo(C5ConjugatedDienesDcpd30Max) > 0) {
|
|
|
+ C5ConjugatedDienesDcpd30Max = C5ConjugatedDienesDcpd30;
|
|
|
+ }
|
|
|
+ if (C5ConjugatedDienesDcpd30.compareTo(C5ConjugatedDienesDcpd30Min) < 0) {
|
|
|
+ C5ConjugatedDienesDcpd30Min = C5ConjugatedDienesDcpd30;
|
|
|
+ }
|
|
|
+ C5ConjugatedDienesDcpd30Sum = C5ConjugatedDienesDcpd30Sum.add(C5ConjugatedDienesDcpd30);
|
|
|
+ C5ConjugatedDienesDcpd30Count++;
|
|
|
+ }
|
|
|
+ String c5ConjugatedDienesDcpd401 = monthlyQualityReportS6301.getC5ConjugatedDienesDcpd40();
|
|
|
+ if (c5ConjugatedDienesDcpd401 != null) {
|
|
|
+ BigDecimal C5ConjugatedDienesDcpd40 = new BigDecimal(c5ConjugatedDienesDcpd401);
|
|
|
+ if (C5ConjugatedDienesDcpd40.compareTo(C5ConjugatedDienesDcpd40Max) > 0) {
|
|
|
+ C5ConjugatedDienesDcpd40Max = C5ConjugatedDienesDcpd40;
|
|
|
+ }
|
|
|
+ if (C5ConjugatedDienesDcpd40.compareTo(C5ConjugatedDienesDcpd40Min) < 0) {
|
|
|
+ C5ConjugatedDienesDcpd40 = C5ConjugatedDienesDcpd40;
|
|
|
+ }
|
|
|
+ C5ConjugatedDienesDcpd40Sum = C5ConjugatedDienesDcpd40Sum.add(C5ConjugatedDienesDcpd40);
|
|
|
+ C5ConjugatedDienesDcpd40Count++;
|
|
|
+ }
|
|
|
+ String c2501 = monthlyQualityReportS6301.getC250();
|
|
|
+ if (c2501 != null) {
|
|
|
+ BigDecimal C250 = new BigDecimal(c2501);
|
|
|
+ if (C250.compareTo(C250Max) > 0) {
|
|
|
+ C250Max = C250;
|
|
|
+ }
|
|
|
+ if (C250.compareTo(C250Min) < 0) {
|
|
|
+ C250 = C250;
|
|
|
+ }
|
|
|
+ C250Sum = C250Sum.add(C250);
|
|
|
+ C250Count++;
|
|
|
+ }
|
|
|
+ String c41 = monthlyQualityReportS6301.getC4();
|
|
|
+ if (c41 != null) {
|
|
|
+ BigDecimal C4 = new BigDecimal(c41);
|
|
|
+ if (C4.compareTo(C4Max) > 0) {
|
|
|
+ C4Max = C4;
|
|
|
+ }
|
|
|
+ if (C4.compareTo(C4Min) < 0) {
|
|
|
+ C4 = C4;
|
|
|
+ }
|
|
|
+ C4Sum = C4Sum.add(C4);
|
|
|
+ C4Count++;
|
|
|
+ }
|
|
|
+ String c4101 = monthlyQualityReportS6301.getC410();
|
|
|
+ if (c4101 != null) {
|
|
|
+ BigDecimal C410 = new BigDecimal(c4101);
|
|
|
+ if (C410.compareTo(C410Max) > 0) {
|
|
|
+ C410Max = C410;
|
|
|
+ }
|
|
|
+ if (C410.compareTo(C410Min) < 0) {
|
|
|
+ C410 = C410;
|
|
|
+ }
|
|
|
+ C410Sum = C410Sum.add(C410);
|
|
|
+ C410Count++;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ if ((C5ConjugatedDienesDcpd30Count+C5ConjugatedDienesDcpd40Count) != 0) {
|
|
|
+ C5ConjugatedDienesDcpdAvg = (C5ConjugatedDienesDcpd30Sum.add(C5ConjugatedDienesDcpd40Sum)).divide(new BigDecimal(C5ConjugatedDienesDcpd30Count+C5ConjugatedDienesDcpd40Count), 2, RoundingMode.HALF_UP);
|
|
|
+ }
|
|
|
+ if (C250Count != 0) {
|
|
|
+ C250Avg = C250Sum.divide(new BigDecimal(C250Count), 2, RoundingMode.HALF_UP);
|
|
|
+ }
|
|
|
+ if ((C4Count+C410Count) != 0) {
|
|
|
+ C4Avg = (C4Sum.add(C410Sum)).divide(new BigDecimal((C4Count+C410Count)), 2, RoundingMode.HALF_UP);
|
|
|
}
|
|
|
- BigDecimal count = new BigDecimal(tMonthlyQualityReportS6301s.size());
|
|
|
- C5ConjugatedDienesDcpdAvg = (C5ConjugatedDienesDcpd30Sum.add(C5ConjugatedDienesDcpd40Sum)).divide(count, 2, RoundingMode.HALF_UP);
|
|
|
- C250Avg = C250Sum.divide(count, 2, RoundingMode.HALF_UP);
|
|
|
- C4Avg = (C4Sum.add(C410Sum)).divide(count, 2, RoundingMode.HALF_UP);
|
|
|
StringBuffer description = new StringBuffer();
|
|
|
description.append("C5ConjugatedDienesDcpd30(max)="+ (C5ConjugatedDienesDcpd30Max.compareTo(C5ConjugatedDienesDcpd40Max) > 0 ? C5ConjugatedDienesDcpd30Max : C5ConjugatedDienesDcpd40Max).toString().toString() + "\t");
|
|
|
description.append("C250(max)="+ C250Max.toString() + "\t");
|