Index: ssts-web/src/main/webapp/disinfectsystem/basedatamanager/tousse/tousseForm.js =================================================================== diff -u -r16351 -r16431 --- ssts-web/src/main/webapp/disinfectsystem/basedatamanager/tousse/tousseForm.js (.../tousseForm.js) (revision 16351) +++ ssts-web/src/main/webapp/disinfectsystem/basedatamanager/tousse/tousseForm.js (.../tousseForm.js) (revision 16431) @@ -1158,6 +1158,28 @@ columnWidth : .25, layout : 'form', items:[{ + xtype : 'combo', + fieldLabel : '限制发货科室', + id : 'limitInvoiceDepart', + name : 'limitInvoiceDepart', + valueField : 'value', + displayField : 'value', + store : new Ext.data.SimpleStore( { + fields : [ 'value'], + data : [['是'],['否']] + }), + editable : false, + forceSelection : true, + allowBlank : false, + value : '否', + mode : 'local', + triggerAction : 'all', + anchor : '100%' + }] + },{ + columnWidth : .25, + layout : 'form', + items:[{ xtype : 'numberfield', fieldLabel : "打印份数", allowBlank : false, Index: ssts-basedata/src/main/java/com/forgon/disinfectsystem/entity/basedatamanager/toussedefinition/TousseDefinition.java =================================================================== diff -u -r16365 -r16431 --- ssts-basedata/src/main/java/com/forgon/disinfectsystem/entity/basedatamanager/toussedefinition/TousseDefinition.java (.../TousseDefinition.java) (revision 16365) +++ ssts-basedata/src/main/java/com/forgon/disinfectsystem/entity/basedatamanager/toussedefinition/TousseDefinition.java (.../TousseDefinition.java) (revision 16431) @@ -150,6 +150,8 @@ private String isPrintOnDirectPacking = STR_NO; // 自定义装配是否打印标签 + private String limitInvoiceDepart = STR_NO; + private String isPrintOrg = STR_NO; //是否打印科室(默认不打印,省医提出问题) private String isTraceable = STR_YES; //是否追溯 @@ -789,6 +791,14 @@ this.isPrintOnDirectPacking = isPrintOnDirectPacking; } + public String getLimitInvoiceDepart() { + return limitInvoiceDepart; + } + + public void setLimitInvoiceDepart(String limitInvoiceDepart) { + this.limitInvoiceDepart = limitInvoiceDepart; + } + public String getIsPrintOrg() { return isPrintOrg; } Index: forgon-core/src/main/java/com/forgon/Constants.java =================================================================== diff -u -r16416 -r16431 --- forgon-core/src/main/java/com/forgon/Constants.java (.../Constants.java) (revision 16416) +++ forgon-core/src/main/java/com/forgon/Constants.java (.../Constants.java) (revision 16431) @@ -19,7 +19,7 @@ "3.3.0","3.3.8", "3.3.9", "3.3.10","3.3.12","3.3.13","3.8.0","3.9.0","3.9.1","3.9.2","4.0.2","4.0.3","4.0.4", "4.0.5","4.0.6","4.0.44","4.0.45","4.1.0","4.1.1","4.1.2","4.1.3","4.1.4","4.1.5","4.1.6","4.1.7","4.1.8","4.1.9","4.2.0","4.2.1","4.2.2", "4.2.3","4.2.4","4.2.5","4.2.6","4.2.7","4.2.8","4.2.9","4.3.0","4.3.1","4.3.2","4.3.3","4.3.4","4.3.5","4.3.6","4.3.7","4.3.8","4.3.9", - "4.4.0","4.4.1","4.4.2","4.4.3","4.4.4","4.4.5","4.4.6","4.4.7","4.4.8","4.4.9","4.5.0","4.5.1","4.5.2","4.5.3","4.5.4","4.5.5"};// 版本列表 + "4.4.0","4.4.1","4.4.2","4.4.3","4.4.4","4.4.5","4.4.6","4.4.7","4.4.8","4.4.9","4.5.0","4.5.1","4.5.2","4.5.3","4.5.4","4.5.5","4.5.6"};// 版本列表 public final static List SOFTWARE_VERSION_LIST = Arrays .asList(SOFTWARE_VERSION_ARRAY); public final static String SOFTWARE_VERSION = SOFTWARE_VERSION_ARRAY[SOFTWARE_VERSION_ARRAY.length - 1];// 软件最新版本 Index: ssts-web/src/main/webapp/dataUpdater/sqls/4.5.5_4.5.6.sql =================================================================== diff -u --- ssts-web/src/main/webapp/dataUpdater/sqls/4.5.5_4.5.6.sql (revision 0) +++ ssts-web/src/main/webapp/dataUpdater/sqls/4.5.5_4.5.6.sql (revision 16431) @@ -0,0 +1 @@ +update TousseDefinition set limitInvoiceDepart='否' where limitInvoiceDepart is null; \ No newline at end of file Index: ssts-invoice/src/main/java/com/forgon/disinfectsystem/invoicemanager/service/InvoiceManagerImpl.java =================================================================== diff -u -r16405 -r16431 --- ssts-invoice/src/main/java/com/forgon/disinfectsystem/invoicemanager/service/InvoiceManagerImpl.java (.../InvoiceManagerImpl.java) (revision 16405) +++ ssts-invoice/src/main/java/com/forgon/disinfectsystem/invoicemanager/service/InvoiceManagerImpl.java (.../InvoiceManagerImpl.java) (revision 16431) @@ -3508,10 +3508,10 @@ } private JsonArray buildJSONArrayForTousseInstances( - Collection tousseInstances) { + Collection tousseInstances,String departCodeOfInvoicePlan) { JsonArray datasJSONArray = new JsonArray(); - for (TousseInstance tousseInstanc : tousseInstances) { - Long pdid = tousseInstanc.getProxyDisinfection_id(); + for (TousseInstance tousseInstance : tousseInstances) { + Long pdid = tousseInstance.getProxyDisinfection_id(); if (pdid != null) { ProxyDisinfection pd = (ProxyDisinfection) objectDao .getByProperty(ProxyDisinfection.class.getSimpleName(), @@ -3523,7 +3523,7 @@ List tis = pd.getApplicationItems(); for (TousseItem tousseItem : tis) { if (tousseItem.getTousseName().equals( - tousseInstanc.getTousseName())) { + tousseInstance.getTousseName())) { if (tousseItem.getSendOutAmount() >= tousseItem .getAmount()) { continue; @@ -3533,12 +3533,34 @@ } } } - JsonObject dataJSONObject = buildJSONObjectForTousseInstance(tousseInstanc); + // 过滤科室 + if(filterByDepart(tousseInstance, departCodeOfInvoicePlan)){ + continue; + } + + JsonObject dataJSONObject = buildJSONObjectForTousseInstance(tousseInstance); logScannedTousse(dataJSONObject); datasJSONArray.add(dataJSONObject); } return datasJSONArray; } + + private boolean filterByDepart(TousseInstance tousseInstance, + String departCodeOfInvoicePlan) { + // 过滤科室 + TousseDefinition tousseDefinition = tousseInstance + .getTousseDefinition(); + String departCoding = tousseInstance.getDepartCoding(); + if (tousseDefinition != null + && StringUtils.equals(tousseDefinition.getLimitInvoiceDepart(), + TousseDefinition.STR_YES) + && StringUtils.isNotBlank(departCoding)) { + if (StringUtils.equals(departCoding, departCodeOfInvoicePlan)) { + return true; + } + } + return false; + } // 根据固定条码的消毒物品包实例获取能发货的包实例 private Collection getCanInvoiceTousseInstancesByFixedDisinfectionTousseInstance(InvoicePlan invoicePlan, TousseInstance fixedBarcodeTousseInstance,int amount){ @@ -3680,418 +3702,7 @@ fixedBarcodeTousseInstance.getTousseName()); return obj; } - // 预约发货扫描处理 - private JsonObject getInfoByBarcodeForOperationReservationInvoiceScan(JsonObject params){ - final String barcodeStr = params.get("barcode").getAsString(); - if (StringUtils.isBlank(barcodeStr)) - return buildErrorMsgJsonResult("请扫描条码!"); - - final JsonObject extraParam = params.get("extraParam") - .getAsJsonObject(); - if (extraParam == null) - return buildErrorMsgJsonResult("缺失参数extraParam"); - - final String mode = GsonUtil.getString(extraParam, "mode", ""); - final String departCodeOfInvoicePlan = GsonUtil.getString(extraParam, "departCodeOfInvoicePlan", ""); - final long invoicePlanId = GsonUtil.getLong(extraParam, "invoicePlanId", 0); - - if (StringUtils.isBlank(departCodeOfInvoicePlan)) - return buildErrorMsgJsonResult("extraParam缺失参数departCodeOfInvoicePlan"); - - String[] barcodeArray = barcodeStr.split(";"); - String barcode = barcodeArray[0]; - String barcodeEnd = ""; - if(barcodeArray.length > 1){ - barcodeEnd = barcodeArray[1]; - } - - BarcodeDevice barcodeDevice = barcodeManager - .getBarcodeByBarcode(barcode); - if (barcodeDevice == null) - return buildErrorMsgJsonResult("查无此物品"); - - - JsonArray tips = new JsonArray(); - if (barcodeDevice instanceof TousseInstance) { - // 器械包 - final TousseInstance tousseInstance = (TousseInstance) barcodeDevice; - final TousseDefinition tousseDefinition = tousseInstance - .getTousseDefinition(); - - //如果器械包实例条件(尾)不为空 - if(StringUtils.isNotBlank(barcodeEnd)){ - BarcodeDevice barcodeDeviceEnd = barcodeManager - .getBarcodeByBarcode(barcodeEnd); - if (barcodeDeviceEnd == null){ - return buildErrorMsgJsonResult("条码/篮筐(尾)请输入正确的参数"); - } - if(!(barcodeDeviceEnd instanceof TousseInstance)){ - return buildErrorMsgJsonResult("条码/篮筐(首)与条码/篮筐(尾)尾参数类型不一致!"); - } - } - - //如果器械包实例条件(尾)为空 - if(StringUtils.isBlank(barcodeEnd)){ - // 不追溯的消毒物品,发货扫描固定条码,返回多个器械包 - if (tousseInstance.getTousseFixedBarcode() - && tousseDefinition.isDisinfection()) { - long tousseInstanceAmount = 0; - switch(mode){ - case "depart": - tousseInstanceAmount = getDisinfectionTousseInstanceAmount( - departCodeOfInvoicePlan, tousseDefinition); - break; - case "invoicePlan": - tousseInstanceAmount = getDisinfectionTousseInstanceAmountByInvoicePlanId( - invoicePlanId, tousseDefinition); - break; - default: - return buildErrorMsgJsonResult("extraParam缺失参数mode"); - } - - if (tousseInstanceAmount <= 0) - return buildErrorMsgJsonResult("该物品库存不足"); - tousseInstance.setStockForFixedBarcode(new Long(tousseInstanceAmount)); - JsonObject result = new JsonObject(); - result.addProperty("success", true); - result.addProperty("barcode", barcode); - result.addProperty("type", "tousseInstance"); - JsonObject dataJSONObject = buildJSONObjectForTousseInstance(tousseInstance); - result.add("data", dataJSONObject); - logScannedTousse(dataJSONObject); - // result.addProperty("type", "tousseInstanceList"); - // result.add("fixedBarcodeInfo", getFixedBarcodeInfo(tousseInstance, resultTousseInstanceList)); - // result.add( - // "data", - // buildJSONArrayForTousseInstances(resultTousseInstanceList)); - return result; - } - - // 不追溯的器械包(除消毒物品外),发货扫描固定条码,返回多个器械包 - if (!tousseDefinition.traceable() && tousseInstance.getTousseFixedBarcode()) { - - // 非可追溯器械包,返回多个器械包实例 - Collection resultTousseInstanceList = getCanInvoiceTousseInstancesByFixedTousseInstance(tousseInstance); - - if (CollectionUtils.isEmpty(resultTousseInstanceList)) - return buildErrorMsgJsonResult("该物品库存不足"); - - JsonObject result = new JsonObject(); - tousseInstance.setStockForFixedBarcode(new Long(resultTousseInstanceList.size())); - result.addProperty("success", true); - result.addProperty("barcode", barcode); - result.addProperty("type", "tousseInstance"); - JsonObject dataJSONObject = buildJSONObjectForTousseInstance(tousseInstance); - result.add("data", dataJSONObject); - logScannedTousse(dataJSONObject); - // result.addProperty("type", "tousseInstanceList"); - // result.add("fixedBarcodeInfo", getFixedBarcodeInfo(tousseInstance, resultTousseInstanceList)); - // result.add( - // "data", - // buildJSONArrayForTousseInstances(resultTousseInstanceList)); - return result; - - } - // 如果是 - if(tousseInstance.getTousseFixedBarcode() && TousseDefinition.STR_YES.equals(tousseDefinition - .getIsTraceable())){ - return buildErrorMsgJsonResult(tousseInstance.getTousseName()+"为可追溯的包,不能扫描固定条码!"); - } - // 可追溯器械包,返回单个器械包实例 - if (!checkStatusForInvoice.evaluate(tousseInstance)) { - - return buildErrorMsgJsonResult("该器械包状态为" + tousseInstance.getStatus() + ",不能发货!请扫描已消毒或者已灭菌的器械包"); - } - if (!tousseInstanceManager.checkTousseInstanceHasNotRecall() - .evaluate(tousseInstance)) { - return buildErrorMsgJsonResult("器械包已被召回"); - } - - Date validUntil = tousseInstance.getValidUntil(); - if (DateTools.isExpire(validUntil, new Date())) { - return buildErrorMsgJsonResult("器械包已过期"); - } - Date warningUntil = tousseInstance.getWarningUntil(); - if (DateTools.isDuringWarningPeriod(validUntil, warningUntil, - new Date())) { - SupplyRoomConfig cofig = supplyRoomConfigManager.getSystemParamsObj(); - Boolean warningTousseWhetherDelivery = cofig - .getWarningTousseWhetherDelivery(); - if (warningTousseWhetherDelivery) { - tips.add(new JsonPrimitive("器械包即将失效")); - } else { - return buildErrorMsgJsonResult("器械包处于预警期不能发货"); - } - } - - - JsonObject result = new JsonObject(); - result.addProperty("success", true); - result.addProperty("barcode", barcode); - result.addProperty("type", "tousseInstance"); - JsonObject dataJSONObject = buildJSONObjectForTousseInstance(tousseInstance); - result.add("data", dataJSONObject); - logScannedTousse(dataJSONObject); - result.add("tips", tips); - return result; - }else{ - //如果存在器械包实例条码(尾) - JsonObject result = new JsonObject(); - result.addProperty("success", true); - result.addProperty("barcode", barcodeStr); - result.addProperty("type", "tousseInstanceList"); - Map mapResult = - barcodeManager.getTousseInstanceListByRange(barcode, barcodeEnd, TousseInstance.STATUS_STERILED); - - if(mapResult != null && mapResult.get("result") != null){ - List tousseInstanceList = (List)mapResult.get("result"); - if(CollectionUtils.isNotEmpty(tousseInstanceList)){ - JsonArray datasJSONArray = buildJSONArrayForTousseInstances(tousseInstanceList); - result.add("data", datasJSONArray); - logScannedTousses(datasJSONArray); - }else{ - return buildErrorMsgJsonResult("未找到符合条件的器械包"); - } - }else{ - return buildErrorMsgJsonResult("未找到符合条件的器械包"); - } - result.add("tips", tips); - return result; - } - - } else if (barcodeDevice instanceof User) { - // 用户 - JsonObject data = new JsonObject(); - data.addProperty("fullName", ((User)barcodeDevice).getFullName()); - JsonObject result = new JsonObject(); - result.addProperty("success", true); - result.addProperty("barcode", barcode); - result.addProperty("type", "user"); - result.add("data", - data); - return result; - }else if (barcodeDevice instanceof Container) { - if(Container.CONTAINER_PURPOSE_DISINFECTION.equals(((Container) barcodeDevice).getPurpose())){ - // 容器(整筐发货),针对灭菌篮筐(单个)的处理 - Map multiResult = loadSterilizeBasketInsideTousseInstance( - barcode, departCodeOfInvoicePlan); - boolean success = (Boolean) multiResult.get("success"); - if (!success) { - String errorMsg = (String) multiResult.get("error"); - return buildErrorMsgJsonResult(errorMsg); - } - - Collection tousseInstances = (Collection) multiResult - .get("data"); - tips = (JsonArray) new Gson().toJsonTree(multiResult.get("tips"), - new TypeToken>() { - }.getType()); - - JsonObject result = new JsonObject(); - result.addProperty("success", true); - result.addProperty("barcode", barcode); - result.addProperty("type", "tousseInstancesInContainer"); - JsonArray datasJSONArray = buildJSONArrayForTousseInstances(tousseInstances); - result.add("data", datasJSONArray); - logScannedTousses(datasJSONArray); - result.add("tips", tips); - return result; - }else if(Container.CONTAINER_PURPOSE_VIRTUAL.equals(((Container) barcodeDevice).getPurpose())){ - //判断条码/篮筐(尾)对应的篮筐是否存在,且类型与条码/篮筐(首)是否一致 - if(StringUtils.isNotBlank(barcodeEnd)){ - BarcodeDevice barcodeDeviceEnd = barcodeManager - .getBarcodeByBarcode(barcodeEnd); - if (barcodeDeviceEnd == null){ - return buildErrorMsgJsonResult("条码/篮筐(尾)请输入正确的参数"); - } - if(!(barcodeDeviceEnd instanceof Container) - || !Container.CONTAINER_PURPOSE_VIRTUAL.equals(((Container) barcodeDeviceEnd).getPurpose())){ - return buildErrorMsgJsonResult("条码/篮筐(首)与条码/篮筐(尾)尾参数类型不一致!"); - } - } - - // 容器(整筐发货),针对虚拟篮筐(单个或首尾)的处理 - Map multiResult = - loadSterilizeBasketInsideTousseInstanceByRange(barcode, barcodeEnd, departCodeOfInvoicePlan); - boolean success = (Boolean) multiResult.get("success"); - if (!success) { - String errorMsg = (String) multiResult.get("error"); - return buildErrorMsgJsonResult(errorMsg); - } - - Collection tousseInstances = (Collection) multiResult - .get("data"); - tips = (JsonArray) new Gson().toJsonTree(multiResult.get("tips"), - new TypeToken>() { - }.getType()); - - JsonObject result = new JsonObject(); - result.addProperty("success", true); - result.addProperty("barcode", barcode); - result.addProperty("type", "tousseInstancesInContainer"); - JsonArray datasJSONArray = buildJSONArrayForTousseInstances(tousseInstances); - result.add("data", datasJSONArray); - logScannedTousses(datasJSONArray); - result.add("tips", tips); - return result; - }else{ - return buildErrorMsgJsonResult("篮筐为非有效的篮筐,请扫描或输入灭菌篮筐或虚拟篮筐"); - } - } else if (barcodeDevice instanceof ExpensiveDisposablegoods) { - // 高值耗材 - ExpensiveDisposablegoods expensiveDisposablegoods = (ExpensiveDisposablegoods) barcodeDevice; - if(!expensiveDisposablegoods.inWarehouse()){ - return buildErrorMsgJsonResult(String.format("条码为[%s]的高值耗材状态为%s,不能发货", barcode,expensiveDisposablegoods.getStatus())); - } - Long disposableGoodsBatchId = expensiveDisposablegoods.getDisposableGoodsBatchID(); - if(disposableGoodsBatchId == null){ - return buildErrorMsgJsonResult(String.format("条码为[%s]的高值耗材数据异常,批次定义id为空", barcode)); - } - DisposableGoodsBatch disposableGoodsBatch = diposableGoodsManager.getDisposableGoodsBatchById(expensiveDisposablegoods.getDisposableGoodsBatchID()); - if(disposableGoodsBatch == null){ - return buildErrorMsgJsonResult(String.format("条码为[%s]的高值耗材批次定义已被删除", barcode)); - } - DisposableGoods diposableGoods = disposableGoodsBatch.getDiposableGoods(); - if(diposableGoods == null){ - return buildErrorMsgJsonResult(String.format("条码为[%s]的高值耗材的物品定义已被删除", barcode)); - } - String showName = diposableGoods.getShowName(); - - DisposableGoodsBatchStock disposableGoodsBatchStock = expensiveDisposablegoods.getDisposableGoodsBatchStock(); - if(disposableGoodsBatchStock == null){ - return buildErrorMsgJsonResult(String.format("条码为[%s]的高值耗材的批次库存已被删除", barcode)); - } - - // ***验证失效期*** - Date expDate = disposableGoodsBatchStock.getExpDate(); - if (new Date().after(expDate)) {// 一次性物品失效 - return buildErrorMsgJsonResult(String.format("[%s]已过期", showName)); - } - - // 获取单价 - Double price = expensiveDisposablegoods.getPrice(); - Double fluctuationPrice = supplyRoomConfigManager.getDisposableGoodsFluctuationPrice(price); - - JSONObject typeInfoOnScanned = new JSONObject(); - typeInfoOnScanned.put("disposableGoodsId", diposableGoods.getId()); - typeInfoOnScanned.put("disposableGoodsStockId", expensiveDisposablegoods.getDisposableGoodsStockID()); - typeInfoOnScanned.put("disposableGoodsBatchId", disposableGoodsBatchId); - typeInfoOnScanned.put("disposableGoodsBatchStockId", disposableGoodsBatchStock.getId()); - typeInfoOnScanned.put("expensiveDisposablegoodsId", expensiveDisposablegoods.getId()); - JsonObject data = new JsonObject(); - data.addProperty("name", showName); - data.addProperty("showTousseName", showName); - data.addProperty("barcode", expensiveDisposablegoods.getBarcode()); - data.addProperty("diposable", Constants.STR_YES); - data.addProperty("batchNumber",disposableGoodsBatchStock.getBatchNumber()); - data.addProperty("storage", 1); - data.addProperty("price", price); - data.addProperty("fluctuationPrice", fluctuationPrice); - data.addProperty("typeInfoOnScanned", typeInfoOnScanned.toString()); - JsonObject result = new JsonObject(); - result.addProperty("success", true); - result.addProperty("barcode", barcode); - result.addProperty("type", "expensiveDisposablegoods"); - result.add("data", data); - result.add("tips", tips); - return result; - - }else if (barcodeDevice instanceof DisposableGoodsBatch) { - // 一次性物品 - Long sourceWarehouseId = extraParam.get("sourceWarehouseId").getAsLong(); - DisposableGoodsBatch disposableGoodsBatch = (DisposableGoodsBatch) barcodeDevice; - DisposableGoods diposableGoods = disposableGoodsBatch - .getDiposableGoods(); - if(diposableGoods.expensiveDiposablegoods()){ - return buildErrorMsgJsonResult("此物品为高值耗材,请扫描高值耗材条码!"); - } - String name = diposableGoods.getShowName(); - - DisposableGoodsBatchStock disposableGoodsBatchStock = diposableGoodsManager.getDisposableGoodsStockByBatchNumber(sourceWarehouseId, diposableGoods.getId(), disposableGoodsBatch.getBatchNumber()); - if(disposableGoodsBatchStock == null){ - return buildErrorMsgJsonResult("批次库存为空!"); - } - // 验证库存 - if(disposableGoodsBatchStock.getStorage().intValue() <= 0){ - return buildErrorMsgJsonResult(String.format("[%s]库存不足!", name)); - } - // ***验证一次性物品*** - Date scannedExpDate = disposableGoodsBatch.getExpDate(); - Date curDate = new Date(); - String scannedExpDateStr = DateFormatUtils.format(scannedExpDate, - "yyyy-MM-dd HH:mm:ss"); - if (curDate.after(scannedExpDate)) {// 一次性物品失效 - return buildErrorMsgJsonResult(String.format("[%s]已过期", name)); - } - - // 获取单价 - List identificationOfDiposableGoodss = diposableGoodBatchStockManager - .getIdentificationsWithNoZeroStroge(disposableGoodsBatchStock - .getId()); - - Double price = 0.0; - Double fluctuationPrice = 0.0; - if (CollectionUtils.isNotEmpty(identificationOfDiposableGoodss)) { - price = identificationOfDiposableGoodss.get(0).getPrice(); - fluctuationPrice = supplyRoomConfigManager.getDisposableGoodsFluctuationPrice(price); - } - JSONObject typeInfoOnScanned = new JSONObject(); - typeInfoOnScanned.put("disposableGoodsId", diposableGoods.getId()); - typeInfoOnScanned.put("disposableGoodsStockId", disposableGoodsBatchStock.getDisposableGoodsStockId()); - typeInfoOnScanned.put("disposableGoodsBatchId", disposableGoodsBatchStock.getDisposableGoodsBatchId()); - typeInfoOnScanned.put("disposableGoodsBatchStockId", disposableGoodsBatchStock.getId()); - JsonObject data = new JsonObject(); - data.addProperty("name", name); - data.addProperty("showTousseName", name); - data.addProperty("barcode", disposableGoodsBatch.getBarcode()); - data.addProperty("diposable", Constants.STR_YES); - data.addProperty("batchNumber", - disposableGoodsBatch.getBatchNumber()); - data.addProperty("storage", disposableGoodsBatchStock.getStorage()); - data.addProperty("price", price); - data.addProperty("fluctuationPrice", fluctuationPrice); - data.addProperty("typeInfoOnScanned", typeInfoOnScanned.toString()); - String batchNumber = diposableGoodBatchStockManager - .getEarliestNonExpiredDisposableGoodsBatchStock(disposableGoodsBatchStock.getDisposableGoodsStockId(), scannedExpDateStr); - - if (StringUtils.isNotBlank(batchNumber)) { - String tipsStr = String.format("批次为[%s]的[%s]快到失效期,请优先发货", - batchNumber, name); - tips.add(new JsonPrimitive(tipsStr)); - } - - JsonObject result = new JsonObject(); - result.addProperty("success", true); - result.addProperty("barcode", barcode); - result.addProperty("type", "diposableGoodsBatchStock"); - result.add("data", data); - result.add("tips", tips); - return result; - - }else if(barcodeDevice instanceof WareHouse){ - WareHouse wareHouse = (WareHouse)barcodeDevice; - JsonObject data = new JsonObject(); - data.addProperty("wareHouseID", wareHouse.getId()); - data.addProperty("wareHouseName", wareHouse.getName()); - - JsonObject result = new JsonObject(); - result.addProperty("success", true); - result.addProperty("barcode", barcode); - result.addProperty("type", "wareHouse"); - - result.add("data", data); - result.add("tips", tips); - return result; - }else { - return buildErrorMsgJsonResult("查无此物品"); - } - - } - // 自定义发货扫描处理 - private JsonObject getInfoByBarcodeForCustomInvoiceScan(JsonObject params){ - return null; - } // 过滤器械包 private void filterTousseInstanceByInvoiceType(String invoiceType, Collection tousseInstanceList) { @@ -4226,11 +3837,6 @@ JsonObject dataJSONObject = buildJSONObjectForTousseInstance(tousseInstance); result.add("data", dataJSONObject); logScannedTousse(dataJSONObject); - // result.addProperty("type", "tousseInstanceList"); - // result.add("fixedBarcodeInfo", getFixedBarcodeInfo(tousseInstance, resultTousseInstanceList)); - // result.add( - // "data", - // buildJSONArrayForTousseInstances(resultTousseInstanceList)); return result; } @@ -4251,11 +3857,6 @@ JsonObject dataJSONObject = buildJSONObjectForTousseInstance(tousseInstance); result.add("data", dataJSONObject); logScannedTousse(dataJSONObject); - // result.addProperty("type", "tousseInstanceList"); - // result.add("fixedBarcodeInfo", getFixedBarcodeInfo(tousseInstance, resultTousseInstanceList)); - // result.add( - // "data", - // buildJSONArrayForTousseInstances(resultTousseInstanceList)); return result; } @@ -4289,8 +3890,11 @@ return buildErrorMsgJsonResult("器械包处于预警期不能发货"); } } + // 过滤科室 + if(filterByDepart(tousseInstance, departCodeOfInvoicePlan)){ + return buildErrorMsgJsonResult(String.format("%s不属于当前科室!", tousseInstance.getTousseName())); + } - JsonObject result = new JsonObject(); result.addProperty("success", true); result.addProperty("barcode", barcode); @@ -4313,7 +3917,7 @@ List tousseInstanceList = (List)mapResult.get("result"); filterTousseInstanceByInvoiceType(invoiceType, tousseInstanceList); if(CollectionUtils.isNotEmpty(tousseInstanceList)){ - JsonArray datasJSONArray = buildJSONArrayForTousseInstances(tousseInstanceList); + JsonArray datasJSONArray = buildJSONArrayForTousseInstances(tousseInstanceList,departCodeOfInvoicePlan); result.add("data", datasJSONArray); logScannedTousses(datasJSONArray); @@ -4367,7 +3971,7 @@ result.addProperty("success", true); result.addProperty("barcode", barcode); result.addProperty("type", "tousseInstancesInContainer"); - JsonArray datasJSONArray = buildJSONArrayForTousseInstances(tousseInstances); + JsonArray datasJSONArray = buildJSONArrayForTousseInstances(tousseInstances,departCodeOfInvoicePlan); result.add("data", datasJSONArray); logScannedTousses(datasJSONArray); result.add("tips", tips); @@ -4406,7 +4010,7 @@ result.addProperty("success", true); result.addProperty("barcode", barcode); result.addProperty("type", "tousseInstancesInContainer"); - JsonArray datasJSONArray = buildJSONArrayForTousseInstances(tousseInstances); + JsonArray datasJSONArray = buildJSONArrayForTousseInstances(tousseInstances,departCodeOfInvoicePlan); result.add("data", datasJSONArray); logScannedTousses(datasJSONArray); result.add("tips", tips); @@ -8264,6 +7868,27 @@ if(td == null){ continue; } + if (!tousseInstanceManager.checkTousseInstanceHasNotRecall() + .evaluate(tousseInstance)) { + continue; + } + + Date validUntil = tousseInstance.getValidUntil(); + if (DateTools.isExpire(validUntil, new Date())) { + continue; + } + Date warningUntil = tousseInstance.getWarningUntil(); + if (DateTools.isDuringWarningPeriod(validUntil, warningUntil, + new Date())) { + SupplyRoomConfig cofig = supplyRoomConfigManager.getSystemParamsObj(); + Boolean warningTousseWhetherDelivery = cofig + .getWarningTousseWhetherDelivery(); + if (warningTousseWhetherDelivery) { + + } else { + continue; + } + } String barcode = tousseInstance.getBarcode(); JSONObject obj = new JSONObject(); obj.put("id", tousseInstance.getId());