20240305 开车HSE管理
This commit is contained in:
@@ -772,6 +772,8 @@
|
||||
<Compile Include="TestRun\ProduceTestRun\TestRunPumpCheckService.cs" />
|
||||
<Compile Include="TestRun\ProduceTestRun\TestRunRecordService.cs" />
|
||||
<Compile Include="TestRun\ProduceTestRun\TestRunReportService.cs" />
|
||||
<Compile Include="TestRun\TestRunConstructSolutionApproveService.cs" />
|
||||
<Compile Include="TestRun\TestRunConstructSolutionService.cs" />
|
||||
<Compile Include="TestRun\TestRunService.cs" />
|
||||
<Compile Include="BoSheng\BOSHENGMonitorService.cs" />
|
||||
<Compile Include="Transfer\PipingService.cs" />
|
||||
|
||||
@@ -4779,6 +4779,30 @@ namespace BLL
|
||||
/// 流程闭环
|
||||
/// </summary>
|
||||
public static string DriverRun_Complete = "6";
|
||||
#endregion
|
||||
|
||||
#region 开车方案流程定义
|
||||
|
||||
/// <summary>
|
||||
/// 重报
|
||||
/// </summary>
|
||||
public const string TestRunConstructSolution_ReCompile = "0";
|
||||
|
||||
/// <summary>
|
||||
/// 编制
|
||||
/// </summary>
|
||||
public static string TestRunConstructSolution_Compile = "1";
|
||||
|
||||
/// <summary>
|
||||
/// 会签
|
||||
/// </summary>
|
||||
public static string TestRunConstructSolution_Audit = "2";
|
||||
|
||||
/// <summary>
|
||||
/// 审批完成
|
||||
/// </summary>
|
||||
public static string TestRunConstructSolution_Complete = "3";
|
||||
|
||||
#endregion
|
||||
#endregion
|
||||
|
||||
@@ -5238,7 +5262,7 @@ namespace BLL
|
||||
/// <summary>
|
||||
/// 开车方案管理
|
||||
/// </summary>
|
||||
public const string DriverSchemeMenuId = "CAA63693-5D41-4018-9FF7-AAB311E6D8E0";
|
||||
public const string TestRunConstructSolutionMenuId = "CAA63693-5D41-4018-9FF7-AAB311E6D8E0";
|
||||
|
||||
/// <summary>
|
||||
/// 开车进度管理
|
||||
|
||||
@@ -49,6 +49,32 @@ namespace BLL
|
||||
Funs.DB.SubmitChanges();
|
||||
}
|
||||
|
||||
public static void AddDriverRunForApi(Model.DriverRun_DriverRun driverRun)
|
||||
{
|
||||
using (Model.SGGLDB db = new Model.SGGLDB(Funs.ConnString))
|
||||
{
|
||||
Model.DriverRun_DriverRun newDriverRun = new Model.DriverRun_DriverRun();
|
||||
newDriverRun.DriverRunId = driverRun.DriverRunId;
|
||||
newDriverRun.ProjectId = driverRun.ProjectId;
|
||||
newDriverRun.Code = driverRun.Code;
|
||||
newDriverRun.UnitId = driverRun.UnitId;
|
||||
newDriverRun.Implement = driverRun.Implement;
|
||||
newDriverRun.Descriptions = driverRun.Descriptions;
|
||||
newDriverRun.InstallationId = driverRun.InstallationId;
|
||||
newDriverRun.InstallationNames = driverRun.InstallationNames;
|
||||
newDriverRun.Objective = driverRun.Objective;
|
||||
newDriverRun.NeedCompletedDate = driverRun.NeedCompletedDate;
|
||||
newDriverRun.CompileMan = driverRun.CompileMan;
|
||||
newDriverRun.CompileDate = driverRun.CompileDate;
|
||||
newDriverRun.AttachUrl = driverRun.AttachUrl;
|
||||
newDriverRun.Remark = driverRun.Remark;
|
||||
newDriverRun.State = driverRun.State;
|
||||
|
||||
db.DriverRun_DriverRun.InsertOnSubmit(newDriverRun);
|
||||
db.SubmitChanges();
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 修改开车保运管理
|
||||
/// </summary>
|
||||
|
||||
@@ -0,0 +1,488 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace BLL
|
||||
{
|
||||
public class TestRunConstructSolutionApproveService
|
||||
{
|
||||
public static Model.Solution_TestRunConstructSolutionApprove GetSee(string ConstructSolutionId, string userId)
|
||||
{
|
||||
Model.SGGLDB db = Funs.DB;
|
||||
return db.Solution_TestRunConstructSolutionApprove.FirstOrDefault(x => x.ConstructSolutionId == ConstructSolutionId && x.ApproveType == "S" && x.ApproveMan == userId && x.ApproveDate == null);
|
||||
}
|
||||
|
||||
public static void See(string ConstructSolutionId, string userId)
|
||||
{
|
||||
using (var db = new Model.SGGLDB(Funs.ConnString))
|
||||
{
|
||||
var res = db.Solution_TestRunConstructSolutionApprove.FirstOrDefault(x => x.ConstructSolutionId == ConstructSolutionId && x.ApproveType == "S" && x.ApproveMan == userId && x.ApproveDate == null);
|
||||
if (res != null)
|
||||
{
|
||||
res.ApproveDate = DateTime.Now;
|
||||
db.SubmitChanges();
|
||||
}
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// 根据施工方案发布Id获取对应组会签人id集合信息
|
||||
/// </summary>
|
||||
/// <param name="ConstructSolutionCode">施工方案发布Id</param>
|
||||
/// <returns>施工方案审批集合</returns>
|
||||
public static List<string> GetUserIdsApprovesBySignType(string ConstructSolutionId, string signType)
|
||||
{
|
||||
var edtion = GetUserIdsApprovesBySignTypeEditon(ConstructSolutionId);
|
||||
return (from x in Funs.DB.Solution_TestRunConstructSolutionApprove where x.ConstructSolutionId == ConstructSolutionId && x.ApproveType != "S" && x.SignType == signType && x.Edition == edtion select x.ApproveMan).ToList();
|
||||
}
|
||||
|
||||
public static int? GetUserIdsApprovesBySignTypeEditon(string ConstructSolutionId)
|
||||
{
|
||||
int edition = 0;
|
||||
var solution = Funs.DB.Solution_TestRunConstructSolution.FirstOrDefault(p => p.ConstructSolutionId == ConstructSolutionId);
|
||||
if (solution != null)
|
||||
{
|
||||
edition = Convert.ToInt32(solution.Edition);
|
||||
}
|
||||
return edition;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 修改施工方案审批信息
|
||||
/// </summary>
|
||||
/// <param name="managerRuleApprove">施工方案审批实体</param>
|
||||
public static void UpdateConstructSolutionApprove(Model.Solution_TestRunConstructSolutionApprove approve)
|
||||
{
|
||||
Model.SGGLDB db = Funs.DB;
|
||||
Model.Solution_TestRunConstructSolutionApprove newApprove = db.Solution_TestRunConstructSolutionApprove.First(e => e.ConstructSolutionApproveId == approve.ConstructSolutionApproveId && e.ApproveDate == null);
|
||||
newApprove.ConstructSolutionId = approve.ConstructSolutionId;
|
||||
newApprove.ApproveMan = approve.ApproveMan;
|
||||
newApprove.ApproveDate = approve.ApproveDate;
|
||||
newApprove.ApproveIdea = approve.ApproveIdea;
|
||||
newApprove.IsAgree = approve.IsAgree;
|
||||
newApprove.ApproveType = approve.ApproveType;
|
||||
newApprove.Edition = approve.Edition;
|
||||
newApprove.Order = approve.Order;
|
||||
db.SubmitChanges();
|
||||
}
|
||||
/// <summary>
|
||||
/// 根据施工方案发布Id获取所以对应施工方案审批信息(查询全部会签状态)
|
||||
/// </summary>
|
||||
/// <param name="ConstructSolutionCode">施工方案发布Id</param>
|
||||
/// <returns>施工方案审批集合</returns>
|
||||
public static List<Model.Solution_TestRunConstructSolutionApprove> GetHandleConstructSolutionApprovesByConstructSolutionId(string ConstructSolutionId, int edition)
|
||||
{
|
||||
var list = Funs.DB.Solution_TestRunConstructSolutionApprove.Where(p => p.ConstructSolutionId == ConstructSolutionId && p.ApproveType == Const.TestRunConstructSolution_Audit && p.Edition == edition).ToList();
|
||||
return list;
|
||||
|
||||
}
|
||||
|
||||
public static List<Model.Solution_TestRunConstructSolutionApprove> GetHandleConstruct(string ConstructSolutionId, int edition)
|
||||
{
|
||||
var list = Funs.DB.Solution_TestRunConstructSolutionApprove.Where(p => p.ConstructSolutionId == ConstructSolutionId && p.ApproveType != "S" && p.ApproveDate != null && p.Edition == edition).ToList();
|
||||
return list;
|
||||
|
||||
}
|
||||
/// <summary>
|
||||
/// 根据施工方案发布Id获取所以对应施工方案审批信息
|
||||
/// </summary>
|
||||
/// <param name="ConstructSolutionCode">施工方案发布Id</param>
|
||||
/// <returns>施工方案审批集合</returns>
|
||||
public static List<Model.Solution_TestRunConstructSolutionApprove> GetConstructSolutionApprovesByConstructSolutionId(string ConstructSolutionId, string state)
|
||||
{
|
||||
Model.SGGLDB db = Funs.DB;
|
||||
var reDate = (from x in db.Solution_TestRunConstructSolutionApprove where x.ConstructSolutionId == ConstructSolutionId && x.ApproveType == BLL.Const.TestRunConstructSolution_ReCompile orderby x.ApproveDate descending select x.ApproveDate).FirstOrDefault();
|
||||
if (reDate == null)
|
||||
{
|
||||
return (from x in db.Solution_TestRunConstructSolutionApprove where x.ConstructSolutionId == ConstructSolutionId && x.ApproveType == state select x).ToList();
|
||||
}
|
||||
else
|
||||
{
|
||||
return (from x in db.Solution_TestRunConstructSolutionApprove where x.ConstructSolutionId == ConstructSolutionId && x.ApproveType == state && (x.ApproveDate == null || x.ApproveDate > reDate) select x).ToList();
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 获取施工方案模板列表
|
||||
/// </summary>
|
||||
/// <param name="satartRowIndex"></param>
|
||||
/// <param name="maximumRows"></param>
|
||||
/// <returns></returns>
|
||||
public static IList<Model.Solution_TestRunConstructSolutionApprove> getListData(string ConstructSolutionId)
|
||||
{
|
||||
Model.SGGLDB db = Funs.DB;
|
||||
var res = from x in db.Solution_TestRunConstructSolutionApprove
|
||||
where x.ConstructSolutionId == ConstructSolutionId && x.ApproveDate != null && x.ApproveType != "S"
|
||||
orderby x.ApproveDate
|
||||
select x;
|
||||
|
||||
//select new
|
||||
//{
|
||||
// x.ConstructSolutionApproveId,
|
||||
// x.ConstructSolutionId,
|
||||
// x.ApproveMan,
|
||||
// x.ApproveDate,
|
||||
// x.IsAgree,
|
||||
// x.ApproveIdea,
|
||||
// x.ApproveType,
|
||||
// x.SignType,
|
||||
// //= x.IsAgree == true ? "是" : "否",
|
||||
//};
|
||||
return res.ToList();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 获取未代办的记录数量
|
||||
/// </summary>
|
||||
/// <param name="satartRowIndex"></param>
|
||||
/// <param name="maximumRows"></param>
|
||||
/// <returns></returns>
|
||||
public static int getListSolutionApproveCount(string constructSolutionId, string man, string signType)
|
||||
{
|
||||
|
||||
var res = (from x in Funs.DB.Solution_TestRunConstructSolutionApprove
|
||||
where x.ConstructSolutionId == constructSolutionId && x.ApproveDate == null && x.ApproveType != "S" && x.ApproveMan.Equals(man) && x.SignType == signType
|
||||
orderby x.ApproveDate
|
||||
select x).Count();
|
||||
return res;
|
||||
}
|
||||
public static IList<Model.Solution_TestRunConstructSolutionApprove> getListSolutionApprove(string constructSolutionId, string man)
|
||||
{
|
||||
|
||||
var res = (from x in Funs.DB.Solution_TestRunConstructSolutionApprove
|
||||
where x.ConstructSolutionId == constructSolutionId && x.ApproveDate == null && x.ApproveType != "S" && x.ApproveMan.Equals(man)
|
||||
orderby x.ApproveDate
|
||||
select x).ToList();
|
||||
return res;
|
||||
}
|
||||
/// <summary>
|
||||
/// 删除未代办的记录
|
||||
/// </summary>
|
||||
/// <param name="ConstructSolutionId"></param>
|
||||
public static void delSolutionApprove(string constructSolutionId, string man)
|
||||
{
|
||||
Model.SGGLDB db = Funs.DB;
|
||||
var q = (from x in Funs.DB.Solution_TestRunConstructSolutionApprove where x.ConstructSolutionId == constructSolutionId && x.ApproveType != "S" && x.ApproveMan.Equals(man) && x.ApproveDate == null select x).ToList();
|
||||
db.Solution_TestRunConstructSolutionApprove.DeleteAllOnSubmit(q);
|
||||
db.SubmitChanges();
|
||||
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 根据施工方案编号删除对应的所有施工方案审批信息
|
||||
/// </summary>
|
||||
/// <param name="ConstructSolutionCode">施工方案编号</param>
|
||||
public static void DeleteConstructSolutionApprovesByConstructSolutionId(string ConstructSolutionId)
|
||||
{
|
||||
Model.SGGLDB db = Funs.DB;
|
||||
var q = (from x in Funs.DB.Solution_TestRunConstructSolutionApprove where x.ConstructSolutionId == ConstructSolutionId select x).ToList();
|
||||
db.Solution_TestRunConstructSolutionApprove.DeleteAllOnSubmit(q);
|
||||
db.SubmitChanges();
|
||||
}
|
||||
/// <summary>
|
||||
/// 根据施工方案编号获取一个施工方案审批信息
|
||||
/// </summary>
|
||||
/// <param name="ConstructSolutionCode">施工方案编号</param>
|
||||
/// <returns>一个施工方案审批实体</returns>
|
||||
public static Model.Solution_TestRunConstructSolutionApprove GetConstructSolutionApproveByApproveMan(string ConstructSolutionId, string approveMan)
|
||||
{
|
||||
|
||||
return Funs.DB.Solution_TestRunConstructSolutionApprove.FirstOrDefault(x => x.ConstructSolutionId == ConstructSolutionId && x.ApproveMan == approveMan && x.ApproveType != "S" && x.ApproveDate == null);
|
||||
}
|
||||
public static Model.Solution_TestRunConstructSolutionApprove GetConstructSoluAppByApproveMan(string ConstructSolutionId, string approveMan, int edtion)
|
||||
{
|
||||
|
||||
return Funs.DB.Solution_TestRunConstructSolutionApprove.FirstOrDefault(x => x.ConstructSolutionId == ConstructSolutionId && x.Edition == edtion && x.ApproveMan == approveMan && x.ApproveType != "S" && x.ApproveDate == null);
|
||||
}
|
||||
|
||||
public static Model.Solution_TestRunConstructSolutionApprove GetConstructSolApproveByApproveMan(string ConstructSolutionId, string approveMan)
|
||||
{
|
||||
return Funs.DB.Solution_TestRunConstructSolutionApprove.FirstOrDefault(x => x.ConstructSolutionId == ConstructSolutionId && x.ApproveMan == approveMan && x.ApproveType != "S" && x.ApproveDate == null);
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 增加施工方案审批信息
|
||||
/// </summary>
|
||||
/// <param name="managerRuleApprove">施工方案审批实体</param>
|
||||
public static void AddConstructSolutionApprove(Model.Solution_TestRunConstructSolutionApprove approve)
|
||||
{
|
||||
var db = Funs.DB;
|
||||
Model.Solution_TestRunConstructSolutionApprove newApprove = new Model.Solution_TestRunConstructSolutionApprove();
|
||||
if (string.IsNullOrWhiteSpace(approve.ConstructSolutionApproveId))
|
||||
{
|
||||
newApprove.ConstructSolutionApproveId = SQLHelper.GetNewID(typeof(Model.Solution_TestRunConstructSolutionApprove));
|
||||
}
|
||||
else
|
||||
{
|
||||
newApprove.ConstructSolutionApproveId = approve.ConstructSolutionApproveId;
|
||||
}
|
||||
newApprove.ConstructSolutionId = approve.ConstructSolutionId;
|
||||
newApprove.ApproveMan = approve.ApproveMan;
|
||||
newApprove.ApproveDate = approve.ApproveDate;
|
||||
newApprove.ApproveIdea = approve.ApproveIdea;
|
||||
newApprove.IsAgree = approve.IsAgree;
|
||||
newApprove.ApproveType = approve.ApproveType;
|
||||
newApprove.SignType = approve.SignType;
|
||||
newApprove.Edition = approve.Edition;
|
||||
newApprove.Order = GetMaxOrderByConstructSolutionId(approve.ConstructSolutionId);
|
||||
db.Solution_TestRunConstructSolutionApprove.InsertOnSubmit(newApprove);
|
||||
db.SubmitChanges();
|
||||
}
|
||||
|
||||
public static int GetMaxOrderByConstructSolutionId(string constructSolutionId)
|
||||
{
|
||||
int order = 0;
|
||||
var q = (from x in Funs.DB.Solution_TestRunConstructSolutionApprove
|
||||
where x.ConstructSolutionId == constructSolutionId
|
||||
select x).ToList().Count();
|
||||
order = q + 1;
|
||||
return order;
|
||||
}
|
||||
/// <summary>
|
||||
/// 获取当前办理人
|
||||
/// </summary>
|
||||
/// <param name="constructSolutionId"></param>
|
||||
/// <returns></returns>
|
||||
public static Model.Solution_TestRunConstructSolutionApprove GetThisApproveByConstructSolutionId(string constructSolutionId)
|
||||
{
|
||||
var q = (from x in Funs.DB.Solution_TestRunConstructSolutionApprove
|
||||
where x.ConstructSolutionId == constructSolutionId && x.ApproveDate == null
|
||||
orderby x.Order
|
||||
select x).FirstOrDefault();
|
||||
return q;
|
||||
}
|
||||
public static string GetThisApproveNameByConstructSolutionId(object constructSolutionId)
|
||||
{
|
||||
string name = "";
|
||||
var q = (from x in Funs.DB.Solution_TestRunConstructSolutionApprove
|
||||
where x.ConstructSolutionId == constructSolutionId.ToString() && x.ApproveDate == null
|
||||
orderby x.Order
|
||||
select x).FirstOrDefault();
|
||||
if (q != null)
|
||||
{
|
||||
name = UserService.GetUserNameByUserId(q.ApproveMan);
|
||||
}
|
||||
return name;
|
||||
}
|
||||
/// <summary>
|
||||
/// 推送待办给下一步办理人
|
||||
/// </summary>
|
||||
/// <param name="constructSolutionId"></param>
|
||||
public static void PushMessageToNextMan(string constructSolutionId)
|
||||
{
|
||||
var approve = GetThisApproveByConstructSolutionId(constructSolutionId);
|
||||
if (approve != null)
|
||||
{
|
||||
|
||||
APICommonService.SendSubscribeMessage(approve.ApproveMan, "施工方案待办理", UserService.GetUserNameByUserId(approve.ApproveMan), string.Format("{0:yyyy-MM-dd HH:mm:ss}", DateTime.Now));
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public static void AddConstructSolutionApproveForApi(Model.Solution_TestRunConstructSolutionApprove approve)
|
||||
{
|
||||
using (var db = new Model.SGGLDB(Funs.ConnString))
|
||||
{
|
||||
Model.Solution_TestRunConstructSolutionApprove newApprove = new Model.Solution_TestRunConstructSolutionApprove();
|
||||
if (string.IsNullOrWhiteSpace(approve.ConstructSolutionApproveId))
|
||||
{
|
||||
newApprove.ConstructSolutionApproveId = SQLHelper.GetNewID(typeof(Model.Solution_TestRunConstructSolutionApprove));
|
||||
}
|
||||
else
|
||||
{
|
||||
newApprove.ConstructSolutionApproveId = approve.ConstructSolutionApproveId;
|
||||
}
|
||||
newApprove.ConstructSolutionId = approve.ConstructSolutionId;
|
||||
newApprove.ApproveMan = approve.ApproveMan;
|
||||
newApprove.ApproveDate = approve.ApproveDate;
|
||||
newApprove.ApproveIdea = approve.ApproveIdea;
|
||||
newApprove.IsAgree = approve.IsAgree;
|
||||
newApprove.ApproveType = approve.ApproveType;
|
||||
newApprove.SignType = approve.SignType;
|
||||
newApprove.Edition = approve.Edition;
|
||||
newApprove.Order = approve.Order;
|
||||
db.Solution_TestRunConstructSolutionApprove.InsertOnSubmit(newApprove);
|
||||
db.SubmitChanges();
|
||||
}
|
||||
}
|
||||
public static List<Model.Solution_TestRunConstructSolutionApprove> getListDataForApi(string ConstructSolutionId, int edition)
|
||||
{
|
||||
using (var db = new Model.SGGLDB(Funs.ConnString))
|
||||
{
|
||||
var q = from x in db.Solution_TestRunConstructSolutionApprove
|
||||
where x.ConstructSolutionId == ConstructSolutionId && x.Edition == edition && x.ApproveDate != null && x.ApproveType != "S"
|
||||
orderby x.ApproveDate
|
||||
select new
|
||||
{
|
||||
x.ConstructSolutionApproveId,
|
||||
x.ConstructSolutionId,
|
||||
x.ApproveMan,
|
||||
ApproveManName = (from y in db.Sys_User where y.UserId == x.ApproveMan select y.UserName).First(),
|
||||
x.ApproveDate,
|
||||
x.IsAgree,
|
||||
x.ApproveIdea,
|
||||
x.ApproveType,
|
||||
x.SignType,
|
||||
};
|
||||
var list = q.ToList();
|
||||
List<Model.Solution_TestRunConstructSolutionApprove> res = new List<Model.Solution_TestRunConstructSolutionApprove>();
|
||||
foreach (var item in list)
|
||||
{
|
||||
Model.Solution_TestRunConstructSolutionApprove ap = new Model.Solution_TestRunConstructSolutionApprove();
|
||||
ap.ConstructSolutionApproveId = item.ConstructSolutionApproveId;
|
||||
ap.ConstructSolutionId = item.ConstructSolutionId;
|
||||
ap.ApproveMan = item.ApproveMan + "$" + item.ApproveManName;
|
||||
ap.ApproveDate = item.ApproveDate;
|
||||
ap.IsAgree = item.IsAgree;
|
||||
ap.ApproveIdea = item.ApproveIdea;
|
||||
ap.ApproveType = item.ApproveType;
|
||||
ap.SignType = item.SignType;
|
||||
ap.AttachUrl = AttachFileService.getFileUrl(ap.ConstructSolutionApproveId);
|
||||
res.Add(ap);
|
||||
}
|
||||
return res;
|
||||
}
|
||||
}
|
||||
public static List<Model.Solution_TestRunConstructSolutionApprove> getListDataForApi(string ConstructSolutionId)
|
||||
{
|
||||
using (var db = new Model.SGGLDB(Funs.ConnString))
|
||||
{
|
||||
var q = from x in db.Solution_TestRunConstructSolutionApprove
|
||||
where x.ConstructSolutionId == ConstructSolutionId && x.ApproveDate != null && x.ApproveType != "S"
|
||||
orderby x.ApproveDate
|
||||
select new
|
||||
{
|
||||
x.ConstructSolutionApproveId,
|
||||
x.ConstructSolutionId,
|
||||
x.ApproveMan,
|
||||
ApproveManName = (from y in db.Sys_User where y.UserId == x.ApproveMan select y.UserName).First(),
|
||||
x.ApproveDate,
|
||||
x.IsAgree,
|
||||
x.ApproveIdea,
|
||||
x.ApproveType,
|
||||
x.SignType,
|
||||
};
|
||||
var list = q.ToList();
|
||||
List<Model.Solution_TestRunConstructSolutionApprove> res = new List<Model.Solution_TestRunConstructSolutionApprove>();
|
||||
foreach (var item in list)
|
||||
{
|
||||
Model.Solution_TestRunConstructSolutionApprove ap = new Model.Solution_TestRunConstructSolutionApprove();
|
||||
ap.ConstructSolutionApproveId = item.ConstructSolutionApproveId;
|
||||
ap.ConstructSolutionId = item.ConstructSolutionId;
|
||||
ap.ApproveMan = item.ApproveMan + "$" + item.ApproveManName;
|
||||
ap.ApproveDate = item.ApproveDate;
|
||||
ap.IsAgree = item.IsAgree;
|
||||
ap.ApproveIdea = item.ApproveIdea;
|
||||
ap.ApproveType = item.ApproveType;
|
||||
ap.SignType = item.SignType;
|
||||
ap.AttachUrl = AttachFileService.getFileUrl(ap.ConstructSolutionApproveId);
|
||||
res.Add(ap);
|
||||
}
|
||||
return res;
|
||||
}
|
||||
}
|
||||
public static Model.Solution_TestRunConstructSolutionApprove getCurrApproveForApi(string ConstructSolutionId, string approveMan, int edition)
|
||||
{
|
||||
using (var db = new Model.SGGLDB(Funs.ConnString))
|
||||
{
|
||||
Model.Solution_TestRunConstructSolutionApprove newApprove = db.Solution_TestRunConstructSolutionApprove.FirstOrDefault(e => e.ConstructSolutionId == ConstructSolutionId && e.ApproveMan == approveMan && e.Edition == edition && e.ApproveType != "S" && e.ApproveDate == null);
|
||||
if (newApprove != null)
|
||||
{
|
||||
Model.Sys_User user = BLL.UserService.GetUserByUserId(newApprove.ApproveMan);
|
||||
if (user != null)
|
||||
{
|
||||
newApprove.ApproveIdea = user.UserName;
|
||||
}
|
||||
}
|
||||
return newApprove;
|
||||
}
|
||||
}
|
||||
public static List<Model.Solution_TestRunConstructSolutionApprove> getConApproveForApi(string ConstructSolutionId, int edition)
|
||||
{
|
||||
using (var db = new Model.SGGLDB(Funs.ConnString))
|
||||
{
|
||||
List<Model.Solution_TestRunConstructSolutionApprove> res = new List<Model.Solution_TestRunConstructSolutionApprove>();
|
||||
var newApproves = db.Solution_TestRunConstructSolutionApprove.Where(e => e.ConstructSolutionId == ConstructSolutionId && e.Edition == edition && e.ApproveType == "2").ToList();
|
||||
if (newApproves != null)
|
||||
{
|
||||
foreach (Model.Solution_TestRunConstructSolutionApprove newApprove in newApproves)
|
||||
{
|
||||
Model.Solution_TestRunConstructSolutionApprove a = new Model.Solution_TestRunConstructSolutionApprove();
|
||||
a.ConstructSolutionApproveId = newApprove.ConstructSolutionApproveId;
|
||||
a.ConstructSolutionId = newApprove.ConstructSolutionId;
|
||||
a.ApproveDate = newApprove.ApproveDate;
|
||||
a.ApproveMan = newApprove.ApproveMan;
|
||||
a.ApproveType = newApprove.ApproveType;
|
||||
a.Edition = newApprove.Edition;
|
||||
a.IsAgree = newApprove.IsAgree;
|
||||
Model.Sys_User user = BLL.UserService.GetUserByUserId(newApprove.ApproveMan);
|
||||
if (user != null)
|
||||
{
|
||||
a.ApproveMan = a.ApproveMan + "$" + user.UserName;
|
||||
}
|
||||
a.AttachUrl = AttachFileService.getFileUrl(a.ConstructSolutionApproveId);
|
||||
res.Add(a);
|
||||
}
|
||||
}
|
||||
return res;
|
||||
}
|
||||
}
|
||||
public static List<Model.Solution_TestRunConstructSolutionApprove> getConApprovesForApi(string ConstructSolutionId, int edition)
|
||||
{
|
||||
using (var db = new Model.SGGLDB(Funs.ConnString))
|
||||
{
|
||||
List<Model.Solution_TestRunConstructSolutionApprove> res = new List<Model.Solution_TestRunConstructSolutionApprove>();
|
||||
var newApproves = db.Solution_TestRunConstructSolutionApprove.Where(e => e.ConstructSolutionId == ConstructSolutionId && e.Edition == edition).ToList();
|
||||
if (newApproves != null)
|
||||
{
|
||||
foreach (Model.Solution_TestRunConstructSolutionApprove newApprove in newApproves)
|
||||
{
|
||||
Model.Solution_TestRunConstructSolutionApprove a = new Model.Solution_TestRunConstructSolutionApprove();
|
||||
a.ConstructSolutionApproveId = newApprove.ConstructSolutionApproveId;
|
||||
a.ConstructSolutionId = newApprove.ConstructSolutionId;
|
||||
a.ApproveDate = newApprove.ApproveDate;
|
||||
a.ApproveMan = newApprove.ApproveMan;
|
||||
a.ApproveType = newApprove.ApproveType;
|
||||
a.Edition = newApprove.Edition;
|
||||
a.IsAgree = newApprove.IsAgree;
|
||||
Model.Sys_User user = BLL.UserService.GetUserByUserId(newApprove.ApproveMan);
|
||||
if (user != null)
|
||||
{
|
||||
a.ApproveMan = a.ApproveMan + "$" + user.UserName;
|
||||
}
|
||||
a.AttachUrl = AttachFileService.getFileUrl(a.ConstructSolutionApproveId);
|
||||
res.Add(a);
|
||||
}
|
||||
}
|
||||
return res;
|
||||
}
|
||||
}
|
||||
public static Model.Solution_TestRunConstructSolutionApprove UpdateConstructSolutionApproveForApi(Model.Solution_TestRunConstructSolutionApprove approve)
|
||||
{
|
||||
using (var db = new Model.SGGLDB(Funs.ConnString))
|
||||
{
|
||||
Model.Solution_TestRunConstructSolutionApprove newApprove = db.Solution_TestRunConstructSolutionApprove.First(e => e.ConstructSolutionApproveId == approve.ConstructSolutionApproveId);
|
||||
if (!string.IsNullOrEmpty(approve.ConstructSolutionId))
|
||||
newApprove.ConstructSolutionId = approve.ConstructSolutionId;
|
||||
if (!string.IsNullOrEmpty(approve.ApproveMan))
|
||||
newApprove.ApproveMan = approve.ApproveMan;
|
||||
if (approve.ApproveDate.HasValue)
|
||||
newApprove.ApproveDate = approve.ApproveDate;
|
||||
if (!string.IsNullOrEmpty(approve.ApproveIdea))
|
||||
newApprove.ApproveIdea = approve.ApproveIdea;
|
||||
if (approve.IsAgree.HasValue)
|
||||
newApprove.IsAgree = approve.IsAgree;
|
||||
if (!string.IsNullOrEmpty(approve.ApproveType))
|
||||
newApprove.ApproveType = approve.ApproveType;
|
||||
|
||||
db.SubmitChanges();
|
||||
AttachFileService.updateAttachFile(approve.AttachUrl, newApprove.ConstructSolutionApproveId, Const.TestRunConstructSolutionMenuId);
|
||||
return newApprove;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,423 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using System.Web.UI.WebControls;
|
||||
|
||||
namespace BLL
|
||||
{
|
||||
public class TestRunConstructSolutionService
|
||||
{
|
||||
public static string IsAgree(Object type, Object res)
|
||||
{
|
||||
string result = string.Empty;
|
||||
if (type.ToString().Equals(Const.TestRunConstructSolution_ReCompile) || type.ToString().Equals(Const.TestRunConstructSolution_Compile))
|
||||
{
|
||||
res = null;
|
||||
}
|
||||
if (res != null)
|
||||
{
|
||||
if (Convert.ToBoolean(res))
|
||||
{
|
||||
result = "是";
|
||||
}
|
||||
else
|
||||
{
|
||||
result = "否";
|
||||
}
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 根据方案审查Id删除一个方案审查信息
|
||||
/// </summary>
|
||||
/// <param name="constructSolutionCode">方案审查Id</param>
|
||||
public static void DeleteConstructSolution(string constructSolutionId)
|
||||
{
|
||||
Model.SGGLDB db = Funs.DB;
|
||||
Model.Solution_TestRunConstructSolution constructSolution = db.Solution_TestRunConstructSolution.First(e => e.ConstructSolutionId == constructSolutionId);
|
||||
|
||||
db.Solution_TestRunConstructSolution.DeleteOnSubmit(constructSolution);
|
||||
db.SubmitChanges();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 增加方案审查信息
|
||||
/// </summary>
|
||||
/// <param name="constructSolution">方案审查实体</param>
|
||||
public static void AddConstructSolution(Model.Solution_TestRunConstructSolution constructSolution)
|
||||
{
|
||||
Model.SGGLDB db = Funs.DB;
|
||||
Model.Solution_TestRunConstructSolution newConstructSolution = new Model.Solution_TestRunConstructSolution();
|
||||
newConstructSolution.ConstructSolutionId = constructSolution.ConstructSolutionId;
|
||||
newConstructSolution.Code = constructSolution.Code;
|
||||
newConstructSolution.ProjectId = constructSolution.ProjectId;
|
||||
newConstructSolution.UnitId = constructSolution.UnitId;
|
||||
newConstructSolution.SolutionName = constructSolution.SolutionName;
|
||||
newConstructSolution.SolutionType = constructSolution.SolutionType;
|
||||
newConstructSolution.UnitWorkIds = constructSolution.UnitWorkIds;
|
||||
newConstructSolution.CNProfessionalCodes = constructSolution.CNProfessionalCodes;
|
||||
newConstructSolution.AttachUrl = constructSolution.AttachUrl;
|
||||
newConstructSolution.CompileMan = constructSolution.CompileMan;
|
||||
newConstructSolution.CompileDate = constructSolution.CompileDate;
|
||||
newConstructSolution.State = constructSolution.State;
|
||||
newConstructSolution.Edition = constructSolution.Edition;
|
||||
newConstructSolution.SpecialSchemeTypeId = constructSolution.SpecialSchemeTypeId;
|
||||
newConstructSolution.Content = constructSolution.Content;
|
||||
db.Solution_TestRunConstructSolution.InsertOnSubmit(newConstructSolution);
|
||||
db.SubmitChanges();
|
||||
}
|
||||
/// <summary>
|
||||
/// 修改方案审查信息
|
||||
/// </summary>
|
||||
/// <param name="constructSolution">方案审查实体</param>
|
||||
public static void UpdateConstructSolution(Model.Solution_TestRunConstructSolution constructSolution)
|
||||
{
|
||||
Model.SGGLDB db = Funs.DB;
|
||||
Model.Solution_TestRunConstructSolution newConstructSolution = db.Solution_TestRunConstructSolution.First(e => e.ConstructSolutionId == constructSolution.ConstructSolutionId);
|
||||
newConstructSolution.Code = constructSolution.Code;
|
||||
newConstructSolution.UnitId = constructSolution.UnitId;
|
||||
newConstructSolution.SolutionName = constructSolution.SolutionName;
|
||||
newConstructSolution.SolutionType = constructSolution.SolutionType;
|
||||
newConstructSolution.UnitWorkIds = constructSolution.UnitWorkIds;
|
||||
newConstructSolution.CNProfessionalCodes = constructSolution.CNProfessionalCodes;
|
||||
newConstructSolution.AttachUrl = constructSolution.AttachUrl;
|
||||
newConstructSolution.State = constructSolution.State;
|
||||
newConstructSolution.Edition = constructSolution.Edition;
|
||||
newConstructSolution.SpecialSchemeTypeId = constructSolution.SpecialSchemeTypeId;
|
||||
newConstructSolution.Content = constructSolution.Content;
|
||||
db.SubmitChanges();
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 把状态转换代号为文字形式
|
||||
/// </summary>
|
||||
/// <param name="state"></param>
|
||||
/// <returns></returns>
|
||||
///
|
||||
public static string ConvertState(object state)
|
||||
{
|
||||
if (state != null)
|
||||
{
|
||||
if (state.ToString() == BLL.Const.TestRunConstructSolution_ReCompile)
|
||||
{
|
||||
return "重报";
|
||||
}
|
||||
else if (state.ToString() == BLL.Const.TestRunConstructSolution_Compile)
|
||||
{
|
||||
return "编制";
|
||||
}
|
||||
else if (state.ToString() == BLL.Const.TestRunConstructSolution_Audit)
|
||||
{
|
||||
return "会签";
|
||||
}
|
||||
else if (state.ToString() == BLL.Const.TestRunConstructSolution_Complete)
|
||||
{
|
||||
return "审批完成";
|
||||
}
|
||||
}
|
||||
return "";
|
||||
}
|
||||
/// <summary>
|
||||
/// 获取单位信息中的常用工程类型信息
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public static ListItem[] GetSolutionType()
|
||||
{
|
||||
ListItem[] list = new ListItem[13];
|
||||
list[0] = new ListItem("01 开车文件编制计划", "01");
|
||||
list[1] = new ListItem("02 单机试车方案", "02");
|
||||
list[2] = new ListItem("03 冲洗吹扫方案", "03");
|
||||
list[3] = new ListItem("04 气密试验方案", "04");
|
||||
list[4] = new ListItem("05 化洗清洗方案", "05");
|
||||
list[5] = new ListItem("06 烘炉方案", "06");
|
||||
list[6] = new ListItem("07 催化剂装填方案", "07");
|
||||
list[7] = new ListItem("08 联动试车方案", "08");
|
||||
list[8] = new ListItem("09 投料试车方案", "09");
|
||||
list[9] = new ListItem("10 性能考核方案", "10");
|
||||
list[10] = new ListItem("11 其他方案(如:真空试验、升温还原、煮炉、预冷、预热等)", "11");
|
||||
list[11] = new ListItem("12 总体试车方案", "12");
|
||||
list[12] = new ListItem("13 方案审查记录", "13");
|
||||
return list;
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 根据方案审查Id获取一个方案审查信息
|
||||
/// </summary>
|
||||
/// <param name="constructSolutionCode">方案审查Id</param>
|
||||
/// <returns>一个方案审查实体</returns>
|
||||
public static Model.Solution_TestRunConstructSolution GetConstructSolutionByConstructSolutionId(string constructSolutionId)
|
||||
{
|
||||
return Funs.DB.Solution_TestRunConstructSolution.FirstOrDefault(x => x.ConstructSolutionId == constructSolutionId);
|
||||
}
|
||||
public static Model.Solution_TestRunConstructSolution GetConstructSolutionByConstructSolutionIdForApi(string constructSolutionId)
|
||||
{
|
||||
using (var db = new Model.SGGLDB(Funs.ConnString))
|
||||
{
|
||||
Model.Solution_TestRunConstructSolution solution = db.Solution_TestRunConstructSolution.FirstOrDefault(x => x.ConstructSolutionId == constructSolutionId);
|
||||
solution.AttachUrl = AttachFileService.getFileUrl(solution.ConstructSolutionId);
|
||||
solution.CNProfessionalCodes = solution.CNProfessionalCodes + "$" + GetProfessionalName(solution.CNProfessionalCodes);
|
||||
solution.UnitWorkIds = solution.UnitWorkIds + "$" + GetUnitWorkName(solution.UnitWorkIds);
|
||||
var unit = BLL.UnitService.GetUnitByUnitId(solution.UnitId);
|
||||
solution.UnitId = solution.UnitId + "$" + (unit != null ? unit.UnitName : "");
|
||||
solution.CompileMan = solution.CompileMan + "$" + UserService.GetUserNameByUserId(solution.CompileMan);
|
||||
return solution;
|
||||
}
|
||||
|
||||
}
|
||||
/// <summary>
|
||||
/// 获取方案类别
|
||||
/// </summary>
|
||||
/// <param name="state"></param>
|
||||
/// <returns></returns>
|
||||
public static string ConvertSolutionType(object solutionType)
|
||||
{
|
||||
if (solutionType != null)
|
||||
{
|
||||
ListItem[] list = GetSolutionType();
|
||||
var item = list.FirstOrDefault(x => x.Value == solutionType.ToString());
|
||||
if (item != null)
|
||||
{
|
||||
return item.Text.Substring(3);
|
||||
}
|
||||
}
|
||||
return "";
|
||||
}
|
||||
public static string GetProfessionalName(string cNProfessionalCodes)
|
||||
{
|
||||
string professionalName = string.Empty;
|
||||
if (!string.IsNullOrEmpty(cNProfessionalCodes))
|
||||
{
|
||||
string[] strs = cNProfessionalCodes.Split(',');
|
||||
foreach (var item in strs)
|
||||
{
|
||||
var cn = BLL.CNProfessionalService.GetCNProfessional(item);
|
||||
if (cn != null)
|
||||
{
|
||||
professionalName += cn.ProfessionalName + ",";
|
||||
}
|
||||
}
|
||||
if (!string.IsNullOrEmpty(professionalName))
|
||||
{
|
||||
professionalName = professionalName.Substring(0, professionalName.LastIndexOf(","));
|
||||
}
|
||||
}
|
||||
return professionalName;
|
||||
}
|
||||
public static string GetUnitWorkName(string unitWorkIds)
|
||||
{
|
||||
string unitWorkName = string.Empty;
|
||||
if (!string.IsNullOrEmpty(unitWorkIds))
|
||||
{
|
||||
string[] strs = unitWorkIds.Split(',');
|
||||
foreach (var item in strs)
|
||||
{
|
||||
var un = BLL.UnitWorkService.GetUnitWorkByUnitWorkId(item);
|
||||
if (un != null)
|
||||
{
|
||||
unitWorkName += un.UnitWorkName + BLL.UnitWorkService.GetProjectType(un.ProjectType) + ",";
|
||||
}
|
||||
}
|
||||
if (!string.IsNullOrEmpty(unitWorkName))
|
||||
{
|
||||
unitWorkName = unitWorkName.Substring(0, unitWorkName.LastIndexOf(","));
|
||||
}
|
||||
}
|
||||
return unitWorkName;
|
||||
}
|
||||
public static List<Model.Solution_TestRunConstructSolution> getListDataForApi(string name, string unitId, string unitWork, string cNProfessionalCodes, string solutionType, string state, string projectId, int startRowIndex, int maximumRows)
|
||||
{
|
||||
using (var db = new Model.SGGLDB(Funs.ConnString))
|
||||
{
|
||||
IQueryable<Model.Solution_TestRunConstructSolution> q = db.Solution_TestRunConstructSolution;
|
||||
|
||||
if (!string.IsNullOrEmpty(projectId))
|
||||
{
|
||||
q = q.Where(e => e.ProjectId == projectId);
|
||||
}
|
||||
if (!string.IsNullOrEmpty(unitId) && unitId != "undefined")
|
||||
{
|
||||
q = q.Where(e => e.UnitId == unitId);
|
||||
}
|
||||
if (!string.IsNullOrEmpty(unitWork) && unitWork != "undefined")
|
||||
{
|
||||
q = q.Where(e => e.UnitWorkIds.Contains(unitWork));
|
||||
}
|
||||
if (!string.IsNullOrEmpty(cNProfessionalCodes) && cNProfessionalCodes != "undefined")
|
||||
{
|
||||
q = q.Where(e => e.CNProfessionalCodes.Contains(cNProfessionalCodes));
|
||||
}
|
||||
if (!string.IsNullOrEmpty(solutionType) && solutionType != "undefined")
|
||||
{
|
||||
q = q.Where(e => e.SolutionType == solutionType);
|
||||
}
|
||||
if (!string.IsNullOrEmpty(state) && state != "undefined")
|
||||
{
|
||||
if ("已闭合" == state)
|
||||
{
|
||||
q = q.Where(e => e.State == "3");
|
||||
}
|
||||
else if ("未闭合" == state)
|
||||
{
|
||||
q = q.Where(e => e.State != "3");
|
||||
|
||||
}
|
||||
}
|
||||
if (!string.IsNullOrEmpty(name))
|
||||
{
|
||||
List<string> ids = new List<string>();
|
||||
var qunit = from u in Funs.DB.Base_Unit
|
||||
where u.UnitName.Contains(name)
|
||||
select u.UnitId;
|
||||
ids = qunit.ToList();
|
||||
q = q.Where(e => e.SolutionName.Contains(name) || ids.Contains(e.UnitId));
|
||||
}
|
||||
|
||||
|
||||
var qlist = from x in q
|
||||
orderby x.Code descending
|
||||
|
||||
select new
|
||||
{
|
||||
x.ConstructSolutionId,
|
||||
x.Code,
|
||||
x.ProjectId,
|
||||
x.UnitId,
|
||||
UnitName = (from y in db.Base_Unit where y.UnitId == x.UnitId select y.UnitName).First(),
|
||||
x.SolutionName,
|
||||
x.SolutionType,
|
||||
x.UnitWorkIds,
|
||||
UnitWorkName = GetUnitWorkName(x.UnitWorkIds),
|
||||
x.CNProfessionalCodes,
|
||||
ProfessionalName = GetProfessionalName(x.CNProfessionalCodes),
|
||||
x.AttachUrl,
|
||||
x.CompileMan,
|
||||
x.CompileDate,
|
||||
x.State,
|
||||
x.Edition,
|
||||
CompileManName = (from y in db.Sys_User where y.UserId == x.CompileMan select y.UserName).First(),
|
||||
};
|
||||
|
||||
List<Model.Solution_TestRunConstructSolution> res = new List<Model.Solution_TestRunConstructSolution>();
|
||||
var qres = qlist.Skip(startRowIndex * maximumRows).Take(maximumRows).ToList();
|
||||
foreach (var item in qres)
|
||||
{
|
||||
Model.Solution_TestRunConstructSolution cs = new Model.Solution_TestRunConstructSolution();
|
||||
cs.ConstructSolutionId = item.ConstructSolutionId;
|
||||
cs.Code = item.Code;
|
||||
cs.ProjectId = item.ProjectId;
|
||||
cs.UnitId = item.UnitId + "$" + item.UnitName;
|
||||
cs.SolutionName = item.SolutionName;
|
||||
cs.SolutionType = item.SolutionType;
|
||||
cs.UnitWorkIds = item.UnitWorkIds + "$" + item.UnitWorkName;
|
||||
cs.CNProfessionalCodes = item.CNProfessionalCodes + "$" + item.ProfessionalName;
|
||||
cs.AttachUrl = item.AttachUrl;
|
||||
cs.CompileMan = item.CompileMan + "$" + item.CompileManName;
|
||||
cs.CompileDate = item.CompileDate;
|
||||
cs.State = item.State;
|
||||
cs.Edition = item.Edition;
|
||||
|
||||
res.Add(cs);
|
||||
}
|
||||
return res;
|
||||
}
|
||||
}
|
||||
public static List<Model.Solution_TestRunConstructSolution> getListDataForApi(string name, string projectId, int startRowIndex, int maximumRows)
|
||||
{
|
||||
var db = Funs.DB;
|
||||
IQueryable<Model.Solution_TestRunConstructSolution> q = db.Solution_TestRunConstructSolution;
|
||||
|
||||
if (!string.IsNullOrEmpty(projectId))
|
||||
{
|
||||
q = q.Where(e => e.ProjectId == projectId);
|
||||
}
|
||||
if (!string.IsNullOrEmpty(name))
|
||||
{
|
||||
List<string> ids = new List<string>();
|
||||
var qunit = from u in Funs.DB.Base_Unit
|
||||
where u.UnitName.Contains(name)
|
||||
select u.UnitId;
|
||||
ids = qunit.ToList();
|
||||
q = q.Where(e => e.SolutionName.Contains(name) || ids.Contains(e.UnitId));
|
||||
}
|
||||
|
||||
|
||||
var qlist = from x in q
|
||||
orderby x.Code descending
|
||||
|
||||
select new
|
||||
{
|
||||
x.ConstructSolutionId,
|
||||
x.Code,
|
||||
x.ProjectId,
|
||||
x.UnitId,
|
||||
UnitName = (from y in db.Base_Unit where y.UnitId == x.UnitId select y.UnitName).First(),
|
||||
x.SolutionName,
|
||||
x.SolutionType,
|
||||
x.UnitWorkIds,
|
||||
UnitWorkName = GetUnitWorkName(x.UnitWorkIds),
|
||||
x.CNProfessionalCodes,
|
||||
ProfessionalName = GetProfessionalName(x.CNProfessionalCodes),
|
||||
x.AttachUrl,
|
||||
x.CompileMan,
|
||||
x.CompileDate,
|
||||
x.State,
|
||||
x.Edition,
|
||||
CompileManName = (from y in db.Sys_User where y.UserId == x.CompileMan select y.UserName).First(),
|
||||
};
|
||||
|
||||
List<Model.Solution_TestRunConstructSolution> res = new List<Model.Solution_TestRunConstructSolution>();
|
||||
var qres = qlist.Skip(startRowIndex * maximumRows).Take(maximumRows).ToList();
|
||||
foreach (var item in qres)
|
||||
{
|
||||
Model.Solution_TestRunConstructSolution cs = new Model.Solution_TestRunConstructSolution();
|
||||
cs.ConstructSolutionId = item.ConstructSolutionId;
|
||||
cs.Code = item.Code;
|
||||
cs.ProjectId = item.ProjectId;
|
||||
cs.UnitId = item.UnitId + "$" + item.UnitName;
|
||||
cs.SolutionName = item.SolutionName;
|
||||
cs.SolutionType = item.SolutionType;
|
||||
cs.UnitWorkIds = item.UnitWorkIds + "$" + item.UnitWorkName;
|
||||
cs.CNProfessionalCodes = item.CNProfessionalCodes + "$" + item.ProfessionalName;
|
||||
cs.AttachUrl = AttachFileService.getFileUrl(item.ConstructSolutionId);
|
||||
cs.CompileMan = item.CompileMan + "$" + item.CompileManName;
|
||||
cs.CompileDate = item.CompileDate;
|
||||
cs.State = item.State;
|
||||
cs.Edition = item.Edition;
|
||||
|
||||
res.Add(cs);
|
||||
}
|
||||
return res;
|
||||
}
|
||||
public static void UpdateConstructSolutionForApi(Model.Solution_TestRunConstructSolution constructSolution)
|
||||
{
|
||||
using (var db = new Model.SGGLDB(Funs.ConnString))
|
||||
{
|
||||
Model.Solution_TestRunConstructSolution newConstructSolution = db.Solution_TestRunConstructSolution.First(e => e.ConstructSolutionId == constructSolution.ConstructSolutionId);
|
||||
if (!string.IsNullOrEmpty(constructSolution.Code))
|
||||
newConstructSolution.Code = constructSolution.Code;
|
||||
if (!string.IsNullOrEmpty(constructSolution.UnitId))
|
||||
newConstructSolution.UnitId = constructSolution.UnitId;
|
||||
if (!string.IsNullOrEmpty(constructSolution.SolutionName))
|
||||
newConstructSolution.SolutionName = constructSolution.SolutionName;
|
||||
if (!string.IsNullOrEmpty(constructSolution.SolutionType))
|
||||
newConstructSolution.SolutionType = constructSolution.SolutionType;
|
||||
if (!string.IsNullOrEmpty(constructSolution.UnitWorkIds))
|
||||
newConstructSolution.UnitWorkIds = constructSolution.UnitWorkIds;
|
||||
if (!string.IsNullOrEmpty(constructSolution.CNProfessionalCodes))
|
||||
newConstructSolution.CNProfessionalCodes = constructSolution.CNProfessionalCodes;
|
||||
if (!string.IsNullOrEmpty(constructSolution.AttachUrl))
|
||||
newConstructSolution.AttachUrl = constructSolution.AttachUrl;
|
||||
if (!string.IsNullOrEmpty(constructSolution.State))
|
||||
newConstructSolution.State = constructSolution.State;
|
||||
if (constructSolution.Edition.HasValue)
|
||||
newConstructSolution.Edition = constructSolution.Edition;
|
||||
db.SubmitChanges();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user