Index: ssts-web/src/main/webapp/disinfectsystem/config/gzszyy/print/recyclingDetailPrintConfig.js =================================================================== diff -u --- ssts-web/src/main/webapp/disinfectsystem/config/gzszyy/print/recyclingDetailPrintConfig.js (revision 0) +++ ssts-web/src/main/webapp/disinfectsystem/config/gzszyy/print/recyclingDetailPrintConfig.js (revision 22812) @@ -0,0 +1,134 @@ +{ + 普通器械列头 : [ + { + columnName : '开方包', + includeTousse : [ + {id : 553,tousseName : '开方包(9件)'} + ] + },{ + columnName : '中段尿包', + includeTousse : [ + {id : 15,tousseName : '中段尿包'} + ] + },{ + columnName : '缝合包', + includeTousse : [ + {id : 68,tousseName : '缝合包'} + ] + },{ + columnName : '气切包', + includeTousse : [ + {id : 8,tousseName : '气管切开包'} + ] + },{ + columnName : '小手术包', + includeTousse : [ + {id : 521,tousseName : '小手术包﹙7件﹚'} + ] + },{ + columnName : '小镊子', + includeTousse : [ + {id : 39,tousseName : '包装镊子'} + ] + },{ + columnName : '小镊子筒', + includeTousse : [ + {id : 28,tousseName : '小镊子筒'} + ] + },{ + columnName : '中镊子', + includeTousse : [ + {id : 190,tousseName : '中镊子'} + ] + },{ + columnName : '中镊子包', + includeTousse : [ + {id : 558,tousseName : '中镊子包'} + ] + },{ + columnName : '方盅', + includeTousse : [ + {id : 555,tousseName : '方盅'} + ] + },{ + columnName : '中镊子筒', + includeTousse : [ + {id : 31,tousseName : '中镊子筒'} + ] + }, + { + columnName : '空中镊子筒', + includeTousse : [ + {id : 32,tousseName : '空中镊子筒'} + ] + }, { + columnName : '小剪筒', + includeTousse : [ + {id : 29,tousseName : '小剪筒'} + ] + },{ + columnName : '线剪', + includeTousse : [ + {id : 56,tousseName : '包装线剪'} + ] + },{ + columnName : '弯剪', + includeTousse : [ + {id : 29,tousseName : '包装弯剪'} + ] + },{ + columnName : '包装直剪', + includeTousse : [ + {id : 53,tousseName : '包装直剪'} + + ] + },{ + columnName : '弯钳', + includeTousse : [ + {id : 43,tousseName : '包装弯钳'} + ] + }, + { + columnName : '直钳', + includeTousse : [ + {id : 47,tousseName : '包装直钳'} + ] + }, + + + { + columnName : '酒精瓶', + includeTousse : [ + {id : 554,tousseName : '酒精瓶'} + ] + }, + { + columnName : '有芯湿化瓶', + includeTousse : [ + {id : 556,tousseName : '宽口有芯湿化瓶'}, + {id : 565,tousseName : '宽口有芯湿化瓶'}, + {id : 566,tousseName : '宽口有芯湿化瓶'}, + {id : 748,tousseName : '宽口有芯湿化瓶'}, + {id : 560,tousseName : '湿化瓶(窄)'} + ] + }, + { + columnName : '无芯湿化瓶', + includeTousse : [ + {id : 565,tousseName : '宽口无芯湿化瓶'} + ] + }, + { + columnName : '负压瓶', + includeTousse : [ + {id : 181,tousseName : '负压瓶'} + ] + }, + { + columnName : '空培包', + includeTousse : [ + {id : 38,tousseName : '空培包'} + ] + } + ] +} Index: ssts-recyclingrecord/src/main/java/com/forgon/disinfectsystem/recyclingrecord/action/RecyclingRecordAction.java =================================================================== diff -u -r22430 -r22812 --- ssts-recyclingrecord/src/main/java/com/forgon/disinfectsystem/recyclingrecord/action/RecyclingRecordAction.java (.../RecyclingRecordAction.java) (revision 22430) +++ ssts-recyclingrecord/src/main/java/com/forgon/disinfectsystem/recyclingrecord/action/RecyclingRecordAction.java (.../RecyclingRecordAction.java) (revision 22812) @@ -1825,6 +1825,101 @@ } } /** + * 回收清单打印,指定的器械包按表格打印,未指定的器械包,打印到其他的表单,并指定科室与器械包名称和数量 + */ + public void printRecyclingDetailWithTousseAndOther(){ + String fromTime = StrutsParamUtils.getPraramValue("startDateTime",""); + String toTime = StrutsParamUtils.getPraramValue("endDateTime", ""); + String handlerDepartCoding = StrutsParamUtils.getPraramValue("handlerDepartCoding",""); + if (StringUtils.isNotBlank(fromTime) && StringUtils.isNotBlank(toTime) && StringUtils.isNotBlank(handlerDepartCoding)) { + fromTime = dateQueryAdapter.dateAdapter(fromTime); + toTime = dateQueryAdapter.dateAdapter(toTime); + //手术室不用统计 + String orOrgUnitNameSQL = ""; + GoodsOption goodsOption = goodsOptionManager.getGoodsOption(GoodsOption.MODEL_SURGICALINSTRUMENTS_DEPT, ""); + if(goodsOption != null){ + if(StringUtils.isNotBlank(goodsOption.getValue())){ + orOrgUnitNameSQL = " and po.depart not in ('" + goodsOption.getValue().replace(";", "','") + "')"; + } + } + + String sql = String + .format("select min(po.depart) departName,po.departCode,td.ancestorID,min(bo.tousseName) tousseName,sum(bo.amount) amount,td.id from %s po " + + "join %s bo on po.id = bo.recyclingRecord_id join %s td on td.id = bo.tousseDefinitionId " + + "where po.recyclingTime between %s and %s and po.orgUnitCoding = '%s' %s group by po.departCode,td.ancestorID,td.id", + RecyclingRecord.class.getSimpleName(), RecyclingItem.class.getSimpleName(), + TousseDefinition.class.getSimpleName(),fromTime, toTime, handlerDepartCoding,orOrgUnitNameSQL); + + ResultSet rs = objectDao.executeSql(sql); + + JSONObject printConfig = CssdUtils.getWebConfigInfo(CssdUtils.getProjectName() + + "/print/recyclingDetailPrintConfig.js"); + if(printConfig == null){ + StrutsResponseUtils.output(false, "回收清单参数配置有误!"); + return; + } + + JSONArray commonTousse = printConfig.optJSONArray(commonMaterial); + List tousseIds = new ArrayList(); + getModelIncludeTousseIds(commonTousse,tousseIds); + + + Map commonMaterialmap = new HashMap(); + Map> specialMaterialMap = new HashMap>(); + + try { + while(rs.next()){ + String depart = rs.getString("departName"); + String departCode = rs.getString("departCode"); + long ancestorID = rs.getLong("ancestorID"); + String tousseName = rs.getString("tousseName"); + Integer amount = rs.getInt("amount"); + //验证器械包属于那种打印类型 + boolean isExist = isConfigExist(tousseIds, "" + ancestorID); + if (isExist) { + JSONObject data = commonMaterialmap.get(departCode); + if (data == null) { + data = new JSONObject(); + commonMaterialmap.put(departCode, data); + } + buildDepartmentRecyclingItemJson(printConfig, commonMaterial, depart, + departCode, ancestorID, amount, data); + continue; + //其他器械(非呼吸机管道的3个包) + }else{ + buildTousseItemJson(specialMaterialMap, departCode, depart, + tousseName, amount); + } + } + } catch (SQLException e) { + e.printStackTrace(); + } finally { + DatabaseUtil.closeResultSetAndStatement(rs); + } + JSONObject data = new JSONObject(); + data.put("success",true); + data.put(commonMaterial, commonMaterialmap.values()); + data.put("专科器械", buildDepartToussJson(specialMaterialMap,printConfig.optJSONArray(""))); + + data.put("配置文件", printConfig); + data.put("printUser", AcegiHelper.getLoginUserFullName()); + + String invoicePlanHql = String.format("id in(select recyclingApplication.id from %s po where po.recyclingTime between %s and %s and po.orgUnitCoding = '%s' %s) and %s order by depart,recyclingTime", + RecyclingRecord.class.getSimpleName(),fromTime,toTime,handlerDepartCoding,orOrgUnitNameSQL,sqlFunctionsAdapter.strNotBlank("remark")); + List invoicePlans = invoicePlanManager.getByHql(invoicePlanHql); + Map> maps = invoicePlanManager.groupByDepartCoding(invoicePlans); + JsonConfig jsonConfig = new JsonConfig(); + List list = new ArrayList<>(maps.keySet()); + list.add("serialNumber"); + list.add("depart"); + list.add("departCoding"); + list.add("remark"); + jsonConfig.setJsonPropertyFilter(new JsonIncludePropertyFilter(list.toArray(new String[0]))); + data.put("remarks", JSONObject.fromObject(maps, jsonConfig)); + StrutsResponseUtils.output(data); + } + } + /** * 东莞中医院回收清单定制方法 */ public void dongGuanZhongYiYuanProcess(){ @@ -1868,14 +1963,14 @@ } } - public static final String 普通器械 = "普通器械列头"; + public static final String commonMaterial = "普通器械列头"; public static final String 呼吸机管道 = "呼吸机管道"; public static final String 住院专科 = "住院专科"; public static final String 门诊专科 = "门诊专科"; public static final String 分院 = "分院"; public Map> getPrintTableConfigInfo(JSONObject printConfig){ - JSONArray commonTousse = printConfig.optJSONArray(普通器械); + JSONArray commonTousse = printConfig.optJSONArray(commonMaterial); List 普通器械包Ids = new ArrayList(); getModelIncludeTousseIds(commonTousse,普通器械包Ids); @@ -1897,7 +1992,7 @@ Map> data = new HashMap>(); - data.put(普通器械, 普通器械包Ids); + data.put(commonMaterial, 普通器械包Ids); data.put(呼吸机管道, 呼吸机管道Ids); data.put(住院专科, 住院专科code); data.put(门诊专科, 门诊专科code); @@ -1994,14 +2089,14 @@ String tousseDefinitionId = rs.getString(6); //验证器械包属于那种打印类型 if(StringUtils.isNotBlank(普通器械科室Map.get(departCode))){ - boolean isExist = isConfigExist(configMap.get(普通器械), "" + ancestorID); + boolean isExist = isConfigExist(configMap.get(commonMaterial), "" + ancestorID); if (isExist) { JSONObject data = 普通器械map.get(departCode); if (data == null) { data = new JSONObject(); 普通器械map.put(departCode, data); } - buildDepartmentRecyclingItemJson(printConfig, 普通器械, depart, + buildDepartmentRecyclingItemJson(printConfig, commonMaterial, depart, departCode, ancestorID, amount, data); continue; //其他器械(非呼吸机管道的3个包) @@ -2061,7 +2156,7 @@ } JSONObject data = new JSONObject(); data.put("success",true); - data.put(普通器械, 普通器械map.values()); + data.put(commonMaterial, 普通器械map.values()); data.put(呼吸机管道, 呼吸机管道map.values()); data.put(住院专科, buildDepartToussJson(住院专科回收清单map,printConfig.optJSONArray(住院专科))); data.put(门诊专科, buildDepartToussJson(门诊专科回收清单map,printConfig.optJSONArray(门诊专科))); Index: ssts-web/src/main/webapp/disinfectsystem/packing/printRecyclingDetailWin.js =================================================================== diff -u -r22140 -r22812 --- ssts-web/src/main/webapp/disinfectsystem/packing/printRecyclingDetailWin.js (.../printRecyclingDetailWin.js) (revision 22140) +++ ssts-web/src/main/webapp/disinfectsystem/packing/printRecyclingDetailWin.js (.../printRecyclingDetailWin.js) (revision 22812) @@ -190,8 +190,30 @@ showResult(result.cause); } }); - // 按器械包的资产归属过滤打印范围,需要在器械包定义中进行设置 + }else if(projectName == 'gzszyy'){ + //广州市中医院的打印 + Ext.Ajax.request({ + url : WWWROOT + '/disinfectSystem/recyclingRecordAction!printRecyclingDetailWithTousseAndOther.do', + params : { + startDateTime : startDateTime, + endDateTime : endDateTime, + handlerDepartCoding : handlerDepartCoding + }, + success : function(response, options) { + var obj = JSON.parse(response.responseText); + if(obj.success){ + doPrintRecyclingDetailWithTousseAndOther(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({ url : WWWROOT + '/disinfectSystem/recyclingRecordAction!getPrintRecyclingDetailList.do', params : { @@ -586,6 +608,44 @@ } } +function doPrintRecyclingDetailWithTousseAndOther(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,"CSSD每日回收登记表"); + LODOP.SET_PRINT_STYLE("FontSize",11); + LODOP.ADD_PRINT_TEXT(35,50,"100%",5,"制单人: " + printUser); + LODOP.ADD_PRINT_TEXT(35,200,"100%",5,"开始时间:" + startDateTime); + LODOP.ADD_PRINT_TEXT(35,450,"100%",5,"结束时间: " + endDateTime); + +// LODOP.SET_PRINT_STYLE("ItemType", 2); +// LODOP.ADD_PRINT_TEXT(10,600,"95%",5,"第#页/共&页"); + + var htmlTable =""; + //普通器械 + htmlTable += ""; + //其他 + htmlTable += ""; + //备注 + htmlTable += ""; + + + htmlContent = "" + htmlTable + ""; + LODOP.ADD_PRINT_HTM(55,5,"100%","100%",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);
"; + htmlTable += buildTable(recyclingDetail,"普通器械列头",24); + htmlTable += "
"; + htmlTable += buildDepartTable(recyclingDetail,"专科器械"); + htmlTable += "
"; + htmlTable += buildRemarkTable(recyclingDetail.remarks,"备注"); + htmlTable += "