Merge branch 'master' of https://gitee.com/frane-yang/SGGL_SeDin_New
This commit is contained in:
@@ -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);
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
namespace BLL
|
||||
{
|
||||
using Model;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
public static class MaterialCodeLibService
|
||||
{
|
||||
@@ -12,7 +13,11 @@
|
||||
{
|
||||
return Funs.DB.HJGL_MaterialCodeLib.FirstOrDefault(e => e.MaterialCode == materialCode);
|
||||
}
|
||||
|
||||
public static List<Model.HJGL_MaterialCodeLib> GetMaterialCodeLibList()
|
||||
{
|
||||
var q = (from x in Funs.DB.HJGL_MaterialCodeLib select x).ToList();
|
||||
return q;
|
||||
}
|
||||
/// <summary>
|
||||
/// 增加材料库信息
|
||||
/// </summary>
|
||||
@@ -34,7 +39,12 @@
|
||||
db.HJGL_MaterialCodeLib.InsertOnSubmit(newCodeLib);
|
||||
db.SubmitChanges();
|
||||
}
|
||||
|
||||
public static void AddBulkMaterialCodeLib(List<Model.HJGL_MaterialCodeLib> codeLib)
|
||||
{
|
||||
Model.SGGLDB db = Funs.DB;
|
||||
db.HJGL_MaterialCodeLib.InsertAllOnSubmit(codeLib);
|
||||
db.SubmitChanges();
|
||||
}
|
||||
/// <summary>
|
||||
/// 修改材料库信息
|
||||
/// </summary>
|
||||
|
||||
@@ -9,6 +9,22 @@ namespace BLL
|
||||
{
|
||||
public class HJGL_MaterialService
|
||||
{
|
||||
/// <summary>
|
||||
/// 工程预制库存
|
||||
/// </summary>
|
||||
public static List<Model.MaterialStockItem> materialStockItems_SHOP
|
||||
{
|
||||
get;
|
||||
set;
|
||||
}
|
||||
/// <summary>
|
||||
/// 现场安装库存
|
||||
/// </summary>
|
||||
public static List<Model.MaterialStockItem> materialStockItems_FIELD
|
||||
{
|
||||
get;
|
||||
set;
|
||||
}
|
||||
/// <summary>
|
||||
/// 获取材料信息
|
||||
/// </summary>
|
||||
@@ -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<Model.MaterialStockItem> list = GetMaterialStockItems(projectid, pipemodel.PipeArea);
|
||||
if (list != null && list.Count > 0) //判断是否有库存信息
|
||||
List<Model.MaterialStockItem> materialStockItems = new List<Model.MaterialStockItem>();
|
||||
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<Model.MaterialStockItem> 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;
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
@@ -24,7 +24,13 @@ namespace BLL
|
||||
/// 现场安装
|
||||
/// </summary>
|
||||
public const string PipeArea_FIELD = "2";
|
||||
|
||||
public static List<Model.HJGL_Pipeline> hJGL_Pipelines
|
||||
{
|
||||
|
||||
get;
|
||||
set;
|
||||
|
||||
}
|
||||
/// <summary>
|
||||
/// 实际日期类型
|
||||
/// </summary>
|
||||
@@ -54,7 +60,11 @@ namespace BLL
|
||||
list[1] = new ListItem("现场安装", PipeArea_FIELD);
|
||||
return list;
|
||||
}
|
||||
|
||||
public static void RestPipelineAndJoints(string projectid )
|
||||
{
|
||||
PipelineService.hJGL_Pipelines = PipelineService.GetPipelinesByProjectId(projectid);
|
||||
WeldJointService.hJGL_WeldJoints = WeldJointService.GetWeldJointByProjectid(projectid);
|
||||
}
|
||||
/// <summary>
|
||||
/// 根据管线ID获取管线信息
|
||||
/// </summary>
|
||||
@@ -65,11 +75,7 @@ namespace BLL
|
||||
return Funs.DB.HJGL_Pipeline.FirstOrDefault(e => e.PipelineId == pipelineId);
|
||||
}
|
||||
public static void GetStateByPipelineId(string pipelineId)
|
||||
{//< f:ListItem Value = "0" Text = "未开始" />
|
||||
// < f:ListItem Value = "1" Text = "未开始且延误" />
|
||||
// < f:ListItem Value = "2" Text = "开始" />
|
||||
// < f:ListItem Value = "3" Text = "已开始且延误" />
|
||||
// < f:ListItem Value = "4" Text = "完成" />
|
||||
{
|
||||
var mdoel = GetPipelineByPipelineId(pipelineId);
|
||||
var PlanStartDate = mdoel.PlanStartDate;
|
||||
var PlanEndDate = mdoel.PlanEndDate;
|
||||
@@ -161,18 +167,18 @@ namespace BLL
|
||||
{
|
||||
return Funs.DB.HJGL_Pipeline.FirstOrDefault(e => e.PipelineCode == pipelineCode);
|
||||
}
|
||||
public static List<View_HJGL_Pipeline> GetView_HJGL_Pipelines(View_HJGL_Pipeline model)
|
||||
public static List<HJGL_Pipeline> GetView_HJGL_Pipelines(HJGL_Pipeline model)
|
||||
{
|
||||
var db = Funs.DB;
|
||||
var pipelineList =( from x in db.View_HJGL_Pipeline
|
||||
where
|
||||
var pipelineList =( from x in hJGL_Pipelines
|
||||
where
|
||||
(string.IsNullOrEmpty(model.ProjectId) || x.ProjectId.Contains(model.ProjectId))
|
||||
&& (string.IsNullOrEmpty(model.UnitWorkId) || x.UnitWorkId.Contains(model.UnitWorkId))
|
||||
&& (string.IsNullOrEmpty(model.PipelineCode) || x.PipelineCode.Contains(model.PipelineCode))
|
||||
&& (string.IsNullOrEmpty(model.SingleName) || x.SingleName.Contains(model.SingleName))
|
||||
&& (string.IsNullOrEmpty(model.DesignPress) || x.DesignPress.Contains(model.DesignPress))
|
||||
&& (string.IsNullOrEmpty(model.MaterialCode) || x.MaterialCode.Contains(model.MaterialCode))
|
||||
select x).ToList();
|
||||
/* && (string.IsNullOrEmpty(model.MaterialCode) || x.MaterialCode.Contains(model.MaterialCode))*/
|
||||
select x).ToList();
|
||||
if (model.IsFinished!=null)
|
||||
{
|
||||
if (model.IsFinished==true)
|
||||
@@ -200,6 +206,17 @@ namespace BLL
|
||||
return q;
|
||||
}
|
||||
/// <summary>
|
||||
/// 根据项目获取所有管线
|
||||
/// </summary>
|
||||
/// <param name="ProjectId"></param>
|
||||
/// <returns></returns>
|
||||
public static List<Model.HJGL_Pipeline> GetPipelinesByProjectId(string ProjectId)
|
||||
{
|
||||
|
||||
var q = Funs.DB.HJGL_Pipeline.Where(e => e.ProjectId == ProjectId).ToList();
|
||||
return q;
|
||||
}
|
||||
/// <summary>
|
||||
/// 根据管线ID获取管线信息
|
||||
/// </summary>
|
||||
/// <param name="pipelineName"></param>
|
||||
@@ -385,10 +402,28 @@ namespace BLL
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 添加作业管线
|
||||
/// </summary>
|
||||
/// <param name="pipeline"></param>
|
||||
public static bool IsExistPipelineCode(string pipelineCode, string unitWorkId)
|
||||
{
|
||||
Model.SGGLDB db = Funs.DB;
|
||||
Model.HJGL_Pipeline q = null;
|
||||
q = Funs.DB.HJGL_Pipeline.FirstOrDefault(x => x.PipelineCode == pipelineCode && x.UnitWorkId == unitWorkId);
|
||||
if (q != null)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
else
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
public static HJGL_Pipeline GetPipelineByCode(string pipelineCode, string unitWorkId)
|
||||
{
|
||||
Model.SGGLDB db = Funs.DB;
|
||||
Model.HJGL_Pipeline q = null;
|
||||
q = Funs.DB.HJGL_Pipeline.FirstOrDefault(x => x.PipelineCode == pipelineCode && x.UnitWorkId == unitWorkId);
|
||||
return q;
|
||||
}
|
||||
|
||||
public static void AddPipeline(Model.HJGL_Pipeline pipeline)
|
||||
{
|
||||
Model.SGGLDB db = Funs.DB;
|
||||
|
||||
@@ -1,11 +1,21 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Threading;
|
||||
using System.Threading.Tasks;
|
||||
using System.Web;
|
||||
|
||||
namespace BLL
|
||||
{
|
||||
public static class WeldJointService
|
||||
{
|
||||
public static List<Model.HJGL_WeldJoint> hJGL_WeldJoints
|
||||
{
|
||||
|
||||
get;
|
||||
set;
|
||||
|
||||
}
|
||||
/// <summary>
|
||||
/// 根据焊口Id获取焊口信息
|
||||
/// </summary>
|
||||
@@ -59,6 +69,15 @@ namespace BLL
|
||||
var q = (from x in Funs.DB.HJGL_WeldJoint where x.PipelineId == PipelineId select x).ToList();
|
||||
return q;
|
||||
}
|
||||
|
||||
public static Model.HJGL_WeldJoint GetWeldJointsByWeldJointCode(string PipelineId, string WeldJointCode)
|
||||
{
|
||||
var q=(from x in Funs.DB.HJGL_WeldJoint where x.PipelineId==PipelineId && x.WeldJointCode==WeldJointCode select x ).FirstOrDefault();
|
||||
|
||||
return q;
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 添加
|
||||
/// </summary>
|
||||
@@ -312,6 +331,26 @@ namespace BLL
|
||||
Model.SGGLDB db = Funs.DB;
|
||||
return db.View_HJGL_WeldJoint.FirstOrDefault(e => e.WeldJointId == weldJointId);
|
||||
}
|
||||
public static List<Model.HJGL_WeldJoint> GetWeldJointByUnitworkId(string UnitWorkId)
|
||||
{
|
||||
Model.SGGLDB db = Funs.DB;
|
||||
var q = (from x in db.HJGL_WeldJoint
|
||||
join y in db.HJGL_Pipeline on x.PipelineId equals y.PipelineId into tt
|
||||
from g in tt.DefaultIfEmpty()
|
||||
where g.UnitWorkId == UnitWorkId
|
||||
select x).ToList();
|
||||
|
||||
return q;
|
||||
}
|
||||
public static List<Model.HJGL_WeldJoint> GetWeldJointByProjectid(string ProjectId)
|
||||
{
|
||||
Model.SGGLDB db = Funs.DB;
|
||||
|
||||
var q = (from x in db.HJGL_WeldJoint
|
||||
where x.ProjectId == ProjectId
|
||||
select x).ToList();
|
||||
return q;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 根据焊口Id获取插入焊口数
|
||||
|
||||
Reference in New Issue
Block a user