From 49afa7e25de0c5ea4b0426f5b10cf57c5b51d1c7 Mon Sep 17 00:00:00 2001 From: gaofei <181547018@qq.com> Date: Thu, 16 Mar 2023 14:35:01 +0800 Subject: [PATCH] =?UTF-8?q?=E6=8F=90=E4=BA=A4=E8=B4=A8=E9=87=8F=E6=8E=A5?= =?UTF-8?q?=E5=8F=A3=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- DataBase/版本日志/SGGLDB_V2023-03-16.sql | 4 + SGGL/BLL/API/APIBaseInfoService.cs | 40 +++ SGGL/BLL/API/APIUnitService.cs | 19 ++ .../Meeting/CQMS_MeetingApproveService.cs | 99 +++++++ SGGL/BLL/CQMS/Meeting/CQMS_MeetingService.cs | 263 +++++++++++++++++- .../CQMS/Plan/CQMS_MainPlanApproveService.cs | 4 +- SGGL/BLL/CQMS/Plan/CQMS_MainPlanService.cs | 6 +- .../CQMS/Plan/CQMS_SubPlanApproveService.cs | 2 +- SGGL/BLL/CQMS/Plan/CQMS_SubPlanService.cs | 6 +- .../RewardAndPunish/RewardAndPunishService.cs | 68 +++++ SGGL/BLL/CQMS/Train/CQMS_TrainPlanService.cs | 3 + .../RewardAndPunish/RewardAndPunish.aspx.cs | 2 +- SGGL/Model/Model.cs | 24 ++ .../Controllers/CQMS/CQMSMeetingController.cs | 246 ++++++++++++++++ .../CQMS/CQMSRewardAndPunishController.cs | 28 ++ SGGL/WebAPI/Controllers/UnitController.cs | 22 ++ SGGL/WebAPI/WebAPI.csproj | 1 + 17 files changed, 826 insertions(+), 11 deletions(-) create mode 100644 DataBase/版本日志/SGGLDB_V2023-03-16.sql create mode 100644 SGGL/WebAPI/Controllers/CQMS/CQMSRewardAndPunishController.cs diff --git a/DataBase/版本日志/SGGLDB_V2023-03-16.sql b/DataBase/版本日志/SGGLDB_V2023-03-16.sql new file mode 100644 index 00000000..7a903f5f --- /dev/null +++ b/DataBase/版本日志/SGGLDB_V2023-03-16.sql @@ -0,0 +1,4 @@ +alter table Meeting_CQMSMeeting add AttachUrl nvarchar(1000) null +GO +alter table RewardAndPunish_RewardAndPunish 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 6b7d9e58..d60e081c 100644 --- a/SGGL/BLL/API/APIBaseInfoService.cs +++ b/SGGL/BLL/API/APIBaseInfoService.cs @@ -813,5 +813,45 @@ namespace BLL return items; } #endregion + + #region 获取质量会议主持人 + /// + /// 获取质量会议主持人 + /// + /// + public static List getCQMSMeetingHostMan(string projectId,string unitId) + { + var list = BLL.SitePerson_PersonService.GetSitePerson_PersonListByUnitIdsRoleIds(projectId, unitId, 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 + + #region 获取质量会议参加人员 + /// + /// 获取质量会议参加人员 + /// + /// + public static List getAttentPerson(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/API/APIUnitService.cs b/SGGL/BLL/API/APIUnitService.cs index 3119330e..07519711 100644 --- a/SGGL/BLL/API/APIUnitService.cs +++ b/SGGL/BLL/API/APIUnitService.cs @@ -36,6 +36,25 @@ namespace BLL } } + /// + /// 获取项目所有单位信息 + /// + /// + /// + public static List getProjectUnitLists(string projectId) + { + using (Model.SGGLDB db = new Model.SGGLDB(Funs.ConnString)) + { + var units = (from x in db.Base_Unit + join y in db.Project_ProjectUnit + on x.UnitId equals y.UnitId + where y.ProjectId == projectId + orderby x.UnitName + select new Model.BaseInfoItem { BaseInfoId = x.UnitId, BaseInfoCode = x.UnitCode, BaseInfoName = x.UnitName }).ToList(); + return units; + } + } + /// /// 根据projectId、unitType获取单位信息(总包1;施工分包2;监理3;业主4;其他5) /// diff --git a/SGGL/BLL/CQMS/Meeting/CQMS_MeetingApproveService.cs b/SGGL/BLL/CQMS/Meeting/CQMS_MeetingApproveService.cs index 3fdfdd28..19333ac1 100644 --- a/SGGL/BLL/CQMS/Meeting/CQMS_MeetingApproveService.cs +++ b/SGGL/BLL/CQMS/Meeting/CQMS_MeetingApproveService.cs @@ -91,6 +91,18 @@ namespace BLL } } } + + public static string GetHandleManName(string MeetingId) + { + string name = string.Empty; + var a = Funs.DB.Meeting_CQMSMeetingApprove.FirstOrDefault(x => x.MeetingId == MeetingId && x.ApproveDate == null); + if (a != null) + { + name = BLL.Person_PersonsService.GetPersonsNameById(a.ApproveMan); + } + return name; + } + /// /// 根据质量会议编号获取一个质量会议审批信息 /// @@ -155,5 +167,92 @@ namespace BLL { return db.Meeting_CQMSMeetingApprove.FirstOrDefault(x => x.MeetingId == MeetingId && x.ApproveType == BLL.Const.CQMSMeeting_Compile); } + + public static List GetListDataByIdForApi(string id) + { + using (var db = new Model.SGGLDB(Funs.ConnString)) + { + var q = from x in db.Meeting_CQMSMeetingApprove + where x.MeetingId == id && x.ApproveDate != null && x.ApproveType != "S" + orderby x.ApproveDate + select new + { + x.MeetingApproveId, + x.MeetingId, + 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.Meeting_CQMSMeetingApprove approve = new Model.Meeting_CQMSMeetingApprove(); + approve.MeetingApproveId = item.MeetingApproveId; + approve.MeetingId = item.MeetingId; + approve.ApproveMan = item.ApproveMan; + approve.ApproveDate = item.ApproveDate; + approve.IsAgree = item.IsAgree; + approve.ApproveIdea = item.ApproveIdea; + approve.ApproveType = item.ApproveType; + res.Add(approve); + } + return res; + } + } + + public static Model.Meeting_CQMSMeetingApprove getCurrApproveForApi(string id) + { + using (Model.SGGLDB db = new Model.SGGLDB(Funs.ConnString)) + { + Model.Meeting_CQMSMeetingApprove newApprove = db.Meeting_CQMSMeetingApprove.FirstOrDefault(e => e.MeetingId == id && e.ApproveType != "S" && e.ApproveDate == null); + return newApprove; + } + } + + public static string AddMeetingApproveForApi(Model.Meeting_CQMSMeetingApprove approve) + { + using (var db = new Model.SGGLDB(Funs.ConnString)) + { + string newKeyID = SQLHelper.GetNewID(typeof(Model.Meeting_CQMSMeetingApprove)); + Model.Meeting_CQMSMeetingApprove newApprove = new Model.Meeting_CQMSMeetingApprove(); + newApprove.MeetingApproveId = newKeyID; + newApprove.MeetingId = approve.MeetingId; + newApprove.ApproveMan = approve.ApproveMan; + newApprove.ApproveDate = approve.ApproveDate; + newApprove.ApproveIdea = approve.ApproveIdea; + newApprove.IsAgree = approve.IsAgree; + newApprove.ApproveType = approve.ApproveType; + + db.Meeting_CQMSMeetingApprove.InsertOnSubmit(newApprove); + db.SubmitChanges(); + return newKeyID; + } + } + + public static void UpdateMeetingApproveForApi(Model.Meeting_CQMSMeetingApprove approve) + { + using (Model.SGGLDB db = new Model.SGGLDB(Funs.ConnString)) + { + Model.Meeting_CQMSMeetingApprove newApprove = db.Meeting_CQMSMeetingApprove.FirstOrDefault(e => e.MeetingApproveId == approve.MeetingApproveId && e.ApproveDate == null); + if (newApprove != null) + { + if (!string.IsNullOrEmpty(approve.ApproveMan)) + newApprove.ApproveMan = approve.ApproveMan; + if (approve.ApproveDate.HasValue) + newApprove.ApproveDate = approve.ApproveDate; + if (!string.IsNullOrEmpty(approve.ApproveIdea)) + newApprove.ApproveIdea = approve.ApproveIdea; + if (approve.IsAgree.HasValue) + newApprove.IsAgree = approve.IsAgree; + if (!string.IsNullOrEmpty(approve.ApproveType)) + newApprove.ApproveType = approve.ApproveType; + + db.SubmitChanges(); + } + } + } } } diff --git a/SGGL/BLL/CQMS/Meeting/CQMS_MeetingService.cs b/SGGL/BLL/CQMS/Meeting/CQMS_MeetingService.cs index 0c5d020c..62d3c889 100644 --- a/SGGL/BLL/CQMS/Meeting/CQMS_MeetingService.cs +++ b/SGGL/BLL/CQMS/Meeting/CQMS_MeetingService.cs @@ -112,7 +112,7 @@ namespace BLL newCQMSMeeting.MeetingTheme = CQMSMeeting.MeetingTheme; newCQMSMeeting.MeetingContents = CQMSMeeting.MeetingContents; newCQMSMeeting.State = CQMSMeeting.State; - + db.SubmitChanges(); } } @@ -156,5 +156,266 @@ namespace BLL else return null; } + + /// + /// 根据状态选择下一步办理类型 + /// + /// + /// + public static List GetDHandleTypeByStateForApi(string state) + { + List list = new List(); + if (state == Const.CQMSMeeting_Compile || state == Const.CQMSMeeting_ReCompile) + { + Model.BaseInfoItem item = new Model.BaseInfoItem(); + item.BaseInfoId = Const.CQMSMeeting_Audit; + item.BaseInfoName = "总包质量经理审批"; + list.Add(item); + return list; + } + else if (state == Const.CQMSMeeting_Audit) + { + Model.BaseInfoItem item = new Model.BaseInfoItem(); + item.BaseInfoId = Const.CQMSMeeting_Complete; + item.BaseInfoName = "审批完成"; + list.Add(item); + Model.BaseInfoItem item2 = new Model.BaseInfoItem(); + item2.BaseInfoId = Const.CQMSMeeting_ReCompile; + item2.BaseInfoName = "重新编制"; + list.Add(item2); + return list; + } + else + return null; + } + + /// + /// 根据状态选择下一步办理类型 + /// + /// + /// + public static List GetHandleManListForApi(string state, string id, string projectId) + { + List list = new List(); + if (state == Const.CQMSMeeting_Compile) + { + return null; + } + else if (state == Const.CQMSMeeting_ReCompile) + { + var user = BLL.Person_PersonsService.GetPerson_PersonsById(BLL.CQMS_MeetingApproveService.GetAuditMan(id, BLL.Const.CQMSMeeting_Compile).ApproveMan); + Model.BaseInfoItem item = new Model.BaseInfoItem(); + item.BaseInfoId = user.PersonId; + item.BaseInfoName = user.PersonName; + list.Add(item); + return list; + } + else if (state == Const.CQMSMeeting_Audit) + { + var users = BLL.SitePerson_PersonService.GetSitePerson_PersonListByProjectIdUnitTypeRoleIds(projectId, Const.ProjectUnitType_1, null); + foreach (var user in users) + { + Model.BaseInfoItem item = new Model.BaseInfoItem(); + item.BaseInfoId = user.PersonId; + item.BaseInfoName = user.PersonName; + list.Add(item); + } + return list; + } + else + return null; + } + + /// + /// 把状态转换代号为文字形式 + /// + /// + /// + public static string ConvertState(object state) + { + if (state != null) + { + if (state.ToString() == BLL.Const.CQMSMeeting_ReCompile) + { + return "重新编制"; + } + else if (state.ToString() == BLL.Const.CQMSMeeting_Compile) + { + return "编制"; + } + else if (state.ToString() == BLL.Const.CQMSMeeting_Audit) + { + return "总包质量经理审批"; + } + else if (state.ToString() == BLL.Const.CQMSMeeting_Complete) + { + return "审批完成"; + } + else + { + return ""; + } + } + return ""; + } + + public static List getListDataForApi(string projectId, int startRowIndex, int maximumRows, string meetingType) + { + using (var db = new Model.SGGLDB(Funs.ConnString)) + { + IQueryable q = db.Meeting_CQMSMeeting; + if (!string.IsNullOrEmpty(projectId)) + { + q = q.Where(e => e.ProjectId == projectId); + } + if (!string.IsNullOrEmpty(meetingType)) + { + q = q.Where(e => e.MeetingType == meetingType); + } + var qres = from x in q + orderby x.CompileDate descending + select new + { + x.MeetingId, + x.ProjectId, + x.UnitId, + UnitName = (from y in db.Base_Unit where y.UnitId == x.UnitId select y.UnitName).First(), + x.MeetingType, + MeetingTypeStr = x.MeetingType == "M" ? "质量月例会" : "质量专题会", + x.MeetingCode, + x.MeetingDate, + x.Place, + x.HostMan, + HostManName = BLL.Person_PersonsService.getPersonsNamesPersonIds(x.HostMan), + x.AttentPerson, + AttentPersonName = BLL.Person_PersonsService.getPersonsNamesPersonIds(x.AttentPerson), + x.AttentPersonNum, + x.MeetingTheme, + x.MeetingContents, + 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(), + HandleManName = BLL.CQMS_MeetingApproveService.GetHandleManName(x.MeetingId), + x.AttachUrl, + }; + List res = new List(); + var list = qres.Skip(startRowIndex).Take(maximumRows).ToList(); + foreach (var item in list) + { + Model.Meeting_CQMSMeeting cd = new Model.Meeting_CQMSMeeting(); + cd.MeetingId = item.MeetingId; + cd.ProjectId = item.ProjectId; + cd.UnitId = item.UnitId + "$" + item.UnitName; + cd.MeetingType = item.MeetingType + "$" + item.MeetingTypeStr; + cd.MeetingCode = item.MeetingCode; + cd.MeetingDate = item.MeetingDate; + cd.Place = item.Place; + cd.HostMan = item.HostMan + "$" + item.HostManName; + cd.AttentPerson = item.AttentPerson + "$" + item.AttentPersonName; + cd.AttentPersonNum = item.AttentPersonNum; + cd.MeetingTheme = item.MeetingTheme; + cd.MeetingContents = item.MeetingContents; + cd.CompileDate = item.CompileDate; + cd.CompileMan = item.CompileMan + "$" + item.CompileManName; + cd.State = item.State + "$" + item.StateStr + "$" + item.HandleManName; + cd.AttachUrl = AttachFileService.getFileUrl(item.MeetingId); + res.Add(cd); + } + return res; + } + } + + /// + /// 获取质量会议信息 + /// + /// + /// + public static Model.Meeting_CQMSMeeting GetMeetingByMeetingIdForApi(string MeetingId) + { + using (var db = new Model.SGGLDB(Funs.ConnString)) + { + var q = db.Meeting_CQMSMeeting.FirstOrDefault(e => e.MeetingId == MeetingId); + if (q != null) + { + q.UnitId = q.UnitId + "$" + BLL.UnitService.GetUnitNameByUnitId(q.UnitId); + q.MeetingType = q.MeetingType + "$" + (q.MeetingType == "M" ? "质量月例会" : "质量专题会"); + q.HostMan = q.HostMan + "$" + BLL.Person_PersonsService.getPersonsNamesPersonIds(q.HostMan); + q.AttentPerson = q.AttentPerson + "$" + BLL.Person_PersonsService.getPersonsNamesPersonIds(q.AttentPerson); + q.CompileMan = q.CompileMan + "$" + BLL.Person_PersonsService.GetPersonsNameById(q.CompileMan); + q.State = q.State + "$" + ConvertState(q.State) + "$" + BLL.CQMS_MeetingApproveService.GetHandleManName(q.MeetingId); + q.AttachUrl = AttachFileService.getFileUrl(q.MeetingId); + } + return q; + } + } + + public static void AddMeetingForApi(Model.Meeting_CQMSMeeting Meeting) + { + using (Model.SGGLDB db = new Model.SGGLDB(Funs.ConnString)) + { + Model.Meeting_CQMSMeeting newCQMSMeeting = new Model.Meeting_CQMSMeeting + { + MeetingId = Meeting.MeetingId, + ProjectId = Meeting.ProjectId, + UnitId = Meeting.UnitId, + MeetingType = Meeting.MeetingType, + MeetingCode = Meeting.MeetingCode, + MeetingDate = Meeting.MeetingDate, + Place = Meeting.Place, + HostMan = Meeting.HostMan, + AttentPerson = Meeting.AttentPerson, + AttentPersonNum = Meeting.AttentPersonNum, + MeetingTheme = Meeting.MeetingTheme, + MeetingContents = Meeting.MeetingContents, + State = Meeting.State, + CompileMan = Meeting.CompileMan, + CompileDate = Meeting.CompileDate, + }; + + db.Meeting_CQMSMeeting.InsertOnSubmit(Meeting); + db.SubmitChanges(); + + Model.Meeting_CQMSMeetingApprove approve = new Model.Meeting_CQMSMeetingApprove(); + approve.MeetingApproveId = BLL.SQLHelper.GetNewID(); + approve.MeetingId = Meeting.MeetingId; + approve.ApproveType = BLL.Const.CQMSMeeting_Compile; + approve.ApproveMan = Meeting.CompileMan; + approve.ApproveDate = Meeting.CompileDate; + db.Meeting_CQMSMeetingApprove.InsertOnSubmit(approve); + db.SubmitChanges(); + } + } + + public static void UpdateMeetingForApi(Model.Meeting_CQMSMeeting Meeting) + { + + using (var db = new Model.SGGLDB(Funs.ConnString)) + { + Model.Meeting_CQMSMeeting newMeeting = db.Meeting_CQMSMeeting.First(e => e.MeetingId == Meeting.MeetingId); + if (!string.IsNullOrEmpty(Meeting.UnitId)) + newMeeting.UnitId = Meeting.UnitId; + if (!string.IsNullOrEmpty(Meeting.MeetingCode)) + newMeeting.MeetingCode = Meeting.MeetingCode; + if (Meeting.MeetingDate.HasValue) + newMeeting.MeetingDate = Meeting.MeetingDate; + if (!string.IsNullOrEmpty(Meeting.Place)) + newMeeting.Place = Meeting.Place; + if (!string.IsNullOrEmpty(Meeting.HostMan)) + newMeeting.HostMan = Meeting.HostMan; + if (!string.IsNullOrEmpty(Meeting.AttentPerson)) + newMeeting.AttentPerson = Meeting.AttentPerson; + if (Meeting.AttentPersonNum.HasValue) + newMeeting.AttentPersonNum = Meeting.AttentPersonNum; + if (!string.IsNullOrEmpty(Meeting.MeetingTheme)) + newMeeting.MeetingTheme = Meeting.MeetingTheme; + if (!string.IsNullOrEmpty(Meeting.MeetingContents)) + newMeeting.MeetingContents = Meeting.MeetingContents; + if (!string.IsNullOrEmpty(Meeting.State)) + newMeeting.State = Meeting.State; + db.SubmitChanges(); + } + } } } diff --git a/SGGL/BLL/CQMS/Plan/CQMS_MainPlanApproveService.cs b/SGGL/BLL/CQMS/Plan/CQMS_MainPlanApproveService.cs index ccdf36ee..a27b4b2f 100644 --- a/SGGL/BLL/CQMS/Plan/CQMS_MainPlanApproveService.cs +++ b/SGGL/BLL/CQMS/Plan/CQMS_MainPlanApproveService.cs @@ -118,7 +118,7 @@ namespace BLL public static string GetHandleManName(string MainPlanId) { string name = string.Empty; - var a= Funs.DB.Plan_MainPlanApprove.FirstOrDefault(x => x.MainPlanId == MainPlanId && x.ApproveDate == null); + var a = Funs.DB.Plan_MainPlanApprove.FirstOrDefault(x => x.MainPlanId == MainPlanId && x.ApproveDate == null); if (a != null) { name = BLL.Person_PersonsService.GetPersonsNameById(a.ApproveMan); @@ -246,7 +246,7 @@ namespace BLL cd.ApproveDate = item.ApproveDate; cd.IsAgree = item.IsAgree; cd.ApproveIdea = item.ApproveIdea; - cd.ApproveType = item.ApproveType; + cd.ApproveType = item.ApproveType + "$" + CQMS_MainPlanService.ConvertState(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 67f9df2d..0a70204f 100644 --- a/SGGL/BLL/CQMS/Plan/CQMS_MainPlanService.cs +++ b/SGGL/BLL/CQMS/Plan/CQMS_MainPlanService.cs @@ -195,7 +195,7 @@ namespace BLL x.State, StateStr = ConvertState(x.State), CompileManName = (from y in db.Person_Persons where y.PersonId == x.CompileMan select y.PersonName).First(), - HandleManName = BLL.CQMS_MainPlanApproveService.GetHandleManName(x.State), + HandleManName = BLL.CQMS_MainPlanApproveService.GetHandleManName(x.MainPlanId), FilePath = x.FilePath, }; List res = new List(); @@ -209,7 +209,7 @@ namespace BLL cd.FileName = item.FileName; cd.CompileDate = item.CompileDate; cd.CompileMan = item.CompileMan + "$" + item.CompileManName; - cd.State = item.State + "$" + item.StateStr + "&" + item.HandleManName; + cd.State = item.State + "$" + item.StateStr + "$" + item.HandleManName; cd.FilePath = item.FilePath; res.Add(cd); } @@ -227,7 +227,7 @@ namespace BLL var q = Funs.DB.Plan_MainPlan.FirstOrDefault(e => e.MainPlanId == MainPlanId); if (q != null) { - q.State = q.State + "$" + ConvertState(q.State) + "$" + BLL.CQMS_MainPlanApproveService.GetHandleManName(q.State); + q.State = q.State + "$" + ConvertState(q.State) + "$" + BLL.CQMS_MainPlanApproveService.GetHandleManName(q.MainPlanId); 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 93a47911..866c5567 100644 --- a/SGGL/BLL/CQMS/Plan/CQMS_SubPlanApproveService.cs +++ b/SGGL/BLL/CQMS/Plan/CQMS_SubPlanApproveService.cs @@ -288,7 +288,7 @@ namespace BLL cd.ApproveDate = item.ApproveDate; cd.IsAgree = item.IsAgree; cd.ApproveIdea = item.ApproveIdea; - cd.ApproveType = item.ApproveType; + cd.ApproveType = item.ApproveType + "$" + CQMS_SubPlanService.ConvertState(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 57c64856..f3ae2505 100644 --- a/SGGL/BLL/CQMS/Plan/CQMS_SubPlanService.cs +++ b/SGGL/BLL/CQMS/Plan/CQMS_SubPlanService.cs @@ -228,7 +228,7 @@ namespace BLL UnitName = BLL.UnitService.GetUnitNameByUnitId(x.UnitId), UnitWorkNames=BLL.UnitWorkService.GetUnitWorkName(x.UnitWorkIds), CNProfessionalNames=BLL.CNProfessionalService.GetCNProfessionalNameByCode(x.CNProfessionalCodes), - HandleManName = BLL.CQMS_SubPlanApproveService.GetHandleManName(x.State), + HandleManName = BLL.CQMS_SubPlanApproveService.GetHandleManName(x.SubPlanId), FilePath = x.FilePath, }; List res = new List(); @@ -245,7 +245,7 @@ namespace BLL cd.CNProfessionalCodes = item.CNProfessionalCodes + "$" + item.CNProfessionalNames; cd.CompileDate = item.CompileDate; cd.CompileMan = item.CompileMan + "$" + item.CompileManName; - cd.State = item.State + "$" + item.StateStr + "&" + item.HandleManName; + cd.State = item.State + "$" + item.StateStr + "$" + item.HandleManName; cd.Edition = item.Edition; cd.FilePath = item.FilePath; res.Add(cd); @@ -268,7 +268,7 @@ namespace BLL 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) + "$" + BLL.CQMS_SubPlanApproveService.GetHandleManName(q.State); + q.State = q.State + "$" + ConvertState(q.State) + "$" + BLL.CQMS_SubPlanApproveService.GetHandleManName(q.SubPlanId); } return q; } diff --git a/SGGL/BLL/CQMS/RewardAndPunish/RewardAndPunishService.cs b/SGGL/BLL/CQMS/RewardAndPunish/RewardAndPunishService.cs index 06f513fb..e9d0f49e 100644 --- a/SGGL/BLL/CQMS/RewardAndPunish/RewardAndPunishService.cs +++ b/SGGL/BLL/CQMS/RewardAndPunish/RewardAndPunishService.cs @@ -115,5 +115,73 @@ namespace BLL else return null; } + + //public static List getListDataForApi(string projectId, int startRowIndex, int maximumRows, string type) + //{ + // using (var db = new Model.SGGLDB(Funs.ConnString)) + // { + // IQueryable q = db.RewardAndPunish_RewardAndPunish; + // if (!string.IsNullOrEmpty(projectId)) + // { + // q = q.Where(e => e.ProjectId == projectId); + // } + // if (type!="0") + // { + // q = q.Where(e => e.Type == type); + // } + // var qres = from x in q + // orderby x.CompileDate descending + // select new + // { + // x.MeetingId, + // x.ProjectId, + // x.UnitId, + // UnitName = (from y in db.Base_Unit where y.UnitId == x.UnitId select y.UnitName).First(), + // x.MeetingType, + // MeetingTypeStr = x.MeetingType == "M" ? "质量月例会" : "质量专题会", + // x.MeetingCode, + // x.MeetingDate, + // x.Place, + // x.HostMan, + // HostManName = BLL.Person_PersonsService.getPersonsNamesPersonIds(x.HostMan), + // x.AttentPerson, + // AttentPersonName = BLL.Person_PersonsService.getPersonsNamesPersonIds(x.AttentPerson), + // x.AttentPersonNum, + // x.MeetingTheme, + // x.MeetingContents, + // 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(), + // HandleManName = BLL.CQMS_MeetingApproveService.GetHandleManName(x.MeetingId), + // x.AttachUrl, + // }; + // List res = new List(); + // var list = qres.Skip(startRowIndex).Take(maximumRows).ToList(); + // foreach (var item in list) + // { + // Model.Meeting_CQMSMeeting cd = new Model.Meeting_CQMSMeeting(); + // cd.MeetingId = item.MeetingId; + // cd.ProjectId = item.ProjectId; + // cd.UnitId = item.UnitId + "$" + item.UnitName; + // cd.MeetingType = item.MeetingType + "$" + item.MeetingTypeStr; + // cd.MeetingCode = item.MeetingCode; + // cd.MeetingDate = item.MeetingDate; + // cd.Place = item.Place; + // cd.HostMan = item.HostMan + "$" + item.HostManName; + // cd.AttentPerson = item.AttentPerson + "$" + item.AttentPersonName; + // cd.AttentPersonNum = item.AttentPersonNum; + // cd.MeetingTheme = item.MeetingTheme; + // cd.MeetingContents = item.MeetingContents; + // cd.CompileDate = item.CompileDate; + // cd.CompileMan = item.CompileMan + "$" + item.CompileManName; + // cd.State = item.State + "$" + item.StateStr + "$" + item.HandleManName; + // cd.AttachUrl = AttachFileService.getFileUrl(item.MeetingId); + // res.Add(cd); + // } + // return res; + // } + //} } } diff --git a/SGGL/BLL/CQMS/Train/CQMS_TrainPlanService.cs b/SGGL/BLL/CQMS/Train/CQMS_TrainPlanService.cs index f154bf80..c670f188 100644 --- a/SGGL/BLL/CQMS/Train/CQMS_TrainPlanService.cs +++ b/SGGL/BLL/CQMS/Train/CQMS_TrainPlanService.cs @@ -131,6 +131,7 @@ namespace BLL x.RealTrainPersons, x.CompileDate, x.CompileMan, + x.AttachUrl, CompileManName = (from y in db.Person_Persons where y.PersonId == x.CompileMan select y.PersonName).First(), }; List res = new List(); @@ -152,6 +153,7 @@ namespace BLL cd.RealTrainPersons = item.RealTrainPersons; cd.CompileDate = item.CompileDate; cd.CompileMan = item.CompileMan + "$" + item.CompileManName; + cd.AttachUrl = AttachFileService.getFileUrl(item.TrainPlanId); res.Add(cd); } return res; @@ -173,6 +175,7 @@ namespace BLL 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.HostMan = q.HostMan + "$" + BLL.Person_PersonsService.getPersonsNamesPersonIds(q.HostMan); q.CompileMan = q.CompileMan + "$" + BLL.Person_PersonsService.GetPersonsNameById(q.CompileMan); q.AttachUrl = AttachFileService.getFileUrl(q.TrainPlanId); } diff --git a/SGGL/FineUIPro.Web/CQMS/RewardAndPunish/RewardAndPunish.aspx.cs b/SGGL/FineUIPro.Web/CQMS/RewardAndPunish/RewardAndPunish.aspx.cs index fcf26166..024bbf27 100644 --- a/SGGL/FineUIPro.Web/CQMS/RewardAndPunish/RewardAndPunish.aspx.cs +++ b/SGGL/FineUIPro.Web/CQMS/RewardAndPunish/RewardAndPunish.aspx.cs @@ -66,7 +66,7 @@ namespace FineUIPro.Web.CQMS.RewardAndPunish strSql += " AND ins.UnitId=@UnitId"; listStr.Add(new SqlParameter("@UnitId", drpUnit.SelectedValue)); } - if (this.rblType.SelectedValue != "0") + if (this.rblType.SelectedValue != "0") { strSql += " AND ins.Type=@Type"; listStr.Add(new SqlParameter("@Type", rblType.SelectedValue)); diff --git a/SGGL/Model/Model.cs b/SGGL/Model/Model.cs index a794e290..876c2161 100644 --- a/SGGL/Model/Model.cs +++ b/SGGL/Model/Model.cs @@ -124992,6 +124992,8 @@ namespace Model private System.Nullable _CompileDate; + private string _AttachUrl; + private EntityRef _Base_Project; private EntitySet _Meeting_CQMSMeetingApprove; @@ -125030,6 +125032,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 Meeting_CQMSMeeting() @@ -125343,6 +125347,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_Meeting_CQMSMeeting_Base_Project", Storage="_Base_Project", ThisKey="ProjectId", OtherKey="ProjectId", IsForeignKey=true)] public Base_Project Base_Project { diff --git a/SGGL/WebAPI/Controllers/CQMS/CQMSMeetingController.cs b/SGGL/WebAPI/Controllers/CQMS/CQMSMeetingController.cs index 49972bcf..8af82e64 100644 --- a/SGGL/WebAPI/Controllers/CQMS/CQMSMeetingController.cs +++ b/SGGL/WebAPI/Controllers/CQMS/CQMSMeetingController.cs @@ -11,6 +11,252 @@ namespace WebAPI.Controllers /// public class CQMSMeetingController : ApiController { + /// + /// 根据项目id获取质量会议列表集合 + /// + /// + /// + /// + /// + /// + [HttpGet] + public ResponseData> getMeetingList(string projectId, int index, int page, string meetingType) + { + ResponseData> res = new ResponseData>(); + res.successful = true; + res.resultValue = BLL.CQMS_MeetingService.getListDataForApi(projectId, index, page, meetingType); + return res; + } + /// + /// 根据id获取质量会议详情 + /// + /// + /// + [HttpGet] + public ResponseData GetMeetingByMeetingId(string id) + { + ResponseData res = new ResponseData(); + Meeting_CQMSMeeting cd = BLL.CQMS_MeetingService.GetMeetingByMeetingIdForApi(id); + + res.successful = true; + res.resultValue = BeanUtil.CopyOjbect(cd, true); + return res; + } + + /// + /// 根据id获取审核记录集合 + /// + /// + /// + public ResponseData> GetApproveById(string id) + { + ResponseData> res = new ResponseData>(); + + res.successful = true; + res.resultValue = BLL.CQMS_MeetingApproveService.GetListDataByIdForApi(id); + return res; + } + + /// + /// 根据id获取当前办理人审批信息 + /// + /// + /// + public ResponseData GetCurrApproveById(string id) + { + ResponseData res = new ResponseData(); + + res.successful = true; + res.resultValue = BeanUtil.CopyOjbect(BLL.CQMS_MeetingApproveService.getCurrApproveForApi(id), true); + return res; + } + + /// + /// 保存会议主表信息 + /// + /// + /// + [HttpPost] + public ResponseData AddCQMSMeeting([FromBody] Model.Meeting_CQMSMeeting meeting) + { + ResponseData res = new ResponseData(); + try + { + if (string.IsNullOrEmpty(meeting.MeetingId)) + { + meeting.MeetingId = Guid.NewGuid().ToString(); + BLL.CQMS_MeetingService.AddMeetingForApi(meeting); + if (meeting.MeetingType == "M") + { + SaveAttachFile(meeting.MeetingId, BLL.Const.CQMSMonthMeetingMenuId, meeting.AttachUrl); + } + else + { + SaveAttachFile(meeting.MeetingId, BLL.Const.CQMSSpecialMeetingMenuId, meeting.AttachUrl); + } + res.resultValue = meeting.MeetingId; + } + else + { + BLL.CQMS_MeetingService.UpdateMeetingForApi(meeting); + if (meeting.MeetingType == "M") + { + SaveAttachFile(meeting.MeetingId, BLL.Const.CQMSMonthMeetingMenuId, meeting.AttachUrl); + } + else + { + SaveAttachFile(meeting.MeetingId, BLL.Const.CQMSSpecialMeetingMenuId, meeting.AttachUrl); + } + res.resultValue = meeting.MeetingId; + } + + res.successful = true; + + } + catch (Exception e) + { + res.resultHint = e.StackTrace; + res.successful = false; + } + 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); + } + + /// + /// 新增办理信息 + /// + /// + /// + [HttpPost] + public ResponseData AddApprove([FromBody] Model.Meeting_CQMSMeetingApprove approve) + { + ResponseData res = new ResponseData(); + try + { + Model.Meeting_CQMSMeeting Meeting = new Model.Meeting_CQMSMeeting(); + Meeting.MeetingId = approve.MeetingId; + Meeting.State = approve.ApproveType; + BLL.CQMS_MeetingService.UpdateMeetingForApi(Meeting); + res.resultValue = BLL.CQMS_MeetingApproveService.AddMeetingApproveForApi(approve); + res.successful = true; + } + catch (Exception e) + { + res.resultHint = e.StackTrace; + res.successful = false; + } + return res; + } + + /// + /// 更新办理信息 + /// + /// + /// + [HttpPost] + public ResponseData UpdateApprove([FromBody] Model.Meeting_CQMSMeetingApprove approve) + { + ResponseData res = new ResponseData(); + try + { + approve.ApproveDate = DateTime.Now; + BLL.CQMS_MeetingApproveService.UpdateMeetingApproveForApi(approve); + res.successful = true; + + } + catch (Exception e) + { + res.resultHint = e.StackTrace; + res.successful = false; + } + return res; + } + + /// + /// 获取主持人信息 + /// + /// + public Model.ResponeData getHostMan(string projectId, string unitId) + { + var responeData = new Model.ResponeData(); + try + { + responeData.data = APIBaseInfoService.getCQMSMeetingHostMan(projectId, unitId); + } + catch (Exception ex) + { + responeData.code = 0; + responeData.message = ex.Message; + } + return responeData; + } + + /// + /// 获取质量会议参加人员 + /// + /// + public Model.ResponeData getAttentPerson(string projectId) + { + var responeData = new Model.ResponeData(); + try + { + responeData.data = APIBaseInfoService.getAttentPerson(projectId); + } + catch (Exception ex) + { + responeData.code = 0; + responeData.message = ex.Message; + } + return responeData; + } + + /// + /// 根据状态获取办理步骤 0-重新编制,1-编制,2-总包质量经理审批,C-审批完成 + /// + /// + public Model.ResponeData getHandleListByState(string state) + { + var responeData = new Model.ResponeData(); + try + { + responeData.data = CQMS_MeetingService.GetDHandleTypeByStateForApi(state); + } + catch (Exception ex) + { + responeData.code = 0; + responeData.message = ex.Message; + } + return responeData; + } + + /// + /// 根据办理步骤获取办理人 + /// + /// + public Model.ResponeData getHandleManListByState(string state, string id, string projectId) + { + var responeData = new Model.ResponeData(); + try + { + responeData.data = CQMS_MeetingService.GetHandleManListForApi(state, id, projectId); + } + catch (Exception ex) + { + responeData.code = 0; + responeData.message = ex.Message; + } + return responeData; + } } } diff --git a/SGGL/WebAPI/Controllers/CQMS/CQMSRewardAndPunishController.cs b/SGGL/WebAPI/Controllers/CQMS/CQMSRewardAndPunishController.cs new file mode 100644 index 00000000..7fe5ef34 --- /dev/null +++ b/SGGL/WebAPI/Controllers/CQMS/CQMSRewardAndPunishController.cs @@ -0,0 +1,28 @@ +using BLL; +using Model; +using System; +using System.Collections.Generic; +using System.Web.Http; + +namespace WebAPI.Controllers +{ + public class CQMSRewardAndPunishController : ApiController + { + /// + /// 根据项目id获取质量会议列表集合 + /// + /// + /// + /// + /// 0-全部,1-奖励,2-处罚 + /// + [HttpGet] + public ResponseData> getMeetingList(string projectId, int index, int page, string type) + { + ResponseData> res = new ResponseData>(); + res.successful = true; + //res.resultValue = BLL.RewardAndPunishService.getListDataForApi(projectId, index, page, type); + return res; + } + } +} diff --git a/SGGL/WebAPI/Controllers/UnitController.cs b/SGGL/WebAPI/Controllers/UnitController.cs index 02184de7..95776242 100644 --- a/SGGL/WebAPI/Controllers/UnitController.cs +++ b/SGGL/WebAPI/Controllers/UnitController.cs @@ -55,6 +55,28 @@ namespace WebAPI.Controllers } #endregion + #region 获取项目所有单位 + /// + /// 获取项目所有单位 + /// + /// + public Model.ResponeData getProjectUnitLists(string projectId) + { + var responeData = new Model.ResponeData(); + try + { + responeData.data = APIUnitService.getProjectUnitLists(projectId); + } + catch (Exception ex) + { + responeData.code = 0; + responeData.message = ex.Message; + } + + return responeData; + } + #endregion + #region 根据projectId、unitType获取单位信息(总包1;施工分包2;监理3;业主4;其他5) /// /// 根据projectId、unitType获取单位信息(总包1;施工分包2;监理3;业主4;其他5) diff --git a/SGGL/WebAPI/WebAPI.csproj b/SGGL/WebAPI/WebAPI.csproj index 68fcd3cf..3643ae1d 100644 --- a/SGGL/WebAPI/WebAPI.csproj +++ b/SGGL/WebAPI/WebAPI.csproj @@ -170,6 +170,7 @@ +