2023-02-16 焊接修改

This commit is contained in:
2023-02-16 17:19:08 +08:00
parent c19e51a290
commit 75431705fb
28 changed files with 599 additions and 342 deletions
@@ -1,10 +1,14 @@
using BLL;
using FineUIPro.Web.HJGL.WeldingManage;
using MiniExcelLibs;
using Model;
using Newtonsoft.Json.Linq;
using System;
using System.Collections.Generic;
using System.Data;
using System.Data.SqlClient;
using System.Drawing;
using System.IO;
using System.Linq;
using System.Text;
using AspNet = System.Web.UI.WebControls;
@@ -225,41 +229,7 @@ namespace FineUIPro.Web.HJGL.InfoQuery
else
{
this.BindGrid();
Model.Parameter3D parameter3D = new Model.Parameter3D();
Model.ColorModel colorModel = new Model.ColorModel();
colorModel = BLL.Project_SysSetService.GetColorModel(this.CurrUser.LoginProjectId);
parameter3D.ColorModel = colorModel;
parameter3D.TagNum = "";
parameter3D.ButtonType = "2.1";
parameter3D.ModelName = HJGL_DataImportService.Getlatest3DModelNameByUnitWorkId(tvControlItem.SelectedNodeID);
if (this.tvControlItem.SelectedNode.CommandName.Split('|').Count() == 2)
{
parameter3D.ModelName = HJGL_DataImportService.Getlatest3DModelNameByUnitWorkId(tvControlItem.SelectedNodeID);
parameter3D.Crater_data = "0";
parameter3D.Completed_weldedjunction = Completed_weldedjunction;
parameter3D.Incomplete_weldjunction = Incomplete_weldjunction;
}
else if (this.tvControlItem.SelectedNode.CommandName == "管线")
{
var model = PipelineService.GetPipelineByPipelineId(tvControlItem.SelectedNodeID);
if (model != null && !string.IsNullOrEmpty(model.UnitWorkId))
{
parameter3D.Crater_data = "1";
parameter3D.TagNum = "/" + model.PipelineCode;
parameter3D.ModelName = HJGL_DataImportService.Getlatest3DModelNameByUnitWorkId(model.UnitWorkId);
}
}
parameter3D.Transparency = colorModel.PipelineComplete;
parameter3D.Finished_color = colorModel.JointCompleteColor;
parameter3D.Incomplete_color = colorModel.JointNOCompleteColor;
ctlAuditFlow.Url_item = BLL.Project_SysSetService.GetAvevaNetUrl_Item(this.CurrUser.LoginProjectId) + parameter3D.ModelName;
ctlAuditFlow.data = parameter3D;
ctlAuditFlow.BindData();
}
@@ -313,32 +283,6 @@ namespace FineUIPro.Web.HJGL.InfoQuery
private void BindGrid()
{
//string strSql = @"SELECT * FROM dbo.View_HJGL_JointInfoQuery
// WHERE ProjectId= @ProjectId";
//List<SqlParameter> listStr = new List<SqlParameter>();
//listStr.Add(new SqlParameter("@projectId", this.CurrUser.LoginProjectId));
//if (this.tvControlItem.SelectedNode.CommandName == "单位工程")
//{
// strSql += " AND UnitWorkId =@UnitWorkId";
// listStr.Add(new SqlParameter("@UnitWorkId", this.tvControlItem.SelectedNodeID));
//}
//else if (this.tvControlItem.SelectedNode.CommandName == "管线")
//{
// strSql += " AND PipelineId = @PipelineId";
// listStr.Add(new SqlParameter("@PipelineId", this.tvControlItem.SelectedNodeID));
//}
//if (!string.IsNullOrEmpty(this.txtWeldJointCode.Text.Trim()))
//{
// strSql += " AND WeldJointCode LIKE @WeldJointCode";
// listStr.Add(new SqlParameter("@WeldJointCode", this.txtWeldJointCode.Text.Trim()));
//}
//SqlParameter[] parameter = listStr.ToArray();
//DataTable tb = SQLHelper.GetDataTableRunText(strSql, parameter);
//var q = tb.AsEnumerable().Where(x => x["WeldingDate"].ToString() != "");
//var q2 = tb.AsEnumerable().Where(x => x["JointAttribute"].ToString() == "预制口");
//var sumcount = tb.Rows.Count;
//this.Grid1.RecordCount = tb.Rows.Count;
Model.View_HJGL_WeldJoint model =new Model.View_HJGL_WeldJoint();
model.ProjectId = this.CurrUser.LoginProjectId;
if (this.tvControlItem.SelectedNode.CommandName.Split('|').Count() == 2 )
@@ -352,24 +296,12 @@ namespace FineUIPro.Web.HJGL.InfoQuery
}
model.WeldJointCode = this.txtWeldJointCode.Text;
var list= BLL.WeldJointService.GetViewWeldJointsBymodel(model);
if (!string.IsNullOrEmpty(ctlAuditFlow.Url))
{
get3DParmeter_weldjoint(list);//获取三维所需焊口参数
var q = list.Where(x => !string.IsNullOrEmpty(x.WeldingDate));
var q2 = list.Where(x => x.JointAttribute == "预制口");
var sumcount = list.Count;
this.Grid1.RecordCount = list.Count;
this.JointComplete = q.Count();
this.JointNoComplete = sumcount - JointComplete;
this.JointPre = q2.Count();
this.JointNoPre = sumcount - JointPre;
}
var table = this.GetPagedDataTable(Grid1, list);
Grid1.DataSource = table;
Grid1.RecordCount = list.Count;
// var table = this.GetPagedDataTable(Grid1, list);
var table = list.Skip(Grid1.PageSize * (Grid1.PageIndex - 1)).Take(Grid1.PageSize).ToList();
Grid1.DataSource = table;
Grid1.DataBind();
}
private void get3DParmeter_weldjoint(List<View_HJGL_WeldJoint> model)
@@ -451,6 +383,71 @@ namespace FineUIPro.Web.HJGL.InfoQuery
this.InitTreeMenu();
//this.BindGrid3(this.tvControlItem.SelectedNodeID);
}
protected void btnrefresh_Click(object sender, EventArgs e)
{
Model.View_HJGL_WeldJoint model = new Model.View_HJGL_WeldJoint();
model.ProjectId = this.CurrUser.LoginProjectId;
if (this.tvControlItem.SelectedNode.CommandName.Split('|').Count() == 2)
{
model.UnitWorkId = this.tvControlItem.SelectedNodeID;
}
else if (this.tvControlItem.SelectedNode.CommandName == "管线")
{
model.PipelineId = this.tvControlItem.SelectedNodeID;
}
model.WeldJointCode = this.txtWeldJointCode.Text;
var list = BLL.WeldJointService.GetViewWeldJointsBymodel(model);
if (!string.IsNullOrEmpty(ctlAuditFlow.Url))
{
get3DParmeter_weldjoint(list);//获取三维所需焊口参数
var q = list.Where(x => !string.IsNullOrEmpty(x.WeldingDate));
var q2 = list.Where(x => x.JointAttribute == "预制口");
var sumcount = list.Count;
this.Grid1.RecordCount = list.Count;
this.JointComplete = q.Count();
this.JointNoComplete = sumcount - JointComplete;
this.JointPre = q2.Count();
this.JointNoPre = sumcount - JointPre;
}
Model.Parameter3D parameter3D = new Model.Parameter3D();
Model.ColorModel colorModel = new Model.ColorModel();
colorModel = BLL.Project_SysSetService.GetColorModel(this.CurrUser.LoginProjectId);
parameter3D.ColorModel = colorModel;
parameter3D.TagNum = "";
parameter3D.ButtonType = "2.1";
parameter3D.ModelName = HJGL_DataImportService.Getlatest3DModelNameByUnitWorkId(tvControlItem.SelectedNodeID);
if (this.tvControlItem.SelectedNode.CommandName.Split('|').Count() == 2)
{
parameter3D.ModelName = HJGL_DataImportService.Getlatest3DModelNameByUnitWorkId(tvControlItem.SelectedNodeID);
parameter3D.Crater_data = "0";
parameter3D.Completed_weldedjunction = Completed_weldedjunction;
parameter3D.Incomplete_weldjunction = Incomplete_weldjunction;
}
else if (this.tvControlItem.SelectedNode.CommandName == "管线")
{
var modelpipeline = PipelineService.GetPipelineByPipelineId(tvControlItem.SelectedNodeID);
if (modelpipeline != null && !string.IsNullOrEmpty(modelpipeline.UnitWorkId))
{
parameter3D.Crater_data = "1";
parameter3D.TagNum = "/" + modelpipeline.PipelineCode;
parameter3D.ModelName = HJGL_DataImportService.Getlatest3DModelNameByUnitWorkId(modelpipeline.UnitWorkId);
}
}
parameter3D.Transparency = colorModel.PipelineComplete;
parameter3D.Finished_color = colorModel.JointCompleteColor;
parameter3D.Incomplete_color = colorModel.JointNOCompleteColor;
ctlAuditFlow.Url_item = BLL.Project_SysSetService.GetAvevaNetUrl_Item(this.CurrUser.LoginProjectId) + parameter3D.ModelName;
ctlAuditFlow.data = parameter3D;
ctlAuditFlow.BindData();
}
/// <summary>
/// 查询
/// </summary>
@@ -476,19 +473,19 @@ namespace FineUIPro.Web.HJGL.InfoQuery
/// <param name="e"></param>
protected void btnOut_Click(object sender, EventArgs e)
{
Model.View_HJGL_WeldJoint model = new Model.View_HJGL_WeldJoint();
model.ProjectId = this.CurrUser.LoginProjectId;
if (this.tvControlItem.SelectedNode.CommandName.Split('|').Count() == 2)
{
model.UnitWorkId = this.tvControlItem.SelectedNodeID;
//Model.View_HJGL_WeldJoint model = new Model.View_HJGL_WeldJoint();
//model.ProjectId = this.CurrUser.LoginProjectId;
//if (this.tvControlItem.SelectedNode.CommandName.Split('|').Count() == 2)
//{
// model.UnitWorkId = this.tvControlItem.SelectedNodeID;
}
else if (this.tvControlItem.SelectedNode.CommandName == "管线")
{
model.PipelineId = this.tvControlItem.SelectedNodeID;
}
model.WeldJointCode = this.txtWeldJointCode.Text;
var list = BLL.WeldJointService.GetViewWeldJointsBymodel(model);
//}
//else if (this.tvControlItem.SelectedNode.CommandName == "管线")
//{
// model.PipelineId = this.tvControlItem.SelectedNodeID;
//}
//model.WeldJointCode = this.txtWeldJointCode.Text;
//var list = BLL.WeldJointService.GetViewWeldJointsBymodel(model);
Response.ClearContent();
@@ -499,7 +496,55 @@ namespace FineUIPro.Web.HJGL.InfoQuery
Response.Write(GetGridTableHtml(Grid1));
Response.End();
}
protected void btnOutNOComPipeline_Click(object sender, EventArgs e)
{
if (this.tvControlItem.SelectedNode.CommandName.Split('|').Count() == 2)
{
var q = (from x in Funs.DB.View_HJGL_WeldJoint where x.ProjectId == this.CurrUser.LoginProjectId && x.UnitWorkId == this.tvControlItem.SelectedNodeID
select new {
PipelineId=x.PipelineId,
WeldingDate=x.WeldingDate,
WeldJointCode=x.WeldJointCode,
PipelineCode=x.PipelineCode,
Size=x.Size,
});
var noCompipeline = from x in q
group x by x.PipelineId into g
select new
{
PipelineId = g.Key,
Count = (from x2 in g where x2.WeldingDate!=null && x2.WeldingDate!="" select x2).Count(),
};
var Noweldjoint =( from x in q
join y in noCompipeline on x.PipelineId equals y.PipelineId
where y.Count == 0
select new { =x.WeldJointCode ,
线=x.PipelineCode,
=x.Size}).ToList();
string path = Funs.RootPath + @"File\Excel\Temp\NoCompleteWeldjoint.xlsx";
path = path.Replace(".xlsx", string.Format("{0:yyyy-MM-dd-HH-mm}", DateTime.Now) + ".xlsx");
MiniExcel.SaveAs(path, Noweldjoint);
string fileName = "未完成管线焊口.xlsx";
FileInfo info = new FileInfo(path);
long fileSize = info.Length;
System.Web.HttpContext.Current.Response.Clear();
System.Web.HttpContext.Current.Response.ContentType = "application/x-zip-compressed";
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", fileSize.ToString());
System.Web.HttpContext.Current.Response.TransmitFile(path, 0, fileSize);
System.Web.HttpContext.Current.Response.Flush();
System.Web.HttpContext.Current.Response.Close();
File.Delete(path);
}
else
{
Alert.Show("请选择主项");
}
}
/// <summary>
/// 导出方法
/// </summary>
@@ -508,7 +553,7 @@ namespace FineUIPro.Web.HJGL.InfoQuery
private string GetGridTableHtml(Grid grid)
{
StringBuilder sb = new StringBuilder();
grid.PageSize = 10000;
grid.PageSize = 100000;
BindGrid();
sb.Append("<meta http-equiv=\"content-type\" content=\"application/excel; charset=UTF-8\"/>");
sb.Append("<table cellspacing=\"0\" rules=\"all\" border=\"1\" style=\"border-collapse:collapse;\">");
@@ -583,5 +628,7 @@ namespace FineUIPro.Web.HJGL.InfoQuery
ctlAuditFlow.data = parameter3D;
ctlAuditFlow.BindData();
}
}
}