Index: ssts-recyclingrecord/src/main/java/com/forgon/disinfectsystem/recyclingrecord/vo/RecyclingContext.java =================================================================== diff -u -r22974 -r23239 --- ssts-recyclingrecord/src/main/java/com/forgon/disinfectsystem/recyclingrecord/vo/RecyclingContext.java (.../RecyclingContext.java) (revision 22974) +++ ssts-recyclingrecord/src/main/java/com/forgon/disinfectsystem/recyclingrecord/vo/RecyclingContext.java (.../RecyclingContext.java) (revision 23239) @@ -31,6 +31,10 @@ */ private String recyclingApplicationId; /** + * 申请单的版本号 + */ + private Integer invoicePlanVersion; + /** * 回收科室编码 */ private String departCode; @@ -122,6 +126,12 @@ public void setRecyclingApplicationId(String recyclingApplicationId) { this.recyclingApplicationId = recyclingApplicationId; } + public Integer getInvoicePlanVersion() { + return invoicePlanVersion; + } + public void setInvoicePlanVersion(Integer invoicePlanVersion) { + this.invoicePlanVersion = invoicePlanVersion; + } public String getDepartCode() { return departCode; } Index: ssts-web/src/main/webapp/disinfectsystem/touchScreen/recycle/recycleForTouchScreen.js =================================================================== diff -u -r22988 -r23239 --- ssts-web/src/main/webapp/disinfectsystem/touchScreen/recycle/recycleForTouchScreen.js (.../recycleForTouchScreen.js) (revision 22988) +++ ssts-web/src/main/webapp/disinfectsystem/touchScreen/recycle/recycleForTouchScreen.js (.../recycleForTouchScreen.js) (revision 23239) @@ -77,20 +77,24 @@ //高亮层不锁定 function lockout(e){ e.stopPropagation(); } -function alertDiv(alertWord,hideCloseButton,showOtherButton){ +function alertDiv(alertWord,hideCloseButton,showOtherButton,showRefreshButton){ lock = true; document.getElementById ("showWord").innerHTML = alertWord; if(typeof(hideCloseButton) != 'undefined' && hideCloseButton){ $('#idBoxClose').hide(); - } - else{ + }else{ $('#idBoxClose').show(); } if(showOtherButton){ $('#idBoxCenterUserType').show(); }else{ $('#idBoxCenterUserType').hide(); } + if(showRefreshButton){ + $('#idBoxCenterRefresh').show(); + }else{ + $('#idBoxCenterRefresh').hide(); + } ab = new AlertBox("idBox"); ab.onShow = function(){ if ( lock ) { @@ -112,7 +116,13 @@ function closeDiv(){ ab.close(); } - +/** + * 刷新当前页面 + * @returns + */ +function refresh(){ + location.reload(); +} var applicationType = null; var userNameByBarcode = "";//条形码对应的用户名 @@ -2764,6 +2774,7 @@ jsonParam : "" + jsonStr + "", id : id, recyclingApplicationId : app_id, + invoicePlanVersion : $("#invoicePlanVersion").val(), departCode : departCode, recyclingUser : recyclingUser, operator : operator, @@ -2796,7 +2807,12 @@ location.href = "awaitForRecycleList.jsp?resolution=" + resolution + "&voluntarilyUrgentItems=" + voluntarilyUrgentItemsString; } }else{ - alertDiv(result.message); + if(result.versionNotMatch){ + alertDiv(result.message,true,false,true); + }else{ + alertDiv(result.message); + } + } }, error: function(x, t, m) { @@ -3401,7 +3417,7 @@ $("#depart").val(application.depart); $("#departCode").val(application.departCoding); } - + $("#invoicePlanVersion").val(application.version); $("#appType").val(application.type); $("#applyTime").val(application.submitTime); $("#remarkText").text($("#remarkText").html() + (application.remark == null ? "" : application.remark)); @@ -3622,6 +3638,7 @@ var application = record.recyclingApplication; if(application != null){ $("#recyclingApplicationId").val(application.id); + $("#invoicePlanVersion").val(application.version); var recordType = application.type; if(recordType == '自定义器械包申请单'){ $('#add-bao').hide(); Index: ssts-recyclingrecord/src/main/java/com/forgon/disinfectsystem/recyclingrecord/vo/ExpressRecyclingVo.java =================================================================== diff -u -r20064 -r23239 --- ssts-recyclingrecord/src/main/java/com/forgon/disinfectsystem/recyclingrecord/vo/ExpressRecyclingVo.java (.../ExpressRecyclingVo.java) (revision 20064) +++ ssts-recyclingrecord/src/main/java/com/forgon/disinfectsystem/recyclingrecord/vo/ExpressRecyclingVo.java (.../ExpressRecyclingVo.java) (revision 23239) @@ -11,6 +11,11 @@ private Long applicationId; + /** + * 申请单的版本号 + */ + private Integer invoicePlanVersion; + private String depart; private String departCoding; @@ -155,4 +160,11 @@ this.tousseGroupId = tousseGroupId; } + public Integer getInvoicePlanVersion() { + return invoicePlanVersion; + } + + public void setInvoicePlanVersion(Integer invoicePlanVersion) { + this.invoicePlanVersion = invoicePlanVersion; + } } Index: ssts-web/src/main/webapp/disinfectsystem/touchScreen/recycle/expressRecycleForTouchScreen.jsp =================================================================== diff -u -r22996 -r23239 --- ssts-web/src/main/webapp/disinfectsystem/touchScreen/recycle/expressRecycleForTouchScreen.jsp (.../expressRecycleForTouchScreen.jsp) (revision 22996) +++ ssts-web/src/main/webapp/disinfectsystem/touchScreen/recycle/expressRecycleForTouchScreen.jsp (.../expressRecycleForTouchScreen.jsp) (revision 23239) @@ -119,6 +119,9 @@
+
+ +
@@ -226,7 +229,7 @@ //高亮层不锁定 function lockout(e){ e.stopPropagation(); } -function alertDiv(alertWord, hideCloseButton){ +function alertDiv(alertWord, hideCloseButton,showRefreshButton){ lock = true; document.getElementById ("showWord").innerHTML = alertWord; if(typeof(hideCloseButton) != 'undefined' && hideCloseButton){ @@ -237,7 +240,14 @@ $('#idBoxClose').show(); $("#progressbar").hide(); } - + if(showRefreshButton){ + $('#idBoxCenterRefresh').show(); + //显示刷新按钮就不要滚动条了 + $("#progressbar").hide(); + }else{ + //滚动条由上面逻辑去显示或者隐藏 + $('#idBoxCenterRefresh').hide(); + } ab = new AlertBox("idBox"); ab.onShow = function(){ if ( lock ) { @@ -604,7 +614,13 @@ function mergedBasket(){ return false; } - +/** + * 刷新当前页面 + * @returns + */ +function refresh(){ + location.reload(); +} function addBasketElement(msg){ var isBasketLoaded = false; var currentNode; @@ -699,7 +715,7 @@ return JSON.stringify(json); } -function getBasketItemJSON(ci_id,type,orgUnitName,tousseName,materialName,amount,tousseAmount,app_id,tousseDefinitionID,basketGroupBarcodes,putBasketMaxAmount){ +function getBasketItemJSON(ci_id,type,orgUnitName,tousseName,materialName,amount,tousseAmount,app_id,tousseDefinitionID,basketGroupBarcodes,putBasketMaxAmount,invoicePlanVersion){ var json = {}; json.classifiedItemId = ci_id; json.type = type; @@ -712,11 +728,12 @@ json.tousseDefinitionID = tousseDefinitionID; json.basketGroupBarcodes = basketGroupBarcodes; json.putBasketMaxAmount = putBasketMaxAmount; + json.invoicePlanVersion = invoicePlanVersion; return JSON.stringify(json); } //创建物品入筐 -function addBasketItemElement(ci_id,type,orgUnitName,tousseName,materialName,showName,amount,tousseAmount,basketBarcode,app_id,tousseDefinitionID,basketGroupBarcodes,putBasketMaxAmount){ +function addBasketItemElement(ci_id,type,orgUnitName,tousseName,materialName,showName,amount,tousseAmount,basketBarcode,app_id,tousseDefinitionID,basketGroupBarcodes,putBasketMaxAmount,invoicePlanVersion){ var isExist = false; var basketElement = $('dl[class="sed clearfix"]:eq(0)'); var basketHidenValue = $("#basketsUl li:first").find('input').val(); @@ -742,7 +759,7 @@ element += '
' + amount + '
'; element += '
删除
'; - var json = getBasketItemJSON(ci_id,type,orgUnitName,tousseName,materialName,amount,tousseAmount,app_id,tousseDefinitionID,basketGroupBarcodes,putBasketMaxAmount); + var json = getBasketItemJSON(ci_id,type,orgUnitName,tousseName,materialName,amount,tousseAmount,app_id,tousseDefinitionID,basketGroupBarcodes,putBasketMaxAmount,invoicePlanVersion); basketElement.prepend($(element)); basketElement.find("input:first").val(json); } @@ -765,6 +782,7 @@ var tousseDefinitionID = $('#tousseDefinitionID'+row).val(); var amount = parseInt($('#recycleAmount'+row).val(),10) - parseInt($('#loadedAmount'+row).val(),10); var app_id = $('#applicationId'+row).val(); + var invoicePlanVersion = $('#invoicePlanVersion'+row).val(); //回收数量扣减入筐操作 如果已经入筐就不能入筐,只能是手动从篮筐里面删除,因为程序不晓得从哪个篮筐里面扣减 var msg = ""; @@ -794,7 +812,7 @@ if(amount == 0){ alertDiv('没有可以放入篮筐的器械包。'); }else{ - var loadedAmount = tousseIntoBasketFunction(tousseDefinitionID,tousseName,amount,isCleanedEntirely,orgUnitName,app_id); + var loadedAmount = tousseIntoBasketFunction(tousseDefinitionID,tousseName,amount,isCleanedEntirely,orgUnitName,app_id,invoicePlanVersion); if(loadedAmount > 0){ $('#loadedAmount'+row).val(parseInt(loadedAmount,10)+parseInt($('#loadedAmount'+row).val(),10)); if(parseInt($('#loadedAmount'+row).val(),10) == parseInt($('#recycleAmount'+row).val(),10)){ @@ -829,7 +847,7 @@ } function addToussItem(row,tousseItemId,tousseName,applicationAmount,recycleAmount,loadedAmount,isApplyEntireTousse,isCleanedEntirely, - tousseType,isThereIdentificationCard,depart,applicationId,tousseDefinitionID,departGroupId,tousseGroupId){ + tousseType,isThereIdentificationCard,depart,applicationId,tousseDefinitionID,departGroupId,tousseGroupId,invoicePlanVersion){ var showTousseName = tousseName; var _index = tousseName.indexOf('_'); if (_index >= 0){ @@ -862,6 +880,7 @@ ''+ ''+ ''+ + ''+ ''+ depart + '' + ''+ @@ -891,7 +910,7 @@ var array = new Array(); -function addItem(array,app_id,itemJson){ +function addItem(array,app_id,itemJson,invoicePlanVersion){ var len = array.length; var isExist = false; for (var i = 0; i < len; i++) { @@ -909,6 +928,7 @@ array[len].app_id = app_id; array[len].errorDamageDetail = ""; array[len].confirmation = ""; + array[len].invoicePlanVersion = invoicePlanVersion; array[len].tousseJson = new Array(); array[len].tousseJson[0] = itemJson; } @@ -990,7 +1010,7 @@ obj.tousseAmountForMaterial = json.tousseAmount; obj.tousseDefinitionID = json.tousseDefinitionID; obj.basketGroupBarcodes = json.basketGroupBarcodes; - addItem(array,json.app_id,obj); + addItem(array,json.app_id,obj,json.invoicePlanVersion); } }); } @@ -1046,7 +1066,7 @@ return basketJsonArray; } -function tousseIntoBasketFunction(tousseDefinitionID,tousseName,recycleAmount,isCleanedEntirely,orgUnitName,app_id){ +function tousseIntoBasketFunction(tousseDefinitionID,tousseName,recycleAmount,isCleanedEntirely,orgUnitName,app_id,invoicePlanVersion){ var params = getScanedGoods(isCleanedEntirely); var loadedAmount = 0; DWREngine.setAsync(false); @@ -1063,10 +1083,10 @@ var materials = data.materials; for(var i = 0;i < materials.length;i++){ var item = materials[i]; - addBasketItemElement("",'材料',orgUnitName,tousseName,item.materialName,item.materialName,item.materialAmount,loadedAmount,item.basketBarcode,app_id,tousseDefinitionID,item.basketGroupBarcodes,item.putBasketMaxAmount); + addBasketItemElement("",'材料',orgUnitName,tousseName,item.materialName,item.materialName,item.materialAmount,loadedAmount,item.basketBarcode,app_id,tousseDefinitionID,item.basketGroupBarcodes,item.putBasketMaxAmount,invoicePlanVersion); } }else{ - addBasketItemElement("",'器械包',orgUnitName,tousseName,"",tousseName,loadedAmount,loadedAmount,"",app_id,tousseDefinitionID,"",data.putBasketMaxAmount); + addBasketItemElement("",'器械包',orgUnitName,tousseName,"",tousseName,loadedAmount,loadedAmount,"",app_id,tousseDefinitionID,"",data.putBasketMaxAmount,invoicePlanVersion); } } }); @@ -1081,7 +1101,12 @@ timeout : 300000, data : {params:"" + JSON.stringify(array[i]) + ""}, success : function(msg) { - updateProgressBar((i+1)); + var json = JSON.parse(msg); + if(json.versionNotMatch){ + alertDiv(json.message,true,true); + }else{ + updateProgressBar((i+1)); + } }, error: function(x, t, m) { if(t == "timeout") { @@ -1163,7 +1188,7 @@ addToussItem(i, '', msg[i].tousseName, msg[i].amount, recycleAmount, '',msg[i].isApplyEntireTousse, msg[i].isCleanedEntirely, msg[i].tousseType, '否', msg[i].depart, - msg[i].applicationId,msg[i].tousseDefinitionID,msg[i].departGroupId,msg[i].tousseGroupId); + msg[i].applicationId,msg[i].tousseDefinitionID,msg[i].departGroupId,msg[i].tousseGroupId,msg[i].invoicePlanVersion); } }, error : function() { Index: ssts-recyclingrecord/src/main/java/com/forgon/disinfectsystem/recyclingrecord/service/RecyclingRecordManagerImpl.java =================================================================== diff -u -r23121 -r23239 --- ssts-recyclingrecord/src/main/java/com/forgon/disinfectsystem/recyclingrecord/service/RecyclingRecordManagerImpl.java (.../RecyclingRecordManagerImpl.java) (revision 23121) +++ ssts-recyclingrecord/src/main/java/com/forgon/disinfectsystem/recyclingrecord/service/RecyclingRecordManagerImpl.java (.../RecyclingRecordManagerImpl.java) (revision 23239) @@ -90,6 +90,8 @@ import com.forgon.disinfectsystem.tousse.toussedefinition.service.TousseInstanceManager; import com.forgon.disinfectsystem.tousseitem.service.TousseItemManager; import com.forgon.disinfectsystem.toussetransition.service.TousseTransitionPlanManager; +import com.forgon.disinfectsystem.version.VersionNotMatchException; +import com.forgon.disinfectsystem.version.VersionOperators; import com.forgon.disinfectsystem.vo.RecyclingApplicationVo; import com.forgon.disinfectsystem.vo.TousseItemVo; import com.forgon.disinfectsystem.washTransition.service.IdCardMaterialErrorDamageManager; @@ -1159,6 +1161,9 @@ public void saveExpressRecycling(JSONObject params,String app_id) { InvoicePlan application = invoicePlanManager.getForUpdate(app_id); if (application != null) { + if(!VersionOperators.versionEquals(application, JSONUtil.optInteger(params, "invoicePlanVersion", null))){ + throw new VersionNotMatchException(application.getDescription()); + } RecyclingRecord recyclingRecord = getFirstForUpdate("recyclingApplication.id", application.getId()); if(recyclingRecord == null){ recyclingRecord = createRecyclingRecord(application); @@ -1207,6 +1212,11 @@ //锁住申请单 application = invoicePlanManager.getForUpdate(application.getId()); } + if(application != null){ + if(!VersionOperators.versionEquals(application, recyclingContext.getInvoicePlanVersion())){ + throw new VersionNotMatchException(application.getDescription()); + } + } recyclingRecord.setRecyclingApplication(application); recyclingRecord.setRecyclingUser(recyclingContext.getRecyclingUser()); recyclingRecord.setCommunicationUserCode(recyclingContext.getCommunicationUserCode()); Index: ssts-basedata/src/main/java/com/forgon/disinfectsystem/vo/RecyclingApplicationVo.java =================================================================== diff -u -r19103 -r23239 --- ssts-basedata/src/main/java/com/forgon/disinfectsystem/vo/RecyclingApplicationVo.java (.../RecyclingApplicationVo.java) (revision 19103) +++ ssts-basedata/src/main/java/com/forgon/disinfectsystem/vo/RecyclingApplicationVo.java (.../RecyclingApplicationVo.java) (revision 23239) @@ -54,6 +54,10 @@ * 是否已预回收 */ private Integer isPrepareRecycled = 0; + /** + * 版本号 + */ + private Integer version; public Long getId() { return id; @@ -214,5 +218,13 @@ public void setIsPrepareRecycled(Integer isPrepareRecycled) { this.isPrepareRecycled = isPrepareRecycled; } + + public Integer getVersion() { + return version; + } + + public void setVersion(Integer version) { + this.version = version; + } } Index: ssts-recyclingapplication/src/main/java/com/forgon/disinfectsystem/recyclingapplication/service/InvoicePlanManagerImpl.java =================================================================== diff -u -r23218 -r23239 --- ssts-recyclingapplication/src/main/java/com/forgon/disinfectsystem/recyclingapplication/service/InvoicePlanManagerImpl.java (.../InvoicePlanManagerImpl.java) (revision 23218) +++ ssts-recyclingapplication/src/main/java/com/forgon/disinfectsystem/recyclingapplication/service/InvoicePlanManagerImpl.java (.../InvoicePlanManagerImpl.java) (revision 23239) @@ -3154,6 +3154,7 @@ vo.setTousseBarcodes(invoicePlan.getTousseBarcodes()); vo.setIsPrepareRecycled(invoicePlan.getIsPrepareRecycled()); vo.setHandleDepart(invoicePlan.getHandleDepart()); + vo.setVersion(invoicePlan.getVersion()); if(invoicePlan.getSubmitTime() != null){ vo.setSubmitTime(Constants.SIMPLEDATEFORMAT_YYYYMMDDHHMM.format(invoicePlan.getSubmitTime())); } Index: ssts-web/src/main/webapp/disinfectsystem/touchScreen/recycle/recycleForTouchScreen.jsp =================================================================== diff -u -r22974 -r23239 --- ssts-web/src/main/webapp/disinfectsystem/touchScreen/recycle/recycleForTouchScreen.jsp (.../recycleForTouchScreen.jsp) (revision 22974) +++ ssts-web/src/main/webapp/disinfectsystem/touchScreen/recycle/recycleForTouchScreen.jsp (.../recycleForTouchScreen.jsp) (revision 23239) @@ -208,6 +208,9 @@ +
+ +
@@ -224,6 +227,7 @@ +
回收人  
Index: ssts-recyclingrecord/src/main/java/com/forgon/disinfectsystem/recyclingrecord/action/RecyclingRecordAction.java =================================================================== diff -u -r23121 -r23239 --- ssts-recyclingrecord/src/main/java/com/forgon/disinfectsystem/recyclingrecord/action/RecyclingRecordAction.java (.../RecyclingRecordAction.java) (revision 23121) +++ ssts-recyclingrecord/src/main/java/com/forgon/disinfectsystem/recyclingrecord/action/RecyclingRecordAction.java (.../RecyclingRecordAction.java) (revision 23239) @@ -104,6 +104,7 @@ import com.forgon.disinfectsystem.tousse.toussedefinition.service.TousseInstanceManager; import com.forgon.disinfectsystem.tousse.toussedefinition.service.TousseMaterialErrorDamageManager; import com.forgon.disinfectsystem.tousseitem.service.TousseItemManager; +import com.forgon.disinfectsystem.version.VersionNotMatchException; import com.forgon.disinfectsystem.washanddisinfectmanager.washanddisinfectrecord.service.WashAndDisinfectRecordManager; import com.forgon.exception.UnfinishedPackingTaskException; import com.forgon.exception.service.ExceptionHandler; @@ -527,18 +528,23 @@ public String saveExpressRecycling() { String paramsStr = StrutsParamUtils.getPraramValue("params", null); String msg = "保存成功!"; + boolean versionNotMatch = false; if(StringUtils.isNotBlank(paramsStr)){ JSONObject params = JSONObject.fromObject(paramsStr); String app_id = params.optString("app_id"); try { recyclingRecordManager .saveExpressRecycling(params,app_id); + }catch(VersionNotMatchException e){ + msg = exceptionHandler.handleException(e); + versionNotMatch = true; } catch (Exception e) { msg = exceptionHandler.handleException(e); } } - - StrutsResponseUtils.output(true, msg); + JSONObject json = JSONUtil.buildJsonObject(true, msg); + json.put("versionNotMatch", versionNotMatch); + StrutsResponseUtils.output(json); return null; } @@ -554,12 +560,17 @@ boolean success = true; JSONArray unfinishedPackingTask = null; String message = recyclingContext.getConfirmation() ? "确认成功" : "保存成功"; + boolean versionNotMatch = false; try { recyclingRecordManager.save(recyclingContext); } catch(UnfinishedPackingTaskException e){ success = false; message = exceptionHandler.handleException(e); unfinishedPackingTask = e.getWaitPackingTask(); + } catch(VersionNotMatchException e){ + success = false; + message = exceptionHandler.handleException(e); + versionNotMatch = true; } catch (Exception e){ success = false; message = exceptionHandler.handleException(e); @@ -569,6 +580,7 @@ session.setAttribute("sessionOperator",recyclingContext.getOperator()); JSONObject jsonObj = JSONUtil.buildJsonObject(success, message); + jsonObj.put("versionNotMatch", versionNotMatch); if(success){ jsonObj.put("recyclingPrintData", recyclingContext.getRecyclingPrintData()); } @@ -1239,6 +1251,7 @@ ExpressRecyclingVo vo = new ExpressRecyclingVo(); vo.setApplicationId(invoicePlan.getId()); vo.setDepart(invoicePlan.getDepart()); + vo.setInvoicePlanVersion(invoicePlan.getVersion()); vo.setApplicationTime(invoicePlan.getApplicationTime()); vo.setTousseName(item.getTousseName()); vo.setAmount(item.getAmount()); Index: forgon-core/src/main/java/com/forgon/disinfectsystem/version/VersionNotMatchException.java =================================================================== diff -u --- forgon-core/src/main/java/com/forgon/disinfectsystem/version/VersionNotMatchException.java (revision 0) +++ forgon-core/src/main/java/com/forgon/disinfectsystem/version/VersionNotMatchException.java (revision 23239) @@ -0,0 +1,17 @@ +package com.forgon.disinfectsystem.version; + +import com.forgon.exception.SystemException; + +/** + * 版本号不相同的异常 + * @author kzh + * + */ +public class VersionNotMatchException extends SystemException { + + private static final long serialVersionUID = 1903511822260920586L; + + public VersionNotMatchException(String message) { + super(message); + } +}