Index: ssts-basedata/src/main/java/com/forgon/disinfectsystem/entity/invoicemanager/InvoicePlan.java =================================================================== diff -u -r34118 -r34769 --- ssts-basedata/src/main/java/com/forgon/disinfectsystem/entity/invoicemanager/InvoicePlan.java (.../InvoicePlan.java) (revision 34118) +++ ssts-basedata/src/main/java/com/forgon/disinfectsystem/entity/invoicemanager/InvoicePlan.java (.../InvoicePlan.java) (revision 34769) @@ -197,7 +197,10 @@ public final static String RETURN_STATUS_RETURNED = "已归还"; public final static String RETURN_STATUS_AWAITCONFIRM = "归还待确认"; - + /** + * 外来器械申请单专用状态,待二次回收 HBTSGRYY-11 + */ + public static final String RECYCLINGSTATUS_AWAIT_SECOND_RECEIVE = "待二次回收"; public static final String RECYCLINGSTATUS_AWAITRECYCLE = "待回收"; public static final String RECYCLINGSTATUS_RECYCLED = "已回收"; public static final String RECYCLINGSTATUS_SECRECYCLED = "二次回收"; @@ -1465,7 +1468,7 @@ public boolean isSecondRecycleForForeignTousse(){ boolean isSencondRecycle = false; if(this.isForeignTousseAppliaction()){ - if(InvoicePlan.RECYCLINGSTATUS_AWAITRECYCLE.equals(recyclingStatus)){ + if(InvoicePlan.RECYCLINGSTATUS_AWAITRECYCLE.equals(recyclingStatus) || InvoicePlan.RECYCLINGSTATUS_PARTRECYCLE.equals(recyclingStatus)){ isSencondRecycle = true; } } Index: ssts-recyclingapplication/src/main/java/com/forgon/disinfectsystem/recyclingapplication/service/InvoicePlanManagerImpl.java =================================================================== diff -u -r34553 -r34769 --- ssts-recyclingapplication/src/main/java/com/forgon/disinfectsystem/recyclingapplication/service/InvoicePlanManagerImpl.java (.../InvoicePlanManagerImpl.java) (revision 34553) +++ ssts-recyclingapplication/src/main/java/com/forgon/disinfectsystem/recyclingapplication/service/InvoicePlanManagerImpl.java (.../InvoicePlanManagerImpl.java) (revision 34769) @@ -3774,7 +3774,7 @@ if(StringUtils.isNotBlank(applicationType)){ if(FOREIGNTOUSSE_APP_AWAITRECEIVE.equals(applicationType)){ whereSql += " and po.type = '" + InvoicePlan.TYPE_FOREIGNTOUSSEAPPLIACTION + "'"; - whereSql += " and po.recyclingStatus in( '" + InvoicePlan.RECYCLINGSTATUS_AWAITRECEIVE + "','"+ InvoicePlan.RECYCLINGSTATUS_PARTAWAITRECEIVE +"')"; + whereSql += " and po.recyclingStatus in('"+ InvoicePlan.RECYCLINGSTATUS_PARTRECYCLE +"','" + InvoicePlan.RECYCLINGSTATUS_AWAITRECEIVE + "','"+ InvoicePlan.RECYCLINGSTATUS_PARTAWAITRECEIVE +"')"; }else if(FOREIGNTOUSSE_APP_AWAITRECYCLE.equals(applicationType)){ whereSql += " and po.type = '" + InvoicePlan.TYPE_FOREIGNTOUSSEAPPLIACTION + "'"; whereSql += " and po.recyclingStatus = '" + InvoicePlan.RECYCLINGSTATUS_AWAITRECYCLE + "'"; @@ -4928,7 +4928,7 @@ if(recyclingAllowsSaveOfNonBasketDisinfectionTousse && enablePartRecycle && !CollectionUtils.matchesAll(needRecycleTousseItemsExcludeTerminated, recycledPredOfAmount)){ recyclingStatus = InvoicePlan.RECYCLINGSTATUS_PARTRECYCLE; - if(invoicePlan.isForeignTousseAppliaction()){ + if(invoicePlan.isForeignTousseAppliaction() && !InvoicePlan.DELIVERSTATUS_AWAITDELIVER.equals(invoicePlan.getDeliverStatus())){ //外来器械包申请单回收状态为"部分接收" recyclingStatus = InvoicePlan.RECYCLINGSTATUS_PARTAWAITRECEIVE; } @@ -4942,7 +4942,7 @@ } else { // 其他情况为部分回收 recyclingStatus = InvoicePlan.RECYCLINGSTATUS_PARTRECYCLE; - if(invoicePlan.isForeignTousseAppliaction()){ + if(invoicePlan.isForeignTousseAppliaction() && !InvoicePlan.DELIVERSTATUS_AWAITDELIVER.equals(invoicePlan.getDeliverStatus())){ //外来器械包申请单回收状态为"部分接收" recyclingStatus = InvoicePlan.RECYCLINGSTATUS_PARTAWAITRECEIVE; } Index: ssts-recyclingrecord/src/main/java/com/forgon/disinfectsystem/recyclingrecord/service/RecyclingRecordManagerImpl.java =================================================================== diff -u -r34629 -r34769 --- ssts-recyclingrecord/src/main/java/com/forgon/disinfectsystem/recyclingrecord/service/RecyclingRecordManagerImpl.java (.../RecyclingRecordManagerImpl.java) (revision 34629) +++ ssts-recyclingrecord/src/main/java/com/forgon/disinfectsystem/recyclingrecord/service/RecyclingRecordManagerImpl.java (.../RecyclingRecordManagerImpl.java) (revision 34769) @@ -4309,6 +4309,15 @@ if(!(application.isSecondRecycleForForeignTousse() && application.isForeignTousseAppliaction())){ appItem.setRecyclingAmount(currentAmount); } + if(application.isForeignTousseAppliaction()){ + if(application.isSecondRecycleForForeignTousse()){ + if(InvoicePlan.RECYCLINGSTATUS_AWAIT_SECOND_RECEIVE.equals(appItem.getPackageStatus())){ + appItem.setPackageStatus(ForeignTousseApplication.APPLICATION_STATUS_TOBERETURNED); + } + }else if(InvoicePlan.RECYCLINGSTATUS_AWAITRECEIVE.equals(InvoicePlan.RECYCLINGSTATUS_AWAITRECEIVED)){ + appItem.setPackageStatus(InvoicePlan.RECYCLINGSTATUS_AWAITRECEIVED); + } + } if(SupplyRoomConfig.INVOICE_ORIGIN_RECYCLING.equals(invoiceOrigin)){ TousseDefinition td = getTousseDefinition(tousseDefinitions,appItem.getTousseDefinitionId()); //不装配不追溯物品 @@ -5093,8 +5102,9 @@ if(application instanceof ForeignTousseApplication){ ForeignTousseApplication ftApplication = (ForeignTousseApplication)application; String oldRecyclingStatus = ftApplication.getRecyclingStatus(); + boolean twoRecyclingtimes = InvoicePlan.RECYCLINGSTATUS_PARTRECYCLE.equals(oldRecyclingStatus) || InvoicePlan.RECYCLINGSTATUS_AWAITRECYCLE.equals(oldRecyclingStatus)?true:false; //外来器械接收器械包时回收记录不关联申请单 - if(InvoicePlan.RECYCLINGSTATUS_AWAITRECEIVE.equals(oldRecyclingStatus) || InvoicePlan.RECYCLINGSTATUS_PARTAWAITRECEIVE.equals(oldRecyclingStatus)){ + if(twoRecyclingtimes || InvoicePlan.RECYCLINGSTATUS_AWAITRECEIVE.equals(oldRecyclingStatus) || InvoicePlan.RECYCLINGSTATUS_PARTAWAITRECEIVE.equals(oldRecyclingStatus)){ Predicate terminatePred1 = new Predicate() { @Override public boolean evaluate(TousseItem vo) { @@ -5152,33 +5162,57 @@ } else if (CollectionUtils.matchesAll(needRecycleTousseItemsExcludeTerminated, PredicateUtils.notPredicate(recycledPred))){ // 所有应回收的物品,都未回收 - recyclingStatus = InvoicePlan.RECYCLINGSTATUS_AWAITRECEIVE; - + if(twoRecyclingtimes){ + recyclingStatus = InvoicePlan.RECYCLINGSTATUS_AWAITRECYCLE; + }else{ + recyclingStatus = InvoicePlan.RECYCLINGSTATUS_AWAITRECEIVE; + } } else if (CollectionUtils.matchesAll(needRecycleTousseItemsExcludeTerminated, recycledPred)){ //回收时允许保存未入筐的消毒包(必须开启了部分回收功能enablePartRecycle:true) boolean recyclingAllowsSaveOfNonBasketDisinfectionTousse = CssdUtils.getSystemSetConfigByNameBool("recyclingAllowsSaveOfNonBasketDisinfectionTousse", false); boolean enablePartRecycle = CssdUtils.getSystemSetConfigByNameBool("enablePartRecycle", false); + recyclingAllowsSaveOfNonBasketDisinfectionTousse = true; Predicate recycledPredOfAmount = new Predicate() { @Override public boolean evaluate(TousseItem vo) { - return (vo.getRecyclingAmount() != 0); + if(twoRecyclingtimes){ + return (ForeignTousseApplication.APPLICATION_STATUS_TOBERETURNED.equals(vo.getPackageStatus())); + }else{ + return (vo.getRecyclingAmount() != 0); + } + } }; //所有应回收的物品,都已回收(如果开启了回收时允许保存未入筐的消毒包和部分回收功能,回收数量都不为0,状态才算已回收,否则就是部分回收) if(recyclingAllowsSaveOfNonBasketDisinfectionTousse && enablePartRecycle && !CollectionUtils.matchesAll(needRecycleTousseItemsExcludeTerminated, recycledPredOfAmount)){ - recyclingStatus = InvoicePlan.RECYCLINGSTATUS_PARTAWAITRECEIVE; + if(twoRecyclingtimes){ + recyclingStatus = InvoicePlan.RECYCLINGSTATUS_PARTRECYCLE; + }else{ + recyclingStatus = InvoicePlan.RECYCLINGSTATUS_PARTAWAITRECEIVE; + } }else{ - recyclingStatus = InvoicePlan.RECYCLINGSTATUS_AWAITRECEIVED; + if(twoRecyclingtimes){ + recyclingStatus = InvoicePlan.RECYCLINGSTATUS_SECRECYCLED; + }else{ + recyclingStatus = InvoicePlan.RECYCLINGSTATUS_AWAITRECEIVED; + } } } else { // 其他情况为部分接收 - recyclingStatus = InvoicePlan.RECYCLINGSTATUS_PARTAWAITRECEIVE; + if(twoRecyclingtimes){ + recyclingStatus = InvoicePlan.RECYCLINGSTATUS_PARTRECYCLE; + }else{ + recyclingStatus = InvoicePlan.RECYCLINGSTATUS_PARTAWAITRECEIVE; + } } - ftApplication.setRecyclingStatus(recyclingStatus); + if(!DatabaseUtil.isPoIdValid(recyclingContext.getId()) && twoRecyclingtimes){ + record.setRecyclingTimes(RecyclingRecord.RECYCLINGTIMES_TWO); + } ftApplication.setReceiveMan(AcegiHelper.getLoginUserFullName()); ftApplication.setReceiveTime(new Date()); ftApplication.setPackageStatus(recyclingStatus); + ftApplication.setRecyclingStatus(recyclingStatus); ftApplication.setOrderByFiled(InvoicePlan.DELIVER_DELIVERED); // record.setRecyclingApplication(null); }else if(InvoicePlan.RECYCLINGSTATUS_AWAITRECYCLE.equals(oldRecyclingStatus)){