Index: ssts-reports/src/main/java/com/forgon/disinfectsystem/jasperreports/service/JasperReportManagerImpl.java =================================================================== diff -u -r34631 -r34641 --- ssts-reports/src/main/java/com/forgon/disinfectsystem/jasperreports/service/JasperReportManagerImpl.java (.../JasperReportManagerImpl.java) (revision 34631) +++ ssts-reports/src/main/java/com/forgon/disinfectsystem/jasperreports/service/JasperReportManagerImpl.java (.../JasperReportManagerImpl.java) (revision 34641) @@ -23940,73 +23940,23 @@ Map firstHalfYearAmountMap = new HashMap(); for (SupplyRoomQualityQuota quota : thisYearData) { String rowName = quota.getRowName(); - String columnName = quota.getColumnName(); - boolean ratioValue = quota.isRatioValue(); - String key = "今年" + columnName; - SupplyRoomQualityQuota newQuota = null; - if(firstHalfYearAmountMap.containsKey(key)){ - newQuota = firstHalfYearAmountMap.get(key); - if(newQuota.isRatioValue()){ - newQuota.setNumerator(MathTools.add(quota.getNumerator(), newQuota.getNumerator()).intValue()); - newQuota.setDenominator(MathTools.add(quota.getDenominator(), newQuota.getDenominator()).intValue()); - String ratio = null; - if (newQuota.getNumerator() == 0 || newQuota.getDenominator() == 0) {//如果有一个为0则合格率或者不合格率都为0% - ratio = "0%"; - } else { - ratio = MathTools.div(newQuota.getNumerator(), newQuota.getDenominator()).setScale(6, BigDecimal.ROUND_HALF_UP).multiply(new BigDecimal(100)).doubleValue() + "%"; - } - newQuota.setValue(ratio); - }else{ - newQuota.setValue(MathTools.add(Integer.valueOf(newQuota.getValue()), Integer.valueOf(quota.getValue())).intValue() + ""); - } - }else{ - newQuota = new SupplyRoomQualityQuota(); - newQuota.setRowName(columnName); - newQuota.setRowSerialNumber(quota.getColumnSerialNumber()); - newQuota.setColumnName("今年"); - newQuota.setValue(quota.getValue()); - newQuota.setRatioValue(quota.isRatioValue()); - if(newQuota.isRatioValue()){ - newQuota.setNumerator(quota.getNumerator()); - newQuota.setDenominator(quota.getDenominator()); - } - firstHalfYearAmountMap.put(key, newQuota); + if(!SupplyRoomQualityQuota.TOTAL.equals(rowName)){ + continue; } + String key = "今年" + quota.getColumnName(); + quota.setRowName(quota.getColumnName()); + quota.setColumnName("今年"); + firstHalfYearAmountMap.put(key, quota); } for (SupplyRoomQualityQuota quota : lastData) { String rowName = quota.getRowName(); - String columnName = quota.getColumnName(); - boolean ratioValue = quota.isRatioValue(); - String key = "去年" + columnName; - SupplyRoomQualityQuota newQuota = null; - if(firstHalfYearAmountMap.containsKey(key)){ - newQuota = firstHalfYearAmountMap.get(key); - if(newQuota.isRatioValue()){ - newQuota.setNumerator(MathTools.add(quota.getNumerator(), newQuota.getNumerator()).intValue()); - newQuota.setDenominator(MathTools.add(quota.getDenominator(), newQuota.getDenominator()).intValue()); - String ratio = null; - if (newQuota.getNumerator() == 0 || newQuota.getDenominator() == 0) {//如果有一个为0则合格率或者不合格率都为0% - ratio = "0%"; - } else { - ratio = MathTools.div(newQuota.getNumerator(), newQuota.getDenominator()).setScale(6, BigDecimal.ROUND_HALF_UP).multiply(new BigDecimal(100)).doubleValue() + "%"; - } - newQuota.setValue(ratio); - }else{ - newQuota.setValue(MathTools.add(Integer.valueOf(newQuota.getValue()), Integer.valueOf(quota.getValue())).intValue() + ""); - } - }else{ - newQuota = new SupplyRoomQualityQuota(); - newQuota.setRowName(columnName); - newQuota.setRowSerialNumber(quota.getColumnSerialNumber()); - newQuota.setColumnName("去年"); - newQuota.setValue(quota.getValue()); - newQuota.setRatioValue(quota.isRatioValue()); - if(newQuota.isRatioValue()){ - newQuota.setNumerator(quota.getNumerator()); - newQuota.setDenominator(quota.getDenominator()); - } - firstHalfYearAmountMap.put(key, newQuota); + if(!SupplyRoomQualityQuota.TOTAL.equals(rowName)){ + continue; } + String key = "去年" + quota.getColumnName(); + quota.setRowName(quota.getColumnName()); + quota.setColumnName("去年"); + firstHalfYearAmountMap.put(key, quota); } return Arrays.asList(firstHalfYearAmountMap.values().toArray()); }