Index: ssts-recyclingapplication/src/main/java/com/forgon/disinfectsystem/adverseeventrecord/service/AdverseEventRecordManager.java =================================================================== diff -u -r32918 -r32965 --- ssts-recyclingapplication/src/main/java/com/forgon/disinfectsystem/adverseeventrecord/service/AdverseEventRecordManager.java (.../AdverseEventRecordManager.java) (revision 32918) +++ ssts-recyclingapplication/src/main/java/com/forgon/disinfectsystem/adverseeventrecord/service/AdverseEventRecordManager.java (.../AdverseEventRecordManager.java) (revision 32965) @@ -30,4 +30,10 @@ */ public void saveAdverseEventRecord(InvoicePlan invoicePlan, String eventCode, String eventName, String timeoutHandType); + /** + * 删除申请单的不良事件 + * @param InvoicePlan 不良事件关联的申请单 + */ + public void deleteInvoicePlanAdverseEventRecord(InvoicePlan InvoicePlan); + } Index: ssts-recyclingapplication/src/main/java/com/forgon/disinfectsystem/foreigntousseapplication/service/ForeignTousseApplicationManager.java =================================================================== diff -u -r32957 -r32965 --- ssts-recyclingapplication/src/main/java/com/forgon/disinfectsystem/foreigntousseapplication/service/ForeignTousseApplicationManager.java (.../ForeignTousseApplicationManager.java) (revision 32957) +++ ssts-recyclingapplication/src/main/java/com/forgon/disinfectsystem/foreigntousseapplication/service/ForeignTousseApplicationManager.java (.../ForeignTousseApplicationManager.java) (revision 32965) @@ -122,5 +122,10 @@ * @return */ public JSONArray queryForeignTousseSpecificationStore(); + + /** + * 删除外来器械包申请单 + */ + public boolean delete(ForeignTousseApplication foreignTousseApplication); } Index: ssts-recyclingapplication/src/main/java/com/forgon/disinfectsystem/adverseeventrecord/service/AdverseEventRecordManagerImpl.java =================================================================== diff -u -r32918 -r32965 --- ssts-recyclingapplication/src/main/java/com/forgon/disinfectsystem/adverseeventrecord/service/AdverseEventRecordManagerImpl.java (.../AdverseEventRecordManagerImpl.java) (revision 32918) +++ ssts-recyclingapplication/src/main/java/com/forgon/disinfectsystem/adverseeventrecord/service/AdverseEventRecordManagerImpl.java (.../AdverseEventRecordManagerImpl.java) (revision 32965) @@ -67,8 +67,13 @@ List voList = new ArrayList(); if(CollectionUtils.isNotEmpty(adverseEventRecordList)){ for (AdverseEventRecord adverseEventRecord : adverseEventRecordList) { + InvoicePlan invoicePlan = adverseEventRecord.getInvoicePlan(); AdverseEventRecordVO vo = new AdverseEventRecordVO(); - vo.setInvoicePlanSerialNumber(adverseEventRecord.getInvoicePlan().getSerialNumber()); + if(invoicePlan != null){ + vo.setInvoicePlanSerialNumber(invoicePlan.getSerialNumber()); + vo.setDepart(invoicePlan.getDepart()); + vo.setDepartCoding(invoicePlan.getDepartCoding()); + } try { BeanUtils.copyProperties(vo, adverseEventRecord); } catch (Exception e) { @@ -94,4 +99,26 @@ } } + /** + * 删除申请单的不良事件 + * @param foreignTousseApplication + */ + @Override + public void deleteInvoicePlanAdverseEventRecord(InvoicePlan invoicePlan) { + if(invoicePlan == null){ + return; + } + String hql = String.format("select po from %s po where po.invoicePlan.id = %s", + AdverseEventRecord.class.getSimpleName(), + invoicePlan.getId()); + List adverseEventRecordList = objectDao.findByHql(hql); + if(CollectionUtils.isEmpty(adverseEventRecordList)){ + return; + } + for (AdverseEventRecord adverseEventRecord : adverseEventRecordList) { + adverseEventRecord.setInvoicePlan(null); + } + objectDao.deleteAll(adverseEventRecordList); + } + } Index: ssts-recyclingapplication/src/main/java/com/forgon/disinfectsystem/foreigntousseapplication/service/ForeignTousseApplicationManagerImpl.java =================================================================== diff -u -r32958 -r32965 --- ssts-recyclingapplication/src/main/java/com/forgon/disinfectsystem/foreigntousseapplication/service/ForeignTousseApplicationManagerImpl.java (.../ForeignTousseApplicationManagerImpl.java) (revision 32958) +++ ssts-recyclingapplication/src/main/java/com/forgon/disinfectsystem/foreigntousseapplication/service/ForeignTousseApplicationManagerImpl.java (.../ForeignTousseApplicationManagerImpl.java) (revision 32965) @@ -2285,4 +2285,15 @@ adverseEventRecordManager.saveAdverseEventRecord(foreignTousseApplication, AdverseEventRecord.EVENTNAME_FOREIGNTOUSSESENDTIMEOUTCODE, AdverseEventRecord.EVENTNAME_FOREIGNTOUSSESENDTIMEOUT, timeoutHandType); } } + + @Override + public boolean delete(ForeignTousseApplication foreignTousseApplication){ + try { + adverseEventRecordManager.deleteInvoicePlanAdverseEventRecord(foreignTousseApplication); + objectDao.delete(foreignTousseApplication); + } catch (Exception e) { + throw new SystemException(e.getMessage()); + } + return true; + } } Index: ssts-basedata/src/main/java/com/forgon/disinfectsystem/vo/AdverseEventRecordVO.java =================================================================== diff -u -r32918 -r32965 --- ssts-basedata/src/main/java/com/forgon/disinfectsystem/vo/AdverseEventRecordVO.java (.../AdverseEventRecordVO.java) (revision 32918) +++ ssts-basedata/src/main/java/com/forgon/disinfectsystem/vo/AdverseEventRecordVO.java (.../AdverseEventRecordVO.java) (revision 32965) @@ -25,6 +25,14 @@ */ private String invoicePlanSerialNumber; /** + * 申请科室部门编码 + */ + private String departCoding; + /** + * 申请科室 + */ + private String depart; + /** * 备注 */ private String remark; @@ -73,6 +81,22 @@ this.invoicePlanSerialNumber = invoicePlanSerialNumber; } + public String getDepartCoding() { + return departCoding; + } + + public void setDepartCoding(String departCoding) { + this.departCoding = departCoding; + } + + public String getDepart() { + return depart; + } + + public void setDepart(String depart) { + this.depart = depart; + } + public String getRemark() { return remark; }