This commit is contained in:
2024-11-20 09:08:00 +08:00
parent f1abdbc6d0
commit 9300d77ab0
181 changed files with 28244 additions and 119 deletions
+47 -18
View File
@@ -24,24 +24,53 @@ namespace BLL
{
using (Model.SGGLDB db = new Model.SGGLDB(Funs.ConnString))
{
var getDataLists = (from x in db.Training_TestPlan
where x.ProjectId == projectId && (x.States == states || states == null)
orderby x.TestStartTime descending
select new Model.TestPlanItem
{
TestPlanId = x.TestPlanId,
TestPlanCode = x.PlanCode,
TestPlanName = x.PlanName,
ProjectId = x.ProjectId,
TestPlanManId = x.PlanManId,
TestPlanManName = db.Sys_User.First(y => y.UserId == x.PlanManId).UserName,
TestPalce = x.TestPalce,
TestStartTime = string.Format("{0:yyyy-MM-dd HH:mm}", x.TestStartTime),
TestEndTime = string.Format("{0:yyyy-MM-dd HH:mm}", x.TestEndTime),
States = x.States,
QRCodeUrl = x.QRCodeUrl.Replace('\\', '/'),
}).ToList();
return getDataLists;
if (string.IsNullOrEmpty(projectId))
{
var getDataLists = (from x in db.Training_TestPlan
where (x.ProjectId == null || x.ProjectId=="") && (x.States == states || states == null)
orderby x.TestStartTime descending
select new Model.TestPlanItem
{
TestPlanId = x.TestPlanId,
TestPlanCode = x.PlanCode,
TestPlanName = x.PlanName,
ProjectId = x.ProjectId,
DepartIds = x.DepartIds,
DepartNames = WorkPostService.getDepartNamesByIdsForApi(x.DepartIds),
TestPlanManId = x.PlanManId,
TestPlanManName = db.Sys_User.First(y => y.UserId == x.PlanManId).UserName,
TestPalce = x.TestPalce,
TestStartTime = string.Format("{0:yyyy-MM-dd HH:mm}", x.TestStartTime),
TestEndTime = string.Format("{0:yyyy-MM-dd HH:mm}", x.TestEndTime),
States = x.States,
QRCodeUrl = x.QRCodeUrl.Replace('\\', '/'),
}).ToList();
return getDataLists;
}
else
{
var getDataLists = (from x in db.Training_TestPlan
where x.ProjectId == projectId && (x.States == states || states == null)
orderby x.TestStartTime descending
select new Model.TestPlanItem
{
TestPlanId = x.TestPlanId,
TestPlanCode = x.PlanCode,
TestPlanName = x.PlanName,
ProjectId = x.ProjectId,
TestPlanManId = x.PlanManId,
DepartIds = x.DepartIds,
DepartNames = WorkPostService.getDepartNamesByIdsForApi(x.DepartIds),
TestPlanManName = db.Sys_User.First(y => y.UserId == x.PlanManId).UserName,
TestPalce = x.TestPalce,
TestStartTime = string.Format("{0:yyyy-MM-dd HH:mm}", x.TestStartTime),
TestEndTime = string.Format("{0:yyyy-MM-dd HH:mm}", x.TestEndTime),
States = x.States,
QRCodeUrl = x.QRCodeUrl.Replace('\\', '/'),
}).ToList();
return getDataLists;
}
}
}
#endregion