修改质量接口
This commit is contained in:
@@ -207,5 +207,40 @@ namespace BLL
|
||||
{
|
||||
return db.Plan_MainPlanApprove.FirstOrDefault(x => x.MainPlanId == MainPlanId && x.ApproveType == BLL.Const.MainPlan_Compile);
|
||||
}
|
||||
|
||||
public static List<Model.Plan_MainPlanApprove> getApproveListDataByIdForApi(string MainPlanId)
|
||||
{
|
||||
using (var db = new Model.SGGLDB(Funs.ConnString))
|
||||
{
|
||||
var q = from x in db.Plan_MainPlanApprove
|
||||
where x.MainPlanId == MainPlanId && x.ApproveDate != null && x.ApproveType != "S"
|
||||
orderby x.ApproveDate
|
||||
select new
|
||||
{
|
||||
x.MainPlanApproveId,
|
||||
x.MainPlanId,
|
||||
ApproveMan = (from y in db.Person_Persons where y.PersonId == x.ApproveMan select y.PersonName).First(),
|
||||
x.ApproveDate,
|
||||
x.IsAgree,
|
||||
x.ApproveIdea,
|
||||
x.ApproveType,
|
||||
};
|
||||
List<Model.Plan_MainPlanApprove> res = new List<Model.Plan_MainPlanApprove>();
|
||||
var list = q.ToList();
|
||||
foreach (var item in list)
|
||||
{
|
||||
Model.Plan_MainPlanApprove cd = new Model.Plan_MainPlanApprove();
|
||||
cd.MainPlanApproveId = item.MainPlanApproveId;
|
||||
cd.MainPlanId = item.MainPlanId;
|
||||
cd.ApproveMan = item.ApproveMan;
|
||||
cd.ApproveDate = item.ApproveDate;
|
||||
cd.IsAgree = item.IsAgree;
|
||||
cd.ApproveIdea = item.ApproveIdea;
|
||||
cd.ApproveType = item.ApproveType;
|
||||
res.Add(cd);
|
||||
}
|
||||
return res;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -30,7 +30,7 @@ namespace BLL
|
||||
newMainPlan.State = MainPlan.State;
|
||||
newMainPlan.CompileMan = MainPlan.CompileMan;
|
||||
newMainPlan.CompileDate = MainPlan.CompileDate;
|
||||
newMainPlan.FilePath = MainPlan.FilePath;
|
||||
newMainPlan.FilePath = MainPlan.FilePath;
|
||||
db.Plan_MainPlan.InsertOnSubmit(newMainPlan);
|
||||
db.SubmitChanges();
|
||||
}
|
||||
@@ -123,5 +123,113 @@ namespace BLL
|
||||
else
|
||||
return null;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 把状态转换代号为文字形式
|
||||
/// </summary>
|
||||
/// <param name="state"></param>
|
||||
/// <returns></returns>
|
||||
public static string ConvertState(object state)
|
||||
{
|
||||
if (state != null)
|
||||
{
|
||||
if (state.ToString() == BLL.Const.MainPlan_ReCompile)
|
||||
{
|
||||
return "重新编制";
|
||||
}
|
||||
else if (state.ToString() == BLL.Const.MainPlan_Compile)
|
||||
{
|
||||
return "编制";
|
||||
}
|
||||
else if (state.ToString() == BLL.Const.MainPlan_Audit1)
|
||||
{
|
||||
return "施工经理审核";
|
||||
}
|
||||
else if (state.ToString() == BLL.Const.MainPlan_Audit2)
|
||||
{
|
||||
return "部门评审小组审核";
|
||||
}
|
||||
else if (state.ToString() == BLL.Const.MainPlan_Audit3)
|
||||
{
|
||||
return "审核";
|
||||
}
|
||||
else if (state.ToString() == BLL.Const.MainPlan_Audit4)
|
||||
{
|
||||
return "项目经理批准";
|
||||
}
|
||||
else if (state.ToString() == BLL.Const.MainPlan_Audit5)
|
||||
{
|
||||
return "评审小组组长确认";
|
||||
}
|
||||
else if (state.ToString() == BLL.Const.MainPlan_Complete)
|
||||
{
|
||||
return "审批完成";
|
||||
}
|
||||
else
|
||||
{
|
||||
return "";
|
||||
}
|
||||
}
|
||||
return "";
|
||||
}
|
||||
|
||||
public static List<Model.Plan_MainPlan> getListDataForApi(string projectId, int startRowIndex, int maximumRows)
|
||||
{
|
||||
using (var db = new Model.SGGLDB(Funs.ConnString))
|
||||
{
|
||||
IQueryable<Model.Plan_MainPlan> q = db.Plan_MainPlan;
|
||||
if (!string.IsNullOrEmpty(projectId))
|
||||
{
|
||||
q = q.Where(e => e.ProjectId == projectId);
|
||||
}
|
||||
var qres = from x in q
|
||||
orderby x.CompileDate descending
|
||||
select new
|
||||
{
|
||||
x.MainPlanId,
|
||||
x.PlanCode,
|
||||
x.ProjectId,
|
||||
x.FileName,
|
||||
x.CompileDate,
|
||||
x.CompileMan,
|
||||
x.State,
|
||||
StateStr = ConvertState(x.State),
|
||||
CompileManName = (from y in db.Person_Persons where y.PersonId == x.CompileMan select y.PersonName).First(),
|
||||
FilePath = x.FilePath,
|
||||
};
|
||||
List<Model.Plan_MainPlan> res = new List<Model.Plan_MainPlan>();
|
||||
var list = qres.Skip(startRowIndex).Take(maximumRows).ToList();
|
||||
foreach (var item in list)
|
||||
{
|
||||
Model.Plan_MainPlan cd = new Model.Plan_MainPlan();
|
||||
cd.MainPlanId = item.MainPlanId;
|
||||
cd.ProjectId = item.ProjectId;
|
||||
cd.PlanCode = item.PlanCode;
|
||||
cd.FileName = item.FileName;
|
||||
cd.CompileDate = item.CompileDate;
|
||||
cd.CompileMan = item.CompileMan + "$" + item.CompileManName;
|
||||
cd.State = item.State + "$" + item.StateStr;
|
||||
cd.FilePath = item.FilePath;
|
||||
res.Add(cd);
|
||||
}
|
||||
return res;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 获取总包施工计划信息
|
||||
/// </summary>
|
||||
/// <param name="UnitWorkId"></param>
|
||||
/// <returns></returns>
|
||||
public static Model.Plan_MainPlan GetMainPlanByMainPlanIdForApi(string MainPlanId)
|
||||
{
|
||||
var q = Funs.DB.Plan_MainPlan.FirstOrDefault(e => e.MainPlanId == MainPlanId);
|
||||
if (q != null)
|
||||
{
|
||||
q.State = q.State + "$" + ConvertState(q.State);
|
||||
q.CompileMan = q.CompileMan + "$" + BLL.Person_PersonsService.GetPersonsNameById(q.CompileMan);
|
||||
}
|
||||
return q;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -259,5 +259,42 @@ namespace BLL
|
||||
db.SubmitChanges();
|
||||
}
|
||||
}
|
||||
|
||||
public static List<Model.Plan_SubPlanApprove> getApproveListDataByIdForApi(string SubPlanId)
|
||||
{
|
||||
using (var db = new Model.SGGLDB(Funs.ConnString))
|
||||
{
|
||||
var q = from x in db.Plan_SubPlanApprove
|
||||
where x.SubPlanId == SubPlanId && x.ApproveDate != null && x.ApproveType != "S"
|
||||
orderby x.ApproveDate
|
||||
select new
|
||||
{
|
||||
x.SubPlanApproveId,
|
||||
x.SubPlanId,
|
||||
ApproveMan = (from y in db.Person_Persons where y.PersonId == x.ApproveMan select y.PersonName).First(),
|
||||
x.ApproveDate,
|
||||
x.IsAgree,
|
||||
x.ApproveIdea,
|
||||
x.ApproveType,
|
||||
};
|
||||
List<Model.Plan_SubPlanApprove> res = new List<Model.Plan_SubPlanApprove>();
|
||||
var list = q.ToList();
|
||||
foreach (var item in list)
|
||||
{
|
||||
Model.Plan_SubPlanApprove cd = new Model.Plan_SubPlanApprove();
|
||||
cd.SubPlanApproveId = item.SubPlanApproveId;
|
||||
cd.SubPlanId = item.SubPlanId;
|
||||
cd.ApproveMan = item.ApproveMan;
|
||||
cd.ApproveDate = item.ApproveDate;
|
||||
cd.IsAgree = item.IsAgree;
|
||||
cd.ApproveIdea = item.ApproveIdea;
|
||||
cd.ApproveType = item.ApproveType;
|
||||
res.Add(cd);
|
||||
}
|
||||
return res;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user