Index: ssts-recyclingrecord/src/main/java/com/forgon/disinfectsystem/recyclingrecord/service/RecyclingRecordManagerImpl.java =================================================================== diff -u -r35525 -r35543 --- ssts-recyclingrecord/src/main/java/com/forgon/disinfectsystem/recyclingrecord/service/RecyclingRecordManagerImpl.java (.../RecyclingRecordManagerImpl.java) (revision 35525) +++ ssts-recyclingrecord/src/main/java/com/forgon/disinfectsystem/recyclingrecord/service/RecyclingRecordManagerImpl.java (.../RecyclingRecordManagerImpl.java) (revision 35543) @@ -9176,14 +9176,14 @@ if(!DatabaseUtil.isPoIdValid(invoicePlanId)){ return "参数异常invoicePlanId:"+invoicePlanId; } - if(!verifyPreRecycledByOtherApplication(invoicePlanId, verifyBarcode)){ - InvoicePlan ip = invoicePlanManager.get(invoicePlanId); - return StringUtils.isNotBlank(idCardInstanceBarcode)?idCardInstanceBarcode:verifyBarcode - + "【"+ td.getName() + InvoicePlan ip = verifyPreRecycledByOtherApplication(invoicePlanId, verifyBarcode); + if(ip != null){ + return StringUtils.isNotBlank(idCardInstanceBarcode)?idCardInstanceBarcode:verifyBarcode + + "【"+ td.getName() +"】已经被【" - + ip.getDepart() + + ip.getDepart() +"】的" - + ip.getSerialNumber() + + ip.getSerialNumber() +"申请单预回收,请打开对应的申请单进行回收!"; } return null; @@ -9192,20 +9192,17 @@ * 验证包实例条码是否被其他申请单预回收了 * @param invoicePlanId 申请单id * @param barcode 包实例条码 - * @return false 被预回收了 不通过验证 + * @return 返回被预回收的申请单 */ - private boolean verifyPreRecycledByOtherApplication(Long invoicePlanId, String barcode){ - String sql = "select count(*) from " - + TousseItem.class.getSimpleName() - +" ti join " - + PrepareRecyleScanBarcode.class.getSimpleName() - + " prb on prb.tousseItemId=ti.id " - + "where ti.recyclingApplication_ID<>" + private InvoicePlan verifyPreRecycledByOtherApplication(Long invoicePlanId, String barcode){ + String sql = " where po.id<>" + invoicePlanId - + " and prb.tousseInstanceBarcode='" + +" and po.applicationItems.id in (select tousseItemId from " + + PrepareRecyleScanBarcode.class.getSimpleName() + + " where tousseInstanceBarcode='" + barcode - +"'"; - return objectDao.countBySql(sql) > 0? false:true; + +"') "; + return (InvoicePlan)objectDao.getBySql(InvoicePlan.class.getSimpleName(),sql); } /** * 获取scanBarcodeToRecycleTousseDeliveredToDepartmentMustBeInUsedState配置项开启后的验证信息 KSDQDYRMYY-11