Index: ssts-recyclingrecord/src/main/java/com/forgon/disinfectsystem/recyclingrecord/action/RecyclingRecordAction.java =================================================================== diff -u -r13553 -r13571 --- ssts-recyclingrecord/src/main/java/com/forgon/disinfectsystem/recyclingrecord/action/RecyclingRecordAction.java (.../RecyclingRecordAction.java) (revision 13553) +++ ssts-recyclingrecord/src/main/java/com/forgon/disinfectsystem/recyclingrecord/action/RecyclingRecordAction.java (.../RecyclingRecordAction.java) (revision 13571) @@ -216,10 +216,11 @@ public void getRecyclingApplicationByUsedTousseBarcode(){ - String message = "没有找到与该条码有关的信息"; + String message = "没有找到该条码所对应的待回收申请单"; String id = ""; String departMent = ""; String orgUnitCoding = ""; + boolean isIdCardBarcode = false; String barcodeStr = StrutsParamUtils.getPraramValue("barcode",null); BarcodeDevice barcodeDevice = barcodeManager .getBarcodeByBarcode(barcodeStr); @@ -233,7 +234,7 @@ } // 是否器械包标识牌实例 else if (barcodeDevice instanceof IDCardInstance) { - + isIdCardBarcode = true; IDCardInstance idCardInstance = (IDCardInstance) barcodeDevice; List tousseInstances = idCardInstance .getTousseInstances(objectDao); @@ -277,8 +278,8 @@ id = recyclingApplicationManager.getWaitingRecycleApplicationIdContaintTousseInstance(tousseInstance.getBarcode()); - if ( StringUtils.isBlank(id)){ - message = "没有找到该器械包条码所对应的申请单"; + if (StringUtils.isBlank(id)){ + message = "没有找到该条码所对应的待回收申请单"; } else{ message = ""; @@ -292,6 +293,7 @@ jsonObject.put("id", id); jsonObject.put("departMent", departMent); jsonObject.put("orgUnitCoding", orgUnitCoding); + jsonObject.put("isIdCardBarcode", isIdCardBarcode); String result = jsonObject.toString(); StrutsParamUtils.getResponse().setCharacterEncoding("UTF-8"); Index: ssts-web/src/main/webapp/disinfectsystem/touchScreen/recycle/js/recycleRecordFilterManager.js =================================================================== diff -u -r12560 -r13571 --- ssts-web/src/main/webapp/disinfectsystem/touchScreen/recycle/js/recycleRecordFilterManager.js (.../recycleRecordFilterManager.js) (revision 12560) +++ ssts-web/src/main/webapp/disinfectsystem/touchScreen/recycle/js/recycleRecordFilterManager.js (.../recycleRecordFilterManager.js) (revision 13571) @@ -14,6 +14,9 @@ var applicationType = ''; //回收时间范围 var recyclingDateRange = ''; + //标识牌条码 + var idCardBarcode = ''; + //设置过滤的科室,返回条件表示是否有修改 this.selectDepart = function(name,code){ if(name.length > 0 && code.length > 0 && departCode.indexOf(code) == -1){ @@ -55,6 +58,15 @@ } return false; } + + this.selectIDCardBarcode = function(barcode){ + if(barcode.length > 0 && idCardBarcode.indexOf(barcode) == -1){ + idCardBarcode = barcode; + return true; + } + return false; + } + this.getFilter = function(){ var filter = '{'; if(departCode.length > 0){ @@ -89,6 +101,13 @@ filter += '"recyclingDateRange":'; filter += recyclingDateRange; } + if(idCardBarcode.length > 0){ + if(filter.length > 1){ + filter += ','; + } + filter += '"idCardBarcode":'; + filter += '"' + idCardBarcode + '"'; + } filter += '}'; return filter; } @@ -108,6 +127,10 @@ recyclingDateRange = ''; ret = true; } + if(idCardBarcode.length > 0){ + idCardBarcode = ''; + ret = true; + } return ret; } function resetUser(){ Index: ssts-web/src/main/webapp/disinfectsystem/touchScreen/recycle/awaitForRecycleList.jsp =================================================================== diff -u -r13553 -r13571 --- ssts-web/src/main/webapp/disinfectsystem/touchScreen/recycle/awaitForRecycleList.jsp (.../awaitForRecycleList.jsp) (revision 13553) +++ ssts-web/src/main/webapp/disinfectsystem/touchScreen/recycle/awaitForRecycleList.jsp (.../awaitForRecycleList.jsp) (revision 13571) @@ -107,14 +107,23 @@ } +var ab; +var lock = false; //锁定键盘 function lockup(e){ e.preventDefault(); } //高亮层不锁定 function lockout(e){ e.stopPropagation(); } -function alertDiv(alertWord){ +function alertDiv(alertWord,hideCloseButton){ lock = true; document.getElementById ("showWord").innerHTML = alertWord; + if(typeof(hideCloseButton) != 'undefined' && hideCloseButton){ + $('#idBoxClose').hide(); + } + else{ + $('#idBoxClose').show(); + } + $('#idBoxCenterUserType').hide(); ab = new AlertBox("idBox"); ab.onShow = function(){ if ( lock ) { @@ -702,10 +711,10 @@ success:function(msg){ if(msg.success){ //没有错误消息 - if(msg.message.length==0){ + if(msg.message.length == 0){ var id = msg.id; recycleTheApplication(id,barcode); - }else if(msg.departMent !="" && msg.orgUnitCoding != ""){ + }else if(msg.departMent != "" && msg.orgUnitCoding != ""){ $.ajax({ type:'post', url:WWWROOT + '/disinfectSystem/recyclingRecordAction!getAwaitForRecyclingInvoicePlan.do', @@ -719,18 +728,22 @@ $("#awaitForRecycleTable").empty(); getData(jsonData); } - }, error:function(){ + alert("数据加载异常!"); } }); }else{ - alert(msg.message); + if(msg.isIdCardBarcode){ + selectIdCardBarcode(barcode); + } + alertDiv(msg.message,false); return; } } }, error:function(){ + alert("数据加载异常!"); } }); }else{ @@ -871,6 +884,11 @@ setHeaderFilterStyle("state"); } } +function selectIdCardBarcode(barcode){ + if(recycleRecordFilterManager.selectIDCardBarcode(barcode)){ + firstPage(); + } +} function filterApplicationType(){ openSelect('选择申请单类型','selectApplicationType.jsp'); } @@ -906,6 +924,13 @@ 条码长度不符合规范!

