修改质量接口
This commit is contained in:
@@ -0,0 +1,2 @@
|
||||
alter table [dbo].[Train_TrainPlan] add AttachUrl nvarchar(1000) null
|
||||
GO
|
||||
@@ -739,5 +739,79 @@ namespace BLL
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region 获取质量培训对象
|
||||
/// <summary>
|
||||
/// 获取质量培训对象
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public static List<Model.BaseInfoItem> getPlanTrainPersons()
|
||||
{
|
||||
using (Model.SGGLDB db = new Model.SGGLDB(Funs.ConnString))
|
||||
{
|
||||
var getDataLists = (from x in db.Base_CQMSTrainObject
|
||||
orderby x.TrainObjectCode
|
||||
select new Model.BaseInfoItem { BaseInfoId = x.TrainObjectId, BaseInfoName = x.TrainObjectName }).ToList();
|
||||
return getDataLists;
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region 获取质量培训类别
|
||||
/// <summary>
|
||||
/// 获取质量培训类别
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public static List<Model.BaseInfoItem> getCQMSTrainType()
|
||||
{
|
||||
using (Model.SGGLDB db = new Model.SGGLDB(Funs.ConnString))
|
||||
{
|
||||
var getDataLists = (from x in Funs.DB.Base_CQMSTrainType
|
||||
orderby x.TrainTypeCode
|
||||
select new Model.BaseInfoItem { BaseInfoId = x.TrainTypeId, BaseInfoCode = x.TrainTypeCode, BaseInfoName = x.TrainTypeName }).ToList();
|
||||
return getDataLists;
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region 获取质量培训主持人
|
||||
/// <summary>
|
||||
/// 获取质量培训主持人
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public static List<Model.BaseInfoItem> getCQMSTrainHostMan(string projectId)
|
||||
{
|
||||
var list = BLL.SitePerson_PersonService.GetSitePerson_PersonListByProjectIdUnitTypeRoleIds(projectId, Const.ProjectUnitType_1, Const.QAManager + "," + Const.CQEngineer);
|
||||
List<Model.BaseInfoItem> items = new List<Model.BaseInfoItem>();
|
||||
foreach (var item in list)
|
||||
{
|
||||
Model.BaseInfoItem b = new Model.BaseInfoItem();
|
||||
b.BaseInfoId = item.PersonId;
|
||||
b.BaseInfoName = item.PersonName;
|
||||
items.Add(b);
|
||||
}
|
||||
return items;
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region 获取质量培训参与培训教育人员信息
|
||||
/// <summary>
|
||||
/// 获取质量培训参与培训教育人员信息
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public static List<Model.BaseInfoItem> getRealTrainPersons(string projectId)
|
||||
{
|
||||
var list = BLL.SitePerson_PersonService.GetSitePerson_PersonListByProjectIdUnitTypeRoleIds(projectId, Const.ProjectUnitType_1 + "," + Const.ProjectUnitType_2, null);
|
||||
List<Model.BaseInfoItem> items = new List<Model.BaseInfoItem>();
|
||||
foreach (var item in list)
|
||||
{
|
||||
Model.BaseInfoItem b = new Model.BaseInfoItem();
|
||||
b.BaseInfoId = item.PersonId;
|
||||
b.BaseInfoName = item.PersonName;
|
||||
items.Add(b);
|
||||
}
|
||||
return items;
|
||||
}
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -78,5 +78,162 @@ namespace BLL
|
||||
db.SubmitChanges();
|
||||
}
|
||||
}
|
||||
|
||||
//<summary>
|
||||
//获取培训对象
|
||||
//</summary>
|
||||
//<param name="state"></param>
|
||||
//<returns></returns>
|
||||
public static string ConvertPlanTrainPersons(object PlanTrainPersons)
|
||||
{
|
||||
string names = string.Empty;
|
||||
if (PlanTrainPersons != null)
|
||||
{
|
||||
string[] strs = PlanTrainPersons.ToString().Split(',');
|
||||
foreach (var item in strs)
|
||||
{
|
||||
names += BLL.CQMSTrainObjectService.GetTrainObjectNameById(item) + ",";
|
||||
}
|
||||
if (!string.IsNullOrEmpty(names))
|
||||
{
|
||||
names = names.Substring(0, names.Length - 1);
|
||||
}
|
||||
}
|
||||
return names;
|
||||
}
|
||||
|
||||
public static List<Model.Train_TrainPlan> getListDataForApi(string projectId, int startRowIndex, int maximumRows)
|
||||
{
|
||||
using (var db = new Model.SGGLDB(Funs.ConnString))
|
||||
{
|
||||
IQueryable<Model.Train_TrainPlan> q = db.Train_TrainPlan;
|
||||
if (!string.IsNullOrEmpty(projectId))
|
||||
{
|
||||
q = q.Where(e => e.ProjectId == projectId);
|
||||
}
|
||||
var qres = from x in q
|
||||
orderby x.CompileDate descending
|
||||
select new
|
||||
{
|
||||
x.TrainPlanId,
|
||||
x.ProjectId,
|
||||
x.PlanTrainPersons,
|
||||
PlanTrainPersonsStr = ConvertPlanTrainPersons(x.PlanTrainPersons),
|
||||
x.TrainTypeId,
|
||||
TrainTypeName = (from y in db.Base_CQMSTrainType where y.TrainTypeId == x.TrainTypeId select y.TrainTypeName).First(),
|
||||
x.TrainContent,
|
||||
x.PlanTrainDate,
|
||||
x.HostMan,
|
||||
x.RealTrainDate,
|
||||
x.Place,
|
||||
x.TeachHour,
|
||||
x.TrainPersonNum,
|
||||
x.RealTrainPersons,
|
||||
x.CompileDate,
|
||||
x.CompileMan,
|
||||
CompileManName = (from y in db.Person_Persons where y.PersonId == x.CompileMan select y.PersonName).First(),
|
||||
};
|
||||
List<Model.Train_TrainPlan> res = new List<Model.Train_TrainPlan>();
|
||||
var list = qres.Skip(startRowIndex).Take(maximumRows).ToList();
|
||||
foreach (var item in list)
|
||||
{
|
||||
Model.Train_TrainPlan cd = new Model.Train_TrainPlan();
|
||||
cd.TrainPlanId = item.TrainPlanId;
|
||||
cd.ProjectId = item.ProjectId;
|
||||
cd.PlanTrainPersons = item.PlanTrainPersons + "$" + item.PlanTrainPersonsStr;
|
||||
cd.TrainTypeId = item.TrainTypeId + "$" + item.TrainTypeName;
|
||||
cd.TrainContent = item.TrainContent;
|
||||
cd.PlanTrainDate = item.PlanTrainDate;
|
||||
cd.HostMan = item.HostMan;
|
||||
cd.RealTrainDate = item.RealTrainDate;
|
||||
cd.Place = item.Place;
|
||||
cd.TeachHour = item.TeachHour;
|
||||
cd.TrainPersonNum = item.TrainPersonNum;
|
||||
cd.RealTrainPersons = item.RealTrainPersons;
|
||||
cd.CompileDate = item.CompileDate;
|
||||
cd.CompileMan = item.CompileMan + "$" + item.CompileManName;
|
||||
res.Add(cd);
|
||||
}
|
||||
return res;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 获取质量培训信息
|
||||
/// </summary>
|
||||
/// <param name="UnitWorkId"></param>
|
||||
/// <returns></returns>
|
||||
public static Model.Train_TrainPlan GetTraiPlanByTrainPlanIdForApi(string TrainPlanId)
|
||||
{
|
||||
using (var db = new Model.SGGLDB(Funs.ConnString))
|
||||
{
|
||||
var q = db.Train_TrainPlan.FirstOrDefault(e => e.TrainPlanId == TrainPlanId);
|
||||
if (q != null)
|
||||
{
|
||||
q.PlanTrainPersons = q.PlanTrainPersons + "$" + ConvertPlanTrainPersons(q.PlanTrainPersons);
|
||||
q.TrainTypeId = q.TrainTypeId + "$" + (from y in db.Base_CQMSTrainType where y.TrainTypeId == q.TrainTypeId select y.TrainTypeName).First();
|
||||
q.RealTrainPersons = q.RealTrainPersons + "$" + Person_PersonsService.getPersonsNamesPersonIds(q.RealTrainPersons);
|
||||
q.CompileMan = q.CompileMan + "$" + BLL.Person_PersonsService.GetPersonsNameById(q.CompileMan);
|
||||
q.AttachUrl = AttachFileService.getFileUrl(q.TrainPlanId);
|
||||
}
|
||||
return q;
|
||||
}
|
||||
}
|
||||
|
||||
public static void AddTrainPlanForApi(Model.Train_TrainPlan TrainPlan)
|
||||
{
|
||||
using (var db = new Model.SGGLDB(Funs.ConnString))
|
||||
{
|
||||
Model.Train_TrainPlan newTrainPlan = new Model.Train_TrainPlan();
|
||||
newTrainPlan.TrainPlanId = TrainPlan.TrainPlanId;
|
||||
newTrainPlan.ProjectId = TrainPlan.ProjectId;
|
||||
newTrainPlan.PlanTrainPersons = TrainPlan.PlanTrainPersons;
|
||||
newTrainPlan.TrainTypeId = TrainPlan.TrainTypeId;
|
||||
newTrainPlan.TrainContent = TrainPlan.TrainContent;
|
||||
newTrainPlan.PlanTrainDate = TrainPlan.PlanTrainDate;
|
||||
newTrainPlan.HostMan = TrainPlan.HostMan;
|
||||
newTrainPlan.RealTrainDate = TrainPlan.RealTrainDate;
|
||||
newTrainPlan.Place = TrainPlan.Place;
|
||||
newTrainPlan.TeachHour = TrainPlan.TeachHour;
|
||||
newTrainPlan.TrainPersonNum = TrainPlan.TrainPersonNum;
|
||||
newTrainPlan.RealTrainPersons = TrainPlan.RealTrainPersons;
|
||||
newTrainPlan.CompileMan = TrainPlan.CompileMan;
|
||||
newTrainPlan.CompileDate = TrainPlan.CompileDate;
|
||||
db.Train_TrainPlan.InsertOnSubmit(newTrainPlan);
|
||||
db.SubmitChanges();
|
||||
}
|
||||
}
|
||||
|
||||
public static void UpdateTrainPlanForApi(Model.Train_TrainPlan TrainPlan)
|
||||
{
|
||||
using (Model.SGGLDB db = new Model.SGGLDB(Funs.ConnString))
|
||||
{
|
||||
Model.Train_TrainPlan newTrainPlan = db.Train_TrainPlan.FirstOrDefault(e => e.TrainPlanId == TrainPlan.TrainPlanId);
|
||||
if (newTrainPlan != null)
|
||||
{
|
||||
if (!string.IsNullOrEmpty(TrainPlan.PlanTrainPersons))
|
||||
newTrainPlan.PlanTrainPersons = TrainPlan.PlanTrainPersons;
|
||||
if (!string.IsNullOrEmpty(TrainPlan.TrainTypeId))
|
||||
newTrainPlan.TrainTypeId = TrainPlan.TrainTypeId;
|
||||
if (!string.IsNullOrEmpty(TrainPlan.TrainContent))
|
||||
newTrainPlan.TrainContent = TrainPlan.TrainContent;
|
||||
if (TrainPlan.PlanTrainDate.HasValue)
|
||||
newTrainPlan.PlanTrainDate = TrainPlan.PlanTrainDate;
|
||||
if (!string.IsNullOrEmpty(TrainPlan.HostMan))
|
||||
newTrainPlan.HostMan = TrainPlan.HostMan;
|
||||
if (TrainPlan.RealTrainDate.HasValue)
|
||||
newTrainPlan.RealTrainDate = TrainPlan.RealTrainDate;
|
||||
if (!string.IsNullOrEmpty(TrainPlan.Place))
|
||||
newTrainPlan.Place = TrainPlan.Place;
|
||||
if (TrainPlan.TeachHour.HasValue)
|
||||
newTrainPlan.TeachHour = TrainPlan.TeachHour;
|
||||
if (TrainPlan.TrainPersonNum.HasValue)
|
||||
newTrainPlan.TrainPersonNum = TrainPlan.TrainPersonNum;
|
||||
if (!string.IsNullOrEmpty(TrainPlan.RealTrainPersons))
|
||||
newTrainPlan.RealTrainPersons = TrainPlan.RealTrainPersons;
|
||||
db.SubmitChanges();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -39,6 +39,9 @@
|
||||
<f:TextBox ID="txtEquipmentName" runat="server" Label="设备名称" LabelWidth="80px"
|
||||
LabelAlign="Right">
|
||||
</f:TextBox>
|
||||
<f:TextBox ID="txtSpecificationAndModel" runat="server" Label="规格型号" LabelWidth="80px"
|
||||
LabelAlign="Right">
|
||||
</f:TextBox>
|
||||
<f:ToolbarFill runat="server"></f:ToolbarFill>
|
||||
<f:Button ID="btnSearch" Icon="SystemSearch"
|
||||
EnablePostBack="true" runat="server" OnClick="btnSearch_Click">
|
||||
|
||||
@@ -86,6 +86,11 @@ namespace FineUIPro.Web.CQMS.Material
|
||||
strSql += " AND EquipmentName like @EquipmentName";
|
||||
listStr.Add(new SqlParameter("@EquipmentName", "%" + this.txtEquipmentName.Text.Trim() + "%"));
|
||||
}
|
||||
if (!string.IsNullOrEmpty(this.txtSpecificationAndModel.Text.Trim()))
|
||||
{
|
||||
strSql += " AND SpecificationAndModel like @SpecificationAndModel";
|
||||
listStr.Add(new SqlParameter("@SpecificationAndModel", "%" + this.txtSpecificationAndModel.Text.Trim() + "%"));
|
||||
}
|
||||
SqlParameter[] parameter = listStr.ToArray();
|
||||
DataTable tb = SQLHelper.GetDataTableRunText(strSql, parameter);
|
||||
return tb;
|
||||
|
||||
@@ -93,6 +93,15 @@ namespace FineUIPro.Web.CQMS.Material {
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.TextBox txtEquipmentName;
|
||||
|
||||
/// <summary>
|
||||
/// txtSpecificationAndModel 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.TextBox txtSpecificationAndModel;
|
||||
|
||||
/// <summary>
|
||||
/// btnSearch 控件。
|
||||
/// </summary>
|
||||
|
||||
@@ -39,6 +39,9 @@
|
||||
<f:TextBox ID="txtMaterialName" runat="server" Label="材料名称" LabelWidth="80px"
|
||||
LabelAlign="Right">
|
||||
</f:TextBox>
|
||||
<f:TextBox ID="txtSpecificationAndModel" runat="server" Label="规格型号" LabelWidth="80px"
|
||||
LabelAlign="Right">
|
||||
</f:TextBox>
|
||||
<f:ToolbarFill runat="server"></f:ToolbarFill>
|
||||
<f:Button ID="btnSearch" Icon="SystemSearch"
|
||||
EnablePostBack="true" runat="server" OnClick="btnSearch_Click">
|
||||
|
||||
@@ -86,6 +86,11 @@ namespace FineUIPro.Web.CQMS.Material
|
||||
strSql += " AND MaterialName like @MaterialName";
|
||||
listStr.Add(new SqlParameter("@MaterialName", "%" + this.txtMaterialName.Text.Trim() + "%"));
|
||||
}
|
||||
if (!string.IsNullOrEmpty(this.txtSpecificationAndModel.Text.Trim()))
|
||||
{
|
||||
strSql += " AND SpecificationAndModel like @SpecificationAndModel";
|
||||
listStr.Add(new SqlParameter("@SpecificationAndModel", "%" + this.txtSpecificationAndModel.Text.Trim() + "%"));
|
||||
}
|
||||
SqlParameter[] parameter = listStr.ToArray();
|
||||
DataTable tb = SQLHelper.GetDataTableRunText(strSql, parameter);
|
||||
return tb;
|
||||
|
||||
@@ -93,6 +93,15 @@ namespace FineUIPro.Web.CQMS.Material {
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.TextBox txtMaterialName;
|
||||
|
||||
/// <summary>
|
||||
/// txtSpecificationAndModel 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.TextBox txtSpecificationAndModel;
|
||||
|
||||
/// <summary>
|
||||
/// btnSearch 控件。
|
||||
/// </summary>
|
||||
|
||||
@@ -212039,6 +212039,8 @@ namespace Model
|
||||
|
||||
private System.Nullable<System.DateTime> _CompileDate;
|
||||
|
||||
private string _AttachUrl;
|
||||
|
||||
private EntityRef<Base_CQMSTrainType> _Base_CQMSTrainType;
|
||||
|
||||
private EntityRef<Base_Project> _Base_Project;
|
||||
@@ -212075,6 +212077,8 @@ namespace Model
|
||||
partial void OnCompileManChanged();
|
||||
partial void OnCompileDateChanging(System.Nullable<System.DateTime> value);
|
||||
partial void OnCompileDateChanged();
|
||||
partial void OnAttachUrlChanging(string value);
|
||||
partial void OnAttachUrlChanged();
|
||||
#endregion
|
||||
|
||||
public Train_TrainPlan()
|
||||
@@ -212372,6 +212376,26 @@ namespace Model
|
||||
}
|
||||
}
|
||||
|
||||
[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_AttachUrl", DbType="NVarChar(1000)")]
|
||||
public string AttachUrl
|
||||
{
|
||||
get
|
||||
{
|
||||
return this._AttachUrl;
|
||||
}
|
||||
set
|
||||
{
|
||||
if ((this._AttachUrl != value))
|
||||
{
|
||||
this.OnAttachUrlChanging(value);
|
||||
this.SendPropertyChanging();
|
||||
this._AttachUrl = value;
|
||||
this.SendPropertyChanged("AttachUrl");
|
||||
this.OnAttachUrlChanged();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
[global::System.Data.Linq.Mapping.AssociationAttribute(Name="FK_Train_TrainPlan_Base_CQMSTrainType", Storage="_Base_CQMSTrainType", ThisKey="TrainTypeId", OtherKey="TrainTypeId", IsForeignKey=true)]
|
||||
public Base_CQMSTrainType Base_CQMSTrainType
|
||||
{
|
||||
|
||||
@@ -0,0 +1,16 @@
|
||||
using BLL;
|
||||
using Model;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Web.Http;
|
||||
|
||||
namespace WebAPI.Controllers
|
||||
{
|
||||
/// <summary>
|
||||
/// 质量会议
|
||||
/// </summary>
|
||||
public class CQMSMeetingController : ApiController
|
||||
{
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,104 @@
|
||||
using BLL;
|
||||
using Model;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Web.Http;
|
||||
|
||||
namespace WebAPI.Controllers
|
||||
{
|
||||
/// <summary>
|
||||
/// 质量计划
|
||||
/// </summary>
|
||||
public class CQMSPlanController : ApiController
|
||||
{
|
||||
/// <summary>
|
||||
/// 根据项目id获取总包质量计划列表集合
|
||||
/// </summary>
|
||||
/// <param name="projectId"></param>
|
||||
/// <param name="index"></param>
|
||||
/// <param name="page"></param>
|
||||
/// <returns></returns>
|
||||
[HttpGet]
|
||||
public ResponseData<List<Plan_MainPlan>> getMainPlanList(string projectId, int index, int page)
|
||||
{
|
||||
ResponseData<List<Plan_MainPlan>> res = new ResponseData<List<Plan_MainPlan>>();
|
||||
res.successful = true;
|
||||
res.resultValue = BLL.CQMS_MainPlanService.getListDataForApi(projectId, index, page);
|
||||
return res;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 根据项目id获取分包质量计划列表集合
|
||||
/// </summary>
|
||||
/// <param name="projectId"></param>
|
||||
/// <param name="index"></param>
|
||||
/// <param name="page"></param>
|
||||
/// <returns></returns>
|
||||
[HttpGet]
|
||||
public ResponseData<List<Plan_SubPlan>> getSubPlanList(string projectId, int index, int page)
|
||||
{
|
||||
ResponseData<List<Plan_SubPlan>> res = new ResponseData<List<Plan_SubPlan>>();
|
||||
res.successful = true;
|
||||
res.resultValue = BLL.CQMS_SubPlanService.getListDataForApi(projectId, index, page);
|
||||
return res;
|
||||
}
|
||||
/// <summary>
|
||||
/// 根据id获取总包质量计划详情
|
||||
/// </summary>
|
||||
/// <param name="id"></param>
|
||||
/// <returns></returns>
|
||||
[HttpGet]
|
||||
public ResponseData<Plan_MainPlan> GetMainPlanByMainPlanId(string id)
|
||||
{
|
||||
ResponseData<Plan_MainPlan> res = new ResponseData<Plan_MainPlan>();
|
||||
Plan_MainPlan cd = BLL.CQMS_MainPlanService.GetMainPlanByMainPlanIdForApi(id);
|
||||
|
||||
res.successful = true;
|
||||
res.resultValue = BeanUtil.CopyOjbect<Plan_MainPlan>(cd, true);
|
||||
return res;
|
||||
}
|
||||
/// <summary>
|
||||
/// 根据id获取分包质量计划详情
|
||||
/// </summary>
|
||||
/// <param name="id"></param>
|
||||
/// <returns></returns>
|
||||
[HttpGet]
|
||||
public ResponseData<Plan_SubPlan> GetSubPlanBySubPlanId(string id)
|
||||
{
|
||||
ResponseData<Plan_SubPlan> res = new ResponseData<Plan_SubPlan>();
|
||||
Plan_SubPlan cd = BLL.CQMS_SubPlanService.GetSubPlanBySubPlanIdForApi(id);
|
||||
|
||||
res.successful = true;
|
||||
res.resultValue = BeanUtil.CopyOjbect<Plan_SubPlan>(cd, true);
|
||||
return res;
|
||||
}
|
||||
/// <summary>
|
||||
/// 根据id获取总包质量计划审批明细
|
||||
/// </summary>
|
||||
/// <param name="id"></param>
|
||||
/// <returns></returns>
|
||||
[HttpGet]
|
||||
public ResponseData<List<Plan_MainPlanApprove>> GetMainPlanApproveById(string id)
|
||||
{
|
||||
ResponseData<List<Plan_MainPlanApprove>> res = new ResponseData<List<Plan_MainPlanApprove>>();
|
||||
res.successful = true;
|
||||
res.resultValue = BLL.CQMS_MainPlanApproveService.getApproveListDataByIdForApi(id);
|
||||
return res;
|
||||
|
||||
}
|
||||
/// <summary>
|
||||
/// 根据id获取分包质量计划审批明细
|
||||
/// </summary>
|
||||
/// <param name="id"></param>
|
||||
/// <returns></returns>
|
||||
[HttpGet]
|
||||
public ResponseData<List<Plan_SubPlanApprove>> GetSubPlanApproveById(string id)
|
||||
{
|
||||
ResponseData<List<Plan_SubPlanApprove>> res = new ResponseData<List<Plan_SubPlanApprove>>();
|
||||
res.successful = true;
|
||||
res.resultValue = BLL.CQMS_SubPlanApproveService.getApproveListDataByIdForApi(id);
|
||||
return res;
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,170 @@
|
||||
using BLL;
|
||||
using Model;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Web.Http;
|
||||
|
||||
namespace WebAPI.Controllers
|
||||
{
|
||||
/// <summary>
|
||||
/// 质量培训计划
|
||||
/// </summary>
|
||||
public class CQMSTrainController : ApiController
|
||||
{
|
||||
/// <summary>
|
||||
/// 根据项目id获取质量培训列表集合
|
||||
/// </summary>
|
||||
/// <param name="projectId"></param>
|
||||
/// <param name="index"></param>
|
||||
/// <param name="page"></param>
|
||||
/// <returns></returns>
|
||||
[HttpGet]
|
||||
public ResponseData<List<Train_TrainPlan>> getTrainPlanList(string projectId, int index, int page)
|
||||
{
|
||||
ResponseData<List<Train_TrainPlan>> res = new ResponseData<List<Train_TrainPlan>>();
|
||||
res.successful = true;
|
||||
res.resultValue = BLL.CQMS_TrainPlanService.getListDataForApi(projectId, index, page);
|
||||
return res;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 根据id获取质量培训详情
|
||||
/// </summary>
|
||||
/// <param name="id"></param>
|
||||
/// <returns></returns>
|
||||
[HttpGet]
|
||||
public ResponseData<Train_TrainPlan> GetTrainPlanByTrainPlanId(string id)
|
||||
{
|
||||
ResponseData<Train_TrainPlan> res = new ResponseData<Train_TrainPlan>();
|
||||
Train_TrainPlan cd = BLL.CQMS_TrainPlanService.GetTraiPlanByTrainPlanIdForApi(id);
|
||||
|
||||
res.successful = true;
|
||||
res.resultValue = BeanUtil.CopyOjbect<Train_TrainPlan>(cd, true);
|
||||
return res;
|
||||
}
|
||||
/// <summary>
|
||||
/// 保存质量培训
|
||||
/// </summary>
|
||||
/// <param name="trainPlan"></param>
|
||||
/// <returns></returns>
|
||||
[HttpPost]
|
||||
public ResponseData<string> AddTrainPlan([FromBody] Model.Train_TrainPlan trainPlan)
|
||||
{
|
||||
ResponseData<string> res = new ResponseData<string>();
|
||||
try
|
||||
{
|
||||
if (string.IsNullOrEmpty(trainPlan.TrainPlanId))
|
||||
{
|
||||
trainPlan.TrainPlanId = Guid.NewGuid().ToString();
|
||||
BLL.CQMS_TrainPlanService.AddTrainPlanForApi(trainPlan);
|
||||
SaveAttachFile(trainPlan.TrainPlanId, BLL.Const.CQMSTrainPlanMenuId, trainPlan.AttachUrl);
|
||||
res.resultValue = trainPlan.TrainPlanId;
|
||||
res.successful = true;
|
||||
}
|
||||
else
|
||||
{
|
||||
BLL.CQMS_TrainPlanService.UpdateTrainPlanForApi(trainPlan);
|
||||
SaveAttachFile(trainPlan.TrainPlanId, BLL.Const.CQMSTrainPlanMenuId, trainPlan.AttachUrl);
|
||||
res.resultValue = trainPlan.TrainPlanId;
|
||||
res.successful = true;
|
||||
}
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
res.successful = false;
|
||||
res.resultHint = e.StackTrace;
|
||||
}
|
||||
return res;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
public static void SaveAttachFile(string dataId, string menuId, string url)
|
||||
{
|
||||
Model.ToDoItem toDoItem = new Model.ToDoItem
|
||||
{
|
||||
MenuId = menuId,
|
||||
DataId = dataId,
|
||||
UrlStr = url,
|
||||
};
|
||||
APIUpLoadFileService.SaveAttachUrl(toDoItem);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 获取培训对象列表信息
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public Model.ResponeData getPlanTrainPersons()
|
||||
{
|
||||
var responeData = new Model.ResponeData();
|
||||
try
|
||||
{
|
||||
responeData.data = APIBaseInfoService.getPlanTrainPersons();
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
responeData.code = 0;
|
||||
responeData.message = ex.Message;
|
||||
}
|
||||
return responeData;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 获取培训类别列表信息
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public Model.ResponeData getTrainType()
|
||||
{
|
||||
var responeData = new Model.ResponeData();
|
||||
try
|
||||
{
|
||||
responeData.data = APIBaseInfoService.getCQMSTrainType();
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
responeData.code = 0;
|
||||
responeData.message = ex.Message;
|
||||
}
|
||||
return responeData;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 获取培训主持人信息
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public Model.ResponeData getHostMan(string projectId)
|
||||
{
|
||||
var responeData = new Model.ResponeData();
|
||||
try
|
||||
{
|
||||
responeData.data = APIBaseInfoService.getCQMSTrainHostMan(projectId);
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
responeData.code = 0;
|
||||
responeData.message = ex.Message;
|
||||
}
|
||||
return responeData;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 获取参与培训教育人员信息
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public Model.ResponeData getRealTrainPersons(string projectId)
|
||||
{
|
||||
var responeData = new Model.ResponeData();
|
||||
try
|
||||
{
|
||||
responeData.data = APIBaseInfoService.getRealTrainPersons(projectId);
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
responeData.code = 0;
|
||||
responeData.message = ex.Message;
|
||||
}
|
||||
return responeData;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -167,7 +167,10 @@
|
||||
<Compile Include="Areas\HelpPage\XmlDocumentationProvider.cs" />
|
||||
<Compile Include="Controllers\BaseInfoController.cs" />
|
||||
<Compile Include="Controllers\CommonController.cs" />
|
||||
<Compile Include="Controllers\CQMS\CQMSMeetingController.cs" />
|
||||
<Compile Include="Controllers\CQMS\CQMSPersonManageController.cs" />
|
||||
<Compile Include="Controllers\CQMS\CQMSPlanController.cs" />
|
||||
<Compile Include="Controllers\CQMS\CQMSTrainController.cs" />
|
||||
<Compile Include="Controllers\CQMS\WBSController.cs" />
|
||||
<Compile Include="Controllers\HJGL\HJGLIndexController.cs" />
|
||||
<Compile Include="Controllers\HJGL\PackagingManageController.cs" />
|
||||
|
||||
Reference in New Issue
Block a user