Index: ssts-recyclingapplication/src/main/java/com/forgon/disinfectsystem/recyclingapplication/service/RecyclingApplicationManagerImpl.java =================================================================== diff -u -r18173 -r18200 --- ssts-recyclingapplication/src/main/java/com/forgon/disinfectsystem/recyclingapplication/service/RecyclingApplicationManagerImpl.java (.../RecyclingApplicationManagerImpl.java) (revision 18173) +++ ssts-recyclingapplication/src/main/java/com/forgon/disinfectsystem/recyclingapplication/service/RecyclingApplicationManagerImpl.java (.../RecyclingApplicationManagerImpl.java) (revision 18200) @@ -21,7 +21,6 @@ import java.util.Set; import java.util.stream.Collectors; -import com.forgon.disinfectsystem.recyclingapplication.vo.ReturnGoodVo; import net.sf.json.JSONArray; import net.sf.json.JSONObject; import net.sf.json.JsonConfig; @@ -84,6 +83,7 @@ import com.forgon.disinfectsystem.print.vo.PrintPageVo; import com.forgon.disinfectsystem.print.vo.PrintRowVo; import com.forgon.disinfectsystem.print.vo.PrintSummaryVo; +import com.forgon.disinfectsystem.recyclingapplication.vo.ReturnGoodVo; import com.forgon.disinfectsystem.tousse.toussedefinition.service.TousseDefinitionManager; import com.forgon.disinfectsystem.tousse.toussedefinition.service.TousseInstanceManager; import com.forgon.disinfectsystem.tousseitem.service.TousseItemManager; @@ -345,6 +345,7 @@ } + @Override @SuppressWarnings("unchecked") public List getInvoicePlanByTypeAndStatus() { String departCoding = AcegiHelper.getLoginUser() @@ -355,6 +356,7 @@ } + @Override public void delete(InvoicePlan invoicePlan) { if (invoicePlan instanceof ForeignTousseApplication) { for (TousseItem item : invoicePlan.getApplicationItems()) { @@ -376,6 +378,7 @@ jobj.put("id", invoicePlan.getId()); appLogManager.saveLog(AcegiHelper.getLoginUser(), "申请单", "删除申请单", jobj.toString()); } + @Override public boolean deleteRecyclingApplication(String id) { InvoicePlan invoicePlan = (InvoicePlan) objectDao.getByID_ForUpdate(InvoicePlan.class.getSimpleName(), id); @@ -1272,6 +1275,7 @@ * 使用记录转换的申请单是否需要发货 * @return */ + @Override public boolean isNeedInvoiceForRecyclingApplication(RecyclingApplication application){ boolean needInvoice = true; if (application != null && application.getUseRecord() != null @@ -1317,6 +1321,7 @@ * @param departCode * @return */ + @Override public void getPrintObjectOfDept(JSONObject printScope, String departCode, String printUser, List summaryList) { @@ -1341,6 +1346,7 @@ * @param invoicePlans 发货计划 * @param printSummaryList 传出参数,记录了打印数据 */ + @Override public void getPrintObject(JSONObject printScope, Collection invoicePlans, List printSummaryList){ @@ -1474,6 +1480,7 @@ } // 选择多张申请单进行批量打印 + @Override public void getPrintObjectByApplicationIds(JSONObject printScope, String applicationIds, String printUser, List summaryList) { @@ -1535,6 +1542,7 @@ } // 按时间段获取打印对象,主要指针对回收的物品清单 + @Override public JSONObject getPrintObjectByTimePeriod(JSONObject printScope, String fromTime, String toTime, String printUser) { @@ -1583,6 +1591,10 @@ List printRowVos = recyclingItems2PrintRowVos(disinfcetionItems,printByOriginalApplications); + List printTousseVos = null; + if(printTousse){ + printTousseVos = recyclingItems2PrintRowVos(tousseItems,printByOriginalApplications); + } if (sortDisinfcetGoodsByDepartShift){ Collections.sort(printRowVos,new Comparator() { @@ -1596,7 +1608,7 @@ } int totalGoodsAmount = 0; - // 增加序号和计算总数量 + // 增加序号和计算总数量。目前是消毒物品的总数量 for (int i=0; i> getGroupingTousseItems(JSONArray groupTypeArray, Collection allTousseItems) { @@ -1925,6 +1939,7 @@ * @param rowsPerPage * @param printApplyInfo */ + @Override public void populateSummaryList(JSONObject printScope,Collection allTousseItems, List summaryList, int rowsPerPage, boolean printApplyInfo, boolean isMergePrintMultiApplicationsOfSameDepart, String shiftName, String sheetName) { @@ -2100,6 +2115,7 @@ * @param printUser 打印人姓名 * @param summaryList 打印总结对象的集合 */ + @Override public void setPrintInfo(String printUser, List summaryList) { // 转换为打印对象VO int summarySize = summaryList.size(); @@ -2926,6 +2942,7 @@ * @param newTousseItemVoList 申请单上新的物品集合,相对于修改前的物品 * @param committedStatus 提交状态 */ + @Override public String saveRecyclingApplication(RecyclingApplication application, Collection newTousseItemVoList, boolean committedStatus) throws RecyclingRecordException{ @@ -4591,13 +4608,15 @@ // } // 根据器械包实例的条码,获取包含该器械包的待回收的申请单的ID,取满足条件的第一张申请单 + @Override public InvoicePlan getRecycleApplicationByTousseBarcode(String instantceBarcode){ String sql = String .format("where po.committedStatus = 1 and po.endStatus is null and po.tousseBarcodes like '%%%s%%'", instantceBarcode); return (InvoicePlan)objectDao.getBySql(InvoicePlan.class.getSimpleName(), sql); } // 保存消毒物品申请单 + @Override public String saveDisinfectionRecyclingApplication(RecyclingApplication recyclingApplication, JSONArray disinfectGoodsArray){ String message = "保存成功"; Long id = recyclingApplication.getId(); @@ -5049,7 +5068,8 @@ return noPrintList; } - public void addDisinfectTousseItem(InvoicePlan plan, Integer prepareRecycleAmount, TousseDefinition td, TousseItem item) { + @Override + public void addDisinfectTousseItem(InvoicePlan plan, Integer prepareRecycleAmount, TousseDefinition td, TousseItem item) { JSONArray materialArry = new JSONArray(); List mis = td.getMaterialInstances(); if(mis != null){ @@ -5074,7 +5094,7 @@ && TousseDefinition.STR_NO.equals(td.getIsRecycling())) { newUnPackingTousseInstance(td, item.getUpdateAmount(plan.getCommittedStatus()), - (RecyclingApplication) plan, null); + plan, null); } } } Index: ssts-web/src/main/webapp/disinfectsystem/config/cdlqyq1yy/print/printConfig.js =================================================================== diff -u -r17871 -r18200 --- ssts-web/src/main/webapp/disinfectsystem/config/cdlqyq1yy/print/printConfig.js (.../printConfig.js) (revision 17871) +++ ssts-web/src/main/webapp/disinfectsystem/config/cdlqyq1yy/print/printConfig.js (.../printConfig.js) (revision 18200) @@ -1561,6 +1561,137 @@ } ] } +function printrecyclingItems_cdlqyq1yy(obj){ + 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,50,"100%",5,"查询时间:" + obj.fromTime.substring(0,16) + "-" + obj.toTime.substring(0,16)); + //需要引入common.js + LODOP.ADD_PRINT_TEXT(35,470,"100%",5,"打印时间:" + (new Date()).Format("yyyy-MM-dd hh:mm")); + + //先把物品按科室分组 + var departGroupGoods = []; + function groupGoods(goodsArray){ + for(var i = 0; i < goodsArray.length;++i){ + var goods = goodsArray[i]; + var dggs; + for(var j = 0; j < departGroupGoods.length;++j ){ + var tmp = departGroupGoods[j]; + if(tmp){ + if(tmp.depart == goods.applicationDepart){ + dggs = tmp; + break; + } + } + } + if(!dggs){ + dggs = {}; + dggs.depart = goods.applicationDepart; + dggs.goods = []; + departGroupGoods.push(dggs); + } + dggs.goods.push(goods); + } + } + if(obj.goods){ + groupGoods(obj.goods); + } + if(obj.tousses){ + groupGoods(obj.tousses); + } + var tousseGoodsNameArr = ['拆线包','腰穿包','胸穿包','骨穿包','扩创包','吸痰包', + '气切换','气管切开包','皮肤缝合包',"缝合包","静脉切开包", + '舌钳','开口器','湿化瓶','湿化瓶芯','压脉带']; + var tdAlign = "center"; + + var htmlTable =""; + htmlTable += ""; + //表头 + htmlTable += ""; + for(var i = 0; i < tousseGoodsNameArr.length;++i){ + htmlTable += ""; + } + htmlTable += ""; + //数据内容 + var goodsTotalCount = {}; + for(var groupIndex = 0; groupIndex < departGroupGoods.length;++groupIndex ){ + var departGroupItem = departGroupGoods[groupIndex]; + htmlTable += ""; + htmlTable += ""; + for(var tousseNameIndex = 0; tousseNameIndex < tousseGoodsNameArr.length;++tousseNameIndex){ + var count = 0; + for(var goodsIndex = 0; goodsIndex < departGroupItem.goods.length;++goodsIndex){ + if(tousseGoodsNameArr[tousseNameIndex] == departGroupItem.goods[goodsIndex].goodsName){ + count += parseInt(departGroupItem.goods[goodsIndex].goodsAmount); + } + } + var totalCount = goodsTotalCount[tousseGoodsNameArr[tousseNameIndex]]; + if(!totalCount){ + totalCount = 0; + } + totalCount += count; + goodsTotalCount[tousseGoodsNameArr[tousseNameIndex]] = totalCount; + + var tdValue = count ? count : ''; + htmlTable += ""; + } + htmlTable += ""; + } + //合计 + htmlTable += ""; + htmlTable += ""; + for(var i = 0; i < tousseGoodsNameArr.length;++i){ + var value = goodsTotalCount[tousseGoodsNameArr[i]]; + value = value?value:0; + htmlTable += ""; + } + htmlTable += ""; + + htmlTable += "
 " + tousseGoodsNameArr[i] + "
"+departGroupItem.depart+"  " + tdValue + "
合计 " + value + "
"; + + htmlContent = "" + htmlTable + ""; + LODOP.ADD_PRINT_HTM(55,5,"100%","100%",htmlContent); +} +//打印回收清单配置 +var recyclingItemsPrintConfig = { + customPrint:printrecyclingItems_cdlqyq1yy, + isPrintTousse : false, + isPrintDisinfectGoods : true, + isPrintDisposableGoods : false, + isMergePrintTousseAndDisposable : false, // 器械包和一次性物品是否合并打印 + printByOriginalApplications : false, //不合并打印情况下是否按原始单据逐份打印 + printApplyInfo : false, + printOrder : 2, // 1:优先打印一次性物品, 2:优先打印器械包 + // 在器械包和一次性物品不合并打印的情况下,消毒物品打印方式: + // 1:优先与一次性物品合并打印,如果无一次性物品则与器械包合并打印, 2:优先与器械包一起合并打印,如果没有器械包则与一次性物品合并打印 ,3:单独打印 + disinfectGoodsPrintMode : 3, + sortDisinfcetGoodsByDepartShift : true, + headerFooter : [ + // 标题 + {label : "中大五院消毒物品下送表", dataIndex : 'header', fontSize : 17, position : ["20","60mm","99%",22]}, + {label : "统计时间: ", dataIndex : 'fromTime', fontSize : 11, position : ["70","20mm","90%",5]}, + {label : " 至 ", dataIndex : 'toTime', fontSize : 11, position : ["70","95mm","90%",5]}, + {label : "制 单 人: ", dataIndex : 'printUser', fontSize : 11, position : ["90","20mm","90%",5]}, + {label : "打印时间: ", dataIndex : 'printTime', fontSize : 11, position : ["90","95mm","90%",5]} + + ], + currentPageNumber : {label : "第#页", fontSize : 11, position : ["27.5cm","75%","90%",5]}, + totalPageAmount : {label : "共&页", fontSize : 11, position : ["27.5cm","81%","90%",5]}, + goodsTable :{ + rowHeight : 25, + position : ["117","3%","97%","23cm"], + headRepeat : true, + columns : [ + {header : "序号", dataIndex : 'serialNumber', width : 40, align : 'center', fontSize : 11}, + {header : "科室分类", dataIndex : 'departShift', width : 90, align : 'left', fontSize : 11}, + {header : "科室名称", dataIndex : 'applicationDepart', width : 100, align : 'left', fontSize : 11}, + {header : "项目名称", dataIndex : 'goodsName', width : 100, align : 'left', fontSize : 11}, + {header : "数量", dataIndex : 'goodsAmount', width : 45, align : 'right', fontSize : 11}, + {header : "单位", dataIndex : 'unit', width : 45, align : 'left', fontSize : 11}, + {header : "规格", dataIndex : 'sp', width : 100, align : 'left', fontSize : 11} + ] + } + } var printConfig = { //发货计划单 @@ -1624,6 +1755,8 @@ appropriationInList : appropriationInListConfig, //调拨出库单 appropriationOutList : appropriationOutListConfig, + //打印回收清单 + recyclingItems : recyclingItemsPrintConfig, //借还记录 borrowRecord:borrowRecordConfig };