Index: ssts-reports/src/main/java/com/forgon/disinfectsystem/jasperreports/service/JasperReportManagerImpl.java =================================================================== diff -u -r35917 -r35918 --- ssts-reports/src/main/java/com/forgon/disinfectsystem/jasperreports/service/JasperReportManagerImpl.java (.../JasperReportManagerImpl.java) (revision 35917) +++ ssts-reports/src/main/java/com/forgon/disinfectsystem/jasperreports/service/JasperReportManagerImpl.java (.../JasperReportManagerImpl.java) (revision 35918) @@ -2912,111 +2912,6 @@ return amount; } /** - * - * @param year - * @param departCoding - * @param isMorrowSend 是否仅获取次日下送的包 - * @return - */ - public Map getMorrowSendTousseInstanceMap(String year,String departCoding,Boolean isMorrowSend){ - if (StringUtils.isNotBlank(year)){ - try{ - Map rsMap = new HashMap(); - String startTime = year+ "-01-01 00:00:00"; - String endTime = DataIndex.getNextYear(year) + " 00:00:00"; - String sql = "select distinct po from " + Invoice.class.getSimpleName() + " po inner join fetch po.invoicePlan inner join fetch po.invoiceItem where " - + " ( po.invoicePlan.depart like '%" + "手术室" + "%' or po.invoicePlan.depart like '%" + "麻醉" +"%' )" - + " and po.invoicePlan.handleDepartCoding = '" + departCoding + "'" - + " and po.sendTime between " + dateQueryAdapter.dateAdapter(startTime) - + " and " + dateQueryAdapter.dateAdapter(endTime) ; - List invoices = objectDao.findByHql(sql); - SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); - if(invoices != null && invoices.size()>0){ - for (int i = 1; i <= 12; i++) { - String mm = ""; - if (i > 9) { - mm = "" + i; - } else { - mm = "0" + i; - } - startTime = year + "-" + mm + "-01 00:00:00"; - endTime = DateTools.getNextMonth(year,mm) + " 00:00:00"; - Date starDate = sdf.parse(startTime); - Date endDate = sdf.parse(endTime); - int tousseInstanceAmount = 0; - for(Invoice iv : invoices){ - Date dt = iv.getSendTime(); - if( dt != null){ - if(starDate.before(dt) && endDate.after(dt)){ - tousseInstanceAmount += getMorrowSendTousseInstance(iv,isMorrowSend); - } - } - } - rsMap.put(mm, tousseInstanceAmount); - } - return rsMap; - } - }catch(Exception ex){ - ex.printStackTrace(); - } - } - return null; - } - /** - * 统计一张发货单里面的器械包,isMorrowSend为true时,只返回次日下送器械包个数 - * @param invoice - * @param isMorrowSend - * @return - */ - public int getMorrowSendTousseInstance(Invoice invoice,Boolean isMorrowSend){ - if(invoice == null) - return 0; - int amount = 0; - try{ - for(InvoiceItem it : invoice.getInvoiceItem()){ - if( !"一次性物品".equals(it.getTousseType()) ){ - amount += it.getAmount(); - } - } -// String sql = "select sum(it.amount) from invoiceitem it where it.tousseType != '一次性物品' and it.invoice_id = " + invoice.getId(); -// ResultSet rs = objectDao.executeSql(sql); -// // 获取发货单器械包数量 -// while (rs.next()) { -// amount = rs.getInt(1); -// } -// DatabaseUtil.closeResultSetAndStatement(rs); - - if(isMorrowSend){ - String sql = "select i.sendTime,rr.recyclingTime from RecyclingRecord rr,invoicePlan ip,invoice i " - + " where i.invoicePlan_ID = ip.id and rr.recyclingApplication_id = ip.id" - + " and i.id = " + invoice.getId(); - ResultSet rs1 = objectDao.executeSql(sql); - String sendTimeStr = null; - String recyclingTimeStr = null; - while (rs1.next()) { - sendTimeStr = rs1.getString(1); - recyclingTimeStr = rs1.getString(2); - } - DatabaseUtil.closeResultSetAndStatement(rs1); - if( StringUtils.isNotBlank(sendTimeStr) && StringUtils.isNotBlank(recyclingTimeStr) ){ - sendTimeStr = sendTimeStr.substring(0,10); - recyclingTimeStr = recyclingTimeStr.substring(0,10); - if( !sendTimeStr.equals(recyclingTimeStr) ){ - // 两个时间不一样,则为次日下送 - return amount; - } - } - return 0; - }else{ - return amount; - } - }catch(Exception ex){ - ex.printStackTrace(); - return 0; - } - } - - /** * 获取"外来器械包的植入物和植入型器械灭菌监测及发放报表"的javabean * @param startTime 开始时间 * @param endTime 结束时间