Index: ssts-reports/src/main/java/com/forgon/disinfectsystem/jasperreports/javabeansource/TousseWorkLoadChildVO.java =================================================================== diff -u -r33957 -r35392 --- ssts-reports/src/main/java/com/forgon/disinfectsystem/jasperreports/javabeansource/TousseWorkLoadChildVO.java (.../TousseWorkLoadChildVO.java) (revision 33957) +++ ssts-reports/src/main/java/com/forgon/disinfectsystem/jasperreports/javabeansource/TousseWorkLoadChildVO.java (.../TousseWorkLoadChildVO.java) (revision 35392) @@ -11,8 +11,11 @@ * 器械包名称 */ private String tousseName; + /** + * 器械包分组 + */ + private String tousseGroupName; - /** * 申请数量 */ @@ -72,10 +75,18 @@ * 签收数量 */ private Integer signAmount = 0; - + /** + * 打包包数 + */ private Integer packagingAmount = 0; - + /** + * 打包件数 + */ private Integer packagingMaterialAmount = 0; + /** + * 发货中加急的包数量 + */ + private Integer invoiceUrgent = 0; public String getTousseName() { return tousseName; } @@ -203,5 +214,21 @@ public void setPackagingMaterialAmount(Integer packagingMaterialAmount) { this.packagingMaterialAmount = packagingMaterialAmount; } + + public Integer getInvoiceUrgent() { + return invoiceUrgent; + } + + public void setInvoiceUrgent(Integer invoiceUrgent) { + this.invoiceUrgent = invoiceUrgent; + } + + public String getTousseGroupName() { + return tousseGroupName; + } + + public void setTousseGroupName(String tousseGroupName) { + this.tousseGroupName = tousseGroupName; + } } Index: ssts-reports/src/main/java/com/forgon/disinfectsystem/jasperreports/service/JasperReportManagerImpl.java =================================================================== diff -u -r35357 -r35392 --- ssts-reports/src/main/java/com/forgon/disinfectsystem/jasperreports/service/JasperReportManagerImpl.java (.../JasperReportManagerImpl.java) (revision 35357) +++ ssts-reports/src/main/java/com/forgon/disinfectsystem/jasperreports/service/JasperReportManagerImpl.java (.../JasperReportManagerImpl.java) (revision 35392) @@ -10,6 +10,7 @@ import java.sql.ResultSet; import java.sql.SQLException; import java.sql.Timestamp; +import java.text.Collator; import java.text.DecimalFormat; import java.text.ParseException; import java.text.SimpleDateFormat; @@ -14390,8 +14391,33 @@ @Override public List getTousseWorkLoadData(String instrumentSetTypes, String startTime, String endTime, String departCoding, String tousseTypes, String operator, - String isDisableIDCard, String taskGroup, String tousseGroup, boolean showAsTousseSplitAmount, String sterilizationMode, String packageType, String applicationDepart, String groupIds, String queryType, String isProxyDisinfection) { + String isDisableIDCard, String taskGroup, String tousseGroup, boolean showAsTousseSplitAmount, String sterilizationMode, String packageType, String applicationDepart, String groupIds, String queryType, String isProxyDisinfection + ,Map parametMap) { long begin = System.currentTimeMillis(); + String extendedColumnConfigOfTousseWork = CssdUtils.getSystemSetConfigByName("extendedColumnConfigOfTousseWork"); + boolean queryTousseGroupName = false; + boolean queryUrgentAmount = false; + boolean queryPackagingAmount = false; + if(StringUtils.isNotBlank(extendedColumnConfigOfTousseWork)){ + JSONArray arr = JSONArray.fromObject(extendedColumnConfigOfTousseWork); + for (int i = 0; i < arr.size(); i++) { + String extendedColumnName = arr.get(i).toString().trim(); + if(StringUtils.isBlank(extendedColumnName)){ + continue; + } + if("toussegroupname".equals(extendedColumnName.toLowerCase()) && !"sumQuery".equals(queryType)){//汇总方式不显示器械包分组 + queryTousseGroupName = true; + parametMap.put("queryTousseGroupName", true); + }else if("urgentamount".equals(extendedColumnName.toLowerCase())){ + queryUrgentAmount = true; + parametMap.put("queryUrgentAmount", true); + }else if("packagingamount".equals(extendedColumnName.toLowerCase())){ + queryPackagingAmount = true; + parametMap.put("queryPackagingAmount", true); + } + } + } + String startDateTime = startTime; if(StringUtils.isNotBlank(startTime) && startTime.trim().length() == 16){ startDateTime = startTime + ":00"; @@ -14462,6 +14488,18 @@ params.selectTousseName = true; params.showAsTousseSplitAmount = showAsTousseSplitAmount; params.isGroup = true; + String queryMaxTousseGroupNameSql = ""; + String queryTousseGroupNameSql = ""; + String tdcTousseGroupNameSQL = ""; + String maxTdcTousseGroupNameSQL = ""; + String nullTousseGroupNameSQL = ""; + if(queryTousseGroupName){ + queryMaxTousseGroupNameSql = ",max(tousseGroupName) tousseGroupName "; + queryTousseGroupNameSql = ",tousseGroupName "; + tdcTousseGroupNameSQL = ",tdc.tousseGroupName tousseGroupName "; + maxTdcTousseGroupNameSQL = ",max(tdc.tousseGroupName) tousseGroupName "; + nullTousseGroupNameSQL = ", null tousseGroupName "; + } params.applicationDepart = applicationDepart; String statisticTousseWorkLoadIncludeDisposableGoodsAmountStr = CssdUtils.getSystemSetConfigByName("statisticTousseWorkLoadIncludeDisposableGoodsAmount"); JSONObject statisticTousseWorkLoadIncludeDisposableGoodsAmountObj = null; @@ -14500,7 +14538,8 @@ }else if("否".equals(isProxyDisinfection)){ params.extraQuery = " and ip.type<>'"+ InvoicePlan.TYPE_PROXYDISINFECTION +"'" + instrumentSetTypeSetSql; } - String applicationSql = String.format("select 'application' type,tl.tousseName,amount ,tl.tousseType from (" + params.extraSelectColumns = maxTdcTousseGroupNameSQL; + String applicationSql = String.format("select 'application' type,tl.tousseName,amount ,tl.tousseType"+ queryTousseGroupNameSql +" from (" +dataIndex.getWorkAmountByPackageSQL("申请数量", params) + ") tl"); String sql = applicationSql; @@ -14512,15 +14551,15 @@ params.extraQuery = " and (rr.recyclingApplication_id is null or rr.recyclingApplication_id not in (select id from InvoicePlan where type='"+ InvoicePlan.TYPE_PROXYDISINFECTION +"')) " + instrumentSetTypeSetSql; } sql += " union all "; - String recycSql = String.format("select 'recyc' type,tl.tousseName,amount ,tl.tousseType from (" + String recycSql = String.format("select 'recyc' type,tl.tousseName,amount ,tl.tousseType"+ queryTousseGroupNameSql +" from (" +dataIndex.getWorkAmountByPackageSQL("回收数量", params) + ") tl"); sql += recycSql; querySqlList.add(recycSql); //清点数量(按包统计) sql += " union all "; - String inventorySql = String.format("select 'inventory' type,tl.tousseName,amount ,tl.tousseType from (" + String inventorySql = String.format("select 'inventory' type,tl.tousseName,amount ,tl.tousseType"+ queryTousseGroupNameSql +" from (" +dataIndex.getWorkAmountByPackageSQL("清点数量", params) + ") tl"); sql += inventorySql; @@ -14530,7 +14569,7 @@ sql += " union all "; int dataSoureOfMaterialsCountOfToussesInReports = CssdUtils.getSystemSetConfigByNameInt("dataSoureOfMaterialsCountOfToussesInReports", 3); //清点数量(按材料统计) - String inventoryMaterialSql = String.format("select 'inventory-material' type,tl.tousseName,amount ,tl.tousseType from (" + String inventoryMaterialSql = String.format("select 'inventory-material' type,tl.tousseName,amount ,tl.tousseType"+ queryTousseGroupNameSql +" from (" +dataIndex.getWorkAmountByMaterialSQL("清点数量", params, dataSoureOfMaterialsCountOfToussesInReports) + ") tl"); sql += inventoryMaterialSql; @@ -14542,18 +14581,30 @@ }else if("否".equals(isProxyDisinfection)){ params.extraQuery = " and (ci.invoicePlanID is null or ci.invoicePlanID not in (select id from InvoicePlan where type='"+ InvoicePlan.TYPE_PROXYDISINFECTION +"')) " + instrumentSetTypeSetSql; } - String washSql = String.format("select 'wash' type,tl.tousseName,sum(tl.amount) amount ,tl.tousseType from (" + params.extraSelectColumns = ""; + params.extraSelectColumns1 = maxTdcTousseGroupNameSQL; + params.extraSelectColumns2 = tdcTousseGroupNameSQL; + String washSql = String.format("select 'wash' type,tl.tousseName,sum(tl.amount) amount ,tl.tousseType"+ queryMaxTousseGroupNameSql +" from (" +dataIndex.getWorkAmountByPackageSQL("清洗数量", params) + ") tl group by tl.tousseType,tl.tousseName "); sql += washSql; querySqlList.add(washSql); + params.extraSelectColumns1 = tdcTousseGroupNameSQL; + params.extraSelectColumns2 = tdcTousseGroupNameSQL; + params.extraSelectColumns3 = tdcTousseGroupNameSQL; + params.extraSelectColumns4 = nullTousseGroupNameSQL; //清洗数量(按材料统计) sql += " union all "; - String washMaterialSql = String.format("select 'wash-material' type,tl.tousseName,sum(tl.amount) amount ,tl.tousseType from (" + String washMaterialSql = String.format("select 'wash-material' type,tl.tousseName,sum(tl.amount) amount ,tl.tousseType"+ queryMaxTousseGroupNameSql +" from (" +dataIndex.getWorkAmountByMaterialSQL("清洗数量", params, dataSoureOfMaterialsCountOfToussesInReports) + ") tl group by tl.tousseType,tl.tousseName "); + params.extraSelectColumns1 = ""; + params.extraSelectColumns2 = ""; + params.extraSelectColumns3 = ""; + params.extraSelectColumns4 = ""; sql += washMaterialSql; - querySqlList.add(washMaterialSql); + querySqlList.add(washMaterialSql); + params.extraSelectColumns = maxTdcTousseGroupNameSQL; //清洗数量(按包统计) if("是".equals(isProxyDisinfection)){ params.extraQuery = " and ti.proxyDisinfection_id is not null " + instrumentSetTypeSetSql; @@ -14562,7 +14613,7 @@ } //装配数量(按包统计) sql += " union all "; - String packingSql = String.format("select 'packing' type,tl.tousseName,sum(tl.amount) amount ,tl.tousseType from (" + String packingSql = String.format("select 'packing' type,tl.tousseName,sum(tl.amount) amount ,tl.tousseType"+ queryMaxTousseGroupNameSql +" from (" +dataIndex.getWorkAmountByPackageSQL("配包数量", params) + ") tl group by tl.tousseType,tl.tousseName "); sql += packingSql; @@ -14574,24 +14625,22 @@ } //装配数量(按材料统计) sql += " union all "; - String packingMaterialSql = String.format("select 'packing-material' type,tl.tousseName,sum(tl.amount) amount ,tl.tousseType from (" + String packingMaterialSql = String.format("select 'packing-material' type,tl.tousseName,sum(tl.amount) amount ,tl.tousseType"+ queryMaxTousseGroupNameSql +" from (" +dataIndex.getWorkAmountByMaterialSQL("配包数量", params, dataSoureOfMaterialsCountOfToussesInReports) + ") tl group by tl.tousseType,tl.tousseName "); sql += packingMaterialSql; querySqlList.add(packingMaterialSql); - // 是否在装配界面显示包装人,默认值为false - boolean enablePackagingRecordFunction = CssdUtils.getSystemSetConfigByNameBool("enablePackagingRecordFunction", false); - if(enablePackagingRecordFunction){ + if(queryPackagingAmount){ //打包数量(按包统计) sql += " union all "; - String packagingSql = String.format("select 'packaging' type,tl.tousseName,sum(tl.amount) amount ,tl.tousseType from (" + String packagingSql = String.format("select 'packaging' type,tl.tousseName,sum(tl.amount) amount ,tl.tousseType"+ queryMaxTousseGroupNameSql +" from (" +dataIndex.getWorkAmountByPackageSQL("打包数量", params) + ") tl group by tl.tousseType,tl.tousseName "); sql += packingSql; querySqlList.add(packagingSql); //打包数量(按材料统计) sql += " union all "; - String packagingMaterialSql = String.format("select 'packaging-material' type,tl.tousseName,sum(tl.amount) amount ,tl.tousseType from (" + String packagingMaterialSql = String.format("select 'packaging-material' type,tl.tousseName,sum(tl.amount) amount ,tl.tousseType"+ queryMaxTousseGroupNameSql +" from (" +dataIndex.getWorkAmountByMaterialSQL("打包数量", params, dataSoureOfMaterialsCountOfToussesInReports) + ") tl group by tl.tousseType,tl.tousseName "); sql += packingMaterialSql; @@ -14607,15 +14656,15 @@ // isDisableIDCardSqlWithAliasOfTousseDefinitionIsTi,taskGroupSqlWithAliasOfTousseDefinitionIsTi,tousseGroupSqlWithAliasOfTousseDefinitionIsTi, // departCoding,startDateSql,endDateSql,Constants.STR_YES,Constants.STR_YES,getAndSql("t.reviewer", operator),tousseTypeSqlWithAliasOfTousseDefinitionIsTi); - String reviewSql = String.format("select 'review' type,tl.tousseName,sum(tl.amount) amount ,tl.tousseType from (" + String reviewSql = String.format("select 'review' type,tl.tousseName,sum(tl.amount) amount ,tl.tousseType"+ queryMaxTousseGroupNameSql +" from (" +dataIndex.getWorkAmountByPackageSQL("审核数量", params) + ") tl group by tl.tousseType,tl.tousseName "); sql += reviewSql; querySqlList.add(reviewSql); //灭菌数量(按包统计) sql += " union all "; - String sterilizationSql = String.format("select 'sterilization' type,tl.tousseName,sum(tl.amount) amount ,tl.tousseType from (" + String sterilizationSql = String.format("select 'sterilization' type,tl.tousseName,sum(tl.amount) amount ,tl.tousseType"+ queryMaxTousseGroupNameSql +" from (" +dataIndex.getWorkAmountByPackageSQL("灭菌数量", params) + ") tl group by tl.tousseType,tl.tousseName "); sql += sterilizationSql; @@ -14627,27 +14676,33 @@ } //发货数量(按包统计) sql += " union all "; - String invoiceSql = String.format("select 'invoice' type,tl.tousseName,sum(tl.amount) amount,tl.tousseType from (" + String invoiceSql = String.format("select 'invoice' type,tl.tousseName,sum(tl.amount) amount,tl.tousseType"+ queryMaxTousseGroupNameSql +" from (" +dataIndex.getWorkAmountByPackageSQL("发货数量", params) + ") tl group by tl.tousseName,tl.tousseType "); sql += invoiceSql; querySqlList.add(invoiceSql); - + if(queryUrgentAmount){ + String urgentAmountSql = String.format("select 'invoiceUrgent' type,tl.tousseName,sum(tl.amount) amount,tl.tousseType"+ queryMaxTousseGroupNameSql +" from (" + +dataIndex.getWorkAmountByPackageSQL("发货中包含加急的包数量", params) + + ") tl group by tl.tousseName,tl.tousseType "); + sql += " union all " + urgentAmountSql; + querySqlList.add(urgentAmountSql); + } //发货数量(按材料数量统计) sql += " union all "; if(statisticTousseWorkLoadIncludeDisposableGoodsAmountObj !=null){ params.includeDisposableGoodsInTousse = statisticTousseWorkLoadIncludeDisposableGoodsAmountObj.optBoolean("发货", false); }else{ params.includeDisposableGoodsInTousse = false; } - params.extraSelectColumns = " ,td.name tousseName,td.tousseType"; + params.extraSelectColumns = maxTdcTousseGroupNameSQL + ",td.name tousseName,td.tousseType"; params.groupBySql = " group by td.name,td.tousseType"; - String invoiceMaterialSql = String.format("select 'invoice-material' type,tl.tousseName,sum(tl.amount) amount,tl.tousseType from (" + String invoiceMaterialSql = String.format("select 'invoice-material' type,tl.tousseName,sum(tl.amount) amount,tl.tousseType"+ queryMaxTousseGroupNameSql +" from (" +dataIndex.getWorkAmountByMaterialSQL("发货数量", params, dataSoureOfMaterialsCountOfToussesInReports) + ") tl group by tl.tousseName,tl.tousseType "); sql += invoiceMaterialSql; querySqlList.add(invoiceMaterialSql); - params.extraSelectColumns = ""; + params.extraSelectColumns = maxTdcTousseGroupNameSQL; params.groupBySql = ""; if("是".equals(isProxyDisinfection)){ params.extraQuery = " and ti.proxyDisinfection_id is not null " + instrumentSetTypeSetSql; @@ -14656,16 +14711,20 @@ } //签收数量(按包统计) sql += " union all "; - String signedSql = String.format("select 'signed' type,tl.tousseName,sum(tl.amount) amount,tl.tousseType from (" + String signedSql = String.format("select 'signed' type,tl.tousseName,sum(tl.amount) amount,tl.tousseType"+ queryMaxTousseGroupNameSql +" from (" +dataIndex.getWorkAmountByPackageSQL("签收数量", params) + ") tl group by tl.tousseName,tl.tousseType "); sql += signedSql; querySqlList.add(signedSql); - Map> typeOfChild = new HashMap>(); + Map> typeOfChild = new LinkedHashMap>(); GoodsOption option = goodsOptionManager.getGoodsOption(GoodsOption.MODEL_TOUSSEWORKLOAD, departCoding); logger.debug(" 器械包工作量统计报表后台查询sql...=" + sql); //ResultSet result = objectDao.executeSql(sql); + Set tousseGroupNames = null;//器械包分组组数 + if(queryTousseGroupName){ + tousseGroupNames = new HashSet(); + } try { // 若用户自定义了需要查询的器械包,则根据自定义查询,否则查全部的器械包 HashMap selectedTousseNameMap = new HashMap(); @@ -14732,6 +14791,13 @@ if (child == null) { child = new TousseWorkLoadChildVO(); child.setTousseName(tousseName); + if(queryTousseGroupName){ + String tousseGroupName = (String)tousseWorkLoadObjectArray[4]; + if(StringUtils.isNotBlank(tousseGroupName)){ + child.setTousseGroupName(tousseGroupName); + tousseGroupNames.add(tousseGroupName); + } + } nameOfChild.put(tousseName, child); } setVoAmount(type, amount, child); @@ -14740,20 +14806,31 @@ } catch (Exception e) { e.printStackTrace(); } - + if(queryTousseGroupName){ + parametMap.put("tousseGroupNameAmount", tousseGroupNames.size()); + } List list = new ArrayList(); Set>> entrySet1 = typeOfChild.entrySet(); + Comparator sortByCHINA = new Comparator() { + @Override + public int compare(TousseWorkLoadChildVO o1, TousseWorkLoadChildVO o2) { + //排序规则:按照汉字拼音首字母排序 + Comparator com = Collator.getInstance(java.util.Locale.CHINA); + return com.compare(o1.getTousseName(), o2.getTousseName()); + } + }; for (Entry> entry : entrySet1) { HashMap value = entry.getValue(); //每种器械包类型,至少有一种包,才在报表显示 if (value.size() > 0) { TousseWorkLoadVO vo = new TousseWorkLoadVO(); vo.setTousseType(entry.getKey()); Set> entrySet2 = value.entrySet(); - List childList = new LinkedList(); + List childList = new ArrayList(); for (Entry e : entrySet2) { childList.add(e.getValue()); } + Collections.sort(childList, sortByCHINA); vo.setChildrens(childList); list.add(vo); } @@ -14880,7 +14957,12 @@ String tousseName = rs.getString(2); Integer amount = rs.getInt(3); String tousseType = rs.getString(4); - result.add(new Object[]{type, tousseName , amount , tousseType}); + if(SqlUtils.isExistColumn(rs, "tousseGroupName")){ + result.add(new Object[]{type, tousseName , amount , tousseType, rs.getString("tousseGroupName")}); + }else{ + result.add(new Object[]{type, tousseName , amount , tousseType}); + } + } }catch(Exception e){ e.printStackTrace(); @@ -15164,6 +15246,8 @@ childVO.setPackagingAmount(childVO.getPackagingAmount()+amount); }else if("packaging-material".equals(type)){ childVO.setPackagingMaterialAmount(childVO.getPackagingMaterialAmount()+amount); + }else if("invoiceUrgent".equals(type)){ + childVO.setInvoiceUrgent(childVO.getInvoiceUrgent() + amount); } } Index: ssts-reports/src/main/java/com/forgon/disinfectsystem/jasperreports/action/JasperreportsAction.java =================================================================== diff -u -r35349 -r35392 --- ssts-reports/src/main/java/com/forgon/disinfectsystem/jasperreports/action/JasperreportsAction.java (.../JasperreportsAction.java) (revision 35349) +++ ssts-reports/src/main/java/com/forgon/disinfectsystem/jasperreports/action/JasperreportsAction.java (.../JasperreportsAction.java) (revision 35392) @@ -1834,7 +1834,7 @@ } String isProxyDisinfection = StrutsParamUtils.getPraramValue("isProxyDisinfection", ""); if(StringUtils.isNotBlank(startDay) && StringUtils.isNotBlank(endDay)){ - return jasperReportManager.getTousseWorkLoadData(instrumentSetTypes, startDay,endDay,departCoding,tousseTypes,operator,isDisableIDCard,taskGroup,tousseGroupName,showAsTousseSplitAmount,sterilizationMode,packageType,applicationDepart, groupIds, queryType, isProxyDisinfection); + return jasperReportManager.getTousseWorkLoadData(instrumentSetTypes, startDay,endDay,departCoding,tousseTypes,operator,isDisableIDCard,taskGroup,tousseGroupName,showAsTousseSplitAmount,sterilizationMode,packageType,applicationDepart, groupIds, queryType, isProxyDisinfection,parametMap); } }else if(reportName.equals("tousseWorkLoadForDLZXYY")){ String yyyyMM = StrutsParamUtils.getPraramValue("yyyyMM", ""); Index: ssts-reports/src/main/java/com/forgon/disinfectsystem/jasperreports/service/JasperReportManager.java =================================================================== diff -u -r35349 -r35392 --- ssts-reports/src/main/java/com/forgon/disinfectsystem/jasperreports/service/JasperReportManager.java (.../JasperReportManager.java) (revision 35349) +++ ssts-reports/src/main/java/com/forgon/disinfectsystem/jasperreports/service/JasperReportManager.java (.../JasperReportManager.java) (revision 35392) @@ -534,12 +534,14 @@ * @param applicationDepart 申请科室(因为ClassifiedItem 没有记申请科室编码 所以这里用名称) * @param querytype 查询类型 sumQuery or detailQuery * @param 是否代理灭菌 用于查询供应室处理的代理灭菌单(不包含外部代理灭菌单)上的物品 GDSZYY-161 + * @param parametMap 报表参数 map * @return */ public List getTousseWorkLoadData( String instrumentSetTypes, String startTime,String endTime, String departCoding,String tousseTypes, String operator, - String isDisableIDCard, String taskGroup, String tousseGroup, boolean showAsTousseSplitAmount, String sterilizationMode, String packageType, String applicationDepart, String groupIds, String querytype, String isProxyDisinfection); + String isDisableIDCard, String taskGroup, String tousseGroup, boolean showAsTousseSplitAmount, String sterilizationMode, String packageType, String applicationDepart, String groupIds, String querytype, String isProxyDisinfection + ,Map parametMap); /** * 获取定制供应室工作量统计报表 DLZXYY-11 * @param yyyyMM 年月 如 2022-01