Index: ssts-web/src/main/webapp/jasperRtp/foreignToussesEndTimeoutReport.jrxml =================================================================== diff -u --- ssts-web/src/main/webapp/jasperRtp/foreignToussesEndTimeoutReport.jrxml (revision 0) +++ ssts-web/src/main/webapp/jasperRtp/foreignToussesEndTimeoutReport.jrxml (revision 32914) @@ -0,0 +1,125 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Index: ssts-recyclingrecord/src/main/java/com/forgon/disinfectsystem/recyclingrecord/action/RecyclingRecordAction.java =================================================================== diff -u -r32898 -r32914 --- ssts-recyclingrecord/src/main/java/com/forgon/disinfectsystem/recyclingrecord/action/RecyclingRecordAction.java (.../RecyclingRecordAction.java) (revision 32898) +++ ssts-recyclingrecord/src/main/java/com/forgon/disinfectsystem/recyclingrecord/action/RecyclingRecordAction.java (.../RecyclingRecordAction.java) (revision 32914) @@ -49,6 +49,7 @@ import com.forgon.directory.model.BarcodeDevice; import com.forgon.directory.model.OrgUnit; import com.forgon.directory.service.OrgUnitManager; +import com.forgon.disinfectsystem.adverseeventrecord.service.AdverseEventRecordManager; import com.forgon.disinfectsystem.barcode.service.BarcodeManager; import com.forgon.disinfectsystem.basedata.becleanitem.service.ClassifyBasketManager; import com.forgon.disinfectsystem.basedatamanager.departmentgroup.service.DepartmentGroupManager; @@ -57,6 +58,7 @@ import com.forgon.disinfectsystem.basedatamanager.toussedefinition.service.TousseDefinitionUtils; import com.forgon.disinfectsystem.common.CssdUtils; import com.forgon.disinfectsystem.departmentapplicationtemplate.service.DepartmentAppTemplateManager; +import com.forgon.disinfectsystem.entity.adverseeventrecord.AdverseEventRecord; import com.forgon.disinfectsystem.entity.assestmanagement.DiposableGoodsInstance; import com.forgon.disinfectsystem.entity.basedatamanager.container.Container; import com.forgon.disinfectsystem.entity.basedatamanager.departmentapplicationtemplate.DepartmentAppTemplate; @@ -65,6 +67,7 @@ import com.forgon.disinfectsystem.entity.basedatamanager.materialinstance.MaterialInstance; import com.forgon.disinfectsystem.entity.basedatamanager.reportoption.GoodsOption; import com.forgon.disinfectsystem.entity.basedatamanager.supplyroomconfig.SupplyRoomConfig; +import com.forgon.disinfectsystem.entity.basedatamanager.taskGroup.TaskGroup; import com.forgon.disinfectsystem.entity.basedatamanager.toussedefinition.TousseDefinition; import com.forgon.disinfectsystem.entity.basedatamanager.toussedefinition.TousseInstance; import com.forgon.disinfectsystem.entity.becleanitem.ClassifiedItem; @@ -190,6 +193,7 @@ private ImageFileManager imageFileManager; + private AdverseEventRecordManager adverseEventRecordManager; public void setImageFileManager(ImageFileManager imageFileManager) { this.imageFileManager = imageFileManager; } @@ -3907,6 +3911,8 @@ try { if(DatabaseUtil.isPoIdValid(id)){ objectDao.executeUpdate("update TousseItem set timeoutProcessType='"+ timeoutProcessType +"' where id=" + id); + InvoicePlan ip = (InvoicePlan)objectDao.findByHql("select po.invoicePlan from " + TousseItem.class.getSimpleName() + " po where po.id=" + id).get(0); + adverseEventRecordManager.saveAdverseEventRecord(ip, AdverseEventRecord.EVENTNAME_RECYCLINGTIMEOUTCODE, AdverseEventRecord.EVENTNAME_RECYCLINGTIMEOUT, null); JSONUtil.addSuccess(result, true); }else{ JSONUtil.addProperty(result, JSONUtil.JSON_KEY_MESSAGE, "id不合法"); @@ -4091,5 +4097,4 @@ StrutsResponseUtils.output(false, e.getMessage()); } } - } Index: ssts-web/src/main/webapp/jasperRtp/foreignToussesEndTimeoutReport_child.jasper =================================================================== diff -u Binary files differ Index: ssts-reports/src/main/java/com/forgon/disinfectsystem/jasperreports/javabeansource/AdverseEventRecordReportVo.java =================================================================== diff -u --- ssts-reports/src/main/java/com/forgon/disinfectsystem/jasperreports/javabeansource/AdverseEventRecordReportVo.java (revision 0) +++ ssts-reports/src/main/java/com/forgon/disinfectsystem/jasperreports/javabeansource/AdverseEventRecordReportVo.java (revision 32914) @@ -0,0 +1,46 @@ +package com.forgon.disinfectsystem.jasperreports.javabeansource; + + +public class AdverseEventRecordReportVo { + + private String eventName; + + private String timeoutHandType; + + private Integer eventCount; + + private String incidenceRate; + + public String getTimeoutHandType() { + return timeoutHandType; + } + + public void setTimeoutHandType(String timeoutHandType) { + this.timeoutHandType = timeoutHandType; + } + + public Integer getEventCount() { + return eventCount; + } + + public void setEventCount(Integer eventCount) { + this.eventCount = eventCount; + } + + public String getIncidenceRate() { + return incidenceRate; + } + + public void setIncidenceRate(String incidenceRate) { + this.incidenceRate = incidenceRate; + } + + public String getEventName() { + return eventName; + } + + public void setEventName(String eventName) { + this.eventName = eventName; + } + +} Index: ssts-web/src/main/webapp/jasperRtp/recyclingTimeoutReport.jrxml =================================================================== diff -u --- ssts-web/src/main/webapp/jasperRtp/recyclingTimeoutReport.jrxml (revision 0) +++ ssts-web/src/main/webapp/jasperRtp/recyclingTimeoutReport.jrxml (revision 32914) @@ -0,0 +1,100 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Index: ssts-reports/src/main/java/com/forgon/disinfectsystem/jasperreports/action/JasperreportsAction.java =================================================================== diff -u -r32793 -r32914 --- ssts-reports/src/main/java/com/forgon/disinfectsystem/jasperreports/action/JasperreportsAction.java (.../JasperreportsAction.java) (revision 32793) +++ ssts-reports/src/main/java/com/forgon/disinfectsystem/jasperreports/action/JasperreportsAction.java (.../JasperreportsAction.java) (revision 32914) @@ -62,6 +62,7 @@ import com.forgon.disinfectsystem.basedatamanager.warehouse.service.WareHouseManager; import com.forgon.disinfectsystem.common.CssdUtils; import com.forgon.disinfectsystem.diposablegoods.service.DiposableGoodsManager; +import com.forgon.disinfectsystem.entity.adverseeventrecord.AdverseEventRecord; import com.forgon.disinfectsystem.entity.assestmanagement.DisposableGoods; import com.forgon.disinfectsystem.entity.assestmanagement.GodownEntry; import com.forgon.disinfectsystem.entity.basedatamanager.reportoption.GoodsOption; @@ -1907,6 +1908,23 @@ parametMap.put("title", "外来器械包大小统计报表("+ startDate +" & "+ endDate +")"); return jasperReportManager.queryForeignTousseSizeReportData(startDate, endDate, supplier, foreignTousseSizeSettingArr, parametMap); } + }else if("adverseEventRecordSumReport".equals(reportName)){ + JSONObject obj = new JSONObject(); + String startDate = StrutsParamUtils.getPraramValue("startDate", ""); + String endDate = StrutsParamUtils.getPraramValue("endDate", ""); + String eventCode = StrutsParamUtils.getPraramValue("eventCode", ""); + JSONObject otherInfo = new JSONObject(); + List resultList = null; + if(AdverseEventRecord.EVENTNAME_FOREIGNTOUSSESENDTIMEOUTCODE.equals(eventCode)){ + parametMap.put("title", AdverseEventRecord.EVENTNAME_FOREIGNTOUSSESENDTIMEOUT + "(" + startDate + " & " + endDate + ")"); + resultList = jasperReportManager.queryForeignToussesEndTimeoutReportData(startDate, endDate, eventCode, otherInfo); + parametMap.put("totalEventCount", otherInfo.optInt("totalEventCount")); + parametMap.put("totalRate", otherInfo.optString("totalRate")); + }else if(AdverseEventRecord.EVENTNAME_RECYCLINGTIMEOUTCODE.equals(eventCode)){ + parametMap.put("title", AdverseEventRecord.EVENTNAME_RECYCLINGTIMEOUT + "(" + startDate + " & " + endDate + ")"); + resultList = jasperReportManager.queryRecyclingTimeoutReportDataSql(startDate, endDate, eventCode); + } + return resultList; } return null; } Index: ssts-web/src/main/webapp/jasperRtp/recyclingTimeoutReport.jasper =================================================================== diff -u Binary files differ Index: ssts-web/src/main/webapp/jasperRtp/foreignToussesEndTimeoutReport.jasper =================================================================== diff -u Binary files differ Index: ssts-reports/src/main/java/com/forgon/disinfectsystem/jasperreports/service/JasperReportManager.java =================================================================== diff -u -r32793 -r32914 --- ssts-reports/src/main/java/com/forgon/disinfectsystem/jasperreports/service/JasperReportManager.java (.../JasperReportManager.java) (revision 32793) +++ ssts-reports/src/main/java/com/forgon/disinfectsystem/jasperreports/service/JasperReportManager.java (.../JasperReportManager.java) (revision 32914) @@ -19,6 +19,7 @@ import com.forgon.disinfectsystem.entity.stocktakerecordmanager.MaterialStockVo; import com.forgon.disinfectsystem.entity.stocktakerecordmanager.MonthGoodsDetailVo; import com.forgon.disinfectsystem.entity.stocktakerecordmanager.StockTakeRecord; +import com.forgon.disinfectsystem.jasperreports.javabeansource.AdverseEventRecordReportVo; import com.forgon.disinfectsystem.jasperreports.javabeansource.ApparatusInfusionisType; import com.forgon.disinfectsystem.jasperreports.javabeansource.BaseBean; import com.forgon.disinfectsystem.jasperreports.javabeansource.BiologicalMonitoringReportVo; @@ -1153,5 +1154,22 @@ * @return */ public JSONObject getReportDataByReportName(String reportName); + /** + * 外来器械包送达超时报表统计 + * @param startDate + * @param endDate + * @param eventCode 事件代码 + * @param otherInfo 额外的返回信息 + * @return + */ + public List queryForeignToussesEndTimeoutReportData(String startDate, String endDate, String eventCode, JSONObject otherInfo); + /** + * 物品回收超时报表统计 + * @param startDate + * @param endDate + * @param eventCode 事件代码 + * @return + */ + public List queryRecyclingTimeoutReportDataSql(String startDate, String endDate, String eventCode); } Index: ssts-reports/src/main/java/com/forgon/disinfectsystem/jasperreports/service/JasperReportManagerImpl.java =================================================================== diff -u -r32793 -r32914 --- ssts-reports/src/main/java/com/forgon/disinfectsystem/jasperreports/service/JasperReportManagerImpl.java (.../JasperReportManagerImpl.java) (revision 32793) +++ ssts-reports/src/main/java/com/forgon/disinfectsystem/jasperreports/service/JasperReportManagerImpl.java (.../JasperReportManagerImpl.java) (revision 32914) @@ -77,6 +77,7 @@ import com.forgon.disinfectsystem.diposablegoods.util.DisposableGoodsUtils; import com.forgon.disinfectsystem.diposablegoods.util.GodownEntryUtil; import com.forgon.disinfectsystem.diposablegoods.util.MaterialEntryUtil; +import com.forgon.disinfectsystem.entity.adverseeventrecord.AdverseEventRecord; import com.forgon.disinfectsystem.entity.assestmanagement.DisposableGoods; import com.forgon.disinfectsystem.entity.assestmanagement.DisposableGoodsBatch; import com.forgon.disinfectsystem.entity.assestmanagement.DisposableGoodsBatchStock; @@ -23784,4 +23785,110 @@ } return new JSONObject(); } + @Override + public List queryForeignToussesEndTimeoutReportData(String startDate, String endDate, String eventCode, JSONObject otherInfo) { + ResultSet rs = null; + List firstColumnVos = new ArrayList(); + Map firstColumnVosMap = new HashMap(); + try { + String betweenSql = String.format(" between %s and %s ", + dateQueryAdapter.dateAdapter(startDate), + dateQueryAdapter.dateAdapter(endDate)); + String sql = String.format("select a.eventName,a.timeoutHandType,count(*) eventCount " + + " from %s a where a.eventTime %s " + + " and eventCode='%s' " + + " group by a.eventName,a.timeoutHandType order by a.eventName ,a.timeoutHandType", + AdverseEventRecord.class.getSimpleName(), + betweenSql, + eventCode); + int invoicePlanCount = objectDao.countBySql("select count(*) from InvoicePlan ip " + + "where ip.type='"+ InvoicePlan.TYPE_FOREIGNTOUSSEAPPLIACTION +"' and ip.recyclingStatus is not null and ip.applicationTime " + + betweenSql); + rs = objectDao.executeSql(sql); + int totalEventCount = 0; + while (rs.next()) { + String eventName = rs.getString("eventName"); + int eventCount = rs.getInt("eventCount"); + totalEventCount += eventCount; + FirstColumnVo firstColumnVo = null; + List firstColumnDetaileds = null; + if(firstColumnVosMap.containsKey(eventName)){ + firstColumnVo = firstColumnVosMap.get(eventName); + firstColumnDetaileds = firstColumnVo.getFirstColumnDetaileds(); + }else{ + firstColumnVosMap.clear(); + firstColumnVo = new FirstColumnVo(); + firstColumnVo.setFirstColumnName(eventName); + firstColumnDetaileds = new ArrayList(); + firstColumnVo.setFirstColumnDetaileds(firstColumnDetaileds); + firstColumnVosMap.put(eventName, firstColumnVo); + firstColumnVos.add(firstColumnVo); + } + AdverseEventRecordReportVo adverseEventRecordReportVo = new AdverseEventRecordReportVo(); + adverseEventRecordReportVo.setEventCount(eventCount); + String timeoutHandType = rs.getString("timeoutHandType"); + adverseEventRecordReportVo.setTimeoutHandType(timeoutHandType); + String rate = "0.0%"; + if(eventCount > 0 && invoicePlanCount > 0){ + rate = MathTools.divideStr(eventCount, invoicePlanCount, 2); + } + adverseEventRecordReportVo.setIncidenceRate(rate); + firstColumnDetaileds.add(adverseEventRecordReportVo); + } + if(totalEventCount > 0 && invoicePlanCount > 0){ + otherInfo.put("totalRate", MathTools.divideStr(totalEventCount, invoicePlanCount, 2)); + }else{ + otherInfo.put("totalRate", "0.0%"); + } + otherInfo.put("totalEventCount", totalEventCount); + } catch (SQLException e) { + e.printStackTrace(); + } finally { + DatabaseUtil.closeResultSetAndStatement(rs); + } + return firstColumnVos; + } + @Override + public List queryRecyclingTimeoutReportDataSql(String startDate, + String endDate, String eventCode) { + ResultSet rs = null; + List result = new ArrayList(); + try { + String betweenSql = String.format(" between %s and %s ", + dateQueryAdapter.dateAdapter(startDate), + dateQueryAdapter.dateAdapter(endDate)); + String sql = String.format("select a.eventName,count(*) eventCount,(select count(*) from " + + " %s ip where ip.recyclingStatus is not null and ip.applicationTime %s " + + " ) invoicePlanCount " + + " from %s a where a.eventTime %s " + + " and eventCode='%s' " + + " group by a.eventName order by a.eventName", + InvoicePlan.class.getSimpleName(), + betweenSql, + AdverseEventRecord.class.getSimpleName(), + betweenSql, + eventCode); + rs = objectDao.executeSql(sql); + while (rs.next()) { + AdverseEventRecordReportVo adverseEventRecordReportVo = new AdverseEventRecordReportVo(); + String eventName = rs.getString("eventName"); + int eventCount = rs.getInt("eventCount"); + int invoicePlanCount = rs.getInt("invoicePlanCount"); + + adverseEventRecordReportVo.setEventCount(eventCount); + String rate = "0.0%"; + if(eventCount > 0 && invoicePlanCount > 0){ + rate = MathTools.divideStr(eventCount, invoicePlanCount, 2); + } + adverseEventRecordReportVo.setEventName(eventName); + adverseEventRecordReportVo.setIncidenceRate(rate); + result.add(adverseEventRecordReportVo); + } + } catch (SQLException e) { + e.printStackTrace(); + } finally { + DatabaseUtil.closeResultSetAndStatement(rs); + } + return result; + } } Index: ssts-basedata/src/main/java/com/forgon/disinfectsystem/entity/adverseeventrecord/AdverseEventRecord.java =================================================================== diff -u --- ssts-basedata/src/main/java/com/forgon/disinfectsystem/entity/adverseeventrecord/AdverseEventRecord.java (revision 0) +++ ssts-basedata/src/main/java/com/forgon/disinfectsystem/entity/adverseeventrecord/AdverseEventRecord.java (revision 32914) @@ -0,0 +1,110 @@ +package com.forgon.disinfectsystem.entity.adverseeventrecord; + +import java.util.Date; +import java.util.Map; + +import javax.persistence.Entity; +import javax.persistence.FetchType; +import javax.persistence.GeneratedValue; +import javax.persistence.GenerationType; +import javax.persistence.Id; +import javax.persistence.JoinColumn; +import javax.persistence.ManyToOne; + +import org.hibernate.annotations.Cache; +import org.hibernate.annotations.CacheConcurrencyStrategy; +import org.hibernate.annotations.Cascade; +import org.hibernate.annotations.CascadeType; +import org.hibernate.annotations.DynamicInsert; +import org.hibernate.annotations.DynamicUpdate; + +import com.forgon.disinfectsystem.entity.invoicemanager.InvoicePlan; + +@Entity +@DynamicInsert(false) +@DynamicUpdate(true) +@Cache(usage=CacheConcurrencyStrategy.NONSTRICT_READ_WRITE) +public class AdverseEventRecord { + private Long id; + /** + * 物品回收超时代码 + */ + public static String EVENTNAME_RECYCLINGTIMEOUTCODE = "2"; + /** + * 外来器械包送达超时代码 + */ + public static String EVENTNAME_FOREIGNTOUSSESENDTIMEOUTCODE = "1"; + /** + * 事件代码 + */ + private String eventCode; + public static String EVENTNAME_RECYCLINGTIMEOUT = "物品回收超时"; + public static String EVENTNAME_FOREIGNTOUSSESENDTIMEOUT = "外来器械包送达超时"; + /** + * 事件名称 + */ + private String eventName; + /** + * 事件发生时间 + */ + private Date eventTime; + /** + * 申请单 + */ + private InvoicePlan invoicePlan; + /** + * 备注 + */ + private String remark; + /** + * 超时处理方式 + */ + private String timeoutHandType; + @Id + @GeneratedValue(strategy = GenerationType.AUTO) + public Long getId() { + return id; + } + public void setId(Long id) { + this.id = id; + } + public String getEventCode() { + return eventCode; + } + public void setEventCode(String eventCode) { + this.eventCode = eventCode; + } + public String getEventName() { + return eventName; + } + public void setEventName(String eventName) { + this.eventName = eventName; + } + public Date getEventTime() { + return eventTime; + } + public void setEventTime(Date eventTime) { + this.eventTime = eventTime; + } + @ManyToOne(fetch = FetchType.EAGER) + @Cascade(value = { CascadeType.SAVE_UPDATE }) + @JoinColumn(name = "recyclingApplication_ID") + public InvoicePlan getInvoicePlan() { + return invoicePlan; + } + public void setInvoicePlan(InvoicePlan invoicePlan) { + this.invoicePlan = invoicePlan; + } + public String getRemark() { + return remark; + } + public void setRemark(String remark) { + this.remark = remark; + } + public String getTimeoutHandType() { + return timeoutHandType; + } + public void setTimeoutHandType(String timeoutHandType) { + this.timeoutHandType = timeoutHandType; + } +} Index: ssts-web/src/main/webapp/jasperRtp/foreignToussesEndTimeoutReport_child.jrxml =================================================================== diff -u --- ssts-web/src/main/webapp/jasperRtp/foreignToussesEndTimeoutReport_child.jrxml (revision 0) +++ ssts-web/src/main/webapp/jasperRtp/foreignToussesEndTimeoutReport_child.jrxml (revision 32914) @@ -0,0 +1,64 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +