diff --git a/.vs/SGGL_SeDin/v17/.wsuo b/.vs/SGGL_SeDin/v17/.wsuo
index 4775c270..77417425 100644
Binary files a/.vs/SGGL_SeDin/v17/.wsuo and b/.vs/SGGL_SeDin/v17/.wsuo differ
diff --git a/DataBase/版本日志/SGGLDB_V2022-11-24.sql b/DataBase/版本日志/SGGLDB_V2022-11-24.sql
new file mode 100644
index 00000000..fa97c725
--- /dev/null
+++ b/DataBase/版本日志/SGGLDB_V2022-11-24.sql
@@ -0,0 +1 @@
+alter table [dbo].[HJGL_MaterialManage] alter column [SpecificationAndModel] nvarchar(1000)
\ No newline at end of file
diff --git a/SGGL/BLL/Common/Funs.cs b/SGGL/BLL/Common/Funs.cs
index 1316fc53..8e8742d7 100644
--- a/SGGL/BLL/Common/Funs.cs
+++ b/SGGL/BLL/Common/Funs.cs
@@ -1022,11 +1022,17 @@ namespace BLL
T entity = new T();
foreach (PropertyInfo p in pArray)
{
+ if (string.IsNullOrEmpty(row[p.Name].ToString()))
+ {
+ p.SetValue(entity, "", null);
+ continue;
+ }
if (row[p.Name] is Int64)
{
p.SetValue(entity, Convert.ToInt32(row[p.Name]), null);
continue;
}
+
p.SetValue(entity, row[p.Name], null);
}
list.Add(entity);
diff --git a/SGGL/BLL/HJGL/PreDesign/HJGL_MaterialService.cs b/SGGL/BLL/HJGL/PreDesign/HJGL_MaterialService.cs
index 4cb51e43..3a270e0b 100644
--- a/SGGL/BLL/HJGL/PreDesign/HJGL_MaterialService.cs
+++ b/SGGL/BLL/HJGL/PreDesign/HJGL_MaterialService.cs
@@ -9,6 +9,22 @@ namespace BLL
{
public class HJGL_MaterialService
{
+ ///
+ /// 工程预制库存
+ ///
+ public static List materialStockItems_SHOP
+ {
+ get;
+ set;
+ }
+ ///
+ /// 现场安装库存
+ ///
+ public static List materialStockItems_FIELD
+ {
+ get;
+ set;
+ }
///
/// 获取材料信息
///
@@ -96,7 +112,6 @@ namespace BLL
mat.MaterialCode,
lib.MaterialName,
lib.MaterialSpec,
- lib.MaterialMade,
lib.MaterialUnit,
sum( mat.Num)+ISNULL( aa.Num,0) as MaterialNum
from HJGL_MaterialManage mat
@@ -125,7 +140,6 @@ namespace BLL
mat.MaterialCode,
lib.MaterialName,
lib.MaterialSpec,
- lib.MaterialMade,
lib.MaterialUnit,
sum( mat.Num)+ISNULL( aa.Num,0) as MaterialNum
from Material_Material mat
@@ -240,12 +254,30 @@ namespace BLL
if (q != null && q.Count() > 0) //判断管线是否有关联材料
{
var pipemodel = BLL.PipelineService.GetPipelineByPipelineId(pipelineid);
- List list = GetMaterialStockItems(projectid, pipemodel.PipeArea);
- if (list != null && list.Count > 0) //判断是否有库存信息
+ List materialStockItems = new List();
+ if (pipemodel.PipeArea==PipelineService.PipeArea_SHOP)
+ {
+ if (HJGL_MaterialService.materialStockItems_SHOP.Count == 0)
+ {
+ HJGL_MaterialService.materialStockItems_SHOP = GetMaterialStockItems(projectid, pipemodel.PipeArea);
+ }
+ materialStockItems = materialStockItems_SHOP;
+ }
+ else if (pipemodel.PipeArea == PipelineService.PipeArea_FIELD)
+ {
+ if(HJGL_MaterialService.materialStockItems_FIELD.Count == 0)
+ {
+ HJGL_MaterialService.materialStockItems_FIELD = GetMaterialStockItems(projectid, pipemodel.PipeArea);
+ }
+ materialStockItems = materialStockItems_FIELD;
+ }
+
+ //List materialStockItems = GetMaterialStockItems(projectid, pipemodel.PipeArea);
+ if (materialStockItems != null && materialStockItems.Count > 0) //判断是否有库存信息
{
foreach (var item in q)
{
- var StockMater = list.Where(x => x.MaterialCode == item.MaterialCode).FirstOrDefault();
+ var StockMater = materialStockItems.Where(x => x.MaterialCode == item.MaterialCode).FirstOrDefault();
if (StockMater != null) //判断该材料是否存在库存
{
var StockNum = StockMater.MaterialNum;
diff --git a/SGGL/BLL/HJGL/WeldingManage/PipelineComponentService.cs b/SGGL/BLL/HJGL/WeldingManage/PipelineComponentService.cs
index bfd3ef12..6aeb6db9 100644
--- a/SGGL/BLL/HJGL/WeldingManage/PipelineComponentService.cs
+++ b/SGGL/BLL/HJGL/WeldingManage/PipelineComponentService.cs
@@ -93,7 +93,7 @@ namespace BLL
{
model.PipelineId = PipelineId;
model.PipelineComponentCode = model_mat.PrefabricatedComponents;
- model.DrawingName = model_mat.PrefabricatedComponents.Substring(0, model_mat.PrefabricatedComponents.LastIndexOf('-'));
+ model.DrawingName = model_mat.PrefabricatedComponents.Substring(0, model_mat.PrefabricatedComponents.LastIndexOf('-')).Replace("\"", "");
model.State = state_0;
UpdatePipelineComponent(model);
}
@@ -103,7 +103,7 @@ namespace BLL
model.PipelineComponentId = SQLHelper.GetNewID();
model.PipelineId = PipelineId;
model.PipelineComponentCode = model_mat.PrefabricatedComponents;
- model.DrawingName = model_mat.PrefabricatedComponents.Substring(0, model_mat.PrefabricatedComponents.LastIndexOf('-'));
+ model.DrawingName = model_mat.PrefabricatedComponents.Substring(0, model_mat.PrefabricatedComponents.LastIndexOf('-')).Replace("\"", "");
model.State = state_0;
AddPipelineComponent(model);
}
diff --git a/SGGL/FineUIPro.Web/HJGL/PreDesign/PrePipelineQRCodeIn.aspx.cs b/SGGL/FineUIPro.Web/HJGL/PreDesign/PrePipelineQRCodeIn.aspx.cs
index ab7bea8c..2335491b 100644
--- a/SGGL/FineUIPro.Web/HJGL/PreDesign/PrePipelineQRCodeIn.aspx.cs
+++ b/SGGL/FineUIPro.Web/HJGL/PreDesign/PrePipelineQRCodeIn.aspx.cs
@@ -150,7 +150,8 @@ namespace FineUIPro.Web.HJGL.PreDesign
{
Model.ResponeData responeData = new Model.ResponeData();
- string result = string.Empty;
+ //string result = string.Empty;
+ List result = new List () ;
int ic, ir;
ic = pds.Columns.Count;
ir = pds.Rows.Count;
@@ -175,39 +176,41 @@ namespace FineUIPro.Web.HJGL.PreDesign
if (string.IsNullOrEmpty(pipelinecode))
{
- result += "第" + (i + 2).ToString() + "行," + "管线号" + "," + "此项为必填项!" + "|";
+ //result += "第" + (i + 2).ToString() + "行," + "管线号" + "," + "此项为必填项!" + "|";
+ result.Add("第" + (i + 2).ToString() + "行," + "管线号" + "," + "此项为必填项!");
}
else
{
pipeline = getPipeline.FirstOrDefault(x => x.PipelineCode == pipelinecode);
if (pipeline == null)
{
- result += "第" + (i + 2).ToString() + "行," + "不存在此管线号" + "|";
-
+ //result += "第" + (i + 2).ToString() + "行," + "不存在此管线号" + "|";
+ result.Add("不存在此管线号-"+ pipelinecode);
continue;
}
}
if (string.IsNullOrEmpty(PipelineComponentCode))
{
- result += "第" + (i + 2).ToString() + "行," + "预制组件" + "," + "此项为必填项!" + "|";
+ //result += "第" + (i + 2).ToString() + "行," + "预制组件" + "," + "此项为必填项!" + "|";
+ result.Add("第" + (i + 2).ToString() + "行," + "预制组件" + "," + "此项为必填项!");
}
else
{
hJGL_Pipeline_Component = HJGL_PipelineComponentService.GetPipelineComponentByCodeandpipelineId(PipelineComponentCode, pipeline.PipelineId);
if (hJGL_Pipeline_Component == null)
{
- result += "第" + (i + 2).ToString() + "行," + "不存在此预制组件 " + PipelineComponentCode + " |";
-
+ //result += "第" + (i + 2).ToString() + "行," + "不存在此预制组件 " + PipelineComponentCode + " |";
+ result.Add("不存在此预制组件-" + PipelineComponentCode);
continue;
}
}
}
- if (!string.IsNullOrEmpty(result))
+ if (result.Count>0)
{
PipelineList.Clear();
- result = result.Substring(0, result.LastIndexOf("|"));
- errorInfos = result;
+ // result = result.Substring(0, result.LastIndexOf("|"));
+ errorInfos = string .Join("|", result.Distinct()) ;
//Alert alert = new Alert();
//alert.Message = result;
//alert.Target = Target.Self;
diff --git a/SGGL/FineUIPro.Web/HJGL/WeldingManage/SelectTaskWeldJoint.aspx b/SGGL/FineUIPro.Web/HJGL/WeldingManage/SelectTaskWeldJoint.aspx
index e7acb6de..84795544 100644
--- a/SGGL/FineUIPro.Web/HJGL/WeldingManage/SelectTaskWeldJoint.aspx
+++ b/SGGL/FineUIPro.Web/HJGL/WeldingManage/SelectTaskWeldJoint.aspx
@@ -36,7 +36,7 @@
diff --git a/SGGL/FineUIPro.Web/HJGL/WeldingManage/SelectTaskWeldJoint.aspx.cs b/SGGL/FineUIPro.Web/HJGL/WeldingManage/SelectTaskWeldJoint.aspx.cs
index 1a992a7e..c2c287c7 100644
--- a/SGGL/FineUIPro.Web/HJGL/WeldingManage/SelectTaskWeldJoint.aspx.cs
+++ b/SGGL/FineUIPro.Web/HJGL/WeldingManage/SelectTaskWeldJoint.aspx.cs
@@ -94,6 +94,9 @@ namespace FineUIPro.Web.HJGL.WeldingManage
{
if (!IsPostBack)
{
+ HJGL_MaterialService.materialStockItems_FIELD = new List();
+ HJGL_MaterialService.materialStockItems_SHOP = new List();
+
this.txtTaskDate.Text = string.Format("{0:yyyy-MM-dd}", DateTime.Now.AddDays(1));
this.txtTaskCode.Text = BLL.WeldTaskService.GetTaskCodeByDate(this.CurrUser.LoginProjectId, this.txtTaskDate.Text);
BLL.Base_WeldingLocationServie.InitWeldingLocationDropDownList(drpWeldingLocation, true);
@@ -161,19 +164,35 @@ namespace FineUIPro.Web.HJGL.WeldingManage
rootNode1.Text = "工厂预制";
rootNode1.CommandName = "工厂预制";
rootNode1.EnableClickEvent = true;
- rootNode1.Selectable = true;
+ rootNode1.EnableExpandEvent = true;
this.tvControlItem.Nodes.Add(rootNode1);
+ int a = (from x in PipelineService.hJGL_Pipelines where x.UnitWorkId == this.UnitWorkId && x.UnitId == this.UnitId && x.PipeArea == PipelineService.PipeArea_SHOP select x).Count();
+ if (a > 0)
+ {
+ // BindNodes(tn1);
+ TreeNode newNode = new TreeNode();
+ newNode.Text = "加载管线...";
+ newNode.NodeID = "加载管线...";
+ rootNode1.Nodes.Add(newNode);
+ }
+
TreeNode rootNode2 = new TreeNode();
rootNode2.NodeID = BLL.PipelineService.PipeArea_FIELD;
rootNode2.Text = "现场安装";
rootNode2.CommandName = "现场安装";
rootNode2.EnableClickEvent = true;
- rootNode2.Expanded = true;
+ rootNode2.EnableExpandEvent = true;
this.tvControlItem.Nodes.Add(rootNode2);
- AddTreeNode(BLL.PipelineService.PipeArea_SHOP, rootNode1);
- AddTreeNode(BLL.PipelineService.PipeArea_FIELD, rootNode2);
-
+ int b = (from x in PipelineService.hJGL_Pipelines where x.UnitWorkId == this.UnitWorkId && x.UnitId == this.UnitId && x.PipeArea == PipelineService.PipeArea_FIELD select x).Count();
+ if (b > 0)
+ {
+ // BindNodes(tn1);
+ TreeNode newNode = new TreeNode();
+ newNode.Text = "加载管线...";
+ newNode.NodeID = "加载管线...";
+ rootNode2.Nodes.Add(newNode);
+ }
//TreeNode rootNode = new TreeNode();
//rootNode.Text = "管线号";
//rootNode.NodeID = "0";
@@ -185,12 +204,12 @@ namespace FineUIPro.Web.HJGL.WeldingManage
}
void AddTreeNode(string PipeArea , TreeNode node )
{
- var iso = (from x in Funs.DB.HJGL_Pipeline where x.UnitWorkId == this.UnitWorkId && x.UnitId == this.UnitId && x.PipeArea == PipeArea orderby x.PipelineCode select x).ToList();
+ var iso = (from x in PipelineService.hJGL_Pipelines where x.UnitWorkId == this.UnitWorkId && x.UnitId == this.UnitId && x.PipeArea == PipeArea orderby x.PipelineCode select x).ToList();
if (!string.IsNullOrEmpty(this.txtPipelineCode.Text))
{
iso = (from x in iso where x.PipelineCode.Contains(this.txtPipelineCode.Text.Trim()) orderby x.PipelineCode select x).ToList();
}
- var joints = from x in Funs.DB.HJGL_WeldJoint where x.ProjectId == this.CurrUser.LoginProjectId select x;
+ var joints = from x in WeldJointService.hJGL_WeldJoints select x;
foreach (var item in iso)
{
TreeNode newNode = new TreeNode();
@@ -208,14 +227,31 @@ namespace FineUIPro.Web.HJGL.WeldingManage
node.Nodes.Add(newNode);
}
}
+ protected void tvControlItem_TreeNodeExpanded(object sender, TreeNodeEventArgs e)
+ {
+ if (e.Node.Nodes[0].NodeID == "加载管线...")
+ {
+ e.Node.Nodes.Clear();
+ if (e.Node.CommandName == "工厂预制")
+ {
+ AddTreeNode(BLL.PipelineService.PipeArea_SHOP, e.Node);
- #endregion
+ }
+ else if (e.Node.CommandName == "现场安装")
+ {
+ AddTreeNode(BLL.PipelineService.PipeArea_FIELD, e.Node);
- #region 数据绑定
- ///
- /// 数据绑定
- ///
- private void BindGrid()
+ }
+ }
+
+ }
+ #endregion
+
+ #region 数据绑定
+ ///
+ /// 数据绑定
+ ///
+ private void BindGrid()
{
string pipelineId = this.tvControlItem.SelectedNodeID;
diff --git a/SGGL/FineUIPro.Web/HJGL/WeldingManage/WeldMatMatch.aspx.cs b/SGGL/FineUIPro.Web/HJGL/WeldingManage/WeldMatMatch.aspx.cs
index 8e666f44..f0b7359d 100644
--- a/SGGL/FineUIPro.Web/HJGL/WeldingManage/WeldMatMatch.aspx.cs
+++ b/SGGL/FineUIPro.Web/HJGL/WeldingManage/WeldMatMatch.aspx.cs
@@ -37,6 +37,9 @@ namespace FineUIPro.Web.HJGL.WeldingManage
if (!IsPostBack)
{
PipeArea = Request.Params["PipeArea"];
+ HJGL_MaterialService.materialStockItems_FIELD = new List();
+ HJGL_MaterialService.materialStockItems_SHOP = new List();
+
this.InitTreeMenu();//加载树
}
}
@@ -159,6 +162,7 @@ namespace FineUIPro.Web.HJGL.WeldingManage
{
pipeline= pipeline.Where(x => x.PipelineCode.Contains(txtPipelineCode.Text.Trim())).ToList();
}
+
foreach (var item in pipeline)
{
//var jotCount = (from x in Funs.DB.HJGL_WeldJoint where x.PipelineId == item.PipelineId && x.IsTwoJoint == null select x).Count();