Index: ssts-web/src/main/webapp/jasperRtp/DepartmentMonthDetail.jrxml =================================================================== diff -u -r14530 -r15296 --- ssts-web/src/main/webapp/jasperRtp/DepartmentMonthDetail.jrxml (.../DepartmentMonthDetail.jrxml) (revision 14530) +++ ssts-web/src/main/webapp/jasperRtp/DepartmentMonthDetail.jrxml (.../DepartmentMonthDetail.jrxml) (revision 15296) @@ -1,5 +1,5 @@ - + @@ -53,7 +53,7 @@ <band height="35"> <textField> - <reportElement uuid="44490171-536f-433c-ba9c-7d6e64a00900" x="0" y="0" width="1175" height="35"/> + <reportElement uuid="44490171-536f-433c-ba9c-7d6e64a00900" x="0" y="0" width="1095" height="35"/> <textElement textAlignment="Center" verticalAlignment="Middle"> <font size="14" isBold="true"/> </textElement> @@ -92,14 +92,14 @@ <text><![CDATA[单价(元)]]></text> </staticText> <staticText> - <reportElement uuid="27328556-20ed-4384-959d-d0be3328fdec" style="table_TH" x="995" y="0" width="80" height="34" backcolor="#FFFFFF"/> + <reportElement uuid="27328556-20ed-4384-959d-d0be3328fdec" style="table_TH" x="915" y="0" width="80" height="34" backcolor="#FFFFFF"/> <textElement textAlignment="Center" verticalAlignment="Middle"> <font size="12" isBold="true"/> </textElement> <text><![CDATA[总计(元)]]></text> </staticText> <staticText> - <reportElement uuid="5957a0a9-0a13-4bcd-9199-5c6ce6b6014e" style="table_TH" x="1075" y="0" width="100" height="34" backcolor="#FFFFFF"/> + <reportElement uuid="5957a0a9-0a13-4bcd-9199-5c6ce6b6014e" style="table_TH" x="995" y="0" width="100" height="34" backcolor="#FFFFFF"/> <textElement textAlignment="Center" verticalAlignment="Middle"> <font size="12" isBold="true"/> </textElement> @@ -120,20 +120,13 @@ <text><![CDATA[生产厂家]]></text> </staticText> <staticText> - <reportElement uuid="207fe40d-3a67-4738-ac6d-59b1a52f3096" style="table_TH" x="915" y="0" width="80" height="34" backcolor="#FFFFFF"/> + <reportElement uuid="207fe40d-3a67-4738-ac6d-59b1a52f3096" style="table_TH" x="835" y="0" width="80" height="34" backcolor="#FFFFFF"/> <textElement textAlignment="Center" verticalAlignment="Middle"> <font size="12" isBold="true"/> </textElement> <text><![CDATA[失效期]]></text> </staticText> <staticText> - <reportElement uuid="207fe40d-3a67-4738-ac6d-59b1a52f3096" style="table_TH" x="835" y="0" width="80" height="34" backcolor="#FFFFFF"/> - <textElement textAlignment="Center" verticalAlignment="Middle"> - <font size="12" isBold="true"/> - </textElement> - <text><![CDATA[生产日期]]></text> - </staticText> - <staticText> <reportElement uuid="81cca96c-e1ce-4713-86de-05fc14c4899d" style="table_TH" x="100" y="0" width="80" height="34" backcolor="#FFFFFF"/> <textElement textAlignment="Center" verticalAlignment="Middle"> <font size="12" isBold="true"/> @@ -159,14 +152,14 @@ <textFieldExpression><![CDATA[$F{depart}]]></textFieldExpression> </textField> <textField pattern="###0.0000;-###0.0000"> - <reportElement uuid="3bf0b3ba-9ae6-4900-a6a4-24e5d640c09a" style="table_TD" stretchType="RelativeToBandHeight" x="1075" y="0" width="100" height="35" isPrintWhenDetailOverflows="true"/> + <reportElement uuid="3bf0b3ba-9ae6-4900-a6a4-24e5d640c09a" style="table_TD" stretchType="RelativeToBandHeight" x="995" y="0" width="100" height="35" isPrintWhenDetailOverflows="true"/> <textElement textAlignment="Center" verticalAlignment="Middle"> <font size="12"/> </textElement> <textFieldExpression><![CDATA[$F{totalPrice}]]></textFieldExpression> </textField> <subreport runToBottom="false"> - <reportElement uuid="17170695-399b-4463-ac82-477c70660490" style="table_TD" stretchType="RelativeToBandHeight" x="100" y="0" width="975" height="35"/> + <reportElement uuid="17170695-399b-4463-ac82-477c70660490" style="table_TD" stretchType="RelativeToBandHeight" x="100" y="0" width="895" height="35"/> <subreportParameter name="depart"> <subreportParameterExpression><![CDATA[$F{depart}]]></subreportParameterExpression> </subreportParameter> @@ -214,13 +207,6 @@ <reportElement uuid="e20b67d4-cb55-4c58-aaaf-9711aa3d8d79" style="table_TH" x="530" y="0" width="545" height="35" backcolor="#FFFFFF"/> <textElement/> </textField> - <textField pattern="###0.0000;-###0.0000" isBlankWhenNull="true"> - <reportElement uuid="b2102e6b-98c3-4da0-a39c-76db976a74ce" style="table_TH" x="1075" y="0" width="100" height="35" backcolor="#FFFFFF"/> - <textElement textAlignment="Center" verticalAlignment="Middle"> - <font size="12" isBold="true"/> - </textElement> - <textFieldExpression><![CDATA[$V{sum_totalPrice}]]></textFieldExpression> - </textField> <textField isBlankWhenNull="true"> <reportElement uuid="e8cfb76c-c9f4-482a-a857-b6544c593d77" style="table_TH" x="100" y="0" width="360" height="35" backcolor="#FFFFFF"/> <textElement/> @@ -232,6 +218,13 @@ </textElement> <textFieldExpression><![CDATA[$V{sum_amount}]]></textFieldExpression> </textField> + <textField pattern="###0.0000;-###0.0000" isBlankWhenNull="true"> + <reportElement uuid="b2102e6b-98c3-4da0-a39c-76db976a74ce" style="table_TH" x="994" y="0" width="101" height="35" backcolor="#FFFFFF"/> + <textElement textAlignment="Center" verticalAlignment="Middle"> + <font size="12" isBold="true"/> + </textElement> + <textFieldExpression><![CDATA[$V{sum_totalPrice}]]></textFieldExpression> + </textField> </band> </summary> </jasperReport> Index: ssts-web/src/main/webapp/jasperRtp/DepartmentMonthDetail_child.jrxml =================================================================== diff -u -r14530 -r15296 --- ssts-web/src/main/webapp/jasperRtp/DepartmentMonthDetail_child.jrxml (.../DepartmentMonthDetail_child.jrxml) (revision 14530) +++ ssts-web/src/main/webapp/jasperRtp/DepartmentMonthDetail_child.jrxml (.../DepartmentMonthDetail_child.jrxml) (revision 15296) @@ -1,7 +1,7 @@ <?xml version="1.0" encoding="UTF-8"?> -<jasperReport xmlns="http://jasperreports.sourceforge.net/jasperreports" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://jasperreports.sourceforge.net/jasperreports http://jasperreports.sourceforge.net/xsd/jasperreport.xsd" name="DepartmentMonthDetail_child" language="groovy" pageWidth="976" pageHeight="700" columnWidth="976" leftMargin="0" rightMargin="0" topMargin="0" bottomMargin="0" uuid="518f2007-e7af-4a46-a103-ff54cdf6d701"> +<jasperReport xmlns="http://jasperreports.sourceforge.net/jasperreports" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://jasperreports.sourceforge.net/jasperreports http://jasperreports.sourceforge.net/xsd/jasperreport.xsd" name="DepartmentMonthDetail_child" language="groovy" pageWidth="895" pageHeight="700" columnWidth="895" leftMargin="0" rightMargin="0" topMargin="0" bottomMargin="0" uuid="518f2007-e7af-4a46-a103-ff54cdf6d701"> <property name="ireport.zoom" value="1.0"/> - <property name="ireport.x" value="22"/> + <property name="ireport.x" value="0"/> <property name="ireport.y" value="0"/> <style name="table"> <box> @@ -82,7 +82,7 @@ <textFieldExpression><![CDATA[$F{price}]]></textFieldExpression> </textField> <textField pattern="###0.0000;-###0.0000"> - <reportElement uuid="333fac08-3646-4228-886a-62068ff1e7de" style="table_TD" stretchType="RelativeToBandHeight" x="895" y="0" width="80" height="35"/> + <reportElement uuid="333fac08-3646-4228-886a-62068ff1e7de" style="table_TD" stretchType="RelativeToBandHeight" x="815" y="0" width="80" height="35"/> <textElement textAlignment="Center" verticalAlignment="Middle"> <font size="12"/> </textElement> @@ -103,19 +103,12 @@ <textFieldExpression><![CDATA[$F{manufacturer}==null?"":$F{manufacturer}]]></textFieldExpression> </textField> <textField pattern="###0.00;-###0.00"> - <reportElement uuid="81606dbd-1f31-4aed-ba2d-507bda07689e" style="table_TD" stretchType="RelativeToBandHeight" x="815" y="0" width="80" height="35"/> + <reportElement uuid="81606dbd-1f31-4aed-ba2d-507bda07689e" style="table_TD" stretchType="RelativeToBandHeight" x="735" y="0" width="80" height="35"/> <textElement textAlignment="Center" verticalAlignment="Middle"> <font size="12"/> </textElement> <textFieldExpression><![CDATA[$F{expDate}==null?"":$F{expDate}]]></textFieldExpression> </textField> - <textField pattern="###0.00;-###0.00"> - <reportElement uuid="81606dbd-1f31-4aed-ba2d-507bda07689e" style="table_TD" stretchType="RelativeToBandHeight" x="735" y="0" width="80" height="35"/> - <textElement textAlignment="Center" verticalAlignment="Middle"> - <font size="12"/> - </textElement> - <textFieldExpression><![CDATA[""]]></textFieldExpression> - </textField> <textField> <reportElement uuid="5675a27f-9780-42e0-a6bf-ad5a931bb845" style="table_TD" stretchType="RelativeToBandHeight" x="0" y="0" width="80" height="35"/> <textElement textAlignment="Center" verticalAlignment="Middle"> Index: ssts-web/src/main/webapp/jasperRtp/DepartmentMonthDetail.jasper =================================================================== diff -u -r14530 -r15296 Binary files differ Index: ssts-web/src/main/webapp/jasperRtp/DepartmentMonthDetail_child.jasper =================================================================== diff -u -r14530 -r15296 Binary files differ Index: ssts-reports/src/main/java/com/forgon/disinfectsystem/jasperreports/service/JasperReportManagerImpl.java =================================================================== diff -u -r15292 -r15296 --- ssts-reports/src/main/java/com/forgon/disinfectsystem/jasperreports/service/JasperReportManagerImpl.java (.../JasperReportManagerImpl.java) (revision 15292) +++ ssts-reports/src/main/java/com/forgon/disinfectsystem/jasperreports/service/JasperReportManagerImpl.java (.../JasperReportManagerImpl.java) (revision 15296) @@ -167,6 +167,7 @@ import com.forgon.tools.db.InitDbConnection; import com.forgon.tools.hibernate.ObjectDao; import com.forgon.tools.string.StringTools; +import com.forgon.tools.util.ForgonDateUtils; import com.forgon.tools.util.SqlUtils; /** @@ -6485,7 +6486,7 @@ } String tousseSql = "select i.settleAccountsDepart," + caseSql + " as name,sum(ii.amount) as amount,sum(ii.settlementPrice) as settlementprice,ii.tousseType as type" - + ",'' as batchNumber from invoice i,InvoiceItem ii " + + ",'' as batchNumber,null as expDate from invoice i,InvoiceItem ii " + " where i.id = ii.invoice_id " + " and ii.diposable = '否' and "+getHandleDeptCodeSql("i.orgUnitCoding")+" " + monthFilterSql @@ -6497,34 +6498,35 @@ String diposableGoodsSql = " "; if(StringUtils.isBlank(typeSearch) || "一次性物品".equals(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 as batchNumber from invoice i,DiposableGoodsItem d " - + " where i.id = d.invoice_id and "+getHandleDeptCodeSql("i.orgUnitCoding")+" " + + ",d.batch as batchNumber,dgbs.expDate from invoice i,DiposableGoodsItem d," + DisposableGoodsBatchStock.class.getSimpleName() + " dgbs " + + " where i.id = d.invoice_id and d.disposableGoodsBatchStockID=dgbs.id and "+getHandleDeptCodeSql("i.orgUnitCoding")+" " +" and "+diposableGoodsItemPredicate + monthFilterSql + departFilterSql + nameFilterSql + expensiveDisposablegoodsSql - + " group by i.settleaccountsdepart,d.name,d.batch) "; + + " group by i.settleaccountsdepart,d.name,d.batch,dgbs.expDate) "; } String packingDisposableGoodsSql = " "; { if(StringUtils.isBlank(typeSearch) || "一次性物品".equals(typeSearch)){ packingDisposableGoodsSql = " union all (select pr.orgUnitName,dgi.name as name,sum(dgi.amount) as amount,sum(dgi.fluctuationPrice*dgi.amount) as settlementprice,'一次性物品' as type" - + ",dgi.batch as batchNumber from PackingRecord pr inner join DiposableGoodsItem dgi on pr.id = dgi.packingRecordId " + + ",dgi.batch as batchNumber,dgbs.expDate 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")+" " +" and "+packingDisposableGoodsTypeSql + packingDisposableGoodsTimeSql + packingDisposableGoodsDepartSql + packingDisposableGoodsNameSql // + expensiveDisposablegoodsSql - + " group by pr.orgUnitName,dgi.name,dgi.batch) "; + + " group by pr.orgUnitName,dgi.name,dgi.batch,dgbs.expDate) "; } } String materialInvoiceSql = " "; if (StringUtils.isBlank(typeSearch) || "器械材料".equals(typeSearch) || "高值耗材".equals(typeSearch)) { // 材料发货 - materialInvoiceSql = " union all (select i.settleAccountsDepart,ii.materialName,sum(ii.amount),sum(ii.settlementPrice),'材料' as type,'' as batchNumber " + materialInvoiceSql = " union all (select i.settleAccountsDepart,ii.materialName,sum(ii.amount),sum(ii.settlementPrice),'材料' as type,'' as batchNumber,null as expDate " + " from MaterialInvoice i," + "MaterialInvoiceItem ii,materialDefinition d where i.id = ii.materialInvoice_id " + " and ii.materialDefinitionId = d.id and "+getHandleDeptCodeSql("i.orgUnitCoding")+" " @@ -6535,7 +6537,7 @@ + " group by i.settleaccountsdepart,ii.materialName) "; } // 材料退货 - String materialReturnSql = " union all (select rr.depart as settleaccountsdepart,ii.materialName,-sum(ii.amount),-sum(ii.settlementPrice),'材料' as type,'' as batchNumber " + String materialReturnSql = " union all (select rr.depart as settleaccountsdepart,ii.materialName,-sum(ii.amount),-sum(ii.settlementPrice),'材料' as type,'' as batchNumber,null as expDate " + " from ReturnMaterialRecord rr,materialDefinition d," + "ReturnMaterialItem ii where rr.id = ii.returnMaterialRecord_ID " + " and ii.materialDefinitionId = d.id and "+getHandleDeptCodeSql("rr.handleDepartCode")+" " @@ -6548,43 +6550,44 @@ //退货 String returnGoodsSql = " union all (select rr.depart as settleaccountsdepart,ri.toussename as name," + "-sum(ri.amount) as amount,-sum(ri.settlementPrice) as settlementprice,"+returnGoodsTousseType+" as type" - + ",ri.batchNumber as batchNumber from " + ReturnGoodsRecord.class.getSimpleName() + " rr inner join " + + ",ri.batchNumber as batchNumber,dgbs.expDate 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" + + " left join " + DisposableGoodsBatchStock.class.getSimpleName() + " dgbs on ri.disposableGoodsBatchStockID=dgbs.id" + " where " + getHandleDeptCodeSql("rr.handleDepartCode")+" " + returnGoodsFilterSql +" and "+returnGoodsItemPredicate - + " group by rr.depart,ri.toussename,"+returnGoodsTousseType+",ri.batchNumber) "; + + " group by rr.depart,ri.toussename,"+returnGoodsTousseType+",ri.batchNumber,dgbs.expDate) "; - String lostMaterial = " union all (select r.depart,r.materialName,sum(r.additionalAmount),sum(r.additionalAmount * r.materialCost),'材料' as type,'' as batchNumber " + String lostMaterial = " union all (select r.depart,r.materialName,sum(r.additionalAmount),sum(r.additionalAmount * r.materialCost),'材料' as type,'' as batchNumber,null as expDate " + " from RecyclingError r,materialDefinition m where r.materialDefinitionId = m.id and r.errorType = '缺失' and r.materialName != '器械包标识牌' and r.additionalAmount > 0 and "+getHandleDeptCodeSql("r.handleDepartCode")+" " + lostMaterialFilterSql + "group by r.depart,r.materialName ) "; - String damageMaterial = " union all (select i.depart,i.materialName,sum(i.additionalAmount),sum(i.materialCost*i.additionalAmount),'材料' as type,'' as batchNumber " + String damageMaterial = " union all (select i.depart,i.materialName,sum(i.additionalAmount),sum(i.materialCost*i.additionalAmount),'材料' as type,'' as batchNumber,null as expDate " + "from RecyclingDamageItem i,MaterialDefinition m where i.materialDefinitionId = m.id " + "and i.additionalAmount > 0 and "+getHandleDeptCodeSql("i.handleDepartCode")+" " + damageFilterSql + " group by i.departCoding,i.depart,i.materialName ) "; - String supplyRoomDiposableGoodsSql = " union all (select rr.depart as settleaccountsdepart,rri.goodsName,sum(rri.amount),sum(rri.price*rri.amount) as settlementprice,rri.type as type,dbs.batchNumber as batchNumber " + String supplyRoomDiposableGoodsSql = " union all (select rr.depart as settleaccountsdepart,rri.goodsName,sum(rri.amount),sum(rri.price*rri.amount) as settlementprice,rri.type as type,dbs.batchNumber as batchNumber,dbs.expDate " +" from ReceiveRecord rr,ReceiveRecordItem rri left join " + DisposableGoodsBatchStock.class.getSimpleName() + " dbs " +" on rri.diposableGoodBatchStock_id = dbs.id left join DisposableGoods d on d.id = rri.disposableGoodsId where rr.id = rri.receiveRecord_id and "+getHandleDeptCodeSql("rr.departCoding")+" " +supplyRoomDiposableGoodsFilterSql +" and "+receiveRecordItemPredicate - + " group by rr.depart,rri.goodsName,rri.amount,rri.type,dbs.batchNumber) "; + + " group by rr.depart,rri.goodsName,rri.amount,rri.type,dbs.batchNumber,dbs.expDate) "; // 调拨出库 - String appropriateOutDiposableGoodsSql = " union all (select oge.targetOrgUnitName as settleaccountsdepart,ged.goodsName,sum(ged.amount),sum(ged.price*ged.amount) as settlementprice,'一次性物品' as type,dgb.batchNumber as batchNumber " + String appropriateOutDiposableGoodsSql = " union all (select oge.targetOrgUnitName as settleaccountsdepart,ged.goodsName,sum(ged.amount),sum(ged.price*ged.amount) as settlementprice,'一次性物品' as type,dgb.batchNumber as batchNumber,dgb.expDate " +" from GodownEntry oge inner join GodownEntryDiposableGoodsItem ged on oge.id = ged.godownEntryID inner join DisposableGoodsBatch dgb on ged.disposableGoodsBatchID=dgb.id " +" where oge.type ='退库单' and oge.subType='调拨出库' and "+getHandleDeptCodeSql("oge.orgUnitCode")+" " +outEntryFilterSql +" and "+outEntryPredicate - + " group by oge.targetOrgUnitName, ged.goodsName,dgb.batchNumber) "; + + " group by oge.targetOrgUnitName, ged.goodsName,dgb.batchNumber,dgb.expDate) "; // 盘亏出库 - String stocktakeOutDiposableGoodsSql = " union all (select oge.orgUnitName as settleaccountsdepart,ged.goodsName,sum(ged.amount),sum(ged.price*ged.amount) as settlementprice,'一次性物品' as type,dgb.batchNumber as batchNumber " + String stocktakeOutDiposableGoodsSql = " union all (select oge.orgUnitName as settleaccountsdepart,ged.goodsName,sum(ged.amount),sum(ged.price*ged.amount) as settlementprice,'一次性物品' as type,dgb.batchNumber as batchNumber,dgb.expDate " +" from GodownEntry oge inner join GodownEntryDiposableGoodsItem ged on oge.id = ged.godownEntryID inner join DisposableGoodsBatch dgb on ged.disposableGoodsBatchID=dgb.id " +" where oge.type ='退库单' and oge.subType='盘亏出库' and "+getHandleDeptCodeSql("oge.orgUnitCode")+" " +outEntryFilterSql +" and "+outEntryPredicate - + " group by oge.orgUnitName, ged.goodsName,dgb.batchNumber) "; + + " group by oge.orgUnitName, ged.goodsName,dgb.batchNumber,dgb.expDate) "; String sql = tousseSql + diposableGoodsSql + packingDisposableGoodsSql + materialInvoiceSql + returnGoodsSql + materialReturnSql + supplyRoomDiposableGoodsSql + appropriateOutDiposableGoodsSql @@ -6627,6 +6630,7 @@ String type = rs.getString("type"); double settlementPrice = rs.getDouble("settlementprice"); int amount = rs.getInt("amount"); + Date expDate = rs.getTimestamp("expDate"); int disinfectGoodsStatisticAmount = 0; int totalAmount = amount; DepartmentMonthDetailItem mdi = new DepartmentMonthDetailItem(); @@ -6659,6 +6663,7 @@ mdi.setType(type); mdi.setSettlementPrice(settlementPrice); mdi.setBatchNumber(rs.getString("batchNumber")); + mdi.setExpDate(ForgonDateUtils.safelyFormatDate(expDate, Constants.SIMPLEDATEFORMAT_YYYYMMDD, "")); if ("一次性物品".equals(type)) { mdi.setManufacturer(manufacturerMap.get(goodsName + "_" + mdi.getBatchNumber())); mdi.setExternalCode(disposableGoodsExternalCodeMap.get(goodsName));