Index: ssts-reports/src/main/java/com/forgon/disinfectsystem/jasperreports/service/JasperReportManagerImpl.java =================================================================== diff -u -r15054 -r15064 --- ssts-reports/src/main/java/com/forgon/disinfectsystem/jasperreports/service/JasperReportManagerImpl.java (.../JasperReportManagerImpl.java) (revision 15054) +++ ssts-reports/src/main/java/com/forgon/disinfectsystem/jasperreports/service/JasperReportManagerImpl.java (.../JasperReportManagerImpl.java) (revision 15064) @@ -2332,6 +2332,16 @@ String year, String type,String querySupplyRoom, String month) throws ParseException, SQLException { List list = new ArrayList(); + // 工作量持续统计报表 全年数据的处理 + //long starTime=System.currentTimeMillis(); + if("allYear".equals(type)){ + list = getWorkQualityCollectionListAllyear(year,querySupplyRoom); +// long endTime=System.currentTimeMillis(); +// long Time=endTime-starTime; +// System.out.println("读数据库数据耗时(改进方法):"); +// System.out.println(Time); + return list; + } Map> startAndEndDays = null; if (StringUtils.isNotBlank(year) && StringUtils.isNotBlank(type)) { startAndEndDays = getStartAndEndDay(year, type, null); @@ -2399,8 +2409,79 @@ getGoodsDeliveryError(startAndEndDays, list,querySupplyRoom); // 手术包次日下送件数 getSecordDaySendTousseAmount(startAndEndDays, list,querySupplyRoom); +// long endTime=System.currentTimeMillis(); +// long Time=endTime-starTime; +// System.out.println("读数据库数据耗时(原方法):"); +// System.out.println(Time); return list; } + + private List getWorkQualityCollectionListAllyear( + String year,String querySupplyRoom) throws ParseException, + SQLException { + List list = new ArrayList(); + // 处理器械总件数 + getWashMaterialAmountAllYear(year, list,querySupplyRoom); + // 处理敷料总件数 + getDressingAmountAllYear(year, list,querySupplyRoom); + // 外来器械清洗总件数 + getWashForeignMaterialAmountAllYear(year, list,querySupplyRoom); + // 消毒物品工作量 + getDisinfectGoodsQuantityAllYear(year, list,querySupplyRoom); + // CSSD包装物品总包数 + getPackingAmountAllYear(year, list,querySupplyRoom); + // CSSD包装物品总件数 + getPackingTousseMaterialAmountAllYear(year, list,querySupplyRoom); + // 灭菌器使用炉次 + getCountFrequencyOfMonthAllYear(year, list,querySupplyRoom); + // 灭菌物品总件数 + getSterilizationAmountAllYear(year, list,querySupplyRoom); + // 发放无菌物品总件数 + getSendTousseAmountAllYear(year, list,querySupplyRoom); + // 一次性物品发货数量 + getSendDiposableGoodsAmountAllYear(year, list,querySupplyRoom); + // 器械清洗不合格数 + getMaterialWashUnqualifiedAmountAllYear(year, list,querySupplyRoom); + // 消毒物品不合格数 + getDisinfectGoodsUnqualifiedAmountAllYear(year, list,querySupplyRoom); + // 灭菌物品包装密闭不合格数 + getPackSealUnqualifiedAmountAllYear(year, list,querySupplyRoom); + // 回收器械丢失发生件数 + getRecyclingMaterialLostAmountAllYear(year, list,querySupplyRoom); + // 器械损坏件数 + getMaterialScrapAmountAllYear(year, list,querySupplyRoom); + // 无菌包内器械缺失发生件数 + getMaterialLostAmountAllYear(year, list,querySupplyRoom); + // 无菌包内器械功能不全件数 + getMaterialFunctionIncompleteAllYear(year, list,querySupplyRoom); + // 包内器械种类错误发生件数 + getMaterialTypeErrorAmountAllYear(year, list,querySupplyRoom); + // 无菌标识不正确发生数 + getLabelErrorAmountAllYear(year, list,querySupplyRoom); + // 包外化学指示标签变色不合格 + getLabelChangeColourUnqualifiedAmountAllYear(year, list,querySupplyRoom); + // 包内化学指示卡不合格数 + getInstructionCardUnqualifiedAllYear(year, list,querySupplyRoom); + // 包外明显污迹 + getTousseOutsideSmudginessAllYear(year, list,querySupplyRoom); + // 标签固定差 + getLooseTagsAmountAllYear(year, list,querySupplyRoom); + // 包装松散 + getIncompactPackageAmountAllYear(year, list,querySupplyRoom); + // 灭菌方式选择不正确发生数 + getSterilizationTypeChooserWrongAllYear(year, list,querySupplyRoom); + // 湿包发生数 + getWetBagAmountAllYear(year, list,querySupplyRoom); + // 破包发生数 + getTornBagAmountAllYear(year, list,querySupplyRoom); + // 灭菌失败事件发生数 + getSterilizationFaildAmountAllYear(year, list,querySupplyRoom); + // 无菌物品发放错误发生数 + getGoodsDeliveryErrorAllYear(year, list,querySupplyRoom); + // 手术包次日下送件数 + getSecordDaySendTousseAmountAllYear(year, list,querySupplyRoom); + return list; + } private void getDisinfectGoodsQuantity( Map> startAndEndDays, @@ -2442,6 +2523,45 @@ list.add(bean); } } + // 消毒物品工作量统计 全年数据 + private void getDisinfectGoodsQuantityAllYear( + String year, + List list,String querySupplyRoom) throws ParseException, + SQLException { + WorkQualityCollection bean = new WorkQualityCollection(); + String queryYear = year + "-01-01 00:00:00"; + String nextYear = getNextYear(year) + " 00:00:00"; + String sql = "select " + dateQueryAdapter.dateConverAdapter3("i.sendTime","mm") + + " monthstr, sum(ti.statisticsAmount) from tousseinstance ti, invoice i,invoiceplan ip" + + " where ti.invoice_id = i.id and i.invoiceplan_id = ip.id" + + " and ip.type = '消毒物品申请单' and i.sendTime >= " + + dateQueryAdapter.dateAdapter(queryYear) + + " and i.sendTime <= " + + dateQueryAdapter.dateAdapter(nextYear) + + " and ti.status = '已发货'" + + " group by " + dateQueryAdapter.dateConverAdapter3("i.sendTime","mm"); + ResultSet result = objectDao.executeSql(sql); + bean.setRowNum(list.size()+1); + bean.setTitle("消毒物品工作量统计"); + String key = ""; + Integer amount = 0; + try { + while (result.next()) { + key = result.getString(1); + // 月份以0开头的,去掉0 + if(key.length() > 1 && Integer.valueOf(key) < 10){ + key = Integer.valueOf(key).toString(); + } + amount = result.getInt(2); + setWorkQualityBeanAmount(bean, key, amount); + } + } catch (SQLException e) { + e.printStackTrace(); + }finally { + DatabaseUtil.closeResultSetAndStatement(result); + } + list.add(bean); + } private void getDisinfectGoodsUnqualifiedAmount( Map> startAndEndDays, @@ -2483,6 +2603,45 @@ list.add(bean); } } + // 消毒物品不合格数 全年统计 + private void getDisinfectGoodsUnqualifiedAmountAllYear( + String year, + List list,String querySupplyRoom) throws SQLException { + WorkQualityCollection bean = new WorkQualityCollection(); + String queryYear = year + "-01-01 00:00:00"; + String nextYear = getNextYear(year) + " 00:00:00"; + String sql = "select " + dateQueryAdapter.dateConverAdapter3("q.dateTime","mm") + + " monthstr, sum(q.amount) from QualityMonitoring q " + + " where q.orgUnitCoding = '"+querySupplyRoom+"' " + + " and q.inspectitem like '%消毒物品不合格%' and q.dateTime >= " + + dateQueryAdapter.dateAdapter(queryYear) + + " and q.dateTime <= " + + dateQueryAdapter.dateAdapter(nextYear) + + " and q.type = '质量监测' " + +" group by q.id " + + " , " + dateQueryAdapter.dateConverAdapter3("q.dateTime","mm"); + ResultSet result = objectDao.executeSql(sql); + bean.setRowNum(list.size()+1); + bean.setTitle("消毒物品不合格数"); + String key = ""; + Integer amount = 0; + try { + while (result.next()) { + key = result.getString(1); + // 月份以0开头的,去掉0 + if(key.length() > 1 && Integer.valueOf(key) < 10){ + key = Integer.valueOf(key).toString(); + } + amount = result.getInt(2); + setWorkQualityBeanAmount(bean, key, amount); + } + } catch (SQLException e) { + e.printStackTrace(); + }finally { + DatabaseUtil.closeResultSetAndStatement(result); + } + list.add(bean); + } private void getLabelChangeColourUnqualifiedAmount( Map> startAndEndDays, @@ -2528,7 +2687,81 @@ list.add(bean); } } + // 包内化学指示卡不合格 全年数据查询 + private void getLabelChangeColourUnqualifiedAmountAllYear( + String year, + List list,String querySupplyRoom) throws SQLException { + WorkQualityCollection bean = new WorkQualityCollection(); + String queryYear = year + "-01-01 00:00:00"; + String nextYear = getNextYear(year) + " 00:00:00"; + String sql = "select " + dateQueryAdapter.dateConverAdapter3("q.dateTime","mm") + + " monthstr, sum(q.amount) from QualityMonitoring q,QualityMonitoringAnswer a " + + "where q.id = a.qualitymonitoring_id and a.answer like '%包外化学指示标签变色不合格%' and q.dateTime >= " + + dateQueryAdapter.dateAdapter(queryYear) + + " and q.dateTime <= " + + dateQueryAdapter.dateAdapter(nextYear) + + " and q.type = '质量监测'" + + " and q.orgUnitCoding = '"+querySupplyRoom+"'" + + " group by " + dateQueryAdapter.dateConverAdapter3("q.dateTime","mm"); + String sql2 = "select " + dateQueryAdapter.dateConverAdapter3("p.packTime","mm") + + " monthstr, sum(p.amount) from packingrecord p where p.packTime >= " + + dateQueryAdapter.dateAdapter(queryYear) + + " and p.packTime <= " + + dateQueryAdapter.dateAdapter(nextYear) + + " and p.orgUnitCoding = '"+querySupplyRoom+"'" + + " group by " + dateQueryAdapter.dateConverAdapter3("p.packTime","mm"); + ResultSet result = objectDao.executeSql(sql); + bean.setRowNum(list.size()+1); + bean.setTitle("包外化学指示标签变色不合格"); + String key = ""; + Integer amount = 0; + Map map = new HashMap(); + try { + while (result.next()) { + key = result.getString(1); + // 月份以0开头的,去掉0 + if(key.length() > 1 && Integer.valueOf(key) < 10){ + key = Integer.valueOf(key).toString(); + } + amount = result.getInt(2); + map.put(key,amount); + setWorkQualityBeanAmount(bean, key, amount); + } + } catch (SQLException e) { + e.printStackTrace(); + }finally { + DatabaseUtil.closeResultSetAndStatement(result); + } + // 遍历结果集 设置百分比 + ResultSet result2 = objectDao.executeSql(sql2); + try{ + while(result2.next()){ + key = result2.getString(1); + // 月份以0开头的,去掉0 + if(key.length() > 1 && Integer.valueOf(key) < 10){ + key = Integer.valueOf(key).toString(); + } + amount = map.get(key); + // 分母 + int amount2 = result2.getInt(2); + if(amount2 > 0 && amount != null){ + double percentage = new BigDecimal(amount).divide( + new BigDecimal(amount2), 4, BigDecimal.ROUND_HALF_UP) + .doubleValue(); + percentage = new BigDecimal(percentage).multiply( + new BigDecimal(100)).doubleValue(); + setWorkQualityBeanPercentage(bean, key, percentage); + } + } + }catch(SQLException e){ + e.printStackTrace(); + }finally{ + DatabaseUtil.closeResultSetAndStatement(result2); + } + list.add(bean); + } + private void getSecordDaySendTousseAmount( Map> startAndEndDays, List list,String querySupplyRoom) throws SQLException { @@ -2572,6 +2805,48 @@ list.add(bean); } } + // 手术包次日下送件数 全年数据 + private void getSecordDaySendTousseAmountAllYear( + String year, + List list,String querySupplyRoom) throws SQLException { + WorkQualityCollection bean = new WorkQualityCollection(); + String queryYear = year + "-01-01 00:00:00"; + String nextYear = getNextYear(year) + " 00:00:00"; + String sql = "select " + dateQueryAdapter.dateConverAdapter3("p.applicationTime","mm") + + " monthstr, count(*) from invoiceplan p ,invoice i,tousseinstance t where p.id = i.invoiceplan_id and t.invoice_id = i.id " + + "and i.orgUnitCoding = '"+querySupplyRoom+"' and " + + dateQueryAdapter.dateToVarchar("p.applicationTime") + + " != " + + dateQueryAdapter.dateToVarchar("i.sendTime") + + " and p.depart = '手术室' " + + "and p.applicationTime >= " + + dateQueryAdapter.dateAdapter(queryYear) + + " and p.applicationTime <= " + + dateQueryAdapter.dateAdapter(nextYear) + + " and i.status != '未发货'" + + " group by " + dateQueryAdapter.dateConverAdapter3("p.applicationTime","mm"); + ResultSet result = objectDao.executeSql(sql); + bean.setRowNum(list.size()+1); + bean.setTitle("手术包次日下送件数"); + String key = ""; + Integer amount = 0; + try { + while (result.next()) { + key = result.getString(1); + // 月份以0开头的,去掉0 + if(key.length() > 1 && Integer.valueOf(key) < 10){ + key = Integer.valueOf(key).toString(); + } + amount = result.getInt(2); + setWorkQualityBeanAmount(bean, key, amount); + } + } catch (SQLException e) { + e.printStackTrace(); + }finally { + DatabaseUtil.closeResultSetAndStatement(result); + } + list.add(bean); + } private void getWashForeignMaterialAmount( Map> startAndEndDays, @@ -2610,7 +2885,42 @@ list.add(bean); } } - + // 外来器械清洗总件数 全年统计 + private void getWashForeignMaterialAmountAllYear( + String year, + List list,String querySupplyRoom) throws SQLException { + WorkQualityCollection bean = new WorkQualityCollection(); + String queryYear = year + "-01-01 00:00:00"; + String nextYear = getNextYear(year) + " 00:00:00"; + String sql = "select " + dateQueryAdapter.dateConverAdapter3("r.endDate","mm") + + " monthstr, sum(r.foreignMaterialAmount) from washanddisinfectrecord r " + + "where r.orgUnitCoding = '"+querySupplyRoom+"' and r.endDate >= " + + dateQueryAdapter.dateAdapter(queryYear) + + " and r.endDate <= " + + dateQueryAdapter.dateAdapter(nextYear) + + " group by " + dateQueryAdapter.dateConverAdapter3("r.endDate","mm"); + ResultSet result = objectDao.executeSql(sql); + bean.setRowNum(list.size()+1); + bean.setTitle("外来器械清洗总件数"); + String key = ""; + Integer amount = 0; + try { + while (result.next()) { + key = result.getString(1); + // 月份以0开头的,去掉0 + if(key.length() > 1 && Integer.valueOf(key) < 10){ + key = Integer.valueOf(key).toString(); + } + amount = result.getInt(2); + setWorkQualityBeanAmount(bean, key, amount); + } + } catch (SQLException e) { + e.printStackTrace(); + }finally { + DatabaseUtil.closeResultSetAndStatement(result); + } + list.add(bean); + } private void getSterilizationFaildAmount( Map> startAndEndDays, List list,String querySupplyRoom) throws SQLException { @@ -2639,7 +2949,44 @@ list.add(bean); } } - + // 灭菌失败事件发生数 全年数据 + private void getSterilizationFaildAmountAllYear( + String year, + List list,String querySupplyRoom) throws SQLException { + WorkQualityCollection bean = new WorkQualityCollection(); + String queryYear = year + "-01-01 00:00:00"; + String nextYear = getNextYear(year) + " 00:00:00"; + String sql = "select " + dateQueryAdapter.dateConverAdapter3("q.dateTime","mm") + + " monthstr, count(*) from QualityMonitoring q where q.inspectitem like '%灭菌失败事件%' " + + "and q.dateTime >= " + + dateQueryAdapter.dateAdapter(queryYear) + + " and q.dateTime <= " + + dateQueryAdapter.dateAdapter(nextYear) + + " and q.type = '质量监测'" + + " and q.orgUnitCoding = '"+querySupplyRoom+"'" + + " group by " + dateQueryAdapter.dateConverAdapter3("q.dateTime","mm"); + ResultSet result = objectDao.executeSql(sql); + bean.setRowNum(list.size()+1); + bean.setTitle("灭菌失败事件发生数"); + String key = ""; + Integer amount = 0; + try { + while (result.next()) { + key = result.getString(1); + // 月份以0开头的,去掉0 + if(key.length() > 1 && Integer.valueOf(key) < 10){ + key = Integer.valueOf(key).toString(); + } + amount = result.getInt(2); + setWorkQualityBeanAmount(bean, key, amount); + } + } catch (SQLException e) { + e.printStackTrace(); + }finally { + DatabaseUtil.closeResultSetAndStatement(result); + } + list.add(bean); + } private void getGoodsDeliveryError( Map> startAndEndDays, List list,String querySupplyRoom) throws SQLException { @@ -2668,7 +3015,44 @@ list.add(bean); } } - + // 无菌物品发放错误发生数 全年数据 + private void getGoodsDeliveryErrorAllYear( + String year, + List list,String querySupplyRoom) throws SQLException { + WorkQualityCollection bean = new WorkQualityCollection(); + String queryYear = year + "-01-01 00:00:00"; + String nextYear = getNextYear(year) + " 00:00:00"; + String sql = "select " + dateQueryAdapter.dateConverAdapter3("q.dateTime","mm") + + " monthstr, sum(q.amount) from QualityMonitoring q where q.inspectitem like '%无菌物品发放错误发生数%' " + + "and q.dateTime >= " + + dateQueryAdapter.dateAdapter(queryYear) + + " and q.dateTime <= " + + dateQueryAdapter.dateAdapter(nextYear) + + " and q.type = '质量监测'" + + " and q.orgUnitCoding = '"+querySupplyRoom+"'" + + " group by " + dateQueryAdapter.dateConverAdapter3("q.dateTime","mm"); + ResultSet result = objectDao.executeSql(sql); + bean.setRowNum(list.size()+1); + bean.setTitle("无菌物品发放错误发生数"); + String key = ""; + Integer amount = 0; + try { + while (result.next()) { + key = result.getString(1); + // 月份以0开头的,去掉0 + if(key.length() > 1 && Integer.valueOf(key) < 10){ + key = Integer.valueOf(key).toString(); + } + amount = result.getInt(2); + setWorkQualityBeanAmount(bean, key, amount); + } + } catch (SQLException e) { + e.printStackTrace(); + }finally { + DatabaseUtil.closeResultSetAndStatement(result); + } + list.add(bean); + } private void getRecyclingMaterialLostAmount( Map> startAndEndDays, List list,String querySupplyRoom) throws SQLException { @@ -2698,7 +3082,45 @@ list.add(bean); } } - + // 回收器械丢失发生件数 全年数据 + private void getRecyclingMaterialLostAmountAllYear( + String year, + List list,String querySupplyRoom) throws SQLException { + WorkQualityCollection bean = new WorkQualityCollection(); + String queryYear = year + "-01-01 00:00:00"; + String nextYear = getNextYear(year) + " 00:00:00"; + String sql = "select " + dateQueryAdapter.dateConverAdapter3("q.dateTime","mm") + + " monthstr, sum(q.amount) from QualityMonitoring q " + + " where q.orgUnitCoding = '"+querySupplyRoom+"' " + + " and q.inspectitem like '%回收器械丢失%' " + + "and q.dateTime >= " + + dateQueryAdapter.dateAdapter(queryYear) + + " and q.dateTime <= " + + dateQueryAdapter.dateAdapter(nextYear) + + " and q.type = '质量监测'" + + " group by " + dateQueryAdapter.dateConverAdapter3("q.dateTime","mm"); + ResultSet result = objectDao.executeSql(sql); + bean.setRowNum(list.size()+1); + bean.setTitle("回收器械丢失发生件数"); + String key = ""; + Integer amount = 0; + try { + while (result.next()) { + key = result.getString(1); + // 月份以0开头的,去掉0 + if(key.length() > 1 && Integer.valueOf(key) < 10){ + key = Integer.valueOf(key).toString(); + } + amount = result.getInt(2); + setWorkQualityBeanAmount(bean, key, amount); + } + } catch (SQLException e) { + e.printStackTrace(); + }finally { + DatabaseUtil.closeResultSetAndStatement(result); + } + list.add(bean); + } private void getMaterialScrapAmount( Map> startAndEndDays, List list,String querySupplyRoom) throws SQLException { @@ -2744,7 +3166,79 @@ list.add(bean); } } + // 器械损坏件数 全年数据 + private void getMaterialScrapAmountAllYear( + String year, + List list,String querySupplyRoom) throws SQLException { + WorkQualityCollection bean = new WorkQualityCollection(); + String queryYear = year + "-01-01 00:00:00"; + String nextYear = getNextYear(year) + " 00:00:00"; + String sql = "select " + dateQueryAdapter.dateConverAdapter3("po.dateTime","mm") + + " monthstr, count(po.amount) from qualitymonitoring po" + + " where po.orgUnitCoding = '"+querySupplyRoom+"' " + + " and po.inspectitem like '%器械损坏%'" + " and po.dateTime >= " + + dateQueryAdapter.dateAdapter(queryYear) + + " and po.dateTime <= " + + dateQueryAdapter.dateAdapter(nextYear) + + " group by " + dateQueryAdapter.dateConverAdapter3("po.dateTime","mm"); + String sql2 = "select " + dateQueryAdapter.dateConverAdapter3("p.packTime","mm") + + " monthstr, sum(p.amount) from packingrecord p " + + " where p.orgUnitCoding = '"+querySupplyRoom+"' and p.packTime >= " + + dateQueryAdapter.dateAdapter(queryYear) + + " and p.packTime <= " + + dateQueryAdapter.dateAdapter(nextYear) + + " group by " + dateQueryAdapter.dateConverAdapter3("p.packTime","mm"); + ResultSet result = objectDao.executeSql(sql); + bean.setRowNum(list.size()+1); + bean.setTitle("器械损坏件数"); + String key = ""; + Integer amount = 0; + Map map = new HashMap(); + try { + while (result.next()) { + key = result.getString(1); + // 月份以0开头的,去掉0 + if(key.length() > 1 && Integer.valueOf(key) < 10){ + key = Integer.valueOf(key).toString(); + } + amount = result.getInt(2); + map.put(key,amount); + setWorkQualityBeanAmount(bean, key, amount); + } + } catch (SQLException e) { + e.printStackTrace(); + }finally { + DatabaseUtil.closeResultSetAndStatement(result); + } + // 遍历结果集 设置百分比 + ResultSet result2 = objectDao.executeSql(sql2); + try{ + while(result2.next()){ + key = result2.getString(1); + // 月份以0开头的,去掉0 + if(key.length() > 1 && Integer.valueOf(key) < 10){ + key = Integer.valueOf(key).toString(); + } + amount = map.get(key); + // 分母 + int amount2 = result2.getInt(2); + if(amount2 > 0 && amount != null){ + double percentage = new BigDecimal(amount).divide( + new BigDecimal(amount2), 4, BigDecimal.ROUND_HALF_UP) + .doubleValue(); + percentage = new BigDecimal(percentage).multiply( + new BigDecimal(100)).doubleValue(); + setWorkQualityBeanPercentage(bean, key, percentage); + } + } + }catch(SQLException e){ + e.printStackTrace(); + }finally{ + DatabaseUtil.closeResultSetAndStatement(result2); + } + list.add(bean); + } private void getTousseOutsideSmudginess( Map> startAndEndDays, List list,String querySupplyRoom) throws SQLException { @@ -2790,7 +3284,81 @@ list.add(bean); } } + // 包外明显污迹 全年数据 + private void getTousseOutsideSmudginessAllYear( + String year, + List list,String querySupplyRoom) throws SQLException { + WorkQualityCollection bean = new WorkQualityCollection(); + String queryYear = year + "-01-01 00:00:00"; + String nextYear = getNextYear(year) + " 00:00:00"; + String sql = "select " + dateQueryAdapter.dateConverAdapter3("q.dateTime","mm") + + " monthstr, sum(q.amount) from QualityMonitoring q,QualityMonitoringAnswer a " + + "where q.id = a.qualitymonitoring_id " + + "and a.answer like '%包外明显污迹%' and q.dateTime >= " + + dateQueryAdapter.dateAdapter(queryYear) + + " and q.dateTime <= " + + dateQueryAdapter.dateAdapter(nextYear) + + " and q.type = '质量监测'" + + " and q.orgUnitCoding = '"+querySupplyRoom+"'" + + " group by " + dateQueryAdapter.dateConverAdapter3("q.dateTime","mm"); + String sql2 = "select " + dateQueryAdapter.dateConverAdapter3("p.packTime","mm") + + " monthstr, sum(p.amount) from packingrecord p where p.packTime >= " + + dateQueryAdapter.dateAdapter(queryYear) + + " and p.packTime <= " + + dateQueryAdapter.dateAdapter(nextYear) + + " and p.orgUnitCoding = '"+querySupplyRoom+"'" + + " group by " + dateQueryAdapter.dateConverAdapter3("p.packTime","mm"); + ResultSet result = objectDao.executeSql(sql); + bean.setRowNum(list.size()+1); + bean.setTitle("包外明显污迹"); + String key = ""; + Integer amount = 0; + Map map = new HashMap(); + try { + while (result.next()) { + key = result.getString(1); + // 月份以0开头的,去掉0 + if(key.length() > 1 && Integer.valueOf(key) < 10){ + key = Integer.valueOf(key).toString(); + } + amount = result.getInt(2); + map.put(key,amount); + setWorkQualityBeanAmount(bean, key, amount); + } + } catch (SQLException e) { + e.printStackTrace(); + }finally { + DatabaseUtil.closeResultSetAndStatement(result); + } + // 遍历结果集 设置百分比 + ResultSet result2 = objectDao.executeSql(sql2); + try{ + while(result2.next()){ + key = result2.getString(1); + // 月份以0开头的,去掉0 + if(key.length() > 1 && Integer.valueOf(key) < 10){ + key = Integer.valueOf(key).toString(); + } + amount = map.get(key); + // 分母 + int amount2 = result2.getInt(2); + if(amount2 > 0 && amount != null){ + double percentage = new BigDecimal(amount).divide( + new BigDecimal(amount2), 4, BigDecimal.ROUND_HALF_UP) + .doubleValue(); + percentage = new BigDecimal(percentage).multiply( + new BigDecimal(100)).doubleValue(); + setWorkQualityBeanPercentage(bean, key, percentage); + } + } + }catch(SQLException e){ + e.printStackTrace(); + }finally{ + DatabaseUtil.closeResultSetAndStatement(result2); + } + list.add(bean); + } private void getLooseTagsAmount( Map> startAndEndDays, List list,String querySupplyRoom) throws SQLException { @@ -2836,7 +3404,81 @@ list.add(bean); } } + // 标签固定差 全年数据 + private void getLooseTagsAmountAllYear( + String year, + List list,String querySupplyRoom) throws SQLException { + WorkQualityCollection bean = new WorkQualityCollection(); + String queryYear = year + "-01-01 00:00:00"; + String nextYear = getNextYear(year) + " 00:00:00"; + String sql = "select " + dateQueryAdapter.dateConverAdapter3("q.dateTime","mm") + + " monthstr, sum(q.amount) from QualityMonitoring q,QualityMonitoringAnswer a " + + "where q.id = a.qualitymonitoring_id " + + "and a.answer like '%标签固定差%' and q.dateTime >= " + + dateQueryAdapter.dateAdapter(queryYear) + + " and q.dateTime <= " + + dateQueryAdapter.dateAdapter(nextYear) + + " and q.type = '质量监测'" + + " and q.orgUnitCoding = '"+querySupplyRoom+"'" + + " group by " + dateQueryAdapter.dateConverAdapter3("q.dateTime","mm"); + String sql2 = "select " + dateQueryAdapter.dateConverAdapter3("p.packTime","mm") + + " monthstr, sum(p.amount) from packingrecord p where p.packTime >= " + + dateQueryAdapter.dateAdapter(queryYear) + + " and p.packTime <= " + + dateQueryAdapter.dateAdapter(nextYear) + + " and p.orgUnitCoding = '"+querySupplyRoom+"'" + + " group by " + dateQueryAdapter.dateConverAdapter3("p.packTime","mm"); + ResultSet result = objectDao.executeSql(sql); + bean.setRowNum(list.size()+1); + bean.setTitle("标签固定差"); + String key = ""; + Integer amount = 0; + Map map = new HashMap(); + try { + while (result.next()) { + key = result.getString(1); + // 月份以0开头的,去掉0 + if(key.length() > 1 && Integer.valueOf(key) < 10){ + key = Integer.valueOf(key).toString(); + } + amount = result.getInt(2); + map.put(key,amount); + setWorkQualityBeanAmount(bean, key, amount); + } + } catch (SQLException e) { + e.printStackTrace(); + }finally { + DatabaseUtil.closeResultSetAndStatement(result); + } + // 遍历结果集 设置百分比 + ResultSet result2 = objectDao.executeSql(sql2); + try{ + while(result2.next()){ + key = result2.getString(1); + // 月份以0开头的,去掉0 + if(key.length() > 1 && Integer.valueOf(key) < 10){ + key = Integer.valueOf(key).toString(); + } + amount = map.get(key); + // 分母 + int amount2 = result2.getInt(2); + if(amount2 > 0 && amount != null){ + double percentage = new BigDecimal(amount).divide( + new BigDecimal(amount2), 4, BigDecimal.ROUND_HALF_UP) + .doubleValue(); + percentage = new BigDecimal(percentage).multiply( + new BigDecimal(100)).doubleValue(); + setWorkQualityBeanPercentage(bean, key, percentage); + } + } + }catch(SQLException e){ + e.printStackTrace(); + }finally{ + DatabaseUtil.closeResultSetAndStatement(result2); + } + list.add(bean); + } private void getIncompactPackageAmount( Map> startAndEndDays, List list,String querySupplyRoom) throws SQLException { @@ -2882,7 +3524,81 @@ list.add(bean); } } + // 包装松散 全年数据 + private void getIncompactPackageAmountAllYear( + String year, + List list,String querySupplyRoom) throws SQLException { + WorkQualityCollection bean = new WorkQualityCollection(); + String queryYear = year + "-01-01 00:00:00"; + String nextYear = getNextYear(year) + " 00:00:00"; + String sql = "select " + dateQueryAdapter.dateConverAdapter3("q.dateTime","mm") + + " monthstr, sum(q.amount) from QualityMonitoring q,QualityMonitoringAnswer a " + + "where q.id = a.qualitymonitoring_id " + + "and a.answer like '%包装松散%' and q.dateTime >= " + + dateQueryAdapter.dateAdapter(queryYear) + + " and q.dateTime <= " + + dateQueryAdapter.dateAdapter(nextYear) + + " and q.type = '质量监测'" + + " and q.orgUnitCoding = '"+querySupplyRoom+"'" + + " group by " + dateQueryAdapter.dateConverAdapter3("q.dateTime","mm"); + String sql2 = "select " + dateQueryAdapter.dateConverAdapter3("p.packTime","mm") + + " monthstr, sum(p.amount) from packingrecord p where p.packTime >= " + + dateQueryAdapter.dateAdapter(queryYear) + + " and p.packTime <= " + + dateQueryAdapter.dateAdapter(nextYear) + + " and p.orgUnitCoding = '"+querySupplyRoom+"'" + + " group by " + dateQueryAdapter.dateConverAdapter3("p.packTime","mm"); + ResultSet result = objectDao.executeSql(sql); + bean.setRowNum(list.size()+1); + bean.setTitle("包装松散"); + String key = ""; + Integer amount = 0; + Map map = new HashMap(); + try { + while (result.next()) { + key = result.getString(1); + // 月份以0开头的,去掉0 + if(key.length() > 1 && Integer.valueOf(key) < 10){ + key = Integer.valueOf(key).toString(); + } + amount = result.getInt(2); + map.put(key,amount); + setWorkQualityBeanAmount(bean, key, amount); + } + } catch (SQLException e) { + e.printStackTrace(); + }finally { + DatabaseUtil.closeResultSetAndStatement(result); + } + // 遍历结果集 设置百分比 + ResultSet result2 = objectDao.executeSql(sql2); + try{ + while(result2.next()){ + key = result2.getString(1); + // 月份以0开头的,去掉0 + if(key.length() > 1 && Integer.valueOf(key) < 10){ + key = Integer.valueOf(key).toString(); + } + amount = map.get(key); + // 分母 + int amount2 = result2.getInt(2); + if(amount2 > 0 && amount != null){ + double percentage = new BigDecimal(amount).divide( + new BigDecimal(amount2), 4, BigDecimal.ROUND_HALF_UP) + .doubleValue(); + percentage = new BigDecimal(percentage).multiply( + new BigDecimal(100)).doubleValue(); + setWorkQualityBeanPercentage(bean, key, percentage); + } + } + }catch(SQLException e){ + e.printStackTrace(); + }finally{ + DatabaseUtil.closeResultSetAndStatement(result2); + } + list.add(bean); + } private void getInstructionCardUnqualified( Map> startAndEndDays, List list,String querySupplyRoom) throws SQLException { @@ -2928,7 +3644,81 @@ list.add(bean); } } + // 包内化学指示卡变色不合格数 全年数据 + private void getInstructionCardUnqualifiedAllYear( + String year, + List list,String querySupplyRoom) throws SQLException { + WorkQualityCollection bean = new WorkQualityCollection(); + String queryYear = year + "-01-01 00:00:00"; + String nextYear = getNextYear(year) + " 00:00:00"; + String sql = "select " + dateQueryAdapter.dateConverAdapter3("q.dateTime","mm") + + " monthstr, sum(q.amount) from QualityMonitoring q,QualityMonitoringAnswer a " + + "where q.id = a.qualitymonitoring_id " + + "and a.questionName like '%包内化学指示卡变色不合格%' and q.dateTime >= " + + dateQueryAdapter.dateAdapter(queryYear) + + " and q.dateTime <= " + + dateQueryAdapter.dateAdapter(nextYear) + + " and q.type = '质量监测'" + + " and q.orgUnitCoding = '"+querySupplyRoom+"'" + + " group by " + dateQueryAdapter.dateConverAdapter3("q.dateTime","mm"); + String sql2 = "select " + dateQueryAdapter.dateConverAdapter3("p.packTime","mm") + + " monthstr, sum(p.amount) from packingrecord p where p.packTime >= " + + dateQueryAdapter.dateAdapter(queryYear) + + " and p.packTime <= " + + dateQueryAdapter.dateAdapter(nextYear) + + " and p.orgUnitCoding = '"+querySupplyRoom+"'" + + " group by " + dateQueryAdapter.dateConverAdapter3("p.packTime","mm"); + ResultSet result = objectDao.executeSql(sql); + bean.setRowNum(list.size()+1); + bean.setTitle("包内化学指示卡变色不合格数"); + String key = ""; + Integer amount = 0; + Map map = new HashMap(); + try { + while (result.next()) { + key = result.getString(1); + // 月份以0开头的,去掉0 + if(key.length() > 1 && Integer.valueOf(key) < 10){ + key = Integer.valueOf(key).toString(); + } + amount = result.getInt(2); + map.put(key,amount); + setWorkQualityBeanAmount(bean, key, amount); + } + } catch (SQLException e) { + e.printStackTrace(); + }finally { + DatabaseUtil.closeResultSetAndStatement(result); + } + // 遍历结果集 设置百分比 + ResultSet result2 = objectDao.executeSql(sql2); + try{ + while(result2.next()){ + key = result2.getString(1); + // 月份以0开头的,去掉0 + if(key.length() > 1 && Integer.valueOf(key) < 10){ + key = Integer.valueOf(key).toString(); + } + amount = map.get(key); + // 分母 + int amount2 = result2.getInt(2); + if(amount2 > 0 && amount != null){ + double percentage = new BigDecimal(amount).divide( + new BigDecimal(amount2), 4, BigDecimal.ROUND_HALF_UP) + .doubleValue(); + percentage = new BigDecimal(percentage).multiply( + new BigDecimal(100)).doubleValue(); + setWorkQualityBeanPercentage(bean, key, percentage); + } + } + }catch(SQLException e){ + e.printStackTrace(); + }finally{ + DatabaseUtil.closeResultSetAndStatement(result2); + } + list.add(bean); + } private void getWetBagAmount( Map> startAndEndDays, List list,String querySupplyRoom) throws SQLException { @@ -2975,7 +3765,83 @@ list.add(bean); } } + // 湿包发生数 全年数量 + private void getWetBagAmountAllYear( + String year, + List list,String querySupplyRoom) throws SQLException { + WorkQualityCollection bean = new WorkQualityCollection(); + String queryYear = year + "-01-01 00:00:00"; + String nextYear = getNextYear(year) + " 00:00:00"; + String sql = "select " + dateQueryAdapter.dateConverAdapter3("q.dateTime","mm") + + " monthstr, sum(q.amount) from QualityMonitoring q,QualityMonitoringAnswer a " + + "where q.id = a.qualitymonitoring_id and q.inspectitem like '%湿包%' and a.questionname = '类型' " + + "and a.answer like '%湿包%' and q.dateTime >= " + + dateQueryAdapter.dateAdapter(queryYear) + + " and q.dateTime <= " + + dateQueryAdapter.dateAdapter(nextYear) + + " and q.type = '质量监测'" + + " and q.orgUnitCoding = '"+querySupplyRoom+"'" + + " group by " + dateQueryAdapter.dateConverAdapter3("q.dateTime","mm"); + String sql2 = "select " + dateQueryAdapter.dateConverAdapter3("r.endDate","mm") + + " monthstr, sum(r.amount) from sterilizationrecord r where r.endDate >= " + + dateQueryAdapter.dateAdapter(queryYear) + + " and r.endDate <= " + + dateQueryAdapter.dateAdapter(nextYear) + + " and r.status = '灭菌完成'" + + " and r.orgUnitCoding = '"+querySupplyRoom+"'" + + " group by " + dateQueryAdapter.dateConverAdapter3("r.endDate","mm"); + ResultSet result = objectDao.executeSql(sql); + bean.setRowNum(list.size()+1); + bean.setTitle("湿包发生数"); + String key = ""; + Integer amount = 0; + Map map = new HashMap(); + try { + while (result.next()) { + key = result.getString(1); + // 月份以0开头的,去掉0 + if(key.length() > 1 && Integer.valueOf(key) < 10){ + key = Integer.valueOf(key).toString(); + } + amount = result.getInt(2); + map.put(key,amount); + setWorkQualityBeanAmount(bean, key, amount); + } + } catch (SQLException e) { + e.printStackTrace(); + }finally { + DatabaseUtil.closeResultSetAndStatement(result); + } + // 遍历结果集 设置百分比 + ResultSet result2 = objectDao.executeSql(sql2); + try{ + while(result2.next()){ + key = result2.getString(1); + // 月份以0开头的,去掉0 + if(key.length() > 1 && Integer.valueOf(key) < 10){ + key = Integer.valueOf(key).toString(); + } + amount = map.get(key); + // 分母 + int amount2 = result2.getInt(2); + if(amount2 > 0 && amount != null){ + double percentage = new BigDecimal(amount).divide( + new BigDecimal(amount2), 4, BigDecimal.ROUND_HALF_UP) + .doubleValue(); + percentage = new BigDecimal(percentage).multiply( + new BigDecimal(100)).doubleValue(); + setWorkQualityBeanPercentage(bean, key, percentage); + } + } + }catch(SQLException e){ + e.printStackTrace(); + }finally{ + DatabaseUtil.closeResultSetAndStatement(result2); + } + list.add(bean); + } + private void getTornBagAmount( Map> startAndEndDays, List list,String querySupplyRoom) throws SQLException { @@ -3021,7 +3887,81 @@ list.add(bean); } } + // 破包发生数量 全年数据 + private void getTornBagAmountAllYear( + String year, + List list,String querySupplyRoom) throws SQLException { + WorkQualityCollection bean = new WorkQualityCollection(); + String queryYear = year + "-01-01 00:00:00"; + String nextYear = getNextYear(year) + " 00:00:00"; + String sql = "select " + dateQueryAdapter.dateConverAdapter3("q.dateTime","mm") + + " monthstr, sum(q.amount) from QualityMonitoring q " + + "where q.inspectitem like '%破包%' and q.dateTime >= " + + dateQueryAdapter.dateAdapter(queryYear) + + " and q.dateTime <= " + + dateQueryAdapter.dateAdapter(nextYear) + + " and q.type = '质量监测'" + + " and q.orgUnitCoding = '"+querySupplyRoom+"'" + + " group by " + dateQueryAdapter.dateConverAdapter3("q.dateTime","mm"); + String sql2 = "select " + dateQueryAdapter.dateConverAdapter3("r.endDate","mm") + + " monthstr, sum(r.amount) from sterilizationrecord r where r.endDate >= " + + dateQueryAdapter.dateAdapter(queryYear) + + " and r.endDate <= " + + dateQueryAdapter.dateAdapter(nextYear) + + " and r.status = '灭菌完成'" + + " and r.orgUnitCoding = '"+querySupplyRoom+"'" + + " group by " + dateQueryAdapter.dateConverAdapter3("r.endDate","mm"); + ResultSet result = objectDao.executeSql(sql); + bean.setRowNum(list.size()+1); + bean.setTitle("破包发生数量"); + String key = ""; + Integer amount = 0; + Map map = new HashMap(); + try { + while (result.next()) { + key = result.getString(1); + // 月份以0开头的,去掉0 + if(key.length() > 1 && Integer.valueOf(key) < 10){ + key = Integer.valueOf(key).toString(); + } + amount = result.getInt(2); + map.put(key,amount); + setWorkQualityBeanAmount(bean, key, amount); + } + } catch (SQLException e) { + e.printStackTrace(); + }finally { + DatabaseUtil.closeResultSetAndStatement(result); + } + // 遍历结果集 设置百分比 + ResultSet result2 = objectDao.executeSql(sql2); + try{ + while(result2.next()){ + key = result2.getString(1); + // 月份以0开头的,去掉0 + if(key.length() > 1 && Integer.valueOf(key) < 10){ + key = Integer.valueOf(key).toString(); + } + amount = map.get(key); + // 分母 + int amount2 = result2.getInt(2); + if(amount2 > 0 && amount != null){ + double percentage = new BigDecimal(amount).divide( + new BigDecimal(amount2), 4, BigDecimal.ROUND_HALF_UP) + .doubleValue(); + percentage = new BigDecimal(percentage).multiply( + new BigDecimal(100)).doubleValue(); + setWorkQualityBeanPercentage(bean, key, percentage); + } + } + }catch(SQLException e){ + e.printStackTrace(); + }finally{ + DatabaseUtil.closeResultSetAndStatement(result2); + } + list.add(bean); + } private void getSterilizationTypeChooserWrong( Map> startAndEndDays, List list,String querySupplyRoom) throws SQLException { @@ -3051,7 +3991,45 @@ list.add(bean); } } - + // 灭菌方式选择不正确发生数 全年数据 + private void getSterilizationTypeChooserWrongAllYear( + String year, + List list,String querySupplyRoom) throws SQLException { + WorkQualityCollection bean = new WorkQualityCollection(); + String queryYear = year + "-01-01 00:00:00"; + String nextYear = getNextYear(year) + " 00:00:00"; + String sql = "select " + dateQueryAdapter.dateConverAdapter3("q.dateTime","mm") + + " monthstr, count(*) from QualityMonitoring q,QualityMonitoringAnswer a " + + "where q.id = a.qualitymonitoring_id and q.inspectitem like '%灭菌失败事件%' and a.questionname = '灭菌方式选择不正确' " + + "and a.answer is not null and q.dateTime >= " + + dateQueryAdapter.dateAdapter(queryYear) + + " and q.dateTime <= " + + dateQueryAdapter.dateAdapter(nextYear) + + " and q.type = '质量监测'" + + " and q.orgUnitCoding = '"+querySupplyRoom+"'" + + " group by " + dateQueryAdapter.dateConverAdapter3("q.dateTime","mm"); + ResultSet result = objectDao.executeSql(sql); + bean.setRowNum(list.size()+1); + bean.setTitle("灭菌方式选择不正确发生数"); + String key = ""; + Integer amount = 0; + try { + while (result.next()) { + key = result.getString(1); + // 月份以0开头的,去掉0 + if(key.length() > 1 && Integer.valueOf(key) < 10){ + key = Integer.valueOf(key).toString(); + } + amount = result.getInt(2); + setWorkQualityBeanAmount(bean, key, amount); + } + } catch (SQLException e) { + e.printStackTrace(); + }finally { + DatabaseUtil.closeResultSetAndStatement(result); + } + list.add(bean); + } private void getLabelErrorAmount( Map> startAndEndDays, List list,String querySupplyRoom) throws SQLException { @@ -3081,7 +4059,45 @@ list.add(bean); } } - + // 无菌标识不正确发生数 全年数据 + private void getLabelErrorAmountAllYear( + String year, + List list,String querySupplyRoom) throws SQLException { + WorkQualityCollection bean = new WorkQualityCollection(); + String queryYear = year + "-01-01 00:00:00"; + String nextYear = getNextYear(year) + " 00:00:00"; + String sql = "select " + dateQueryAdapter.dateConverAdapter3("q.dateTime","mm") + + " monthstr, sum(q.amount) from QualityMonitoring q,QualityMonitoringAnswer a " + + "where q.id = a.qualitymonitoring_id " + + "and a.answer like '%包外标识不正确%' and q.dateTime >= " + + dateQueryAdapter.dateAdapter(queryYear) + + " and q.dateTime <= " + + dateQueryAdapter.dateAdapter(nextYear) + + " and q.type = '质量监测'" + + " and q.orgUnitCoding = '"+querySupplyRoom+"'" + + " group by " + dateQueryAdapter.dateConverAdapter3("q.dateTime","mm"); + ResultSet result = objectDao.executeSql(sql); + bean.setRowNum(list.size()+1); + bean.setTitle("无菌标识不正确发生数"); + String key = ""; + Integer amount = 0; + try { + while (result.next()) { + key = result.getString(1); + // 月份以0开头的,去掉0 + if(key.length() > 1 && Integer.valueOf(key) < 10){ + key = Integer.valueOf(key).toString(); + } + amount = result.getInt(2); + setWorkQualityBeanAmount(bean, key, amount); + } + } catch (SQLException e) { + e.printStackTrace(); + }finally { + DatabaseUtil.closeResultSetAndStatement(result); + } + list.add(bean); + } private void getMaterialTypeErrorAmount( Map> startAndEndDays, List list,String querySupplyRoom) throws SQLException { @@ -3125,7 +4141,81 @@ list.add(bean); } } + // 包内器械种类错误发生件数 全年数据 + private void getMaterialTypeErrorAmountAllYear( + String year, + List list,String querySupplyRoom) throws SQLException { + WorkQualityCollection bean = new WorkQualityCollection(); + String queryYear = year + "-01-01 00:00:00"; + String nextYear = getNextYear(year) + " 00:00:00"; + String sql = "select " + dateQueryAdapter.dateConverAdapter3("q.dateTime","mm") + + " monthstr, sum(q.amount) from QualityMonitoring q,QualityMonitoringAnswer a " + + "where q.id = a.qualitymonitoring_id " + + "and a.answer like '%器械种类错误%' and q.dateTime >= " + + dateQueryAdapter.dateAdapter(queryYear) + + " and q.dateTime <= " + + dateQueryAdapter.dateAdapter(nextYear) + + " and q.type = '质量监测'" + + " and q.orgUnitCoding = '"+querySupplyRoom+"'" + + " group by " + dateQueryAdapter.dateConverAdapter3("q.dateTime","mm"); + String sql2 = "select " + dateQueryAdapter.dateConverAdapter3("p.packTime","mm") + + " monthstr, sum(p.amount) from packingrecord p where p.packTime >= " + + dateQueryAdapter.dateAdapter(queryYear) + + " and p.packTime <= " + + dateQueryAdapter.dateAdapter(nextYear) + + " and p.orgUnitCoding = '"+querySupplyRoom+"'" + + " group by " + dateQueryAdapter.dateConverAdapter3("p.packTime","mm"); + ResultSet result = objectDao.executeSql(sql); + bean.setRowNum(list.size()+1); + bean.setTitle("包内器械种类错误发生件数"); + String key = ""; + Integer amount = 0; + Map map = new HashMap(); + try { + while (result.next()) { + key = result.getString(1); + // 月份以0开头的,去掉0 + if(key.length() > 1 && Integer.valueOf(key) < 10){ + key = Integer.valueOf(key).toString(); + } + amount = result.getInt(2); + map.put(key,amount); + setWorkQualityBeanAmount(bean, key, amount); + } + } catch (SQLException e) { + e.printStackTrace(); + }finally { + DatabaseUtil.closeResultSetAndStatement(result); + } + // 遍历结果集 设置百分比 + ResultSet result2 = objectDao.executeSql(sql2); + try{ + while(result2.next()){ + key = result2.getString(1); + // 月份以0开头的,去掉0 + if(key.length() > 1 && Integer.valueOf(key) < 10){ + key = Integer.valueOf(key).toString(); + } + amount = map.get(key); + // 分母 + int amount2 = result2.getInt(2); + if(amount2 > 0 && amount != null){ + double percentage = new BigDecimal(amount).divide( + new BigDecimal(amount2), 4, BigDecimal.ROUND_HALF_UP) + .doubleValue(); + percentage = new BigDecimal(percentage).multiply( + new BigDecimal(100)).doubleValue(); + setWorkQualityBeanPercentage(bean, key, percentage); + } + } + }catch(SQLException e){ + e.printStackTrace(); + }finally{ + DatabaseUtil.closeResultSetAndStatement(result2); + } + list.add(bean); + } private void getMaterialFunctionIncomplete( Map> startAndEndDays, List list,String querySupplyRoom) throws SQLException { @@ -3169,7 +4259,81 @@ list.add(bean); } } + // 无菌包内器械功能不全件数 全年数据 + private void getMaterialFunctionIncompleteAllYear( + String year, + List list,String querySupplyRoom) throws SQLException { + WorkQualityCollection bean = new WorkQualityCollection(); + String queryYear = year + "-01-01 00:00:00"; + String nextYear = getNextYear(year) + " 00:00:00"; + String sql = "select " + dateQueryAdapter.dateConverAdapter3("q.dateTime","mm") + + " monthstr, sum(q.amount) from QualityMonitoring q,QualityMonitoringAnswer a " + + "where q.id = a.qualitymonitoring_id " + + "and a.answer like '%器械功能不全%' and q.dateTime >= " + + dateQueryAdapter.dateAdapter(queryYear) + + " and q.dateTime <= " + + dateQueryAdapter.dateAdapter(nextYear) + + " and q.type = '质量监测'" + + " and q.orgUnitCoding = '"+querySupplyRoom+"'" + + " group by " + dateQueryAdapter.dateConverAdapter3("q.dateTime","mm"); + String sql2 = "select " + dateQueryAdapter.dateConverAdapter3("p.packTime","mm") + + " monthstr, sum(p.amount) from packingrecord p where p.packTime >= " + + dateQueryAdapter.dateAdapter(queryYear) + + " and p.packTime <= " + + dateQueryAdapter.dateAdapter(nextYear) + + " and p.orgUnitCoding = '"+querySupplyRoom+"'" + + " group by " + dateQueryAdapter.dateConverAdapter3("p.packTime","mm"); + ResultSet result = objectDao.executeSql(sql); + bean.setRowNum(list.size()+1); + bean.setTitle("无菌包内器械功能不全件数"); + String key = ""; + Integer amount = 0; + Map map = new HashMap(); + try { + while (result.next()) { + key = result.getString(1); + // 月份以0开头的,去掉0 + if(key.length() > 1 && Integer.valueOf(key) < 10){ + key = Integer.valueOf(key).toString(); + } + amount = result.getInt(2); + map.put(key,amount); + setWorkQualityBeanAmount(bean, key, amount); + } + } catch (SQLException e) { + e.printStackTrace(); + }finally { + DatabaseUtil.closeResultSetAndStatement(result); + } + // 遍历结果集 设置百分比 + ResultSet result2 = objectDao.executeSql(sql2); + try{ + while(result2.next()){ + key = result2.getString(1); + // 月份以0开头的,去掉0 + if(key.length() > 1 && Integer.valueOf(key) < 10){ + key = Integer.valueOf(key).toString(); + } + amount = map.get(key); + // 分母 + int amount2 = result2.getInt(2); + if(amount2 > 0 && amount != null){ + double percentage = new BigDecimal(amount).divide( + new BigDecimal(amount2), 4, BigDecimal.ROUND_HALF_UP) + .doubleValue(); + percentage = new BigDecimal(percentage).multiply( + new BigDecimal(100)).doubleValue(); + setWorkQualityBeanPercentage(bean, key, percentage); + } + } + }catch(SQLException e){ + e.printStackTrace(); + }finally{ + DatabaseUtil.closeResultSetAndStatement(result2); + } + list.add(bean); + } private void getMaterialLostAmount( Map> startAndEndDays, List list,String querySupplyRoom) throws SQLException { @@ -3213,7 +4377,81 @@ list.add(bean); } } + // 无菌包内器械缺失发生件数 全年数据 + private void getMaterialLostAmountAllYear( + String year, + List list,String querySupplyRoom) throws SQLException { + WorkQualityCollection bean = new WorkQualityCollection(); + String queryYear = year + "-01-01 00:00:00"; + String nextYear = getNextYear(year) + " 00:00:00"; + String sql = "select " + dateQueryAdapter.dateConverAdapter3("q.dateTime","mm") + + " monthstr, sum(q.amount) from QualityMonitoring q,QualityMonitoringAnswer a " + + "where q.id = a.qualitymonitoring_id " + + "and a.answer like '%器械缺失%' and q.dateTime >= " + + dateQueryAdapter.dateAdapter(queryYear) + + " and q.dateTime <= " + + dateQueryAdapter.dateAdapter(nextYear) + + " and q.type = '质量监测'" + + " and q.orgUnitCoding = '"+querySupplyRoom+"'" + + " group by " + dateQueryAdapter.dateConverAdapter3("q.dateTime","mm"); + String sql2 = "select " + dateQueryAdapter.dateConverAdapter3("p.packTime","mm") + + " monthstr, sum(p.amount) from packingrecord p where p.packTime >= " + + dateQueryAdapter.dateAdapter(queryYear) + + " and p.packTime <= " + + dateQueryAdapter.dateAdapter(nextYear) + + " and p.orgUnitCoding = '"+querySupplyRoom+"'" + + " group by " + dateQueryAdapter.dateConverAdapter3("p.packTime","mm"); + ResultSet result = objectDao.executeSql(sql); + bean.setRowNum(list.size()+1); + bean.setTitle("无菌包内器械缺失发生件数"); + String key = ""; + Integer amount = 0; + Map map = new HashMap(); + try { + while (result.next()) { + key = result.getString(1); + // 月份以0开头的,去掉0 + if(key.length() > 1 && Integer.valueOf(key) < 10){ + key = Integer.valueOf(key).toString(); + } + amount = result.getInt(2); + map.put(key,amount); + setWorkQualityBeanAmount(bean, key, amount); + } + } catch (SQLException e) { + e.printStackTrace(); + }finally { + DatabaseUtil.closeResultSetAndStatement(result); + } + // 遍历结果集 设置百分比 + ResultSet result2 = objectDao.executeSql(sql2); + try{ + while(result2.next()){ + key = result2.getString(1); + // 月份以0开头的,去掉0 + if(key.length() > 1 && Integer.valueOf(key) < 10){ + key = Integer.valueOf(key).toString(); + } + amount = map.get(key); + // 分母 + int amount2 = result2.getInt(2); + if(amount2 > 0 && amount != null){ + double percentage = new BigDecimal(amount).divide( + new BigDecimal(amount2), 4, BigDecimal.ROUND_HALF_UP) + .doubleValue(); + percentage = new BigDecimal(percentage).multiply( + new BigDecimal(100)).doubleValue(); + setWorkQualityBeanPercentage(bean, key, percentage); + } + } + }catch(SQLException e){ + e.printStackTrace(); + }finally{ + DatabaseUtil.closeResultSetAndStatement(result2); + } + list.add(bean); + } private void getPackSealUnqualifiedAmount( Map> startAndEndDays, List list,String querySupplyRoom) throws SQLException { @@ -3256,7 +4494,81 @@ list.add(bean); } } + // 灭菌物品包装密闭不合格数 全年统计 + private void getPackSealUnqualifiedAmountAllYear( + String year, + List list,String querySupplyRoom) throws SQLException { + WorkQualityCollection bean = new WorkQualityCollection(); + String queryYear = year + "-01-01 00:00:00"; + String nextYear = getNextYear(year) + " 00:00:00"; + String sql = "select " + dateQueryAdapter.dateConverAdapter3("q.dateTime","mm") + + "monthstr, sum(q.amount) from QualityMonitoring q,QualityMonitoringAnswer a " + + "where q.id = a.qualitymonitoring_id " + + " and q.orgUnitCoding = '"+querySupplyRoom+"' and a.answer like '%包装密闭不合格%' and q.dateTime >= " + + dateQueryAdapter.dateAdapter(queryYear) + + " and q.dateTime <= " + + dateQueryAdapter.dateAdapter(nextYear) + + " and q.type = '质量监测'" + + " group by " + dateQueryAdapter.dateConverAdapter3("q.dateTime","mm"); + String sql2 = "select " + dateQueryAdapter.dateConverAdapter3("p.packTime","mm") + + " monthstr, sum(p.amount) from packingrecord p" + + " where p.orgUnitCoding = '"+querySupplyRoom+"' and p.packTime >= " + + dateQueryAdapter.dateAdapter(queryYear) + + " and p.packTime <= " + + dateQueryAdapter.dateAdapter(nextYear) + + " group by " + dateQueryAdapter.dateConverAdapter3("p.packTime","mm"); + ResultSet result = objectDao.executeSql(sql); + bean.setRowNum(list.size()+1); + bean.setTitle("灭菌物品包装密闭不合格数"); + String key = ""; + Integer amount = 0; + Map map = new HashMap(); + try { + while (result.next()) { + key = result.getString(1); + // 月份以0开头的,去掉0 + if(key.length() > 1 && Integer.valueOf(key) < 10){ + key = Integer.valueOf(key).toString(); + } + amount = result.getInt(2); + map.put(key,amount); + setWorkQualityBeanAmount(bean, key, amount); + } + } catch (SQLException e) { + e.printStackTrace(); + }finally { + DatabaseUtil.closeResultSetAndStatement(result); + } + // 遍历结果集 设置百分比 + ResultSet result2 = objectDao.executeSql(sql2); + try{ + while(result2.next()){ + key = result2.getString(1); + // 月份以0开头的,去掉0 + if(key.length() > 1 && Integer.valueOf(key) < 10){ + key = Integer.valueOf(key).toString(); + } + amount = map.get(key); + // 分母 + int amount2 = result2.getInt(2); + if(amount2 > 0 && amount != null){ + double percentage = new BigDecimal(amount).divide( + new BigDecimal(amount2), 4, BigDecimal.ROUND_HALF_UP) + .doubleValue(); + percentage = new BigDecimal(percentage).multiply( + new BigDecimal(100)).doubleValue(); + setWorkQualityBeanPercentage(bean, key, percentage); + } + } + }catch(SQLException e){ + e.printStackTrace(); + }finally{ + DatabaseUtil.closeResultSetAndStatement(result2); + } + list.add(bean); + } + public Integer getSumAmountBySql(String sql) throws SQLException { if (StringUtils.isNotBlank(sql)) { ResultSet rs = objectDao.executeSql(sql); @@ -3274,7 +4586,6 @@ } return 0; } - private void getSendTousseAmount( Map> startAndEndDays, List list,String querySupplyRoom) throws SQLException { @@ -3316,7 +4627,47 @@ list.add(bean); } } - + // 发放无菌物品总包数(器械包) 全年数量 + private void getSendTousseAmountAllYear( + String year, + List list,String querySupplyRoom) throws SQLException { + WorkQualityCollection bean = new WorkQualityCollection(); + String queryYear = year + "-01-01 00:00:00"; + String nextYear = getNextYear(year) + " 00:00:00"; + String sql = "select " + dateQueryAdapter.dateConverAdapter3("i.sendTime","mm") + + " monthstr, sum(i.tousseamount) from invoice i,invoiceplan p where i.invoiceplan_id = p.id" + + " and i.orgUnitCoding = '"+querySupplyRoom+"'" + + " and p.type != '" + + InvoicePlan.TYPE_DIPOSABLE_GOODS_APPLICATION_FORM + + "' and i.sendTime >= " + + dateQueryAdapter.dateAdapter(queryYear) + + " and i.sendTime <= " + + dateQueryAdapter.dateAdapter(nextYear) + + " and i.status != '" + Invoice.STATUS_UNDELIVERED + "'" + + " group by " + dateQueryAdapter.dateConverAdapter3("i.sendTime","mm"); + + ResultSet result = objectDao.executeSql(sql); + bean.setRowNum(list.size()+1); + bean.setTitle("发放无菌物品总包数(器械包)"); + String key = ""; + Integer amount = 0; + try { + while (result.next()) { + key = result.getString(1); + // 月份以0开头的,去掉0 + if(key.length() > 1 && Integer.valueOf(key) < 10){ + key = Integer.valueOf(key).toString(); + } + amount = result.getInt(2); + setWorkQualityBeanAmount(bean, key, amount); + } + } catch (SQLException e) { + e.printStackTrace(); + }finally { + DatabaseUtil.closeResultSetAndStatement(result); + } + list.add(bean); + } private void getSendDiposableGoodsAmount( Map> startAndEndDays, List list,String querySupplyRoom) throws SQLException { @@ -3358,7 +4709,46 @@ list.add(bean); } } - + // 发放无菌物品总件数(一次性物品) 全年数量 + private void getSendDiposableGoodsAmountAllYear( + String year, + List list,String querySupplyRoom) throws SQLException { + WorkQualityCollection bean = new WorkQualityCollection(); + String queryYear = year + "-01-01 00:00:00"; + String nextYear = getNextYear(year) + " 00:00:00"; + String sql = "select " + dateQueryAdapter.dateConverAdapter3("i.sendTime","mm") + + " monthstr, sum(i.diposablegoodsamount) from invoice i,invoiceplan p where i.invoiceplan_id = p.id" + + " and i.orgUnitCoding = '"+querySupplyRoom+"'" + + " and p.type = '" + + InvoicePlan.TYPE_DIPOSABLE_GOODS_APPLICATION_FORM + + "' and i.sendTime >= " + + dateQueryAdapter.dateAdapter(queryYear) + + " and i.sendTime <= " + + dateQueryAdapter.dateAdapter(nextYear) + + " and i.status != '" + Invoice.STATUS_UNDELIVERED + "'" + + " group by " + dateQueryAdapter.dateConverAdapter3("i.sendTime","mm"); + ResultSet result = objectDao.executeSql(sql); + bean.setRowNum(list.size()+1); + bean.setTitle("发放无菌物品总件数(一次性物品)"); + String key = ""; + Integer amount = 0; + try { + while (result.next()) { + key = result.getString(1); + // 月份以0开头的,去掉0 + if(key.length() > 1 && Integer.valueOf(key) < 10){ + key = Integer.valueOf(key).toString(); + } + amount = result.getInt(2); + setWorkQualityBeanAmount(bean, key, amount); + } + } catch (SQLException e) { + e.printStackTrace(); + }finally { + DatabaseUtil.closeResultSetAndStatement(result); + } + list.add(bean); + } private void getMaterialWashUnqualifiedAmount( Map> startAndEndDays, List list,String querySupplyRoom) throws SQLException { @@ -3425,6 +4815,83 @@ list.add(bean); } } + // 器械清洗不合格数 全年统计的数据 + private void getMaterialWashUnqualifiedAmountAllYear( + String year, + List list,String querySupplyRoom) throws SQLException { + WorkQualityCollection bean = new WorkQualityCollection(); + String queryYear = year + "-01-01 00:00:00"; + String nextYear = getNextYear(year) + " 00:00:00"; + // 清洗不合格量 + String sql = "select " + dateQueryAdapter.dateConverAdapter3("q.dateTime","mm") + + " monthstr, sum(q.amount) from QualityMonitoring q " + + " where q.inspectitem like '%器械清洗不合格%' " + + " and q.orgUnitCoding = '"+querySupplyRoom+"'" + + " and q.type = '质量监测' " + + " and q.dateTime >= " + + dateQueryAdapter.dateAdapter(queryYear) + + " and q.dateTime <= " + + dateQueryAdapter.dateAdapter(nextYear) + + " group by " + dateQueryAdapter.dateConverAdapter3("q.dateTime","mm"); + // 清洗总量 + String sql2 = "select "+ dateQueryAdapter.dateConverAdapter3("r.endDate","mm") + + " monthstr, sum(r.washmaterialamount) from washanddisinfectrecord r " + + "where r.orgUnitCoding = '"+querySupplyRoom+"' and r.endDate >= " + + dateQueryAdapter.dateAdapter(queryYear) + + " and r.endDate <= " + + dateQueryAdapter.dateAdapter(nextYear) + + " group by " + dateQueryAdapter.dateConverAdapter3("r.endDate","mm"); + + ResultSet result = objectDao.executeSql(sql); + bean.setRowNum(list.size()+1); + bean.setTitle("器械清洗不合格数"); + String key = ""; + Integer amount = 0; + Map map = new HashMap(); + try { + while (result.next()) { + key = result.getString(1); + // 月份以0开头的,去掉0 + if(key.length() > 1 && Integer.valueOf(key) < 10){ + key = Integer.valueOf(key).toString(); + } + amount = result.getInt(2); + map.put(key,amount); + setWorkQualityBeanAmount(bean, key, amount); + } + } catch (SQLException e) { + e.printStackTrace(); + }finally { + DatabaseUtil.closeResultSetAndStatement(result); + } + // 遍历结果集 设置百分比 + ResultSet result2 = objectDao.executeSql(sql2); + try{ + while(result2.next()){ + key = result2.getString(1); + // 月份以0开头的,去掉0 + if(key.length() > 1 && Integer.valueOf(key) < 10){ + key = Integer.valueOf(key).toString(); + } + amount = map.get(key); + // 分母 + int amount2 = result2.getInt(2); + if(amount2 > 0 && amount != null){ + double percentage = new BigDecimal(amount).divide( + new BigDecimal(amount2), 4, BigDecimal.ROUND_HALF_UP) + .doubleValue(); + percentage = new BigDecimal(percentage).multiply( + new BigDecimal(100)).doubleValue(); + setWorkQualityBeanPercentage(bean, key, percentage); + } + } + }catch(SQLException e){ + e.printStackTrace(); + }finally{ + DatabaseUtil.closeResultSetAndStatement(result2); + } + list.add(bean); + } private void getDressingAmount( Map> startAndEndDays, @@ -3468,7 +4935,45 @@ list.add(bean); } } + // 处理敷料总件数 全年数据的获取 + private void getDressingAmountAllYear( + String year, + List list,String querySupplyRoom) throws SQLException { + WorkQualityCollection bean = new WorkQualityCollection(); + String queryYear = year + "-01-01 00:00:00"; + String nextYear = getNextYear(year) + " 00:00:00"; + String sql = "select " + dateQueryAdapter.dateConverAdapter3("t.operationTime","mm") + + " monthstr, sum(t.statisticsamount) from tousseinstance t,toussedefinition d where " + + "t.toussedefinition_id = d.id and t.operationTime >= " + + dateQueryAdapter.dateAdapter(queryYear) + + " and t.operationTime <= " + + dateQueryAdapter.dateAdapter(nextYear) + + " and d.toussetype = '" + + TousseDefinition.PACKAGE_TYPE_DRESSING + "'" + + " group by " + dateQueryAdapter.dateConverAdapter3("t.operationTime","mm"); + ResultSet result = objectDao.executeSql(sql); + bean.setRowNum(list.size()+1); + bean.setTitle("处理敷料总件数"); + String key = ""; + Integer amount = 0; + try { + while (result.next()) { + key = result.getString(1); + // 月份以0开头的,去掉0 + if(key.length() > 1 && Integer.valueOf(key) < 10){ + key = Integer.valueOf(key).toString(); + } + amount = result.getInt(2); + setWorkQualityBeanAmount(bean, key, amount); + } + } catch (SQLException e) { + e.printStackTrace(); + }finally { + DatabaseUtil.closeResultSetAndStatement(result); + } + list.add(bean); + } private void getSterilizationAmount( Map> startAndEndDays, List list,String querySupplyRoom) throws SQLException { @@ -3522,6 +5027,60 @@ list.add(foreignTousseBean); } } + // 普通灭菌 代理灭菌 外部代理灭菌的统计,全年数据 + private void getSterilizationAmountAllYear( + String year, + List list,String querySupplyRoom) throws SQLException { + WorkQualityCollection tousseBean = new WorkQualityCollection(); + WorkQualityCollection foreignTousseBean = new WorkQualityCollection(); + WorkQualityCollection proxyTousseBean = new WorkQualityCollection(); + WorkQualityCollection bean = new WorkQualityCollection(); + String queryYear = year + "-01-01 00:00:00"; + String nextYear = getNextYear(year) + " 00:00:00"; + String sql = "select " + dateQueryAdapter.dateConverAdapter3("s.endDate","mm") + + " monthstr, sum(s.tousseAmount+s.dressingTousseAmount),sum(s.proxyTousseAmount)," + + "sum(s.foreignTousseAmount) from sterilizationrecord s " + + " where s.orgUnitCoding = '"+querySupplyRoom+"' and s.endDate >= " + + dateQueryAdapter.dateAdapter(queryYear) + + " and s.endDate <= " + + dateQueryAdapter.dateAdapter(nextYear) + + " and s.status = '灭菌完成'" + + " group by " + dateQueryAdapter.dateConverAdapter3("s.endDate","mm"); + ResultSet result = objectDao.executeSql(sql); + tousseBean.setRowNum(list.size()+1); + proxyTousseBean.setRowNum(list.size()+2); + foreignTousseBean.setRowNum(list.size()+3); + tousseBean.setTitle("灭菌物品总包数(普通灭菌)"); + proxyTousseBean.setTitle("灭菌物品总包数(代理灭菌)"); + foreignTousseBean.setTitle("灭菌物品总包数(外部代理灭菌)"); + String key = ""; + Integer amount = 0; + Integer proxyamount = 0; + Integer foreignamount = 0; + try { + while (result.next()) { + key = result.getString(1); + // 月份以0开头的,去掉0 + if(key.length() > 1 && Integer.valueOf(key) < 10){ + key = Integer.valueOf(key).toString(); + } + amount = result.getInt(1); + proxyamount = result.getInt(2); + foreignamount = result.getInt(3); + setWorkQualityBeanAmount(tousseBean, key, amount); + setWorkQualityBeanAmount(proxyTousseBean, key, proxyamount); + setWorkQualityBeanAmount(foreignTousseBean, key, foreignamount); + } + } catch (SQLException e) { + e.printStackTrace(); + }finally { + DatabaseUtil.closeResultSetAndStatement(result); + } + list.add(tousseBean); + list.add(proxyTousseBean); + list.add(foreignTousseBean); + + } private void getPackingAmount( Map> startAndEndDays, @@ -3563,6 +5122,41 @@ list.add(bean); } } + // CSSD包装物品总包数 全年数量 + private void getPackingAmountAllYear( + String year, + List list,String querySupplyRoom) throws SQLException { + WorkQualityCollection bean = new WorkQualityCollection(); + String queryYear = year + "-01-01 00:00:00"; + String nextYear = getNextYear(year) + " 00:00:00"; + String sql = "select " + dateQueryAdapter.dateConverAdapter3("t.operationTime","mm") + + " monthstr, count(*) from tousseinstance t where t.operationTime >= " + + dateQueryAdapter.dateAdapter(queryYear) + + " and t.operationTime <= " + + dateQueryAdapter.dateAdapter(nextYear) + + " group by " + dateQueryAdapter.dateConverAdapter3("t.operationTime","mm"); + ResultSet result = objectDao.executeSql(sql); + bean.setRowNum(list.size()+1); + bean.setTitle("CSSD包装物品总包数"); + String key = ""; + Integer amount = 0; + try { + while (result.next()) { + key = result.getString(1); + // 月份以0开头的,去掉0 + if(key.length() > 1 && Integer.valueOf(key) < 10){ + key = Integer.valueOf(key).toString(); + } + amount = result.getInt(2); + setWorkQualityBeanAmount(bean, key, amount); + } + } catch (SQLException e) { + e.printStackTrace(); + }finally { + DatabaseUtil.closeResultSetAndStatement(result); + } + list.add(bean); + } private void getPackingTousseMaterialAmount( Map> startAndEndDays, @@ -3606,7 +5200,43 @@ list.add(bean); } } - + // CSSD包装物品总件数 全能数量 + private void getPackingTousseMaterialAmountAllYear( + String year, + List list,String querySupplyRoom) throws SQLException { + WorkQualityCollection bean = new WorkQualityCollection(); + String queryYear = year + "-01-01 00:00:00"; + String nextYear = getNextYear(year) + " 00:00:00"; + String sql ="select " + dateQueryAdapter.dateConverAdapter3("t.operationTime","mm") + + " monthstr, sum(mi.count) from tousseinstance t,TousseDefinition td,MaterialInstance mi " + +" where t.tousseDefinition_id = td.id " + +" and td.id = mi.tousse_id and t.operationTime >= " + + dateQueryAdapter.dateAdapter(queryYear) + + " and t.operationTime <= " + + dateQueryAdapter.dateAdapter(nextYear) + + " group by " + dateQueryAdapter.dateConverAdapter3("t.operationTime","mm"); + ResultSet result = objectDao.executeSql(sql); + bean.setRowNum(list.size()+1); + bean.setTitle("CSSD包装物品总件数"); + String key = ""; + Integer amount = 0; + try { + while (result.next()) { + key = result.getString(1); + // 月份以0开头的,去掉0 + if(key.length() > 1 && Integer.valueOf(key) < 10){ + key = Integer.valueOf(key).toString(); + } + amount = result.getInt(2); + setWorkQualityBeanAmount(bean, key, amount); + } + } catch (SQLException e) { + e.printStackTrace(); + }finally { + DatabaseUtil.closeResultSetAndStatement(result); + } + list.add(bean); + } private void getCountFrequencyOfMonth( Map> startAndEndDays, List list,String querySupplyRoom) throws SQLException { @@ -3652,13 +5282,54 @@ list.add(bean); } } - } - - - } - + // 灭菌器使用炉次 全年数据 + private void getCountFrequencyOfMonthAllYear( + String year, + List list,String querySupplyRoom) throws SQLException { + List sterilerGroupList = httpOptionManager.getHttpOptionListById("sterilerGroup"); + if(sterilerGroupList!= null && sterilerGroupList.size()>0){ + for(int i=0;i= " + + dateQueryAdapter.dateAdapter(queryYear) + + " and sr.endDate <= " + + dateQueryAdapter.dateAdapter(nextYear) + + " and s.ownGroup = '"+optionText+"'" + + " group by " + dateQueryAdapter.dateConverAdapter3("sr.endDate","mm"); + ResultSet result = objectDao.executeSql(sql); + bean.setRowNum(list.size()+1); + bean.setTitle("灭菌器使用炉次("+optionText+")"); + String key = ""; + Integer amount = 0; + try { + while (result.next()) { + key = result.getString(1); + // 月份以0开头的,去掉0 + if(key.length() > 1 && Integer.valueOf(key) < 10){ + key = Integer.valueOf(key).toString(); + } + amount = result.getInt(2); + setWorkQualityBeanAmount(bean, key, amount); + } + } catch (SQLException e) { + e.printStackTrace(); + }finally { + DatabaseUtil.closeResultSetAndStatement(result); + } + list.add(bean); + } + } + } private void getWashMaterialAmount( Map> startAndEndDays, List list,String querySupplyRoom) throws SQLException { @@ -3696,6 +5367,42 @@ list.add(bean); } } + // 工作量持续报表 获取处理器械总件数 + private void getWashMaterialAmountAllYear( + String year, + List list,String querySupplyRoom) throws SQLException { + WorkQualityCollection bean = new WorkQualityCollection(); + String queryYear = year + "-01-01 00:00:00"; + String nextYear = getNextYear(year) + " 00:00:00"; + String sql = "select " + dateQueryAdapter.dateConverAdapter3("r.endDate","mm") + + " monthstr, sum(r.generalMaterialAmount+r.operateMaterialAmount+r.foreignMaterialAmount) from washanddisinfectrecord r " + + "where r.orgUnitCoding = '"+querySupplyRoom+"' and r.endDate >= " + + dateQueryAdapter.dateAdapter(queryYear) + + " and r.endDate <= " + + dateQueryAdapter.dateAdapter(nextYear) + + " group by " + dateQueryAdapter.dateConverAdapter3("r.endDate","mm"); + ResultSet result = objectDao.executeSql(sql); + bean.setRowNum(list.size()+1); + bean.setTitle("处理器械总件数"); + String key = ""; + Integer amount = 0; + try { + while (result.next()) { + key = result.getString(1); + // 月份以0开头的,去掉0 + if(key.length() > 1 && Integer.valueOf(key) < 10){ + key = Integer.valueOf(key).toString(); + } + amount = result.getInt(2); + setWorkQualityBeanAmount(bean, key, amount); + } + } catch (SQLException e) { + e.printStackTrace(); + }finally { + DatabaseUtil.closeResultSetAndStatement(result); + } + list.add(bean); + } private void setWorkQualityBeanAmount(WorkQualityCollection bean, String key, Integer amount) {