Index: ssts-recyclingapplication/src/main/java/com/forgon/disinfectsystem/recyclingapplication/service/RecyclingApplicationManagerImpl.java =================================================================== diff -u -r33925 -r33959 --- ssts-recyclingapplication/src/main/java/com/forgon/disinfectsystem/recyclingapplication/service/RecyclingApplicationManagerImpl.java (.../RecyclingApplicationManagerImpl.java) (revision 33925) +++ ssts-recyclingapplication/src/main/java/com/forgon/disinfectsystem/recyclingapplication/service/RecyclingApplicationManagerImpl.java (.../RecyclingApplicationManagerImpl.java) (revision 33959) @@ -1065,6 +1065,10 @@ RecyclingApplication recyclingApplication,Boolean isCommit) { String useRecordSql = ""; if(recyclingApplication.getUseRecord() != null){ + //若使用记录中含有特殊感染类型,则该使用记录只允许单独转换为一张新的申请单,不允许和其他的使用记录合并转换为一张申请单;DGSETYY-43 + if(StringUtils.isNotBlank(recyclingApplication.getUseRecord().getSpecialInfection())){ + return null; + } useRecordSql = " and po.useRecord.id = " + recyclingApplication.getUseRecord().getId(); // 使用记录转申请单时,useRecordConvertRecyclingApplicationMergeRegular没有配置按手术间合并使用记录或者按科室合并使用记录。 // 使用记录转换的申请单不进行合并,会生成一张新的申请单。 @@ -1121,6 +1125,8 @@ + recyclingApplication.getId() : "") + " and (po.isPrepareRecycled = " + RecyclingApplication.SIGNED_FALSE + " or po.isPrepareRecycled is null)" + useRecordSql + //若使用记录中含有特殊感染类型,则该使用记录只允许单独转换为一张新的申请单,不允许和其他的使用记录合并转换为一张申请单;DGSETYY-43 + + " and (po.specialInfection is null or po.specialInfection = '') " + " order by po.applicationTime desc"; RecyclingApplication recyclingApplicationInDb = null; //然后比较原有待合并的单与新提交的单物品是否符合合并的条件(主要是消毒物品),后期再考虑具体的实例,目前已改为申请的物品如果含有消毒物品则都不合并 @since 2018-11-16 shuyongfu @@ -1697,7 +1703,10 @@ recyclingApplication.setApplicationItems(applicationItems); //设置申请单的使用记录 - recyclingApplication.setUseRecord((UseRecord)objectDao.getByProperty(UseRecord.class.getSimpleName(), "id", useRecordId)); + UseRecord useRecord = (UseRecord)objectDao.getByProperty(UseRecord.class.getSimpleName(), "id", useRecordId); + recyclingApplication.setUseRecord(useRecord); + //申请单记录使用记录的特殊感染类型DGSETYY-43 + recyclingApplication.setSpecialInfection(useRecord.getSpecialInfection()); boolean needInvoice = isUseRecord2ApplicationNeedInvoice(recyclingApplication); if(needInvoice){ @@ -6629,7 +6638,10 @@ .setType(StringUtils.isNotBlank(invoicePlanType) ? invoicePlanType : RecyclingApplication.TYPE_COMBO_FORM); if(useRecordId != null){ //设置申请单的使用记录 - recyclingApplication.setUseRecord((UseRecord)objectDao.getByProperty(UseRecord.class.getSimpleName(), "id", useRecordId)); + UseRecord useRecord = (UseRecord)objectDao.getByProperty(UseRecord.class.getSimpleName(), "id", useRecordId); + recyclingApplication.setUseRecord(useRecord); + //DGSETYY-43申请单记录特殊感染类型 + recyclingApplication.setSpecialInfection(useRecord.getSpecialInfection()); } recyclingApplication.setApplicant(applicant); recyclingApplication.setDepart(depart); @@ -6930,6 +6942,8 @@ //设置申请单的使用记录(取第一个包实例的使用记录) recyclingApplication.setUseRecord(idToUseRecordMap.get(useRecordIdList.get(0))); + //申请单记录特殊感染类型DGSETYY-43 + recyclingApplication.setSpecialInfection(idToUseRecordMap.get(useRecordIdList.get(0)).getSpecialInfection()); recyclingApplication.setApplicationItems(tousseItems); // 保存并合并申请单 Index: forgon-tools/src/main/java/com/forgon/Constants.java =================================================================== diff -u -r33654 -r33959 --- forgon-tools/src/main/java/com/forgon/Constants.java (.../Constants.java) (revision 33654) +++ forgon-tools/src/main/java/com/forgon/Constants.java (.../Constants.java) (revision 33959) @@ -27,7 +27,7 @@ "4.9.25","4.9.26","4.9.27","4.9.28","4.9.29","4.9.30","4.9.31","4.9.32","4.9.33","4.9.34","4.9.35","4.9.36","4.9.37","4.9.38","4.9.39","4.9.40","4.9.41","4.9.42","4.9.43","4.9.44", "4.9.45","4.9.46","4.9.47","4.9.48","4.9.49","4.9.50","4.9.51","4.9.52","4.9.53","4.9.54","4.9.55","4.9.56","4.9.57","4.9.58","4.9.59","4.9.60","4.9.61","4.9.62", "4.9.63","4.9.64","4.9.65","4.9.66","4.9.67","4.9.68","4.9.69","4.9.70","4.9.71","4.9.72","4.9.73","4.9.74","4.9.75","4.9.76","4.9.77","4.9.78","4.9.79","4.9.80","4.9.81","4.9.82","4.9.83","4.9.84","4.9.85", - "4.9.86","4.9.87","4.9.88","4.9.89","4.9.90","4.9.91"}; + "4.9.86","4.9.87","4.9.88","4.9.89","4.9.90","4.9.91","4.9.92"}; // 版本列表(4.0版本升级4.1版需要分两步:先从4.0升到4.1.0、然后从4.1.0升级4.1最新版本) /*public final static String[] SOFTWARE_VERSION_ARRAY = new String[] { Index: ssts-userecord/src/main/java/com/forgon/disinfectsystem/useRecord/service/UseRecordManagerImpl.java =================================================================== diff -u -r33705 -r33959 --- ssts-userecord/src/main/java/com/forgon/disinfectsystem/useRecord/service/UseRecordManagerImpl.java (.../UseRecordManagerImpl.java) (revision 33705) +++ ssts-userecord/src/main/java/com/forgon/disinfectsystem/useRecord/service/UseRecordManagerImpl.java (.../UseRecordManagerImpl.java) (revision 33959) @@ -3779,16 +3779,24 @@ ? " and deliverStatus='" + InvoicePlan.DELIVERSTATUS_AWAITDELIVER + "' " : " and (deliverStatus is null or deliverStatus = '') "; + //特殊感染类型查询条件DGSETYY-43(若使用记录中含有特殊感染类型,则该使用记录只允许单独转换为一张新的申请单) + String specialInfectionCondition = " and (po.specialInfection is null or po.specialInfection = '' ) "; + //查询该科室的手术间与当前使用记录的手术单相同的申请单(且未终止、待回收、未发货、未做预回收),也是使用记录转换的申请单 - RecyclingApplication recyclingApplication = (RecyclingApplication)objectDao.getBySql_ForUpdate(RecyclingApplication.class.getSimpleName(), - "where 1=1 and useRecord is not null and departCoding='"+ departCoding + "' " - + "and (sterilizationMode is null or "+ SqlUtils.getStringFieldNotInCollectionsPredicate("sterilizationMode", lowTempSterilizationModesJSONArray) +")" - + operationRoomSql - + "and type in ('"+ InvoicePlan.TYPE_TOUSSE_APPLICATION_FORM +"') " - + "and (endStatus is null) " + deliverStatusCondition - + "and (recyclingStatus='" + InvoicePlan.RECYCLINGSTATUS_AWAITRECYCLE + "' or recyclingStatus is null) " - + "and (po.id not in (select invoicePlan.id from "+ TousseItem.class.getSimpleName() +" where prepareRecycleAmount is not null)) " - + " order by po.id desc"); + //DGSETYY-43(若使用记录中含有特殊感染类型,则该使用记录只允许单独转换为一张新的申请单) + RecyclingApplication recyclingApplication = null; + if(StringUtils.isBlank(useRecordList.get(0).getSpecialInfection())){ + recyclingApplication = (RecyclingApplication)objectDao.getBySql_ForUpdate(RecyclingApplication.class.getSimpleName(), + "where 1=1 and useRecord is not null and departCoding='"+ departCoding + "' " + + "and (sterilizationMode is null or "+ SqlUtils.getStringFieldNotInCollectionsPredicate("sterilizationMode", lowTempSterilizationModesJSONArray) +")" + + operationRoomSql + + "and type in ('"+ InvoicePlan.TYPE_TOUSSE_APPLICATION_FORM +"') " + + "and (endStatus is null) " + deliverStatusCondition + + "and (recyclingStatus='" + InvoicePlan.RECYCLINGSTATUS_AWAITRECYCLE + "' or recyclingStatus is null) " + + "and (po.id not in (select invoicePlan.id from "+ TousseItem.class.getSimpleName() +" where prepareRecycleAmount is not null)) " + + specialInfectionCondition + + " order by po.id desc"); + } //会否合并转换申请单(如果找到符合条件的待合并申请,且合并后的备注与条码长度不超4000就会合并) boolean willMergeConvertApplication = false; if(recyclingApplication != null){ @@ -3920,15 +3928,23 @@ ? " and deliverStatus='" + InvoicePlan.DELIVERSTATUS_AWAITDELIVER + "' " : " and (deliverStatus is null or deliverStatus = '') "; + //若使用记录中含有特殊感染类型,则该使用记录只允许单独转换为一张新的申请单,不允许和其他的使用记录合并转换为一张申请单DGSETYY-43 + String specialInfectionCondition = " and (po.specialInfection is null or po.specialInfection = '' ) "; + //查询该科室的手术间与当前使用记录的手术单相同的申请单(且未终止、待回收、未发货、未做预回收),也是使用记录转换的申请单 - RecyclingApplication recyclingApplication = (RecyclingApplication)objectDao.getBySql(RecyclingApplication.class.getSimpleName(), - "where 1=1 and useRecord is not null and departCoding='"+ departCoding + "'" - + "and (sterilizationMode is null or "+ SqlUtils.getStringFieldNotInCollectionsPredicate("sterilizationMode", lowTempSterilizationModesJSONArray) +")" - + "and type in ('"+ InvoicePlan.TYPE_TOUSSE_APPLICATION_FORM +"') " - + "and (endStatus is null) " + deliverStatusCondition - + "and (recyclingStatus='" + InvoicePlan.RECYCLINGSTATUS_AWAITRECYCLE + "' or recyclingStatus is null) " - + "and (po.id not in (select invoicePlan.id from "+ TousseItem.class.getSimpleName() +" where prepareRecycleAmount is not null)) " - + "order by po.id desc"); + //DGSETYY-43(若使用记录中含有特殊感染类型,则该使用记录只允许单独转换为一张新的申请单) + RecyclingApplication recyclingApplication = null; + if(StringUtils.isBlank(useRecordList.get(0).getSpecialInfection())){ + recyclingApplication = (RecyclingApplication)objectDao.getBySql(RecyclingApplication.class.getSimpleName(), + "where 1=1 and useRecord is not null and departCoding='"+ departCoding + "'" + + "and (sterilizationMode is null or "+ SqlUtils.getStringFieldNotInCollectionsPredicate("sterilizationMode", lowTempSterilizationModesJSONArray) +")" + + "and type in ('"+ InvoicePlan.TYPE_TOUSSE_APPLICATION_FORM +"') " + + "and (endStatus is null) " + deliverStatusCondition + + "and (recyclingStatus='" + InvoicePlan.RECYCLINGSTATUS_AWAITRECYCLE + "' or recyclingStatus is null) " + + "and (po.id not in (select invoicePlan.id from "+ TousseItem.class.getSimpleName() +" where prepareRecycleAmount is not null)) " + + specialInfectionCondition + + "order by po.id desc"); + } //会否合并转换申请单(如果找到符合条件的待合并申请,且合并后的备注与条码长度不超4000就会合并) boolean willMergeConvertApplication = false; if(recyclingApplication != null){ @@ -4133,15 +4149,23 @@ ? " and deliverStatus='" + InvoicePlan.DELIVERSTATUS_AWAITDELIVER + "' " : " and (deliverStatus is null or deliverStatus = '') "; + //DGSETYY-43(若使用记录中含有特殊感染类型,则该使用记录只允许单独转换为一张新的申请单) + String specialInfectionCondition = " and (po.specialInfection is null or po.specialInfection = '' ) "; + //查询该科室的手术间与当前使用记录的手术单相同的申请单(且未终止、待回收、未发货、未做预回收),也是使用记录转换的申请单 - RecyclingApplication recyclingApplication = (RecyclingApplication)objectDao.getBySql(RecyclingApplication.class.getSimpleName(), - "where 1=1 and useRecord is not null and departCoding='"+ departCoding + "'" - + operationRoomSql - + "and type in ('"+ InvoicePlan.TYPE_COMBO_FORM +"') " - + "and (endStatus is null) " + deliverStatusCondition - + "and (recyclingStatus='" + InvoicePlan.RECYCLINGSTATUS_AWAITRECYCLE + "' or recyclingStatus is null) " - + "and (po.id not in (select invoicePlan.id from "+ TousseItem.class.getSimpleName() +" where prepareRecycleAmount is not null)) " - + "order by po.id desc"); + //DGSETYY-43(若使用记录中含有特殊感染类型,则该使用记录只允许单独转换为一张新的申请单) + RecyclingApplication recyclingApplication = null; + if(StringUtils.isBlank(useRecordList.get(0).getSpecialInfection())){ + recyclingApplication = (RecyclingApplication)objectDao.getBySql(RecyclingApplication.class.getSimpleName(), + "where 1=1 and useRecord is not null and departCoding='"+ departCoding + "'" + + operationRoomSql + + "and type in ('"+ InvoicePlan.TYPE_COMBO_FORM +"') " + + "and (endStatus is null) " + deliverStatusCondition + + "and (recyclingStatus='" + InvoicePlan.RECYCLINGSTATUS_AWAITRECYCLE + "' or recyclingStatus is null) " + + "and (po.id not in (select invoicePlan.id from "+ TousseItem.class.getSimpleName() +" where prepareRecycleAmount is not null)) " + + specialInfectionCondition + + "order by po.id desc"); + } //会否合并转换申请单(如果找到符合条件的待合并申请,且合并后的备注与条码长度不超4000就会合并) boolean willMergeConvertApplication = false; if(recyclingApplication != null){ @@ -4271,14 +4295,23 @@ ? " and deliverStatus='" + InvoicePlan.DELIVERSTATUS_AWAITDELIVER + "' " : " and (deliverStatus is null or deliverStatus = '') "; - //查询该科室的手术间与当前使用记录的手术单相同的申请单(且未终止、待回收、未发货、未做预回收),也是使用记录转换的申请单 - RecyclingApplication recyclingApplication = (RecyclingApplication)objectDao.getBySql(RecyclingApplication.class.getSimpleName(), - "where 1=1 and useRecord is not null and departCoding='"+ departCoding + "'" - + "and type in ('"+ InvoicePlan.TYPE_COMBO_FORM +"') " - + "and (endStatus is null) " + deliverStatusCondition - + "and (recyclingStatus='" + InvoicePlan.RECYCLINGSTATUS_AWAITRECYCLE + "' or recyclingStatus is null) " - + "and (po.id not in (select invoicePlan.id from "+ TousseItem.class.getSimpleName() +" where prepareRecycleAmount is not null)) " - + "order by po.id desc"); + //DGSETYY-43(若使用记录中含有特殊感染类型,则该使用记录只允许单独转换为一张新的申请单) + String specialInfectionCondition = " and (po.specialInfection is null or po.specialInfection = '') "; + + //DGSETYY-43(若使用记录中含有特殊感染类型,则该使用记录只允许单独转换为一张新的申请单) + RecyclingApplication recyclingApplication = null; + if(StringUtils.isBlank(useRecordList.get(0).getSpecialInfection())){ + //查询该科室的手术间与当前使用记录的手术单相同的申请单(且未终止、待回收、未发货、未做预回收),也是使用记录转换的申请单 + recyclingApplication = (RecyclingApplication)objectDao.getBySql(RecyclingApplication.class.getSimpleName(), + "where 1=1 and useRecord is not null and departCoding='"+ departCoding + "'" + + "and type in ('"+ InvoicePlan.TYPE_COMBO_FORM +"') " + + "and (endStatus is null) " + deliverStatusCondition + + "and (recyclingStatus='" + InvoicePlan.RECYCLINGSTATUS_AWAITRECYCLE + "' or recyclingStatus is null) " + + "and (po.id not in (select invoicePlan.id from "+ TousseItem.class.getSimpleName() +" where prepareRecycleAmount is not null)) " + + specialInfectionCondition + + "order by po.id desc"); + } + //会否合并转换申请单(如果找到符合条件的待合并申请,且合并后的备注与条码长度不超4000就会合并) boolean willMergeConvertApplication = false; if(recyclingApplication != null){ @@ -4481,17 +4514,25 @@ ? " and deliverStatus='" + InvoicePlan.DELIVERSTATUS_AWAITDELIVER + "' " : " and (deliverStatus is null or deliverStatus = '')"; + //DGSETYY-43(若使用记录中含有特殊感染类型,则该使用记录只允许单独转换为一张新的申请单) + String specialInfectionCondition = " and (po.specialInfection is null or po.specialInfection = '') "; + String sql = "where 1=1 and useRecord is not null and departCoding='"+ departCoding + "'" + operationRoomSql + "and type in ('"+ InvoicePlan.TYPE_COMBO_FORM +"') " + "and (endStatus is null) " + deliverStatusCondition + "and (recyclingStatus='" + InvoicePlan.RECYCLINGSTATUS_AWAITRECYCLE + "' or recyclingStatus is null) " + "and (po.id not in (select invoicePlan.id from "+ TousseItem.class.getSimpleName() +" where prepareRecycleAmount is not null)) " + + specialInfectionCondition + "order by po.id desc"; - //查询该科室的手术间与当前使用记录的手术单相同的申请单(且未终止、待回收、未发货、未做预回收),也是使用记录转换的申请单 - RecyclingApplication recyclingApplication = (RecyclingApplication)objectDao.getBySql(RecyclingApplication.class.getSimpleName(), - sql); + //DGSETYY-43(若使用记录中含有特殊感染类型,则该使用记录只允许单独转换为一张新的申请单) + RecyclingApplication recyclingApplication = null; + if(StringUtils.isBlank(useRecordList.get(0).getSpecialInfection())){ + //查询该科室的手术间与当前使用记录的手术单相同的申请单(且未终止、待回收、未发货、未做预回收),也是使用记录转换的申请单 + recyclingApplication = (RecyclingApplication)objectDao.getBySql(RecyclingApplication.class.getSimpleName(), + sql); + } //会否合并转换申请单(如果找到符合条件的待合并申请,且合并后的备注与条码长度不超4000就会合并) boolean willMergeConvertApplication = false; if(recyclingApplication != null){ @@ -4621,14 +4662,21 @@ ? " and deliverStatus='" + InvoicePlan.DELIVERSTATUS_AWAITDELIVER + "' " : " and (deliverStatus is null or deliverStatus = '')"; - //查询该科室的手术间与当前使用记录的手术单相同的申请单(且未终止、待回收、未发货、未做预回收),也是使用记录转换的申请单 - RecyclingApplication recyclingApplication = (RecyclingApplication)objectDao.getBySql(RecyclingApplication.class.getSimpleName(), - "where 1=1 and useRecord is not null and departCoding='"+ departCoding + "'" - + "and type in ('"+ InvoicePlan.TYPE_COMBO_FORM +"') " - + "and (endStatus is null) " + deliverStatusCondition - + "and (recyclingStatus='" + InvoicePlan.RECYCLINGSTATUS_AWAITRECYCLE + "' or recyclingStatus is null) " - + "and (po.id not in (select invoicePlan.id from "+ TousseItem.class.getSimpleName() +" where prepareRecycleAmount is not null)) " - + "order by po.id desc"); + //DGSETYY-43(若使用记录中含有特殊感染类型,则该使用记录只允许单独转换为一张新的申请单) + String specialInfectionCondition = " and (po.specialInfection is null or po.specialInfection = '' ) "; + + RecyclingApplication recyclingApplication = null; + if(StringUtils.isBlank(useRecordList.get(0).getSpecialInfection())){ + //查询该科室的手术间与当前使用记录的手术单相同的申请单(且未终止、待回收、未发货、未做预回收),也是使用记录转换的申请单 + recyclingApplication = (RecyclingApplication)objectDao.getBySql(RecyclingApplication.class.getSimpleName(), + "where 1=1 and useRecord is not null and departCoding='"+ departCoding + "'" + + "and type in ('"+ InvoicePlan.TYPE_COMBO_FORM +"') " + + "and (endStatus is null) " + deliverStatusCondition + + "and (recyclingStatus='" + InvoicePlan.RECYCLINGSTATUS_AWAITRECYCLE + "' or recyclingStatus is null) " + + "and (po.id not in (select invoicePlan.id from "+ TousseItem.class.getSimpleName() +" where prepareRecycleAmount is not null)) " + + specialInfectionCondition + + "order by po.id desc"); + } //会否合并转换申请单(如果找到符合条件的待合并申请,且合并后的备注与条码长度不超4000就会合并) boolean willMergeConvertApplication = false; if(recyclingApplication != null){ @@ -4970,6 +5018,7 @@ recyclingApplication.setTousseBarcodes(tousseBarcodesOfUseRecord); recyclingApplication.setTreatmentNum(treatmentNums); recyclingApplication.setUseRecord(firstUseRecord); + recyclingApplication.setSpecialInfection(firstUseRecord.getSpecialInfection()); recyclingApplication.setPrinted(InvoicePlan.PRINT_STATUS_UNPRINT); recyclingApplicationManager.saveOrUpdate(recyclingApplication); @@ -5579,15 +5628,22 @@ ? " and deliverStatus='" + InvoicePlan.DELIVERSTATUS_AWAITDELIVER + "' " : " and (deliverStatus is null or deliverStatus = '') "; - //查询该科室的手术间与当前使用记录的手术单相同的申请单(且未终止、待回收、未发货、未做预回收),也是使用记录转换的申请单 - RecyclingApplication recyclingApplication = (RecyclingApplication)objectDao.getBySql(RecyclingApplication.class.getSimpleName(), - "where 1=1 and useRecord is not null and sterilizationMode='"+ sterilizationMode +"' and departCoding='"+ departCoding + "'" - + operationRoomSql - + "and type = '"+ invoicePlanTypeAfterTousseConvert +"' " - + "and (endStatus is null) " + deliverStatusCondition - + "and (recyclingStatus='" + InvoicePlan.RECYCLINGSTATUS_AWAITRECYCLE + "') " - + "and (po.id not in (select invoicePlan.id from "+ TousseItem.class.getSimpleName() +" where prepareRecycleAmount is not null)) " - + "order by po.id desc"); + //若使用记录中含有特殊感染类型,则该使用记录只允许单独转换为一张新的申请单,不允许和其他的使用记录合并转换为一张申请单;DGSETYY-43 + String specialInfectionCondition = " and (po.specialInfection is null or po.specialInfection = '') "; + + RecyclingApplication recyclingApplication = null; + if(StringUtils.isBlank(firstUseRecord.getSpecialInfection())){ + //查询该科室的手术间与当前使用记录的手术单相同的申请单(且未终止、待回收、未发货、未做预回收),也是使用记录转换的申请单 + recyclingApplication = (RecyclingApplication)objectDao.getBySql(RecyclingApplication.class.getSimpleName(), + "where 1=1 and useRecord is not null and sterilizationMode='"+ sterilizationMode +"' and departCoding='"+ departCoding + "'" + + operationRoomSql + + "and type = '"+ invoicePlanTypeAfterTousseConvert +"' " + + "and (endStatus is null) " + deliverStatusCondition + + "and (recyclingStatus='" + InvoicePlan.RECYCLINGSTATUS_AWAITRECYCLE + "') " + + "and (po.id not in (select invoicePlan.id from "+ TousseItem.class.getSimpleName() +" where prepareRecycleAmount is not null)) " + + specialInfectionCondition + + "order by po.id desc"); + } //会否合并转换申请单(如果找到符合条件的待合并申请,且合并后的备注与条码长度不超4000就会合并) boolean willMergeConvertApplication = false; if(recyclingApplication != null){ @@ -5690,14 +5746,22 @@ ? " and deliverStatus='" + InvoicePlan.DELIVERSTATUS_AWAITDELIVER + "' " : " and (deliverStatus is null or deliverStatus = '') "; - //查询该科室的手术间与当前使用记录的手术单相同的申请单(且未终止、待回收、未发货、未做预回收),也是使用记录转换的申请单 - RecyclingApplication recyclingApplication = (RecyclingApplication)objectDao.getBySql(RecyclingApplication.class.getSimpleName(), - "where 1=1 and useRecord is not null and sterilizationMode='"+ sterilizationMode +"' and departCoding='"+ departCoding + "'" - + "and type = '"+ invoicePlanTypeAfterTousseConvert +"' " - + "and (endStatus is null) " + deliverStatusCondition - + "and (recyclingStatus='" + InvoicePlan.RECYCLINGSTATUS_AWAITRECYCLE + "') " - + "and (po.id not in (select invoicePlan.id from "+ TousseItem.class.getSimpleName() +" where prepareRecycleAmount is not null)) " - + "order by po.id desc"); + //若使用记录中含有特殊感染类型,则该使用记录只允许单独转换为一张新的申请单,不允许和其他的使用记录合并转换为一张申请单;DGSETYY-43 + String specialInfectionCondition = " and (po.specialInfection is null or po.specialInfection = '') "; + + RecyclingApplication recyclingApplication = null; + if(StringUtils.isBlank(firstUseRecord.getSpecialInfection())){ + //查询该科室的手术间与当前使用记录的手术单相同的申请单(且未终止、待回收、未发货、未做预回收),也是使用记录转换的申请单 + recyclingApplication = (RecyclingApplication)objectDao.getBySql(RecyclingApplication.class.getSimpleName(), + "where 1=1 and useRecord is not null and sterilizationMode='"+ sterilizationMode +"' and departCoding='"+ departCoding + "'" + + "and type = '"+ invoicePlanTypeAfterTousseConvert +"' " + + "and (endStatus is null) " + deliverStatusCondition + + "and (recyclingStatus='" + InvoicePlan.RECYCLINGSTATUS_AWAITRECYCLE + "') " + + "and (po.id not in (select invoicePlan.id from "+ TousseItem.class.getSimpleName() +" where prepareRecycleAmount is not null)) " + + specialInfectionCondition + + "order by po.id desc"); + } + //会否合并转换申请单(如果找到符合条件的待合并申请,且合并后的备注与条码长度不超4000就会合并) boolean willMergeConvertApplication = false; if(recyclingApplication != null){ Index: ssts-web/src/main/webapp/dataUpdater/sqls/4.9.91_4.9.92.sql =================================================================== diff -u --- ssts-web/src/main/webapp/dataUpdater/sqls/4.9.91_4.9.92.sql (revision 0) +++ ssts-web/src/main/webapp/dataUpdater/sqls/4.9.91_4.9.92.sql (revision 33959) @@ -0,0 +1 @@ +update invoicePlan set specialInfection = (select specialInfection from UseRecord u join RecyclingApplication ra on u.id = ra.userecord_id where ra.id = invoicePlan.id) where specialInfection is null; \ No newline at end of file