Index: ssts-tousse/src/main/java/com/forgon/disinfectsystem/tousse/toussedefinition/service/TousseInstanceManagerImpl.java =================================================================== diff -u -r36602 -r36621 --- ssts-tousse/src/main/java/com/forgon/disinfectsystem/tousse/toussedefinition/service/TousseInstanceManagerImpl.java (.../TousseInstanceManagerImpl.java) (revision 36602) +++ ssts-tousse/src/main/java/com/forgon/disinfectsystem/tousse/toussedefinition/service/TousseInstanceManagerImpl.java (.../TousseInstanceManagerImpl.java) (revision 36621) @@ -6142,38 +6142,49 @@ throw new RuntimeException("扫描条码为空"); } + BarcodeDevice barcodeDevice = barcodeManager.getBarcodeByBarcode(barcode); + if(barcodeDevice != null){ + // 发货单号集合码 + if(StringUtils.equals(barcodeDevice.getType(), BarcodeDevice.BARCODE_TYPE_INVOICESERIALNUMSETCODE)){ + return SignRecord.TYPE_INVOICE_SERIALNUM_SETCODE; + } + // 器械包集合码 + if(BarcodeDevice.BARCODE_TYPE_TOUSSEINSTANCESETCODE.equals(barcodeDevice.getType())){ + return BarcodeDevice.BARCODE_TYPE_TOUSSEINSTANCESETCODE; + } + if(BarcodeDevice.BARCODE_TYPE_PACKAGE.equals(barcodeDevice.getType()) + && barcodeDevice instanceof TousseInstance){ + TousseInstance tousseInstance = (TousseInstance) barcodeDevice; + if(tousseInstance.fixedBarcode()){ + //器械包定义固定条码 + return SignRecord.TYPE_TOUSSE_DEFINITION; + } + //包实例条码签收 + return SignRecord.TYPE_TOUSSE_INSTANCE; + } + } + //配置项,支持扫描哪种单号,默认为发货单. (1:申请单,2:发货单) int serialNumberSignType = CssdUtils.getSystemSetConfigByNameInt("serialNumberSignType", 2); - if(serialNumberSignType==1){//申请单 - InvoicePlan invoicePlan = (InvoicePlan)objectDao.getByProperty( - InvoicePlan.class.getSimpleName(), "serialNumber", barcode); - if(invoicePlan!=null){ - return SignRecord.TYPE_INVOICE_PLAN; + //申请单 + if(serialNumberSignType==1){ + String sql = String.format("select count(1) from %s where serialNumber ='%s'", InvoicePlan.class.getSimpleName(), barcode); + int count = objectDao.countBySql(sql); + if(count > 0){ + return SignRecord.TYPE_INVOICE_PLAN; } } - if(serialNumberSignType==2){//发货单 - Invoice invoice = (Invoice)objectDao.getByProperty( - Invoice.class.getSimpleName(), "serialNumber", barcode); - if(invoice!=null){ - return SignRecord.TYPE_INVOICE; + //发货单 + if(serialNumberSignType==2){ + String sql = String.format("select count(1) from %s where serialNumber ='%s'", Invoice.class.getSimpleName(), barcode); + int count = objectDao.countBySql(sql); + if(count > 0){ + return SignRecord.TYPE_INVOICE; } } - //器械包定义固定条码 - if(this.geyTousseDefinitionByTousseFixedBarcode(barcode) != null){ - return SignRecord.TYPE_TOUSSE_DEFINITION; - } - - // 发货单号集合码 - BarcodeDevice barcodeDevice = barcodeManager.getBarcodeByBarcode(barcode); - if(barcodeDevice != null && StringUtils.equals(barcodeDevice.getType(), BarcodeDevice.BARCODE_TYPE_INVOICESERIALNUMSETCODE)){ - return SignRecord.TYPE_INVOICE_SERIALNUM_SETCODE; - } - if(barcodeDevice != null && BarcodeDevice.BARCODE_TYPE_TOUSSEINSTANCESETCODE.equals(barcodeDevice.getType())){ - return BarcodeDevice.BARCODE_TYPE_TOUSSEINSTANCESETCODE; - } //如果以上都不是,则默认当做包实例条码 return SignRecord.TYPE_TOUSSE_INSTANCE; }