diff --git a/DataBase/版本日志/SGGLDB_V2023-09-01.sql b/DataBase/版本日志/SGGLDB_V2023-09-01.sql new file mode 100644 index 00000000..20807d0f --- /dev/null +++ b/DataBase/版本日志/SGGLDB_V2023-09-01.sql @@ -0,0 +1,82 @@ + + +ALTER TABLE Solution_LargerHazardListItem ALTER COLUMN WorkPackageId NVARCHAR(2000) NULL +GO +ALTER TABLE Solution_LargerHazardListItem ADD WorkPackageName NVARCHAR(2000) NULL +GO + +ALTER TABLE Check_SpotCheckDetail ADD WorkPackageId NVARCHAR(2000) NULL +GO + +ALTER TABLE Accident_AccidentPersonRecord ADD WorkPackageId NVARCHAR(2000) NULL +GO +ALTER TABLE Accident_AccidentPersonRecord ADD WorkPackageName NVARCHAR(2000) NULL +GO + + +ALTER VIEW [dbo].[View_Solution_LargerHazardListItem] + AS +/*Σ󹤳嵥ϸбͼ*/ +SELECT Project.ProjectCode + ,ISNULL(Project.ShortName,Project.ProjectName) AS ProjectName + ,Project.ProjectId + ,list.HazardCode + ,list.RecordTime + ,list.RecardManId + ,list.Remark + ,list.States + ,list.VersionNo + ,Item.LargerHazardListItemId + ,Item.SortIndex + ,Item.LargerHazardListId + ,Item.UnitWorkId + ,(UnitWork.UnitWorkName+'('+(CASE WHEN UnitWork.ProjectType='1' THEN '' ELSE 'װ' END)+')') AS UnitWorkName + ,Item.WorkPackageId + ,WorkPackageName AS PackageContent + ,Item.WorkPackageSize + ,Item.ExpectedStartTime + ,Item.ExpectedEndTime + ,Item.IsArgument + ,(CASE WHEN Item.IsArgument=1 THEN '' ELSE '' END) AS IsArgumentName + ,Item.WorkStates + ,constw.ConstText AS WorkStatesName + ,Item.UnitId + ,Unit.UnitName + ,((CASE WHEN Item.ExpectedStartTime IS NULL THEN '' ELSE CONVERT(varchar(100), Item.ExpectedStartTime,23) END) + + ''+ (CASE WHEN Item.ExpectedEndTime IS NULL THEN '' ELSE CONVERT(varchar(100), Item.ExpectedEndTime,23) END)) AS ExpectedTime +FROM dbo.Solution_LargerHazardListItem AS Item +LEFT JOIN Solution_LargerHazardList AS list ON Item.LargerHazardListId=list.LargerHazardListId +LEFT JOIN Base_Project AS Project ON Project.ProjectId=list.ProjectId +LEFT JOIN WBS_UnitWork AS UnitWork ON Item.UnitWorkId=UnitWork.UnitWorkId +--LEFT JOIN WBS_WorkPackage AS Package ON Item.WorkPackageId=Package.WorkPackageId +LEFT JOIN Base_Unit AS Unit ON Item.UnitId=Unit.UnitId +LEFT JOIN Sys_Const AS constw ON Item.WorkStates=constw.ConstValue AND constw.GroupId='WorkStates' +GO + + +ALTER VIEW [dbo].[View_WBS] +AS +select '1' as Id,'0' as SupId ,'JZ' as Code, '' as Name,'ProjectType' as WBSType,null as PlanStartDate,null as PlanEndDate,null as RealEndDate,null as WBSCode, +ProjectId from dbo.WBS_UnitWork +Union +select '2' as Id,'0' as SupId ,'AZ' as Code, 'װ' as Name,'ProjectType' as WBSType,null as PlanStartDate,null as PlanEndDate,null as RealEndDate,null as WBSCode, +ProjectId from dbo.WBS_UnitWork +Union +select UnitWorkId as Id,ProjectType as SupId ,UnitWorkCode as Code, UnitWorkCode+'-'+UnitWorkName as Name,'UnitWork' as WBSType,PlanStartDate, PlanEndDate,RealEndDate,WBSCode, +ProjectId from dbo.WBS_UnitWork +Union all +select WorkPackageId as id,UnitWorkId as SupId,WorkPackageCode as Code,WorkPackageCode+'-'+PackageContent as Name,'WorkPackage' as WBSType,PlanStartDate, PlanEndDate,RealEndDate,WBSCode, +ProjectId from dbo.WBS_WorkPackage w where IsApprove=1 and SuperWorkPackageId is null +Union all +select WorkPackageId as id,SuperWorkPackageId as SupId,WorkPackageCode as Code, WorkPackageCode+'-'+PackageContent as Name,'WorkPackage' as WBSType,PlanStartDate, PlanEndDate,RealEndDate,WBSCode, +ProjectId from dbo.WBS_WorkPackage w where IsApprove=1 and SuperWorkPackageId is not null + + + + + + + +GO + + diff --git a/DataBase/版本日志/SGGLDB_V2023-07-11.sql b/DataBase/版本日志/已更新脚本/SGGLDB_V2023-07-11.sql similarity index 100% rename from DataBase/版本日志/SGGLDB_V2023-07-11.sql rename to DataBase/版本日志/已更新脚本/SGGLDB_V2023-07-11.sql diff --git a/DataBase/版本日志/SGGLDB_V2023-07-12.sql b/DataBase/版本日志/已更新脚本/SGGLDB_V2023-07-12.sql similarity index 100% rename from DataBase/版本日志/SGGLDB_V2023-07-12.sql rename to DataBase/版本日志/已更新脚本/SGGLDB_V2023-07-12.sql diff --git a/DataBase/版本日志/SGGLDB_V2023-07-20.sql b/DataBase/版本日志/已更新脚本/SGGLDB_V2023-07-20.sql similarity index 100% rename from DataBase/版本日志/SGGLDB_V2023-07-20.sql rename to DataBase/版本日志/已更新脚本/SGGLDB_V2023-07-20.sql diff --git a/DataBase/版本日志/SGGLDB_V2023-07-21.sql b/DataBase/版本日志/已更新脚本/SGGLDB_V2023-07-21.sql similarity index 100% rename from DataBase/版本日志/SGGLDB_V2023-07-21.sql rename to DataBase/版本日志/已更新脚本/SGGLDB_V2023-07-21.sql diff --git a/DataBase/版本日志/SGGLDB_V2023-07-23.sql b/DataBase/版本日志/已更新脚本/SGGLDB_V2023-07-23.sql similarity index 100% rename from DataBase/版本日志/SGGLDB_V2023-07-23.sql rename to DataBase/版本日志/已更新脚本/SGGLDB_V2023-07-23.sql diff --git a/DataBase/版本日志/SGGLDB_V2023-07-25.sql b/DataBase/版本日志/已更新脚本/SGGLDB_V2023-07-25.sql similarity index 100% rename from DataBase/版本日志/SGGLDB_V2023-07-25.sql rename to DataBase/版本日志/已更新脚本/SGGLDB_V2023-07-25.sql diff --git a/DataBase/版本日志/SGGLDB_V2023-08-01.sql b/DataBase/版本日志/已更新脚本/SGGLDB_V2023-08-01.sql similarity index 100% rename from DataBase/版本日志/SGGLDB_V2023-08-01.sql rename to DataBase/版本日志/已更新脚本/SGGLDB_V2023-08-01.sql diff --git a/DataBase/版本日志/SGGLDB_V2023-08-04.sql b/DataBase/版本日志/已更新脚本/SGGLDB_V2023-08-04.sql similarity index 100% rename from DataBase/版本日志/SGGLDB_V2023-08-04.sql rename to DataBase/版本日志/已更新脚本/SGGLDB_V2023-08-04.sql diff --git a/DataBase/版本日志/SGGLDB_V2023-08-22(大数据中心菜单修改).sql b/DataBase/版本日志/已更新脚本/SGGLDB_V2023-08-22(大数据中心菜单修改).sql similarity index 100% rename from DataBase/版本日志/SGGLDB_V2023-08-22(大数据中心菜单修改).sql rename to DataBase/版本日志/已更新脚本/SGGLDB_V2023-08-22(大数据中心菜单修改).sql diff --git a/DataBase/版本日志/SGGLDB_V2023-08-22.sql b/DataBase/版本日志/已更新脚本/SGGLDB_V2023-08-22.sql similarity index 100% rename from DataBase/版本日志/SGGLDB_V2023-08-22.sql rename to DataBase/版本日志/已更新脚本/SGGLDB_V2023-08-22.sql diff --git a/DataBase/版本日志/SGGLDB_V2023-08-23.sql b/DataBase/版本日志/已更新脚本/SGGLDB_V2023-08-23.sql similarity index 100% rename from DataBase/版本日志/SGGLDB_V2023-08-23.sql rename to DataBase/版本日志/已更新脚本/SGGLDB_V2023-08-23.sql diff --git a/DataBase/版本日志/SGGLDB_V2023-08-25.sql b/DataBase/版本日志/已更新脚本/SGGLDB_V2023-08-25.sql similarity index 100% rename from DataBase/版本日志/SGGLDB_V2023-08-25.sql rename to DataBase/版本日志/已更新脚本/SGGLDB_V2023-08-25.sql diff --git a/DataBase/版本日志/SGGLDB_V2023-08-26.sql b/DataBase/版本日志/已更新脚本/SGGLDB_V2023-08-26.sql similarity index 100% rename from DataBase/版本日志/SGGLDB_V2023-08-26.sql rename to DataBase/版本日志/已更新脚本/SGGLDB_V2023-08-26.sql diff --git a/SGGL/BLL/CQMS/Check/SpotCheckDetailService.cs b/SGGL/BLL/CQMS/Check/SpotCheckDetailService.cs index 4a0a6132..db46a066 100644 --- a/SGGL/BLL/CQMS/Check/SpotCheckDetailService.cs +++ b/SGGL/BLL/CQMS/Check/SpotCheckDetailService.cs @@ -41,6 +41,7 @@ namespace BLL newSpotCheckDetail.SpotCheckDetailId = SpotCheckDetail.SpotCheckDetailId; newSpotCheckDetail.SpotCheckCode = SpotCheckDetail.SpotCheckCode; newSpotCheckDetail.ControlItemAndCycleId = SpotCheckDetail.ControlItemAndCycleId; + newSpotCheckDetail.WorkPackageId = WorkPackageService.getWorkPageIdsByControlItemAndCycle(SpotCheckDetail.ControlItemAndCycleId); newSpotCheckDetail.IsOnesOK = SpotCheckDetail.IsOnesOK; newSpotCheckDetail.IsOK = SpotCheckDetail.IsOK; newSpotCheckDetail.ConfirmDate = SpotCheckDetail.ConfirmDate; @@ -58,6 +59,7 @@ namespace BLL newSpotCheckDetail.SpotCheckDetailId = SpotCheckDetail.SpotCheckDetailId; newSpotCheckDetail.SpotCheckCode = SpotCheckDetail.SpotCheckCode; newSpotCheckDetail.ControlItemAndCycleId = SpotCheckDetail.ControlItemAndCycleId; + newSpotCheckDetail.WorkPackageId = WorkPackageService.getWorkPageIdsByControlItemAndCycle(SpotCheckDetail.ControlItemAndCycleId); newSpotCheckDetail.IsOnesOK = SpotCheckDetail.IsOnesOK; newSpotCheckDetail.IsOK = SpotCheckDetail.IsOK; newSpotCheckDetail.ConfirmDate = SpotCheckDetail.ConfirmDate; @@ -80,6 +82,7 @@ namespace BLL { newSpotCheckDetail.SpotCheckCode = SpotCheckDetail.SpotCheckCode; newSpotCheckDetail.ControlItemAndCycleId = SpotCheckDetail.ControlItemAndCycleId; + newSpotCheckDetail.WorkPackageId = WorkPackageService.getWorkPageIdsByControlItemAndCycle(SpotCheckDetail.ControlItemAndCycleId); newSpotCheckDetail.IsOnesOK = SpotCheckDetail.IsOnesOK; newSpotCheckDetail.IsOK = SpotCheckDetail.IsOK; newSpotCheckDetail.ConfirmDate = SpotCheckDetail.ConfirmDate; @@ -334,6 +337,7 @@ namespace BLL newSpotCheckDetail.SpotCheckCode = SpotCheckDetail.SpotCheckCode; if (!string.IsNullOrEmpty(SpotCheckDetail.ControlItemAndCycleId)) newSpotCheckDetail.ControlItemAndCycleId = SpotCheckDetail.ControlItemAndCycleId; + newSpotCheckDetail.WorkPackageId = WorkPackageService.getWorkPageIdsByControlItemAndCycle(SpotCheckDetail.ControlItemAndCycleId); if (SpotCheckDetail.IsOnesOK.HasValue) newSpotCheckDetail.IsOnesOK = SpotCheckDetail.IsOnesOK; if (SpotCheckDetail.IsOK.HasValue) diff --git a/SGGL/BLL/CQMS/WBS/WorkPackageService.cs b/SGGL/BLL/CQMS/WBS/WorkPackageService.cs index 426d539e..98f1f8fc 100644 --- a/SGGL/BLL/CQMS/WBS/WorkPackageService.cs +++ b/SGGL/BLL/CQMS/WBS/WorkPackageService.cs @@ -245,7 +245,7 @@ namespace BLL /// 获取模拟树表格 /// /// - public static DataTable GetAllTreeDataTable(string projectId, string IsOut, string startTime, string endTime) + public static DataTable GetAllTreeDataTable(string projectId, string IsOut, string startTime, string endTime, string isOK) { using (var db = new Model.SGGLDB(Funs.ConnString)) { @@ -308,11 +308,11 @@ namespace BLL newList.Add(item); if (string.IsNullOrEmpty(IsOut)) { - AddDetail(newList, getWBSs.ToList(), item.Id, a.ToString(), startTime, endTime); + AddDetail(newList, getWBSs.ToList(), item.Id, a.ToString(), startTime, endTime, isOK); } else { - AddDetail(newList, getWBSs.ToList(), item.Id, a.ToString(), string.Empty, startTime, endTime); + AddDetail(newList, getWBSs.ToList(), item.Id, a.ToString(), string.Empty, startTime, endTime, isOK); } a++; } @@ -405,7 +405,7 @@ namespace BLL row[12] = workPackage.RealStartDate; } if (workPackage.RealEndDate != null) - { + { row[13] = workPackage.RealEndDate; } if (workPackage.PlanCost != null) @@ -454,30 +454,86 @@ namespace BLL } } - private static void AddDetail(List newList, List oldList, string id, string preCode, string startTime, string endTime) + private static void AddDetail(List newList, List oldList, string id, string preCode, string startTime, string endTime, string isOK) { - var items = oldList.Where(x => x.SupId == id && (x.PlanStartDate <= Funs.GetNewDateTime(startTime) || string.IsNullOrEmpty(startTime)) && (x.PlanEndDate >= Funs.GetNewDateTime(endTime) || string.IsNullOrEmpty(endTime))).OrderBy(x => x.WBSCode); - int b = 1; - foreach (var item in items) + if (isOK == "0") { - item.Code = preCode + "." + b.ToString(); - newList.Add(item); - AddDetail(newList, oldList, item.Id, item.Code, startTime, endTime); - b++; + var items = oldList.Where(x => x.SupId == id && (x.PlanStartDate <= Funs.GetNewDateTime(startTime) || string.IsNullOrEmpty(startTime)) && (x.PlanEndDate >= Funs.GetNewDateTime(endTime) || string.IsNullOrEmpty(endTime))).OrderBy(x => x.WBSCode); + int b = 1; + foreach (var item in items) + { + item.Code = preCode + "." + b.ToString(); + newList.Add(item); + AddDetail(newList, oldList, item.Id, item.Code, startTime, endTime, isOK); + b++; + } + } + else if (isOK == "1") + { + var items = oldList.Where(x => x.SupId == id && x.RealEndDate != null && (x.PlanStartDate <= Funs.GetNewDateTime(startTime) || string.IsNullOrEmpty(startTime)) && (x.PlanEndDate >= Funs.GetNewDateTime(endTime) || string.IsNullOrEmpty(endTime))).OrderBy(x => x.WBSCode); + int b = 1; + foreach (var item in items) + { + item.Code = preCode + "." + b.ToString(); + newList.Add(item); + AddDetail(newList, oldList, item.Id, item.Code, startTime, endTime, isOK); + b++; + } + } + else if (isOK == "2") + { + var items = oldList.Where(x => x.SupId == id && x.RealEndDate == null && (x.PlanStartDate <= Funs.GetNewDateTime(startTime) || string.IsNullOrEmpty(startTime)) && (x.PlanEndDate >= Funs.GetNewDateTime(endTime) || string.IsNullOrEmpty(endTime))).OrderBy(x => x.WBSCode); + int b = 1; + foreach (var item in items) + { + item.Code = preCode + "." + b.ToString(); + newList.Add(item); + AddDetail(newList, oldList, item.Id, item.Code, startTime, endTime, isOK); + b++; + } } } - private static void AddDetail(List newList, List oldList, string id, string preCode, string prefix, string startTime, string endTime) + private static void AddDetail(List newList, List oldList, string id, string preCode, string prefix, string startTime, string endTime, string isOK) { - var items = oldList.Where(x => x.SupId == id && (x.PlanStartDate <= Funs.GetNewDateTime(startTime) || string.IsNullOrEmpty(startTime)) && (x.PlanEndDate >= Funs.GetNewDateTime(endTime) || string.IsNullOrEmpty(endTime))).OrderBy(x => x.WBSCode); - int b = 1; - foreach (var item in items) + if (isOK == "0") { - item.Code = preCode + "." + b.ToString(); - item.Name = prefix + "...." + item.Name; - newList.Add(item); - AddDetail(newList, oldList, item.Id, item.Code, prefix + "....", startTime, endTime); - b++; + var items = oldList.Where(x => x.SupId == id && (x.PlanStartDate <= Funs.GetNewDateTime(startTime) || string.IsNullOrEmpty(startTime)) && (x.PlanEndDate >= Funs.GetNewDateTime(endTime) || string.IsNullOrEmpty(endTime))).OrderBy(x => x.WBSCode); + int b = 1; + foreach (var item in items) + { + item.Code = preCode + "." + b.ToString(); + item.Name = prefix + "...." + item.Name; + newList.Add(item); + AddDetail(newList, oldList, item.Id, item.Code, prefix + "....", startTime, endTime, isOK); + b++; + } + } + else if (isOK == "1") + { + var items = oldList.Where(x => x.SupId == id && x.RealEndDate != null && (x.PlanStartDate <= Funs.GetNewDateTime(startTime) || string.IsNullOrEmpty(startTime)) && (x.PlanEndDate >= Funs.GetNewDateTime(endTime) || string.IsNullOrEmpty(endTime))).OrderBy(x => x.WBSCode); + int b = 1; + foreach (var item in items) + { + item.Code = preCode + "." + b.ToString(); + item.Name = prefix + "...." + item.Name; + newList.Add(item); + AddDetail(newList, oldList, item.Id, item.Code, prefix + "....", startTime, endTime, isOK); + b++; + } + } + else if (isOK == "2") + { + var items = oldList.Where(x => x.SupId == id && x.RealEndDate == null && (x.PlanStartDate <= Funs.GetNewDateTime(startTime) || string.IsNullOrEmpty(startTime)) && (x.PlanEndDate >= Funs.GetNewDateTime(endTime) || string.IsNullOrEmpty(endTime))).OrderBy(x => x.WBSCode); + int b = 1; + foreach (var item in items) + { + item.Code = preCode + "." + b.ToString(); + item.Name = prefix + "...." + item.Name; + newList.Add(item); + AddDetail(newList, oldList, item.Id, item.Code, prefix + "....", startTime, endTime, isOK); + b++; + } } } @@ -626,5 +682,62 @@ namespace BLL } } } + + #region 根据工作包ID获取wbs节点及父节点字符串 + /// + /// 根据工作包ID获取wbs节点及父节点字符串 + /// + /// + /// + public static string getWorkPageIdsByControlItemAndCycle(string controlItemAndCycleId) + { + string returnValues = string.Empty; + var getControlItemAndCycle = Funs.DB.WBS_ControlItemAndCycle.FirstOrDefault(x => x.ControlItemAndCycleId == controlItemAndCycleId); + if (getControlItemAndCycle != null) + { + var getWorkPackage = Funs.DB.WBS_WorkPackage.FirstOrDefault(x => x.WorkPackageId == getControlItemAndCycle.WorkPackageId); + if (getWorkPackage != null) + { + returnValues = getSelectIds(getWorkPackage.WorkPackageId, getWorkPackage.WorkPackageId + "[" + getWorkPackage.InitWorkPackageCode + "]$" + controlItemAndCycleId); + } + } + + return returnValues; + } + + /// + /// id + /// + /// + /// + /// + public static string getSelectIds(string workPageId, string returnValues) + { + var getWorkPackage = Funs.DB.WBS_WorkPackage.FirstOrDefault(x => x.WorkPackageId == workPageId); + if (getWorkPackage != null) + { + if (!string.IsNullOrEmpty(getWorkPackage.SuperWorkPackageId)) + { + var getSupWorkPackage = Funs.DB.WBS_WorkPackage.FirstOrDefault(x => x.WorkPackageId == getWorkPackage.SuperWorkPackageId); + if (getSupWorkPackage != null) + { + returnValues = getWorkPackage.SuperWorkPackageId + "[" + getWorkPackage.InitWorkPackageCode + "]" + "|" + returnValues; + returnValues = getSelectIds(getWorkPackage.SuperWorkPackageId, returnValues); + } + + } + else + { + var getUnitWork = Funs.DB.WBS_UnitWork.FirstOrDefault(x => x.UnitWorkId == getWorkPackage.UnitWorkId); + if (getUnitWork != null) + { + returnValues = ("Type" + getUnitWork.ProjectType ?? "1") + "|" + getUnitWork.UnitWorkId + "|" + returnValues; + } + } + } + + return returnValues; + } + #endregion } } diff --git a/SGGL/BLL/HSSE/Solution/ExpertArgumentService.cs b/SGGL/BLL/HSSE/Solution/ExpertArgumentService.cs index c452ea2f..e4aec9b1 100644 --- a/SGGL/BLL/HSSE/Solution/ExpertArgumentService.cs +++ b/SGGL/BLL/HSSE/Solution/ExpertArgumentService.cs @@ -191,6 +191,7 @@ namespace BLL LargerHazardListId = LargerHazardListItem.LargerHazardListId, UnitWorkId = LargerHazardListItem.UnitWorkId, WorkPackageId = LargerHazardListItem.WorkPackageId, + WorkPackageName = LargerHazardListItem.WorkPackageName, WorkPackageSize = LargerHazardListItem.WorkPackageSize, ExpectedStartTime = LargerHazardListItem.ExpectedStartTime, ExpectedEndTime = LargerHazardListItem.ExpectedEndTime, @@ -215,6 +216,7 @@ namespace BLL newLargerHazardListItem.SortIndex = LargerHazardListItem.SortIndex; newLargerHazardListItem.UnitWorkId = LargerHazardListItem.UnitWorkId; newLargerHazardListItem.WorkPackageId = LargerHazardListItem.WorkPackageId; + newLargerHazardListItem.WorkPackageName = LargerHazardListItem.WorkPackageName; newLargerHazardListItem.WorkPackageSize = LargerHazardListItem.WorkPackageSize; newLargerHazardListItem.ExpectedStartTime = LargerHazardListItem.ExpectedStartTime; newLargerHazardListItem.ExpectedEndTime = LargerHazardListItem.ExpectedEndTime; diff --git a/SGGL/BLL/ProjectData/ProjectService.cs b/SGGL/BLL/ProjectData/ProjectService.cs index a74ab175..4b58db4f 100644 --- a/SGGL/BLL/ProjectData/ProjectService.cs +++ b/SGGL/BLL/ProjectData/ProjectService.cs @@ -338,7 +338,7 @@ } var pcount = (from x in db.Sys_Log - where x.ProjectId != null && x.OperationTime > DateTime.Now.AddDays(-2) + where x.ProjectId != null && x.OperationTime > DateTime.Now.AddDays(-1) group x by x.ProjectId into g select new { g.First().ProjectId, count = g.Count() }).Distinct(); diff --git a/SGGL/FineUIPro.Web/DigData/ProjectWBSDW.aspx b/SGGL/FineUIPro.Web/DigData/ProjectWBSDW.aspx index bdddf9f7..224d6294 100644 --- a/SGGL/FineUIPro.Web/DigData/ProjectWBSDW.aspx +++ b/SGGL/FineUIPro.Web/DigData/ProjectWBSDW.aspx @@ -37,6 +37,7 @@ + @@ -45,19 +46,46 @@ - - +