+
+ +
+ Index: ssts-recyclingrecord/src/main/java/com/forgon/disinfectsystem/recyclingrecord/service/RecyclingRecordListSqlGenerator.java =================================================================== diff -u -r12923 -r13571 --- ssts-recyclingrecord/src/main/java/com/forgon/disinfectsystem/recyclingrecord/service/RecyclingRecordListSqlGenerator.java (.../RecyclingRecordListSqlGenerator.java) (revision 12923) +++ ssts-recyclingrecord/src/main/java/com/forgon/disinfectsystem/recyclingrecord/service/RecyclingRecordListSqlGenerator.java (.../RecyclingRecordListSqlGenerator.java) (revision 13571) @@ -5,6 +5,8 @@ import java.util.HashMap; import java.util.Map; +import org.apache.commons.lang.StringUtils; + import net.sf.json.JSONObject; import com.forgon.databaseadapter.service.DateQueryAdapter; @@ -52,14 +54,15 @@ String[] appType = (appTypeStr == null || appTypeStr.length() <= 0)?null:appTypeStr.split(";"); JSONObject dateRange = jsonObj.optJSONObject("recyclingDateRange"); String dateRangeSql = buildDateRangeSql(dateRange); + String idCardBarcodeStr = JSONUtil.optString(jsonObj, "idCardBarcode", null); Map map = new HashMap(); map.put(recyclingRecordPoName + ".departCode", departCodes); map.put(recyclingRecordPoName + ".operator", userNames); map.put(recyclingRecordPoName + ".status", status); map.put(invoicePlanPoName + ".type", appType); - return buildRecyclingRecordFilterSql(map) + " and " + dateRangeSql; + return buildRecyclingRecordFilterSql(map) + " and " + dateRangeSql + " and " + buildIdCardBarcodeSql(idCardBarcodeStr); } private String buildRecyclingRecordFilterSql(Map propertyValues){ String ret = " (1=1) "; @@ -74,6 +77,17 @@ } return ret; } + + private String buildIdCardBarcodeSql(String barcode) { + String sql = " (1=1) "; + if(StringUtils.isNotBlank(barcode)){ + sql = recyclingRecordPoName + + ".id in (select distinct recyclingRecordId from ClassifiedItem where idCardBarcode = '" + + barcode + "') "; + } + return sql; + } + private String buildDateRangeSql(JSONObject dateRange){ String ret = " (1=1) "; if(dateRange != null){ Index: ssts-recyclingapplication/src/main/java/com/forgon/disinfectsystem/recyclingapplication/service/RecyclingApplicationManagerImpl.java =================================================================== diff -u -r13515 -r13571 --- ssts-recyclingapplication/src/main/java/com/forgon/disinfectsystem/recyclingapplication/service/RecyclingApplicationManagerImpl.java (.../RecyclingApplicationManagerImpl.java) (revision 13515) +++ ssts-recyclingapplication/src/main/java/com/forgon/disinfectsystem/recyclingapplication/service/RecyclingApplicationManagerImpl.java (.../RecyclingApplicationManagerImpl.java) (revision 13571) @@ -4280,8 +4280,11 @@ try{ Session session = objectDao.getHibernateSession(); - Query query = session.createQuery("select po.id from RecyclingApplication po where po.tousseBarcodes like :barcode"); - + Query query = session + .createQuery("select po.id from RecyclingApplication po,InvoicePlan bo where po.id = bo.id and bo.recyclingStatus != '" + + InvoicePlan.RECYCLINGSTATUS_RECYCLED + + "' and bo.committedStatus = 1 and endStatus is null and po.tousseBarcodes like :barcode"); + query.setString("barcode", "%;" + instantceBarcode + ";%");