Index: ssts-recyclingrecord/src/main/java/com/forgon/disinfectsystem/recyclingrecord/service/RecyclingRecordManager.java =================================================================== diff -u -r27459 -r27464 --- ssts-recyclingrecord/src/main/java/com/forgon/disinfectsystem/recyclingrecord/service/RecyclingRecordManager.java (.../RecyclingRecordManager.java) (revision 27459) +++ ssts-recyclingrecord/src/main/java/com/forgon/disinfectsystem/recyclingrecord/service/RecyclingRecordManager.java (.../RecyclingRecordManager.java) (revision 27464) @@ -139,12 +139,13 @@ * @param tdMap 包定义map * @param invoicePlanMap 申请单map * @param terminatedTousseItemToIpMap 申请单内终止的指定物品map + * @param queriedBarcodes 已经查询过的篮筐条码 * @return */ public JSONObject recycleTousseIntoBaskets(String materials, Long tousseDefinitionId, Integer amount, String idCardBarcode, String params,String tousseIntoBasketInfo,Long recyclingApplicationId, Boolean autoSetIDCardBarcodeForPacking, Map classifyBasketMap, Map tdMap - ,Map invoicePlanMap, Map> terminatedTousseItemToIpMap); + ,Map invoicePlanMap, Map> terminatedTousseItemToIpMap, Set queriedBarcodes); /** * 材料入筐,按清洗分类类型及篮筐上限入筐 * @param materialInstanceId 材料实例id Index: ssts-recyclingrecord/src/main/java/com/forgon/disinfectsystem/recyclingrecord/dwr/table/RecyclingRecordTableManager.java =================================================================== diff -u -r27459 -r27464 --- ssts-recyclingrecord/src/main/java/com/forgon/disinfectsystem/recyclingrecord/dwr/table/RecyclingRecordTableManager.java (.../RecyclingRecordTableManager.java) (revision 27459) +++ ssts-recyclingrecord/src/main/java/com/forgon/disinfectsystem/recyclingrecord/dwr/table/RecyclingRecordTableManager.java (.../RecyclingRecordTableManager.java) (revision 27464) @@ -382,6 +382,7 @@ */ public String getTousseIntoBasketAmounts(String intoBasketInfos){ Map classifyBasketMap = new HashMap(); + Set queriedBarcodes = new HashSet(); JSONArray resultArr = new JSONArray(); boolean autoSetIDCardBarcodeForPacking = CssdUtils.getSystemSetConfigByNameBool("autoSetIDCardBarcodeForPacking"); JSONArray intoBasketInfosArr = JSONUtil.toJSONArray(intoBasketInfos); @@ -407,7 +408,7 @@ Long recyclingApplicationId = obj.optLong("recyclingApplicationId"); try { result = recyclingRecordManager.recycleTousseIntoBaskets(null, tousseDefinitionId, amount, null, params,null,recyclingApplicationId,autoSetIDCardBarcodeForPacking - ,classifyBasketMap,tdMap,invoicePlanMap,terminatedTousseItemToIpMap); + ,classifyBasketMap,tdMap,invoicePlanMap,terminatedTousseItemToIpMap, queriedBarcodes); resultArr.add(result); } catch (Exception e) { e.printStackTrace(); Index: ssts-recyclingrecord/src/main/java/com/forgon/disinfectsystem/recyclingrecord/service/RecyclingRecordManagerImpl.java =================================================================== diff -u -r27459 -r27464 --- ssts-recyclingrecord/src/main/java/com/forgon/disinfectsystem/recyclingrecord/service/RecyclingRecordManagerImpl.java (.../RecyclingRecordManagerImpl.java) (revision 27459) +++ ssts-recyclingrecord/src/main/java/com/forgon/disinfectsystem/recyclingrecord/service/RecyclingRecordManagerImpl.java (.../RecyclingRecordManagerImpl.java) (revision 27464) @@ -4520,7 +4520,8 @@ Map barcodeToPercentageMap = new HashMap(); //获取已扫描的篮筐已使用的容积 Map classifyBasketMap = new HashMap(); - getBasketUsedVolume(barcodeToPercentageMap, baskets, classifyBasketMap); + Set queriedBarcodes = new HashSet(); + getBasketUsedVolume(barcodeToPercentageMap, baskets, classifyBasketMap, queriedBarcodes); boolean isSecondRecycleForForeignTousse = false; InvoicePlan ip = invoicePlanManager.get(recyclingApplicationId); if(ip != null){ @@ -4794,6 +4795,7 @@ List baskets = JSONUtil.fromJson(basketArray, CustomIntoBasket.class,map); Map barcodeToPercentageMap = new HashMap(); Map classifyBasketMap = new HashMap(); + Set queriedBarcodes = new HashSet(); //必须是getBean的方式。因为每次都要是新创建的bean。不使用new的方式,是因为内部还引用了其他的bean TousseIntoBasketService tousseIntoBasketService = (TousseIntoBasketService) SpringBeanManger.getBean("tousseIntoBasketService"); tousseIntoBasketService.initJsonArray(tousseIntoBasketInfo); @@ -4805,7 +4807,7 @@ return JSONUtil.buildJsonObject(false,"该器械包内无器械可回收!"); } //获取已扫描的篮筐已使用的容积 - getBasketUsedVolume(barcodeToPercentageMap, baskets, classifyBasketMap); + getBasketUsedVolume(barcodeToPercentageMap, baskets, classifyBasketMap, queriedBarcodes); //篮筐分类类型map Map> washClassifyTypeToBasketsMap = buildWashClassifyTypeMap(baskets); @@ -4929,7 +4931,7 @@ data.put("materials", materials); //整包清洗 }else{ - getBasketUsedVolume(barcodeToPercentageMap, baskets, classifyBasketMap); + getBasketUsedVolume(barcodeToPercentageMap, baskets, classifyBasketMap, queriedBarcodes); try{ tousseIntoBasketService.canAddThisBasketItem(baskets.get(0).getBarcode(),td,isSecondRecycleForForeignTousse); // if(multiForeignTousseIntoSameBasket){}else{ @@ -5202,15 +5204,19 @@ * @param barcodeMap * @param customIntoBaskets */ - private void getBasketUsedVolume(Map percentageMap, List customIntoBaskets, Map classifyBasketMap) { + private void getBasketUsedVolume(Map percentageMap, List customIntoBaskets, Map classifyBasketMap, Set queriedBarcodes) { for (CustomIntoBasket customIntoBaset : customIntoBaskets) { String barcode = customIntoBaset.getBarcode(); ClassifyBasket basket = null; if(classifyBasketMap.containsKey(barcode)){ basket = classifyBasketMap.get(barcode); }else{ - basket = classifyBasketManager.getUnWashedBasket(barcode); - classifyBasketMap.put(barcode, basket); + if(!queriedBarcodes.contains(barcode)){ + basket = classifyBasketManager.getUnWashedBasket(barcode); + if(basket != null){ + classifyBasketMap.put(barcode, basket); + } + } } Double percentage = 0.00; //持久化到数据库中的篮筐内物品 @@ -6175,7 +6181,7 @@ String params, String tousseIntoBasketInfo, Long recyclingApplicationId, Boolean autoSetIDCardBarcodeForPacking, Map classifyBasketMap ,Map tdMap - ,Map invoicePlanMap,Map> terminatedTousseItemToIpMap) { + ,Map invoicePlanMap,Map> terminatedTousseItemToIpMap, Set queriedBarcodes) { if(!DatabaseUtil.isPoIdValid(tousseDefinitionId) || StringUtils.isBlank(params) || amount == null){ return JSONUtil.buildJsonObject(false, "参数错误!"); } @@ -6215,14 +6221,13 @@ return JSONUtil.buildJsonObject(false,"该器械包内无器械可回收!"); } //获取已扫描的篮筐已使用的容积 - getBasketUsedVolume(barcodeToPercentageMap, baskets, classifyBasketMap); + getBasketUsedVolume(barcodeToPercentageMap, baskets, classifyBasketMap,queriedBarcodes); //篮筐分类类型map Map> washClassifyTypeToBasketsMap = buildWashClassifyTypeMap(baskets); JSONArray materials = new JSONArray(); Map basketGroupBarcodeMap = new HashMap(); - JSONArray materialsInfoArr = null; for (MaterialInstance mi : msList) { MaterialDefinition md = mi.getMaterialDefinition(); if(md == null){ @@ -6317,7 +6322,7 @@ data.put("isCleanedEntirely", Constants.STR_NO); //整包清洗 }else{ - getBasketUsedVolume(barcodeToPercentageMap, baskets, classifyBasketMap); + getBasketUsedVolume(barcodeToPercentageMap, baskets, classifyBasketMap,queriedBarcodes); try{ tousseIntoBasketService.canAddThisBasketItem(baskets.get(0).getBarcode(),td,isSecondRecycleForForeignTousse); }catch(Exception e){