20230220 003焊接修改
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
using BLL;
|
||||
using FastReport.Design;
|
||||
using FineUIPro.Web.HJGL.WeldingManage;
|
||||
using FineUIPro.Web.ProjectData;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Data;
|
||||
@@ -86,12 +87,38 @@ namespace FineUIPro.Web.HJGL.DataImport
|
||||
unitWork1 = (from x in unitWorkList where x.ProjectType == "1" select x).ToList();
|
||||
unitWork2 = (from x in unitWorkList where x.ProjectType == "2" select x).ToList();
|
||||
}
|
||||
|
||||
//var dbpipeLineMat = from x in Funs.DB.HJGL_PipeLineMat select x;
|
||||
//var DBpipeline = from x in Funs.DB.HJGL_Pipeline where x.ProjectId == this.CurrUser.LoginProjectId select x;
|
||||
if (unitWork1.Count() > 0)
|
||||
{
|
||||
foreach (var q in unitWork1)
|
||||
{
|
||||
int a = (from x in Funs.DB.HJGL_Pipeline where x.ProjectId == this.CurrUser.LoginProjectId && x.UnitWorkId == q.UnitWorkId select x).Count();
|
||||
string strSql = " SELECT DISTINCT [t0].[PipelineId] FROM [dbo].[HJGL_Pipeline] AS [t0]\r\nleft JOIN [dbo].[HJGL_PipeLineMat] AS [t1] ON [t0].[PipelineId] = [t1].[PipelineId]";
|
||||
strSql += "where [t0].[UnitWorkId] =@UnitWorkId ";
|
||||
List<SqlParameter> listStr = new List<SqlParameter>();
|
||||
listStr.Add(new SqlParameter("@UnitWorkId", q.UnitWorkId));
|
||||
|
||||
if (!string.IsNullOrEmpty(txtMaterialCode.Text.Trim()))
|
||||
{
|
||||
strSql += " and [t1].[MaterialCode] like @MaterialCode";
|
||||
listStr.Add(new SqlParameter("@MaterialCode", "%" + txtMaterialCode.Text.Trim() + "%"));
|
||||
|
||||
}
|
||||
if (!string.IsNullOrEmpty(tvPipeCode.Text.Trim()))
|
||||
{
|
||||
strSql += " and [t0].[PipelineCode] like @PipelineCode";
|
||||
listStr.Add(new SqlParameter("@PipelineCode", "%" + tvPipeCode.Text.Trim() + "%"));
|
||||
|
||||
}
|
||||
SqlParameter[] parameter = listStr.ToArray();
|
||||
DataTable dt = SQLHelper.GetDataTableRunText(strSql, parameter);
|
||||
var a = dt.Rows.Count;
|
||||
|
||||
//int a = (from x in DBpipeline
|
||||
// join y in dbpipeLineMat on x.PipelineId equals y.PipelineId
|
||||
// where x.PipelineCode.Contains(tvPipeCode.Text.Trim()) && x.UnitWorkId == q.UnitWorkId
|
||||
// && y.MaterialCode.Contains(txtMaterialCode.Text.Trim())
|
||||
// select x.PipelineId).Distinct().Count();
|
||||
var u = BLL.UnitService.GetUnitByUnitId(q.UnitId);
|
||||
TreeNode tn1 = new TreeNode();
|
||||
tn1.NodeID = q.UnitWorkId;
|
||||
@@ -112,9 +139,45 @@ namespace FineUIPro.Web.HJGL.DataImport
|
||||
}
|
||||
if (unitWork2.Count() > 0)
|
||||
{
|
||||
|
||||
foreach (var q in unitWork2)
|
||||
{
|
||||
int a = (from x in Funs.DB.HJGL_Pipeline where x.ProjectId == this.CurrUser.LoginProjectId && x.UnitWorkId == q.UnitWorkId select x).Count();
|
||||
string strSql = " SELECT DISTINCT [t0].[PipelineId] FROM [dbo].[HJGL_Pipeline] AS [t0]\r\nleft JOIN [dbo].[HJGL_PipeLineMat] AS [t1] ON [t0].[PipelineId] = [t1].[PipelineId]";
|
||||
strSql += "where [t0].[UnitWorkId] =@UnitWorkId ";
|
||||
List<SqlParameter> listStr = new List<SqlParameter>();
|
||||
listStr.Add(new SqlParameter("@UnitWorkId", q.UnitWorkId));
|
||||
|
||||
if (!string.IsNullOrEmpty(txtMaterialCode.Text.Trim()))
|
||||
{
|
||||
strSql += " and [t1].[MaterialCode] like @MaterialCode";
|
||||
listStr.Add(new SqlParameter("@MaterialCode", "%" + txtMaterialCode.Text.Trim() + "%"));
|
||||
|
||||
}
|
||||
if (!string.IsNullOrEmpty(tvPipeCode.Text.Trim()))
|
||||
{
|
||||
strSql += " and [t0].[PipelineCode] like @PipelineCode";
|
||||
listStr.Add(new SqlParameter("@PipelineCode", "%" + tvPipeCode.Text.Trim() + "%"));
|
||||
|
||||
}
|
||||
SqlParameter[] parameter = listStr.ToArray();
|
||||
DataTable dt = SQLHelper.GetDataTableRunText(strSql, parameter);
|
||||
|
||||
var a =dt.Rows.Count;
|
||||
|
||||
//var b = (from x in Funs.DB.HJGL_Pipeline
|
||||
// join y in Funs.DB.HJGL_PipeLineMat on x.PipelineId equals y.PipelineId
|
||||
// where x.ProjectId == this.CurrUser.LoginProjectId && x.UnitWorkId == q.UnitWorkId && y.MaterialCode.Contains(txtMaterialCode.Text.Trim())
|
||||
// select x).Distinct();
|
||||
//var b = (from x in DBpipeline
|
||||
// join y in dbpipeLineMat on x.PipelineId equals y.PipelineId
|
||||
// where x.PipelineCode.Contains(tvPipeCode.Text.Trim()) && x.UnitWorkId == q.UnitWorkId
|
||||
// && y.MaterialCode.Contains(txtMaterialCode.Text.Trim())
|
||||
// select x.PipelineId).Distinct();
|
||||
//int a = (from x in DBpipeline
|
||||
// join y in dbpipeLineMat on x.PipelineId equals y.PipelineId
|
||||
// where x.PipelineCode.Contains(tvPipeCode.Text.Trim()) && x.UnitWorkId == q.UnitWorkId
|
||||
// && y.MaterialCode.Contains(txtMaterialCode.Text.Trim())
|
||||
// select x.PipelineId).Distinct().Count();
|
||||
var u = BLL.UnitService.GetUnitByUnitId(q.UnitId);
|
||||
TreeNode tn2 = new TreeNode();
|
||||
tn2.NodeID = q.UnitWorkId;
|
||||
@@ -145,7 +208,7 @@ namespace FineUIPro.Web.HJGL.DataImport
|
||||
#region 暂不有
|
||||
private void BindNodes(TreeNode node)
|
||||
{
|
||||
BLL.PipelineService.BindTreeNodes(node, this.tvPipeCode.Text.Trim(), this.CurrUser.LoginProjectId, pageSize);
|
||||
BLL.PipelineService.BindTreeNodes(node, this.tvPipeCode.Text.Trim(),txtMaterialCode.Text.Trim(), this.CurrUser.LoginProjectId, pageSize);
|
||||
}
|
||||
#endregion
|
||||
|
||||
@@ -223,11 +286,11 @@ namespace FineUIPro.Web.HJGL.DataImport
|
||||
LEFT JOIN HJGL_Pipeline line ON pipe.PipelineId=line.PipelineId
|
||||
WHERE line.UnitWorkId=@UnitWorkId and line.PipeArea='1' ";
|
||||
List<SqlParameter> listStr = new List<SqlParameter>();
|
||||
if (!string.IsNullOrEmpty(txtMaterialCode.Text.Trim()))
|
||||
{
|
||||
strSql += " and lib.MaterialCode like @MaterialCode ";
|
||||
listStr.Add(new SqlParameter("@MaterialCode", "%" + txtMaterialCode.Text.Trim() + "%"));
|
||||
}
|
||||
//if (!string.IsNullOrEmpty(txtMaterialCode.Text.Trim()))
|
||||
//{
|
||||
// strSql += " and lib.MaterialCode like @MaterialCode ";
|
||||
// listStr.Add(new SqlParameter("@MaterialCode", "%" + txtMaterialCode.Text.Trim() + "%"));
|
||||
//}
|
||||
if (!string.IsNullOrEmpty(pipelineId))
|
||||
{
|
||||
strSql += " and pipe.PipelineId=@PipelineId order by PrefabricatedComponents ";
|
||||
@@ -258,11 +321,11 @@ namespace FineUIPro.Web.HJGL.DataImport
|
||||
listStr.Add(new SqlParameter("@PipelineId", pipelineId));
|
||||
|
||||
}
|
||||
if (!string.IsNullOrEmpty(txtMaterialCode.Text.Trim()))
|
||||
{
|
||||
strSql += " and lib.MaterialCode like @MaterialCode ";
|
||||
listStr.Add(new SqlParameter("@MaterialCode", "%"+txtMaterialCode.Text.Trim() + "%"));
|
||||
}
|
||||
//if (!string.IsNullOrEmpty(txtMaterialCode.Text.Trim()))
|
||||
//{
|
||||
// strSql += " and lib.MaterialCode like @MaterialCode ";
|
||||
// listStr.Add(new SqlParameter("@MaterialCode", "%"+txtMaterialCode.Text.Trim() + "%"));
|
||||
//}
|
||||
listStr.Add(new SqlParameter("@UnitWorkId", unitworkid));
|
||||
SqlParameter[] parameter = listStr.ToArray();
|
||||
DataTable dt = SQLHelper.GetDataTableRunText(strSql, parameter);
|
||||
|
||||
Reference in New Issue
Block a user