Index: ssts-web/src/main/webapp/jasperRtp/departmentMonthDetailSupplierNameAndDiscountPrice_child.jrxml
===================================================================
diff -u
--- ssts-web/src/main/webapp/jasperRtp/departmentMonthDetailSupplierNameAndDiscountPrice_child.jrxml (revision 0)
+++ ssts-web/src/main/webapp/jasperRtp/departmentMonthDetailSupplierNameAndDiscountPrice_child.jrxml (revision 25907)
@@ -0,0 +1,148 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
Index: ssts-reports/src/main/java/com/forgon/disinfectsystem/jasperreports/service/JasperReportManagerImpl.java
===================================================================
diff -u -r25748 -r25907
--- ssts-reports/src/main/java/com/forgon/disinfectsystem/jasperreports/service/JasperReportManagerImpl.java (.../JasperReportManagerImpl.java) (revision 25748)
+++ ssts-reports/src/main/java/com/forgon/disinfectsystem/jasperreports/service/JasperReportManagerImpl.java (.../JasperReportManagerImpl.java) (revision 25907)
@@ -3419,7 +3419,20 @@
}
List datas = new ArrayList();
List allTousseType = getTousseTypes(typeSearch);
-
+ // 查看是否配置显示供应商
+ Boolean showSupplierNameInDetailedAccountingMonthlyReport = CssdUtils.getSystemSetConfigByNameBool("showSupplierNameInDetailedAccountingMonthlyReport", false);
+ String tousseDefinitionOfSupplierNameSql = "";//用器械包定义里的供应商拼接的sql语句,主要用于查询供应商和按供应商分组
+ String addTousseDefinitionAtWhere = "";//拼接sql,用于添加查询TousseDefinition表
+ String addJoinTousseDefinitionSql = "";//用于连接InvoiceItem和TousseDefinition
+ String dgbsOfSupplierNameSql = "";//用于查询DisposableGoodsBatchStock或DisposableGoodsBatch的供应商名称,主要用于查询供应商和按供应商分组
+ String noQuerySupplierName = "";//不需要查询器械包名称的sql,用于连接union all连接表时保持列数不变
+ if(showSupplierNameInDetailedAccountingMonthlyReport){
+ tousseDefinitionOfSupplierNameSql = " ,td.supplierName ";
+ addTousseDefinitionAtWhere = ",TousseDefinition td ";
+ addJoinTousseDefinitionSql = " and td.id = ii.tousseDefinitionId ";
+ dgbsOfSupplierNameSql = " ,dgbs.supplierName ";
+ noQuerySupplierName = ",''";
+ }
startTime += ":00";
endTime += ":59";
// String handleDeptCode = AcegiHelper.getLoginUser().getOrgUnitCodingFromSupplyRoomConfig();
@@ -3752,21 +3765,23 @@
String returnGoodsTousseType = " CASE rr.type WHEN '一次性物品' THEN (rr.type) WHEN '器械包' THEN (td.toussetype) ELSE rr.type END ";
String returnGoodsTousseDefinitionId = " CASE rr.type WHEN '器械包' THEN ri.tousseDefinition_id ELSE 0 END ";
//器械包
- String tousseSql = " (select i.settleAccountsDepart,ii.tousseName as name,sum(ii.amount) as amount,"
+ String tousseSql = " (select i.settleAccountsDepart "+ tousseDefinitionOfSupplierNameSql +",ii.tousseName as name,sum(ii.amount) as amount,"
+"sum(ii.settlementPrice) as settlementprice,sum(ii.settlementDiscountPrice) as settlementDiscountPrice,ii.tousseType as type"
+ ",'' as batchNumber,null as expDate,ii.tousseDefinitionId as tousseDefinitionId from invoice i,InvoiceItem ii "
+ + addTousseDefinitionAtWhere
+ " where i.id = ii.invoice_id "
+ + addJoinTousseDefinitionSql
+ " and ii.diposable = '否' and ii.expensiveGoodsInstanceId is null and "+getHandleDeptCodeSql("i.orgUnitCoding")+" "
+ monthFilterSql
+ departFilterSql
+ typeFilterSql
+ goodsNameFilterSql
- + " and i.settleaccountsdepart is not null group by i.settleAccountsDepart,ii.tousseType,ii.tousseName,ii.tousseDefinitionId)";
+ + " and i.settleaccountsdepart is not null group by i.settleAccountsDepart,ii.tousseType,ii.tousseName,ii.tousseDefinitionId " + tousseDefinitionOfSupplierNameSql + ")";
//新的高值耗材(发货)
String selectExpensiveGoodsSql = "";
//如果有启用高值耗材则查询
if(enableExpensiveGoods){
- selectExpensiveGoodsSql = " union all (select i.settleAccountsDepart,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,"
+ selectExpensiveGoodsSql = " union all (select i.settleAccountsDepart"+noQuerySupplierName+",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"
+ ",'' as batchNumber,ei.expDate as expDate,0 as tousseDefinitionId from " + Invoice.class.getSimpleName() + " i join "
+ InvoiceItem.class.getSimpleName()+" ii on i.id = ii.invoice_id join " + ExpensiveGoodsInstance.class.getSimpleName()
@@ -3780,7 +3795,7 @@
+ goodsNameFilterSql
+ " and i.settleaccountsdepart is not null group by i.settleAccountsDepart,ii.tousseType,case when egm.model is null then eg.name else eg.name "+ concatSymbolInDb +" '[' "+ concatSymbolInDb +" egm.model "+ concatSymbolInDb +" ']' end,ii.expensiveGoodsInstanceId,ei.expDate)";
//新的高值耗材(一键退库-即退货),如果所选物品类型为全部或高值耗材时,
- selectExpensiveGoodsSql += " union all (select i.settleAccountsDepart,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,null as batchNumber,egi.expDate,null as tousseDefinitionId "
+ selectExpensiveGoodsSql += " union all (select i.settleAccountsDepart "+ noQuerySupplierName+",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,null as batchNumber,egi.expDate,null as tousseDefinitionId "
+ " 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 "
@@ -3800,7 +3815,7 @@
diposableGoodsTousseTypeSql = String.format(" and d.type='%s' ", InvoiceItem.TYPE_AUTO_DEDUCTION);
}
if(StringUtils.isBlank(typeSearch) || "一次性物品".equals(typeSearch) || "高值耗材".equals(typeSearch) && !enableExpensiveGoods || TYPE_AUTO_DEDUCTION.equals(typeSearch)){
- diposableGoodsSql = " union all (select i.settleaccountsdepart,d.name as name,sum(d.amount) as amount,"
+ diposableGoodsSql = " union all (select i.settleaccountsdepart "+ dgbsOfSupplierNameSql +",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"
+ ",d.batch as batchNumber,dgbs.expDate,0 as tousseDefinitionId from invoice i,DiposableGoodsItem d," + DisposableGoodsBatchStock.class.getSimpleName() + " dgbs "
+ " where i.id = d.invoice_id and d.disposableGoodsBatchStockID=dgbs.id and "+getHandleDeptCodeSql("i.orgUnitCoding")+" "
@@ -3810,12 +3825,12 @@
+ departFilterSql
+ nameFilterSql
+ expensiveDisposablegoodsSql
- + " group by i.settleaccountsdepart,d.name,d.batch,dgbs.expDate) ";
+ + " group by i.settleaccountsdepart,d.name,d.batch,dgbs.expDate "+ dgbsOfSupplierNameSql +") ";
}
String packingDisposableGoodsSql = " ";
{
if(StringUtils.isBlank(typeSearch) || "一次性物品".equals(typeSearch)){
- packingDisposableGoodsSql = " union all (select pr.orgUnitName,dgi.name as name,sum(dgi.amount) as amount,"
+ packingDisposableGoodsSql = " union all (select pr.orgUnitName "+ dgbsOfSupplierNameSql +",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"
+ ",dgi.batch as batchNumber,dgbs.expDate,0 as tousseDefinitionId from PackingRecord pr inner join DiposableGoodsItem dgi on pr.id = dgi.packingRecordId "
+ " inner join " + DisposableGoodsBatchStock.class.getSimpleName() + " dgbs on dgi.disposableGoodsBatchStockID=dgbs.id"
@@ -3825,7 +3840,7 @@
+ packingDisposableGoodsDepartSql
+ packingDisposableGoodsNameSql
// + expensiveDisposablegoodsSql
- + " group by pr.orgUnitName,dgi.name,dgi.batch,dgbs.expDate) ";
+ + " group by pr.orgUnitName,dgi.name,dgi.batch,dgbs.expDate "+ dgbsOfSupplierNameSql +") ";
}
}
@@ -3837,7 +3852,7 @@
if(StringUtils.isBlank(batch)){
if ((StringUtils.isBlank(typeSearch) || "器械材料".equals(typeSearch) || "高值耗材".equals(typeSearch))) {
// 材料发货
- materialInvoiceSql = " union all (select i.settleAccountsDepart,ii.materialName,sum(ii.amount),sum(ii.settlementPrice),"
+ materialInvoiceSql = " union all (select i.settleAccountsDepart "+ noQuerySupplierName +",ii.materialName,sum(ii.amount),sum(ii.settlementPrice),"
+"sum(ii.settlementPrice) as settlementDiscountPrice,'材料' as type,'' as batchNumber,null as expDate,0 as tousseDefinitionId "
+ " from MaterialInvoice i,"
+ "MaterialInvoiceItem ii,materialDefinition d where i.id = ii.materialInvoice_id "
@@ -3849,7 +3864,7 @@
+ " group by i.settleaccountsdepart,ii.materialName) ";
}
// 材料退货
- materialReturnSql = " union all (select rr.depart as settleaccountsdepart,ii.materialName,-sum(ii.amount),-sum(ii.settlementPrice),"
+ materialReturnSql = " union all (select rr.depart as settleaccountsdepart "+ noQuerySupplierName+",ii.materialName,-sum(ii.amount),-sum(ii.settlementPrice),"
+"-sum(ii.settlementPrice) as settlementDiscountPrice,'材料' as type,'' as batchNumber,null as expDate,0 as tousseDefinitionId "
+ " from ReturnMaterialRecord rr,materialDefinition d,"
+ "ReturnMaterialItem ii where rr.id = ii.returnMaterialRecord_ID "
@@ -3860,19 +3875,19 @@
+ materialTypeFilterSql
+ " group by rr.depart,ii.materialName) ";
- lostMaterial = " union all (select r.depart,r.materialName,sum(r.additionalAmount),sum(r.additionalAmount * r.materialCost),"
+ lostMaterial = " union all (select r.depart "+noQuerySupplierName+",r.materialName,sum(r.additionalAmount),sum(r.additionalAmount * r.materialCost),"
+"sum(r.additionalAmount * r.materialCost) as settlementDiscountPrice,'材料' as type,'' as batchNumber,null as expDate,0 as tousseDefinitionId "
+ " from MaterialErrorDamageDetail r left join materialDefinition m on r.materialDefinitionId = m.id where 1=1 and r.errorType = '缺失' and r.type = '"+MaterialErrorDamageDetail.TYPE_ERROR+"' and r.materialName != '器械包标识牌' and r.additionalAmount > 0 and "+getHandleDeptCodeSql("r.handleDepartCode")+" "
+ lostMaterialFilterSql + "group by r.depart,r.materialName ) ";
- damageMaterial = " union all (select i.depart,i.materialName,sum(i.additionalAmount),sum(i.materialCost*i.additionalAmount),"
+ damageMaterial = " union all (select i.depart"+noQuerySupplierName+",i.materialName,sum(i.additionalAmount),sum(i.materialCost*i.additionalAmount),"
+"sum(i.materialCost*i.additionalAmount) as settlementDiscountPrice,'材料' as type,'' as batchNumber,null as expDate,0 as tousseDefinitionId "
+ "from MaterialErrorDamageDetail i left join materialDefinition m on i.materialDefinitionId = m.id where 1=1 "
+ "and i.type = '" + MaterialErrorDamageDetail.TYPE_DAMAGE + "' and i.additionalAmount > 0 and "+getHandleDeptCodeSql("i.handleDepartCode")+" " + damageFilterSql
+ " group by i.departCode,i.depart,i.materialName ) ";
}
//退货(一次性物品、器械包)
- String returnGoodsSql = " union all (select rr.depart as settleaccountsdepart,ri.toussename as name,"
+ String returnGoodsSql = " union all (select rr.depart as settleaccountsdepart"+dgbsOfSupplierNameSql+",ri.toussename as name,"
+ "-sum(ri.amount) as amount,-sum(ri.settlementPrice) as settlementprice,-sum(ri.settlementPrice) as settlementDiscountPrice,"
+returnGoodsTousseType+" as type"
+ ",ri.batchNumber as batchNumber,dgbs.expDate,"+returnGoodsTousseDefinitionId+" as tousseDefinitionId from " + ReturnGoodsRecord.class.getSimpleName() + " rr inner join "
@@ -3882,36 +3897,36 @@
+ " where " + getHandleDeptCodeSql("rr.handleDepartCode")+" "
+ returnGoodsFilterSql
+" and "+returnGoodsItemPredicate
- + " group by rr.depart,ri.toussename,"+returnGoodsTousseType+",ri.batchNumber,dgbs.expDate,"+returnGoodsTousseDefinitionId+") ";
+ + " group by rr.depart,ri.toussename,"+returnGoodsTousseType+",ri.batchNumber,dgbs.expDate,"+returnGoodsTousseDefinitionId+ dgbsOfSupplierNameSql +") ";
String supplyRoomTousseTypeSql = "";
if(TYPE_AUTO_DEDUCTION.equals(typeSearch)){
supplyRoomTousseTypeSql = String.format(" and rr.type='%s' ", InvoiceItem.TYPE_AUTO_DEDUCTION);
}
- String supplyRoomDiposableGoodsSql = " union all (select rr.depart as settleaccountsdepart,rri.goodsName,sum(rri.amount),"
- +"sum(rri.price*rri.amount) as settlementprice,sum(rri.price*rri.amount) as settlementDiscountPrice,rri.type as type,dbs.batchNumber as batchNumber,dbs.expDate,0 as tousseDefinitionId "
- +" 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")+" "
+ String supplyRoomDiposableGoodsSql = " union all (select rr.depart"+ dgbsOfSupplierNameSql +" as settleaccountsdepart,rri.goodsName,sum(rri.amount),"
+ +"sum(rri.price*rri.amount) as settlementprice,sum(rri.price*rri.amount) as settlementDiscountPrice,rri.type as type,dgbs.batchNumber as batchNumber,dgbs.expDate,0 as tousseDefinitionId "
+ +" 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")+" "
+supplyRoomDiposableGoodsFilterSql
+supplyRoomTousseTypeSql
+" and "+receiveRecordItemPredicate
- + " group by rr.depart,rri.goodsName,rri.amount,rri.type,dbs.batchNumber,dbs.expDate) ";
+ + " group by rr.depart,rri.goodsName,rri.amount,rri.type,dgbs.batchNumber,dgbs.expDate "+ dgbsOfSupplierNameSql +") ";
// 调拨出库
- String appropriateOutDiposableGoodsSql = " union all (select oge.targetOrgUnitName as settleaccountsdepart,ged.goodsName,sum(ged.amount),"
- +"sum(ged.price*ged.amount) as settlementprice,sum(ged.price*ged.amount) as settlementDiscountPrice,'一次性物品' as type,dgb.batchNumber as batchNumber,dgb.expDate,0 as tousseDefinitionId "
- +" from GodownEntry oge inner join GodownEntryDiposableGoodsItem ged on oge.id = ged.godownEntryID inner join DisposableGoodsBatch dgb on ged.disposableGoodsBatchID=dgb.id inner join DisposableGoods dg on dgb.diposablegoods_id = dg.id "
+ String appropriateOutDiposableGoodsSql = " union all (select oge.targetOrgUnitName as settleaccountsdepart"+dgbsOfSupplierNameSql+",ged.goodsName,sum(ged.amount),"
+ +"sum(ged.price*ged.amount) as settlementprice,sum(ged.price*ged.amount) as settlementDiscountPrice,'一次性物品' as type,dgbs.batchNumber as batchNumber,dgbs.expDate,0 as tousseDefinitionId "
+ +" 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")+" "
+outEntryFilterSql
+" and "+outEntryPredicate
- + " group by oge.targetOrgUnitName, ged.goodsName,dgb.batchNumber,dgb.expDate) ";
+ + " group by oge.targetOrgUnitName, ged.goodsName,dgbs.batchNumber,dgbs.expDate "+ dgbsOfSupplierNameSql +") ";
// 盘亏出库
- String stocktakeOutDiposableGoodsSql = " union all (select oge.orgUnitName as settleaccountsdepart,ged.goodsName,sum(ged.amount),"
- +"sum(ged.price*ged.amount) as settlementprice,sum(ged.price*ged.amount) as settlementDiscountPrice,'一次性物品' as type,dgb.batchNumber as batchNumber,dgb.expDate,0 as tousseDefinitionId "
- +" from GodownEntry oge inner join GodownEntryDiposableGoodsItem ged on oge.id = ged.godownEntryID inner join DisposableGoodsBatch dgb on ged.disposableGoodsBatchID=dgb.id inner join DisposableGoods dg on dgb.diposablegoods_id = dg.id "
+ String stocktakeOutDiposableGoodsSql = " union all (select oge.orgUnitName"+dgbsOfSupplierNameSql+" as settleaccountsdepart,ged.goodsName,sum(ged.amount),"
+ +"sum(ged.price*ged.amount) as settlementprice,sum(ged.price*ged.amount) as settlementDiscountPrice,'一次性物品' as type,dgbs.batchNumber as batchNumber,dgbs.expDate,0 as tousseDefinitionId "
+ +" 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")+" "
+outEntryFilterSql
+" and "+outEntryPredicate
- + " group by oge.orgUnitName, ged.goodsName,dgb.batchNumber,dgb.expDate) ";
+ + " group by oge.orgUnitName, ged.goodsName,dgbs.batchNumber,dgbs.expDate"+dgbsOfSupplierNameSql+") ";
String sql = tousseSql + selectExpensiveGoodsSql + diposableGoodsSql + supplyRoomDiposableGoodsSql ;
@@ -3984,6 +3999,13 @@
if(totalAmount != 0){
price = MathTools.divide(settlementPrice, totalAmount, 4);
}
+ if(showSupplierNameInDetailedAccountingMonthlyReport){
+ if(TousseDefinition.PACKAGE_TYPE_FOREIGN.equals(type) || TousseDefinition.PACKAGE_TYPE_SPLIT.equals(type)
+ || DisposableGoods.TYPE_NAME.equals(type)){
+ String supplierName = rs.getString("supplierName");
+ mdi.setSupplierName(supplierName);
+ }
+ }
mdi.setPrice(price);
mdi.setAmount(totalAmount);
mdi.setGoodsName(goodsName);
@@ -4183,7 +4205,16 @@
String tousseGroupName = StringTools.defaultIfEmpty(requestParams.get("tousseGroupName"),"全部");
String invoiceDepartGroup = StringTools.defaultIfEmpty(requestParams.get("invoiceDepartGroup"),"all");
boolean enableExpensiveGoods = CssdUtils.getSystemSetConfigByNameBool("enableExpensiveGoods");
-
+ //是否查询并显示发货物品查询报表一次性物品和外来器械的供应商。true:显示;false,默认:不查询显示
+ boolean showSupplierNameInInvoiceItemQueryReport = CssdUtils.getSystemSetConfigByNameBool("showSupplierNameInInvoiceItemQueryReport", false);
+ String querySupplierNameOfTousseDefinition = "";//查询器械包定义的供应商,用于拼接sql
+ String noQuerySupplierName = "";//不查询供应商,用于拼接sql,使union all列数一致
+ String querySupplierNameOfDisposableGoodsBatchStock = "";//查询DisposableGoodsBatchStock的供应商,用于拼接sql
+ if(showSupplierNameInInvoiceItemQueryReport){
+ querySupplierNameOfTousseDefinition = ",td.supplierName";
+ noQuerySupplierName = ",''";
+ querySupplierNameOfDisposableGoodsBatchStock = ",dgbs.supplierName";
+ }
String tousseTypeSql = " 1=1 ";
String disposableTypeSql = " 1=1 ";
String materialTypeSql = " 1=1 ";
@@ -4282,31 +4313,31 @@
String tousseAmount = " case td.toussetype when '"+TousseDefinition.PACKAGE_TYPE_CUSTOM+"' then " + cumstomTousseAmount
+ " when '"+TousseDefinition.PACKAGE_TYPE_DISINFECTION+"' then case when m.mcount is null then 1 else m.mcount end else 1 end ";
String sql = " ";
- String tousseSql = "select '器械包' as type,po.orgUnitCoding,po.settleAccountsDepart,po.departCoding,po.depart,do.barcode,bo.tousseName as name,"
+ String tousseSql = "select '器械包' as type"+querySupplierNameOfTousseDefinition+",po.orgUnitCoding,po.settleAccountsDepart,po.departCoding,po.depart,do.barcode,bo.tousseName as name,"
+ tousseAmount + " as amount,bo.price as totalPrice,po.sendTime,po.applicant,'' as batch,'' as externalCode,po.remark as remark,bo.sterileEndTime as sterileEndTime,"
+ "bo.sterilizerName as sterilizerName,bo.sterileFrequency as sterileFrequency,po.hospitalNumber as hospitalNumber,po.sender,po.assistantSender,bo.validUntil as expDate from "
+ Invoice.class.getSimpleName() + " po inner join " + TousseInstance.class.getSimpleName() + " bo on po.id = bo.invoice_id "
+ " inner join " + BarcodeDevice.class.getSimpleName()+ " do on bo.id = do.id"
+ " inner join " + TousseDefinition.class.getSimpleName() + " td on bo.tousseDefinition_id=td.id "
+ " left join (" + tousseMaterialAmount + " ) m on m.id = td.id"
+" where 1=1 " + tousseGroupNameSql + remarkCondition + hospitalNumberSql + " and " + tousseTypeSql;
- String diposableSql = "select '一次性物品' as type,po.orgUnitCoding, po.settleAccountsDepart,po.departCoding,po.depart,case when bo.expensiveDGBarcode is null then bo.barcode else bo.expensiveDGBarcode end barcode,bo.name,bo.amount,bo.price*bo.amount as totalPrice,"
+ String diposableSql = "select '一次性物品' as type "+querySupplierNameOfDisposableGoodsBatchStock+",po.orgUnitCoding, po.settleAccountsDepart,po.departCoding,po.depart,case when bo.expensiveDGBarcode is null then bo.barcode else bo.expensiveDGBarcode end barcode,bo.name,bo.amount,bo.price*bo.amount as totalPrice,"
+ "po.sendTime,po.applicant,bo.batch,dg.externalCode,po.remark as remark,'' as sterileEndTime,'' as sterilizerName,'' as sterileFrequency,"
+ "po.hospitalNumber as hospitalNumber,po.sender,po.assistantSender,dgbs.expDate from "
+ Invoice.class.getSimpleName() + " po," + DiposableGoodsItem.class.getSimpleName()+" bo,"
+ DisposableGoods.class.getSimpleName() + " dg,"+ DisposableGoodsBatchStock.class.getSimpleName() +" dgbs where po.id = bo.invoice_id and "
+ " bo.disposableGoodsBatchStockID=dgbs.id and "
+ "bo.disposableGoodsID = dg.id " + remarkCondition + hospitalNumberSql + " and " + disposableTypeSql;
- String expensiveGoods = "select '高值耗材' as type,po.orgUnitCoding, po.settleAccountsDepart,po.departCoding,po.depart,bd.barcode barcode,ii.tousseName name,ii.amount,ii.settlementPrice as totalPrice,"
+ String expensiveGoods = "select '高值耗材' as type"+noQuerySupplierName+",po.orgUnitCoding, po.settleAccountsDepart,po.departCoding,po.depart,bd.barcode barcode,ii.tousseName name,ii.amount,ii.settlementPrice as totalPrice,"
+ "po.sendTime,po.applicant,'' batch,eg.externalCode,po.remark as remark,'' as sterileEndTime,'' as sterilizerName,'' as sterileFrequency,"
+ "po.hospitalNumber as hospitalNumber,po.sender,po.assistantSender,ei.expDate from "
+ Invoice.class.getSimpleName() + " po join " + InvoiceItem.class.getSimpleName()+" ii on ii.invoice_id = po.id"
+ " join " + ExpensiveGoodsInstance.class.getSimpleName() + " ei on ei.id = ii.expensiveGoodsInstanceId join "+ BarcodeDevice.class.getSimpleName() +" bd on bd.id = ei.id"
+ " join " + ExpensiveGoods.class.getSimpleName() + " eg on eg.id = ei.expensiveGoods_id"
+ " where (1=1) " + remarkCondition + hospitalNumberSql + " and " + expensiveGoodsSql;
- String materialSql = "select '材料' as type,po.orgUnitCoding, po.settleAccountsDepart,po.departCoding,po.depart,'' as barcode,bo.name as name,bo.amount,bo.price*bo.amount as totalPrice,"
+ String materialSql = "select '材料' as type"+noQuerySupplierName+",po.orgUnitCoding, po.settleAccountsDepart,po.departCoding,po.depart,'' as barcode,bo.name as name,bo.amount,bo.price*bo.amount as totalPrice,"
+ "po.sendTime,'' as applicant,'' as batch,dg.externalCode,po.remark as remark,'' as sterileEndTime,'' as sterilizerName,'' as sterileFrequency,"
+ "'' as hospitalNumber,po.sender,'' as assistantSender,null as expDate from " + MaterialInvoice.class.getSimpleName() + " po inner join "
+ MaterialItem.class.getSimpleName() + " bo on po.id = bo.materialInvoice_id "
@@ -4355,8 +4386,10 @@
try {
while (rs2.next()) {
InvoiceQueryItem item = new InvoiceQueryItem();
-
String departStr = rs2.getString("settleAccountsDepart");
+ if(showSupplierNameInInvoiceItemQueryReport){
+ item.setSupplierName(rs2.getString("supplierName"));
+ }
item.setBarcode(rs2.getString("barcode"));
item.setGoodsName(rs2.getString("name"));
item.setAmount(rs2.getInt("amount"));
Index: ssts-web/src/main/webapp/jasperRtp/invoiceItemsQuery_child_1AddSupplierName.jrxml
===================================================================
diff -u
--- ssts-web/src/main/webapp/jasperRtp/invoiceItemsQuery_child_1AddSupplierName.jrxml (revision 0)
+++ ssts-web/src/main/webapp/jasperRtp/invoiceItemsQuery_child_1AddSupplierName.jrxml (revision 25907)
@@ -0,0 +1,208 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
Index: ssts-web/src/main/webapp/disinfectsystem/reportforms/invoiceQueryView.js
===================================================================
diff -u -r23655 -r25907
--- ssts-web/src/main/webapp/disinfectsystem/reportforms/invoiceQueryView.js (.../invoiceQueryView.js) (revision 23655)
+++ ssts-web/src/main/webapp/disinfectsystem/reportforms/invoiceQueryView.js (.../invoiceQueryView.js) (revision 25907)
@@ -53,9 +53,19 @@
removeMask: true
});
myMask.show();
-
+ var jasperreportNameOfsummaryType = "invoiceSummaryQuery_main.jasper";//发货汇总的jasperreportName
+ var jasperreportNameOfDetailedType = "invoiceItemsQuery_main_1.jasper";//发货明细的jasperreportName
+ //获取配置是否查询显示供应商,默认false:不查询隐藏供应商
+ var showSupplierNameInInvoiceItemQueryReport = false;
+ if(sstsConfig.hasOwnProperty('showSupplierNameInInvoiceItemQueryReport') && sstsConfig.showSupplierNameInInvoiceItemQueryReport){
+ showSupplierNameInInvoiceItemQueryReport = true;
+ }
+ if(showSupplierNameInInvoiceItemQueryReport){//有供应商的发货物品查询报表jasperreportName
+ jasperreportNameOfsummaryType = "invoiceSummaryQuery_mainAddSupplierName.jasper";
+ jasperreportNameOfDetailedType = "invoiceItemsQuery_main_1AddSupplierName.jasper";
+ }
if(summaryType == "发货汇总"){
- window.open(WWWROOT + "/jasperreports/jasperreportsAction!createReportFromJavaBeanSource.do?jasperreportName=invoiceSummaryQuery_main.jasper&reportName=invoiceSummaryQuery&depart="
+ window.open(WWWROOT + "/jasperreports/jasperreportsAction!createReportFromJavaBeanSource.do?jasperreportName="+jasperreportNameOfsummaryType+"&reportName=invoiceSummaryQuery&depart="
+ departSearch+ "&settleDepartSearch=" + settleDepartSearch
+"&startDate=" + startDate + "&endDate=" +endDate
+ "&applicant=" + applicant + "&goodsName=" +goodsName + "&hasRemark=" +hasRemark
@@ -64,7 +74,7 @@
+ "&batchNumber=" + batchNumber + "&hospitalNumber=" + hospitalNumber + "&tousseGroupName=" + tousseGroupName
+ "&invoiceDepartGroup=" + invoiceDepartGroup, 'thisIframe', '_self');
}else{
- window.open(WWWROOT + "/jasperreports/jasperreportsAction!createReportFromJavaBeanSource.do?jasperreportName=invoiceItemsQuery_main_1.jasper&reportName=invoiceQuery&depart="
+ window.open(WWWROOT + "/jasperreports/jasperreportsAction!createReportFromJavaBeanSource.do?jasperreportName="+jasperreportNameOfDetailedType+"&reportName=invoiceQuery&depart="
+ departSearch+ "&settleDepartSearch=" + settleDepartSearch
+"&startDate=" + startDate + "&endDate=" +endDate
+ "&applicant=" + applicant + "&goodsName=" +goodsName + "&hasRemark=" +hasRemark
Index: ssts-web/src/main/webapp/jasperRtp/routineMonitoringReport.jrxml
===================================================================
diff -u -r14514 -r25907
--- ssts-web/src/main/webapp/jasperRtp/routineMonitoringReport.jrxml (.../routineMonitoringReport.jrxml) (revision 14514)
+++ ssts-web/src/main/webapp/jasperRtp/routineMonitoringReport.jrxml (.../routineMonitoringReport.jrxml) (revision 25907)
@@ -1,5 +1,5 @@
-
+
@@ -65,7 +65,7 @@
-
+
@@ -76,7 +76,7 @@
-
+
Index: ssts-web/src/main/webapp/jasperRtp/departmentMonthDetailSupplierName.jasper
===================================================================
diff -u
Binary files differ
Index: ssts-web/src/main/webapp/disinfectsystem/config/szszyy/config.js
===================================================================
diff -u -r25194 -r25907
--- ssts-web/src/main/webapp/disinfectsystem/config/szszyy/config.js (.../config.js) (revision 25194)
+++ ssts-web/src/main/webapp/disinfectsystem/config/szszyy/config.js (.../config.js) (revision 25907)
@@ -81,5 +81,9 @@
//是否允许回收数量减小的部分超过待装配数量
allowDecreaseRecyclingAmountGreatUnPackingAmount: true,
//是否在个人桌面显示外部代理灭菌的图标
- showForeignProxySterilizationDesktopIcon:true
+ showForeignProxySterilizationDesktopIcon:true,
+ //是否查询并显示明细核算月报一次性物品和外来器械的供应商。true:显示;false,默认:不查询显示
+ showSupplierNameInDetailedAccountingMonthlyReport : true,
+ //是否查询并显示发货物品查询报表一次性物品和外来器械的供应商。true:显示;false,默认:不查询显示
+ showSupplierNameInInvoiceItemQueryReport : true
}
\ No newline at end of file
Index: ssts-reports/src/main/java/com/forgon/disinfectsystem/jasperreports/javabeansource/DepartmentMonthDetailItem.java
===================================================================
diff -u -r17020 -r25907
--- ssts-reports/src/main/java/com/forgon/disinfectsystem/jasperreports/javabeansource/DepartmentMonthDetailItem.java (.../DepartmentMonthDetailItem.java) (revision 17020)
+++ ssts-reports/src/main/java/com/forgon/disinfectsystem/jasperreports/javabeansource/DepartmentMonthDetailItem.java (.../DepartmentMonthDetailItem.java) (revision 25907)
@@ -38,6 +38,10 @@
private String expDate;
private int typeOrder = ORDER_TOUSSE;
+ /**
+ * 供应商 主要显示一次性物品和外来器械的供应商
+ */
+ private String supplierName;
public String getGoodsName() {
return goodsName;
@@ -141,5 +145,13 @@
public void setExternalCode(String externalCode) {
this.externalCode = externalCode;
}
+
+ public String getSupplierName() {
+ return supplierName;
+ }
+
+ public void setSupplierName(String supplierName) {
+ this.supplierName = supplierName;
+ }
}
Index: ssts-web/src/main/webapp/jasperRtp/departmentMonthDetailSupplierName_child.jasper
===================================================================
diff -u
Binary files differ
Index: ssts-reports/src/main/java/com/forgon/disinfectsystem/jasperreports/javabeansource/InvoiceQueryItem.java
===================================================================
diff -u -r25160 -r25907
--- ssts-reports/src/main/java/com/forgon/disinfectsystem/jasperreports/javabeansource/InvoiceQueryItem.java (.../InvoiceQueryItem.java) (revision 25160)
+++ ssts-reports/src/main/java/com/forgon/disinfectsystem/jasperreports/javabeansource/InvoiceQueryItem.java (.../InvoiceQueryItem.java) (revision 25907)
@@ -87,7 +87,11 @@
* 单位(针对GGSRMYY-51 增加一次性物品发放表新增字段)
*/
private String unit;
-
+ /**
+ * 供应商 主要显示一次性物品和外来器械的供应商
+ */
+ private String supplierName;
+
public String getExternalCode() {
return externalCode;
}
@@ -254,4 +258,12 @@
this.sequence = sequence;
}
+ public String getSupplierName() {
+ return supplierName;
+ }
+
+ public void setSupplierName(String supplierName) {
+ this.supplierName = supplierName;
+ }
+
}
Index: ssts-web/src/main/webapp/jasperRtp/invoiceItemsQuery_child_1AddSupplierName.jasper
===================================================================
diff -u
Binary files differ
Index: ssts-web/src/main/webapp/jasperRtp/invoiceSummaryQuery_mainAddSupplierName.jrxml
===================================================================
diff -u
--- ssts-web/src/main/webapp/jasperRtp/invoiceSummaryQuery_mainAddSupplierName.jrxml (revision 0)
+++ ssts-web/src/main/webapp/jasperRtp/invoiceSummaryQuery_mainAddSupplierName.jrxml (revision 25907)
@@ -0,0 +1,142 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
Index: ssts-web/src/main/webapp/jasperRtp/invoiceSummaryQuery_childAddSupplierName.jrxml
===================================================================
diff -u
--- ssts-web/src/main/webapp/jasperRtp/invoiceSummaryQuery_childAddSupplierName.jrxml (revision 0)
+++ ssts-web/src/main/webapp/jasperRtp/invoiceSummaryQuery_childAddSupplierName.jrxml (revision 25907)
@@ -0,0 +1,116 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
Index: ssts-web/src/main/webapp/jasperRtp/invoiceSummaryQuery_mainAddSupplierName.jasper
===================================================================
diff -u
Binary files differ
Index: ssts-web/src/main/webapp/jasperRtp/departmentMonthDetailSupplierName_child.jrxml
===================================================================
diff -u
--- ssts-web/src/main/webapp/jasperRtp/departmentMonthDetailSupplierName_child.jrxml (revision 0)
+++ ssts-web/src/main/webapp/jasperRtp/departmentMonthDetailSupplierName_child.jrxml (revision 25907)
@@ -0,0 +1,138 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
Index: ssts-web/src/main/webapp/jasperRtp/departmentMonthDetailSupplierName.jrxml
===================================================================
diff -u
--- ssts-web/src/main/webapp/jasperRtp/departmentMonthDetailSupplierName.jrxml (revision 0)
+++ ssts-web/src/main/webapp/jasperRtp/departmentMonthDetailSupplierName.jrxml (revision 25907)
@@ -0,0 +1,211 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
Index: ssts-web/src/main/webapp/jasperRtp/invoiceItemsQuery_main_1AddSupplierName.jrxml
===================================================================
diff -u
--- ssts-web/src/main/webapp/jasperRtp/invoiceItemsQuery_main_1AddSupplierName.jrxml (revision 0)
+++ ssts-web/src/main/webapp/jasperRtp/invoiceItemsQuery_main_1AddSupplierName.jrxml (revision 25907)
@@ -0,0 +1,219 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
Index: ssts-web/src/main/webapp/jasperRtp/invoiceItemsQuery_main_1AddSupplierName.jasper
===================================================================
diff -u
Binary files differ
Index: ssts-web/src/main/webapp/jasperRtp/routineMonitoringReport.jasper
===================================================================
diff -u -r14514 -r25907
Binary files differ
Index: ssts-web/src/main/webapp/jasperRtp/departmentMonthDetailSupplierNameAndDiscountPrice.jasper
===================================================================
diff -u
Binary files differ
Index: ssts-web/src/main/webapp/jasperRtp/departmentMonthDetailSupplierNameAndDiscountPrice_child.jasper
===================================================================
diff -u
Binary files differ
Index: ssts-web/src/main/webapp/disinfectsystem/reportforms/departmentMonthlyDetailDSInvoiceItemView.js
===================================================================
diff -u -r23941 -r25907
--- ssts-web/src/main/webapp/disinfectsystem/reportforms/departmentMonthlyDetailDSInvoiceItemView.js (.../departmentMonthlyDetailDSInvoiceItemView.js) (revision 23941)
+++ ssts-web/src/main/webapp/disinfectsystem/reportforms/departmentMonthlyDetailDSInvoiceItemView.js (.../departmentMonthlyDetailDSInvoiceItemView.js) (revision 25907)
@@ -54,8 +54,18 @@
}
myMask.show();
var jasperreportFileName = "DepartmentMonthDetail.jasper";
- if(sstsConfig.enableDiscountPrice){
+ //获取配置是否查询显示供应商,默认false:不查询隐藏供应商
+ var showSupplierNameInDetailedAccountingMonthlyReport = false;
+ if(sstsConfig.hasOwnProperty('showSupplierNameInDetailedAccountingMonthlyReport') && sstsConfig.showSupplierNameInDetailedAccountingMonthlyReport){
+ showSupplierNameInDetailedAccountingMonthlyReport = true;
+ }
+ var enableDiscountPrice = sstsConfig.enableDiscountPrice;
+ if(enableDiscountPrice && showSupplierNameInDetailedAccountingMonthlyReport){//价格供应商都显示
+ jasperreportFileName = "DepartmentMonthDetailSupplierNameAndDiscountPrice.jasper";
+ }else if(enableDiscountPrice){//显示价格
jasperreportFileName = "DepartmentMonthDetailDiscountPrice.jasper";
+ }else if(showSupplierNameInDetailedAccountingMonthlyReport){//查询显示供应商
+ jasperreportFileName = "DepartmentMonthDetailSupplierName.jasper";
}
/*window.open(WWWROOT + "/jasperreports/jasperreportsAction!createReportFromJavaBeanSource.do?"
+ "reportName=departmentMonthDetail&jasperreportName=" + jasperreportFileName
Index: ssts-web/src/main/webapp/jasperRtp/invoiceSummaryQuery_childAddSupplierName.jasper
===================================================================
diff -u
Binary files differ
Index: ssts-web/src/main/webapp/jasperRtp/departmentMonthDetailSupplierNameAndDiscountPrice.jrxml
===================================================================
diff -u
--- ssts-web/src/main/webapp/jasperRtp/departmentMonthDetailSupplierNameAndDiscountPrice.jrxml (revision 0)
+++ ssts-web/src/main/webapp/jasperRtp/departmentMonthDetailSupplierNameAndDiscountPrice.jrxml (revision 25907)
@@ -0,0 +1,245 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+