|
@@ -96,7 +96,6 @@ public class TMonthlyQualityReportS0501Controller extends BaseController
|
|
|
BigDecimal nSum = new BigDecimal(BigInteger.ZERO);
|
|
|
BigDecimal fiftySum = new BigDecimal(BigInteger.ZERO);
|
|
|
for(Map.Entry entry : dataMap.entrySet()) {
|
|
|
- String mapKey = (String) entry.getKey();
|
|
|
TMonthlyQualityReportS0501 mapValue = (TMonthlyQualityReportS0501) entry.getValue();
|
|
|
BigDecimal p = new BigDecimal(mapValue.getP());
|
|
|
BigDecimal i = new BigDecimal(mapValue.getI());
|
|
@@ -154,7 +153,81 @@ public class TMonthlyQualityReportS0501Controller extends BaseController
|
|
|
@GetMapping("/list")
|
|
|
public AjaxResult list(TMonthlyQualityReportS0501 tMonthlyQualityReportS0501)
|
|
|
{
|
|
|
- return AjaxResult.success(tMonthlyQualityReportS0501Service.selectTMonthlyQualityReportS0501List(tMonthlyQualityReportS0501));
|
|
|
+ List<TMonthlyQualityReportS0501> tMonthlyQualityReportS0501s = tMonthlyQualityReportS0501Service.selectTMonthlyQualityReportS0501List(tMonthlyQualityReportS0501);
|
|
|
+ // 获取list第一个元素
|
|
|
+ TMonthlyQualityReportS0501 firstValue = tMonthlyQualityReportS0501s.get(0);
|
|
|
+ // 最大值
|
|
|
+ BigDecimal pMax = new BigDecimal(firstValue.getP());
|
|
|
+ BigDecimal iMax = new BigDecimal(firstValue.getI());
|
|
|
+ BigDecimal oMax = new BigDecimal(firstValue.getO());
|
|
|
+ BigDecimal nMax = new BigDecimal(firstValue.getN());
|
|
|
+ BigDecimal fiftyMax = new BigDecimal(firstValue.getFifty());
|
|
|
+ // 最小值
|
|
|
+ BigDecimal pMin = new BigDecimal(firstValue.getP());
|
|
|
+ BigDecimal iMin = new BigDecimal(firstValue.getI());
|
|
|
+ BigDecimal oMin = new BigDecimal(firstValue.getO());
|
|
|
+ BigDecimal nMin = new BigDecimal(firstValue.getN());
|
|
|
+ BigDecimal fiftyMin = new BigDecimal(firstValue.getFifty());
|
|
|
+ // 平均值
|
|
|
+ BigDecimal pAvg = new BigDecimal(BigInteger.ZERO);
|
|
|
+ BigDecimal iAvg = new BigDecimal(BigInteger.ZERO);
|
|
|
+ BigDecimal oAvg = new BigDecimal(BigInteger.ZERO);
|
|
|
+ BigDecimal nAvg = new BigDecimal(BigInteger.ZERO);
|
|
|
+ BigDecimal fiftyAvg = new BigDecimal(BigInteger.ZERO);
|
|
|
+ // 总和
|
|
|
+ BigDecimal pSum = new BigDecimal(BigInteger.ZERO);
|
|
|
+ BigDecimal iSum = new BigDecimal(BigInteger.ZERO);
|
|
|
+ BigDecimal oSum = new BigDecimal(BigInteger.ZERO);
|
|
|
+ BigDecimal nSum = new BigDecimal(BigInteger.ZERO);
|
|
|
+ BigDecimal fiftySum = new BigDecimal(BigInteger.ZERO);
|
|
|
+ for (TMonthlyQualityReportS0501 monthlyQualityReportS0501 : tMonthlyQualityReportS0501s) {
|
|
|
+ BigDecimal p = new BigDecimal(monthlyQualityReportS0501.getP());
|
|
|
+ BigDecimal i = new BigDecimal(monthlyQualityReportS0501.getI());
|
|
|
+ BigDecimal o = new BigDecimal(monthlyQualityReportS0501.getO());
|
|
|
+ BigDecimal n = new BigDecimal(monthlyQualityReportS0501.getN());
|
|
|
+ BigDecimal fifty = new BigDecimal(monthlyQualityReportS0501.getFifty());
|
|
|
+ if (p.compareTo(pMax) > 0) { pMax = p; }
|
|
|
+ if (i.compareTo(iMax) > 0) { iMax = i; }
|
|
|
+ if (o.compareTo(oMax) > 0) { oMax = o; }
|
|
|
+ if (n.compareTo(nMax) > 0) { nMax = n; }
|
|
|
+ if (fifty.compareTo(fiftyMax) > 0) { fiftyMax = fifty; }
|
|
|
+ if (p.compareTo(pMin) < 0) { pMin = p; }
|
|
|
+ if (i.compareTo(iMin) < 0) { iMin = i; }
|
|
|
+ if (o.compareTo(oMin) < 0) { oMin = o; }
|
|
|
+ if (n.compareTo(nMin) < 0) { nMin = n; }
|
|
|
+ if (fifty.compareTo(fiftyMin) < 0) { fiftyMin = fifty; }
|
|
|
+ pSum = pSum.add(p);
|
|
|
+ iSum = iSum.add(i);
|
|
|
+ oSum = oSum.add(o);
|
|
|
+ nSum = nSum.add(n);
|
|
|
+ fiftySum = fiftySum.add(fifty);
|
|
|
+ }
|
|
|
+ BigDecimal count = new BigDecimal(tMonthlyQualityReportS0501s.size());
|
|
|
+ pAvg = pSum.divide(count, 2, RoundingMode.HALF_UP);
|
|
|
+ iAvg = iSum.divide(count, 2, RoundingMode.HALF_UP);
|
|
|
+ oAvg = oSum.divide(count, 2, RoundingMode.HALF_UP);
|
|
|
+ nAvg = nSum.divide(count, 2, RoundingMode.HALF_UP);
|
|
|
+ fiftyAvg = fiftySum.divide(count, 2, RoundingMode.HALF_UP);
|
|
|
+ StringBuffer description = new StringBuffer();
|
|
|
+ description.append("正构烷烃(max)="+ pMax.toString() + "\t");
|
|
|
+ description.append("异构烷烃(max)="+ iMax.toString() + "\t");
|
|
|
+ description.append("芳烃(max)="+ oMax.toString() + "\t");
|
|
|
+ description.append("烷烃(max)="+ nMax.toString() + "\t");
|
|
|
+ description.append("50%BP(max)="+ fiftyMax.toString() + "\t\n");
|
|
|
+ description.append("正构烷烃(min)="+ pMin.toString() + "\t");
|
|
|
+ description.append("异构烷烃(min)="+ iMin.toString() + "\t");
|
|
|
+ description.append("芳烃(min)="+ oMin.toString() + "\t");
|
|
|
+ description.append("烷烃(min)="+ nMin.toString() + "\t");
|
|
|
+ description.append("50%BP(min)="+ fiftyMin.toString() + "\t\n");
|
|
|
+ description.append("正构烷烃(avg)="+ pAvg.toString() + "\t");
|
|
|
+ description.append("异构烷烃(avg)="+ iAvg.toString() + "\t");
|
|
|
+ description.append("芳烃(avg)="+ oAvg.toString() + "\t");
|
|
|
+ description.append("烷烃(avg)="+ nAvg.toString() + "\t");
|
|
|
+ description.append("50%BP(avg)="+ fiftyAvg.toString() + "\t");
|
|
|
+ QualityAnalysisVO vo = new QualityAnalysisVO();
|
|
|
+ vo.setDataList(tMonthlyQualityReportS0501s);
|
|
|
+ vo.setDescription(description.toString());
|
|
|
+ return AjaxResult.success(vo);
|
|
|
}
|
|
|
|
|
|
/**
|