修改质量接口
This commit is contained in:
@@ -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;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user