111 lines
3.6 KiB
C#
111 lines
3.6 KiB
C#
using NPOI.OpenXmlFormats.Dml;
|
|
using YLErp.Model;
|
|
using YLErp.Modules.SuperviseReportModule.ExtendReport.Common;
|
|
using YLErp.Modules.SuperviseReportModule.ExtendReport.GeLin;
|
|
using YLErp.Modules.SuperviseReportModule.ExtendReport.ZheQi;
|
|
using YLErp.Modules.SuperviseReportModule.ExtendReport.ZheShang;
|
|
|
|
namespace YLErp.Modules.SuperviseReportModule.ExtendReport
|
|
{
|
|
public abstract class ExtendReportBaseService : YLBaseService
|
|
{
|
|
protected SuperviseReportReq RequestInfo { get; private set; }
|
|
|
|
/// <summary>
|
|
/// 输出模板名
|
|
/// </summary>
|
|
public abstract string TemplateName { get; }
|
|
|
|
/// <summary>
|
|
/// 输出文件名
|
|
/// </summary>
|
|
/// <returns></returns>
|
|
public abstract string TargetFileName { get; }
|
|
|
|
public ExtendReportBaseService(OptUserInfo userInfo, SuperviseReportReq req) : base(userInfo)
|
|
{
|
|
RequestInfo = req;
|
|
}
|
|
|
|
/// <summary>
|
|
/// 获取实现对象
|
|
/// </summary>
|
|
/// <param name="reportType"></param>
|
|
/// <returns></returns>
|
|
public static ExtendReportBaseService ServiceFactory(OptUserInfo optUser, SuperviseReportReq req)
|
|
{
|
|
ExtendReportBaseService service = null;
|
|
switch (req.DataSource)
|
|
{
|
|
case "成交明细汇总":
|
|
service = new TransactionDetails(optUser, req);
|
|
break;
|
|
case "风险资本准备计算表":
|
|
service = new ExtendOtherReport(optUser, req);
|
|
break;
|
|
case "客户持仓信息":
|
|
service = new ClientPositionReport(optUser, req);
|
|
break;
|
|
case "客户资金记录报表":
|
|
service = new CustomerFundsReport(optUser, req);
|
|
break;
|
|
case "月报基础数据债券收益互换":
|
|
service = new SwapTradeMothReport(optUser, req);
|
|
break;
|
|
default:
|
|
throw new ServiceException("报表未实现");
|
|
}
|
|
return service;
|
|
}
|
|
|
|
/// <summary>
|
|
/// 获取报告内容
|
|
/// </summary>
|
|
/// <returns>
|
|
/// Key:模板中的sheet名
|
|
/// Value:模板中要填充的Model
|
|
/// </returns>
|
|
public virtual Dictionary<string, object> SearchReportInfo()
|
|
{
|
|
throw new ServiceException("未实现");
|
|
}
|
|
}
|
|
public abstract class SimpleExtendReportBaseService : ExtendReportBaseService
|
|
{
|
|
/// <summary>
|
|
/// 输出Sheet名
|
|
/// </summary>
|
|
public virtual string[] SheetNames { get; } = { "Sheet1" };
|
|
|
|
public SimpleExtendReportBaseService(OptUserInfo userInfo, SuperviseReportReq req) : base(userInfo, req)
|
|
{ }
|
|
|
|
/// <summary>
|
|
/// 获取报告内容
|
|
/// </summary>
|
|
/// <returns>
|
|
/// Key:模板中的sheet名
|
|
/// Value:模板中要填充的Model
|
|
/// </returns>
|
|
public override Dictionary<string, object> SearchReportInfo()
|
|
{
|
|
var result = new Dictionary<string, object>();
|
|
foreach (var name in SheetNames)
|
|
{
|
|
result[name] = SearchReportInfo(name);
|
|
}
|
|
return result;
|
|
}
|
|
|
|
/// <summary>
|
|
/// 获取报告内容
|
|
/// </summary>
|
|
/// <param name="sheetName">要填充的Sheet名</param>
|
|
/// <returns></returns>
|
|
public virtual object SearchReportInfo(string sheetName)
|
|
{
|
|
throw new ServiceException("未实现");
|
|
}
|
|
}
|
|
}
|