From c30f2badb9bf1cacfb1156855ab7b977018ceba0 Mon Sep 17 00:00:00 2001
From: gaofei <181547018@qq.com>
Date: Wed, 15 Mar 2023 10:55:53 +0800
Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E8=B4=A8=E9=87=8F=E6=8E=A5?=
=?UTF-8?q?=E5=8F=A3?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
DataBase/版本日志/SGGLDB_V2023-03-14.sql | 2 +
SGGL/BLL/API/APIBaseInfoService.cs | 74 ++++++++
.../CQMS/Plan/CQMS_MainPlanApproveService.cs | 35 ++++
SGGL/BLL/CQMS/Plan/CQMS_MainPlanService.cs | 110 +++++++++++-
.../CQMS/Plan/CQMS_SubPlanApproveService.cs | 37 ++++
SGGL/BLL/CQMS/Plan/CQMS_SubPlanService.cs | 73 ++++++++
SGGL/BLL/CQMS/Train/CQMS_TrainPlanService.cs | 157 ++++++++++++++++
.../CQMS/Material/EquipmentSearch.aspx | 3 +
.../CQMS/Material/EquipmentSearch.aspx.cs | 5 +
.../Material/EquipmentSearch.aspx.designer.cs | 9 +
.../CQMS/Material/MaterialSearch.aspx | 3 +
.../CQMS/Material/MaterialSearch.aspx.cs | 5 +
.../Material/MaterialSearch.aspx.designer.cs | 9 +
SGGL/Model/Model.cs | 24 +++
.../Controllers/CQMS/CQMSMeetingController.cs | 16 ++
.../Controllers/CQMS/CQMSPlanController.cs | 104 +++++++++++
.../Controllers/CQMS/CQMSTrainController.cs | 170 ++++++++++++++++++
SGGL/WebAPI/WebAPI.csproj | 3 +
18 files changed, 838 insertions(+), 1 deletion(-)
create mode 100644 DataBase/版本日志/SGGLDB_V2023-03-14.sql
create mode 100644 SGGL/WebAPI/Controllers/CQMS/CQMSMeetingController.cs
create mode 100644 SGGL/WebAPI/Controllers/CQMS/CQMSPlanController.cs
create mode 100644 SGGL/WebAPI/Controllers/CQMS/CQMSTrainController.cs
diff --git a/DataBase/版本日志/SGGLDB_V2023-03-14.sql b/DataBase/版本日志/SGGLDB_V2023-03-14.sql
new file mode 100644
index 00000000..b759c3cc
--- /dev/null
+++ b/DataBase/版本日志/SGGLDB_V2023-03-14.sql
@@ -0,0 +1,2 @@
+alter table [dbo].[Train_TrainPlan] add AttachUrl nvarchar(1000) null
+GO
\ No newline at end of file
diff --git a/SGGL/BLL/API/APIBaseInfoService.cs b/SGGL/BLL/API/APIBaseInfoService.cs
index 0aa5171e..6b7d9e58 100644
--- a/SGGL/BLL/API/APIBaseInfoService.cs
+++ b/SGGL/BLL/API/APIBaseInfoService.cs
@@ -739,5 +739,79 @@ namespace BLL
}
}
#endregion
+
+ #region 获取质量培训对象
+ ///
+ /// 获取质量培训对象
+ ///
+ ///
+ public static List 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 获取质量培训类别
+ ///
+ /// 获取质量培训类别
+ ///
+ ///
+ public static List 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 获取质量培训主持人
+ ///
+ /// 获取质量培训主持人
+ ///
+ ///
+ public static List getCQMSTrainHostMan(string projectId)
+ {
+ var list = BLL.SitePerson_PersonService.GetSitePerson_PersonListByProjectIdUnitTypeRoleIds(projectId, Const.ProjectUnitType_1, Const.QAManager + "," + Const.CQEngineer);
+ List items = new List();
+ 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 获取质量培训参与培训教育人员信息
+ ///
+ /// 获取质量培训参与培训教育人员信息
+ ///
+ ///
+ public static List getRealTrainPersons(string projectId)
+ {
+ var list = BLL.SitePerson_PersonService.GetSitePerson_PersonListByProjectIdUnitTypeRoleIds(projectId, Const.ProjectUnitType_1 + "," + Const.ProjectUnitType_2, null);
+ List items = new List();
+ 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
}
}
diff --git a/SGGL/BLL/CQMS/Plan/CQMS_MainPlanApproveService.cs b/SGGL/BLL/CQMS/Plan/CQMS_MainPlanApproveService.cs
index fdc9fbf2..4c15c203 100644
--- a/SGGL/BLL/CQMS/Plan/CQMS_MainPlanApproveService.cs
+++ b/SGGL/BLL/CQMS/Plan/CQMS_MainPlanApproveService.cs
@@ -207,5 +207,40 @@ namespace BLL
{
return db.Plan_MainPlanApprove.FirstOrDefault(x => x.MainPlanId == MainPlanId && x.ApproveType == BLL.Const.MainPlan_Compile);
}
+
+ public static List 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 res = new List();
+ 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;
+ }
+ }
}
}
diff --git a/SGGL/BLL/CQMS/Plan/CQMS_MainPlanService.cs b/SGGL/BLL/CQMS/Plan/CQMS_MainPlanService.cs
index e04725c7..4bbe5917 100644
--- a/SGGL/BLL/CQMS/Plan/CQMS_MainPlanService.cs
+++ b/SGGL/BLL/CQMS/Plan/CQMS_MainPlanService.cs
@@ -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;
}
+
+ ///
+ /// 把状态转换代号为文字形式
+ ///
+ ///
+ ///
+ 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 getListDataForApi(string projectId, int startRowIndex, int maximumRows)
+ {
+ using (var db = new Model.SGGLDB(Funs.ConnString))
+ {
+ IQueryable 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 res = new List();
+ 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;
+ }
+ }
+
+ ///
+ /// 获取总包施工计划信息
+ ///
+ ///
+ ///
+ 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;
+ }
}
}
diff --git a/SGGL/BLL/CQMS/Plan/CQMS_SubPlanApproveService.cs b/SGGL/BLL/CQMS/Plan/CQMS_SubPlanApproveService.cs
index 4e366fee..ace062f5 100644
--- a/SGGL/BLL/CQMS/Plan/CQMS_SubPlanApproveService.cs
+++ b/SGGL/BLL/CQMS/Plan/CQMS_SubPlanApproveService.cs
@@ -259,5 +259,42 @@ namespace BLL
db.SubmitChanges();
}
}
+
+ public static List 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 res = new List();
+ 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;
+ }
+ }
+
+
}
}
diff --git a/SGGL/BLL/CQMS/Plan/CQMS_SubPlanService.cs b/SGGL/BLL/CQMS/Plan/CQMS_SubPlanService.cs
index 18508b10..2e909131 100644
--- a/SGGL/BLL/CQMS/Plan/CQMS_SubPlanService.cs
+++ b/SGGL/BLL/CQMS/Plan/CQMS_SubPlanService.cs
@@ -198,5 +198,78 @@ namespace BLL
rootNode.Nodes.Add(roleNode);
}
}
+
+ public static List getListDataForApi(string projectId, int startRowIndex, int maximumRows)
+ {
+ using (var db = new Model.SGGLDB(Funs.ConnString))
+ {
+ IQueryable 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 res = new List();
+ 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;
+ }
+ }
+
+ ///
+ /// 根据分包施工质量计划Id获取一个分包施工质量计划信息
+ ///
+ /// 分包施工质量计划Id
+ /// 一个分包施工质量计划实体
+ 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;
+ }
}
}
diff --git a/SGGL/BLL/CQMS/Train/CQMS_TrainPlanService.cs b/SGGL/BLL/CQMS/Train/CQMS_TrainPlanService.cs
index 7cc594e8..f154bf80 100644
--- a/SGGL/BLL/CQMS/Train/CQMS_TrainPlanService.cs
+++ b/SGGL/BLL/CQMS/Train/CQMS_TrainPlanService.cs
@@ -78,5 +78,162 @@ namespace BLL
db.SubmitChanges();
}
}
+
+ //
+ //获取培训对象
+ //
+ //
+ //
+ 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 getListDataForApi(string projectId, int startRowIndex, int maximumRows)
+ {
+ using (var db = new Model.SGGLDB(Funs.ConnString))
+ {
+ IQueryable 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 res = new List();
+ 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;
+ }
+ }
+
+ ///
+ /// 获取质量培训信息
+ ///
+ ///
+ ///
+ 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();
+ }
+ }
+ }
}
}
diff --git a/SGGL/FineUIPro.Web/CQMS/Material/EquipmentSearch.aspx b/SGGL/FineUIPro.Web/CQMS/Material/EquipmentSearch.aspx
index 810edde1..e82cb812 100644
--- a/SGGL/FineUIPro.Web/CQMS/Material/EquipmentSearch.aspx
+++ b/SGGL/FineUIPro.Web/CQMS/Material/EquipmentSearch.aspx
@@ -39,6 +39,9 @@
+
+
diff --git a/SGGL/FineUIPro.Web/CQMS/Material/EquipmentSearch.aspx.cs b/SGGL/FineUIPro.Web/CQMS/Material/EquipmentSearch.aspx.cs
index e915c594..a58c2797 100644
--- a/SGGL/FineUIPro.Web/CQMS/Material/EquipmentSearch.aspx.cs
+++ b/SGGL/FineUIPro.Web/CQMS/Material/EquipmentSearch.aspx.cs
@@ -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;
diff --git a/SGGL/FineUIPro.Web/CQMS/Material/EquipmentSearch.aspx.designer.cs b/SGGL/FineUIPro.Web/CQMS/Material/EquipmentSearch.aspx.designer.cs
index fc68e352..af994a1c 100644
--- a/SGGL/FineUIPro.Web/CQMS/Material/EquipmentSearch.aspx.designer.cs
+++ b/SGGL/FineUIPro.Web/CQMS/Material/EquipmentSearch.aspx.designer.cs
@@ -93,6 +93,15 @@ namespace FineUIPro.Web.CQMS.Material {
///
protected global::FineUIPro.TextBox txtEquipmentName;
+ ///
+ /// txtSpecificationAndModel 控件。
+ ///
+ ///
+ /// 自动生成的字段。
+ /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
+ ///
+ protected global::FineUIPro.TextBox txtSpecificationAndModel;
+
///
/// btnSearch 控件。
///
diff --git a/SGGL/FineUIPro.Web/CQMS/Material/MaterialSearch.aspx b/SGGL/FineUIPro.Web/CQMS/Material/MaterialSearch.aspx
index 775d0532..1dd2bc54 100644
--- a/SGGL/FineUIPro.Web/CQMS/Material/MaterialSearch.aspx
+++ b/SGGL/FineUIPro.Web/CQMS/Material/MaterialSearch.aspx
@@ -39,6 +39,9 @@
+
+
diff --git a/SGGL/FineUIPro.Web/CQMS/Material/MaterialSearch.aspx.cs b/SGGL/FineUIPro.Web/CQMS/Material/MaterialSearch.aspx.cs
index b185ddd0..ae8f9d23 100644
--- a/SGGL/FineUIPro.Web/CQMS/Material/MaterialSearch.aspx.cs
+++ b/SGGL/FineUIPro.Web/CQMS/Material/MaterialSearch.aspx.cs
@@ -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;
diff --git a/SGGL/FineUIPro.Web/CQMS/Material/MaterialSearch.aspx.designer.cs b/SGGL/FineUIPro.Web/CQMS/Material/MaterialSearch.aspx.designer.cs
index 3d9e4414..139ead17 100644
--- a/SGGL/FineUIPro.Web/CQMS/Material/MaterialSearch.aspx.designer.cs
+++ b/SGGL/FineUIPro.Web/CQMS/Material/MaterialSearch.aspx.designer.cs
@@ -93,6 +93,15 @@ namespace FineUIPro.Web.CQMS.Material {
///
protected global::FineUIPro.TextBox txtMaterialName;
+ ///
+ /// txtSpecificationAndModel 控件。
+ ///
+ ///
+ /// 自动生成的字段。
+ /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
+ ///
+ protected global::FineUIPro.TextBox txtSpecificationAndModel;
+
///
/// btnSearch 控件。
///
diff --git a/SGGL/Model/Model.cs b/SGGL/Model/Model.cs
index 1300d94f..e3fd855e 100644
--- a/SGGL/Model/Model.cs
+++ b/SGGL/Model/Model.cs
@@ -212039,6 +212039,8 @@ namespace Model
private System.Nullable _CompileDate;
+ private string _AttachUrl;
+
private EntityRef _Base_CQMSTrainType;
private EntityRef _Base_Project;
@@ -212075,6 +212077,8 @@ namespace Model
partial void OnCompileManChanged();
partial void OnCompileDateChanging(System.Nullable 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
{
diff --git a/SGGL/WebAPI/Controllers/CQMS/CQMSMeetingController.cs b/SGGL/WebAPI/Controllers/CQMS/CQMSMeetingController.cs
new file mode 100644
index 00000000..49972bcf
--- /dev/null
+++ b/SGGL/WebAPI/Controllers/CQMS/CQMSMeetingController.cs
@@ -0,0 +1,16 @@
+using BLL;
+using Model;
+using System;
+using System.Collections.Generic;
+using System.Web.Http;
+
+namespace WebAPI.Controllers
+{
+ ///
+ /// 质量会议
+ ///
+ public class CQMSMeetingController : ApiController
+ {
+
+ }
+}
diff --git a/SGGL/WebAPI/Controllers/CQMS/CQMSPlanController.cs b/SGGL/WebAPI/Controllers/CQMS/CQMSPlanController.cs
new file mode 100644
index 00000000..9d9d5fec
--- /dev/null
+++ b/SGGL/WebAPI/Controllers/CQMS/CQMSPlanController.cs
@@ -0,0 +1,104 @@
+using BLL;
+using Model;
+using System;
+using System.Collections.Generic;
+using System.Web.Http;
+
+namespace WebAPI.Controllers
+{
+ ///
+ /// 质量计划
+ ///
+ public class CQMSPlanController : ApiController
+ {
+ ///
+ /// 根据项目id获取总包质量计划列表集合
+ ///
+ ///
+ ///
+ ///
+ ///
+ [HttpGet]
+ public ResponseData> getMainPlanList(string projectId, int index, int page)
+ {
+ ResponseData> res = new ResponseData>();
+ res.successful = true;
+ res.resultValue = BLL.CQMS_MainPlanService.getListDataForApi(projectId, index, page);
+ return res;
+ }
+
+ ///
+ /// 根据项目id获取分包质量计划列表集合
+ ///
+ ///
+ ///
+ ///
+ ///
+ [HttpGet]
+ public ResponseData> getSubPlanList(string projectId, int index, int page)
+ {
+ ResponseData> res = new ResponseData>();
+ res.successful = true;
+ res.resultValue = BLL.CQMS_SubPlanService.getListDataForApi(projectId, index, page);
+ return res;
+ }
+ ///
+ /// 根据id获取总包质量计划详情
+ ///
+ ///
+ ///
+ [HttpGet]
+ public ResponseData GetMainPlanByMainPlanId(string id)
+ {
+ ResponseData res = new ResponseData();
+ Plan_MainPlan cd = BLL.CQMS_MainPlanService.GetMainPlanByMainPlanIdForApi(id);
+
+ res.successful = true;
+ res.resultValue = BeanUtil.CopyOjbect(cd, true);
+ return res;
+ }
+ ///
+ /// 根据id获取分包质量计划详情
+ ///
+ ///
+ ///
+ [HttpGet]
+ public ResponseData GetSubPlanBySubPlanId(string id)
+ {
+ ResponseData res = new ResponseData();
+ Plan_SubPlan cd = BLL.CQMS_SubPlanService.GetSubPlanBySubPlanIdForApi(id);
+
+ res.successful = true;
+ res.resultValue = BeanUtil.CopyOjbect(cd, true);
+ return res;
+ }
+ ///
+ /// 根据id获取总包质量计划审批明细
+ ///
+ ///
+ ///
+ [HttpGet]
+ public ResponseData> GetMainPlanApproveById(string id)
+ {
+ ResponseData> res = new ResponseData>();
+ res.successful = true;
+ res.resultValue = BLL.CQMS_MainPlanApproveService.getApproveListDataByIdForApi(id);
+ return res;
+
+ }
+ ///
+ /// 根据id获取分包质量计划审批明细
+ ///
+ ///
+ ///
+ [HttpGet]
+ public ResponseData> GetSubPlanApproveById(string id)
+ {
+ ResponseData> res = new ResponseData>();
+ res.successful = true;
+ res.resultValue = BLL.CQMS_SubPlanApproveService.getApproveListDataByIdForApi(id);
+ return res;
+
+ }
+ }
+}
diff --git a/SGGL/WebAPI/Controllers/CQMS/CQMSTrainController.cs b/SGGL/WebAPI/Controllers/CQMS/CQMSTrainController.cs
new file mode 100644
index 00000000..eadd83e4
--- /dev/null
+++ b/SGGL/WebAPI/Controllers/CQMS/CQMSTrainController.cs
@@ -0,0 +1,170 @@
+using BLL;
+using Model;
+using System;
+using System.Collections.Generic;
+using System.Web.Http;
+
+namespace WebAPI.Controllers
+{
+ ///
+ /// 质量培训计划
+ ///
+ public class CQMSTrainController : ApiController
+ {
+ ///
+ /// 根据项目id获取质量培训列表集合
+ ///
+ ///
+ ///
+ ///
+ ///
+ [HttpGet]
+ public ResponseData> getTrainPlanList(string projectId, int index, int page)
+ {
+ ResponseData> res = new ResponseData>();
+ res.successful = true;
+ res.resultValue = BLL.CQMS_TrainPlanService.getListDataForApi(projectId, index, page);
+ return res;
+ }
+
+ ///
+ /// 根据id获取质量培训详情
+ ///
+ ///
+ ///
+ [HttpGet]
+ public ResponseData GetTrainPlanByTrainPlanId(string id)
+ {
+ ResponseData res = new ResponseData();
+ Train_TrainPlan cd = BLL.CQMS_TrainPlanService.GetTraiPlanByTrainPlanIdForApi(id);
+
+ res.successful = true;
+ res.resultValue = BeanUtil.CopyOjbect(cd, true);
+ return res;
+ }
+ ///
+ /// 保存质量培训
+ ///
+ ///
+ ///
+ [HttpPost]
+ public ResponseData AddTrainPlan([FromBody] Model.Train_TrainPlan trainPlan)
+ {
+ ResponseData res = new ResponseData();
+ 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;
+ }
+
+ ///
+ ///
+ ///
+ 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);
+ }
+
+ ///
+ /// 获取培训对象列表信息
+ ///
+ ///
+ 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;
+ }
+
+ ///
+ /// 获取培训类别列表信息
+ ///
+ ///
+ 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;
+ }
+
+ ///
+ /// 获取培训主持人信息
+ ///
+ ///
+ 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;
+ }
+
+ ///
+ /// 获取参与培训教育人员信息
+ ///
+ ///
+ 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;
+ }
+ }
+}
diff --git a/SGGL/WebAPI/WebAPI.csproj b/SGGL/WebAPI/WebAPI.csproj
index 30f4ed47..68fcd3cf 100644
--- a/SGGL/WebAPI/WebAPI.csproj
+++ b/SGGL/WebAPI/WebAPI.csproj
@@ -167,7 +167,10 @@
+
+
+