Index: ssts-web/src/main/webapp/disinfectsystem/touchScreen/recycle/recycleForTouchScreen.js =================================================================== diff -u -r26276 -r26282 --- ssts-web/src/main/webapp/disinfectsystem/touchScreen/recycle/recycleForTouchScreen.js (.../recycleForTouchScreen.js) (revision 26276) +++ ssts-web/src/main/webapp/disinfectsystem/touchScreen/recycle/recycleForTouchScreen.js (.../recycleForTouchScreen.js) (revision 26282) @@ -2,7 +2,7 @@ var deleteTousseItemArray = new Array(); // 科室绑定的篮筐的条码数组 var departBindingBasketBarcodes = []; -var materialsMapForSave = new Map(); +var materialsMapForSave = {}; /** * 不回收的器械包的集合。这个是由绑定带出来的器械包,并且不回收,在回收这里本来是不做处理的。现在要能修改原来的申请数量,相关的还有装配任务 */ @@ -2707,7 +2707,11 @@ */ function addMaterialsMapForSave(tousseDefinitionID,materialsJsonStr){ var materialsJson = JSON.parse(materialsJsonStr); - materialsMapForSave[tousseDefinitionID]=materialsJson; + var materialsArrayForSave = {}; + for(var i = 0; i < materialsJson.length; i++){ + materialsArrayForSave[materialsJson[i].materialId] = {"materialName":materialsJson[i].materialName,"count":materialsJson[i].count}; + } + materialsMapForSave[tousseDefinitionID] = materialsArrayForSave; } /** * 判断tousseItem表是否是空的。删除的项不算在内 @@ -2822,7 +2826,7 @@ paramJson.confirmation = confirmation; paramJson.tally = false; paramJson.recyclingItemArray = getRecyclingItemInfo(); - paramJson.materialsMapForSave = materialsMapForSave; + paramJson.materialsJsonForSave = materialsMapForSave; return JSON.stringify(paramJson); } Index: ssts-recyclingrecord/src/main/java/com/forgon/disinfectsystem/recyclingrecord/service/RecyclingRecordManagerImpl.java =================================================================== diff -u -r26276 -r26282 --- ssts-recyclingrecord/src/main/java/com/forgon/disinfectsystem/recyclingrecord/service/RecyclingRecordManagerImpl.java (.../RecyclingRecordManagerImpl.java) (revision 26276) +++ ssts-recyclingrecord/src/main/java/com/forgon/disinfectsystem/recyclingrecord/service/RecyclingRecordManagerImpl.java (.../RecyclingRecordManagerImpl.java) (revision 26282) @@ -3290,7 +3290,7 @@ if (amount != 0) { newUnPackingTousseInstanceOrDisinfectGoodsDefinition( record, application, amount, isNewAddTousse,td, appItem, - recyclingBasketItem, errorDamages,basketItemJson, urgentTousseItems,appTousseItemMap,recyclingContext.getMaterialsMapForSave().get(td.getId().toString())); + recyclingBasketItem, errorDamages,basketItemJson, urgentTousseItems,appTousseItemMap,recyclingContext.getMaterialsJsonForSave().optJSONObject(td.getId().toString())); } } } @@ -3338,7 +3338,7 @@ if(td.isDisinfection()){ newDisinfectTousseDefinition(application, td, appItem, recyclingBasketItem, errorDamages, basketItemJson, - urgentTousseItems, appTousseItemMap, recyclingContext.getMaterialsMapForSave().get(td.getId().toString())); + urgentTousseItems, appTousseItemMap, recyclingContext.getMaterialsJsonForSave().optJSONObject(td.getId().toString())); } } } @@ -3380,7 +3380,6 @@ List tousseDefinitions, List errorDamages, List basketItemJson, List urgentTousseItems,boolean isForeignTousseApplication,boolean isChangeApplyDepart, Map tousseDefIdTousseItemVoMap) { - Map materialsMapForSave= recyclingContext.getMaterialsMapForSave(); InvoicePlan application = record.getRecyclingApplication(); String invoiceOrigin = supplyRoomConfigManager.getInvoiceOrigin(); RecyclingApplicationVo orignalApplication = invoicePlanManager.invoicePlan2RecyclingApplicationVo(application,false); @@ -3627,12 +3626,11 @@ item.setInvoicePlan(application); item.setIsRecycling(td.getIsRecycling()); tousseItems.add(item); - //不装配不追溯物品 newUnPackingTousseInstanceOrDisinfectGoodsDefinition( record, application, recyclingAmount, isNewAddTousse, td, item, json, errorDamages, - basketItemJson, urgentTousseItems,itemMap,materialsMapForSave.get(td.getId().toString())); + basketItemJson, urgentTousseItems,itemMap,recyclingContext.getMaterialsJsonForSave().optJSONObject(td.getId().toString())); } //未入筐添加的物品 for(Map.Entry entry : tousseDefIdTousseItemVoMap.entrySet()){ @@ -3812,7 +3810,7 @@ boolean isNewAddTousse, TousseDefinition td, TousseItem appItem, SimpleTousseItem basketItemJson, List errorDamageDetail, List basketItems, List urgentTousseItems, - Map toussItemMap,JSONArray materialsJsonForSave) { + Map toussItemMap,JSONObject materialsJsonForSave) { TousseDefinition createInstanceTD = td; //创建消毒物品包定义 @@ -3834,7 +3832,7 @@ List errorDamageDetail, List basketItems, List urgentTousseItems, - Map toussItemMap, JSONArray materialsJsonForSave) { + Map toussItemMap, JSONObject materialsJsonForSave) { TousseDefinition createInstanceTD; JSONArray materialArray = new JSONArray(); for(MaterialInstance mi : td.getMaterialInstances()){ @@ -3843,13 +3841,9 @@ obj.put("name", CssdUtils.getMaterialName(md)); obj.put("tousseType", "器械"); int count = 0; - if(materialsJsonForSave != null && materialsJsonForSave.size() > 0){ - for (int i = 0; i < materialsJsonForSave.size(); i++) { - JSONObject materialJson = (JSONObject) materialsJsonForSave.get(i); - if(md.getId() == materialJson.optInt("materialId")){ - count = materialJson.optInt("count"); - } - } + if(materialsJsonForSave != null){ + JSONObject materialObj = materialsJsonForSave.optJSONObject(md.getId().toString()); + count = materialObj.optInt("count"); }else{ count = mi.getCount(); } Index: ssts-recyclingrecord/src/main/java/com/forgon/disinfectsystem/recyclingrecord/vo/RecyclingContext.java =================================================================== diff -u -r26276 -r26282 --- ssts-recyclingrecord/src/main/java/com/forgon/disinfectsystem/recyclingrecord/vo/RecyclingContext.java (.../RecyclingContext.java) (revision 26276) +++ ssts-recyclingrecord/src/main/java/com/forgon/disinfectsystem/recyclingrecord/vo/RecyclingContext.java (.../RecyclingContext.java) (revision 26282) @@ -134,7 +134,7 @@ /** * jsonParam中的参数,修改的材料数量和相关数据(包定义id,材料定义id,材料数量) */ - private Map materialsMapForSave; + private JSONObject materialsJsonForSave; public String getJsonParam() { return jsonParam; @@ -262,7 +262,7 @@ // voluntarilyUrgentItems = jsonParamObject.optJSONArray("voluntarilyUrgentItems"); unrecycleTousseItemArray = jsonParamObject.optJSONArray("unrecycleTousseItemArray"); tousseIntoBasketInfo = jsonParamObject.optJSONArray("tousseIntoBasketInfo"); - materialsMapForSave = (Map)jsonParamObject.opt("materialsMapForSave"); + materialsJsonForSave = jsonParamObject.optJSONObject("materialsJsonForSave"); } } public JSONObject getJsonParamObject() { @@ -310,11 +310,11 @@ public void setNeedPrint(Boolean needPrint) { this.needPrint = needPrint; } - public Map getMaterialsMapForSave() { - return materialsMapForSave; + public JSONObject getMaterialsJsonForSave() { + return materialsJsonForSave; } - public void setMaterialsMapForSave(Map materialsMapForSave) { - this.materialsMapForSave = materialsMapForSave; + public void setMaterialsJsonForSave(JSONObject materialsJsonForSave) { + this.materialsJsonForSave = materialsJsonForSave; } }