Index: ssts-web/src/main/webapp/disinfectsystem/packing/packingView.jsp =================================================================== diff -u -r14885 -r15003 --- ssts-web/src/main/webapp/disinfectsystem/packing/packingView.jsp (.../packingView.jsp) (revision 14885) +++ ssts-web/src/main/webapp/disinfectsystem/packing/packingView.jsp (.../packingView.jsp) (revision 15003) @@ -209,9 +209,9 @@ - - - + + + Index: ssts-sterile/src/main/java/com/forgon/disinfectsystem/sterilizationmanager/proxydisinfection/action/ProxyDisinfectionAction.java =================================================================== diff -u -r14169 -r15003 --- ssts-sterile/src/main/java/com/forgon/disinfectsystem/sterilizationmanager/proxydisinfection/action/ProxyDisinfectionAction.java (.../ProxyDisinfectionAction.java) (revision 14169) +++ ssts-sterile/src/main/java/com/forgon/disinfectsystem/sterilizationmanager/proxydisinfection/action/ProxyDisinfectionAction.java (.../ProxyDisinfectionAction.java) (revision 15003) @@ -4,7 +4,6 @@ import java.text.ParseException; import java.text.SimpleDateFormat; import java.util.ArrayList; -import java.util.Arrays; import java.util.Date; import java.util.HashMap; import java.util.List; @@ -24,6 +23,7 @@ import org.apache.struts2.convention.annotation.Namespace; import org.apache.struts2.convention.annotation.ParentPackage; +import com.forgon.Constants; import com.forgon.directory.acegi.tools.AcegiHelper; import com.forgon.directory.model.BarcodeDevice; import com.forgon.directory.model.OrgUnit; @@ -42,8 +42,11 @@ import com.forgon.serialnumber.model.SerialNum; import com.forgon.serialnumber.service.SerialNumManager; import com.forgon.tools.StrutsParamUtils; +import com.forgon.tools.StrutsResponseUtils; +import com.forgon.tools.db.DatabaseUtil; import com.forgon.tools.hibernate.ObjectDao; import com.forgon.tools.json.JsonPropertyFilter; +import com.forgon.tools.string.StringTools; import com.opensymphony.xwork2.ModelDriven; import com.opensymphony.xwork2.Preparable; @@ -166,6 +169,23 @@ } return null; } + /** + * 重新更新是否二次发货。由干预管理界面调用 + */ + public void updateResendout(){ + String id = StrutsParamUtils.getPraramValue("id", ""); + String resendout = StrutsParamUtils.getPraramValue("canResendout", null); + try{ + proxyDisinfectionManager.changeResendout(id, resendout); + StrutsResponseUtils.output(true,"修改成功"); + }catch(RuntimeException ex){ + ex.printStackTrace(); + StrutsResponseUtils.output(false, ex.getMessage()); + }catch(Exception ex){ + ex.printStackTrace(); + StrutsResponseUtils.output(false, "修改失败"); + } + } public void getDepartByBarcode() { String barcode = StrutsParamUtils.getPraramValue("barcode", ""); @@ -452,9 +472,14 @@ public void iniInfo() { String id = StrutsParamUtils.getPraramValue("id", ""); - if (StringUtils.isNotBlank(id) && !id.equals("0")) { - proxyDisinfection = proxyDisinfectionManager - .getProxyDisinfectionById(id); + String newInstance = StrutsParamUtils.getPraramValue("newInstance",Constants.STR_NO); + if (DatabaseUtil.isPoIdValid(id)) { + if(StringTools.equals(Constants.STR_YES, newInstance)){ + proxyDisinfection = new ProxyDisinfection(); + }else{ + proxyDisinfection = proxyDisinfectionManager + .getProxyDisinfectionById(id); + } } else { proxyDisinfection = new ProxyDisinfection(); } Index: ssts-web/src/main/webapp/disinfectsystem/interfere/interfereProxyDisinfectionView.js =================================================================== diff -u --- ssts-web/src/main/webapp/disinfectsystem/interfere/interfereProxyDisinfectionView.js (revision 0) +++ ssts-web/src/main/webapp/disinfectsystem/interfere/interfereProxyDisinfectionView.js (revision 15003) @@ -0,0 +1,987 @@ +var entityName = "代理灭菌"; +var grid; +//var editMode = true; + +function formatDateYear(v, p, record) { + try { + return Ext.util.Format.date(new Date(v.time), 'Y-m-d H:i'); + } catch (e) { + } +} + +function createNode(isParentNode,id,barcode,name,type,status){ + var node; + if(isParentNode){ + //创建父节点 + node = new top.Ext.tree.TreeNode({ + id:Ext.id(), + text:barcode, + cls:'master-task', + iconCls:'task-folder', + uiProvider:top.Ext.tree.ColumnNodeUI, + leaf:false, + expanded:true + }); + }else{ + //创建子节点 + node = new top.Ext.tree.TreeNode({ + id:Ext.id(), + text:barcode, + iconCls:'task', + uiProvider:top.Ext.tree.ColumnNodeUI, + leaf:true, + expanded:true + }); + } + //********************** 节点保存的属性值 ****************************// + node.attributes.id = id; + node.attributes.barcode = barcode; + node.attributes.name = name; + node.attributes.type = type; + node.attributes.operation=''; + node.attributes.status = status; + return node; +} + +var departJsonStore = new Ext.data.SimpleStore({ + fields : [ 'name','id' ], + url : WWWROOT + '/disinfectSystem/baseData/supplyRoomConfigAction!getAllOrgUnitName.do' +}); + +var loadFormData = function(grid) { + var records = grid.getSelectionModel().getSelections(); + if (records.length == 0) { + showResult("请选择要修改的灭菌记录!"); + return false; + } + if (records.length > 1) { + showResult("一次只能修改一个灭菌记录信息!"); + return false; + } + var id = records[0].data['id']; + addAndEditProxyDisinfection(id); +}; + +var rd = new Ext.data.JsonReader({ + fields : [ + {name : 'id'}, + {name : 'barcode'}, + {name : 'name'} + ] +}); + +//验证条码是否重复扫描 +function isBarcodeRepeat(barcode){ + var isRepeat = false; + if(barcode != null && barcode.length > 0){ + var rootNode = top.Ext.getCmp('proxyDisinfectionTree').getRootNode(); + rootNode.eachChild(function(pNode){ + if(pNode != null && pNode.attributes.type == '容器'){ + pNode.eachChild(function(tNode){ + if(tNode != null && tNode.attributes.barcode == barcode) { + isRepeat = true; + return false; + } + }); + } else if (pNode != null && pNode.attributes.type == '器械包') { + if(pNode.attributes.barcode == barcode) { + isRepeat = true; + return false; + } + } + }); + } + return isRepeat; +} + +function getBasketAndTousseInfo(){ + var rootNode = top.Ext.getCmp('proxyDisinfectionTree').getRootNode(); + var basketsArray = []; + var tousseIdsArray = []; + + var returnValue = null; + if(rootNode.item(0) == null){ + returnValue = '该代理灭菌单没有任何器械包,请扫描器械包条码。'; + return returnValue; + } + rootNode.eachChild(function(pNode){ + if(pNode.attributes.type == '器械包'){ + if(!pNode.hasChildNodes()){ + returnValue = '请将器械包装入'+pNode.attributes.name+',或者删除该篮筐。'; + } + var basket = {}; + basket.id = "" + pNode.attributes.id; + basket.basketBarcode = pNode.attributes.barcode; + basket.name = pNode.attributes.name; + + + var tousseInstanceIdsInsideBasket = []; + + var tousseItemsInfo = null; + pNode.eachChild(function(cNode){ + + tousseInstanceIdsInsideBasket.push("" + cNode.attributes.id); + }); + + basket.tousseInstanceIdStrs = tousseInstanceIdsInsideBasket; + + basketsArray.push(basket); + + }else{ + tousseIdsArray.push("" + pNode.attributes.id); + } + }); + top.Ext.getCmp('toussesInfo').setValue(JSON.stringify(tousseIdsArray)); + top.Ext.getCmp('basketsInfo').setValue(JSON.stringify(basketsArray)); + return returnValue; +} + +function addAndEditProxyDisinfection(id) { + + var resendoutStore = new Ext.data.SimpleStore( { + fields : ['value'], + data : [ ['是'],['否']] + }); + + var form = new top.Ext.FormPanel( { + id : 'proxyDisinfectionForm', + frame : true, + border : 0, + labelSeparator : ':', + bodyStyle : 'padding:5px 5px 0px 5px', + width : 400, + labelAlign:'right', + autoHeight : true, + autoScroll : true, + items : [{ + xtype:"fieldset", + layout:'column', + title :'基础信息', + autoHeight:true, + items:[{ + layout : 'column', + items : [{ + xtype : 'hidden', + name : 'id', + id : 'id' + },{ + xtype : 'hidden', + name : 'toussesInfo', + id : 'toussesInfo' + },{ + xtype : 'hidden', + name : 'basketsInfo', + id : 'basketsInfo' + },{ + xtype : 'hidden', + name : 'departCoding', + id : 'departCoding' + },{ + columnWidth : .5, + layout : 'form', + labelWidth : 70, + items : [{ + xtype : 'textfield', + fieldLabel : '操作员', + maxLength : '16', + id : 'applicant', + name : 'applicant', + value : $Id('userName').value, + cls : 'fieldReadOnlyNoRemove', + readOnly : true, + allowBlank : false, + anchor : '98%' + }] + },{ + id:'serialNum', + columnWidth : .5, + layout : 'form', + labelWidth : 90, + items : [{ + xtype : 'textfield', + fieldLabel : '流水号', + maxLength : '41', + id : 'serialNumber', + name : 'serialNumber', + allowBlank : true, + anchor : '98%', + readOnly:true, + cls:'fieldReadOnlyNoRemove' + }] + }, { + columnWidth : .5, + layout : 'form', + labelWidth : 70, + items : [{ + xtype : 'textfield', + fieldLabel : "申请科室", + editable : false, + name : "depart", + id : "depart", + anchor : '98%', + readOnly : true, + cls : 'fieldReadOnlyNoRemove', + allowBlank : false + }] + },{ + columnWidth : .5, + layout : 'form', + labelWidth : 90, + items : [{ + xtype : 'textfield', + fieldLabel : '器械包总数', + maxLength : '41', + id : 'totalAmountOfTousses', + name : 'totalAmountOfTousses', + allowBlank : true, + anchor : '98%', + value : '0', + readOnly : true, + cls:'fieldReadOnlyNoRemove' + }] + }, { + columnWidth : .5, + layout : 'form', + labelWidth : 70, + items : [{ + xtype : 'textfield', + fieldLabel : '申请时间', + id : 'applicationTime', + name : 'applicationTime', + allowBlank: false, + readOnly:true, + cls:'fieldReadOnlyNoRemove' + }] + },{ + columnWidth : .5, + layout : 'form', + labelWidth : 90, + items : [{ + xtype : 'combo', + fieldLabel : '是否二次发货', + id : 'canResendout', + name : 'canResendout', + valueField : 'value', + displayField : 'value', + store : resendoutStore, + forceSelection : true, + editable : false, + mode : 'local', + triggerAction : 'all', + anchor : '95%' + }] + }, { + columnWidth : 1, + layout : 'form', + labelWidth : 70, + items : [{ + xtype : 'textfield', + height : 45, + fieldLabel : '备注', + id : 'remark', + name : 'remark', + allowBlank : true, + readOnly:true, + cls:'fieldReadOnlyNoRemove', + anchor : '99%' + }] + }] + }] + },{ + xtype:"fieldset", + layout:'column', + title :entityName + '单明细', + autoHeight:true, + items:[{ + layout : 'form', + columnWidth : 1, + items :[ + new top.Ext.tree.ColumnTree({ + id : 'proxyDisinfectionTree', + width :660, + height : 340, + bodyStyle : 'border:1px solid #afd7af', + rootVisible:false, + autoScroll:true, + containerScroll : true, + columns:[ + {header:'条码',dataIndex:'barcode',width:150}, + {header:'名称',dataIndex:'name',width:300}, + {header:'状态',dataIndex:'status',width:100}, + {header:'id',dataIndex:'id',width:0,hidden:true}, + {header:'类型',dataIndex:'type',width:90} + ], + loader: new top.Ext.tree.TreeLoader({ + uiProviders:{'col': top.Ext.tree.ColumnNodeUI} + }), + root: new top.Ext.tree.AsyncTreeNode({ + text:'容器' + }), + tbar : [{ + xtype : 'hidden', + name : 'isDiposableGoods', + id : 'isDiposableGoods' + },{ + xtype : 'hidden', + name : 'diposableGoodsAmount', + id : 'diposableGoodsAmount' + },{ + xtype : 'textfield', + hidden : true, + id : 'basketBarcode', + name : 'basketBarcode' + },{ + xtype : 'textfield', + hidden : true, + id : 'reviewedBasketId', + name : 'reviewedBasketId' + }] + })] + }] + }], + buttonAlign :'center', + buttons : [{ + id :'saveBtn', + text : '保存', + disabled : SSTS_ProxyDisinfection_Update, + handler : function(){ + if(!form.getForm().isValid()){ + showResult('请正确填写表单各值'); + return false; + } + + // 开始:判断是否有器械包未入筐 + var rootNode = top.Ext.getCmp('proxyDisinfectionTree').getRootNode(); + + // 结束:判断是否有器械包未入筐 + + var confirmMessage = "是否确认修改"+entityName+"单信息?"; + top.Ext.MessageBox.confirm("请确认",confirmMessage,function(btn) { + if(btn=='yes') { +// var validation = getBasketAndTousseInfo(); +// if(validation!=null){ +// showResult(validation); +// return false; +// } + + var submitActionUrl = WWWROOT + '/disinfectSystem/proxyDisinfectionAction!updateResendout.do?'; + form.form.submit({ + url : submitActionUrl, + params: { + newInstance: '是' + }, + method : 'POST', + waitMsg : '正在保存数据,请稍候', + waitTitle : '提交表单', + success : function(form, action) { + var result = Ext.decode(action.response.responseText) + showResult(result.message); + if(result.success){ + window.close(); + grid.dwrReload(); + } + + }, + failure : function(form, action) { + var result = Ext.decode(action.response.responseText) + if(result && result.message){ + showResult(result.message); + } + } + }); + } + }); + } + },{ + text : '取消', + handler : function() { + window.close(); + } + }] + }); + + var window = new top.Ext.Window( { + id : 'recyclingApplicationWin', + layout : 'fit', + title : entityName + '单信息', + width : 720, + height : 620, + modal : true, + border : false, + plain : true, + items : [ form ] + }); + window.show(); + + if(id != 0){ + form.form.load( { + url : WWWROOT + '/disinfectSystem/proxyDisinfectionAction!loadProxyDisinfection.do', + method : 'GET', + waitMsg : '正在加载数据,请稍候', + success : function(form, action) { + top.Ext.getCmp('applicationTime').setValue(formatDateYear(action.result.data.applicationTime)); + var status = action.result.data.deliverStatus; +// editMode = action.result.editMode; +// if(status != '待发货' || editMode == false){ +// top.Ext.getCmp('saveBtn').disable(); +// } + var rootNode = top.Ext.getCmp('proxyDisinfectionTree').getRootNode(); + var instancesBarcodeInBasket = ';'; + for(var i = 0 ;i < action.result.baskets.length; i++){ + var basket = action.result.baskets[i]; + var basketNode = createNode(true,basket.id,basket.barcode,basket.name,'容器',''); + rootNode.appendChild(basketNode); + for(var j = 0 ; j < basket.instances.length ; j++){ + var instance = basket.instances[j]; + instancesBarcodeInBasket += instance.barcode + ';'; + var instanceNode = createNode(false,instance.id,instance.barcode,instance.name,'器械包',instance.status); + basketNode.appendChild(instanceNode); + } + } + + for(var i = 0 ;i < action.result.instances.length; i++){ + var instance = action.result.instances[i]; + if(instancesBarcodeInBasket.indexOf(';' + instance.barcode + ';') < 0){ + var instanceNode = createNode(false,instance.id,instance.barcode,instance.name,'器械包',instance.status); + rootNode.appendChild(instanceNode); + } + } + + }, + failure : function(form, action) { + }, + params : { + id : id + } + }); + } +} + +/** + * 修改记录 + * modifyRecord函数 触发modify函数调用,并传入当前列的值以及record.data对象 + * 页面中需要定义 modify(v,data) 函数 + */ +function modify(v,data){ + var records = grid.getSelectionModel().getSelections(); + var id = records[0].data['id']; + addAndEditProxyDisinfection(id); +} + +//发货单 +function searchInvoice(id){ + $Id('parm_s_recyclingApplicantID').value = id; + var rd = new Ext.data.JsonReader( { + fields : [{ + name : 'id' + },{ + name : 'barcode' + }, { + name : 'name' + }, { + name : 'count' + }, { + name : 'diposable' + },{ + name : 'price' + },{ + name : 'tempAmount' + },{ + name : 'amount' + },{ + name : 'applicationAmount' + }] + }); + + var invoiceColumns = [ { + header : "流水号", + width : 120, + dataIndex : 'serialNumber' + },{ + header : "申请科室", + width : 120, + hidden : true, + dataIndex : 'depart' + },{ + header : "发货员", + width : 70, + dataIndex : 'sender' + }, { + header : "发货时间", + width : 120, + dataIndex : 'sendTime', + renderer : myDateFormatByMinute + }, { + header : "状态", + width : 120, + dataIndex : 'status' + }, { + id : 'remark', + header : "备注", + width : 120, + hidden : true, + dataIndex : 'remark' + } ]; + + //申请的物品 + var recyclingapplicationStore = new Ext.data.Store({ + proxy : new Ext.data.HttpProxy({ + url : WWWROOT + '/disinfectSystem/invoiceAction!loadRecyclingApplicationByid.do', + method : 'POST' + }), + reader : rd + }); + + var recyclingapplicationCm = new Ext.grid.ColumnModel( [{ + id :'id', + dataIndex :'id', + hidden :true + },{ + header : "物品名称", + dataIndex : 'name', + width : 140, + sortable : true + }, { + header : "发货数量", + dataIndex : 'count', + width : 60 + },{ + header : '实发数量', + dataIndex : 'tempAmount', + width : 60, + value : 0, + hidden : true + },{ + id : 'diposable', + header : "是否一次性材料", + dataIndex : 'diposable' + }, { + id: 'amount', + header : '待发数量', + dataIndex : 'amount', + width : 100, + hidden : true + },{ + id :'applicationAmount', + header : "申请数量", + dataIndex : 'applicationAmount', + hidden : true, + width :150 + } ]); + var readerDetail2 = [ { + name : 'id' + },{ + name : 'serialNumber' + },{ + name : 'depart' + }, { + name : 'sender' + }, { + name : 'sendTime' + }, { + name : 'status' + }, { + name : 'remark' + } ]; + + var filters2 = new Ext.grid.GridFilters( { + filters : [{ + type : 'string', + dataIndex : 'sender' + },{ + type : 'date', + dataIndex : 'sendTime' + },{ + type : 'string', + dataIndex : 'remark' + }] + }); + + //发货单 + var invoiceGrid = new Ext.ux.ForgonPageGrid( { + tbar : null, + pageSize : 20, + defaultSortField : 'id', + defaultSortDirection : 'ASC', + isCheckboxSelectionModel : true, + rememberSelected : false, + isShowSearchField : false, + columns : invoiceColumns, + plugins : filters2, + autoExpandColumn : 'remark', + renderTo : 'gridDiv', + frame : false + }, readerDetail2, InvoiceTableManager.findInvoiceTableList, null); + + invoiceGrid.on('rowclick', function(grid, index) { + var record = grid.getSelectionModel().getSelected(); + var invoiceID = record.data.id; + invoiceFormPanel.form.load( { + url : WWWROOT + '/disinfectSystem/invoiceAction!loadInvoice.do', + method : 'GET', + waitMsg : '正在加载数据,请稍候', + success : function(form, action) { + Ext.getCmp('applicationTime').setValue(formatDateYear(action.result.data.applicationTime)); + Ext.getCmp('sendTime').setValue(formatDateYear(action.result.data.sendTime)); + Ext.getCmp('receiptingTime').setRawValue(formatDateYear(action.result.data.receiptingTime)); + var status = action.result.data.status; + if(status != '收货签收'){ + Ext.getCmp('receiptingTime').setValue(new Date()); + Ext.getCmp('receiptor').setValue(document.getElementById('userName').value); + } + if(status == '收货签收'){ + Ext.getCmp('saveBtn').disable(); + }else{ + Ext.getCmp('saveBtn').enable(); + } + }, + failure : function(form, action) { + }, + params : { + id : invoiceID + } + }); + + recyclingapplicationStore.on("beforeload", function(thiz, options) { + thiz.baseParams["id"] = invoiceID; + }); + recyclingapplicationStore.load(); + + + + }, this, { + buffer : 250 + }); + //发货单表单明细 + var invoiceFormPanel = new Ext.FormPanel( { + id : 'invoiceForm', + frame : true, + border : 0, + labelSeparator : ':', + bodyStyle : 'padding:5px 5px 0px 5px', + width : 400, + labelAlign:'left', + autoHeight : true, + autoScroll : true, + items : [{ + layout : 'column', + items :[{ + layout : 'form', + columnWidth : 0.5, + labelWidth : 60, + items :[{ + xtype : 'textfield', + fieldLabel : '流水号', + maxLength : '41', + id : 'serialNumber', + name : 'serialNumber', + readOnly:true, + anchor : '99%' + }] + },{ + layout : 'form', + columnWidth : 0.5, + labelWidth : 60, + items :[{ + xtype : 'textfield', + fieldLabel : '操作员', + maxLength : '41', + id : 'applicant', + name : 'applicant', + readOnly:true, + anchor : '99%' + }] + },{ + layout : 'form', + columnWidth : 0.5, + labelWidth : 60, + items :[{ + xtype : 'textfield', + fieldLabel : '申请科室', + maxLength : '100', + id : 'depart', + name : 'depart', + readOnly:true, + anchor : '99%' + }] + },{ + layout : 'form', + columnWidth : 0.5, + labelWidth : 60, + items :[{ + xtype : 'textfield', + fieldLabel : '申请时间', + id : 'applicationTime', + name : 'applicationTime', + readOnly:true, + format : 'Y-m-d', + anchor : '99%' + }] + },{ + layout : 'form', + columnWidth : 0.5, + labelWidth :60, + items : [{ + xtype : 'textfield', + fieldLabel : '发货时间', + id : 'sendTime', + name : 'sendTime', + editable : false, + format : 'Y-m-d', + anchor : '99%', + readOnly : true + }] + },{ + layout : 'form', + columnWidth : 0.5, + labelWidth :60, + items : [{ + xtype : 'textfield', + fieldLabel : '发货员', + maxLength : '16', + id : 'sender', + name : 'sender', + anchor : '99%', + readOnly : true + }] + },{ + layout : 'form', + columnWidth : 1, + labelWidth :60, + items : [{ + xtype : 'textfield', + fieldLabel : '备注', + id : 'remark', + name : 'remark', + anchor : '99%', + height : 40, + readOnly : true + }] + },{ + layout : 'form', + columnWidth : 0.5, + labelWidth :60, + items : [{ + xtype : 'textfield', + fieldLabel : '签收人', + maxLength : '16', + id : 'receiptor', + name : 'receiptor', + readOnly : true, + anchor : '99%' + }] + },{ + layout : 'form', + columnWidth : 0.5, + labelWidth :60, + items : [{ + xtype : 'datefield', + fieldLabel : '签收时间', + id : 'receiptingTime', + name : 'receiptingTime', + editable : false, + format : 'Y-m-d', + readOnly : true, + anchor : '99%' + }] + },{ + layout : 'form', + columnWidth : 1, + labelWidth :50, + items : [new Ext.grid.EditorGridPanel({ + id : 'recyclingGrid1', + title : '发货单', + store : recyclingapplicationStore, + cm : recyclingapplicationCm, + width : '100%', + height : 250, + autoExpandColumn : 'diposable', + frame : false, + bodyStyle : 'border:1px solid #afd7af', + clicksToEdit:1, + selModel : new Ext.grid.RowSelectionModel({ + singleSelect : false + }) + }) + ] + }] + }], + buttons : [{ + id : 'saveBtn', + text : '签收保存', + handler : function() { + var receiptor = Ext.getCmp('receiptor').getValue(); + var receiptingTime = Ext.getCmp('receiptingTime').getValue(); + var record = invoiceGrid.getSelectionModel().getSelected(); + var invoiceId = record==null?null:record.data.id; + if(invoiceId != null){ + DWREngine.setAsync(false); + InvoiceTableManager.updateInvoiceStatus(invoiceId,function(){ + /*invoiceGrid.dwrReload(); + grid.getStore().reload(); + MsgTip.msg('提示', '签收保存成功!',true,3); + this.disable();*/ + }); + invoiceGrid.dwrReload(); + grid.getStore().reload(); + MsgTip.msg('提示', '签收保存成功!',true,3); + this.disable(); + DWREngine.setAsync(true); + }else{ + showResult("请选择待签收的发货单!"); + } + } + }] + }); + + var invoiceWindow = new Ext.Window({ + id : 'invoiceWin', + layout : 'border', + title : '发货单列表', + width : 850, + autoHeight : false, + border : false, + height:480, + plain : true, + modal :true, + items : [{ + region:'west', + width: '55%', + items:[invoiceGrid] + },{ + region:'center' + },{ + region:'east', + width: '45%', + layout :'fit', + items:[invoiceFormPanel] + }] + }); + invoiceWindow.show(); +} + +Ext.onReady(function() { + Ext.QuickTips.init(); + + var columns = [ + {header : "操作员",width : 120,dataIndex : 'applicant', renderer : modifyRecord}, + {header : "申请时间",width : 120,dataIndex : 'applicationTime',renderer : myDateFormatByMinute}, + {header : "申请部门",width : 120,dataIndex : 'depart'}, + {header : "器械包总数",width : 100,dataIndex : 'totalAmountOfTousses'}, + {header : "状态",width : 80,dataIndex : 'deliverStatus'}, + {header:'查看发货单',align :'center',renderer: function(v,p,record){ + var status = record.data.deliverStatus; + if(status == '已发货'){ + var str = ""; + return str; + }else if(status == '部分发货'){ + var str = ""; + return str; + }else{ + var str = null; + return str; + } + }}, + {id :'remark',header : "备注",width : 120,dataIndex : 'remark'} + ]; + + var readerDetail = [ + {name : 'id'}, + {name : 'applicant'}, + {name : 'applicationTime'}, + {name : 'depart'}, + {name : 'totalAmountOfTousses'}, + {name : 'remark'}, + {name : 'deliverStatus'} + ]; + + var filters = new Ext.grid.GridFilters({ + filters : [ + {type : 'string',dataIndex : 'applicant'}, + {type : 'string',dataIndex : 'deliverStatus'}, + {type : 'string',dataIndex : 'depart'}, + {type : 'numeric',dataIndex : 'totalAmountOfTousses'}, + {type : 'string',dataIndex : 'remark'}, + {type : 'date',dataIndex : 'applicationTime'} + ] + }); + + var tbar = [{}, '-', { + text : '修改', + hidden : SSTS_ProxyDisinfection_Update, + iconCls : 'btn_ext_application_edit', + id : 'editTbar', + handler : function(){ + var records = grid.getSelectionModel().getSelections(); + id = records[0].data['id']; + addAndEditProxyDisinfection(id); + } + }, '-', {}, '-', {}]; + + Ext.ux.ForgonPageGrid.prototype.getGridParameterMap = function() {}; + + grid = new Ext.ux.ForgonPageGrid( { + title : '代理灭菌列表', + tbar : tbar, + pageSize : 20, + defaultSortField : 'applicationTime', + defaultSortDirection : 'DESC', + isCheckboxSelectionModel : true, + rememberSelected : false, + isShowSearchField : true, + columns : columns, + plugins : filters, + autoExpandColumn : 'remark', + renderTo : 'gridDiv', + frame : false + }, readerDetail, + ProxyDisinfectionTableManager.findProxyDisinfectionTableList, + null // 这个参数只是占位作用 + ); + + grid.on('mouseover', function(e) { + var index = grid.getView().findRowIndex(e.getTarget()); + if (index !== false) { + var record = this.getStore().getAt(index); + var tableContent = record.data['htmlContent']; + if(!tableContent){ + var content = ""; + DWREngine.setAsync(false); + ProxyDisinfectionTableManager.getProxyDisinfectionItems(record.data['id'],function(jsonAarry){ + var result = Ext.decode(jsonAarry); + for (var i = 1; i <= result.length; i++) { + var tousseName = result[i-1].tousseName; + var amount = result[i-1].amount; + if(i % 2 != 0){ + content += ""; + } + content += " " + tousseName +"" + amount+""; + if(i % 2 == 0){ + content += ""; + } + } + if(result.length % 2 != 0){ + content += "  "; + } + }); + DWREngine.setAsync(true); + } + tableContent = (""); + tableContent += (""); + tableContent += ("" + content + "

物品名称

数量

物品名称

数量


"); + var rowEl = Ext.fly(e.getTarget()); + rowEl.set({'ext:qtip' : tableContent,'ext:qwidth':500,'ext:qwidth':500,'ext:qtitle':" 申请物品列表:"}, false); + } + }); + + var viewport = new Ext.Viewport({ + layout : 'border', + items : [{ + region : 'center', + margins : '0 0 0 0', + layout : 'fit', + items : grid + }] + }); + +}); \ No newline at end of file Index: ssts-tousse/src/main/java/com/forgon/disinfectsystem/tousse/toussedefinition/service/TousseInstanceManager.java =================================================================== diff -u -r14956 -r15003 --- ssts-tousse/src/main/java/com/forgon/disinfectsystem/tousse/toussedefinition/service/TousseInstanceManager.java (.../TousseInstanceManager.java) (revision 14956) +++ ssts-tousse/src/main/java/com/forgon/disinfectsystem/tousse/toussedefinition/service/TousseInstanceManager.java (.../TousseInstanceManager.java) (revision 15003) @@ -258,5 +258,22 @@ public JSONObject buildTousseInstanceSuccessJson(String returnType, TousseInstance tousseInstance); - + /** + * 修改器械包的状态,并记录日志 + * @param tousseInstance 待修改的器械包实例 + * @param status 新的器械包状态 + * @param model 日志的模块名称 + * @param type 日志的操作类型 + * @param description 日志的描述信息 + */ + public void updateStatus(TousseInstance tousseInstance, String status,String model,String type,String description); + /** + * 修改器械包的状态,并记录更新日志 + * @param tousseInstance 待修改的器械包实例 + * @param status 新的器械包状态 + * @param model 日志的模块名称 + * @param type 日志的操作类型 + * @param description 日志的描述信息 + */ + public void updateStatus(TousseInstance tousseInstance, String status,String model); } Index: ssts-web/src/main/webapp/homepage/menuconfigure.js =================================================================== diff -u -r14967 -r15003 --- ssts-web/src/main/webapp/homepage/menuconfigure.js (.../menuconfigure.js) (revision 14967) +++ ssts-web/src/main/webapp/homepage/menuconfigure.js (.../menuconfigure.js) (revision 15003) @@ -347,6 +347,7 @@ ] }, {hidden :SSTS_InterfereSterilizationRecord_ViewMenu,text:"灭菌记录干预管理",href:WWWROOT+'/disinfectsystem/interfere/interfereSterilizationView.jsp',hrefTarget:linkTarget,leaf:true}, + {hidden :SSTS_InterfereSterilizationRecord_ViewMenu,text:"代理灭菌单干预管理",href:WWWROOT+'/disinfectsystem/interfere/interfereProxyDisinfectionView.jsp',hrefTarget:linkTarget,leaf:true}, {hidden :SSTS_InterfereRecyclingApplication_ViewMenu,text:"申请单干预管理",href:WWWROOT+'/disinfectsystem/interfere/interfereGoodsApplicationView.jsp',hrefTarget:linkTarget,leaf:true}, {hidden :SSTS_InterfereForeigntousseApplication_ViewMenu,text:"外来器械干预管理",href:WWWROOT+'/disinfectsystem/interfere/interfereForeignTousseApplicationView.jsp',hrefTarget:linkTarget,leaf:true} ] Index: ssts-web/src/main/webapp/disinfectsystem/interfere/interfereProxyDisinfectionView.jsp =================================================================== diff -u --- ssts-web/src/main/webapp/disinfectsystem/interfere/interfereProxyDisinfectionView.jsp (revision 0) +++ ssts-web/src/main/webapp/disinfectsystem/interfere/interfereProxyDisinfectionView.jsp (revision 15003) @@ -0,0 +1,54 @@ +<%@ page contentType="text/html; charset=UTF-8"%> +<%@ include file="/common/taglibs.jsp"%> +<% + request.setAttribute("userName",AcegiHelper.getLoginUser().getUserFullName()); +%> + + + +代理灭菌单干预管理 + + +<%@ include file="/common/includeExtJsAndCss.jsp"%> + + + + + + + + + + + + + +
+ +
+ + + + + + +
+
+
+ + \ No newline at end of file Index: ssts-sterile/src/main/java/com/forgon/disinfectsystem/sterilizationmanager/proxydisinfection/service/ProxyDisinfectionManager.java =================================================================== diff -u -r12331 -r15003 --- ssts-sterile/src/main/java/com/forgon/disinfectsystem/sterilizationmanager/proxydisinfection/service/ProxyDisinfectionManager.java (.../ProxyDisinfectionManager.java) (revision 12331) +++ ssts-sterile/src/main/java/com/forgon/disinfectsystem/sterilizationmanager/proxydisinfection/service/ProxyDisinfectionManager.java (.../ProxyDisinfectionManager.java) (revision 15003) @@ -34,4 +34,11 @@ public void endProxyDisinfectionById(String[] str); public List getProxyDisinfectionBySql(String dateSql); + + /** + * 重新修改代理灭菌单的是否二次发货的值。由干预管理调用 + * @param proxyDisinfectionId 代理灭菌单的id,可能为无效值 + * @param resendout 是否二次发货的新的值,可能是无效值(不是"是",也不是"否")。此处的处理,这个值只能是"是"或者是"否",否则都会抛出异常 + */ + public void changeResendout(String proxyDisinfectionId,String resendout); } Index: ssts-sterile/src/main/java/com/forgon/disinfectsystem/sterilizationmanager/proxydisinfection/service/ProxyDisinfectionManagerImpl.java =================================================================== diff -u -r14996 -r15003 --- ssts-sterile/src/main/java/com/forgon/disinfectsystem/sterilizationmanager/proxydisinfection/service/ProxyDisinfectionManagerImpl.java (.../ProxyDisinfectionManagerImpl.java) (revision 14996) +++ ssts-sterile/src/main/java/com/forgon/disinfectsystem/sterilizationmanager/proxydisinfection/service/ProxyDisinfectionManagerImpl.java (.../ProxyDisinfectionManagerImpl.java) (revision 15003) @@ -10,30 +10,34 @@ import java.util.List; import java.util.Map; import java.util.Set; - import net.sf.json.JSONArray; import net.sf.json.JSONObject; +import org.apache.commons.collections4.CollectionUtils; import org.apache.commons.lang.ArrayUtils; import org.apache.commons.lang.StringUtils; import org.hibernate.Query; +import com.forgon.Constants; import com.forgon.directory.acegi.tools.AcegiHelper; import com.forgon.disinfectsystem.basedatamanager.container.service.ReviewedBasketManager; import com.forgon.disinfectsystem.basedatamanager.supplyroomconfig.service.SupplyRoomConfigManager; +import com.forgon.disinfectsystem.basedatamanager.warehouse.service.WareHouseManager; import com.forgon.disinfectsystem.entity.basedatamanager.supplyroomconfig.SupplyRoomConfig; import com.forgon.disinfectsystem.entity.basedatamanager.toussedefinition.TousseDefinition; import com.forgon.disinfectsystem.entity.basedatamanager.toussedefinition.TousseInstance; -import com.forgon.disinfectsystem.entity.invoicemanager.InvoicePlan; import com.forgon.disinfectsystem.entity.packing.ReviewedBasket; import com.forgon.disinfectsystem.entity.sterilizationmanager.proxydisinfection.ProxyDisinfection; import com.forgon.disinfectsystem.entity.tousseitem.TousseItem; import com.forgon.disinfectsystem.recyclingapplication.service.InvoicePlanManager; import com.forgon.disinfectsystem.tousse.toussedefinition.service.TousseInstanceManager; +import com.forgon.log.model.Log; +import com.forgon.log.service.LogManager; import com.forgon.tools.GB2Alpha; import com.forgon.tools.GB2WB; import com.forgon.tools.db.DatabaseUtil; import com.forgon.tools.hibernate.ObjectDao; +import com.forgon.tools.string.StringTools; /** * @author WangYi @@ -51,6 +55,10 @@ private InvoicePlanManager invoicePlanManager; + private WareHouseManager wareHouseManager; + + private LogManager appLogManager; + public void setInvoicePlanManager(InvoicePlanManager invoicePlanManager) { this.invoicePlanManager = invoicePlanManager; } @@ -78,6 +86,14 @@ objectDao.delete(proxyDisinfection); } + public void setWareHouseManager(WareHouseManager wareHouseManager) { + this.wareHouseManager = wareHouseManager; + } + + public void setAppLogManager(LogManager appLogManager) { + this.appLogManager = appLogManager; + } + @Override public void deleteProxyDisinfectionById(String id) { @@ -125,6 +141,32 @@ } } + /** + * 获取代理灭菌单关联的器械包实例,包括已入筐的器械包和未入筐的器械包 + * @param proxyDisinfection 代理灭菌单 + * @return 器械包实例的集合,非null,可能为空 + */ + private Set getTousseInstance(ProxyDisinfection proxyDisinfection){ + Set ret = new HashSet(); + if(proxyDisinfection != null){ + List tousses = proxyDisinfection.getProxyTousses(objectDao); + if(CollectionUtils.isNotEmpty(tousses)){ + ret.addAll(tousses); + } + for (ReviewedBasket basket : proxyDisinfection.getReviewedBaskets()) { + Set basketTousses = basket.getTousseInstances(objectDao); + if(CollectionUtils.isNotEmpty(basketTousses)){ + for(TousseInstance ti : basketTousses){ + Long proxyDisinfection_id = ti.getProxyDisinfection_id(); + if (proxyDisinfection_id != null && proxyDisinfection_id.equals(proxyDisinfection.getId())){ + ret.add(ti); + } + } + } + } + } + return ret; + } private Set getTousseInstanceAndReviewedBasketInfo( ProxyDisinfection proxyDisinfection, String[] tousseInstanceIdStrs, JSONArray basketInfos,String loginUserName,String loginUserCode) { @@ -441,4 +483,102 @@ } + @Override + public void changeResendout(String proxyDisinfectionId, + String resendout) { + if(!DatabaseUtil.isPoIdValid(proxyDisinfectionId)){ + throw new RuntimeException("代理灭菌单的id非法"); + } + if(!StringTools.equals(Constants.STR_YES,resendout) && !StringTools.equals(Constants.STR_NO, resendout)){ + throw new RuntimeException("是否二次发货的值只能为是或者否"); + } + ProxyDisinfection proxyDisinfection = getProxyDisinfectionById(proxyDisinfectionId); + if(proxyDisinfection == null){ + throw new RuntimeException(String.format("没有找到id为%s的代理灭菌单,可能已经被删除",proxyDisinfectionId)); + } + if(StringTools.equals(proxyDisinfection.getCanResendout(), resendout)){ + throw new RuntimeException("是否二次发货的值没有修改,或者已经被其他人修改了,此次操作未做修改"); + } + Set allTousses = getTousseInstance(proxyDisinfection); + //申请科室的仓库id集合 + List applyWareHouseIds = wareHouseManager.getWareHouseIdsByUnitCode(proxyDisinfection.getDepartCoding()); + //处理科室的仓库id集合 + List handleWareHouseIds = wareHouseManager.getWareHouseIdsByUnitCode(proxyDisinfection.getHandleDepartCoding()); + + if(proxyDisinfection.resendout()){ + //原来的值为是,需要修改为否.此时,如果包实例的状态全部都为已灭菌或者是已消毒,才可以修改 + for(TousseInstance ti : allTousses){ + if(!ti.isDisinfected() && !ti.isSteriled()){ + throw new RuntimeException("代理灭菌单中的器械包状态只能是已灭菌或者已消毒才能修改为非二次发货," + ti.getTousseName() + "的状态为" + ti.getStatus()); + } + if(CollectionUtils.isNotEmpty(applyWareHouseIds) && applyWareHouseIds.contains(ti.getWareHouseId())){ + //器械包在申请科室,说明处理科室已经发货给申请科室,此时需要将包实例的状态设置为已发货,申请科室就可以使用了 + //至于发货人、发货时间那些信息,在代理灭菌单发货的时候已经设置了,这里不修改,也不用考虑 + tousseInstanceManager.updateStatus(ti, TousseInstance.STATUS_SHIPPED, Log.MODEL_INTERFERE); + }else if(CollectionUtils.isNotEmpty(handleWareHouseIds) && handleWareHouseIds.contains(ti.getWareHouseId())){ + //器械包在处理科室,说明处理科室还未发货给申请科室,此时,器械包保持已灭菌或者已消毒状态,不需要处理 + }else{ + throw new RuntimeException(ti.getTousseName() + "既不在申请科室,也不在处理科室,不能修改"); + } + } + updateCanResendout(proxyDisinfection,Constants.STR_NO,Log.MODEL_INTERFERE); + }else{ + //原来的值为否,需要修改为是,此时需要考虑,如果包实例还在处理科室,可以不处理,如果包实例在申请科室,此时,包状态就已经是已发货了,需要修改为已灭菌或者是已消毒,从而可以二次发货 + for(TousseInstance ti : allTousses){ + if(CollectionUtils.isNotEmpty(applyWareHouseIds) && applyWareHouseIds.contains(ti.getWareHouseId())){ + //在申请科室,此时只能是已发货状态或者是已签收状态才能修改 + if(!ti.isShipped() && !ti.isSigned()){ + throw new RuntimeException("在申请科室的器械包,只有已发货或者是已签收状态的器械包才能修改为二次发货," + ti.getTousseName() + "的状态为" + ti.getStatus()); + } + if(ti.getTousseDefinition().isDisinfection()){ + tousseInstanceManager.updateStatus(ti, TousseInstance.STATUS_DISINFECTED, Log.MODEL_INTERFERE); + }else{ + tousseInstanceManager.updateStatus(ti, TousseInstance.STATUS_STERILED, Log.MODEL_INTERFERE); + } + }else if(CollectionUtils.isNotEmpty(handleWareHouseIds) && handleWareHouseIds.contains(ti.getWareHouseId())){ + //器械包在处理科室,说明处理科室还未发货给申请科室,此时,器械包保持已灭菌或者已消毒状态,不需要处理 + }else{ + throw new RuntimeException(ti.getTousseName() + "既不在申请科室,也不在处理科室,不能修改"); + } + } + updateCanResendout(proxyDisinfection,Constants.STR_YES,Log.MODEL_INTERFERE); + } + } + /** + * 更新是否二次发货的值,并记录日志 + * @param proxyDisinfection + * @param resendout + */ + private void updateCanResendout(ProxyDisinfection proxyDisinfection,String resendout,String model){ + if(proxyDisinfection == null){ + return; + } + StringBuilder description = new StringBuilder(); + description.append(model); + description.append(":将代理灭菌单(id:"); + description.append(proxyDisinfection.getId()); + description.append(",申请科室编码:" ); + description.append(proxyDisinfection.getDepartCoding()); + description.append(",处理科室编码:"); + description.append(proxyDisinfection.getHandleDepartCoding()); + description.append(")的是否二次发货的值由"); + description.append(proxyDisinfection.getCanResendout()); + description.append("修改为"); + description.append(resendout); + updateCanResendout(proxyDisinfection,resendout,model,Log.TYPE_UPDATE,description.toString()); + } + + private void updateCanResendout(ProxyDisinfection proxyDisinfection,String resendout,String model,String type,String description){ + if(proxyDisinfection == null){ + return; + } + if(StringTools.equals(proxyDisinfection.getCanResendout(), resendout)){ + return; + } + appLogManager.saveLog(AcegiHelper.getLoginUser(), model, type, description); + proxyDisinfection.setCanResendout(resendout); + objectDao.saveOrUpdate(proxyDisinfection); + + } + } \ No newline at end of file Index: ssts-tousse/src/main/java/com/forgon/disinfectsystem/tousse/toussedefinition/service/TousseInstanceManagerImpl.java =================================================================== diff -u -r14956 -r15003 --- ssts-tousse/src/main/java/com/forgon/disinfectsystem/tousse/toussedefinition/service/TousseInstanceManagerImpl.java (.../TousseInstanceManagerImpl.java) (revision 14956) +++ ssts-tousse/src/main/java/com/forgon/disinfectsystem/tousse/toussedefinition/service/TousseInstanceManagerImpl.java (.../TousseInstanceManagerImpl.java) (revision 15003) @@ -61,6 +61,8 @@ import com.forgon.disinfectsystem.tousse.cssdhandletousses.service.CssdHandleTousseManager; import com.forgon.disinfectsystem.vo.ItemDefinitionVO; import com.forgon.disinfectsystem.vo.TousseSimpleVO; +import com.forgon.log.model.Log; +import com.forgon.log.service.LogManager; import com.forgon.serialnumber.model.SerialNum; import com.forgon.serialnumber.service.SerialNumManager; import com.forgon.tools.Path; @@ -73,6 +75,7 @@ import com.forgon.tools.excel.ExcelHelper; import com.forgon.tools.hibernate.ObjectDao; import com.forgon.tools.json.JSONUtil; +import com.forgon.tools.string.StringTools; import com.forgon.tools.util.ForgonDateUtils; import com.forgon.tools.util.SqlUtils; @@ -108,6 +111,8 @@ private CssdHandleTousseManager cssdHandleTousseManager; + private LogManager appLogManager; + public void setCssdHandleTousseManager( CssdHandleTousseManager cssdHandleTousseManager) { this.cssdHandleTousseManager = cssdHandleTousseManager; @@ -137,6 +142,10 @@ this.objectDao = objectDao; } + public void setAppLogManager(LogManager appLogManager) { + this.appLogManager = appLogManager; + } + @Override public void saveOrUpdate(TousseInstance tousseInstance) { objectDao.saveOrUpdate(tousseInstance); @@ -1763,6 +1772,41 @@ return objectDao.findBySql( TousseInstance.class.getSimpleName(), String.format(" where po.invoicePlanID=%s", appid)); } + + @Override + public void updateStatus(TousseInstance tousseInstance, String status,String model,String type,String description) { + if(tousseInstance == null){ + return; + } + if(StringTools.equals(tousseInstance.getStatus(), status)){ + return; + } + appLogManager.saveLog(AcegiHelper.getLoginUser(), model, type, description); + tousseInstance.setStatus(status); + saveOrUpdate(tousseInstance); + } + + @Override + public void updateStatus(TousseInstance tousseInstance, String status, + String model) { + if(tousseInstance == null){ + return; + } + StringBuilder description = new StringBuilder(); + description.append(model); + description.append(":将器械包(id:"); + description.append(tousseInstance.getId()); + description.append(",条码:" ); + description.append(tousseInstance.getBarcode()); + description.append(",名称:"); + description.append(tousseInstance.getTousseName()); + description.append(")的状态由"); + description.append(tousseInstance.getStatus()); + description.append("修改为"); + description.append(status); + + updateStatus(tousseInstance,status,model,Log.TYPE_UPDATE,description.toString()); + } }