2022-09-05 16:36:31 +08:00
|
|
|
|
using System.Linq;
|
|
|
|
|
|
|
|
|
|
|
|
namespace BLL
|
|
|
|
|
|
{
|
|
|
|
|
|
public static class Project_SysSetService
|
|
|
|
|
|
{
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// 获取avevanet 地址
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
/// <returns></returns>
|
|
|
|
|
|
public static string GetAvevaNetUrl(string projectId)
|
|
|
|
|
|
{
|
|
|
|
|
|
var q = from x in Funs.DB.Project_Sys_Set where x.SetId == "9" && x.ProjectId == projectId select x;
|
|
|
|
|
|
if (q.Count() == 0)
|
|
|
|
|
|
{
|
|
|
|
|
|
return "";
|
|
|
|
|
|
}
|
|
|
|
|
|
return q.First().SetValue;
|
|
|
|
|
|
}
|
|
|
|
|
|
public static Model.ColorModel GetColorModel(string projectId)
|
|
|
|
|
|
{
|
|
|
|
|
|
Model.ColorModel colorModel = new Model.ColorModel();
|
|
|
|
|
|
|
|
|
|
|
|
Model.Project_Sys_Set Model_PipelineNOComplete = BLL.Project_SysSetService.GetSysSetBySetName("管线未完成", projectId);
|
|
|
|
|
|
if (Model_PipelineNOComplete != null)
|
|
|
|
|
|
{
|
|
|
|
|
|
colorModel.PipelineNOComplete = Model_PipelineNOComplete.SetValue;
|
|
|
|
|
|
}
|
|
|
|
|
|
Model.Project_Sys_Set Model_PipelineComplete = BLL.Project_SysSetService.GetSysSetBySetName("管线已完成", projectId);
|
|
|
|
|
|
if (Model_PipelineComplete != null)
|
|
|
|
|
|
{
|
|
|
|
|
|
colorModel.PipelineComplete = Model_PipelineComplete.SetValue;
|
|
|
|
|
|
}
|
|
|
|
|
|
Model.Project_Sys_Set Model_JointNOCompleteColor = BLL.Project_SysSetService.GetSysSetBySetName("焊口未完成", projectId);
|
|
|
|
|
|
if (Model_JointNOCompleteColor != null)
|
|
|
|
|
|
{
|
|
|
|
|
|
colorModel.JointNOCompleteColor = Model_JointNOCompleteColor.SetValue;
|
|
|
|
|
|
}
|
|
|
|
|
|
Model.Project_Sys_Set Model_JointCompleteColor = BLL.Project_SysSetService.GetSysSetBySetName("焊口已完成", projectId);
|
|
|
|
|
|
if (Model_JointCompleteColor != null)
|
|
|
|
|
|
{
|
2022-10-12 19:17:42 +08:00
|
|
|
|
colorModel.JointCompleteColor = Model_JointCompleteColor.SetValue;
|
2022-09-05 16:36:31 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
return colorModel;
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
public static bool? IsAuto(string setId, string projectId)
|
|
|
|
|
|
{
|
|
|
|
|
|
var q = from x in Funs.DB.Project_Sys_Set where x.SetId == setId && x.ProjectId == projectId select x;
|
|
|
|
|
|
return q.First().IsAuto;
|
|
|
|
|
|
}
|
|
|
|
|
|
public static Model.Project_Sys_Set GetSysSetBySetId(string setId, string projectId)
|
|
|
|
|
|
{
|
|
|
|
|
|
return Funs.DB.Project_Sys_Set.Where(x => x.SetId == setId && x.ProjectId == projectId).FirstOrDefault();
|
|
|
|
|
|
}
|
|
|
|
|
|
public static Model.Project_Sys_Set GetSysSetBySetName(string setName, string projectId)
|
|
|
|
|
|
{
|
|
|
|
|
|
return Funs.DB.Project_Sys_Set.Where(x => x.SetName == setName && x.ProjectId == projectId).FirstOrDefault();
|
|
|
|
|
|
}
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// 增加系统变量
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
/// <param name="user">系统变量</param>
|
|
|
|
|
|
public static void AddSet(Model.Project_Sys_Set set)
|
|
|
|
|
|
{
|
|
|
|
|
|
Model.SGGLDB db = Funs.DB;
|
|
|
|
|
|
Model.Project_Sys_Set newSet = new Model.Project_Sys_Set();
|
|
|
|
|
|
newSet.SetId = set.SetId;
|
|
|
|
|
|
newSet.ProjectId = set.ProjectId;
|
|
|
|
|
|
newSet.SetName = set.SetName;
|
|
|
|
|
|
newSet.IsAuto = set.IsAuto;
|
|
|
|
|
|
newSet.SetValue = set.SetValue;
|
|
|
|
|
|
|
|
|
|
|
|
db.Project_Sys_Set.InsertOnSubmit(newSet);
|
|
|
|
|
|
db.SubmitChanges();
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// 修改系统变量
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
/// <param name="user">系统变量</param>
|
|
|
|
|
|
public static void UpdateSet(Model.Project_Sys_Set set)
|
|
|
|
|
|
{
|
|
|
|
|
|
Model.SGGLDB db = Funs.DB;
|
|
|
|
|
|
Model.Project_Sys_Set newSet = db.Project_Sys_Set.FirstOrDefault(e => e.SetId == set.SetId && e.ProjectId == set.ProjectId);
|
|
|
|
|
|
if (newSet != null)
|
|
|
|
|
|
{
|
|
|
|
|
|
newSet.IsAuto = set.IsAuto;
|
|
|
|
|
|
newSet.SetValue = set.SetValue;
|
|
|
|
|
|
db.SubmitChanges();
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public static void InsertHjglInit(string projectId)
|
|
|
|
|
|
{
|
|
|
|
|
|
for (int i = 1; i <= 5; i++)
|
|
|
|
|
|
{
|
|
|
|
|
|
Model.Project_Sys_Set newSet = new Model.Project_Sys_Set();
|
|
|
|
|
|
newSet.SetId = i.ToString();
|
|
|
|
|
|
newSet.ProjectId = projectId;
|
|
|
|
|
|
|
|
|
|
|
|
if (i == 1)
|
|
|
|
|
|
{
|
|
|
|
|
|
newSet.SetName = "焊接日报编号";
|
|
|
|
|
|
newSet.IsAuto = true;
|
|
|
|
|
|
}
|
|
|
|
|
|
if (i == 2)
|
|
|
|
|
|
{
|
|
|
|
|
|
newSet.SetName = "点口编号";
|
|
|
|
|
|
newSet.IsAuto = true;
|
|
|
|
|
|
}
|
|
|
|
|
|
if (i == 3)
|
|
|
|
|
|
{
|
|
|
|
|
|
newSet.SetName = "无损检测委托单";
|
|
|
|
|
|
newSet.IsAuto = true;
|
|
|
|
|
|
}
|
|
|
|
|
|
if (i == 4)
|
|
|
|
|
|
{
|
|
|
|
|
|
newSet.SetName = "引用PDMS导出模板";
|
|
|
|
|
|
newSet.IsAuto = false;
|
|
|
|
|
|
}
|
|
|
|
|
|
if (i == 5)
|
|
|
|
|
|
{
|
|
|
|
|
|
newSet.SetName = "组批条件设置";
|
|
|
|
|
|
newSet.SetValue = "1";
|
|
|
|
|
|
newSet.SetValue = "1|2|3|4|5";
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
AddSet(newSet);
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|