Index: ssts-reports/src/main/java/com/forgon/disinfectsystem/jasperreports/service/JasperReportManagerImpl.java =================================================================== diff -u -r14363 -r14365 --- ssts-reports/src/main/java/com/forgon/disinfectsystem/jasperreports/service/JasperReportManagerImpl.java (.../JasperReportManagerImpl.java) (revision 14363) +++ ssts-reports/src/main/java/com/forgon/disinfectsystem/jasperreports/service/JasperReportManagerImpl.java (.../JasperReportManagerImpl.java) (revision 14365) @@ -74,6 +74,7 @@ import com.forgon.disinfectsystem.entity.materialmanager.MaterialEntry; import com.forgon.disinfectsystem.entity.materialmanager.MaterialEntryItem; import com.forgon.disinfectsystem.entity.packing.PackingRecord; +import com.forgon.disinfectsystem.entity.packing.PackingRecordOutItem; import com.forgon.disinfectsystem.entity.receiverecord.ReceiveRecord; import com.forgon.disinfectsystem.entity.receiverecord.ReceiveRecordItem; import com.forgon.disinfectsystem.entity.recyclingapplication.RecyclingApplication; @@ -8454,6 +8455,23 @@ if(StringUtils.isNotBlank(type)){ supplyRoomDiposableGoodsSql += " and dg.type = '" + type + "' "; } + //装配扣减,暂时算到供应室领用 + String packingRecordUsedSql = " select dg.name,dg.specification,dgi.price as cost,dgi.amount," + + "'" + GodownEntry.TYPE_OUT + "' as type,'供应室领用' as subType" + +" from " + PackingRecord.class.getSimpleName() + " pr left join " + + PackingRecordOutItem.class.getSimpleName() + " pri on pr.id = pri.packingRecordId" + +" left join " + DisposableGoods.class.getSimpleName() + " dg on dg.id=pri.disposableGoodsId" + +" left join " + DiposableGoodsItem.class.getSimpleName() + " dgi on dgi.packingRecordOutItemId=pri.id" + +" left join " + DisposableGoodsBatchStock.class.getSimpleName() + " dgbs on dgbs.id=dgi.disposableGoodsBatchStockID" + + " where 1=1 and dgbs.warehouseID="+currentRecord.getWarehouseId(); + if(StringUtils.isBlank(startDate)){ + packingRecordUsedSql += " and pr.packTime < " + endDate; + }else{ + packingRecordUsedSql += " and pr.packTime between " + startDate + " and " + endDate; + } + if(StringUtils.isNotBlank(type)){ + packingRecordUsedSql += " and dg.type = '" + type + "' "; + } //科室退货 String returnGoodsSql = "select dg.name,dg.specification,i.amount,i.price as cost," + "'" + GodownEntry.TYPE_IN + "' as type,'科室退货' as subType from " @@ -8471,6 +8489,7 @@ } sql += " union all " + diposableSql; sql += " union all " + supplyRoomDiposableGoodsSql; + sql += " union all " + packingRecordUsedSql; sql += " union all " + returnGoodsSql; rs = objectDao.executeSql(sql); try {