refactor(hjgl): 整理历史资源并完善焊接查询
归档数据库版本脚本并清理历史地图资源,补充焊口查询和焊接任务相关逻辑,降低项目资源维护成本并完善焊接业务查询。
This commit is contained in:
@@ -84,6 +84,9 @@
|
||||
<f:Button ID="btnOut" OnClick="btnOut_Click" runat="server" Text="导出"
|
||||
Icon="TableGo" EnableAjax="false" DisableControlBeforePostBack="true" EnablePostBack="true">
|
||||
</f:Button>
|
||||
<f:Button ID="btnOutRussian" OnClick="btnOutRussian_Click" runat="server" Text="导出(俄)"
|
||||
Icon="TableGo" EnableAjax="false" DisableControlBeforePostBack="true" EnablePostBack="true">
|
||||
</f:Button>
|
||||
<f:Button ID="btnOutNoComPipeline" OnClick="btnOutNOComPipeline_Click" runat="server" Text="导出未完成管线"
|
||||
Icon="TableGo" EnableAjax="false" DisableControlBeforePostBack="true" EnablePostBack="true">
|
||||
|
||||
|
||||
@@ -690,6 +690,73 @@ namespace FineUIPro.Web.HJGL.InfoQuery
|
||||
//Response.Write(GetGridTableHtml(Grid1));
|
||||
//Response.End();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 按当前焊口查询条件导出俄文焊口信息总览。
|
||||
/// </summary>
|
||||
protected void btnOutRussian_Click(object sender, EventArgs e)
|
||||
{
|
||||
if (this.tvControlItem.SelectedNode == null
|
||||
|| (this.tvControlItem.SelectedNode.CommandName.Split('|').Count() != 2
|
||||
&& this.tvControlItem.SelectedNode.CommandName != "管线"))
|
||||
{
|
||||
Alert.ShowInTop("请选择单位工程或管线!", MessageBoxIcon.Warning);
|
||||
return;
|
||||
}
|
||||
|
||||
Model.View_HJGL_WeldJoint model = GetCurrentWeldJointQueryModel();
|
||||
string fileName;
|
||||
if (this.tvControlItem.SelectedNode.CommandName.Split('|').Count() == 2)
|
||||
{
|
||||
model.UnitWorkId = this.tvControlItem.SelectedNodeID;
|
||||
fileName = UnitWorkService.GetNameById(model.UnitWorkId);
|
||||
}
|
||||
else
|
||||
{
|
||||
model.PipelineId = this.tvControlItem.SelectedNodeID;
|
||||
fileName = PipelineService.GetPipelineByPipelineId(model.PipelineId)?.PipelineCode;
|
||||
}
|
||||
if (!string.IsNullOrEmpty(this.txtWeldingDate.Text.Trim()))
|
||||
{
|
||||
model.WeldingDate = this.txtWeldingDate.Text.Trim();
|
||||
}
|
||||
|
||||
var list = BLL.WeldJointService.GetViewWeldJointsBymodel(model);
|
||||
if (list.Count == 0)
|
||||
{
|
||||
Alert.ShowInTop("无数据,无法导出!", MessageBoxIcon.Warning);
|
||||
return;
|
||||
}
|
||||
|
||||
string templatePath = Funs.RootPath + @"File\Excel\DataOut\焊口信息总览(俄)导出模板.xlsx";
|
||||
if (!File.Exists(templatePath))
|
||||
{
|
||||
Alert.ShowInTop("焊口信息总览导出模板不存在!", MessageBoxIcon.Warning);
|
||||
return;
|
||||
}
|
||||
|
||||
DataTable data = BLL.WeldingDailyService.GetRussianWeldJointExportData(list);
|
||||
string path = Funs.RootPath + @"File\Excel\Temp\JointQueryRussian_"
|
||||
+ DateTime.Now.ToString("yyyy-MM-dd-HH-mm-ss-fff") + ".xlsx";
|
||||
var value = new Dictionary<string, object>
|
||||
{
|
||||
["Data"] = data
|
||||
};
|
||||
MiniExcel.SaveAsByTemplate(path, templatePath, value);
|
||||
|
||||
fileName = fileName + "-焊口信息总览(俄).xlsx";
|
||||
FileInfo info = new FileInfo(path);
|
||||
System.Web.HttpContext.Current.Response.Clear();
|
||||
System.Web.HttpContext.Current.Response.ContentType = "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet";
|
||||
System.Web.HttpContext.Current.Response.AddHeader("Content-Disposition", "attachment;filename="
|
||||
+ System.Web.HttpUtility.UrlEncode(fileName, System.Text.Encoding.UTF8));
|
||||
System.Web.HttpContext.Current.Response.AddHeader("Content-Length", info.Length.ToString());
|
||||
System.Web.HttpContext.Current.Response.TransmitFile(path, 0, info.Length);
|
||||
System.Web.HttpContext.Current.Response.Flush();
|
||||
File.Delete(path);
|
||||
System.Web.HttpContext.Current.ApplicationInstance.CompleteRequest();
|
||||
}
|
||||
|
||||
protected void PrintByUnitWork(string unitWorkId)
|
||||
{
|
||||
const int pageSize = 10000;
|
||||
|
||||
@@ -203,6 +203,15 @@ namespace FineUIPro.Web.HJGL.InfoQuery
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.Button btnOut;
|
||||
|
||||
/// <summary>
|
||||
/// btnOutRussian 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.Button btnOutRussian;
|
||||
|
||||
/// <summary>
|
||||
/// btnOutNoComPipeline 控件。
|
||||
/// </summary>
|
||||
|
||||
Reference in New Issue
Block a user