Index: ssts-web/src/main/webapp/jasperRtp/monthReportOnlyPrice.jrxml =================================================================== diff -u --- ssts-web/src/main/webapp/jasperRtp/monthReportOnlyPrice.jrxml (revision 0) +++ ssts-web/src/main/webapp/jasperRtp/monthReportOnlyPrice.jrxml (revision 25167) @@ -0,0 +1,139 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + <band height="34" splitType="Stretch"> + <textField> + <reportElement uuid="722b0dd0-f1ec-492e-8a80-360209a6322a" x="3" y="0" width="797" height="34"/> + <textElement textAlignment="Center" verticalAlignment="Middle"> + <font size="14" isBold="true"/> + </textElement> + <textFieldExpression><![CDATA[$P{title}]]></textFieldExpression> + </textField> + </band> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Index: ssts-reports/src/main/java/com/forgon/disinfectsystem/jasperreports/action/JasperreportsAction.java =================================================================== diff -u -r25160 -r25167 --- ssts-reports/src/main/java/com/forgon/disinfectsystem/jasperreports/action/JasperreportsAction.java (.../JasperreportsAction.java) (revision 25160) +++ ssts-reports/src/main/java/com/forgon/disinfectsystem/jasperreports/action/JasperreportsAction.java (.../JasperreportsAction.java) (revision 25167) @@ -78,6 +78,7 @@ import com.forgon.disinfectsystem.jasperreports.javabeansource.MaterialDamageTotal_child; import com.forgon.disinfectsystem.jasperreports.javabeansource.MaterialErrorDamageSummaryOfDepartmentVO; import com.forgon.disinfectsystem.jasperreports.javabeansource.MonthReportBean; +import com.forgon.disinfectsystem.jasperreports.javabeansource.MonthReportBeanWith2Column; import com.forgon.disinfectsystem.jasperreports.javabeansource.PackingFractionDefectiveBean; import com.forgon.disinfectsystem.jasperreports.javabeansource.SatisfyInfo; import com.forgon.disinfectsystem.jasperreports.javabeansource.SatisfyItem; @@ -529,40 +530,145 @@ String startDate = StrutsParamUtils.getPraramValue("startDate", null); Long warehouseId = StrutsParamUtils.getPraramLongValue("warehouseId", null); return jasperReportManager.getSupplyRoomMaterialStocktakingList(startDate,warehouseId); - }else if (reportName.equals("monthReport")) {//核算月报 - String startDate = StrutsParamUtils.getPraramValue("startTime",null); - String endDate = StrutsParamUtils.getPraramValue("endTime",null); + } else if (reportName.equals("monthReport")) {// 核算月报 + String startDate = StrutsParamUtils.getPraramValue("startTime", + null); + String endDate = StrutsParamUtils.getPraramValue("endTime", null); String department = StrutsParamUtils.getPraramValue("depart", null); - //增加物品类型 - String tousseType = StrutsParamUtils.getPraramValue("tousseType", ""); - String disposableGoodsType = StrutsParamUtils.getPraramValue("disposableGoodsType", ""); - String showCustonTousseAmountStr = StrutsParamUtils.getPraramValue("showCustonTousseAmount", ""); - Boolean showCustonTousseAmount = Boolean.valueOf(showCustonTousseAmountStr); - List dataSource = jasperReportManager.getMonthReportData(startDate, endDate, department,tousseType,disposableGoodsType,showCustonTousseAmount); - boolean applyMonthReportOneColumnTemplate = CssdUtils.getSystemSetConfigByNameBool("applyMonthReportOneColumnTemplate"); - if(applyMonthReportOneColumnTemplate){ - Map> columnTitleColumnNameMap = new HashMap<>(); - for(MonthReportBean bean : dataSource){ + // 增加物品类型 + String tousseType = StrutsParamUtils.getPraramValue("tousseType", + ""); + String disposableGoodsType = StrutsParamUtils.getPraramValue( + "disposableGoodsType", ""); + String showCustonTousseAmountStr = StrutsParamUtils.getPraramValue( + "showCustonTousseAmount", ""); + Boolean showCustonTousseAmount = Boolean + .valueOf(showCustonTousseAmountStr); + List dataSource = jasperReportManager + .getMonthReportData(startDate, endDate, department, + tousseType, disposableGoodsType, + showCustonTousseAmount); + + boolean applyMonthReportOneColumnTemplate = CssdUtils + .getSystemSetConfigByNameBool("applyMonthReportOneColumnTemplate"); + // 如果启用了仅仅显示价格,不显示数量的核算月报模板 + boolean applyMonthReportOnlyPriceTemplate = CssdUtils + .getSystemSetConfigByNameBool("applyMonthReportOnlyPriceTemplate"); + + if (applyMonthReportOneColumnTemplate) { + Map> columnTitleColumnNameMap = new HashMap<>(); + for (MonthReportBean bean : dataSource) { String title = bean.getColumnTitle(); - Set columnNames = columnTitleColumnNameMap.get(title); - if(columnNames == null){ + Set columnNames = columnTitleColumnNameMap + .get(title); + if (columnNames == null) { columnNames = new HashSet(); columnTitleColumnNameMap.put(title, columnNames); } columnNames.add(bean.getColumnName()); } boolean onlyOneColumn = true; - for(Entry> entry : columnTitleColumnNameMap.entrySet()){ - if(entry.getValue().size() > 1){ + for (Entry> entry : columnTitleColumnNameMap + .entrySet()) { + if (entry.getValue().size() > 1) { onlyOneColumn = false; } } - if(onlyOneColumn){ - requestParameters.put("jasperreportName", "monthReportOneColumn.jasper"); + if (onlyOneColumn) { + requestParameters.put("jasperreportName", + "monthReportOneColumn.jasper"); } + return dataSource; + + } else if (applyMonthReportOnlyPriceTemplate) { + + List myDataSource = new ArrayList(); + + + // 去除掉不是器械包总价的bean + for (int i = dataSource.size() -1 ;i>=0;i--){ + MonthReportBean bean = dataSource.get(i); + if (!"器械包总价".equals(bean.getColumnName())){ + dataSource.remove(i); + } + } + + // 合并相同科室的数据 + Map distinctMap = new HashMap(); + for (MonthReportBean bean : dataSource){ + String depart = bean.getDepartment(); + MonthReportBean existBean = distinctMap.get(depart); + if (existBean == null){ + distinctMap.put(depart, bean); + } + else{ + existBean.setMoney( existBean.getMoney() + bean.getMoney()); + } + } + + + + + + // 记录总条数,增加合计统计信息,所以行数增加1 + int totalSize = distinctMap.size() + 1; + + // 每行2列,计算总行数 + int totalRowNumber = totalSize / 2; + if (totalSize % 2 != 0){ + totalRowNumber++; + } + + // 转为ArrayList,TODO:需要增加排序的方法,对按科室进行排序 + List beans = new ArrayList(distinctMap.values()); + + for (int i=0;i getParametMap(String reportName) { + public Map getParametMap(String reportName) { Map map = new HashMap(); // 设置子报表的默认位置 @@ -2567,7 +2673,7 @@ * @param reportName 报表模块名称 * @return */ - private Map getParameterMap(String reportName) { + public Map getParameterMap(String reportName) { Map map = new HashMap(); String rootPath = StrutsParamUtils.getRequest().getSession() .getServletContext().getRealPath(""); Index: ssts-web/src/main/webapp/disinfectsystem/config/ggsrmyy/config.js =================================================================== diff -u -r25158 -r25167 --- ssts-web/src/main/webapp/disinfectsystem/config/ggsrmyy/config.js (.../config.js) (revision 25158) +++ ssts-web/src/main/webapp/disinfectsystem/config/ggsrmyy/config.js (.../config.js) (revision 25167) @@ -196,5 +196,8 @@ //是否限制同一个手术间只能登记一个未审核的使用记录 limitOneOperationRoomCanOnlyRegistOneUnAuditedUseRecord : true, // 是否统计一次性物品发放数量(年度消毒供应中心工作量报表) - statisticDisposableGoodsSendAmount : true + statisticDisposableGoodsSendAmount : true, + monthReportName:"科室领用供应室物品报表", + applyMonthReportOnlyPriceTemplate:true + } \ No newline at end of file Index: ssts-web/src/main/webapp/jasperRtp/monthReportOnlyPrice.jasper =================================================================== diff -u Binary files differ Index: ssts-reports/src/main/java/com/forgon/disinfectsystem/jasperreports/javabeansource/MonthReportBeanWith2Column.java =================================================================== diff -u --- ssts-reports/src/main/java/com/forgon/disinfectsystem/jasperreports/javabeansource/MonthReportBeanWith2Column.java (revision 0) +++ ssts-reports/src/main/java/com/forgon/disinfectsystem/jasperreports/javabeansource/MonthReportBeanWith2Column.java (revision 25167) @@ -0,0 +1,69 @@ +package com.forgon.disinfectsystem.jasperreports.javabeansource; + +/** + * @author Terry Kwan + * 一行显示2列的报表 + * + */ +public class MonthReportBeanWith2Column { + + private int index; + + private String department; + + private Double money; + + private String department2; + + private Double money2; + + public int getIndex() { + return index; + } + + + public void setIndex(int index) { + this.index = index; + } + + + public String getDepartment() { + return department; + } + + + public void setDepartment(String department) { + this.department = department; + } + + + public Double getMoney() { + return money; + } + + + public void setMoney(Double money) { + this.money = money; + } + + + public String getDepartment2() { + return department2; + } + + + public void setDepartment2(String department2) { + this.department2 = department2; + } + + + public Double getMoney2() { + return money2; + } + + + public void setMoney2(Double money2) { + this.money2 = money2; + } + +}