年度变更建库软件5.0版本
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

482 lines
29 KiB

6 months ago
using KGIS.Framework.DBOperator;
using KGIS.Framework.Platform;
using KGIS.Framework.Utils;
using kingo.Plugin.BGResultManager.Interface;
using Kingo.Plugin.BGResultManager.Model;
using Kingo.Plugin.BGResultManager.Utility;
using System;
using System.Collections.Generic;
using System.Data;
using System.Linq;
namespace kingo.Plugin.BGResultManager.Helper
{
public class ExportHelper : IStatisticExport
{
public List<ReportEntityClass> GetReportEntityClassList()
{
List<ReportEntityClass> result = new List<ReportEntityClass>();
result = new List<ReportEntityClass>();
result.Add(new ReportEntityClass() { ReportType = ReportTypeEnum.TDLYXZYJFLMJHZB, Name = "土地利用现状一级分类面积汇总表", TempalateFileName = "土地利用现状一级分类面积汇总表" });
//result.Add(new ReportEntityClass() { ReportType = ReportTypeEnum.LDTDLYXZYJFLMJHZB, Name = "土地利用现状一级分类面积汇总表", TempalateFileName = "土地利用现状一级分类面积汇总表" });
result.Add(new ReportEntityClass() { ReportType = ReportTypeEnum.HDTDLYXZYJFLMJHZB, Name = "海岛土地利用现状一级分类面积汇总表", TempalateFileName = "海岛土地利用现状一级分类面积汇总表" });
result.Add(new ReportEntityClass() { ReportType = ReportTypeEnum.FRDTDLYXZYJFLMJHZB, Name = "飞入地土地利用现状一级分类面积汇总表", TempalateFileName = "飞入地土地利用现状一级分类面积汇总表" });
result.Add(new ReportEntityClass() { ReportType = ReportTypeEnum.TDLYXZEJFLMJHZB, Name = "土地利用现状分类面积汇总表", TempalateFileName = "土地利用现状分类面积汇总表" });
//result.Add(new ReportEntityClass() { ReportType = ReportTypeEnum.LDTDLYXZEJFLMJHZB, Name = "土地利用现状分类面积汇总表", TempalateFileName = "土地利用现状分类面积汇总表" });
result.Add(new ReportEntityClass() { ReportType = ReportTypeEnum.HDTDLYXZEJFLMJHZB, Name = "海岛土地利用现状分类面积汇总表", TempalateFileName = "海岛土地利用现状分类面积汇总表" });
result.Add(new ReportEntityClass() { ReportType = ReportTypeEnum.FRDTDLYXZEJFLMJHZB, Name = "飞入地土地利用现状分类面积汇总表", TempalateFileName = "飞入地土地利用现状分类面积汇总表" });
result.Add(new ReportEntityClass() { ReportType = ReportTypeEnum.TDLYXZYJFLMJAQSXZHZB, Name = "土地利用现状一级分类面积按权属性质汇总表", TempalateFileName = "土地利用现状一级分类面积按权属性质汇总表" });
result.Add(new ReportEntityClass() { ReportType = ReportTypeEnum.FRDTDLYXZYJFLMJAQSXZHZB, Name = "飞入地土地利用现状一级分类面积按权属性质汇总表", TempalateFileName = "飞入地土地利用现状一级分类面积按权属性质汇总表" });
result.Add(new ReportEntityClass() { ReportType = ReportTypeEnum.CZCJGKYDMJHZB, Name = "城镇村及工矿用地面积汇总表", TempalateFileName = "城镇村及工矿用地面积汇总表" });
result.Add(new ReportEntityClass() { ReportType = ReportTypeEnum.FRDCZCJGKYDMJHZB, Name = "飞入地城镇村及工矿用地面积汇总表", TempalateFileName = "飞入地城镇村及工矿用地面积汇总表" });
result.Add(new ReportEntityClass() { ReportType = ReportTypeEnum.GDPDFJMJHZB, Name = "耕地坡度分级面积汇总表", TempalateFileName = "耕地坡度分级面积汇总表" });
result.Add(new ReportEntityClass() { ReportType = ReportTypeEnum.GDZZLXMJTJB, Name = "耕地种植类型面积统计表", TempalateFileName = "耕地种植类型面积统计表" });
result.Add(new ReportEntityClass() { ReportType = ReportTypeEnum.LXFWNYDHZTJB, Name = "林区范围内种植园用地汇总统计表", TempalateFileName = "林区范围内种植园用地汇总统计表" });
result.Add(new ReportEntityClass() { ReportType = ReportTypeEnum.GCCDXSCDHZQKTJB, Name = "灌丛草地汇总情况统计表", TempalateFileName = "灌丛草地汇总情况统计表" });
result.Add(new ReportEntityClass() { ReportType = ReportTypeEnum.GYYDALXHZTJB, Name = "工业用地按类型汇总统计表", TempalateFileName = "工业用地按类型汇总统计表" });
result.Add(new ReportEntityClass() { ReportType = ReportTypeEnum.KTZDLMJHZB, Name = "可调整地类面积汇总表", TempalateFileName = "可调整地类面积汇总表" });
result.Add(new ReportEntityClass() { ReportType = ReportTypeEnum.BFXHDLMJHZB, Name = "部分细化地类面积汇总表", TempalateFileName = "部分细化地类面积汇总表" });
//result.Add(new ReportEntityClass() { ReportType = ReportTypeEnum.SDDCMJTJB, Name = "湿地调查面积统计表", TempalateFileName = "湿地调查面积统计表" });
result.Add(new ReportEntityClass() { ReportType = ReportTypeEnum.GDXHDCQKTJB, Name = "耕地细化调查情况统计表", TempalateFileName = "耕地细化调查情况统计表" });
result.Add(new ReportEntityClass() { ReportType = ReportTypeEnum.PZWJSDJSYDYTQKTJB, Name = "批准未建设的建设用地用途情况统计表", TempalateFileName = "批准未建设的建设用地用途情况统计表" });
result.Add(new ReportEntityClass() { ReportType = ReportTypeEnum.PZWJSDJSYDXZQKTJB, Name = "批准未建设的建设用地现状情况统计表", TempalateFileName = "批准未建设的建设用地现状情况统计表" });
result.Add(new ReportEntityClass() { ReportType = ReportTypeEnum.DSCGTDCYGQKTJB, Name = "第三次全国国土调查有关情况统计表(生空模板)", TempalateFileName = "第三次全国国土调查有关情况统计表" });
result.Add(new ReportEntityClass() { ReportType = ReportTypeEnum.QSDWDMB, Name = "权属单位代码表", TempalateFileName = "权属单位代码表" });
//result.Add(new ReportEntityClass() { ReportType = ReportTypeEnum.TDDCJLB, Name = "土地调查记录表(生空模板)", TempalateFileName = "土地调查记录表" });
//result.Add(new ReportEntityClass() { ReportType = ReportTypeEnum.YFTKXSCSB, Name = "样方田坎系数测算表(生空模板)", TempalateFileName = "样方田坎系数测算表" });
//result.Add(new ReportEntityClass() { ReportType = ReportTypeEnum.KCXS, Name = "田坎系数(生空模板)", TempalateFileName = "田坎系数" });
//白明雅 2018-12-03
// 王靖 2019-01-24
//result.Add(new ReportEntityClass() { ReportType = ReportTypeEnum.YFTKXSCS, Name = "样方田坎系数测算表", TempalateFileName = "样方田坎系数测算表" });
//result.Add(new ReportEntityClass() { ReportType = ReportTypeEnum.TKXS, Name = "田坎系数", TempalateFileName = "田坎系数" });
//-----------------------------------
//霍岩 2019-02-22 添加永久基本农田现状情况统计表
result.Add(new ReportEntityClass() { ReportType = ReportTypeEnum.YJJBNTXZQKTJB, Name = "永久基本农田现状情况统计表", TempalateFileName = "永久基本农田现状情况统计表" });
//霍岩 2019-04-02 添加无居民海岛统计表
result.Add(new ReportEntityClass() { ReportType = ReportTypeEnum.WJMHDTJB, Name = "无居民海岛现状调查分类面积汇总表", TempalateFileName = "无居民海岛现状调查分类面积汇总表" });
//霍岩 2019-04-03 添加即可恢复与工程恢复种植属性汇总统计表
result.Add(new ReportEntityClass() { ReportType = ReportTypeEnum.JKHFGCHFZZTJB, Name = "即可恢复与工程恢复种植属性汇总统计表", TempalateFileName = "即可恢复与工程恢复种植属性汇总统计表" });
//霍岩 2019-04-03 添加废弃细化标注汇总统计表
result.Add(new ReportEntityClass() { ReportType = ReportTypeEnum.FQXHBZTJB, Name = "废弃与垃圾填埋细化标注汇总统计表", TempalateFileName = "废弃与垃圾填埋细化标注汇总统计表" });
return result;
}
/// <summary>
/// 文字输出报表列
/// </summary>
/// <returns></returns>
/// 白明雅 2018-12-03
public List<ReportEntityClass> GetReportlanguageOutEntityClassList()
{
List<ReportEntityClass> result = new List<ReportEntityClass>();
result = new List<ReportEntityClass>();
result.Add(new ReportEntityClass() { ReportType = ReportTypeEnum.GTDCGZBG, Name = "第三次国土调查工作报告", TempalateFileName = "第三次国土调查工作报告" });
result.Add(new ReportEntityClass() { ReportType = ReportTypeEnum.GTDCJSBG, Name = "第三次国土调查技术报告", TempalateFileName = "第三次国土调查技术报告" });
result.Add(new ReportEntityClass() { ReportType = ReportTypeEnum.GTDCSJKJSBG, Name = "第三次国土调查数据库建设报告", TempalateFileName = "第三次国土调查数据库建设报告" });
result.Add(new ReportEntityClass() { ReportType = ReportTypeEnum.GTDCCGFXBG, Name = "第三次国土调查成果分析报告", TempalateFileName = "第三次国土调查成果分析报告" });
result.Add(new ReportEntityClass() { ReportType = ReportTypeEnum.CZCZTDLYXZFXBG, Name = "城镇村庄土地利用状况分析报告", TempalateFileName = "城镇村庄土地利用状况分析报告" });
result.Add(new ReportEntityClass() { ReportType = ReportTypeEnum.TDDCSJKZLJCBG, Name = "第三次国土调查数据库质量检查报告", TempalateFileName = "第三次国土调查数据库质量检查报告" });
result.Add(new ReportEntityClass() { ReportType = ReportTypeEnum.ZXDCCGBG, Name = "专项调查成果报告", TempalateFileName = "专项调查成果报告" });
result.Add(new ReportEntityClass() { ReportType = ReportTypeEnum.HDDCCGBG, Name = "海岛调查成果报告", TempalateFileName = "海岛调查成果报告" });
return result;
}
/// <summary>
/// 增量管理导出列表 王欢 2018-12-03
/// </summary>
/// <returns></returns>
public List<ReportEntityClass> GetReportEntityZLGLClassList()
{
List<ReportEntityClass> result = new List<ReportEntityClass>();
//result.Add(new ReportEntityClass() { ReportType = ReportTypeEnum.变更一览表, Name = "变更一览表", TempalateFileName = "表 1-变更一览表.xlsx" });
//result.Add(new ReportEntityClass() { ReportType = ReportTypeEnum.土地利用现状变化平衡统计表, Name = "土地利用现状变化平衡统计表", TempalateFileName = "表 2-土地利用现状变化平衡统计表.xls" });
//result.Add(new ReportEntityClass() { ReportType = ReportTypeEnum.土地利用现状一级分类面积按权属性质变化统计表, Name = "土地利用现状一级分类面积按权属性质变化统计表", TempalateFileName = "表 3-土地利用现状一级分类面积按权属性质变化统计表.xlsx" });
//result.Add(new ReportEntityClass() { ReportType = ReportTypeEnum.城镇村及工矿用地面积变化统计表, Name = "城镇村及工矿用地面积变化统计表", TempalateFileName = "表 4-城镇村及工矿用地面积变化统计表.xlsx" });
//result.Add(new ReportEntityClass() { ReportType = ReportTypeEnum.耕地坡度分级面积变化统计表, Name = "耕地坡度分级面积变化统计表", TempalateFileName = "表 5-耕地坡度分级面积变化统计表.xlsx" });
//result.Add(new ReportEntityClass() { ReportType = ReportTypeEnum.耕地种植类型面积变化统计表, Name = "耕地种植类型面积变化统计表", TempalateFileName = "表 6-耕地种植类型面积变化统计表.xlsx" });
//result.Add(new ReportEntityClass() { ReportType = ReportTypeEnum.即可恢复与工程恢复种植属性变化统计表, Name = "即可恢复与工程恢复种植属性变化统计表", TempalateFileName = "表 7-即可恢复与工程恢复种植属性变化统计表.xlsx" });
//result.Add(new ReportEntityClass() { ReportType = ReportTypeEnum.林区范围内种植园用地变化统计表, Name = "林区范围内种植园用地变化统计表", TempalateFileName = "表 8-林区范围内种植园用地变化统计表.xlsx" });
//result.Add(new ReportEntityClass() { ReportType = ReportTypeEnum.灌丛草地汇总情况变化统计表, Name = "灌丛草地汇总情况变化统计表", TempalateFileName = "表 9-灌丛草地汇总情况变化统计表.xlsx" });
//result.Add(new ReportEntityClass() { ReportType = ReportTypeEnum.工业用地按类型汇总变化统计表, Name = "工业用地按类型汇总变化统计表", TempalateFileName = "表 10-工业用地按类型汇总变化统计表.xlsx" });
//result.Add(new ReportEntityClass() { ReportType = ReportTypeEnum.可调整地类面积变化统计表, Name = "可调整地类面积变化统计表", TempalateFileName = "表 11-可调整地类面积变化统计表.xlsx" });
//result.Add(new ReportEntityClass() { ReportType = ReportTypeEnum.部分细化地类面积变化统计表, Name = "部分细化地类面积变化统计表", TempalateFileName = "表 12-部分细化地类面积变化统计表.xlsx" });
//result.Add(new ReportEntityClass() { ReportType = ReportTypeEnum.废弃与垃圾填埋细化标注变化统计表, Name = "废弃与垃圾填埋细化标注变化统计表", TempalateFileName = "表 13-废弃与垃圾填埋细化标注变化统计表.xlsx" });
//result.Add(new ReportEntityClass() { ReportType = ReportTypeEnum.耕地细化调查情况变化统计表, Name = "耕地细化调查情况变化统计表", TempalateFileName = "表 14-耕地细化调查情况变化统计表.xlsx" });
//result.Add(new ReportEntityClass() { ReportType = ReportTypeEnum.海岛土地利用现状变化平衡统计表, Name = "海岛土地利用现状变化平衡统计表", TempalateFileName = "表 15-海岛土地利用现状变化平衡统计表.xls" });
//result.Add(new ReportEntityClass() { ReportType = ReportTypeEnum.三大类土地利用现状变化平衡统计表, Name = "三大类土地利用现状变化平衡统计表", TempalateFileName = "表 16-三大类土地利用现状变化平衡统计表.xlsx" });
return result;
}
/// <summary>
/// 变更WOrd表名
/// </summary>
/// <returns></returns>
public List<ReportEntityClass> GetReportEntityBGWordClassList()
{
List<ReportEntityClass> result = new List<ReportEntityClass>();
//result.Add(new ReportEntityClass() { ReportType = ReportTypeEnum.GTDCTYSDGXGZBG, Name = "第三次国土调查统一时点更新工作报告", TempalateFileName = "第三次国土调查统一时点更新工作报告.docx" });
//result.Add(new ReportEntityClass() { ReportType = ReportTypeEnum.GTDCTYSDGXJSBG, Name = "第三次国土调查统一时点更新技术报告", TempalateFileName = "第三次国土调查统一时点更新技术报告.docx" });
//result.Add(new ReportEntityClass() { ReportType = ReportTypeEnum.GTDCCGFXBG, Name = "第三次国土调查统一时点更新成果分析报告", TempalateFileName = "第三次国土调查统一时点更新成果分析报告.docx" });
//result.Add(new ReportEntityClass() { ReportType = ReportTypeEnum.GTDCTYSDGXSJKJSBG, Name = "第三次国土调查统一时点更新数据库建设报告", TempalateFileName = "第三次国土调查统一时点更新数据库建设报告.docx" });
return result;
}
public List<XZQTreeNode> TreeList
{
get
{
List<DataDicTionary> dicList = Platform.Instance.DicHelper.GetDic(DicTypeEnum.QSDM, true);
if (dicList == null)
return null;
return GetTree(dicList);
}
}
#region 构造复选TreeView 王欢 2018-09-29
public List<XZQTreeNode> CheckBoxTreeList
{
get
{
List<XZQTreeNode> XZQTreeNodeList = new List<XZQTreeNode>();
List<BasicDataModel> dicList = Platform.Instance.DicHelper.GetXZQDic(1).ToList();//Platform.Instance
List<BasicDataModel> dicList2 = Platform.Instance.DicHelper.GetXZQDic(2).ToList();
foreach (var item in dicList)
{
XZQTreeNode tvi = new XZQTreeNode();
tvi.XZQDM = item.Code;
tvi.XZQMC = item.Name;
tvi.Tag = item;
tvi.IsChecked = true;
tvi.GroupName = "XZQ";
foreach (var item2 in dicList2.Where(x => x.Code.Substring(0, 6) == item.Code))
{
XZQTreeNode tvi2 = new XZQTreeNode();
tvi2.XZQDM = item2.Code;
tvi2.XZQMC = item2.Name;
tvi2.Tag = item2;
tvi2.IsChecked = true;
tvi2.GroupName = "XZQ";
//Bug-16276 霍岩 2019-07-01 子节点的父级属性赋值
tvi2.Parent = tvi;
tvi.Nodes.Add(tvi2);
}
XZQTreeNodeList.Add(tvi);
}
return XZQTreeNodeList;
}
}
private List<XZQTreeNode> GetTreeParent(List<DataDicTionary> dicList)
{
try
{
var list = new List<XZQTreeNode>();
foreach (DataDicTionary item in dicList)
{
if (item.CODE.Length < 6 || item.CODE.Length > 12)
{
if (item.SubDic != null && item.SubDic.Count > 0)
{
list.AddRange(GetTreeParent(item.SubDic));
}
continue;
}
XZQTreeNode tvi = new XZQTreeNode();
tvi.XZQDM = item.CODE;
tvi.XZQMC = item.NAME;
tvi.Tag = item;
tvi.GroupName = "XZQ";
list.Add(tvi);
RecursiveAddChildren(tvi, item.SubDic);
tvi.IsExpanded = true;
}
list = list.OrderBy(x => x.XH).ToList();
return list;
}
catch (Exception ex)
{
LogAPI.Debug(ex);
}
return null;
}
private XZQTreeNode RecursiveAddChildren(XZQTreeNode parent, List<DataDicTionary> dicList)
{
try
{
//王欢 2018-12-11 系统日志报错问题
if (dicList == null)
{
return null;
}
//parent.Nodes = new List<XZQTreeNode>();
foreach (DataDicTionary item in dicList)
{
if (item == null)
{
continue;
}
if (item.CODE.Length < 6 || item.CODE.Length > 12)
{
continue;
}
XZQTreeNode tvi = new XZQTreeNode();
tvi.XZQDM = item.CODE;
tvi.XZQMC = item.NAME;
tvi.Tag = item;
tvi.GroupName = "XZQ";
tvi.Parent = parent;
parent.Nodes.Add(tvi);
RecursiveAddChildren(tvi, item.SubDic);
tvi.IsExpanded = true;
}
return parent;
}
catch (Exception ex)
{
LogAPI.Debug(ex);
}
return null;
}
#endregion
private List<XZQTreeNode> GetTree(List<DataDicTionary> dicList)
{
try
{
if (dicList == null)
return null;
List<XZQTreeNode> result = new List<XZQTreeNode>();
foreach (DataDicTionary dic in dicList)
{
if (dic.CODE.Length < 6 || dic.CODE.Length > 12)
{
if (dic.SubDic != null && dic.SubDic.Count > 0)
{
result.AddRange(GetTree(dic.SubDic));
}
continue;
}
var n1 = new XZQTreeNode();
n1.XZQDM = dic.CODE;
n1.XZQMC = dic.NAME;
n1.Tag = dic;
n1.GroupName = "XZQ";
result.Add(n1);
if (dic.SubDic != null && dic.SubDic.Count > 0)
{
n1.Nodes = GetTree(dic.SubDic);
}
if (n1.XZQDM.Length == 6)
{
n1.IsExpanded = true;
}
}
result = result.OrderBy(x => x.XH).ToList();
return result;
}
catch (Exception ex)
{
LogAPI.Debug(ex);
}
return null;
}
public ReportEntityClass GetReportEntityClass(ReportTypeEnum re)
{
var relist = GetReportEntityClassList();
return relist.FirstOrDefault(x => x.ReportType == re);
}
public ReportEntityClass GetWordReportEntityClass(ReportTypeEnum re)
{
var relist = GetReportlanguageOutEntityClassList();
return relist.FirstOrDefault(x => x.ReportType == re);
}
//public void Export(ReportTypeEnum re)
//{
// IRDBHelper dbHelper = null;
// try
// {
// if (string.IsNullOrWhiteSpace(Platform.Instance.GetProjectInfo().CODE))
// {
// MessageHelper.Show("县行政区划代码不能为空,请在工程属性界面中填写6位县区划代码!");
// //Bug-13832 霍岩 2018-12-24 县行政区划代码为空则停止输出报表
// return;
// }
// int validateType = 0;
// //RegionAuthorize regionAuthorize = new RegionAuthorize();
// //
// //if (!regionAuthorize.ValidateAuthorizeByXZQDM(ref validateType))
// //{
// // if (validateType.Equals(1))
// // {
// // MessageHelper.ShowError("地类图斑数据区域授权未通过");
// // }
// // else if (validateType.Equals(2))
// // {
// // MessageHelper.ShowError("行政区数据区域授权未通过");
// // }
// // else
// // {
// // MessageHelper.ShowError("区域授权验证失败");
// // }
// // return;
// //}
// string connStr = SysConfigsOprator.GetDBConnectionByName("MDBOledbConnection");
// string SourcePath = string.Format(connStr, Platform.Instance.GetProjectInfo().GetProjMDBPath());
// //创建数据库连接
// dbHelper = RDBFactory.CreateDbHelper(SourcePath, DatabaseType.MSAccess);
// //第一步:首先判断是否已经缓存过表
// if (re != ReportTypeEnum.YJJBNTXZQKTJB)
// {
// string cjhzsqlsql = "select sum(TBZMJ) from MJHZJCTJB ";
// DataTable cjmjhzdt = null;
// try
// {
// cjmjhzdt = dbHelper.ExecuteDatatable("cjmjhz", cjhzsqlsql, true);
// }
// catch
// {
// }
// if (cjmjhzdt == null || cjmjhzdt.Rows.Count == 0 || cjmjhzdt.Rows[0][0].ToDecimal(2) != (Platform.Instance.GetProjectInfo().LDKZMJ2 + Platform.Instance.GetProjectInfo().HDKZMJ2).ToDecimal(2))
// {
// MessageHelper.Show("请先进行数据汇总!");
// return;
// }
// }
// ProgressHelper.ShowProcessBar("正在导出...");
// StatisticalReportClass reportClass = new StatisticalReportClass();
// reportClass.MjConvertValue = 1;
// if (reportClass.MjConvertValue == 1)
// {
// reportClass.ReportFileType = ReportFileTypeEnum.DBGQ;
// }
// else
// {
// reportClass.ReportFileType = ReportFileTypeEnum.DBM;
// }
// string savepath = "temp\\export";
// if (!System.IO.Directory.Exists(savepath))
// {
// System.IO.Directory.CreateDirectory(savepath);
// }
// ReportEntityClass reportEntity = GetReportEntityClass(re);
// //Bug-13390 霍岩 2018-12-17 添加原路径文件名前加六位县行政区代码
// string saveCurrentPath = savepath + "\\" + string.Format("({0})", Platform.Instance.GetProjectInfo().CODE) + reportEntity.TempalateFileName + ".xlsx";
// if (TreeList != null)
// {
// reportEntity.XZQTreeNode = TreeList[0];
// }
// bool isRst = reportClass.Export(saveCurrentPath, dbHelper, reportEntity);
// ProgressHelper.CloseProcessBar();
// if (isRst)
// {
// //启动主程序
// System.Diagnostics.Process.Start(saveCurrentPath);
// //MessageBox.Show("导出完成!");
// }
// else
// {
// MessageHelper.ShowError("导出失败!");
// }
// }
// catch (Exception ex)
// {
// ProgressHelper.CloseProcessBar();
// MessageHelper.ShowError("导出失败!");
// LogAPI.Debug("导出失败:" + ex);
// }
// finally
// {
// ProgressHelper.CloseProcessBar();
// if (dbHelper != null)
// dbHelper.DisConnect();
// }
//}
#region IStatisticExport接口实现
public string OutPath
{
get;
set;
}
public ReportFileTypeEnum AreaUnit
{
get;
set;
}
public void ExportReport(ReportTypeEnum pReportType)
{
try
{
ReportEntityClass reportEntity = GetReportEntityClass(pReportType);
string saveCurrentPath = OutPath + ".xlsx";
string sourPath = SysAppPath.GetCurrentAppPath() + "TempalateReports\\统一时点更新统计表\\原样表"+ reportEntity.Name;
if (System.IO.File.Exists(sourPath))
{
System.IO.File.Copy(sourPath, saveCurrentPath);
}
}
catch (Exception ex)
{
LogAPI.Debug("导出失败:" + ex);
}
finally
{
}
}
public void ExportWordReport(ReportTypeEnum pReportType)
{
IRDBHelper dbHelper = null;
try
{
//StatisticalReportClass reportClass = new StatisticalReportClass();
//reportClass.ReportFileType = AreaUnit;
ReportEntityClass reportEntity = GetWordReportEntityClass(pReportType);
string saveCurrentPath = OutPath + ".docx";
//if (TreeList != null)
//{
// reportEntity.XZQTreeNode = TreeList[0];
//}
//bool isRst = reportClass.Export(saveCurrentPath, dbHelper, reportEntity, new System.Collections.Hashtable());
string sourPath = SysAppPath.GetCurrentAppPath() + "TempalateReports\\统一时点更新统计表\\原样表" + reportEntity.Name;
if (System.IO.File.Exists(sourPath))
{
System.IO.File.Copy(sourPath, saveCurrentPath);
}
else
System.IO.File.Create(saveCurrentPath);
}
catch (Exception ex)
{
LogAPI.Debug("导出失败:" + ex);
}
finally
{
if (dbHelper != null)
dbHelper.DisConnect();
}
}
#endregion
}
}