Index: ssts-reports/src/main/java/com/forgon/disinfectsystem/jasperreports/service/JasperReportManagerImpl.java =================================================================== diff -u -r13141 -r13146 --- ssts-reports/src/main/java/com/forgon/disinfectsystem/jasperreports/service/JasperReportManagerImpl.java (.../JasperReportManagerImpl.java) (revision 13141) +++ ssts-reports/src/main/java/com/forgon/disinfectsystem/jasperreports/service/JasperReportManagerImpl.java (.../JasperReportManagerImpl.java) (revision 13146) @@ -3750,10 +3750,10 @@ DatabaseUtil.closeResultSetAndStatement(materialInvoicePriceResultSet); } String invoiceAmountSql = "select '' as coding,i.settleAccountsDepart " - + "as depart,i.tousseAmount from Invoice i " - + "where i.orgUnitCoding = '" + handleDeptCode + "' " - + " and (i.tousseAmount is not null and i.tousseAmount>0) "// 限制为只查包含器械包数量的 - + "and (i.status ='收货签收' or i.status = '已发货') " + invoiceWheresql; + + "as depart,ii.amount from Invoice i,InvoiceItem ii where i.id = ii.invoice_id " + + " and i.orgUnitCoding = '" + handleDeptCode + "' " + + " and (ii.amount is not null and ii.amount>0 and ii.tousseType!='一次性物品') "// 限制为只查包含器械包数量的 + + " and (i.status ='收货签收' or i.status = '已发货') " + invoiceWheresql; ResultSet rs2 = objectDao.executeSql(invoiceAmountSql); try { @@ -3999,15 +3999,15 @@ startTime += " 00:00:00"; endTime += " 23:59:59"; String handleDeptCode = AcegiHelper.getLoginUser().getOrgUnitCodingFromSupplyRoomConfig(); - String monthFilterSql = ""; - String returnGoodsFilterSql = ""; - String returnGoodsTimeFilterSql = ""; - String returnGoodsDepartFilterSql = ""; - String materialNameFilterSql = ""; - String materialTypeFilterSql = ""; - String lostMaterialFilterSql = ""; - String damageFilterSql = ""; - String supplyRoomDiposableGoodsFilterSql = ""; + String monthFilterSql = " "; + String returnGoodsFilterSql = " "; + String returnGoodsTimeFilterSql = " "; + String returnGoodsDepartFilterSql = " "; + String materialNameFilterSql = " "; + String materialTypeFilterSql = " "; + String lostMaterialFilterSql = " "; + String damageFilterSql = " "; + String supplyRoomDiposableGoodsFilterSql = " "; String invoiceItemDisposableGoodsTypePredicate = " (1=1) "; String diposableGoodsItemPredicate = " (1=1) "; @@ -4059,10 +4059,10 @@ + dateQueryAdapter.dateConverAdapter2( endTime , "yyyy-mm-dd HH24:MI:SS"); } else { - monthFilterSql = " and 1=2"; - returnGoodsFilterSql = " and 1=2"; - lostMaterialFilterSql = " and 1=2"; - damageFilterSql = " and 1=2"; + monthFilterSql = " and 1=2 "; + returnGoodsFilterSql = " and 1=2 "; + lostMaterialFilterSql = " and 1=2 "; + damageFilterSql = " and 1=2 "; } String departFilterSql = ""; if (StringUtils.isNotBlank(departSearch)) { @@ -4079,7 +4079,7 @@ supplyRoomDiposableGoodsFilterSql += " and rr.departCoding = '"+departCoding+"'"; } - String typeFilterSql = ""; + String typeFilterSql = " "; materialTypeFilterSql = " "; if (StringUtils.isNotBlank(typeSearch)) { if ("全部器械包".equals(typeSearch)) { @@ -4125,10 +4125,10 @@ returnGoodsFilterSql += " and rr.type = '一次性物品'"; lostMaterialFilterSql += " and 1=2 "; damageFilterSql += " and 1=2 "; - supplyRoomDiposableGoodsFilterSql += " and rri.type = '一次性物品'"; + supplyRoomDiposableGoodsFilterSql += " and rri.type = '一次性物品' "; } } - String goodsNameFilterSql = ""; + String goodsNameFilterSql = " "; if (StringUtils.isNotBlank(goodsNameSearch)) { //消毒物品需用like查询 if(disinfection){ @@ -4199,7 +4199,7 @@ + goodsNameFilterSql + " and i.settleaccountsdepart is not null group by i.settleAccountsDepart,ii.tousseType," + caseSql; - String diposableGoodsSql = ""; + String diposableGoodsSql = " "; if(StringUtils.isBlank(typeSearch) || "一次性物品".equals(typeSearch)){ diposableGoodsSql = " union all (select i.settleaccountsdepart,d.name as name,sum(d.amount) as amount,sum(d.fluctuationPrice*d.amount) as settlementprice,'一次性物品' as type" + ",d.batch from invoice i,DiposableGoodsItem d " @@ -4236,16 +4236,16 @@ + ",ri.batchNumber from returngoodsrecord rr,returngoodsitem ri where rr.id = ri.returngoodsrecord_id and rr.handleDepartCode = '"+handleDeptCode+"' " + returnGoodsFilterSql +" and "+returnGoodsItemPredicate - + " group by rr.depart,ri.toussename,rr.type,ri.batchNumber)"; + + " group by rr.depart,ri.toussename,rr.type,ri.batchNumber) "; String lostMaterial = " union all (select r.depart,r.materialName,sum(r.amount),sum(r.amount*r.materialCost),'材料' as type,'' " + " from RecyclingError r where r.packingTask_ID is null and r.errorType = '缺失' and r.handleDepartCode = '"+handleDeptCode+"' " - + lostMaterialFilterSql + "group by r.depart,r.materialName )"; + + lostMaterialFilterSql + "group by r.depart,r.materialName ) "; String damageMaterial = " union all (select r.depart,i.materialName,sum(i.additionalAmount),sum(i.materialCost*i.additionalAmount),'材料','' " + "from RecyclingDamageRecord r,RecyclingDamageItem i where r.id = i.RecyclingDamageRecord_ID " + "and r.status != '未补充' and r.additionalDeptCode = '"+handleDeptCode+"' and i.additionalTime is not null " + damageFilterSql - + " group by r.departCoding,r.depart,i.materialName )"; + + " group by r.departCoding,r.depart,i.materialName ) "; String supplyRoomDiposableGoodsSql = " union all (select '消毒供应中心' as settleaccountsdepart,rri.goodsName,sum(rri.amount),sum(rri.price*rri.amount) as settlementprice,rri.type as type,dbs.batchNumber " +" from ReceiveRecord rr,ReceiveRecordItem rri left join " + DisposableGoodsBatchStock.class.getSimpleName() + " dbs "