修改质量接口

This commit is contained in:
2023-03-15 10:55:53 +08:00
parent 643ef1ceb8
commit c30f2badb9
18 changed files with 838 additions and 1 deletions
+73
View File
@@ -198,5 +198,78 @@ namespace BLL
rootNode.Nodes.Add(roleNode);
}
}
public static List<Model.Plan_SubPlan> getListDataForApi(string projectId, int startRowIndex, int maximumRows)
{
using (var db = new Model.SGGLDB(Funs.ConnString))
{
IQueryable<Model.Plan_SubPlan> q = db.Plan_SubPlan;
if (!string.IsNullOrEmpty(projectId))
{
q = q.Where(e => e.ProjectId == projectId);
}
var qres = from x in q
orderby x.CompileDate descending
select new
{
x.SubPlanId,
x.ProjectId,
x.Code,
x.UnitId,
x.PlanName,
x.UnitWorkIds,
x.CNProfessionalCodes,
x.CompileDate,
x.CompileMan,
x.State,
x.Edition,
StateStr = ConvertState(x.State),
CompileManName = (from y in db.Person_Persons where y.PersonId == x.CompileMan select y.PersonName).First(),
UnitName = BLL.UnitService.GetUnitNameByUnitId(x.UnitId),
UnitWorkNames=BLL.UnitWorkService.GetUnitWorkName(x.UnitWorkIds),
CNProfessionalNames=BLL.CNProfessionalService.GetCNProfessionalNameByCode(x.CNProfessionalCodes),
FilePath = x.FilePath,
};
List<Model.Plan_SubPlan> res = new List<Model.Plan_SubPlan>();
var list = qres.Skip(startRowIndex).Take(maximumRows).ToList();
foreach (var item in list)
{
Model.Plan_SubPlan cd = new Model.Plan_SubPlan();
cd.SubPlanId = item.SubPlanId;
cd.ProjectId = item.ProjectId;
cd.Code = item.Code;
cd.UnitId=item.UnitId + "$" + item.UnitName;
cd.PlanName = item.PlanName;
cd.UnitWorkIds=item.UnitWorkIds + "$" + item.UnitWorkNames;
cd.CNProfessionalCodes = item.CNProfessionalCodes + "$" + item.CNProfessionalNames;
cd.CompileDate = item.CompileDate;
cd.CompileMan = item.CompileMan + "$" + item.CompileManName;
cd.State = item.State + "$" + item.StateStr;
cd.Edition = item.Edition;
cd.FilePath = item.FilePath;
res.Add(cd);
}
return res;
}
}
/// <summary>
/// 根据分包施工质量计划Id获取一个分包施工质量计划信息
/// </summary>
/// <param name="SubPlanCode">分包施工质量计划Id</param>
/// <returns>一个分包施工质量计划实体</returns>
public static Model.Plan_SubPlan GetSubPlanBySubPlanIdForApi(string SubPlanId)
{
var q= Funs.DB.Plan_SubPlan.FirstOrDefault(x => x.SubPlanId == SubPlanId);
if (q != null)
{
q.UnitId = q.UnitId + "$" + BLL.UnitService.GetUnitNameByUnitId(q.UnitId);
q.UnitWorkIds = q.UnitWorkIds + "$" + BLL.UnitWorkService.GetUnitWorkName(q.UnitWorkIds);
q.CNProfessionalCodes = q.CNProfessionalCodes + "$" + BLL.CNProfessionalService.GetCNProfessionalNameByCode(q.CNProfessionalCodes);
q.CompileMan=q.CompileMan + "$" + BLL.Person_PersonsService.GetPersonsNameById(q.CompileMan);
q.State = q.State + "$" + ConvertState(q.State);
}
return q;
}
}
}