二次开发的帐表在oracle中报错 table or view does not exit
金蝶云社区-BacktotheSea
BacktotheSea
0人赞赏了该文章 2,293次浏览 未经作者许可,禁止转载编辑于2015年11月19日 08:45:29

完整代码:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Kingdee.BOS.Contracts.Report;
using Kingdee.BOS.Core.Report;
using Kingdee.BOS;
using Kingdee.BOS.Core.List;
using Kingdee.BOS.Orm.DataEntity;
using Kingdee.BOS.Contracts;
using Kingdee.K3.SCM.Sal.Report.PlugIn;
using Kingdee.K3.CRM.App.Core;
using System.Collections;
using Kingdee.BOS.App.Data;
using Kingdee.BOS.Core.SqlBuilder;
using Kingdee.BOS.Core;
using Kingdee.BOS.Core.Util;
using Kingdee.BOS.Resource;
using Kingdee.BOS.Util;
using Kingdee.BOS.Core.Metadata;
using Kingdee.BOS.Core.Permission;
using Kingdee.BOS.App.Core.BusinessFlow;
using Kingdee.K3.Core;
using Kingdee.BOS.Core.BusinessFlow.ServiceArgs;
using Kingdee.BOS.BusinessEntity.BusinessFlow;
using System.Data;
using Kingdee.BOS.Core.Permission.Objects;
using Kingdee.BOS.Core.CommonFilter;
using Kingdee.BOS.App;
using System.Transactions;

