feat: 完善材料条码与焊接业务功能
This commit is contained in:
@@ -631,6 +631,15 @@ namespace FineUIPro.Web.HJGL.PointTrust
|
||||
dt.Columns.Add("CH_NDTMethod", typeof(String));
|
||||
dt.Columns.Add("CH_SlopeType", typeof(String));
|
||||
dt.Columns.Add("CH_NDTRate", typeof(String));
|
||||
dt.Columns.Add("CH_DetectionType", typeof(String));
|
||||
dt.Columns.Add("CH_WorkName", typeof(String));
|
||||
dt.Columns.Add("CH_WorkType", typeof(String));
|
||||
dt.Columns.Add("CH_Material", typeof(String));
|
||||
dt.Columns.Add("CH_MediumGrade", typeof(String));
|
||||
dt.Columns.Add("CH_DetectionTiming", typeof(String));
|
||||
dt.Columns.Add("CH_ProjectPipelineCode", typeof(String));
|
||||
dt.Columns.Add("CH_HeatTreatmentStatus", typeof(String));
|
||||
dt.Columns.Add("CH_ExecutionStandard", typeof(String));
|
||||
|
||||
|
||||
|
||||
@@ -649,20 +658,39 @@ namespace FineUIPro.Web.HJGL.PointTrust
|
||||
Alert.ShowInTop("请选择要打印的委托单!", MessageBoxIcon.Warning);
|
||||
return;
|
||||
}
|
||||
var CH_WeldMethod = (from batch in Funs.DB.View_Batch_BatchTrustItem
|
||||
join joint in Funs.DB.View_HJGL_WeldJoint on batch.WeldJointId equals joint.WeldJointId
|
||||
where batch.TrustBatchId == trust.TrustBatchId
|
||||
select joint.WeldingMethodCode).Distinct().ToList();
|
||||
var CH_SlopeType = (from batch in Funs.DB.View_Batch_BatchTrustItem
|
||||
var printDetails = (from batch in Funs.DB.View_Batch_BatchTrustItem
|
||||
join joint in Funs.DB.View_HJGL_WeldJoint on batch.WeldJointId equals joint.WeldJointId
|
||||
where batch.TrustBatchId == trust.TrustBatchId
|
||||
select joint.GrooveTypeCode).Distinct().ToList();
|
||||
orderby batch.PipelineCode, batch.WeldJointCode
|
||||
select new
|
||||
{
|
||||
batch.PipelineCode,
|
||||
batch.WeldJointCode,
|
||||
batch.WelderCode,
|
||||
joint.Specification,
|
||||
joint.MaterialCode,
|
||||
joint.Remark,
|
||||
joint.WeldingMethodCode,
|
||||
joint.GrooveTypeCode,
|
||||
batch.PipingClassCode
|
||||
}).ToList();
|
||||
var CH_WeldMethod = printDetails.Select(x => x.WeldingMethodCode).Where(x => !string.IsNullOrEmpty(x)).Distinct().ToList();
|
||||
var CH_SlopeType = printDetails.Select(x => x.GrooveTypeCode).Where(x => !string.IsNullOrEmpty(x)).Distinct().ToList();
|
||||
if (trust != null)
|
||||
{
|
||||
string varValue = string.Empty;
|
||||
var projectName = BLL.ProjectService.GetProjectNameByProjectId(this.CurrUser.LoginProjectId);
|
||||
|
||||
dr["ProjectName"] = projectName;
|
||||
dr["CH_TrustUnit"] = BLL.UnitService.GetUnitNameByUnitId(this.CurrUser.UnitId);
|
||||
dr["CH_DetectionType"] = "委托检测";
|
||||
dr["CH_WorkName"] = "工艺管道";
|
||||
dr["CH_WorkType"] = "对接焊缝";
|
||||
dr["CH_DetectionTiming"] = "焊后";
|
||||
dr["CH_HeatTreatmentStatus"] = "/";
|
||||
dr["CH_ProjectPipelineCode"] = string.Join(",", printDetails.Select(x => x.PipelineCode).Where(x => !string.IsNullOrEmpty(x)).Distinct());
|
||||
dr["CH_Material"] = string.Join("/", printDetails.Select(x => x.MaterialCode).Where(x => !string.IsNullOrEmpty(x)).Distinct());
|
||||
dr["CH_MediumGrade"] = string.Join(",", printDetails.Select(x => x.PipingClassCode).Where(x => !string.IsNullOrEmpty(x)).Distinct());
|
||||
if (!string.IsNullOrEmpty(trust.NDEUnit))
|
||||
{
|
||||
dr["CH_CheckUnit"] = BLL.UnitService.GetUnitNameByUnitId(trust.NDEUnit).ToString();
|
||||
@@ -715,6 +743,54 @@ namespace FineUIPro.Web.HJGL.PointTrust
|
||||
}
|
||||
dt.Rows.Add(dr);
|
||||
|
||||
DataTable detailTable = new DataTable("Detail");
|
||||
detailTable.Columns.Add("Sequence", typeof(int));
|
||||
detailTable.Columns.Add("PipelineCode", typeof(string));
|
||||
detailTable.Columns.Add("WeldJointCode", typeof(string));
|
||||
detailTable.Columns.Add("Specification", typeof(string));
|
||||
detailTable.Columns.Add("GrooveType", typeof(string));
|
||||
detailTable.Columns.Add("WeldingMethod", typeof(string));
|
||||
detailTable.Columns.Add("WelderCode", typeof(string));
|
||||
detailTable.Columns.Add("MaterialCode", typeof(string));
|
||||
detailTable.Columns.Add("Remark", typeof(string));
|
||||
|
||||
int sequence = 1;
|
||||
foreach (var item in printDetails)
|
||||
{
|
||||
DataRow detailRow = detailTable.NewRow();
|
||||
detailRow["Sequence"] = sequence++;
|
||||
detailRow["PipelineCode"] = item.PipelineCode ?? string.Empty;
|
||||
detailRow["WeldJointCode"] = item.WeldJointCode ?? string.Empty;
|
||||
detailRow["Specification"] = item.Specification ?? string.Empty;
|
||||
detailRow["GrooveType"] = item.GrooveTypeCode ?? string.Empty;
|
||||
detailRow["WeldingMethod"] = item.WeldingMethodCode ?? string.Empty;
|
||||
detailRow["WelderCode"] = item.WelderCode ?? string.Empty;
|
||||
detailRow["MaterialCode"] = item.MaterialCode ?? string.Empty;
|
||||
detailRow["Remark"] = item.Remark ?? string.Empty;
|
||||
detailTable.Rows.Add(detailRow);
|
||||
}
|
||||
|
||||
bool isAttachment6 = (ViewState["TrustPrintTemplate"] as string) == "附件6";
|
||||
DataTable mainDetails = detailTable.Clone();
|
||||
mainDetails.TableName = isAttachment6 ? "Detail6Main" : "Detail4";
|
||||
int mainRowCount = isAttachment6 ? Math.Min(13, detailTable.Rows.Count) : detailTable.Rows.Count;
|
||||
for (int i = 0; i < mainRowCount; i++)
|
||||
{
|
||||
mainDetails.ImportRow(detailTable.Rows[i]);
|
||||
}
|
||||
PadPrintDetailRows(mainDetails, 13);
|
||||
|
||||
DataTable extraDetails = detailTable.Clone();
|
||||
extraDetails.TableName = "Detail6Extra";
|
||||
if (isAttachment6)
|
||||
{
|
||||
for (int i = 13; i < detailTable.Rows.Count; i++)
|
||||
{
|
||||
extraDetails.ImportRow(detailTable.Rows[i]);
|
||||
}
|
||||
PadPrintDetailRows(extraDetails, 15);
|
||||
}
|
||||
|
||||
Dictionary<string, string> keyValuePairs = new Dictionary<string, string>();
|
||||
keyValuePairs.Add("TrustBatchId", trust.TrustBatchId);
|
||||
keyValuePairs.Add("totalUnit", "赛鼎工程有限公司");
|
||||
@@ -737,13 +813,18 @@ namespace FineUIPro.Web.HJGL.PointTrust
|
||||
|
||||
BLL.FastReportService.ResetData();
|
||||
BLL.FastReportService.AddFastreportTable(dt);
|
||||
BLL.FastReportService.AddFastreportTable(mainDetails);
|
||||
if (isAttachment6)
|
||||
{
|
||||
BLL.FastReportService.AddFastreportTable(extraDetails);
|
||||
}
|
||||
BLL.FastReportService.AddFastreportParameter(keyValuePairs);
|
||||
|
||||
// Session["Table"] = dt;
|
||||
// Session["CH_TrustID"] = reportId;
|
||||
string initTemplatePath = "";
|
||||
string rootPath = Server.MapPath("~/");
|
||||
initTemplatePath = (ViewState["TrustPrintTemplate"] as string) == "附件6"
|
||||
initTemplatePath = isAttachment6
|
||||
? "File\\Fastreport\\无损检测委托单_附件6.frx"
|
||||
: "File\\Fastreport\\管道焊口检测委托单_附件4.frx";
|
||||
|
||||
@@ -1011,6 +1092,21 @@ namespace FineUIPro.Web.HJGL.PointTrust
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 按打印模板的固定行数补空行;附页超过一页时补齐到整页,确保页脚位置不随数据量漂移。
|
||||
/// </summary>
|
||||
private static void PadPrintDetailRows(DataTable table, int pageSize)
|
||||
{
|
||||
int targetRowCount = Math.Max(pageSize, ((table.Rows.Count + pageSize - 1) / pageSize) * pageSize);
|
||||
while (table.Rows.Count < targetRowCount)
|
||||
{
|
||||
DataRow row = table.NewRow();
|
||||
// FastReport 2017 会忽略所有字段均为 DBNull 的记录,设置隐藏序号保证空白表格行正常输出。
|
||||
row["Sequence"] = 0;
|
||||
table.Rows.Add(row);
|
||||
}
|
||||
}
|
||||
|
||||
#region 判断是否可删除
|
||||
/// <summary>
|
||||
/// 判断是否可以删除
|
||||
|
||||
@@ -51,16 +51,54 @@ namespace FineUIPro.Web.HJGL.WeldingManage
|
||||
rootNode2.Expanded = true;
|
||||
this.tvControlItem.Nodes.Add(rootNode2);
|
||||
|
||||
var pUnits = (from x in Funs.DB.Project_ProjectUnit where x.ProjectId == this.CurrUser.LoginProjectId select x).ToList();
|
||||
// 获取当前用户所在单位
|
||||
var currUnit = pUnits.FirstOrDefault(x => x.UnitId == this.CurrUser.UnitId);
|
||||
|
||||
var unitWorkList = (from x in Funs.DB.WBS_UnitWork
|
||||
where x.ProjectId == this.CurrUser.LoginProjectId
|
||||
&& x.SuperUnitWork == null && x.UnitId != null && x.ProjectType != null
|
||||
orderby x.UnitWorkCode
|
||||
select x).ToList();
|
||||
|
||||
var unitWorkIds = unitWorkList.Select(x => x.UnitWorkId).ToList();
|
||||
var testPackages = (from x in Funs.DB.PTP_TestPackage
|
||||
where x.ProjectId == this.CurrUser.LoginProjectId
|
||||
&& unitWorkIds.Contains(x.UnitWorkId)
|
||||
orderby x.TestPackageNo
|
||||
select x).ToList();
|
||||
var testPackageIds = testPackages.Select(x => x.PTP_ID).ToList();
|
||||
|
||||
// 试压包与管线、焊口存在跨表联动,必须批量统计,避免按单位工程和试压包逐条访问数据库。
|
||||
var pipelineCountByTestPackage = new Dictionary<string, int>();
|
||||
if (testPackageIds.Count > 0)
|
||||
{
|
||||
var pipelineQuery = from x in Funs.DB.HJGL_Pipeline
|
||||
join y in Funs.DB.PTP_PipelineList on x.PipelineId equals y.PipelineId
|
||||
where testPackageIds.Contains(y.PTP_ID)
|
||||
&& x.ProjectId == this.CurrUser.LoginProjectId
|
||||
&& x.PipelineCode.Contains(this.txtPipelineCode.Text.Trim())
|
||||
select new { y.PTP_ID, x.PipelineId };
|
||||
|
||||
if (!cbAllPipeline.Checked)
|
||||
{
|
||||
pipelineQuery = pipelineQuery.Where(x => Funs.DB.HJGL_WeldJoint.Any(y =>
|
||||
y.PipelineId == x.PipelineId && y.IsTwoJoint == true));
|
||||
}
|
||||
|
||||
pipelineCountByTestPackage = pipelineQuery.Distinct()
|
||||
.ToList()
|
||||
.GroupBy(x => x.PTP_ID)
|
||||
.ToDictionary(x => x.Key, x => x.Count());
|
||||
}
|
||||
|
||||
var unitIds = unitWorkList
|
||||
.Where(x => !string.IsNullOrEmpty(x.UnitId))
|
||||
.SelectMany(x => x.UnitId.Split(','))
|
||||
.Where(x => !string.IsNullOrEmpty(x))
|
||||
.Distinct()
|
||||
.ToList();
|
||||
var unitNameById = Funs.DB.Base_Unit
|
||||
.Where(x => unitIds.Contains(x.UnitId))
|
||||
.ToDictionary(x => x.UnitId, x => x.UnitName);
|
||||
var testPackagesByUnitWork = testPackages.ToLookup(x => x.UnitWorkId);
|
||||
|
||||
List<Model.WBS_UnitWork> unitWork1 = null;
|
||||
List<Model.WBS_UnitWork> unitWork2 = null;
|
||||
|
||||
@@ -84,16 +122,9 @@ namespace FineUIPro.Web.HJGL.WeldingManage
|
||||
{
|
||||
foreach (var q in unitWork1)
|
||||
{
|
||||
int a = 0;
|
||||
if (cbAllPipeline.Checked)
|
||||
{
|
||||
a = GetUnitWorkTestPackagePipelineCount(q.UnitWorkId);
|
||||
}
|
||||
else
|
||||
{
|
||||
a = GetUnitWorkTestPackagePipelineCount(q.UnitWorkId);
|
||||
}
|
||||
var unitNamesUnitIds = BLL.UnitService.getUnitNamesUnitIds(q.UnitId);
|
||||
var unitTestPackages = testPackagesByUnitWork[q.UnitWorkId].ToList();
|
||||
int a = unitTestPackages.Sum(x => GetPipelineCount(pipelineCountByTestPackage, x.PTP_ID));
|
||||
var unitNamesUnitIds = GetUnitNames(q.UnitId, unitNameById);
|
||||
TreeNode tn1 = new TreeNode();
|
||||
tn1.NodeID = q.UnitWorkId;
|
||||
tn1.Text = q.UnitWorkName + "【" + a.ToString() + "】" + "管线";
|
||||
@@ -104,7 +135,7 @@ namespace FineUIPro.Web.HJGL.WeldingManage
|
||||
rootNode1.Nodes.Add(tn1);
|
||||
if (a > 0)
|
||||
{
|
||||
BindTestPackageNodes(tn1);
|
||||
BindTestPackageNodes(tn1, unitTestPackages, pipelineCountByTestPackage);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -112,16 +143,9 @@ namespace FineUIPro.Web.HJGL.WeldingManage
|
||||
{
|
||||
foreach (var q in unitWork2)
|
||||
{
|
||||
int a = 0;
|
||||
if (cbAllPipeline.Checked)
|
||||
{
|
||||
a = GetUnitWorkTestPackagePipelineCount(q.UnitWorkId);
|
||||
}
|
||||
else
|
||||
{
|
||||
a = GetUnitWorkTestPackagePipelineCount(q.UnitWorkId);
|
||||
}
|
||||
var unitNamesUnitIds = BLL.UnitService.getUnitNamesUnitIds(q.UnitId);
|
||||
var unitTestPackages = testPackagesByUnitWork[q.UnitWorkId].ToList();
|
||||
int a = unitTestPackages.Sum(x => GetPipelineCount(pipelineCountByTestPackage, x.PTP_ID));
|
||||
var unitNamesUnitIds = GetUnitNames(q.UnitId, unitNameById);
|
||||
TreeNode tn2 = new TreeNode();
|
||||
tn2.NodeID = q.UnitWorkId;
|
||||
tn2.Text = q.UnitWorkName + "【" + a.ToString() + "】" + "管线";
|
||||
@@ -136,11 +160,29 @@ namespace FineUIPro.Web.HJGL.WeldingManage
|
||||
rootNode2.Nodes.Add(tn2);
|
||||
if (a > 0)
|
||||
{
|
||||
BindTestPackageNodes(tn2);
|
||||
BindTestPackageNodes(tn2, unitTestPackages, pipelineCountByTestPackage);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private static int GetPipelineCount(IDictionary<string, int> pipelineCountByTestPackage, string testPackageId)
|
||||
{
|
||||
int count;
|
||||
return pipelineCountByTestPackage.TryGetValue(testPackageId, out count) ? count : 0;
|
||||
}
|
||||
|
||||
private static string GetUnitNames(string unitIds, IDictionary<string, string> unitNameById)
|
||||
{
|
||||
if (string.IsNullOrEmpty(unitIds))
|
||||
{
|
||||
return string.Empty;
|
||||
}
|
||||
|
||||
return string.Join(",", unitIds.Split(',')
|
||||
.Where(x => unitNameById.ContainsKey(x))
|
||||
.Select(x => unitNameById[x]));
|
||||
}
|
||||
#endregion
|
||||
private void BindNodes(TreeNode node)
|
||||
{
|
||||
@@ -214,27 +256,14 @@ namespace FineUIPro.Web.HJGL.WeldingManage
|
||||
}
|
||||
}
|
||||
|
||||
private int GetUnitWorkTestPackagePipelineCount(string unitWorkId)
|
||||
private void BindTestPackageNodes(
|
||||
TreeNode unitWorkNode,
|
||||
IEnumerable<Model.PTP_TestPackage> testPackages,
|
||||
IDictionary<string, int> pipelineCountByTestPackage)
|
||||
{
|
||||
var testPackages = (from x in Funs.DB.PTP_TestPackage
|
||||
where x.ProjectId == this.CurrUser.LoginProjectId
|
||||
&& x.UnitWorkId == unitWorkId
|
||||
select x.PTP_ID).ToList();
|
||||
|
||||
return testPackages.Select(x => GetTestPackagePipelineList(x).Count()).Sum();
|
||||
}
|
||||
|
||||
private void BindTestPackageNodes(TreeNode unitWorkNode)
|
||||
{
|
||||
var testPackages = (from x in Funs.DB.PTP_TestPackage
|
||||
where x.ProjectId == this.CurrUser.LoginProjectId
|
||||
&& x.UnitWorkId == unitWorkNode.NodeID
|
||||
orderby x.TestPackageNo
|
||||
select x).ToList();
|
||||
|
||||
foreach (var item in testPackages)
|
||||
{
|
||||
int pipelineCount = GetTestPackagePipelineList(item.PTP_ID).Count();
|
||||
int pipelineCount = GetPipelineCount(pipelineCountByTestPackage, item.PTP_ID);
|
||||
if (pipelineCount == 0)
|
||||
{
|
||||
continue;
|
||||
@@ -257,20 +286,21 @@ namespace FineUIPro.Web.HJGL.WeldingManage
|
||||
|
||||
private List<Model.HJGL_Pipeline> GetTestPackagePipelineList(string ptpId)
|
||||
{
|
||||
var pipeline = (from x in Funs.DB.HJGL_Pipeline
|
||||
join y in Funs.DB.PTP_PipelineList on x.PipelineId equals y.PipelineId
|
||||
where y.PTP_ID == ptpId
|
||||
&& x.ProjectId == this.CurrUser.LoginProjectId
|
||||
&& x.PipelineCode.Contains(this.txtPipelineCode.Text.Trim())
|
||||
orderby x.PipelineCode
|
||||
select x).Distinct().ToList();
|
||||
var pipelineQuery = (from x in Funs.DB.HJGL_Pipeline
|
||||
join y in Funs.DB.PTP_PipelineList on x.PipelineId equals y.PipelineId
|
||||
where y.PTP_ID == ptpId
|
||||
&& x.ProjectId == this.CurrUser.LoginProjectId
|
||||
&& x.PipelineCode.Contains(this.txtPipelineCode.Text.Trim())
|
||||
orderby x.PipelineCode
|
||||
select x).Distinct();
|
||||
|
||||
if (!cbAllPipeline.Checked)
|
||||
{
|
||||
pipeline = pipeline.Where(x => (from y in Funs.DB.HJGL_WeldJoint where y.PipelineId == x.PipelineId && y.IsTwoJoint == true select y).Count() > 0).ToList();
|
||||
pipelineQuery = pipelineQuery.Where(x => Funs.DB.HJGL_WeldJoint.Any(y =>
|
||||
y.PipelineId == x.PipelineId && y.IsTwoJoint == true));
|
||||
}
|
||||
|
||||
return pipeline;
|
||||
return pipelineQuery.ToList();
|
||||
}
|
||||
|
||||
#region 点击TreeView
|
||||
|
||||
@@ -213,12 +213,11 @@ namespace FineUIPro.Web.HJGL.WeldingManage
|
||||
private void InitTreeMenu()
|
||||
{
|
||||
this.tvControlItem.Nodes.Clear();
|
||||
int a = (from x in Funs.DB.HJGL_Pipeline where x.ProjectId == this.CurrUser.LoginProjectId && x.UnitWorkId == this.UnitWorkId && x.PipeArea == PipelineService.PipeArea_SHOP && x.PipelineCode.Contains(this.txtPipelineCode.Text.Trim()) select x).Count();
|
||||
int b = (from x in Funs.DB.HJGL_Pipeline where x.ProjectId == this.CurrUser.LoginProjectId && x.UnitWorkId == this.UnitWorkId && x.PipeArea == PipelineService.PipeArea_FIELD && x.PipelineCode.Contains(this.txtPipelineCode.Text.Trim()) select x).Count();
|
||||
int a = (from x in Funs.DB.HJGL_Pipeline where x.ProjectId == this.CurrUser.LoginProjectId && x.UnitWorkId == this.UnitWorkId && x.PipelineCode.Contains(this.txtPipelineCode.Text.Trim()) select x).Count();
|
||||
|
||||
TreeNode rootNode1 = new TreeNode();
|
||||
rootNode1.NodeID = BLL.PipelineService.PipeArea_SHOP;
|
||||
rootNode1.Text = "工厂预制";
|
||||
rootNode1.NodeID = "0";
|
||||
rootNode1.Text = "管线";
|
||||
rootNode1.CommandName = 1 + "|" + Funs.GetEndPageNumber(a, pageSize); //页码|总页
|
||||
rootNode1.EnableClickEvent = true;
|
||||
rootNode1.EnableExpandEvent = true;
|
||||
@@ -229,29 +228,14 @@ namespace FineUIPro.Web.HJGL.WeldingManage
|
||||
newNode.Text = "加载管线...";
|
||||
newNode.NodeID = "加载管线...";
|
||||
rootNode1.Nodes.Add(newNode);
|
||||
}
|
||||
TreeNode rootNode2 = new TreeNode();
|
||||
rootNode2.NodeID = BLL.PipelineService.PipeArea_FIELD;
|
||||
rootNode2.Text = "现场施工";
|
||||
rootNode2.CommandName = 1 + "|" + Funs.GetEndPageNumber(b, pageSize);
|
||||
rootNode2.EnableClickEvent = true;
|
||||
rootNode2.EnableExpandEvent = true;
|
||||
this.tvControlItem.Nodes.Add(rootNode2);
|
||||
if (b > 0)
|
||||
{
|
||||
TreeNode newNode = new TreeNode();
|
||||
newNode.Text = "加载管线...";
|
||||
newNode.NodeID = "加载管线...";
|
||||
rootNode2.Nodes.Add(newNode);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
void AddTreeNode(string PipeArea, TreeNode node)
|
||||
void AddTreeNode(TreeNode node)
|
||||
{
|
||||
var pipeline = (from x in Funs.DB.HJGL_Pipeline
|
||||
where x.ProjectId == this.CurrUser.LoginProjectId
|
||||
&& x.UnitWorkId == this.UnitWorkId
|
||||
&& x.PipeArea == PipeArea
|
||||
&& x.UnitWorkId == this.UnitWorkId
|
||||
&& x.PipelineCode.Contains(this.txtPipelineCode.Text.Trim())
|
||||
orderby x.PipelineCode
|
||||
select x).ToList();
|
||||
@@ -289,8 +273,7 @@ namespace FineUIPro.Web.HJGL.WeldingManage
|
||||
TreeNode newNode = new TreeNode();
|
||||
newNode.Text = "加载";
|
||||
newNode.NodeID = SQLHelper.GetNewID();
|
||||
newNode.Icon = Icon.ArrowDown;
|
||||
newNode.CommandName = PipeArea;
|
||||
newNode.Icon = Icon.ArrowDown;
|
||||
newNode.EnableClickEvent = true;
|
||||
node.Nodes.Add(newNode);
|
||||
}
|
||||
@@ -303,16 +286,8 @@ namespace FineUIPro.Web.HJGL.WeldingManage
|
||||
if (e.Node.Nodes[0].NodeID == "加载管线...")
|
||||
{
|
||||
e.Node.Nodes.Clear();
|
||||
if (e.Node.Text == "工厂预制")
|
||||
{
|
||||
AddTreeNode(BLL.PipelineService.PipeArea_SHOP, e.Node);
|
||||
AddTreeNode(e.Node);
|
||||
|
||||
}
|
||||
else if (e.Node.Text == "现场施工")
|
||||
{
|
||||
AddTreeNode(BLL.PipelineService.PipeArea_FIELD, e.Node);
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@@ -333,16 +308,8 @@ namespace FineUIPro.Web.HJGL.WeldingManage
|
||||
TreeNode treeNode = e.Node.ParentNode;
|
||||
treeNode.Nodes.Remove(e.Node);
|
||||
|
||||
if (e.Node.CommandName == "1")
|
||||
{
|
||||
AddTreeNode(BLL.PipelineService.PipeArea_SHOP, e.Node.ParentNode);
|
||||
AddTreeNode(e.Node.ParentNode);
|
||||
|
||||
}
|
||||
else if (e.Node.CommandName == "2")
|
||||
{
|
||||
AddTreeNode(BLL.PipelineService.PipeArea_FIELD, e.Node.ParentNode);
|
||||
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
@@ -57,7 +57,9 @@
|
||||
<f:TextBox ID="txtWeldJointCode" Label="焊口号" Readonly="false"
|
||||
runat="server" LabelWidth="100px" LabelAlign="Right">
|
||||
</f:TextBox>
|
||||
<f:Label runat="server"></f:Label>
|
||||
<f:TextBox ID="txtFlowingSection" Label="流水段" runat="server"
|
||||
LabelWidth="100px" LabelAlign="Right" MaxLength="100">
|
||||
</f:TextBox>
|
||||
</Items>
|
||||
</f:FormRow>
|
||||
<f:FormRow>
|
||||
|
||||
@@ -100,6 +100,7 @@ namespace FineUIPro.Web.HJGL.WeldingManage
|
||||
{
|
||||
this.txtWeldJointCode.Text = joint.WeldJointCode;
|
||||
}
|
||||
this.txtFlowingSection.Text = joint.FlowingSection;
|
||||
if (!string.IsNullOrEmpty(joint.Material1Id))
|
||||
{
|
||||
this.drpMaterial1.SelectedValue = joint.Material1Id;
|
||||
@@ -318,8 +319,17 @@ namespace FineUIPro.Web.HJGL.WeldingManage
|
||||
Alert.ShowInTop("请完善必填项!", MessageBoxIcon.Warning);
|
||||
return;
|
||||
}
|
||||
Model.HJGL_WeldJoint joint = new Model.HJGL_WeldJoint();
|
||||
string weldJointId = WeldJointId;
|
||||
bool isUpdatingExistingJoint = !string.IsNullOrEmpty(weldJointId) && string.IsNullOrEmpty(Request.Params["Type"]);
|
||||
Model.HJGL_WeldJoint joint = isUpdatingExistingJoint
|
||||
? BLL.WeldJointService.GetWeldJointByWeldJointId(weldJointId)
|
||||
: new Model.HJGL_WeldJoint();
|
||||
if (joint == null)
|
||||
{
|
||||
Alert.ShowInTop("焊口数据不存在或已被删除,请刷新后重试!", MessageBoxIcon.Warning);
|
||||
return;
|
||||
}
|
||||
|
||||
joint.PipelineId = this.PipelineId;
|
||||
joint.PipelineCode = txtPipelineCode.Text.Trim();
|
||||
joint.ProjectId = this.CurrUser.LoginProjectId;
|
||||
@@ -418,6 +428,8 @@ namespace FineUIPro.Web.HJGL.WeldingManage
|
||||
joint.IsHotProess = Convert.ToBoolean(drpIsHotProess.SelectedValue);
|
||||
//joint.DesignIsHotProess = Convert.ToBoolean(drpDesignIsHotProess.SelectedValue);
|
||||
joint.Remark = txtRemark.Text.Trim();
|
||||
// 流水段属于焊口自身属性,编辑时直接回写焊口,避免只显示管线流水段而无法修正。
|
||||
joint.FlowingSection = txtFlowingSection.Text.Trim();
|
||||
joint.SubmitMan = CurrUser.PersonId;
|
||||
|
||||
if (this.txtWpqId.Text != "")
|
||||
@@ -426,7 +438,7 @@ namespace FineUIPro.Web.HJGL.WeldingManage
|
||||
}
|
||||
if (!string.IsNullOrEmpty(weldJointId))
|
||||
{
|
||||
if (string.IsNullOrEmpty(Request.Params["Type"])) //非插入焊口
|
||||
if (isUpdatingExistingJoint) // 非插入焊口
|
||||
{
|
||||
joint.WeldJointId = weldJointId;
|
||||
BLL.WeldJointService.UpdateWeldJoint(joint);
|
||||
@@ -878,4 +890,4 @@ namespace FineUIPro.Web.HJGL.WeldingManage
|
||||
PageContext.RegisterStartupScript(WindowAtt.GetShowReference(String.Format("~/AttachFile/webuploader.aspx?toKeyId={0}&path=FileUpload/WeldJoint&menuId={1}", WeldJointId, BLL.Const.HJGL_JotTwoDesignMenuId)));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -149,6 +149,15 @@ namespace FineUIPro.Web.HJGL.WeldingManage
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.TextBox txtWeldJointCode;
|
||||
|
||||
/// <summary>
|
||||
/// txtFlowingSection 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.TextBox txtFlowingSection;
|
||||
|
||||
/// <summary>
|
||||
/// drpMaterial1 控件。
|
||||
/// </summary>
|
||||
|
||||
@@ -757,7 +757,15 @@ namespace FineUIPro.Web.HJGL.WeldingManage
|
||||
{
|
||||
List<string> materialCodes = SplitExportValues(x.MaterialCode);
|
||||
List<string> materialQuantities = SplitExportValues(x.MaterialQuantity);
|
||||
int materialRowCount = Math.Max(materialCodes.Count, materialQuantities.Count);
|
||||
List<string> weldJointCodes = SplitExportValues(x.WeldJointCode);
|
||||
List<string> weldJointDins = SplitExportValues(x.WeldJointDin);
|
||||
int materialRowCount = new[]
|
||||
{
|
||||
materialCodes.Count,
|
||||
materialQuantities.Count,
|
||||
weldJointCodes.Count,
|
||||
weldJointDins.Count
|
||||
}.Max();
|
||||
if (materialRowCount == 0)
|
||||
{
|
||||
materialRowCount = 1;
|
||||
@@ -773,6 +781,8 @@ namespace FineUIPro.Web.HJGL.WeldingManage
|
||||
已焊口数 = x.WeldedWeldJointCount,
|
||||
未焊口数 = x.UnweldedWeldJointCount,
|
||||
未焊达因量 = x.UnweldedDin ?? 0,
|
||||
焊口号 = index < weldJointCodes.Count ? weldJointCodes[index] : string.Empty,
|
||||
焊口达因 = index < weldJointDins.Count ? weldJointDins[index] : string.Empty,
|
||||
材料编码 = index < materialCodes.Count ? materialCodes[index] : string.Empty,
|
||||
数量 = index < materialQuantities.Count ? materialQuantities[index] : string.Empty,
|
||||
组件匹配率 = x.ComponentMatchRateString,
|
||||
@@ -814,7 +824,7 @@ namespace FineUIPro.Web.HJGL.WeldingManage
|
||||
{
|
||||
return string.IsNullOrEmpty(values)
|
||||
? new List<string>()
|
||||
: values.Split(new[] { "\r\n", "\n" }, StringSplitOptions.RemoveEmptyEntries)
|
||||
: values.Split(new[] { "\r\n", "\n" }, StringSplitOptions.None)
|
||||
.Select(x => x.Trim())
|
||||
.ToList();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user