Index: ssts-packing/src/main/java/com/forgon/disinfectsystem/packing/action/PackingAction.java =================================================================== diff -u -r28111 -r28450 --- ssts-packing/src/main/java/com/forgon/disinfectsystem/packing/action/PackingAction.java (.../PackingAction.java) (revision 28111) +++ ssts-packing/src/main/java/com/forgon/disinfectsystem/packing/action/PackingAction.java (.../PackingAction.java) (revision 28450) @@ -612,23 +612,33 @@ Integer amount = StrutsParamUtils.getPraramValue("amount", 0); PackingTask packingTask = packingManager.get(idStr); Integer unPackAmount = packingTask.getUnPackAmount() - amount; - boolean missRow = StrutsParamUtils.getBoolPraramValue("missRow", true); - if(!missRow){//丢失行... + boolean notLossReport = StrutsParamUtils.getBoolPraramValue("notLossReport", true); + if(!notLossReport){//丢失报损行... String whereSql = String.format(" where po.packingTaskId=%s and tousseDefinitionId=%s ", idStr,tousseID); - MaterialErrorDamageDetail medd = (MaterialErrorDamageDetail)objectDao.getBySql(MaterialErrorDamageDetail.class.getSimpleName(), + List medds = objectDao.findBySql(MaterialErrorDamageDetail.class.getSimpleName(), whereSql); - if(medd != null){ + if(CollectionUtils.isNotEmpty(medds)){ TousseDefinition td = tousseDefinitionManager.get(tousseID); String tousseName = ""; if(td != null){ tousseName = td.getName(); } - medd.setStatus(1);//从装配任务处删除 - objectDao.update(medd); - String message = String.format("删除了有器械丢失的待装配记录,记录id:%s,物品名称:%s,包定义id:%s,数量:%s,丢失的器械:%s,器械材料定义id:%s,数量:1", - idStr,tousseName,tousseID,amount,medd.getMaterialName(),medd.getMaterialDefinitionId(),medd.getAmount()); - appLogManager.saveLog(AcegiHelper.getLoginUser(), Log.MODEL_PACKING, - Log.TYPE_DELETE, message); + for (MaterialErrorDamageDetail medd : medds) { + medd.setStatus(1);//从装配任务处删除 + objectDao.update(medd); + String msgType = null; + if(MaterialErrorDamageDetail.TYPE_ERROR.equals(medd.getType())){ + msgType = "丢失"; + }else if(MaterialErrorDamageDetail.TYPE_DAMAGE.equals(medd.getType())){ + msgType = "报损"; + }else{ + msgType = "未知的丢失或报损"; + } + String message = String.format("删除了有器械%s的待装配记录,记录id:%s,物品名称:%s,包定义id:%s,数量:%s,%s的器械:%s,器械材料定义id:%s,数量:%s", + msgType,idStr,tousseName,tousseID,medd.getAmount(),msgType,medd.getMaterialName(),medd.getMaterialDefinitionId(),medd.getAmount()*medd.getAmountPerTousse()); + appLogManager.saveLog(AcegiHelper.getLoginUser(), Log.MODEL_PACKING, + Log.TYPE_DELETE, message); + } } } if(unPackAmount <= 0){ Index: ssts-web/src/main/webapp/disinfectsystem/packing/packingView.js =================================================================== diff -u -r28425 -r28450 --- ssts-web/src/main/webapp/disinfectsystem/packing/packingView.js (.../packingView.js) (revision 28425) +++ ssts-web/src/main/webapp/disinfectsystem/packing/packingView.js (.../packingView.js) (revision 28450) @@ -744,7 +744,7 @@ } } } -deletePackingTask = function(ids,tousseID,amount,missRow) { +deletePackingTask = function(ids,tousseID,amount,notLossReport) { top.Ext4.MessageBox.confirm("请确认","是否删除所选择的待装配任务?", function(button, text) { if ("yes" == button){ @@ -754,7 +754,7 @@ ids : ids, tousseID:tousseID, amount:amount, - missRow:missRow + notLossReport:notLossReport },success : function(response, options) { var result = Ext4.decode(response.responseText); var success = result.success; @@ -1025,17 +1025,25 @@ var status = record.get('status'); var amount = record.get('amount'); var supplent = true; + var notLossReport = true; if(status == '待装配'){ var errors = record.get('errors'); for(var i = 0;i < errors.length ; i++) { if(errorTypeAdd != errors[i].errorType && ((errors[i].amount - errors[i].additionalAmount) != 0)) { supplent = false; + notLossReport = false; } } + if(notLossReport){ + var damages = record.get('damages'); + if(damages.length > 0){ + notLossReport = false; + } + } } if(!SSTS_PackingTask_Delete){ if(taskid != undefined && taskid != null){ - str += ""; + str += ""; } } if(status == '待装配'){