From 4efca8b8622bdd5d2a19bcaf34413f3abe2a1b69 Mon Sep 17 00:00:00 2001 From: gaofei1985 <181547018@qq.com> Date: Mon, 28 Aug 2023 18:26:38 +0800 Subject: [PATCH 1/3] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E9=A6=96=E9=A1=B5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Solution/EditConstructSolution.aspx.cs | 2 +- .../FineUIPro.Web/common/mainProject2.aspx.cs | 10 +++- SGGL/FineUIPro.Web/common/main_new.aspx.cs | 57 ++++++++++++++++++- 3 files changed, 63 insertions(+), 6 deletions(-) diff --git a/SGGL/FineUIPro.Web/CQMS/Solution/EditConstructSolution.aspx.cs b/SGGL/FineUIPro.Web/CQMS/Solution/EditConstructSolution.aspx.cs index 44d331e3..f551f717 100644 --- a/SGGL/FineUIPro.Web/CQMS/Solution/EditConstructSolution.aspx.cs +++ b/SGGL/FineUIPro.Web/CQMS/Solution/EditConstructSolution.aspx.cs @@ -173,7 +173,7 @@ namespace FineUIPro.Web.CQMS.Solution txtSolutionName.Enabled = false; txtCNProfessional.Enabled = false; txtUnitWork.Enabled = false; - ContactImg = -1; + ContactImg = 0; Panel2.Enabled = false; } //提交版本人多次修改 diff --git a/SGGL/FineUIPro.Web/common/mainProject2.aspx.cs b/SGGL/FineUIPro.Web/common/mainProject2.aspx.cs index 16ec59c2..5eb994b6 100644 --- a/SGGL/FineUIPro.Web/common/mainProject2.aspx.cs +++ b/SGGL/FineUIPro.Web/common/mainProject2.aspx.cs @@ -45,9 +45,13 @@ namespace FineUIPro.Web.common this.divSafeWorkTime.InnerHtml = wHours.ToString(); //本月安全人工时 - int wHoursMonth = db.SitePerson_PersonInOutNumber.Where(x => x.InOutDate > DateTime.Now.AddDays(-Convert.ToInt32(DateTime.Now.Date.Day)) - && x.ProjectId == ProjectId) - .Max(x => x.WorkHours) ?? 0; + int wHoursMonth = 0; + DateTime? sDate = Funs.GetNewDateTime(DateTime.Now.Year.ToString()+"-"+ DateTime.Now.Month.ToString()); + var dayReports = BLL.SitePerson_MonthReportService.getMonthReports(this.ProjectId, sDate); + if (dayReports.Count>0) + { + wHoursMonth = Convert.ToInt32(dayReports[0].DayWorkTime); + } this.divSafeWorkTimeMonth.InnerHtml = wHoursMonth.ToString(); //安全培训累计人员 diff --git a/SGGL/FineUIPro.Web/common/main_new.aspx.cs b/SGGL/FineUIPro.Web/common/main_new.aspx.cs index b80aea12..ce922ece 100644 --- a/SGGL/FineUIPro.Web/common/main_new.aspx.cs +++ b/SGGL/FineUIPro.Web/common/main_new.aspx.cs @@ -34,10 +34,19 @@ namespace FineUIPro.Web.common this.divSafeWorkTime.InnerHtml = wHours.ToString(); //本月安全人工时 - int wHoursMonth = db.SitePerson_PersonInOutNumber.Where(x => x.InOutDate > DateTime.Now.AddDays(-Convert.ToInt32(DateTime.Now.Date.Day))) - .Max(x => x.WorkHours) ?? 0; + int wHoursMonth = 0; + DateTime? sDate = Funs.GetNewDateTime(DateTime.Now.Year.ToString() + "-" + DateTime.Now.Month.ToString()); + var dayReports = getMonthReportsByCompany(sDate); + if (dayReports.Count > 0) + { + wHoursMonth = Convert.ToInt32(dayReports[0].DayWorkTime); + } this.divSafeWorkTimeMonth.InnerHtml = wHoursMonth.ToString(); + //int wHoursMonth = db.SitePerson_PersonInOutNumber.Where(x => x.InOutDate > DateTime.Now.AddDays(-Convert.ToInt32(DateTime.Now.Date.Day))) + // .Max(x => x.WorkHours) ?? 0; + //this.divSafeWorkTimeMonth.InnerHtml = wHoursMonth.ToString(); + //安全培训累计人员 var getTrainRecord = db.EduTrain_TrainRecord.Max(x=>x.TrainPersonNum)??0; this.divSafePersonNum.InnerHtml = getTrainRecord.ToString(); @@ -110,6 +119,50 @@ namespace FineUIPro.Web.common } } + #region 当月人工时 + /// + /// 获取出入记录人工时-月报(项目级别) + /// + /// + public static List getMonthReportsByCompany(DateTime? sDate) + { + Model.SGGLDB db = Funs.DB; + List reports = new List(); + var getAllPersonInOutList = from x in db.SitePerson_PersonInOutNumber + + select x; + if (getAllPersonInOutList.Count() > 0) + { + var getInMonths = (from x in getAllPersonInOutList select new { x.InOutDate.Year, x.InOutDate.Month }).Distinct(); + if (sDate.HasValue) + { + getInMonths = getInMonths.Where(x => x.Year == sDate.Value.Year && x.Month == sDate.Value.Month); + } + foreach (var item in getInMonths) + { + DateTime compileDate = Funs.GetNewDateTimeOrNow(item.Year.ToString() + "-" + item.Month.ToString()); + var getNow = getAllPersonInOutList.Where(x => x.InOutDate.Year == compileDate.Year && x.InOutDate.Month == compileDate.Month).Max(x => x.WorkHours); + if (getNow.HasValue) + { + Model.SitePerson_MonthReport reportItem = new Model.SitePerson_MonthReport + { + MonthReportId = SQLHelper.GetNewID(), + + CompileDate = Funs.GetNewDateTime(item.Year.ToString() + "-" + item.Month.ToString()), + TotalPersonWorkTime = getNow, + }; + DateTime upDate = compileDate.AddMonths(-1); + var getMax = getAllPersonInOutList.Where(x => x.InOutDate.Year == upDate.Year && x.InOutDate.Month == upDate.Month).Max(x => x.WorkHours) ?? 0; + reportItem.DayWorkTime = (getNow ?? 0) - getMax; + reports.Add(reportItem); + } + + } + } + return reports; + } + #endregion + #region 项目信息 protected string Project { From 77e39c5281828957c9a2b5dbbd65d7a5f2c1e910 Mon Sep 17 00:00:00 2001 From: wendy <408182087@qq.com> Date: Tue, 29 Aug 2023 09:44:00 +0800 Subject: [PATCH 2/3] =?UTF-8?q?20230829=20wbs=E6=8B=B7=E8=B4=9D=E5=8D=95?= =?UTF-8?q?=E4=BD=8D=E5=B7=A5=E7=A8=8B=E4=B8=8B=E5=8B=BE=E9=80=89=E7=8A=B6?= =?UTF-8?q?=E6=80=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../CQMS/WBS/ProjectControlPoint.aspx | 6 +- .../CQMS/WBS/ProjectControlPoint.aspx.cs | 81 +++++++++++++++++++ .../WBS/ProjectControlPoint.aspx.designer.cs | 9 +++ 3 files changed, 93 insertions(+), 3 deletions(-) diff --git a/SGGL/FineUIPro.Web/CQMS/WBS/ProjectControlPoint.aspx b/SGGL/FineUIPro.Web/CQMS/WBS/ProjectControlPoint.aspx index 926bd886..74109dcf 100644 --- a/SGGL/FineUIPro.Web/CQMS/WBS/ProjectControlPoint.aspx +++ b/SGGL/FineUIPro.Web/CQMS/WBS/ProjectControlPoint.aspx @@ -150,10 +150,10 @@ + - <%-- - --%> diff --git a/SGGL/FineUIPro.Web/CQMS/WBS/ProjectControlPoint.aspx.cs b/SGGL/FineUIPro.Web/CQMS/WBS/ProjectControlPoint.aspx.cs index dd8aa1e6..8129f893 100644 --- a/SGGL/FineUIPro.Web/CQMS/WBS/ProjectControlPoint.aspx.cs +++ b/SGGL/FineUIPro.Web/CQMS/WBS/ProjectControlPoint.aspx.cs @@ -1374,5 +1374,86 @@ namespace FineUIPro.Web.CQMS.WBS } } #endregion + + #region 拷贝单位工程下勾选状态 + /// + /// 拷贝单位工程下勾选状态 + /// + /// + /// + protected void btnMenuCopy_Click(object sender, EventArgs e) + { + if (this.trWBS.SelectedNode != null) + { + string unitWorkId = string.Empty; + var newUnitWork = BLL.UnitWorkService.GetUnitWorkByUnitWorkId(this.trWBS.SelectedNode.NodeID); + if (newUnitWork != null) + { + unitWorkId = newUnitWork.UnitWorkId; + } + else + { + var div = BLL.DivisionProjectService.GetDivisionProjectById(this.trWBS.SelectedNode.NodeID); + if (div != null) + { + if (!string.IsNullOrEmpty(div.UnitWorkId)) + { + unitWorkId = div.UnitWorkId; + } + } + else + { + var div2 = (from x in Funs.DB.WBS_DivisionProject where x.CNProfessionalId != null && x.CNProfessionalId == this.trWBS.SelectedNodeID select x).FirstOrDefault(); + if (div2 != null) + { + if (!string.IsNullOrEmpty(div2.UnitWorkId)) + { + unitWorkId = div2.UnitWorkId; + } + } + else + { + var nodeId = this.trWBS.SelectedNodeID.Split('|')[0]; + var uw = BLL.UnitWorkService.GetUnitWorkByUnitWorkId(nodeId); + if (uw != null) + { + unitWorkId = uw.UnitWorkId; + } + } + } + } + var unitWork = (from x in Funs.DB.WBS_UnitWork + where x.ProjectId == this.CurrUser.LoginProjectId + && x.UnitWorkId != unitWorkId + select x).FirstOrDefault(); + + var oldDivsionProject = (from x in Funs.DB.WBS_DivisionProject + where x.ProjectId == this.CurrUser.LoginProjectId && x.IsSelected == true + && x.UnitWorkId == unitWork.UnitWorkId + select x).ToList(); + foreach (var item in oldDivsionProject) + { + var div = Funs.DB.WBS_DivisionProject.FirstOrDefault(x => x.ProjectId == this.CurrUser.LoginProjectId && x.UnitWorkId == unitWorkId && x.DivisionCode == item.DivisionCode); + if (div != null) + { + div.IsSelected = true; + Funs.DB.SubmitChanges(); + + var breakdownProjects = (from x in Funs.DB.WBS_BreakdownProject + where x.ProjectId == this.CurrUser.LoginProjectId + && x.UnitWorkId == unitWorkId + && x.DivisionProjectId == div.DivisionProjectId + select x).ToList(); + foreach (var b in breakdownProjects) + { + b.IsSelected = true; + Funs.DB.SubmitChanges(); + } + } + } + ShowNotify("拷贝成功", MessageBoxIcon.Success); + } + } + #endregion } } \ No newline at end of file diff --git a/SGGL/FineUIPro.Web/CQMS/WBS/ProjectControlPoint.aspx.designer.cs b/SGGL/FineUIPro.Web/CQMS/WBS/ProjectControlPoint.aspx.designer.cs index cbed3b5f..7b718290 100644 --- a/SGGL/FineUIPro.Web/CQMS/WBS/ProjectControlPoint.aspx.designer.cs +++ b/SGGL/FineUIPro.Web/CQMS/WBS/ProjectControlPoint.aspx.designer.cs @@ -219,6 +219,15 @@ namespace FineUIPro.Web.CQMS.WBS { /// protected global::FineUIPro.MenuButton btnMenuEdit; + /// + /// btnMenuCopy 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.MenuButton btnMenuCopy; + /// /// btnMenuDelete 控件。 /// From 0223f7c3a4709984d67b0bd2e8de8b6d6bea2252 Mon Sep 17 00:00:00 2001 From: gaofei1985 <181547018@qq.com> Date: Tue, 29 Aug 2023 09:45:18 +0800 Subject: [PATCH 3/3] =?UTF-8?q?=E6=8F=90=E4=BA=A4=E8=AF=95=E8=BD=A6?= =?UTF-8?q?=E4=BB=A3=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../版本日志/SGGLDB_WH_2023-08-29.sql | 40 +++++++++++++++++++ .../BeforeTestRun/SysPipingDeviceImport.aspx | 8 ++-- .../SysPipingDeviceImport.aspx.cs | 20 +++++++--- SGGL/Model/Model.cs | 6 +-- 4 files changed, 61 insertions(+), 13 deletions(-) create mode 100644 DataBase/版本日志/SGGLDB_WH_2023-08-29.sql diff --git a/DataBase/版本日志/SGGLDB_WH_2023-08-29.sql b/DataBase/版本日志/SGGLDB_WH_2023-08-29.sql new file mode 100644 index 00000000..549a4d24 --- /dev/null +++ b/DataBase/版本日志/SGGLDB_WH_2023-08-29.sql @@ -0,0 +1,40 @@ + +--޸ֶγ +ALTER TABLE PreRun_TechnologySysPiping ALTER Column NameSpecifications varchar(max) null; +ALTER TABLE PreRun_TechnologySysPiping ALTER Column Materials varchar(max) null; +GO +--ɾеı +ALTER TABLE PreRun_WorkPackage DROP COLUMN WorkPackCode +GO +--ϵͳ +truncate table PreRun_SubSysWorkPackage +--ϵͳϵͳ +alter table PreRun_SubSysWorkPackage add SystemId varchar(50) NULL +GO + +IF object_id(N'PreRun_TechnologySysPiping',N'U') is not null +drop table dbo.PreRun_TechnologySysPiping +CREATE TABLE [dbo].[PreRun_TechnologySysPiping]( + [TechnologyId] [varchar](50) NOT NULL, + [SystemId] [varchar](50) NULL, + [ProjectId] [varchar](50) NULL, + [TagNumber] [varchar](50) NULL, + [NameSpecifications] [varchar](max) NULL, + [DrawingNo] [varchar](50) NULL, + [Materials] [varchar](max) NULL, + [NumOperate] [varchar](50) NULL, + [NumStandby] [varchar](50) NULL, + [WeightSingle] [varchar](50) NULL, + [WeightTotal] [varchar](50) NULL, + [Remark] [nvarchar](150) NULL, + [AddUser] [varchar](50) NULL, + [AddTime] [datetime] NULL, + [Sort] [int] NULL, + CONSTRAINT [PK_PreRun_TechnologySysPiping] PRIMARY KEY CLUSTERED +( + [TechnologyId] ASC +)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY] +) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY] +GO + + diff --git a/SGGL/FineUIPro.Web/TestRun/BeforeTestRun/SysPipingDeviceImport.aspx b/SGGL/FineUIPro.Web/TestRun/BeforeTestRun/SysPipingDeviceImport.aspx index 8a061f51..e4b3418d 100644 --- a/SGGL/FineUIPro.Web/TestRun/BeforeTestRun/SysPipingDeviceImport.aspx +++ b/SGGL/FineUIPro.Web/TestRun/BeforeTestRun/SysPipingDeviceImport.aspx @@ -73,7 +73,7 @@ - + @@ -262,7 +262,7 @@ - + @@ -374,7 +374,7 @@ - + @@ -513,7 +513,7 @@ - + diff --git a/SGGL/FineUIPro.Web/TestRun/BeforeTestRun/SysPipingDeviceImport.aspx.cs b/SGGL/FineUIPro.Web/TestRun/BeforeTestRun/SysPipingDeviceImport.aspx.cs index d3ecedd1..5a290c54 100644 --- a/SGGL/FineUIPro.Web/TestRun/BeforeTestRun/SysPipingDeviceImport.aspx.cs +++ b/SGGL/FineUIPro.Web/TestRun/BeforeTestRun/SysPipingDeviceImport.aspx.cs @@ -48,7 +48,7 @@ namespace FineUIPro.Web.TestRun.BeforeTestRun rootNode.EnableClickEvent = true; this.tvControlItem.Nodes.Add(rootNode); var allPreRunLs = Funs.DB.PreRun_SysDevice.Where(p => p.ProjectId == this.CurrUser.LoginProjectId).ToList(); - var onePreRunLs = allPreRunLs.Where(p => p.PreRunLevel == 1); + var onePreRunLs = allPreRunLs.Where(p => p.PreRunLevel == 1).OrderBy(x => x.Sort); foreach (var item in onePreRunLs) { TreeNode rootUnitNode = new TreeNode();//定义根节点 @@ -71,7 +71,7 @@ namespace FineUIPro.Web.TestRun.BeforeTestRun private void BindNodes(TreeNode node, List list, string parentId) { - var itemList = list.Where(p => p.ParentId == parentId).ToList(); + var itemList = list.Where(p => p.ParentId == parentId).OrderBy(x => x.Sort).ToList(); if (itemList.Count > 0) { foreach (var item in itemList) @@ -305,8 +305,11 @@ namespace FineUIPro.Web.TestRun.BeforeTestRun var existPropertys = Funs.DB.PreRun_PropertySysPiping.Where(a => pipingCodes.Contains(a.PipingCode) && a.SystemId == tvControlItem.SelectedNodeID && a.ProjectId == this.CurrUser.LoginProjectId).ToList(); if (existPropertys.Count > 0) { - ShowNotify($"管道号({string.Join(",", existPropertys.ConvertAll(s => s.PipingCode))})已存在!", MessageBoxIcon.Warning); - return; + //删除已经存在的信息 + Funs.DB.PreRun_PropertySysPiping.DeleteAllOnSubmit(existPropertys); + Funs.DB.SubmitChanges(); + //ShowNotify($"管道号({string.Join(",", existPropertys.ConvertAll(s => s.PipingCode))})已存在!", MessageBoxIcon.Warning); + //return; } List list = new List(); //数据导入 @@ -350,6 +353,7 @@ namespace FineUIPro.Web.TestRun.BeforeTestRun ShowNotify("文件无数据!", MessageBoxIcon.Warning); } ZxtgdBrid(); + ShowNotify("导入成功!", MessageBoxIcon.Success); } catch (Exception ex) { @@ -533,8 +537,11 @@ namespace FineUIPro.Web.TestRun.BeforeTestRun var existTechnologys = Funs.DB.PreRun_TechnologySysPiping.Where(a => tagNumbers.Contains(a.TagNumber) && a.SystemId == tvControlItem.SelectedNodeID && a.ProjectId == this.CurrUser.LoginProjectId).ToList(); if (existTechnologys.Count > 0) { - ShowNotify($"设备位号({string.Join(",", existTechnologys.ConvertAll(s => s.TagNumber))})已存在!", MessageBoxIcon.Warning); - return; + //删除已经存在的信息 + Funs.DB.PreRun_TechnologySysPiping.DeleteAllOnSubmit(existTechnologys); + Funs.DB.SubmitChanges(); + //ShowNotify($"设备位号({string.Join(",", existTechnologys.ConvertAll(s => s.TagNumber))})已存在!", MessageBoxIcon.Warning); + //return; } string nameSpecificationStr = string.Empty; string materialStr = string.Empty; @@ -621,6 +628,7 @@ namespace FineUIPro.Web.TestRun.BeforeTestRun ShowNotify("文件无数据!", MessageBoxIcon.Warning); } ZxtgyBrid(); + ShowNotify("导入成功!", MessageBoxIcon.Success); } catch (Exception ex) { diff --git a/SGGL/Model/Model.cs b/SGGL/Model/Model.cs index 41cac1d2..51b60f25 100644 --- a/SGGL/Model/Model.cs +++ b/SGGL/Model/Model.cs @@ -90816,7 +90816,7 @@ namespace Model } } - [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_InspectionMachineCode", DbType="NVarChar(50) NOT NULL", CanBeNull=false)] + [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_InspectionMachineCode", DbType="NVarChar(100)")] public string InspectionMachineCode { get @@ -91747,7 +91747,7 @@ namespace Model } } - [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_InspectionPersonCode", DbType="NVarChar(50) NOT NULL", CanBeNull=false)] + [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_InspectionPersonCode", DbType="NVarChar(100)")] public string InspectionPersonCode { get @@ -320055,7 +320055,7 @@ namespace Model } } - [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_ConstValue", DbType="NVarChar(200)")] + [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_ConstValue", DbType="NVarChar(500)")] public string ConstValue { get