Index: ssts-reports/src/main/java/com/forgon/disinfectsystem/jasperreports/service/JasperReportManagerImpl.java =================================================================== diff -u -r35574 -r35596 --- ssts-reports/src/main/java/com/forgon/disinfectsystem/jasperreports/service/JasperReportManagerImpl.java (.../JasperReportManagerImpl.java) (revision 35574) +++ ssts-reports/src/main/java/com/forgon/disinfectsystem/jasperreports/service/JasperReportManagerImpl.java (.../JasperReportManagerImpl.java) (revision 35596) @@ -6384,6 +6384,39 @@ addTousseDefinitionAtWhere = " left join TousseDefinition td on td.id = ii.tousseDefinitionId "; unitSqlOftousseDefinitionSql = ",td.unit "; } + + String extendedColumnConfigOfDetailedAccountingMonthlyReport = CssdUtils.getSystemSetConfigByName("extendedColumnConfigOfDetailedAccountingMonthlyReport"); + boolean queryTousseGroupName = false;//是否查询器械包分组 + String nullTousseGroupNameSQL = ""; + String tdcTousseGroupNameSQL = ""; + String tdLeftJoinTdcSQL = ""; + extendedColumnConfigOfDetailedAccountingMonthlyReport = "[\"tousseGroupName\"]"; + if(StringUtils.isNotBlank(extendedColumnConfigOfDetailedAccountingMonthlyReport)){ + JSONArray arr = JSONArray.fromObject(extendedColumnConfigOfDetailedAccountingMonthlyReport); + for (int i = 0; i < arr.size(); i++) { + String extendedColumnName = arr.get(i).toString().trim(); + if(StringUtils.isBlank(extendedColumnName)){ + continue; + } + if("tousseGroupName".equals(extendedColumnName)){ + queryTousseGroupName = true; + tdcTousseGroupNameSQL = ",tdc.tousseGroupName "; + nullTousseGroupNameSQL = ",null tousseGroupName "; + tdLeftJoinTdcSQL = " left join TousseDefinition tdc on tdc.id=td.ancestorID "; + } + } + } + if(queryTousseGroupName){ + if(StringUtils.isBlank(addTousseDefinitionAtWhere)){ + addTousseDefinitionAtWhere += " left join TousseDefinition td on td.id = ii.tousseDefinitionId " + + "left join TousseDefinition tdc on tdc.id=td.ancestorID "; + }else{ + addTousseDefinitionAtWhere += " left join TousseDefinition tdc on tdc.id=td.ancestorID "; + } + if(queryUrgent){ + tousseInstanceJoinTousseDefinitionSql += " join TousseDefinition tdc on tdc.id=td.ancestorID "; + } + } String noQueryUnitSql = ""; //通过DiposableGoodsItem查询一次性物品单位的相关sql String unitDSqlOfDiposableGoodsItem = ""; @@ -6699,13 +6732,19 @@ if(showSendTime){ sendTimeOfT = ",sendTime "; } + String tousseGroupNameOfT = ""; + if(queryTousseGroupName){ + tousseGroupNameOfT = ",tousseGroupName "; + } String groupBySql = "group by i.depart" + + tdcTousseGroupNameSQL + groupByIsendTimeOfShowTime + groupByIsendTime + unitSqlOftousseDefinitionSql +",i.settleAccountsDepart,td.tousseType,td.name,td.id " + tousseDefinitionOfSupplierNameSql + integralOftousseDefinitionSql; String groupBySqlOfT = "group by depart" + showTimeOfT + sendTimeOfT + + tousseGroupNameOfT + getRemovePrefixSql(unitSqlOftousseDefinitionSql) +",settleAccountsDepart,type,name,tousseDefinitionId " + getRemovePrefixSql(tousseDefinitionOfSupplierNameSql) @@ -6718,6 +6757,7 @@ + ",name,sum(amount) amount,sum(settlementprice) settlementprice,sum(settlementDiscountPrice) settlementDiscountPrice,type" + getRemovePrefixSql(unitSqlOftousseDefinitionSql) + ",'' as batchNumber,null as expDate,tousseDefinitionId" + + tousseGroupNameOfT + " from ( select " + tousseInstanceMaterialAmountSql +" i.depart,i.settleAccountsDepart " @@ -6728,7 +6768,9 @@ +",td.name,count(*) as amount," +"sum(ti.price) as settlementprice,sum(ti.discountPrice) as settlementDiscountPrice,td.tousseType as type" + unitSqlOftousseDefinitionSql - + ",'' as batchNumber,null as expDate,td.id as tousseDefinitionId from invoice i " + + ",'' as batchNumber,null as expDate,td.id as tousseDefinitionId" + + tdcTousseGroupNameSQL + + " from invoice i " + "join TousseInstance ti on ti.invoice_id=i.id " + tousseInstanceJoinTousseDefinitionSql + " where " @@ -6752,7 +6794,9 @@ +",td.name,count(*) as amount," +"sum(ti.price) as settlementprice,sum(ti.discountPrice) as settlementDiscountPrice,td.tousseType as type" + unitSqlOftousseDefinitionSql - + ",'' as batchNumber,null as expDate,td.id as tousseDefinitionId from invoice i " + + ",'' as batchNumber,null as expDate,td.id as tousseDefinitionId" + + tdcTousseGroupNameSQL + + " from invoice i " + "join TousseInstance ti on ti.invoice2_id=i.id " + tousseInstanceJoinTousseDefinitionSql + " where " @@ -6771,7 +6815,9 @@ tousseSql = " (select "+ tousseMaterialAmountSql +" i.depart,i.settleAccountsDepart "+ iSendTimeSqlOfShowTime + iSendTime + tousseDefinitionOfSupplierNameSql + integralOftousseDefinitionSql +",ii.tousseName as name,sum(ii.amount) as amount," +"sum(ii.settlementPrice) as settlementprice,sum(ii.settlementDiscountPrice) as settlementDiscountPrice,ii.tousseType as type" + unitSqlOftousseDefinitionSql - + ",'' as batchNumber,null as expDate,ii.tousseDefinitionId as tousseDefinitionId from invoice i" + + ",'' as batchNumber,null as expDate,ii.tousseDefinitionId as tousseDefinitionId " + + tdcTousseGroupNameSQL + + "from invoice i" + " join InvoiceItem ii on i.id = ii.invoice_id " + addTousseDefinitionAtWhere + " where ii.diposable = '否' and ii.expensiveGoodsInstanceId is null and "+ getHandleDeptCodeSql("i.orgUnitCoding", isSupplyRoomUserOrIsExpensiveGoodsSupplyRoomUser, orgUnitCoding) @@ -6780,7 +6826,7 @@ + departFilterSql + typeFilterSql + goodsNameFilterSql - + " and i.settleaccountsdepart is not null group by i.depart"+ groupByIsendTimeOfShowTime + groupByIsendTime + unitSqlOftousseDefinitionSql +",i.settleAccountsDepart,ii.tousseType,ii.tousseName,ii.tousseDefinitionId " + tousseDefinitionOfSupplierNameSql + integralOftousseDefinitionSql + ")"; + + " and i.settleaccountsdepart is not null group by i.depart"+ tdcTousseGroupNameSQL + groupByIsendTimeOfShowTime + groupByIsendTime + unitSqlOftousseDefinitionSql +",i.settleAccountsDepart,ii.tousseType,ii.tousseName,ii.tousseDefinitionId " + tousseDefinitionOfSupplierNameSql + integralOftousseDefinitionSql + ")"; } //新的高值耗材(发货) String selectExpensiveGoodsSql = ""; @@ -6789,7 +6835,9 @@ selectExpensiveGoodsSql = " union all (select "+ noMaterialAmountSql +" i.depart,i.settleAccountsDepart"+ iSendTimeSqlOfShowTime + iSendTime + noQuerySupplierName + noQueryIntegralSql +",case when egm.model is null then eg.name else eg.name "+ concatSymbolInDb +" '[' "+ concatSymbolInDb +" egm.model "+ concatSymbolInDb +" ']' end as name,sum(ii.amount) as amount," +"sum(ii.settlementPrice) as settlementprice,sum(ii.settlementDiscountPrice) as settlementDiscountPrice,ii.tousseType as type" + noQueryUnitSql - + ",'' as batchNumber,ei.expDate as expDate,0 as tousseDefinitionId from " + Invoice.class.getSimpleName() + " i join " + + ",'' as batchNumber,ei.expDate as expDate,0 as tousseDefinitionId" + + nullTousseGroupNameSQL + + " from " + Invoice.class.getSimpleName() + " i join " + InvoiceItem.class.getSimpleName()+" ii on i.id = ii.invoice_id join " + ExpensiveGoodsInstance.class.getSimpleName() + " ei on ei.id = ii.expensiveGoodsInstanceId" + " join ExpensiveGoods eg on ei.expensiveGoods_id=eg.id " @@ -6807,6 +6855,7 @@ selectExpensiveGoodsSql += " union all (select "+ noMaterialAmountSql +" i.depart,i.settleAccountsDepart " + iSendTimeSqlOfShowTime + iSendTime + noQuerySupplierName + noQueryIntegralSql +",case when egm.model is null then eg.name else eg.name "+ concatSymbolInDb +" '[' "+ concatSymbolInDb +" egm.model "+ concatSymbolInDb +" ']' end as name,-1 * count(egi.id) as amount,-1 * sum(egi.price) settlementprice,-1 * sum(egi.price) settlementprice,'高值耗材' as type" + noQueryUnitSql + ",null as batchNumber,egi.expDate,null as tousseDefinitionId " + + nullTousseGroupNameSQL + " from ExpensiveGoodsGodownEntry egge join ExpensiveGoodsGodownEntryItem eggei on egge.id=eggei.expensiveGoodsGodownEntry_id " +" join ExpensiveGoodsInstance egi on egi.id=eggei.expensiveGoodsInstanceId " +" join Invoice i on egi.invoiceId=i.id " @@ -6839,7 +6888,9 @@ diposableGoodsSql += " union all (select "+ noMaterialAmountSql +" i.depart,i.settleaccountsdepart "+ iSendTimeSqlOfShowTime + iSendTime + dgbsOfSupplierNameSql+noQueryIntegralSql +",d.name as name,sum(d.amount) as amount," +"sum(d.fluctuationPrice*d.amount) as settlementprice,sum(d.fluctuationPrice*d.amount) as settlementDiscountPrice,'一次性物品' as type" + unitDSqlOfDiposableGoodsItem - + ",d.batch as batchNumber,dgbs.expDate,0 as tousseDefinitionId from invoice i join DiposableGoodsItem d on d.invoice_id=i.id join " + DisposableGoodsBatchStock.class.getSimpleName() + " dgbs on d.disposableGoodsBatchStockID=dgbs.id " + + ",d.batch as batchNumber,dgbs.expDate,0 as tousseDefinitionId " + + nullTousseGroupNameSQL + + " from invoice i join DiposableGoodsItem d on d.invoice_id=i.id join " + DisposableGoodsBatchStock.class.getSimpleName() + " dgbs on d.disposableGoodsBatchStockID=dgbs.id " + invoiceJoinInvoicePlanSql + " where 1=1 and " + getHandleDeptCodeSql("i.orgUnitCoding", isSupplyRoomUserOrIsExpensiveGoodsSupplyRoomUser, orgUnitCoding) @@ -6855,7 +6906,9 @@ diposableGoodsSql += " union all (select "+ noMaterialAmountSql +" i.depart,i.settleaccountsdepart " + iSendTimeSqlOfShowTime + iSendTime + dgbsOfSupplierNameSql+noQueryIntegralSql +",d.name as name,sum(d.amount) as amount," +"sum(d.fluctuationPrice*d.amount) as settlementprice,sum(d.fluctuationPrice*d.amount) as settlementDiscountPrice,'一次性物品' as type" + unitDSqlOfDiposableGoodsItem - + ",d.batch as batchNumber,dgbs.expDate,0 as tousseDefinitionId from invoice i join DiposableGoodsItem d on d.invoice_id=i.id join " + DisposableGoodsBatchStock.class.getSimpleName() + " dgbs on d.disposableGoodsBatchStockID=dgbs.id " + + ",d.batch as batchNumber,dgbs.expDate,0 as tousseDefinitionId" + + nullTousseGroupNameSQL + + " from invoice i join DiposableGoodsItem d on d.invoice_id=i.id join " + DisposableGoodsBatchStock.class.getSimpleName() + " dgbs on d.disposableGoodsBatchStockID=dgbs.id " + invoiceJoinInvoicePlanSql + " where " + getHandleDeptCodeSql("i.orgUnitCoding", isSupplyRoomUserOrIsExpensiveGoodsSupplyRoomUser, orgUnitCoding) @@ -6873,7 +6926,9 @@ diposableGoodsSql += " union all (select "+ noMaterialAmountSql +" i.depart,i.settleaccountsdepart "+ iSendTimeSqlOfShowTime + iSendTime+ dgbsOfSupplierNameSql+noQueryIntegralSql +",d.name as name,sum(d.amount) as amount," +"sum(d.fluctuationPrice*d.amount) as settlementprice,sum(d.fluctuationPrice*d.amount) as settlementDiscountPrice,'一次性物品' as type" + unitDSqlOfDiposableGoodsItem - + ",d.batch as batchNumber,dgbs.expDate,0 as tousseDefinitionId from invoice i join DiposableGoodsItem d on d.invoice_id=i.id join " + DisposableGoodsBatchStock.class.getSimpleName() + " dgbs on d.disposableGoodsBatchStockID=dgbs.id " + + ",d.batch as batchNumber,dgbs.expDate,0 as tousseDefinitionId" + + nullTousseGroupNameSQL + + " from invoice i join DiposableGoodsItem d on d.invoice_id=i.id join " + DisposableGoodsBatchStock.class.getSimpleName() + " dgbs on d.disposableGoodsBatchStockID=dgbs.id " + invoiceJoinInvoicePlanSql + " where 1=1 and " + getHandleDeptCodeSql("i.orgUnitCoding", isSupplyRoomUserOrIsExpensiveGoodsSupplyRoomUser, orgUnitCoding) @@ -6893,7 +6948,9 @@ packingDisposableGoodsSql = " union all (select "+ noMaterialAmountSql +" pr.depart,pr.orgUnitName "+ prPackTimeSqlOfShowTime + noSendTime + dgbsOfSupplierNameSql + noQueryIntegralSql +",dgi.name as name,sum(dgi.amount) as amount," +"sum(dgi.fluctuationPrice*dgi.amount) as settlementprice,sum(dgi.fluctuationPrice*dgi.amount) as settlementDiscountPrice,'一次性物品' as type" + unitDGISqlOfDiposableGoodsItem - + ",dgi.batch as batchNumber,dgbs.expDate,0 as tousseDefinitionId from PackingRecord pr inner join DiposableGoodsItem dgi on pr.id = dgi.packingRecordId " + + ",dgi.batch as batchNumber,dgbs.expDate,0 as tousseDefinitionId" + + nullTousseGroupNameSQL + + " from PackingRecord pr inner join DiposableGoodsItem dgi on pr.id = dgi.packingRecordId " + " inner join " + DisposableGoodsBatchStock.class.getSimpleName() + " dgbs on dgi.disposableGoodsBatchStockID=dgbs.id" + " where " + getHandleDeptCodeSql("pr.orgUnitCoding", isSupplyRoomUserOrIsExpensiveGoodsSupplyRoomUser, orgUnitCoding) @@ -6920,8 +6977,10 @@ +"sum(ii.settlementPrice) as settlementDiscountPrice,'材料' as type" + unitDSqlOfMd + ",'' as batchNumber,null as expDate,td.id as tousseDefinitionId " + + tdcTousseGroupNameSQL + " from MaterialInvoiceItem ii" + " left join TousseDefinition td on td.id= ii.tousseDefinitionId " + + tdLeftJoinTdcSQL + " inner join MaterialInvoice i on i.id = ii.materialInvoice_id " + " inner join materialDefinition d on ii.materialDefinitionId = d.id where " + getHandleDeptCodeSql("i.orgUnitCoding", isSupplyRoomUserOrIsExpensiveGoodsSupplyRoomUser, orgUnitCoding) @@ -6930,14 +6989,15 @@ + iDepartCodingSql + materialNameFilterSql + materialTypeFilterSql - + " group by i.depart"+ groupByIsendTimeOfShowTime + groupByIsendTime + unitDSqlOfMd +",i.settleaccountsdepart,case when td.name is null then ii.materialName else ii.materialName "+ concatSymbolInDb +" '(' "+ concatSymbolInDb +" td.name "+ concatSymbolInDb +"')' end,td.id) "; + + " group by i.depart" + tdcTousseGroupNameSQL + groupByIsendTimeOfShowTime + groupByIsendTime + unitDSqlOfMd +",i.settleaccountsdepart,case when td.name is null then ii.materialName else ii.materialName "+ concatSymbolInDb +" '(' "+ concatSymbolInDb +" td.name "+ concatSymbolInDb +"')' end,td.id) "; } if(StringUtils.isBlank(typeSearch) || "全部".equals(typeSearch) || typeSearch.contains("器械材料")){ // 材料退货 materialReturnSql = " union all (select "+ noMaterialAmountSql +"rr.depart,rr.settleAccountsDepart " + rrReturnTimeSqlOfShowTime + noSendTime + noQuerySupplierName + noQueryIntegralSql +",ii.materialName,-sum(ii.amount),-sum(ii.settlementPrice)," +"-sum(ii.settlementPrice) as settlementDiscountPrice,'材料' as type" + unitDSqlOfMd + ",'' as batchNumber,null as expDate,0 as tousseDefinitionId " + + nullTousseGroupNameSQL + " from ReturnMaterialRecord rr,materialDefinition d," + "ReturnMaterialItem ii where rr.id = ii.returnMaterialRecord_ID " + " and ii.materialDefinitionId = d.id and " @@ -6953,6 +7013,7 @@ +"sum(i.additionalAmount * i.materialCost) as settlementDiscountPrice,'材料' as type" + unitMSqlOfMd + ",'' as batchNumber,null as expDate,0 as tousseDefinitionId " + + nullTousseGroupNameSQL + " from MaterialErrorDamageDetail i left join materialDefinition m on i.materialDefinitionId = m.id where 1=1 and i.errorType = '缺失' and i.type = '"+MaterialErrorDamageDetail.TYPE_ERROR+"' and i.materialName != '器械包标识牌' and i.additionalAmount > 0 and " + getHandleDeptCodeSql("i.handleDepartCode", isSupplyRoomUserOrIsExpensiveGoodsSupplyRoomUser, orgUnitCoding) + lostMaterialFilterSql @@ -6970,6 +7031,7 @@ +"sum(i.materialCost*i.additionalAmount) as settlementDiscountPrice,'材料' as type" + unitMSqlOfMd + ",'' as batchNumber,null as expDate,0 as tousseDefinitionId " + + nullTousseGroupNameSQL + "from MaterialErrorDamageDetail i left join materialDefinition m on i.materialDefinitionId = m.id where 1=1 " + banQuery + " and i.type = '" + MaterialErrorDamageDetail.TYPE_DAMAGE + "' and i.additionalAmount > 0 and " @@ -6997,21 +7059,25 @@ if(queryUnit){ returnGoodsSql += ",td.unit"; } - returnGoodsSql += ",null as batchNumber,null expDate,td.id as tousseDefinitionId from " + returnGoodsSql += ",null as batchNumber,null expDate,td.id as tousseDefinitionId" + + tdcTousseGroupNameSQL + + " from " + ReturnGoodsRecord.class.getSimpleName() + " rr inner join " + ReturnGoodsItem.class.getSimpleName()+ " ri on rr.id = ri.returngoodsrecord_id " + "join " + TousseInstance.class.getSimpleName() +" ti on ti.returnGoodsItem_ID=ri.id " + " join " + TousseDefinition.class.getSimpleName() + " td on td.id=ti.tousseDefinition_id" + + tdLeftJoinTdcSQL + " where " + getHandleDeptCodeSql("rr.handleDepartCode", isSupplyRoomUserOrIsExpensiveGoodsSupplyRoomUser, orgUnitCoding) + returnGoodsFilterSql + urgentSql + rrSettleAccountsDepartCodingSql +" and "+returnGoodsItemPredicate - + " group by rr.depart"; + + " group by rr.depart" + + tdcTousseGroupNameSQL; if(queryUnit){ returnGoodsSql += ",ri.disposableGoodsID,td.unit "; } @@ -7023,16 +7089,20 @@ if(queryUnit){ returnGoodsSql += ",case when ri.disposableGoodsID is not null THEN (select unit from DisposableGoods where id=ri.disposableGoodsID) else td.unit end unit"; } - returnGoodsSql += ",ri.batchNumber as batchNumber,dgbs.expDate,"+returnGoodsTousseDefinitionId+" as tousseDefinitionId from " + ReturnGoodsRecord.class.getSimpleName() + " rr inner join " + returnGoodsSql += ",ri.batchNumber as batchNumber,dgbs.expDate,"+returnGoodsTousseDefinitionId+" as tousseDefinitionId" + + tdcTousseGroupNameSQL + + " from " + ReturnGoodsRecord.class.getSimpleName() + " rr inner join " + ReturnGoodsItem.class.getSimpleName()+ " ri on rr.id = ri.returngoodsrecord_id " + " left join " + TousseDefinition.class.getSimpleName() + " td on td.id = ri.tousseDefinition_id" + + tdLeftJoinTdcSQL + " left join " + DisposableGoodsBatchStock.class.getSimpleName() + " dgbs on ri.disposableGoodsBatchStockID=dgbs.id" + " where " + getHandleDeptCodeSql("rr.handleDepartCode", isSupplyRoomUserOrIsExpensiveGoodsSupplyRoomUser, orgUnitCoding) + returnGoodsFilterSql + rrSettleAccountsDepartCodingSql +" and "+returnGoodsItemPredicate - + " group by rr.depart"; + + " group by rr.depart" + + tdcTousseGroupNameSQL; if(queryUnit){ returnGoodsSql += ",ri.disposableGoodsID,td.unit "; } @@ -7049,6 +7119,7 @@ +"sum(rri.price*rri.amount) as settlementprice,sum(rri.price*rri.amount) as settlementDiscountPrice,rri.type as type" + unitDSqlOfMd + ",dgbs.batchNumber as batchNumber,dgbs.expDate,0 as tousseDefinitionId " + + nullTousseGroupNameSQL +" from ReceiveRecord rr,ReceiveRecordItem rri left join " + DisposableGoodsBatchStock.class.getSimpleName() + " dgbs " +" on rri.diposableGoodBatchStock_id = dgbs.id left join DisposableGoods d on d.id = rri.disposableGoodsId where rr.id = rri.receiveRecord_id and " + getHandleDeptCodeSql("rr.departCoding", isSupplyRoomUserOrIsExpensiveGoodsSupplyRoomUser, orgUnitCoding) @@ -7066,6 +7137,7 @@ +"sum(ged.price*ged.amount) as settlementprice,sum(ged.price*ged.amount) as settlementDiscountPrice,'一次性物品' as type" +unitDGSqlOfDisposableGoods + ",dgbs.batchNumber as batchNumber,dgbs.expDate,0 as tousseDefinitionId " + + nullTousseGroupNameSQL +" from GodownEntry oge inner join GodownEntryDiposableGoodsItem ged on oge.id = ged.godownEntryID inner join DisposableGoodsBatch dgbs on ged.disposableGoodsBatchID=dgbs.id inner join DisposableGoods dg on dgbs.diposablegoods_id = dg.id " +" where oge.type ='退库单' and oge.subType='调拨出库' and " + getHandleDeptCodeSql("oge.orgUnitCode", isSupplyRoomUserOrIsExpensiveGoodsSupplyRoomUser, orgUnitCoding) @@ -7077,7 +7149,8 @@ String stocktakeOutDiposableGoodsSql = " union all (select "+ noMaterialAmountSql +" oge.orgUnitName depart, oge.orgUnitName" +dgbsOfSupplierNameSql+" as settleaccountsdepart"+ ogeTimeSqlOfShowTime + noSendTime + noQueryIntegralSql +",ged.goodsName,sum(ged.amount)," +"sum(ged.price*ged.amount) as settlementprice,sum(ged.price*ged.amount) as settlementDiscountPrice,'一次性物品' as type" +unitDGSqlOfDisposableGoods - + ",dgbs.batchNumber as batchNumber,dgbs.expDate,0 as tousseDefinitionId " + + ",dgbs.batchNumber as batchNumber,dgbs.expDate,0 as tousseDefinitionId " + + nullTousseGroupNameSQL +" from GodownEntry oge inner join GodownEntryDiposableGoodsItem ged on oge.id = ged.godownEntryID inner join DisposableGoodsBatch dgbs on ged.disposableGoodsBatchID=dgbs.id inner join DisposableGoods dg on dgbs.diposablegoods_id = dg.id " +" where oge.type ='退库单' and oge.subType='盘亏出库' and " + getHandleDeptCodeSql("oge.orgUnitCode", isSupplyRoomUserOrIsExpensiveGoodsSupplyRoomUser, orgUnitCoding) @@ -7115,13 +7188,15 @@ } if(!queryUrgent && StringUtils.isNotBlank(typeSearch) && typeSearch.contains(TYPE_CHARGE)){ String chargeSql = String.format(" union all select "+ noMaterialAmountSql +"ci.orgUnitName depart, ci.orgUnitName settleAccountsDepart" + crChargeTimeSqlOfShowTime + noSendTime+ noQueryIntegralSql +",chargeItem name,1 amount,price settlementprice,0 settlementDiscountPrice,'收费项目' type "+ noQueryUnitSql +",'' batchNumber,NULL as expDate ,null as tousseDefinitionId " + + nullTousseGroupNameSQL + " from ChargeRecordItem ci inner join ChargeRecord cr on cr.id=ci.chargeRecord_id where 1=1 %s %s %s %s group by ci.orgUnitName,chargeItem,price,chargeTime " + groupByCrChargeTimeOfShowTime , chargeDepartSql,chargeDateSql,chargeItemSql, ciOrgUnitCodeSql); sql += chargeSql; }else if(!queryUrgent && StringUtils.isBlank(typeSearch)){ sql += String.format(" union all select "+ noMaterialAmountSql +"ci.orgUnitName depart,ci.orgUnitName settleAccountsDepart" + crChargeTimeSqlOfShowTime + noSendTime + noQueryIntegralSql +",chargeItem name,1 amount,price settlementprice,0 settlementDiscountPrice,'收费项目' type "+ noQueryUnitSql +",'' batchNumber,NULL as expDate ,null as tousseDefinitionId " + + nullTousseGroupNameSQL + " from ChargeRecordItem ci inner join ChargeRecord cr on cr.id=ci.chargeRecord_id where 1=1 %s %s %s %s group by ci.orgUnitName,chargeItem,price,chargeTime " + groupByCrChargeTimeOfShowTime , chargeDepartSql,chargeDateSql,chargeItemSql, @@ -7189,6 +7264,9 @@ int disinfectGoodsStatisticAmount = 0; int totalAmount = amount; DepartmentMonthDetailItem mdi = new DepartmentMonthDetailItem(); + if(queryTousseGroupName){ + mdi.setTousseGroupName(rs.getString("tousseGroupName")); + } boolean flag = true; if (TousseDefinition.PACKAGE_TYPE_DISINFECTION.equals(type) || (TousseDefinition.PACKAGE_TYPE_CUSTOM.equals(type) && !showCustonTousseAmount)) { @@ -7319,6 +7397,9 @@ if(showTime){ item.setShowTime(dmiShowTime); } + if(queryTousseGroupName){ + item.setTousseGroupName(dmi.getTousseGroupName()); + } tmpMap.put(key, item); } if(dmi.getMaterialAmount() != null){ @@ -13219,6 +13300,9 @@ String thisStartDate = sdf.format(startDate); Map thisWashAmountMap = washDateAmountMap.containsKey(thisStartDate)?washDateAmountMap.get(thisStartDate):new HashMap(); Integer thisUnQualityAmount = unQualityAmountMap.get(thisStartDate); + if(thisWashAmountMap == null){ + thisWashAmountMap = new HashMap(); + } String rate = "0.0000%"; CrossTableBean ctBean = getCrossTableBean("普通器械",titleColumnNumMap,thisStartDate,thisWashAmountMap.get("普通器械"),null); ctBeanList.add(ctBean); Index: ssts-reports/src/main/java/com/forgon/disinfectsystem/jasperreports/javabeansource/DepartmentMonthDetailItem.java =================================================================== diff -u -r35157 -r35596 --- ssts-reports/src/main/java/com/forgon/disinfectsystem/jasperreports/javabeansource/DepartmentMonthDetailItem.java (.../DepartmentMonthDetailItem.java) (revision 35157) +++ ssts-reports/src/main/java/com/forgon/disinfectsystem/jasperreports/javabeansource/DepartmentMonthDetailItem.java (.../DepartmentMonthDetailItem.java) (revision 35596) @@ -66,6 +66,10 @@ * 展示的时间 */ private String showTime = ""; + /** + * 器械包分组 + */ + private String tousseGroupName; public String getGoodsName() { return goodsName; } @@ -227,5 +231,13 @@ public void setShowTime(String showTime) { this.showTime = showTime; } + + public String getTousseGroupName() { + return tousseGroupName; + } + + public void setTousseGroupName(String tousseGroupName) { + this.tousseGroupName = tousseGroupName; + } }