namespace ZhongtongRpt
{
public class MarketCostSumRpt : SysReportBaseService
{
public string filterOrgList;
public string strTempTable = string.Empty;
public string finalTempTable = string.Empty;
//填充数据执行的SQL语句 List
List listDataSqlObj = new List();
//自己创建的临时表的SQL语句 List
List listTableSqlObj = new List();
//待删除的自己创建的临时表
List listDelTempTable = new List();

#region 初始化
//初始化
public override void Initialize()
{
base.Initialize();
base.ReportProperty.IdentityFieldName = "F_xxq_ranking";
this.ReportProperty.ReportType = ReportType.REPORTTYPE_NORMAL;
base.ReportProperty.ReportName = new LocaleValue("营销费用汇总表", this.Context.UserLocale.LCID);
//this.ReportProperty.PrimaryKeyFieldName = "FID";
this.ReportProperty.IsGroupSummary = true;
base.ReportProperty.IsUIDesignerColumns = true;//列头是否BOSIDE设置
base.ReportProperty.SimpleAllCols = false;//是否锁定帐表表格列
//初始化报表使用到的临时表。过程中truncate掉,重复使用,关闭报表后删除
InitCreateTempTables();
//this.SetAllocationSQL();
}
#endregion

#region 主方法
//主方法
public override void BuilderReportSqlAndTempTable(Kingdee.BOS.Core.Report.IRptParams filter, string tableName)
{
//base.BuilderReportSqlAndTempTable(filter, tableName);
//string where = this.GetWhere(filter.FilterParameter.CustomFilter);
//填充临时表
FillTempTable(filter);
//填充最终数据临时表
FillfinalTempTable();
//填充最终数据到平台需要展示的表(TableName)
this.FillFinalDataToShowTable(tableName);
//清空临时表数据And执行填充数据的SQL
TruncateForClearTempTableData();
}
#endregion

#region 初始化创建报表使用的临时表
///


/// 初始化创建报表使用的临时表
///

private void InitCreateTempTables()
{
//创建临时表
this.CreatingTempTable();
//创建最终数据的临时表
this.CreatFinalTempTable();
using (KDTransactionScope scope = new KDTransactionScope(System.Transactions.TransactionScopeOption.RequiresNew))
{
DBUtils.ExecuteBatch(this.Context, listTableSqlObj);
listTableSqlObj.Clear();
scope.Complete();
}
}
#endregion

#region 帐表列头信息
//如果账表模型在设计时,没有配置账表单据体字段信息,则通过此方法设置账表列头字段信息
public override Kingdee.BOS.Core.Report.ReportHeader GetReportHeaders(Kingdee.BOS.Core.Report.IRptParams filter)
{
return base.GetReportHeaders(filter);
}
#endregion

#region 创建临时表
private void CreatingTempTable()
{
StringBuilder sb = new StringBuilder();
//创建临时表
IDBService service = ServiceHelper.GetService();
strTempTable = service.CreateTemporaryTableName(this.Context);
sb.AppendFormat(@"CREATE TABLE {0}
(
F_xxq_ranking int default 0
,FID int default 0
,F_xxq_year int default 0
,F_xxq_month int default 0
,F_xxq_dept varchar(200) default ''
,F_xxq_deptChanger varchar(200) default ''
,F_xxq_emp varchar(200) default ''
,F_xxq_actualCost decimal(16,3) default 0
,F_xxq_planCost decimal(16,3) default 0
,F_xxq_rate decimal(16,3) default 0
,F_xxq_actualTravelCost decimal(16,3) default 0
,F_xxq_planTravelCost decimal(16,3) default 0
,F_xxq_actualZhaodaiCost decimal(16,3) default 0
,F_xxq_planZhaodaiCost decimal(16,3) default 0
,F_xxq_actualWasteCost decimal(16,3) default 0
,F_xxq_planWasteCost decimal(16,3) default 0
,F_xxq_actualActCost decimal(16,3) default 0
,F_xxq_planActCost decimal(16,3) default 0
,F_xxq_actualBiaoshuCost decimal(16,3) default 0
,F_xxq_planBiaoshuCost decimal(16,3) default 0
,F_xxq_actualHuifeiCost decimal(16,3) default 0
,F_xxq_planHuifeiCost decimal(16,3) default 0
) ", strTempTable);
listTableSqlObj.Add(new SqlObject(sb.ToString(), new List()));
//记录自己创建的临时表
listDelTempTable.Add(strTempTable);
sb.Clear();
}
#endregion

#region 创建最终临时表
//创建临时表
public void CreatFinalTempTable()
{
StringBuilder sb = new StringBuilder();
IDBService service = ServiceHelper.GetService();
finalTempTable = service.CreateTemporaryTableName(this.Context);
sb.AppendFormat(@"CREATE TABLE {0}(",finalTempTable);
//sb.AppendFormat("[Fidentityid] [bigint] IDENTITY(1,1) NOT NULL,");
sb.AppendFormat(" F_xxq_ranking int default 0,");
sb.AppendFormat(" FID int default 0,");
sb.AppendFormat(" F_xxq_year int default 0,");
sb.AppendFormat(" F_xxq_month int default 0,");
sb.AppendFormat(" F_xxq_dept varchar(200) default '',");
sb.AppendFormat(" F_xxq_deptChanger varchar(200) default '',");
sb.AppendFormat(" F_xxq_emp varchar(200) default '',");
sb.AppendFormat(" F_xxq_actualCost decimal(16,3) default 0,");
sb.AppendFormat(" F_xxq_planCost decimal(16,3) default 0,");
sb.AppendFormat(" F_xxq_rate decimal(16,3) default 0,");
sb.AppendFormat(" F_xxq_actualTravelCost decimal(16,3) default 0,");
sb.AppendFormat(" F_xxq_planTravelCost decimal(16,3) default 0,");
sb.AppendFormat(" F_xxq_actualZhaodaiCost decimal(16,3) default 0,");
sb.AppendFormat(" F_xxq_planZhaodaiCost decimal(16,3) default 0,");
sb.AppendFormat(" F_xxq_actualWasteCost decimal(16,3) default 0,");
sb.AppendFormat(" F_xxq_planWasteCost decimal(16,3) default 0,");
sb.AppendFormat(" F_xxq_actualActCost decimal(16,3) default 0,");
sb.AppendFormat(" F_xxq_planActCost decimal(16,3) default 0,");
sb.AppendFormat(" F_xxq_actualBiaoshuCost decimal(16,3) default 0,");
sb.AppendFormat(" F_xxq_planBiaoshuCost decimal(16,3) default 0,");
sb.AppendFormat(" F_xxq_actualHuifeiCost decimal(16,3) default 0,");
sb.AppendFormat(" F_xxq_planHuifeiCost decimal(16,3) default 0,");
sb.AppendFormat(" F_xxq_actualPhoneCost decimal(16,3) default 0,");
sb.AppendFormat(" F_xxq_planPhoneCost decimal(16,3) default 0,");
sb.AppendFormat(" F_xxq_actualHire decimal(16,3) default 0,");
sb.AppendFormat(" F_xxq_planHire decimal(16,3) default 0");
sb.AppendFormat(" )");
listTableSqlObj.Add(new SqlObject(sb.ToString(), new List()));
//记录自己创建的临时表
listDelTempTable.Add(finalTempTable);
sb.Clear();
}
#endregion

#region 填充临时表 strTempTable
private void FillTempTable(IRptParams filter)
{
string where = this.GetWhere(filter.FilterParameter.CustomFilter);
StringBuilder sb = new StringBuilder();
sb.AppendFormat(@"INSERT INTO {0} (
F_xxq_year
,F_xxq_month
,F_xxq_dept
,F_xxq_emp
,F_xxq_actualCost
,F_xxq_planCost
,F_xxq_rate
,F_xxq_actualTravelCost
,F_xxq_planTravelCost
,F_xxq_actualZhaodaiCost
,F_xxq_planZhaodaiCost
,F_xxq_actualWasteCost
,F_xxq_planWasteCost
,F_xxq_actualActCost
,F_xxq_planActCost
,F_xxq_actualBiaoshuCost
,F_xxq_planBiaoshuCost
,F_xxq_actualHuifeiCost
,F_xxq_planHuifeiCost
)", strTempTable);
sb.AppendFormat(@"select distinct YEAR(a.FCREATEDATE) 年份,month(a.FCREATEDATE) 月份,ISNULL(g.FNAME,' ') 部门,
ISNULL(e.FNAME,' ') 员工,

(linshi.差旅费实际值+linshi.招待费实际值+linshi.物耗费实际值+linshi.标书费实际值+huodong.actshiji+huifei.huishiji) 营销费用实际值,
(linshi.差旅费计划值+linshi.招待费计划值+linshi.物耗费计划值+linshi.标书费计划值+huodong.actyusuan+huifei.huiyusuan) 营销费用计划值,
case when (linshi.差旅费计划值+linshi.招待费计划值+linshi.物耗费计划值+linshi.标书费计划值+huodong.actyusuan+huifei.huiyusuan)=0 then 0
else ((linshi.差旅费实际值+linshi.招待费实际值+linshi.物耗费实际值+linshi.标书费实际值+huodong.actshiji+huifei.huishiji)
/(linshi.差旅费计划值+linshi.招待费计划值+linshi.物耗费计划值+linshi.标书费计划值+huodong.actyusuan+huifei.huiyusuan)) end 完成率,

linshi.差旅费实际值 差旅费实际值,linshi.差旅费计划值 差旅费计划值,
linshi.招待费实际值 招待费实际值,linshi.招待费计划值 招待费计划值,
linshi.物耗费实际值 物耗费实际值,linshi.物耗费计划值 物耗费计划值,
huodong.actshiji actsj,huodong.actyusuan actjh,
linshi.标书费实际值 标书费实际值,linshi.标书费计划值 标书费计划值,
huifei.huishiji huisj, huifei.huiyusuan huijh

from T_CRM_Opportunity a
left join V_BD_SALESMAN b on a.FBEMPID=b.fid
left join T_BD_STAFF c on b.FSTAFFID=c.FSTAFFID
left join T_HR_EMPINFO d on c.FPERSONID=d.FPERSONID
left join T_HR_EMPINFO_L e on d.FID=e.FID
left join T_BD_DEPARTMENT f on b.FDEPTID=f.FDEPTID
left join T_BD_DEPARTMENT_L g on f.FDEPTID=g.FDEPTID
left join (
select
YEAR(a.FCREATEDATE) 年份,month(a.FCREATEDATE) 月份,ISNULL(g.FNAME,' ') 部门,
ISNULL(e.FNAME,' ') 员工,
sum(sjfeiyong.差旅费实际值) 差旅费实际值,sum(jhfeiyong.差旅费计划值) 差旅费计划值,
sum(sjfeiyong.招待费实际值) 招待费实际值,sum(jhfeiyong.招待费计划值) 招待费计划值,
sum(sjfeiyong.物耗费实际值) 物耗费实际值,sum(jhfeiyong.物耗费计划值) 物耗费计划值,
sum(sjfeiyong.标书费实际值) 标书费实际值,sum(jhfeiyong.标书费计划值) 标书费计划值
from T_CRM_Opportunity a
left join V_BD_SALESMAN b on a.FBEMPID=b.fid
left join T_BD_STAFF c on b.FSTAFFID=c.FSTAFFID
left join T_HR_EMPINFO d on c.FPERSONID=d.FPERSONID
left join T_HR_EMPINFO_L e on d.FID=e.FID
left join T_BD_DEPARTMENT f on b.FDEPTID=f.FDEPTID
left join T_BD_DEPARTMENT_L g on f.FDEPTID=g.FDEPTID
left join (
select j.F_xxq_Integer,
SUM(case when F_XXQ_BASE=102258 then k.F_XXQ_AMOUNT else 0 end ) 标书费计划值,
SUM(case when F_XXQ_BASE=20142 then k.F_XXQ_AMOUNT else 0 end ) 物耗费计划值,
SUM(case when F_XXQ_BASE=20137 then k.F_XXQ_AMOUNT else 0 end ) 招待费计划值,
SUM(case when F_XXQ_BASE=20138 then k.F_XXQ_AMOUNT else 0 end ) 差旅费计划值
from xxq_t_Cust_Entry100007 j,xxq_t_Cust_Entry100008 k
where j.FID = k.fid
group by j.F_XXQ_INTEGER
) jhfeiyong on jhfeiyong.F_XXQ_INTEGER=a.FID
left join (
select a.FID ,
SUM(case when FExpenseItemID=20138 then a.FOrgAmount else 0 end ) 差旅费实际值,
SUM(case when FExpenseItemID=20137 then a.FORGAMOUNT else 0 end ) 招待费实际值,
SUM(case when FExpenseItemID=20142 then a.FORGAMOUNT else 0 end ) 物耗费实际值,
SUM(case when FExpenseItemID=102258 then a.FORGAMOUNT else 0 end ) 标书费实际值
from T_CRM_OppExpense a group by a.FID
) sjfeiyong on a.FID=sjfeiyong.FID
group by YEAR(a.FCREATEDATE),month(a.FCREATEDATE),g.FNAME ,e.FNAME
) linshi
on YEAR(a.FCREATEDATE)=linshi.年份 and month(a.FCREATEDATE)=linshi.月份 and g.FNAME=linshi.部门 and e.FNAME=linshi.员工
left join (
select year(a.FActEndTime) nianfen,MONTH(a.FACTENDTIME) yuefen,
c.FNAME bumen,d.FNAME saler,sum(a.F_xxq_Amount) actyusuan,sum(a.F_xxq_Amount1) actshiji
from T_CRM_Activity a
left join T_CRM_Opportunity b on a.FOPPID=b.FID
left join T_BD_DEPARTMENT_L c on a.F_xxq_Base4=c.FDEPTID
left join V_BD_SALESMAN_L d on a.F_xxq_Base3=d.fid
where isnull(b.FID,0) =0 and isnull(a.FCUSTOMERID,0)<>0
group by year(a.FActEndTime),MONTH(a.FACTENDTIME),c.FNAME,d.FNAME
) huodong on huodong.nianfen=linshi.年份 and huodong.yuefen=linshi.月份
and huodong.bumen=linshi.部门 and huodong.saler=linshi.员工
left join (
select year(a.FActEndTime) nianfen,MONTH(a.FACTENDTIME) yuefen,
c.FNAME bumen,d.FNAME saler,sum(a.F_xxq_Amount) huiyusuan,sum(a.F_xxq_Amount1) huishiji
from T_CRM_Activity a
left join T_CRM_Opportunity b on a.FOPPID=b.FID
left join T_BD_DEPARTMENT_L c on a.F_xxq_Base4=c.FDEPTID
left join V_BD_SALESMAN_L d on a.F_xxq_Base3=d.fid
where isnull(b.FID,0) =0 and isnull(a.FCUSTOMERID,0)=0
group by year(a.FActEndTime),MONTH(a.FACTENDTIME),c.FNAME,d.FNAME
) huifei on huifei.nianfen=linshi.年份 and huifei.yuefen=linshi.月份
and huifei.bumen=linshi.部门 and huifei.saler=linshi.员工 ");
sb.AppendLine(where);
this.listDataSqlObj.Add(new SqlObject(sb.ToString(), new List()));
//DBUtils.ExecuteBatch(this.Context, listDataSqlObj);
sb.Clear();
}
#endregion

#region 填充最终临时表 finalTempTable
private void FillfinalTempTable()
{
StringBuilder sb = new StringBuilder();
sb.AppendFormat(@"INSERT INTO {0}
(
F_xxq_year,F_xxq_month,F_xxq_dept
,F_xxq_emp,F_xxq_actualCost,F_xxq_planCost
,F_xxq_rate,F_xxq_actualTravelCost,F_xxq_planTravelCost
,F_xxq_actualZhaodaiCost,F_xxq_planZhaodaiCost,F_xxq_actualWasteCost
,F_xxq_planWasteCost,F_xxq_actualActCost,F_xxq_planActCost,F_xxq_actualBiaoshuCost
,F_xxq_planBiaoshuCost,F_xxq_actualHuifeiCost,F_xxq_planHuifeiCost
)
select F_xxq_year,F_xxq_month,F_xxq_dept
,F_xxq_emp,F_xxq_actualCost,F_xxq_planCost
,F_xxq_rate,F_xxq_actualTravelCost,F_xxq_planTravelCost
,F_xxq_actualZhaodaiCost,F_xxq_planZhaodaiCost,F_xxq_actualWasteCost
,F_xxq_planWasteCost,F_xxq_actualActCost,F_xxq_planActCost,F_xxq_actualBiaoshuCost
,F_xxq_planBiaoshuCost,F_xxq_actualHuifeiCost,F_xxq_planHuifeiCost ", finalTempTable);
sb.AppendFormat(@"
from {0}
union
select
F_xxq_year,F_xxq_month,F_xxq_dept,' 总计',sum(F_xxq_actualCost),sum(F_xxq_planCost)
,case when SUM(F_xxq_planCost)<>0 then SUM(F_xxq_actualCost)/ SUM(F_xxq_planCost) else 0 end
,sum(F_xxq_actualTravelCost),sum(F_xxq_planTravelCost)
,sum(F_xxq_actualZhaodaiCost),sum(F_xxq_planZhaodaiCost),sum(F_xxq_actualWasteCost)
,sum(F_xxq_planWasteCost),sum(F_xxq_actualActCost),sum(F_xxq_planActCost)
,sum(F_xxq_actualBiaoshuCost),sum(F_xxq_planBiaoshuCost)
,sum(F_xxq_actualHuifeiCost),sum(F_xxq_planHuifeiCost)
from {0}
group by F_xxq_year,F_xxq_month,F_xxq_dept
union
select
F_xxq_year,F_xxq_month,' 总计',' ',sum(F_xxq_actualCost),sum(F_xxq_planCost)
,case when SUM(F_xxq_planCost)<>0 then SUM(F_xxq_actualCost)/ SUM(F_xxq_planCost) else 0 end
,sum(F_xxq_actualTravelCost),sum(F_xxq_planTravelCost)
,sum(F_xxq_actualZhaodaiCost),sum(F_xxq_planZhaodaiCost),sum(F_xxq_actualWasteCost)
,sum(F_xxq_planWasteCost),sum(F_xxq_actualActCost),sum(F_xxq_planActCost)
,sum(F_xxq_actualBiaoshuCost),sum(F_xxq_planBiaoshuCost)
,sum(F_xxq_actualHuifeiCost),sum(F_xxq_planHuifeiCost)
from {0}
group by F_xxq_year,F_xxq_month
order by F_xxq_year,F_xxq_month,F_xxq_dept desc ,F_xxq_emp desc ", strTempTable);
this.listDataSqlObj.Add(new SqlObject(sb.ToString(), new List()));
//DBUtils.ExecuteBatch(this.Context, listDataSqlObj);
sb.Clear();
}
#endregion

#region 填充最终数据到平台需要展示的表(TableName)
///


/// 填充最终数据临时表
///

private void FillFinalDataToShowTable(string showTableName)
{
StringBuilder sb = new StringBuilder();
this.KSQL_SEQ = string.Format(this.KSQL_SEQ, "F_xxq_ranking");
#region 主体核心脚本
sb.AppendFormat(@"SELECT
F_xxq_year,F_xxq_month,F_xxq_dept
,F_xxq_emp,F_xxq_actualCost,F_xxq_planCost
,F_xxq_rate,F_xxq_actualTravelCost,F_xxq_planTravelCost
,F_xxq_actualZhaodaiCost,F_xxq_planZhaodaiCost,F_xxq_actualWasteCost
,F_xxq_planWasteCost,F_xxq_actualActCost,F_xxq_planActCost,F_xxq_actualBiaoshuCost
,F_xxq_planBiaoshuCost,F_xxq_actualHuifeiCost,F_xxq_planHuifeiCost
,{0} INTO {1} FROM {2}", this.KSQL_SEQ, showTableName,finalTempTable);
#endregion 主体核心脚本
//#region 高级过滤字段过滤条件(待完善)
//if (!string.IsNullOrWhiteSpace(_sAdvancedFilter))
//{
// _sAdvancedFilter = _sAdvancedFilter.Replace("FSaleOrgId", "FOrgName");
// _sAdvancedFilter = _sAdvancedFilter.Replace("FCustId", "FCustName");
// _sAdvancedFilter = _sAdvancedFilter.Replace("FMaterialId", "FMatName");
// _sAdvancedFilter = _sAdvancedFilter.Replace("FMapId", "FMapName");
// sbSql.AppendFormat(@" WHERE {0}", _sAdvancedFilter);
//}
//#endregion 高级过滤字段过滤条件(待完善)
listDataSqlObj.Add(new SqlObject(sb.ToString(), new List()));
//DBUtils.ExecuteBatch(this.Context, listDataSqlObj);
sb.Clear();
//listDataSqlObj.Clear();
}
#endregion

#region 构造表头标题显示、过滤范围
//准备账表表头信息
public override ReportTitles GetReportTitles(IRptParams filter)
{
DynamicObject customFilter = filter.FilterParameter.CustomFilter;
return this.BuilderTitle(filter);
}

private ReportTitles BuilderTitle(IRptParams filter)
{
ReportTitles titles = new ReportTitles();
DynamicObject customFilter = filter.FilterParameter.CustomFilter;
if (customFilter != null)
{
string blank = string.Empty;

//日期范围
string strstartday = (GetDataByKey(customFilter, "F_xxq_DateFrom") == string.Empty || Convert.ToDateTime(GetDataByKey(customFilter, "F_xxq_DateFrom")) == DateTime.MinValue) ? "" : FieldFormatterUtil.GetDateFormatString(this.Context, Convert.ToDateTime(GetDataByKey(customFilter, "F_xxq_DateFrom")));

string strendday = (GetDataByKey(customFilter, "F_xxq_DateTo") == string.Empty || Convert.ToDateTime(GetDataByKey(customFilter, "F_xxq_DateTo")) == DateTime.MinValue) ? "" : FieldFormatterUtil.GetDateFormatString(this.Context, Convert.ToDateTime(GetDataByKey(customFilter, "F_xxq_DateTo")));

if ((!strstartday.IsNullOrEmptyOrWhiteSpace()) || (!strendday.IsNullOrEmptyOrWhiteSpace()))
{
blank = " 至 ";
}
titles.AddTitle("F_xxq_DateTitle", string.Format("{0}{1}{2}", strstartday, blank, strendday));
blank = string.Empty;

//部门范围
string DeptFromInfo = string.Empty;
string DeptToInfo = string.Empty;
DynamicObject DeptFrom = customFilter["F_xxq_DeptFrom"] as DynamicObject;
string DeptFromNumber = string.Empty;
string DeptFromName = string.Empty;
if (DeptFrom != null)
{
DeptFromNumber = GetDataByKey(DeptFrom, "NUMBER");
DeptFromName = GetDataByKey(DeptFrom, "NAME");
}
DynamicObject DeptTo = customFilter["F_xxq_DeptTo"] as DynamicObject;
string DeptToNumber = string.Empty;
string DeptToName = string.Empty;
if (DeptTo != null)
{
DeptToNumber = GetDataByKey(DeptTo, "NUMBER");
DeptToName = GetDataByKey(DeptTo, "NAME");
}
if (DeptFrom != null || DeptTo != null)
{ blank = "--"; }
else
{
blank = "全部";
}
if (DeptFrom != null)
{
DeptFromInfo = string.Format("{0}({1})", DeptFromNumber, DeptFromName);
}
if (DeptTo != null)
{
DeptToInfo = string.Format("{0}({1})", DeptToNumber, DeptToName);
}
titles.AddTitle("F_xxq_DeptTitle", string.Format("{0}{1}{2}", DeptFromInfo, blank, DeptToInfo));
blank = string.Empty;

//员工范围
string EmpFromInfo = string.Empty;
string EmpToInfo = string.Empty;
DynamicObject EmpFrom = customFilter["F_xxq_EmpFrom"] as DynamicObject;
string EmpFromNumber = string.Empty;
string EmpFromName = string.Empty;
if (EmpFrom != null)
{
EmpFromNumber = GetDataByKey(EmpFrom, "FStaffNumber");
EmpFromName = GetDataByKey(EmpFrom, "NAME");
}
DynamicObject EmpTo = customFilter["F_xxq_EmpTo"] as DynamicObject;
string EmpToNumber = string.Empty;
string EmpToName = string.Empty;
if (EmpTo != null)
{
EmpToNumber = GetDataByKey(EmpTo, "FStaffNumber");
EmpToName = GetDataByKey(EmpTo, "NAME");
}
if (EmpFrom != null || EmpTo != null)
{ blank = "--"; }
else
{
blank = "全部";
}
if (EmpFrom != null)
{
EmpFromInfo = string.Format("{0}({1})", EmpFromNumber, EmpFromName);
}
if (EmpTo != null)
{
EmpToInfo = string.Format("{0}({1})", EmpToNumber, EmpToName);
}
titles.AddTitle("F_xxq_EmpTitle", string.Format("{0}{1}{2}", EmpFromInfo, blank, EmpToInfo));
blank = string.Empty;
}
return titles;
}
#endregion