Index: ssts-reports/src/main/java/com/forgon/disinfectsystem/jasperreports/service/JasperReportManagerImpl.java =================================================================== diff -u -r35246 -r35249 --- ssts-reports/src/main/java/com/forgon/disinfectsystem/jasperreports/service/JasperReportManagerImpl.java (.../JasperReportManagerImpl.java) (revision 35246) +++ ssts-reports/src/main/java/com/forgon/disinfectsystem/jasperreports/service/JasperReportManagerImpl.java (.../JasperReportManagerImpl.java) (revision 35249) @@ -8166,7 +8166,7 @@ monthArr = new String[count]; for (int i = 1; i <= count; i++) { String key = null; - if(i < 10 && dbConnection.isOracle()){ + if(i < 10){ key = "0" + i; }else{ key = i + ""; @@ -8240,8 +8240,8 @@ totalTousseRs = objectDao.executeSql(sql); while (totalTousseRs.next()) { Integer totalTousseAmount = totalTousseRs.getInt("amount"); - String monthstr = totalTousseRs.getString("monthstr"); - totalTousseMap.put(monthstr, totalTousseAmount); + String month = getMonthOrDay(totalTousseRs.getString("monthStr")); + totalTousseMap.put(month, totalTousseAmount); } } catch (SQLException e) { e.printStackTrace(); @@ -8262,8 +8262,8 @@ totalForeignTousseRs = objectDao.executeSql(sql); while (totalForeignTousseRs.next()) { Integer totalForeignTousseAmount = totalForeignTousseRs.getInt("amount"); - String monthstr = totalForeignTousseRs.getString("monthstr"); - totalForeignTousseMap.put(monthstr, totalForeignTousseAmount); + String month = getMonthOrDay(totalForeignTousseRs.getString("monthStr")); + totalForeignTousseMap.put(month, totalForeignTousseAmount); } } catch (SQLException e) { e.printStackTrace(); @@ -8321,7 +8321,7 @@ disinfectionRs = objectDao.executeSql(disinfectionSql); while (disinfectionRs.next()) { Integer disinfectionAmount = disinfectionRs.getInt("amount"); - String month = disinfectionRs.getString("monthstr"); + String month = getMonthOrDay(disinfectionRs.getString("monthStr")); disinfectionMap.put(month, disinfectionAmount); } } catch (SQLException e) { @@ -8347,8 +8347,8 @@ sterileRs = objectDao.executeSql(sterileSql); while (sterileRs.next()) { Integer sterilizaAmount = sterileRs.getInt("amount"); - String month = sterileRs.getString("monthstr"); - sterileMap.put(month, sterilizaAmount); + String monthstr = getMonthOrDay(sterileRs.getString("monthStr")); + sterileMap.put(monthstr, sterilizaAmount); } } catch (SQLException e) { e.printStackTrace(); @@ -8372,8 +8372,8 @@ sterileForeignRs = objectDao.executeSql(sterileForeignSql); while (sterileForeignRs.next()) { Integer sterilizaForeignAmount = sterileForeignRs.getInt("amount"); - String month = sterileForeignRs.getString("monthstr"); - sterileForeignMap.put(month, sterilizaForeignAmount); + String monthstr = getMonthOrDay(sterileForeignRs.getString("monthStr")); + sterileForeignMap.put(monthstr, sterilizaForeignAmount); } } catch (SQLException e) { e.printStackTrace(); @@ -8403,15 +8403,15 @@ while (rs3.next()) { Integer amount5 = rs3.getInt("amount"); String ownGroup = rs3.getString("ownGroup"); - String monthStr = rs3.getString("monthStr"); + String monthstr = getMonthOrDay(rs3.getString("monthStr")); Map itemMap = null; if(sterilizerUseAmountMap.containsKey(ownGroup)){ itemMap = sterilizerUseAmountMap.get(ownGroup); }else{ itemMap = new HashMap(); sterilizerUseAmountMap.put(ownGroup, itemMap); } - itemMap.put(monthStr, amount5); + itemMap.put(monthstr, amount5); } } catch (SQLException e) { e.printStackTrace(); @@ -8456,7 +8456,7 @@ tousseInvoiceSendRs = objectDao.executeSql(tousseSendSql); while (tousseInvoiceSendRs.next()) { Integer tousseInvoiceSendAmount = tousseInvoiceSendRs.getInt("amount"); - String month = tousseInvoiceSendRs.getString("monthStr"); + String month = getMonthOrDay(tousseInvoiceSendRs.getString("monthStr")); tousseInvoiceSendMap.put(month, tousseInvoiceSendAmount); } } catch (SQLException e) { @@ -8475,7 +8475,7 @@ sterilizationRecordCountRs = objectDao.executeSql(sterilizationRecordCountSql); while (sterilizationRecordCountRs.next()) { Integer sterilizationRecordCount = sterilizationRecordCountRs.getInt("count"); - String month = sterilizationRecordCountRs.getString("monthStr"); + String month = getMonthOrDay(sterilizationRecordCountRs.getString("monthStr")); sterilizationRecordCountMap.put(month, sterilizationRecordCount); } } catch (Exception e) { @@ -8499,7 +8499,7 @@ disposableGoodsSendRs = objectDao.executeSql(disposableGoodsSendSql); while (disposableGoodsSendRs.next()) { Integer disposableGoodsInvoiceSendAmount = disposableGoodsSendRs.getInt("amount"); - String month = disposableGoodsSendRs.getString("monthStr"); + String month = getMonthOrDay(disposableGoodsSendRs.getString("monthStr")); disposableGoodsSendMap.put(month, disposableGoodsInvoiceSendAmount); } } catch (SQLException e) { @@ -8547,7 +8547,7 @@ rs8 = objectDao.executeSql(sql8); while (rs8.next()) { Integer amount8 = rs8.getInt("amount"); - String month = rs8.getString("monthStr"); + String month = getMonthOrDay(rs8.getString("monthStr")); nextSendAmountMap.put(month, amount8); } } catch (SQLException e) { @@ -8575,7 +8575,7 @@ monthReportRs = objectDao.executeSql(monthReportSql); while (monthReportRs.next()) { Double totalPrice = monthReportRs.getDouble("totalPrice"); - String month = monthReportRs.getString("monthStr"); + String month = getMonthOrDay(monthReportRs.getString("monthStr")); String settleAccountsDepartCoding = monthReportRs.getString("settleAccountsDepartCoding"); Map monthReportMap = null; if(monthReportPriceMap.containsKey(settleAccountsDepartCoding)){ @@ -8613,7 +8613,7 @@ //System.out.println("monthReportSql:"+adverseEventRecordSql); adverseEventRecordRs = objectDao.executeSql(adverseEventRecordSql); while (adverseEventRecordRs.next()) { - String month = adverseEventRecordRs.getString("monthStr"); + String month = getMonthOrDay(adverseEventRecordRs.getString("monthStr")); Integer amount = adverseEventRecordRs.getInt("amount"); String timeoutHandType = adverseEventRecordRs.getString("timeoutHandType"); Map map = null; @@ -9268,6 +9268,17 @@ return firstColumnVos; } /** + * 获取月份或天 小与10的返回带0的数。比如01 + * @param monthOrDay 月或天 + * @return + */ + private String getMonthOrDay(String monthOrDay){ + if(monthOrDay.length() == 1 && Integer.valueOf(monthOrDay) < 10){ + return "0" + monthOrDay; + } + return monthOrDay; + } + /** * 获取器械包种类过滤 * @param instrumentSetType 器械包种类 * @param inOrNotIN in 或者 not in