Index: ssts-recyclingrecord/src/main/java/com/forgon/disinfectsystem/recyclingrecord/action/RecyclingRecordAction.java =================================================================== diff -u -r24775 -r24830 --- ssts-recyclingrecord/src/main/java/com/forgon/disinfectsystem/recyclingrecord/action/RecyclingRecordAction.java (.../RecyclingRecordAction.java) (revision 24775) +++ ssts-recyclingrecord/src/main/java/com/forgon/disinfectsystem/recyclingrecord/action/RecyclingRecordAction.java (.../RecyclingRecordAction.java) (revision 24830) @@ -2109,6 +2109,8 @@ }catch(Exception e){ e.printStackTrace(); JSONUtil.addMessage(json, "后台异常,请稍候再试."); + }finally{ + DatabaseUtil.closeResultSetAndStatement(rs); } }else{ JSONUtil.addMessage(json, "查询参数不能为空"); @@ -2117,6 +2119,114 @@ } /** + * 深圳市蛇口人民医院定制方法(@see GZZYYFY-21 装配界面的打印回收清单格式) + * 过滤条件: + * 1.回收记录的处理科室为指定的供应室 + * 2.开始时间和结束时间对回收时间进行过滤 + * 3.只统计科室名称不含"手术"字眼的科室 + * + * 返回数据格式如下: + { + "success":true, + "message":"相关提示信息", + "rows":[{"departName":"科室1","tousseDetail":"包1*3、包2*5"、包n*10"},{"departName":"科室2","tousseDetail":"包3*3、包4*5"、包n*10"}] + } + */ + public void printRecyclingDetailForSzsskrmyy(){ + String fromTime = StrutsParamUtils.getPraramValue("startDateTime",""); + String toTime = StrutsParamUtils.getPraramValue("endDateTime", ""); + String handlerDepartCoding = StrutsParamUtils.getPraramValue("handlerDepartCoding",""); + JSONObject json = JSONUtil.buildJsonObject(false); + if (StringUtils.isNotBlank(fromTime) && StringUtils.isNotBlank(toTime) && StringUtils.isNotBlank(handlerDepartCoding)) { + fromTime = dateQueryAdapter.dateAdapter(fromTime); + toTime = dateQueryAdapter.dateAdapter(toTime); + + //1.按条件查询符合条件的内容 + String queryCondition = " and rr.orgUnitCoding='"+ handlerDepartCoding +"' " + + "and rr.recyclingTime between "+ fromTime +" and "+ toTime +" " + + "and rr.depart not like '%手术%' "; + String querySql = "select rr.depart,ri.tousseName,ri.amount " + + " from RecyclingRecord rr join RecyclingItem ri on rr.id=ri.recyclingRecord_id " + + " join TousseDefinition td on td.id=ri.tousseDefinitionId " + + " where 1=1 " + queryCondition + + " and ri.amount > 0"; + ResultSet rs = null; + try{ + rs = objectDao.executeSql(querySql); + Map> departTousseListMap = new HashMap>(); + //按科室分组查询每个科室的物品明细(同科室的vo明细数据合到一起、同科室又同包名的,则数量叠加到一起) + List tousseList = new ArrayList(); + while(rs.next()){ + TousseInstanceVo vo = new TousseInstanceVo(); + vo.setDepart(rs.getString("depart")); + vo.setTousseName(rs.getString("tousseName")); + vo.setAmount((int)rs.getLong("amount")); + tousseList.add(vo); + } + if(CollectionUtils.isNotEmpty(tousseList)){ + List tousseListOfDepart = null; + for (TousseInstanceVo vo : tousseList) { + if(departTousseListMap.containsKey(vo.getDepart())){ + tousseListOfDepart = departTousseListMap.get(vo.getDepart()); + boolean existsTousse = false; + for (TousseInstanceVo tousseInstanceVo : tousseListOfDepart) { + if(StringUtils.equals(tousseInstanceVo.getDepart(), vo.getDepart())){ + if(StringUtils.equals(tousseInstanceVo.getTousseName(), vo.getTousseName())){ + tousseInstanceVo.setAmount(tousseInstanceVo.getAmount() + vo.getAmount()); + existsTousse = true; + break; + } + } + } + if(!existsTousse){ + tousseListOfDepart.add(vo); + } + }else{ + tousseListOfDepart = new ArrayList(); + tousseListOfDepart.add(vo); + } + departTousseListMap.put(vo.getDepart(), tousseListOfDepart); + } + if(departTousseListMap.size() > 0){ + JSONArray jsonArray = new JSONArray(); + for (String departKey : departTousseListMap.keySet()) { + JSONObject jsonObject = new JSONObject(); + jsonObject.put("departName", departKey); + StringBuffer specializedDepartTousseNote = new StringBuffer(); + List departTousseVolist = departTousseListMap.get(departKey); + if(CollectionUtils.isNotEmpty(departTousseVolist)){ + for(TousseInstanceVo vo : departTousseVolist){ + if(specializedDepartTousseNote.length() > 0){ + specializedDepartTousseNote.append("、"); + } + specializedDepartTousseNote.append(vo.getTousseName() + "*" + vo.getAmount()); + } + } + jsonObject.put("tousseDetail", specializedDepartTousseNote.toString()); + jsonArray.add(jsonObject); + } + JSONUtil.addSuccess(json, true); + JSONUtil.addRowsProperty(json, jsonArray); + } + }else{ + JSONUtil.addMessage(json, "未找到符合条件的物品"); + } + }catch(RuntimeException e){ + e.printStackTrace(); + JSONUtil.addMessage(json, e.getMessage()); + }catch(Exception e){ + e.printStackTrace(); + JSONUtil.addMessage(json, "后台异常,请稍候再试."); + }finally{ + DatabaseUtil.closeResultSetAndStatement(rs); + } + }else{ + JSONUtil.addMessage(json, "查询参数不能为空"); + } + StrutsResponseUtils.output(json); + } + + /** * 东莞中医院回收清单定制方法 */ public void dongGuanZhongYiYuanProcess(){ Index: ssts-web/src/main/webapp/disinfectsystem/packing/printRecyclingDetailWin.js =================================================================== diff -u -r24694 -r24830 --- ssts-web/src/main/webapp/disinfectsystem/packing/printRecyclingDetailWin.js (.../printRecyclingDetailWin.js) (revision 24694) +++ ssts-web/src/main/webapp/disinfectsystem/packing/printRecyclingDetailWin.js (.../printRecyclingDetailWin.js) (revision 24830) @@ -234,6 +234,28 @@ showResult(result.cause); } }); + }else if(projectName == 'szsskrmyy'){ + //深圳蛇口人民医院回收清单打印 + Ext.Ajax.request({ + url : WWWROOT + '/disinfectSystem/recyclingRecordAction!printRecyclingDetailForSzsskrmyy.do', + params : { + startDateTime : startDateTime, + endDateTime : endDateTime, + handlerDepartCoding : handlerDepartCoding + }, + success : function(response, options) { + var obj = JSON.parse(response.responseText); + if(obj.success){ + doPrintRecyclingDetailForSzsskrmyy(printType,startDateTime,endDateTime,obj.printUser,obj); + }else{ + showResult(obj.message); + } + }, + failure : function(response, options) { + var result = Ext.decode(response.responseText); + showResult(result.cause); + } + }); }else if (sstsConfig.recyclingRecordListFilterByAssetBelong){ // 按器械包的资产归属过滤打印范围,需要在器械包定义中进行设置 Ext.Ajax.request({ @@ -704,6 +726,45 @@ } } +//深圳市蛇口人民医院打印回收清单 +function doPrintRecyclingDetailForSzsskrmyy(printType,startDateTime,endDateTime,printUser,recyclingDetail){ + var LODOP = getLodop(document.getElementById('LODOP'), document.getElementById('LODOP_EM')); + LODOP.SET_PRINT_STYLE("FontSize",17); + LODOP.ADD_PRINT_TEXT(5,300,"100%",5,"器械回收汇总"); + LODOP.SET_PRINT_STYLE("FontSize",11); + LODOP.ADD_PRINT_TEXT(35,20,"100%",5,"开始时间:" + startDateTime); + LODOP.ADD_PRINT_TEXT(35,270,"100%",5,"结束时间:" + endDateTime); + LODOP.ADD_PRINT_TEXT(35,520,"100%",5,"打印时间:" + new Date().format('Y-m-d H:i:s')); + + var htmlTable =""; + //各科室的器械包(一行抬头+多行数据(每个科室1行、需要遍历)) + htmlTable += "" + + "" + + "" + + "" + + ""; + + if(recyclingDetail.rows && recyclingDetail.rows.length){ + for(var i = 0;i < recyclingDetail.rows.length;i++){ + htmlTable += "" + + "" + + "" + + "" + + ""; + } + } + + htmlContent = "" + htmlTable + ""; + LODOP.ADD_PRINT_HTM(55,5,"99%","99%",htmlContent); + + if(printType == 0){//直接打印 + LODOP.PRINT(); + }else{//打印预览 + LODOP.SET_SHOW_MODE("HIDE_PAPER_BOARD",1); + LODOP.PREVIEW(); + } +} + function lodopPrint(printType,startDateTime,endDateTime,printUser,printDetail,disinfectionDetail,tableRowSize){ var LODOP = getLodop(document.getElementById('LODOP'), document.getElementById('LODOP_EM')); LODOP.SET_PRINT_STYLE("FontSize",17);
科室器械包签收人
"+ recyclingDetail.rows[i].departName +""+ recyclingDetail.rows[i].tousseDetail +"