Index: ssts-reports/src/main/java/com/forgon/disinfectsystem/jasperreports/service/JasperReportManager.java =================================================================== diff -u -r12943 -r12957 --- ssts-reports/src/main/java/com/forgon/disinfectsystem/jasperreports/service/JasperReportManager.java (.../JasperReportManager.java) (revision 12943) +++ ssts-reports/src/main/java/com/forgon/disinfectsystem/jasperreports/service/JasperReportManager.java (.../JasperReportManager.java) (revision 12957) @@ -193,14 +193,14 @@ public List getGodownEntryStatisticBean( String title, String author, String orgUnit, String sheetId, String unit, String timeStart, String timeEnd, String goodsName, - String filterSql1, String filterSql2); + String filterSql1, String filterSql2,String suplierName); public List getwashWorkloadList(String month,String querySupplyRoom); public List getGodownEntryDetailStatistic( String title, String author, String orgUnit, String sheetId, String unit, String timeStart, String timeEnd, String goodsName, - String filterSql1, String filterSql2); + String filterSql1, String filterSql2,String suplierName); /** * @param startDay Index: ssts-reports/src/main/java/com/forgon/disinfectsystem/jasperreports/action/JasperreportsAction.java =================================================================== diff -u -r12944 -r12957 --- ssts-reports/src/main/java/com/forgon/disinfectsystem/jasperreports/action/JasperreportsAction.java (.../JasperreportsAction.java) (revision 12944) +++ ssts-reports/src/main/java/com/forgon/disinfectsystem/jasperreports/action/JasperreportsAction.java (.../JasperreportsAction.java) (revision 12957) @@ -574,7 +574,7 @@ } return jasperReportManager.getGodownEntryStatisticBean(title, author, orgUnit, sheetId, unit, timeStart, timeEnd, - goodsName, filterSql1, filterSql2); + goodsName, filterSql1, filterSql2,null); }else if(reportName.equals("washWorkloadReprot")){ // 清洗器械物品工作量及不合格率汇总表 String month = StrutsParamUtils.getPraramValue("month", ""); @@ -601,6 +601,7 @@ String goodsName = StrutsParamUtils.getPraramValue("goodsName", ""); String type = StrutsParamUtils.getPraramValue("type", ""); + String suplierName = StrutsParamUtils.getPraramValue("suplierName", ""); String filterSql1 = ""; String filterSql2 = ""; if (StringUtils.isNotBlank(goodsName)) { @@ -632,7 +633,7 @@ } return jasperReportManager.getGodownEntryDetailStatistic(title, author, orgUnit, sheetId, unit, timeStart, timeEnd, - goodsName, filterSql1, filterSql2); + goodsName, filterSql1, filterSql2,suplierName); }else if (reportName.equals("useRecordTotalView")) {//使用记录录入统计报表 Index: ssts-reports/src/main/java/com/forgon/disinfectsystem/jasperreports/service/JasperReportManagerImpl.java =================================================================== diff -u -r12953 -r12957 --- ssts-reports/src/main/java/com/forgon/disinfectsystem/jasperreports/service/JasperReportManagerImpl.java (.../JasperReportManagerImpl.java) (revision 12953) +++ ssts-reports/src/main/java/com/forgon/disinfectsystem/jasperreports/service/JasperReportManagerImpl.java (.../JasperReportManagerImpl.java) (revision 12957) @@ -133,6 +133,7 @@ import com.forgon.tools.db.DatabaseUtil; import com.forgon.tools.db.InitDbConnection; import com.forgon.tools.hibernate.ObjectDao; +import com.forgon.tools.string.StringTools; /** * @author wangyi 2012-08-15 上午12:04 报表服务类 @@ -6172,8 +6173,15 @@ public List getGodownEntryStatisticBean( String title, String author, String orgUnit, String sheetId, String unit, String timeStart, String timeEnd, String goodsName, - String filterSql1, String filterSql2) { + String filterSql1, String filterSql2,String suplierName) { + String supplierWhere = " 1=1 "; + String materialSupplierWhere = " 1=1 "; + if(StringTools.isNotEmpty(suplierName)){ + supplierWhere = " gei.supplierName = '" + suplierName + "'"; + materialSupplierWhere = " mei.supplierName = '" + suplierName + "'"; + } + List mainList = new ArrayList(); String database = dbConnection.getDatabase(); @@ -6195,6 +6203,7 @@ + "sum(gei.amount)*gei.cost as totalprice,ge.serialNumber as serialNumber " + "from godownentryitem gei,godownentry ge," + DisposableGoodsStock.class.getSimpleName() + " dg " + "where ge.id = gei.godownentry_id and gei.diposablegoods_id = dg.id " + + " and " + supplierWhere + "and ge.type = '入库单' " + " and ge.time >= " + dateQueryAdapter.dateAdapter(timeStart) + " and ge.time <= " + dateQueryAdapter.dateAdapter(timeEnd) @@ -6210,6 +6219,7 @@ + "mei.cost as price,mei.cost*mei.amount as totalprice,me.serialNumber as serialNumber " + "from materialentry me,materialentryitem mei,materialdefinition md " + "where me.id = mei.materialentry_id and mei.materialdefinition_id = md.id " + + " and " + materialSupplierWhere + "and me.type = '入库单' and me.time >= " + dateQueryAdapter.dateAdapter(timeStart) + " and me.time <= " + dateQueryAdapter.dateAdapter(timeEnd) + filterSql2 + ") temp2 group by mid,name,specification,serialNumber " @@ -6253,7 +6263,7 @@ List childBeans = getGodownEntryStatisticChildBean( timeStart, timeEnd, main.getDid(), main.getMid(), - main.getBatchnumber(),main.getGodownEntryNumber()); + main.getBatchnumber(),main.getGodownEntryNumber(),suplierName); main.setChildList(childBeans); } for (GodownEntryStatistic_main main : mainList) { @@ -6277,8 +6287,14 @@ private List getGodownEntryStatisticChildBean( String timeStart, String timeEnd, String did, String mid, - String batchnumber,String serialNumber) { + String batchnumber,String serialNumber,String filterSupplierName) { + String supplierWhere = " 1=1 "; + String materialSupplierWhere = " 1=1 "; + if(StringTools.isNotEmpty(filterSupplierName)){ + supplierWhere = " gei.supplierName = '" + filterSupplierName + "'"; + materialSupplierWhere = " mei.supplierName = '" + filterSupplierName + "'"; + } String sql = "select batchnumber,totalamount,price,totalprice as totalprice,expDate,supplierName," +"sterileBatchNumber,manufacturer,certification,id,time from" + " (select " @@ -6290,6 +6306,7 @@ + "godownentryitem gei,godownentry ge," + DisposableGoodsStock.class.getSimpleName() + " dg," + DisposableGoodsBatchStock.class.getSimpleName() + " ds " + "where ge.id = gei.godownentry_id " + "and gei.diposablegoods_id = dg.id " + + "and " + supplierWhere + "and dg.id = ds.diposablegoods_id " + "and gei.batchnumber = ds.batchnumber " + "and ge.type = '入库单' " @@ -6324,6 +6341,7 @@ + "from materialentry me,materialentryitem mei,materialdefinition md " + "where me.id = mei.materialentry_id " + "and mei.materialdefinition_id = md.id " + + " and " + materialSupplierWhere + "and me.type = '入库单' " + "and me.time >= " + dateQueryAdapter.dateAdapter(timeStart) @@ -6621,11 +6639,11 @@ public List getGodownEntryDetailStatistic( String title, String author, String orgUnit, String sheetId, String unit, String timeStart, String timeEnd, String goodsName, - String filterSql1, String filterSql2) { + String filterSql1, String filterSql2,String suplierName) { List mainList = getGodownEntryStatisticBean(title, author, orgUnit, sheetId, unit, timeStart, timeEnd, - goodsName, filterSql1, filterSql2); + goodsName, filterSql1, filterSql2,suplierName); return mainList; } Index: ssts-web/src/main/webapp/disinfectsystem/reportforms/godownEntryDetailStatisticView.js =================================================================== diff -u -r12331 -r12957 --- ssts-web/src/main/webapp/disinfectsystem/reportforms/godownEntryDetailStatisticView.js (.../godownEntryDetailStatisticView.js) (revision 12331) +++ ssts-web/src/main/webapp/disinfectsystem/reportforms/godownEntryDetailStatisticView.js (.../godownEntryDetailStatisticView.js) (revision 12957) @@ -46,7 +46,8 @@ "&orgUnit=" + reportParamOrgUnit + "&sheetId=" + reportParamSheetId + "&unit=" + reportParamUnit + - "&type=" + type; + "&type=" + type + + "&suplierName=" + Ext.getCmp('suplierName').getValue(); window.open(reportUrl, 'thisIframe','_self'); } @@ -63,7 +64,19 @@ fields : ['value'], data : [ ['全部'],['手工录入'],['系统同步']] }); - + var supplierStore = new Ext.data.Store({ + proxy : new Ext.data.HttpProxy({ + url : WWWROOT + '/disinfectSystem/baseData/supplierAction!getSupplierData.do?supplierType='+encodeURI(supplier), + method : 'POST' + }), + reader : new Ext.data.JsonReader({ + totalProperty : 'totalCount', + root : 'data' + }, [ + {name : 'id',mapping : 'id'}, + {name : 'name',mapping : 'name'} + ]) + }); var form = new Ext.form.FormPanel({ title : entityName, region : 'north', @@ -151,6 +164,35 @@ layout : 'form', labelWidth : 60, columnWidth : .2, + items : [{ + fieldLabel : '供应商', + xtype : 'combo', + id : 'suplierName', + name : 'suplierName', + queryParam : 'supplierName', + minChars : 0, + valueField : 'id', + displayField : 'name', + width : 600, + store : supplierStore, + forceSelection : true, + lazyInit : true, + triggerAction : 'all', + hideTrigger : true, + typeAhead : false, + allowBlank : true, + anchor : '97%', + listeners : { + select : function(combo, record, index) { + Ext.getCmp('suplierName').setValue(record.data.name); + } + } + }] + + },{ + layout : 'form', + labelWidth : 60, + columnWidth : .2, items : [{ fieldLabel : '物品名称', xtype : 'combo', @@ -176,7 +218,7 @@ } }] },{ - columnWidth : .25, + columnWidth : .2, layout : 'form', labelWidth : 60, items : [{ @@ -212,6 +254,7 @@ handler : function() { $Id('timeStart').value = ""; $Id('timeEnd').value = ""; + Ext.getCmp('suplierName').setValue(""); } }] });