焊接优化
This commit is contained in:
@@ -110,7 +110,7 @@ namespace FineUIPro.Web.WeldingProcess.TrustManage
|
||||
tn.ToolTip = "Installation";
|
||||
|
||||
// 按管线查询能展开
|
||||
if (!string.IsNullOrEmpty(this.txtPipeCode.Text))
|
||||
if (!string.IsNullOrEmpty(this.txtPipeCode.Text.Trim()))
|
||||
{
|
||||
tn.Expanded = true;
|
||||
newNode.Nodes.Add(tn);
|
||||
@@ -154,7 +154,7 @@ namespace FineUIPro.Web.WeldingProcess.TrustManage
|
||||
if (!string.IsNullOrEmpty(this.txtJotDate.Text))
|
||||
{
|
||||
var pitem = from x in Funs.DB.Batch_PointBatchItem
|
||||
where x.PointBatchId == p.PointBatchId && x.WeldingDate >= sar && x.WeldingDate < end
|
||||
where x.PointBatchId == p.PointBatchId /*&& x.WeldingDate >= sar && x.WeldingDate < end*/
|
||||
select x;
|
||||
if (drpTrustState.SelectedValue == "0")
|
||||
{
|
||||
@@ -340,7 +340,63 @@ namespace FineUIPro.Web.WeldingProcess.TrustManage
|
||||
DateTime sar = Convert.ToDateTime(startDate).AddMonths(-1);
|
||||
DateTime end = Convert.ToDateTime(startDate).AddMonths(1);
|
||||
|
||||
foreach (var item in pointManages)
|
||||
/*var list = from x in pointManages
|
||||
join y in Funs.DB.Batch_PointBatchItem on x.PointBatchId equals y.PointBatchId
|
||||
where y.WeldingDate >= sar && y.WeldingDate < end
|
||||
select new { x.PointBatchId, x.PointBatchCode, x.StartDate, x.EndDate, x.IsTrust, y.PointDate, y.IsBuildTrust };*/
|
||||
var list = pointManages
|
||||
.Join(Funs.DB.Batch_PointBatchItem,
|
||||
x => x.PointBatchId,
|
||||
y => y.PointBatchId,
|
||||
(x, y) => new { x, y })
|
||||
.Where(joined => joined.y.WeldingDate >= sar && joined.y.WeldingDate < end)
|
||||
.Select(joined => new
|
||||
{
|
||||
joined.x.PointBatchId,
|
||||
joined.x.PointBatchCode,
|
||||
joined.x.StartDate,
|
||||
joined.x.EndDate,
|
||||
joined.x.IsTrust,
|
||||
joined.y.PointDate,
|
||||
joined.y.IsBuildTrust
|
||||
});
|
||||
|
||||
if (drpTrustState.SelectedValue == "0")
|
||||
{
|
||||
list = list.Where(item => item.PointDate.HasValue && (item.IsBuildTrust == null || item.IsBuildTrust == false));
|
||||
}
|
||||
|
||||
if (drpTrustState.SelectedValue == "0")
|
||||
{
|
||||
list = list.Where(x => x.PointDate.HasValue && (x.IsBuildTrust == null || x.IsBuildTrust == false));
|
||||
}
|
||||
var PointBatchIdList = list.OrderByDescending(x=>x.StartDate). Select(x => x.PointBatchId).Distinct();
|
||||
foreach (var PointBatchId in PointBatchIdList)
|
||||
{
|
||||
var item = list.Where(x => x.PointBatchId == PointBatchId).FirstOrDefault();
|
||||
TreeNode newNode = new TreeNode
|
||||
{
|
||||
NodeID = item.PointBatchId,
|
||||
ToolTip = "批",
|
||||
EnableClickEvent = true,
|
||||
};
|
||||
|
||||
// 当天批
|
||||
if (string.Format("{0:yyyy-MM-dd}", item.StartDate) == string.Format("{0:yyyy-MM-dd}", System.DateTime.Now)
|
||||
|| string.Format("{0:yyyy-MM-dd}", item.EndDate) == string.Format("{0:yyyy-MM-dd}", System.DateTime.Now))
|
||||
{
|
||||
newNode.Text = "<font color='#EE0000'>" + item.PointBatchCode + "</font>";
|
||||
newNode.ToolTip = "当天批";
|
||||
}
|
||||
else
|
||||
{
|
||||
newNode.Text = item.PointBatchCode;
|
||||
}
|
||||
|
||||
e.Node.Nodes.Add(newNode);
|
||||
}
|
||||
|
||||
/* foreach (var item in pointManages)
|
||||
{
|
||||
if (!string.IsNullOrEmpty(this.txtJotDate.Text))
|
||||
{
|
||||
@@ -391,7 +447,7 @@ namespace FineUIPro.Web.WeldingProcess.TrustManage
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
*/ }
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
@@ -200,9 +200,8 @@ namespace FineUIPro.Web.WeldingProcess.TrustManage
|
||||
e.Node.Nodes.Clear();
|
||||
// 单号
|
||||
var trusts = from x in Funs.DB.Batch_BatchTrust
|
||||
where x.TrustDate < Convert.ToDateTime(this.txtTrustDateMonth.Text.Trim() + "-01").AddMonths(1)
|
||||
&& x.TrustDate >= Convert.ToDateTime(this.txtTrustDateMonth.Text.Trim() + "-01").AddMonths(-1)
|
||||
&& x.ProjectId == this.CurrUser.LoginProjectId
|
||||
where
|
||||
x.ProjectId == this.CurrUser.LoginProjectId
|
||||
&& x.InstallationId.ToString() == e.Node.ParentNode.NodeID.Split('|')[0]
|
||||
&& x.UnitId == e.Node.ParentNode.ParentNode.NodeID
|
||||
&& x.DetectionTypeId == e.Node.NodeID.Split('|')[0]
|
||||
@@ -220,7 +219,11 @@ namespace FineUIPro.Web.WeldingProcess.TrustManage
|
||||
where y.PipelineCode.Contains(txtPipeCode.Text.Trim())
|
||||
select x;
|
||||
}
|
||||
|
||||
if (txtSearchCode.Text.Trim() == ""&& txtPipeCode.Text.Trim() == "")
|
||||
{
|
||||
trusts = from x in trusts where x.TrustDate < Convert.ToDateTime(this.txtTrustDateMonth.Text.Trim() + "-01").AddMonths(1)
|
||||
&& x.TrustDate >= Convert.ToDateTime(this.txtTrustDateMonth.Text.Trim() + "-01").AddMonths(-1) select x;
|
||||
}
|
||||
trusts = trusts.OrderByDescending(x => x.TrustBatchCode);
|
||||
|
||||
foreach (var trust in trusts)
|
||||
|
||||
Reference in New Issue
Block a user