Index: ssts-reports/src/main/java/com/forgon/disinfectsystem/jasperreports/action/JasperreportsAction.java =================================================================== diff -u -r37839 -r37860 --- ssts-reports/src/main/java/com/forgon/disinfectsystem/jasperreports/action/JasperreportsAction.java (.../JasperreportsAction.java) (revision 37839) +++ ssts-reports/src/main/java/com/forgon/disinfectsystem/jasperreports/action/JasperreportsAction.java (.../JasperreportsAction.java) (revision 37860) @@ -1882,7 +1882,7 @@ endTime = DateTools.getNextMonth(yearAndMonth[0],yearAndMonth[1]) + " 00:00"; } if("汇总".equals(queryType)){ - if(enableTheSterilizationResultJudgmentFunction){ + if(enableTheSterilizationResultJudgmentFunction && CssdUtils.getSystemSetConfigByNameBool("enableStatisticalSterilizationInterruptOfSterilizingStoveUseCountView", false)){ requestParameters.put("jasperreportName", "sterilizingStoveUseInterruptCount.jasper"); } Index: ssts-reports/src/main/java/com/forgon/disinfectsystem/jasperreports/util/SterilizingStoveUseCountReportHelper.java =================================================================== diff -u -r37856 -r37860 --- ssts-reports/src/main/java/com/forgon/disinfectsystem/jasperreports/util/SterilizingStoveUseCountReportHelper.java (.../SterilizingStoveUseCountReportHelper.java) (revision 37856) +++ ssts-reports/src/main/java/com/forgon/disinfectsystem/jasperreports/util/SterilizingStoveUseCountReportHelper.java (.../SterilizingStoveUseCountReportHelper.java) (revision 37860) @@ -65,7 +65,8 @@ Map interruptMap = null; boolean enableTheSterilizationResultJudgmentFunction = CssdUtils.getSystemSetConfigByNameBool("enableTheSterilizationResultJudgmentFunction", false); - if(!showEmptyFurnace && enableTheSterilizationResultJudgmentFunction){ + if(!showEmptyFurnace && enableTheSterilizationResultJudgmentFunction + && CssdUtils.getSystemSetConfigByNameBool("enableStatisticalSterilizationInterruptOfSterilizingStoveUseCountView", false)){ interruptMap = getSuccessData(departCoding,sterilizationPurpose, startTime,endTime,SterilizationRecord.STERILIZATION_STATUS_INTERRUPT, sterilizerNameGroup, sterilizerName, sterilisation,showEmptyFurnace); } @@ -121,6 +122,10 @@ , boolean showEmptyFurnace) { String statusSql = " and sr.status = '"+type+"'"; boolean enableTheSterilizationResultJudgmentFunction = CssdUtils.getSystemSetConfigByNameBool("enableTheSterilizationResultJudgmentFunction", false); + boolean enableStatisticalSterilizationInterruptOfSterilizingStoveUseCountView = false; + if(enableTheSterilizationResultJudgmentFunction){ + enableStatisticalSterilizationInterruptOfSterilizingStoveUseCountView = CssdUtils.getSystemSetConfigByNameBool("enableStatisticalSterilizationInterruptOfSterilizingStoveUseCountView", false); + } if(SterilizationRecord.STERILIZATION_STATUS_FAILURE.equals(type)){ if(enableTheSterilizationResultJudgmentFunction){ statusSql = " and sr.status = '"+SterilizationRecord.STERILIZATION_STATUS_END @@ -137,7 +142,7 @@ }else{ statusSql = " and sr.status = '"+type+"'"; } - }else if(SterilizationRecord.STERILIZATION_STATUS_INTERRUPT.equals(type)){ + }else if(enableStatisticalSterilizationInterruptOfSterilizingStoveUseCountView && SterilizationRecord.STERILIZATION_STATUS_INTERRUPT.equals(type)){ statusSql = " and sr.status = '"+SterilizationRecord.STERILIZATION_STATUS_INTERRUPT+"'"; } String emptyFurnaceCountSQL = null; @@ -156,7 +161,9 @@ +" where 1=1 " + statusSql + orgUnitCodingSql - +" and sr.endDate between "+dateQueryAdapter.dateConverAdapter2( startTime + +" and " + + (enableStatisticalSterilizationInterruptOfSterilizingStoveUseCountView?"sr.startDate":"sr.endDate") + + " between "+dateQueryAdapter.dateConverAdapter2( startTime , "yyyy-mm-dd HH24:MI") +" and "+dateQueryAdapter.dateConverAdapter2( endTime , "yyyy-mm-dd HH24:MI"); @@ -226,15 +233,28 @@ try{ boolean enableTheSterilizationResultJudgmentFunction = CssdUtils.getSystemSetConfigByNameBool("enableTheSterilizationResultJudgmentFunction", false); String statusSql = ""; + boolean enableStatisticalSterilizationInterruptOfSterilizingStoveUseCountView = false; if(enableTheSterilizationResultJudgmentFunction){ - statusSql = " and (po.status = '"+SterilizationRecord.STERILIZATION_STATUS_END - + "' and po.sterilizationResult in('" - + SterilizationRecord.STERILIZATIONRESULT_QUALIFIED - +"','"+ SterilizationRecord.STERILIZATIONRESULT_UNQUALIFIED - +"') or po.status='"+ SterilizationRecord.STERILIZATION_STATUS_INTERRUPT +"') "; + enableStatisticalSterilizationInterruptOfSterilizingStoveUseCountView = CssdUtils.getSystemSetConfigByNameBool("enableStatisticalSterilizationInterruptOfSterilizingStoveUseCountView", false); + if(enableStatisticalSterilizationInterruptOfSterilizingStoveUseCountView){ + statusSql = " and (po.status = '"+SterilizationRecord.STERILIZATION_STATUS_END + + "' and po.sterilizationResult in('" + + SterilizationRecord.STERILIZATIONRESULT_QUALIFIED + +"','"+ SterilizationRecord.STERILIZATIONRESULT_UNQUALIFIED + +"') or po.status='"+ SterilizationRecord.STERILIZATION_STATUS_INTERRUPT +"') "; + }else{ + statusSql = " and po.status = '"+SterilizationRecord.STERILIZATION_STATUS_END + + "' and po.sterilizationResult in('" + + SterilizationRecord.STERILIZATIONRESULT_QUALIFIED + +"','"+ SterilizationRecord.STERILIZATIONRESULT_UNQUALIFIED + +"') "; + } + } String orgUnitCodingSql = SqlUtils.getWhereSqlByfilterFieldAndStringValueAndSeparatorFilterAll("po.sterilizer.orgUnitCoding", departCoding, ","); - String sql = " where po.endDate between " + String sql = " where " + + (enableStatisticalSterilizationInterruptOfSterilizingStoveUseCountView?"po.startDate":"po.endDate") + + " between " + dateQueryAdapter.dateConverAdapter2( startTime , "yyyy-mm-dd HH24:MI") + " and " + "" @@ -257,7 +277,9 @@ Map bioloicalMonitoringCountMap = new HashMap();//生物监测次数汇总map for (SterilizationRecord sr : srList) { String dateStr = ""; - if(sr.getEndDate() != null){ + if(enableStatisticalSterilizationInterruptOfSterilizingStoveUseCountView && sr.getStartDate() != null){ + dateStr = DateTools.YMDFORMAT.get().format(sr.getStartDate()); + }else if(sr.getEndDate() != null){ dateStr = DateTools.YMDFORMAT.get().format(sr.getEndDate()); } String key = null; @@ -414,12 +436,22 @@ } boolean enableTheSterilizationResultJudgmentFunction = CssdUtils.getSystemSetConfigByNameBool("enableTheSterilizationResultJudgmentFunction", false); String statusSql = ""; + boolean enableStatisticalSterilizationInterruptOfSterilizingStoveUseCountView = false; if(enableTheSterilizationResultJudgmentFunction){ - statusSql = " and (sr.status = '"+SterilizationRecord.STERILIZATION_STATUS_END - + "' and sr.sterilizationResult in('" - + SterilizationRecord.STERILIZATIONRESULT_QUALIFIED - +"','"+ SterilizationRecord.STERILIZATIONRESULT_UNQUALIFIED - +"') or sr.status='"+ SterilizationRecord.STERILIZATION_STATUS_INTERRUPT +"') "; + enableStatisticalSterilizationInterruptOfSterilizingStoveUseCountView = CssdUtils.getSystemSetConfigByNameBool("enableStatisticalSterilizationInterruptOfSterilizingStoveUseCountView", false); + if(enableStatisticalSterilizationInterruptOfSterilizingStoveUseCountView){ + statusSql = " and (sr.status = '"+SterilizationRecord.STERILIZATION_STATUS_END + + "' and sr.sterilizationResult in('" + + SterilizationRecord.STERILIZATIONRESULT_QUALIFIED + +"','"+ SterilizationRecord.STERILIZATIONRESULT_UNQUALIFIED + +"') or sr.status='"+ SterilizationRecord.STERILIZATION_STATUS_INTERRUPT +"') "; + }else{ + statusSql = " and sr.status = '"+SterilizationRecord.STERILIZATION_STATUS_END + + "' and sr.sterilizationResult in('" + + SterilizationRecord.STERILIZATIONRESULT_QUALIFIED + +"','"+ SterilizationRecord.STERILIZATIONRESULT_UNQUALIFIED + +"') "; + } } String sterilizerNameGroupSql = SqlUtils.getWhereSqlByfilterFieldAndStringValueAndSeparator("s.ownGroup", sterilizerNameGroup, ","); String sterilizerNameSql = SqlUtils.getWhereSqlByfilterFieldAndStringValueAndSeparator("s.name", sterilizerName, ","); @@ -433,7 +465,9 @@ + sterilizerNameSql + sterilisationSql + statusSql - + " and sr.endDate between " + dateQueryAdapter.dateConverAdapter2(startTime, "yyyy-mm-dd HH24:MI:SS") + + " and " + + (enableStatisticalSterilizationInterruptOfSterilizingStoveUseCountView?"sr.startDate":"sr.endDate") + + " between " + dateQueryAdapter.dateConverAdapter2(startTime, "yyyy-mm-dd HH24:MI:SS") + " and "+dateQueryAdapter.dateConverAdapter2(endTime, "yyyy-mm-dd HH24:MI:SS") + " group by s.name"; return sql; @@ -496,26 +530,44 @@ } boolean enableTheSterilizationResultJudgmentFunction = CssdUtils.getSystemSetConfigByNameBool("enableTheSterilizationResultJudgmentFunction", false); String statusSql = ""; + boolean enableStatisticalSterilizationInterruptOfSterilizingStoveUseCountView = false; if(enableTheSterilizationResultJudgmentFunction){ - statusSql = " and (sr.status = '"+SterilizationRecord.STERILIZATION_STATUS_END - + "' and sr.sterilizationResult in('" - + SterilizationRecord.STERILIZATIONRESULT_QUALIFIED - +"','"+ SterilizationRecord.STERILIZATIONRESULT_UNQUALIFIED - +"') or sr.status='"+ SterilizationRecord.STERILIZATION_STATUS_INTERRUPT +"') "; + enableStatisticalSterilizationInterruptOfSterilizingStoveUseCountView = CssdUtils.getSystemSetConfigByNameBool("enableStatisticalSterilizationInterruptOfSterilizingStoveUseCountView", false); + + if(enableStatisticalSterilizationInterruptOfSterilizingStoveUseCountView){ + statusSql = " and (sr.status = '"+SterilizationRecord.STERILIZATION_STATUS_END + + "' and sr.sterilizationResult in('" + + SterilizationRecord.STERILIZATIONRESULT_QUALIFIED + +"','"+ SterilizationRecord.STERILIZATIONRESULT_UNQUALIFIED + +"') or sr.status='"+ SterilizationRecord.STERILIZATION_STATUS_INTERRUPT +"') "; + }else{ + statusSql = " and sr.status = '"+SterilizationRecord.STERILIZATION_STATUS_END + + "' and sr.sterilizationResult in('" + + SterilizationRecord.STERILIZATIONRESULT_QUALIFIED + +"','"+ SterilizationRecord.STERILIZATIONRESULT_UNQUALIFIED + +"') "; + } } String sterilizerNameGroupSql = SqlUtils.getWhereSqlByfilterFieldAndStringValueAndSeparator("s.ownGroup", sterilizerNameGroup, ","); String sterilizerNameSql = SqlUtils.getWhereSqlByfilterFieldAndStringValueAndSeparator("s.name", sterilizerName, ","); String sterilisationSql = SqlUtils.getWhereSqlByfilterFieldAndStringValueAndSeparator("sr.sterilizationType", sterilisation, ","); String orgUnitCodingSql = SqlUtils.getWhereSqlByfilterFieldAndStringValueAndSeparatorFilterAll("s.orgUnitCoding", departCoding, ","); - String monthStr = dateQueryAdapter.dateConverAdapter3("sr.endDate","mm"); + String monthStr = null; + if(enableStatisticalSterilizationInterruptOfSterilizingStoveUseCountView){ + monthStr = dateQueryAdapter.dateConverAdapter3("sr.startDate","mm"); + }else{ + monthStr = dateQueryAdapter.dateConverAdapter3("sr.endDate","mm"); + } String groupSql = " group by s.id," + monthStr; String orderBySql = " order by " + monthStr; String sql = "select min(s.name) name,count(*) amount,"+ monthStr +" month from SterilizationRecord sr,Sterilizer s " +" where sr.sterilizer_id = s.id " //+ " and s.id=" + sterilizerId + orgUnitCodingSql + statusSql - +" and sr.endDate between "+dateQueryAdapter.dateConverAdapter2( startTime + +" and " + + (enableStatisticalSterilizationInterruptOfSterilizingStoveUseCountView?"sr.startDate":"sr.endDate") + + " between "+dateQueryAdapter.dateConverAdapter2( startTime , "yyyy-mm-dd HH24:MI:SS") +" and "+dateQueryAdapter.dateConverAdapter2( endTime , "yyyy-mm-dd HH24:MI:SS")