From 26b921cab23bebfb757df18710c7e1b649c44ec3 Mon Sep 17 00:00:00 2001 From: fei550 <1420031550@qq.com> Date: Wed, 24 Dec 2025 16:27:05 +0800 Subject: [PATCH 1/5] =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E8=80=83=E5=8B=A4?= =?UTF-8?q?=E5=AF=B9=E6=8E=A5=E9=9C=80=E8=A6=81=E4=BA=BA=E5=91=98=E6=8E=A5?= =?UTF-8?q?=E5=8F=A3=E5=92=8C=E8=80=83=E5=8B=A4=E8=AE=B0=E5=BD=95=E6=8E=A5?= =?UTF-8?q?=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- SGGL/BLL/API/APIPersonService.cs | 127 ++++++++++++++++++++ SGGL/FineUIPro.Web/FineUIPro.Web.csproj | 2 +- SGGL/Model/HSSE/ProjectPersonInput.cs | 96 +++++++++++++++ SGGL/Model/Model.csproj | 1 + SGGL/WebAPI/Controllers/PersonController.cs | 33 +++++ 5 files changed, 258 insertions(+), 1 deletion(-) create mode 100644 SGGL/Model/HSSE/ProjectPersonInput.cs diff --git a/SGGL/BLL/API/APIPersonService.cs b/SGGL/BLL/API/APIPersonService.cs index 22fc70d4..c111966b 100644 --- a/SGGL/BLL/API/APIPersonService.cs +++ b/SGGL/BLL/API/APIPersonService.cs @@ -293,6 +293,133 @@ namespace BLL } #endregion + #region 根据条件获取项目人员信息(支持多条件过滤) + /// + /// 根据条件获取项目人员信息(支持多条件过滤) + /// + /// 查询过滤条件 + /// + public static List getPersonByFilter(Model.ProjectPersonInput filter) + { + using (Model.SGGLDB db = new Model.SGGLDB(Funs.ConnString)) + { + var query = from x in db.View_SitePerson_Person + select x; + + // 添加过滤条件 + if (filter != null) + { + // 项目ID过滤 + if (!string.IsNullOrEmpty(filter.ProjectId)) + { + query = query.Where(x => x.ProjectId == filter.ProjectId); + } + + // 人员ID过滤 + if (!string.IsNullOrEmpty(filter.PersonId)) + { + query = query.Where(x => x.PersonId == filter.PersonId); + } + + // 项目人员ID过滤 + if (!string.IsNullOrEmpty(filter.SitePersonId)) + { + query = query.Where(x => x.SitePersonId == filter.SitePersonId); + } + + // 姓名过滤(模糊查询) + if (!string.IsNullOrEmpty(filter.PersonName)) + { + query = query.Where(x => x.PersonName.Contains(filter.PersonName)); + } + + // 身份证号过滤 + if (!string.IsNullOrEmpty(filter.IdentityCard)) + { + query = query.Where(x => x.IdentityCard == filter.IdentityCard); + } + + // 卡号过滤 + if (!string.IsNullOrEmpty(filter.CardNo)) + { + query = query.Where(x => x.CardNo == filter.CardNo); + } + + // 单位名称过滤(模糊查询) + if (!string.IsNullOrEmpty(filter.UnitName)) + { + query = query.Where(x => x.UnitName.Contains(filter.UnitName)); + } + + // 班组名称过滤(模糊查询) + if (!string.IsNullOrEmpty(filter.TeamGroupName)) + { + query = query.Where(x => x.TeamGroupName.Contains(filter.TeamGroupName)); + } + + // 岗位名称过滤(模糊查询) + if (!string.IsNullOrEmpty(filter.WorkPostName)) + { + query = query.Where(x => x.WorkPostName.Contains(filter.WorkPostName)); + } + + // 性别过滤 + if (!string.IsNullOrEmpty(filter.Sex)) + { + query = query.Where(x => x.Sex == filter.Sex); + } + + // 电话号码过滤(模糊查询) + if (!string.IsNullOrEmpty(filter.Telephone)) + { + query = query.Where(x => x.Telephone.Contains(filter.Telephone)); + } + } + + // 默认只返回在岗人员 + query = query.Where(x => x.States == Const.ProjectPersonStates_1); + + var persons = from x in query orderby x.CardNo descending + select new Model.PersonItem + { + PersonId = x.PersonId, + SitePersonId = x.SitePersonId, + CardNo = x.CardNo, + PersonName = x.PersonName, + SexName = x.SexName, + Sex = x.Sex, + IdentityCard = x.IdentityCard, + Address = x.Address, + ProjectId = x.ProjectId, + ProjectCode = x.ProjectCode, + ProjectName = x.ProjectName, + UnitId = x.UnitId, + UnitCode = x.UnitCode, + UnitName = x.UnitName, + TeamGroupId = x.TeamGroupId, + TeamGroupName = x.TeamGroupName, + WorkPostId = x.WorkPostId, + WorkPostName = x.WorkPostName, + InTime = string.Format("{0:yyyy-MM-dd}", x.InTime), + OutTime = string.Format("{0:yyyy-MM-dd}", x.OutTime), + OutResult = x.OutResult, + Telephone = x.Telephone, + PhotoUrl = x.PhotoUrl, + DepartName = x.DepartName, + WorkAreaId = x.WorkAreaId, + WorkAreaName = x.WorkAreaName, + PostType = x.PostType, + IsForeign = x.IsForeign.HasValue ? x.IsForeign : false, + PersonType = x.PersonType, + PersonTypeName = x.PersonType == "2" ? "外聘" : (x.PersonType == "3" ? "第三方" : "员工"), + PostTypeName = db.Sys_Const.FirstOrDefault(z => z.GroupId == ConstValue.Group_PostType && z.ConstValue == x.PostType).ConstText, + }; + + return persons.ToList(); + } + } + #endregion + #region 获取在岗、离岗、待审人员列表 /// /// 记录数 diff --git a/SGGL/FineUIPro.Web/FineUIPro.Web.csproj b/SGGL/FineUIPro.Web/FineUIPro.Web.csproj index a4dfcd34..ba58f7e9 100644 --- a/SGGL/FineUIPro.Web/FineUIPro.Web.csproj +++ b/SGGL/FineUIPro.Web/FineUIPro.Web.csproj @@ -16838,7 +16838,7 @@ - + diff --git a/SGGL/Model/HSSE/ProjectPersonInput.cs b/SGGL/Model/HSSE/ProjectPersonInput.cs new file mode 100644 index 00000000..68c2d405 --- /dev/null +++ b/SGGL/Model/HSSE/ProjectPersonInput.cs @@ -0,0 +1,96 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace Model +{ + public class ProjectPersonInput + { + /// + /// 人员主键ID + /// + public string PersonId { get; set; } + /// + /// 项目人员主键ID + /// + public string SitePersonId { get; set; } + + /// + /// 卡号 + /// + public string CardNo { get; set; } + /// + /// 姓名 + /// + public string PersonName { get; set; } + /// + /// 性别 + /// + public string SexName { get; set; } + /// + /// 性别 + /// + public string Sex { get; set; } + /// + /// 身份证号码 + /// + public string IdentityCard { get; set; } + + /// + /// 项目id + /// + public string ProjectId { get; set; } + + /// + /// 项目名称 + /// + public string ProjectName { get; set; } + /// + /// 单位名称 + /// + public string UnitName { get; set; } + /// + /// 班组名称 + /// + public string TeamGroupName { get; set; } + /// + /// 岗位名称 + /// + public string WorkPostName { get; set; } + + /// + /// 电话 + /// + public string Telephone { get; set; } + /// + /// 照片路径 + /// + public string PhotoUrl { get; set; } + /// + /// 照片二进制 + /// + public string headImage { get; set; } + /// + /// 部门名称 + /// + public string DepartName { get; set; } + /// + /// 岗位类型名称 + /// + public string PostTypeName + { + get; + set; + } + /// + /// 人员类型 + /// + public string PersonTypeName + { + get; + set; + } + } +} diff --git a/SGGL/Model/Model.csproj b/SGGL/Model/Model.csproj index 016a5a9d..bddb95ec 100644 --- a/SGGL/Model/Model.csproj +++ b/SGGL/Model/Model.csproj @@ -252,6 +252,7 @@ + diff --git a/SGGL/WebAPI/Controllers/PersonController.cs b/SGGL/WebAPI/Controllers/PersonController.cs index 86800b99..fd8a1989 100644 --- a/SGGL/WebAPI/Controllers/PersonController.cs +++ b/SGGL/WebAPI/Controllers/PersonController.cs @@ -98,6 +98,39 @@ namespace WebAPI.Controllers } #endregion + #region 根据条件获取项目人员信息(支持分页和过滤) + /// + /// 根据条件获取项目人员信息(支持分页和过滤) + /// + /// 查询过滤条件 + /// 每页条数 + /// 页码(从1开始) + /// 是否返回全部数据 + /// + public Model.ResponeData getPersonByFilter([FromUri] Model.ProjectPersonInput filter, int pagesize = 15, int pageindex = 1, bool returnAll = false) + { + var responeData = new Model.ResponeData(); + try + { + var getDataList = APIPersonService.getPersonByFilter(filter); + int pageCount = getDataList.Count; + + if (!returnAll && pageCount > 0 && pageindex > 0 && pagesize > 0) + { + getDataList = getDataList.Skip(pagesize * (pageindex - 1)).Take(pagesize).ToList(); + } + + responeData.data = new { pageCount, pageindex, pagesize, getDataList }; + } + catch (Exception ex) + { + responeData.code = 0; + responeData.message = ex.Message; + } + return responeData; + } + #endregion + #region 获取在岗、离岗、待审人员数量 /// /// 获取在岗、离岗、待审人员列表 From 8ccc25e07458e9bd0c84e0234f940936078ed587 Mon Sep 17 00:00:00 2001 From: fei550 <1420031550@qq.com> Date: Wed, 24 Dec 2025 16:27:07 +0800 Subject: [PATCH 2/5] =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E8=80=83=E5=8B=A4?= =?UTF-8?q?=E5=AF=B9=E6=8E=A5=E9=9C=80=E8=A6=81=E4=BA=BA=E5=91=98=E6=8E=A5?= =?UTF-8?q?=E5=8F=A3=E5=92=8C=E8=80=83=E5=8B=A4=E8=AE=B0=E5=BD=95=E6=8E=A5?= =?UTF-8?q?=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- SGGL/BLL/API/APIPersonService.cs | 81 +++++++++---- SGGL/Model/HSSE/PersonInOutRecordInput.cs | 31 +++++ SGGL/Model/HSSE/ProjectPersonInput.cs | 20 ---- SGGL/Model/HSSE/ProjectPersonOutput.cs | 124 ++++++++++++++++++++ SGGL/Model/Model.csproj | 2 + SGGL/WebAPI/Controllers/PersonController.cs | 81 +++++++++++-- 6 files changed, 289 insertions(+), 50 deletions(-) create mode 100644 SGGL/Model/HSSE/PersonInOutRecordInput.cs create mode 100644 SGGL/Model/HSSE/ProjectPersonOutput.cs diff --git a/SGGL/BLL/API/APIPersonService.cs b/SGGL/BLL/API/APIPersonService.cs index c111966b..9f46216d 100644 --- a/SGGL/BLL/API/APIPersonService.cs +++ b/SGGL/BLL/API/APIPersonService.cs @@ -299,7 +299,7 @@ namespace BLL /// /// 查询过滤条件 /// - public static List getPersonByFilter(Model.ProjectPersonInput filter) + public static List getPersonByFilter(Model.ProjectPersonInput filter) { using (Model.SGGLDB db = new Model.SGGLDB(Funs.ConnString)) { @@ -315,6 +315,12 @@ namespace BLL query = query.Where(x => x.ProjectId == filter.ProjectId); } + // 项目名称过滤(模糊查询) + if (!string.IsNullOrEmpty(filter.ProjectName)) + { + query = query.Where(x => x.ProjectName.Contains(filter.ProjectName)); + } + // 人员ID过滤 if (!string.IsNullOrEmpty(filter.PersonId)) { @@ -361,44 +367,26 @@ namespace BLL if (!string.IsNullOrEmpty(filter.WorkPostName)) { query = query.Where(x => x.WorkPostName.Contains(filter.WorkPostName)); - } - - // 性别过滤 - if (!string.IsNullOrEmpty(filter.Sex)) - { - query = query.Where(x => x.Sex == filter.Sex); - } - - // 电话号码过滤(模糊查询) - if (!string.IsNullOrEmpty(filter.Telephone)) - { - query = query.Where(x => x.Telephone.Contains(filter.Telephone)); - } + } } // 默认只返回在岗人员 query = query.Where(x => x.States == Const.ProjectPersonStates_1); var persons = from x in query orderby x.CardNo descending - select new Model.PersonItem + select new Model.ProjectPersonOutput { PersonId = x.PersonId, SitePersonId = x.SitePersonId, CardNo = x.CardNo, PersonName = x.PersonName, SexName = x.SexName, - Sex = x.Sex, IdentityCard = x.IdentityCard, - Address = x.Address, ProjectId = x.ProjectId, - ProjectCode = x.ProjectCode, ProjectName = x.ProjectName, UnitId = x.UnitId, - UnitCode = x.UnitCode, UnitName = x.UnitName, - TeamGroupId = x.TeamGroupId, TeamGroupName = x.TeamGroupName, - WorkPostId = x.WorkPostId, WorkPostName = x.WorkPostName, InTime = string.Format("{0:yyyy-MM-dd}", x.InTime), OutTime = string.Format("{0:yyyy-MM-dd}", x.OutTime), @@ -406,10 +394,8 @@ namespace BLL Telephone = x.Telephone, PhotoUrl = x.PhotoUrl, DepartName = x.DepartName, - WorkAreaId = x.WorkAreaId, WorkAreaName = x.WorkAreaName, PostType = x.PostType, - IsForeign = x.IsForeign.HasValue ? x.IsForeign : false, PersonType = x.PersonType, PersonTypeName = x.PersonType == "2" ? "外聘" : (x.PersonType == "3" ? "第三方" : "员工"), PostTypeName = db.Sys_Const.FirstOrDefault(z => z.GroupId == ConstValue.Group_PostType && z.ConstValue == x.PostType).ConstText, @@ -1113,6 +1099,55 @@ namespace BLL } #endregion + #region 根据条件获取人员出入场记录(支持多条件过滤) + /// + /// 根据条件获取人员出入场记录(支持多条件过滤) + /// + /// 查询过滤条件 + /// + public static List getPersonInOutListByFilter(Model.PersonInOutRecordInput filter) + { + using (Model.SGGLDB db = new Model.SGGLDB(Funs.ConnString)) + { + var query = from x in db.SitePerson_PersonInOut + join y in db.SitePerson_Person on x.PersonId equals y.PersonId + where x.ChangeTime >= filter.StartTime && x.ChangeTime <= filter.EndTime + select new Model.PersonInOutItem + { + PersonId = x.PersonId, + PersonName = y.PersonName, + ProjectId = x.ProjectId, + UnitId = y.UnitId, + UnitName = db.Base_Unit.First(z => z.UnitId == y.UnitId).UnitName, + WorkPostId = y.WorkPostId, + WorkPostName = db.Base_WorkPost.First(z => z.WorkPostId == y.WorkPostId).WorkPostName, + IsIn = x.IsIn, + IsInName = x.IsIn == true ? "进场" : "出场", + ChangeTime = string.Format("{0:yyyy-MM-dd HH:mm}", x.ChangeTime), + ChangeTimeD = x.ChangeTime, + }; + + // 添加过滤条件 + if (filter != null) + { + // 单位名称过滤(模糊查询) + if (!string.IsNullOrEmpty(filter.UnitName)) + { + query = query.Where(x => x.UnitName.Contains(filter.UnitName)); + } + + // 人员姓名过滤(模糊查询) + if (!string.IsNullOrEmpty(filter.PersonName)) + { + query = query.Where(x => x.PersonName.Contains(filter.PersonName)); + } + } + + return query.OrderByDescending(x => x.ChangeTimeD).ToList(); + } + } + #endregion + #region 根据identityCard获取人员资质信息 /// /// 根据identityCard获取人员资质信息 diff --git a/SGGL/Model/HSSE/PersonInOutRecordInput.cs b/SGGL/Model/HSSE/PersonInOutRecordInput.cs new file mode 100644 index 00000000..659d32ea --- /dev/null +++ b/SGGL/Model/HSSE/PersonInOutRecordInput.cs @@ -0,0 +1,31 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace Model +{ + /// + /// 人员出入记录入参 + /// + public class PersonInOutRecordInput + { + /// + /// 单位名称 + /// + public string UnitName { get; set; } + /// + /// 人员姓名 + /// + public string PersonName { get; set; } + /// + /// 开始时间 + /// + public DateTime StartTime { get; set; } + /// + /// 结束时间 + /// + public DateTime EndTime { get; set; } + } +} diff --git a/SGGL/Model/HSSE/ProjectPersonInput.cs b/SGGL/Model/HSSE/ProjectPersonInput.cs index 68c2d405..e594b832 100644 --- a/SGGL/Model/HSSE/ProjectPersonInput.cs +++ b/SGGL/Model/HSSE/ProjectPersonInput.cs @@ -26,14 +26,6 @@ namespace Model /// public string PersonName { get; set; } /// - /// 性别 - /// - public string SexName { get; set; } - /// - /// 性别 - /// - public string Sex { get; set; } - /// /// 身份证号码 /// public string IdentityCard { get; set; } @@ -60,18 +52,6 @@ namespace Model /// public string WorkPostName { get; set; } - /// - /// 电话 - /// - public string Telephone { get; set; } - /// - /// 照片路径 - /// - public string PhotoUrl { get; set; } - /// - /// 照片二进制 - /// - public string headImage { get; set; } /// /// 部门名称 /// diff --git a/SGGL/Model/HSSE/ProjectPersonOutput.cs b/SGGL/Model/HSSE/ProjectPersonOutput.cs new file mode 100644 index 00000000..b0fb4ebd --- /dev/null +++ b/SGGL/Model/HSSE/ProjectPersonOutput.cs @@ -0,0 +1,124 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace Model +{ + public class ProjectPersonOutput + { + /// + /// 人员主键ID + /// + public string PersonId { get; set; } + /// + /// 项目人员主键ID + /// + public string SitePersonId { get; set; } + /// + /// 卡号 + /// + public string CardNo { get; set; } + /// + /// 姓名 + /// + public string PersonName { get; set; } + /// + /// 性别 + /// + public string SexName { get; set; } + /// + /// 身份证号码 + /// + public string IdentityCard { get; set; } + + /// + /// 项目id + /// + public string ProjectId { get; set; } + /// + /// 项目名称 + /// + public string ProjectName { get; set; } + /// + /// 单位ID + /// + public string UnitId { get; set; } + /// + /// 单位名称 + /// + public string UnitName { get; set; } + /// + /// 班组名称 + /// + public string TeamGroupName { get; set; } + /// + /// 岗位名称 + /// + public string WorkPostName { get; set; } + /// + /// 入场时间 + /// + public string InTime { get; set; } + /// + /// 出场时间 + /// + public string OutTime { get; set; } + /// + /// 出场原因 + /// + public string OutResult { get; set; } + /// + /// 电话 + /// + public string Telephone { get; set; } + /// + /// 照片路径 + /// + public string PhotoUrl { get; set; } + /// + /// 部门名称 + /// + public string DepartName { get; set; } + + /// + /// 作业区域名称 + /// + public string WorkAreaName { get; set; } + + /// + /// 岗位类型 + /// + public string PostType + { + get; + set; + } + /// + /// 岗位类型名称 + /// + public string PostTypeName + { + get; + set; + } + /// + /// 人员类型 + /// + public string PersonType + { + get; + set; + } + /// + /// 人员类型 + /// + public string PersonTypeName + { + get; + set; + } + + } +} diff --git a/SGGL/Model/Model.csproj b/SGGL/Model/Model.csproj index bddb95ec..a1b83dcc 100644 --- a/SGGL/Model/Model.csproj +++ b/SGGL/Model/Model.csproj @@ -252,7 +252,9 @@ + + diff --git a/SGGL/WebAPI/Controllers/PersonController.cs b/SGGL/WebAPI/Controllers/PersonController.cs index fd8a1989..0313f87e 100644 --- a/SGGL/WebAPI/Controllers/PersonController.cs +++ b/SGGL/WebAPI/Controllers/PersonController.cs @@ -102,25 +102,38 @@ namespace WebAPI.Controllers /// /// 根据条件获取项目人员信息(支持分页和过滤) /// - /// 查询过滤条件 + /// 查询过滤条件(ProjectName为必填参数) /// 每页条数 /// 页码(从1开始) /// 是否返回全部数据 /// - public Model.ResponeData getPersonByFilter([FromUri] Model.ProjectPersonInput filter, int pagesize = 15, int pageindex = 1, bool returnAll = false) + public Model.ResponeData getPersonByFilter([FromUri] Model.ProjectPersonInput filter, int? pagesize = 15, int? pageindex = 1, bool ? returnAll = false) { var responeData = new Model.ResponeData(); try { + // 验证必填参数 ProjectName + if (filter == null || string.IsNullOrEmpty(filter.ProjectName)) + { + responeData.code = 2; + responeData.message = "ProjectName为必填参数!"; + return responeData; + } + + // 处理可空参数的默认值 + int actualPagesize = pagesize ?? 15; + int actualPageindex = pageindex ?? 1; + bool actualReturnAll = returnAll ?? false; + var getDataList = APIPersonService.getPersonByFilter(filter); int pageCount = getDataList.Count; - if (!returnAll && pageCount > 0 && pageindex > 0 && pagesize > 0) + if (!actualReturnAll && pageCount > 0 && actualPageindex > 0 && actualPagesize > 0) { - getDataList = getDataList.Skip(pagesize * (pageindex - 1)).Take(pagesize).ToList(); + getDataList = getDataList.Skip(actualPagesize * (actualPageindex - 1)).Take(actualPagesize).ToList(); } - responeData.data = new { pageCount, pageindex, pagesize, getDataList }; + responeData.data = new { pageCount, pageindex = actualPageindex, pagesize = actualPagesize, getDataList }; } catch (Exception ex) { @@ -999,8 +1012,8 @@ namespace WebAPI.Controllers #region 根据人员ID获取个人出入场记录 /// /// 根据人员ID获取个人出入场记录 - /// - /// + /// + /// /// /// /// 页码 @@ -1027,6 +1040,60 @@ namespace WebAPI.Controllers } #endregion + #region 根据条件获取人员出入场记录(支持分页和过滤) + /// + /// 根据条件获取人员出入场记录(支持分页和过滤) + /// + /// 查询过滤条件(StartTime和EndTime必填) + /// 每页条数 + /// 页码(从1开始) + /// 是否返回全部数据 + /// + public Model.ResponeData getPersonInOutListByFilter([FromUri] Model.PersonInOutRecordInput filter, int? pagesize = 15, int? pageindex = 1, bool? returnAll = false) + { + var responeData = new Model.ResponeData(); + try + { + // 验证必填参数 + if (filter == null || filter.StartTime == default(DateTime) || filter.EndTime == default(DateTime)) + { + responeData.code = 2; + responeData.message = "StartTime和EndTime为必填参数!"; + return responeData; + } + + // 验证时间范围 + if (filter.StartTime > filter.EndTime) + { + responeData.code = 2; + responeData.message = "StartTime不能大于EndTime!"; + return responeData; + } + + // 处理可空参数的默认值 + int actualPagesize = pagesize ?? 15; + int actualPageindex = pageindex ?? 1; + bool actualReturnAll = returnAll ?? false; + + var getDataList = APIPersonService.getPersonInOutListByFilter(filter); + int pageCount = getDataList.Count; + + if (!actualReturnAll && pageCount > 0 && actualPageindex > 0 && actualPagesize > 0) + { + getDataList = getDataList.Skip(actualPagesize * (actualPageindex - 1)).Take(actualPagesize).ToList(); + } + + responeData.data = new { pageCount, pageindex = actualPageindex, pagesize = actualPagesize, getDataList }; + } + catch (Exception ex) + { + responeData.code = 0; + responeData.message = ex.Message; + } + return responeData; + } + #endregion + #region 获取异常人员信息出入场记录 /// /// 获取异常人员信息出入场记录 From 07aa1370e2d4359bd27d78c1a03ae8902e475ed2 Mon Sep 17 00:00:00 2001 From: fei550 <1420031550@qq.com> Date: Wed, 24 Dec 2025 16:48:46 +0800 Subject: [PATCH 3/5] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E6=8E=A5=E5=8F=A3?= =?UTF-8?q?=EF=BC=8C=E5=A2=9E=E5=8A=A0=E5=8F=82=E6=95=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- SGGL/BLL/API/APIPersonService.cs | 5 +++-- SGGL/Model/HSSE/PersonInOutRecordInput.cs | 4 ++++ SGGL/WebAPI/Controllers/PersonController.cs | 15 ++++++++++----- 3 files changed, 17 insertions(+), 7 deletions(-) diff --git a/SGGL/BLL/API/APIPersonService.cs b/SGGL/BLL/API/APIPersonService.cs index 9f46216d..51e9c7c8 100644 --- a/SGGL/BLL/API/APIPersonService.cs +++ b/SGGL/BLL/API/APIPersonService.cs @@ -1111,8 +1111,9 @@ namespace BLL { var query = from x in db.SitePerson_PersonInOut join y in db.SitePerson_Person on x.PersonId equals y.PersonId - where x.ChangeTime >= filter.StartTime && x.ChangeTime <= filter.EndTime - select new Model.PersonInOutItem + join z in db.Base_Project on x.ProjectId equals z.ProjectId + where x.ChangeTime >= filter.StartTime && x.ChangeTime <= filter.EndTime && z.ProjectName.Contains(filter.ProjectName) + select new Model.PersonInOutItem { PersonId = x.PersonId, PersonName = y.PersonName, diff --git a/SGGL/Model/HSSE/PersonInOutRecordInput.cs b/SGGL/Model/HSSE/PersonInOutRecordInput.cs index 659d32ea..12287848 100644 --- a/SGGL/Model/HSSE/PersonInOutRecordInput.cs +++ b/SGGL/Model/HSSE/PersonInOutRecordInput.cs @@ -11,6 +11,10 @@ namespace Model /// public class PersonInOutRecordInput { + /// + /// 项目名称 + /// + public string ProjectName { get; set; } /// /// 单位名称 /// diff --git a/SGGL/WebAPI/Controllers/PersonController.cs b/SGGL/WebAPI/Controllers/PersonController.cs index af0377ad..c534b96a 100644 --- a/SGGL/WebAPI/Controllers/PersonController.cs +++ b/SGGL/WebAPI/Controllers/PersonController.cs @@ -115,7 +115,7 @@ namespace WebAPI.Controllers // 验证必填参数 ProjectName if (filter == null || string.IsNullOrEmpty(filter.ProjectName)) { - responeData.code = 2; + responeData.code = 0; responeData.message = "ProjectName为必填参数!"; return responeData; } @@ -1061,18 +1061,23 @@ namespace WebAPI.Controllers // 验证必填参数 if (filter == null || filter.StartTime == default(DateTime) || filter.EndTime == default(DateTime)) { - responeData.code = 2; + responeData.code = 0; responeData.message = "StartTime和EndTime为必填参数!"; return responeData; - } - + } // 验证时间范围 if (filter.StartTime > filter.EndTime) { - responeData.code = 2; + responeData.code = 0; responeData.message = "StartTime不能大于EndTime!"; return responeData; } + if (filter == null || string.IsNullOrEmpty(filter.ProjectName)) + { + responeData.code = 0; + responeData.message = "ProjectName为必填参数!"; + return responeData; + } // 处理可空参数的默认值 int actualPagesize = pagesize ?? 15; From 3fc9aeab38d0ba6a6e30f007634f46958ebbae69 Mon Sep 17 00:00:00 2001 From: fei550 <1420031550@qq.com> Date: Thu, 25 Dec 2025 20:17:07 +0800 Subject: [PATCH 4/5] =?UTF-8?q?=E9=A1=B9=E7=9B=AE=E7=8E=AF=E5=A2=83?= =?UTF-8?q?=E8=AE=BE=E7=BD=AE=E5=A2=9E=E5=8A=A0=E4=BA=91=E7=9C=B8=E8=AE=BE?= =?UTF-8?q?=E7=BD=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../ProjectData/ProjectDevices.aspx.cs | 30 ++++++++-------- .../ProjectData/ProjectDevicesEdit.aspx.cs | 25 +++++++------ .../ProjectData/ProjectSysSet.aspx | 7 +--- .../ProjectData/ProjectSysSet.aspx.cs | 35 ++++++++++++++++++- 4 files changed, 64 insertions(+), 33 deletions(-) diff --git a/SGGL/FineUIPro.Web/ProjectData/ProjectDevices.aspx.cs b/SGGL/FineUIPro.Web/ProjectData/ProjectDevices.aspx.cs index f85822d3..696c9dd8 100644 --- a/SGGL/FineUIPro.Web/ProjectData/ProjectDevices.aspx.cs +++ b/SGGL/FineUIPro.Web/ProjectData/ProjectDevices.aspx.cs @@ -27,9 +27,8 @@ namespace FineUIPro.Web.ProjectData if (!IsPostBack) { Funs.DropDownPageSize(this.ddlPageSize); - this.ddlPageSize.SelectedValue = Grid1.PageSize.ToString(); - + // 绑定表格 this.BindGrid(); ////权限按钮方法 @@ -60,7 +59,7 @@ namespace FineUIPro.Web.ProjectData tb = GetFilteredTable(Grid1.FilteredData, tb); var table = this.GetPagedDataTable(Grid1, tb); Grid1.DataSource = table; - Grid1.DataBind(); + Grid1.DataBind(); } #region 操作 Events @@ -165,7 +164,7 @@ namespace FineUIPro.Web.ProjectData return; } - var device = Funs.DB.Project_Devices.FirstOrDefault(x=>x.DeviceId== Grid1.SelectedRowID) ; + var device = Funs.DB.Project_Devices.FirstOrDefault(x => x.DeviceId == Grid1.SelectedRowID); if (device != null) { var project = Funs.DB.Base_Project.FirstOrDefault(x => x.ProjectId == CurrUser.LoginProjectId); @@ -201,13 +200,14 @@ namespace FineUIPro.Web.ProjectData var project = Funs.DB.Base_Project.FirstOrDefault(x => x.ProjectId == CurrUser.LoginProjectId); var token = YunMouHelper.getToken(); var res = YunMouHelper.addDevicesToGroups(project.YunMouGroupId, new string[] { device.DeviceSerial }, token);//添加到权限组 - YunMouHelper.setDefence(device.DeviceSerial,"1",token); + YunMouHelper.setDefence(device.DeviceSerial, "1", token); if (string.IsNullOrEmpty(res)) { Alert.ShowInTop("关联权限出错!", MessageBoxIcon.Warning); } - else { + else + { device.YunMouPermission = "是"; Funs.DB.SubmitChanges(); ShowNotify("关联成功", MessageBoxIcon.Success); @@ -215,7 +215,7 @@ namespace FineUIPro.Web.ProjectData } } } - + protected void btnMenuDeletePermission_Click(object sender, EventArgs e) { if (Grid1.SelectedRowIndexArray.Length == 0) @@ -255,8 +255,8 @@ namespace FineUIPro.Web.ProjectData return; } - PageContext.RegisterStartupScript(Window1.GetShowReference(String.Format("ProjectDevicesEdit.aspx?DeviceId={0}", Grid1.SelectedRowID), "编辑项目单位", 800, 300)); - + PageContext.RegisterStartupScript(Window1.GetShowReference(String.Format("ProjectDevicesEdit.aspx?DeviceId={0}", Grid1.SelectedRowID), "编辑项目单位", 800, 300)); + } /// @@ -282,18 +282,18 @@ namespace FineUIPro.Web.ProjectData return; } string menuId = BLL.Const.ProjectDevicesMenuId; - + var buttonList = BLL.CommonService.GetAllButtonList(this.CurrUser.LoginProjectId, this.CurrUser.PersonId, menuId); if (buttonList.Count() > 0) { if (buttonList.Contains(BLL.Const.BtnAdd)) { this.btnAdd.Hidden = false; - + } if (buttonList.Contains(BLL.Const.BtnModify)) { - this.btnMenuDeletePermission.Hidden= false; + this.btnMenuDeletePermission.Hidden = false; this.btnAdd.Hidden = false; this.btnMenuEdit.Hidden = false; this.btnMenuDeviceToYunMou.Hidden = false; @@ -304,7 +304,7 @@ namespace FineUIPro.Web.ProjectData this.btnMenuDelete.Hidden = false; } } - + } #endregion @@ -320,8 +320,8 @@ namespace FineUIPro.Web.ProjectData this.BindGrid(); this.GetButtonPower(); } - #endregion + #endregion + - } } \ No newline at end of file diff --git a/SGGL/FineUIPro.Web/ProjectData/ProjectDevicesEdit.aspx.cs b/SGGL/FineUIPro.Web/ProjectData/ProjectDevicesEdit.aspx.cs index d2471ca8..13d8a6f3 100644 --- a/SGGL/FineUIPro.Web/ProjectData/ProjectDevicesEdit.aspx.cs +++ b/SGGL/FineUIPro.Web/ProjectData/ProjectDevicesEdit.aspx.cs @@ -6,7 +6,10 @@ using System.Web; using System.Web.UI; using System.Web.UI.WebControls; using BLL; -using BLL.Common; +using BLL.Common; +using FastReport.Cloud.OAuth; +using FineUIPro.Web.DataShow; +using Org.BouncyCastle.Crypto; namespace FineUIPro.Web.ProjectData { @@ -39,11 +42,11 @@ namespace FineUIPro.Web.ProjectData { if (!IsPostBack) { - btnClose.OnClientClick = ActiveWindow.GetHideReference(); + btnClose.OnClientClick = ActiveWindow.GetHideReference(); this.DeviceId = Request.Params["DeviceId"]; if (!string.IsNullOrEmpty(this.DeviceId)) { - Model.Project_Devices device = Funs.DB.Project_Devices.FirstOrDefault(x=>x.DeviceId==this.DeviceId); + Model.Project_Devices device = Funs.DB.Project_Devices.FirstOrDefault(x => x.DeviceId == this.DeviceId); if (device != null) { this.txtDeviceName.Text = device.DeviceName; @@ -59,8 +62,8 @@ namespace FineUIPro.Web.ProjectData { this.dpCreateDate.Text = string.Format("{0:yyyy-MM-dd}", device.CreateDate); } - - } + + } } } } @@ -74,15 +77,15 @@ namespace FineUIPro.Web.ProjectData /// protected void btnSave_Click(object sender, EventArgs e) { - - + + Model.Project_Devices device = new Model.Project_Devices { ProjectId = this.CurrUser.LoginProjectId, DeviceName = this.txtDeviceName.Text.Trim(), DeviceSerial = this.txtDeviceSerial.Text.Trim(), Address = txtAddress.Text.Trim(), - ValidateCode=txtValidateCode.Text.Trim(), + ValidateCode = txtValidateCode.Text.Trim(), CreateDate = Funs.GetNewDateTime(this.dpCreateDate.Text.Trim()) }; if (this.drpInOut.SelectedValue != BLL.Const._Null) @@ -120,9 +123,9 @@ namespace FineUIPro.Web.ProjectData } #endregion - - - + + + } } \ No newline at end of file diff --git a/SGGL/FineUIPro.Web/ProjectData/ProjectSysSet.aspx b/SGGL/FineUIPro.Web/ProjectData/ProjectSysSet.aspx index fca5e0d5..4c77b905 100644 --- a/SGGL/FineUIPro.Web/ProjectData/ProjectSysSet.aspx +++ b/SGGL/FineUIPro.Web/ProjectData/ProjectSysSet.aspx @@ -30,12 +30,7 @@ - - - - - - + diff --git a/SGGL/FineUIPro.Web/ProjectData/ProjectSysSet.aspx.cs b/SGGL/FineUIPro.Web/ProjectData/ProjectSysSet.aspx.cs index de5019cc..85a404b2 100644 --- a/SGGL/FineUIPro.Web/ProjectData/ProjectSysSet.aspx.cs +++ b/SGGL/FineUIPro.Web/ProjectData/ProjectSysSet.aspx.cs @@ -51,6 +51,35 @@ namespace FineUIPro.Web.common.ProjectSet ShowNotify("请选择项目!", MessageBoxIcon.Warning); return; } + #region 云眸 + ///通用 + var getProject = ProjectService.GetProjectByProjectId(projectId); + if (getProject != null) + { + getProject.IsYunMou = this.ckbIsYunMou.Checked; + if (this.ckbIsYunMou.Checked) + { + var token = YunMouHelper.getToken(); + string data; + data = Regex.Replace(getProject.ProjectCode, "[^0-9A-Fa-f]", "", RegexOptions.IgnoreCase); + YunMouHelper.addDevicesGroups(getProject.ProjectName, data, token); + var groupId = YunMouHelper.addPermissionGroups(getProject.ProjectName, token); + if (!string.IsNullOrEmpty(groupId)) + { + getProject.YunMouGroupId = groupId; + } + } + else + { + var token = YunMouHelper.getToken(); + string data; + data = Regex.Replace(getProject.ProjectCode, "[^0-9A-Fa-f]", "", RegexOptions.IgnoreCase); + YunMouHelper.deleteDevicesGroups(data, token);//删除设备分组,如果有子节点,可以不删除 + + } + Funs.DB.SubmitChanges(); + } + #endregion #region 焊接 // 焊接 Model.Project_Sys_Set dayReport = BLL.Project_SysSetService.GetSysSetBySetId("1", projectId); @@ -339,7 +368,11 @@ namespace FineUIPro.Web.common.ProjectSet SetCheckFromDict(dict, "10", this.ckPressMustCheckBItem); if (dict.ContainsKey("11")) this.rbMaterialColorAttribute.SelectedValue = dict["11"].SetValue == "1" ? "1" : "2"; } - + var getProject = ProjectService.GetProjectByProjectId(projectId); + if (getProject != null && getProject.IsYunMou == true) + { + this.ckbIsYunMou.Checked = true; + } //颜色模型设置 var m1 = BLL.Project_SysSetService.GetSysSetBySetName("管线未完成", this.CurrUser.LoginProjectId); if (m1 != null) this.txtPipelineNOComplete.Text = m1.SetValue; From 8fe384bb6ab670aaf27048dca9905d991aad7440 Mon Sep 17 00:00:00 2001 From: fei550 <1420031550@qq.com> Date: Fri, 26 Dec 2025 10:51:20 +0800 Subject: [PATCH 5/5] =?UTF-8?q?=E6=89=A9=E5=B1=95=E6=8B=9B=E6=A0=87?= =?UTF-8?q?=E6=96=B9=E5=BC=8F=E9=80=89=E9=A1=B9=E5=B9=B6=E4=BF=AE=E6=AD=A3?= =?UTF-8?q?=E4=B8=8B=E6=8B=89=E7=BB=91=E5=AE=9A=E5=AD=97=E6=AE=B5=E9=A1=BA?= =?UTF-8?q?=E5=BA=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- SGGL/BLL/DropListService.cs | 15 +++++++++------ .../BidDocumentsReviewService.cs | 4 ++-- 2 files changed, 11 insertions(+), 8 deletions(-) diff --git a/SGGL/BLL/DropListService.cs b/SGGL/BLL/DropListService.cs index f616d01e..76dd763a 100644 --- a/SGGL/BLL/DropListService.cs +++ b/SGGL/BLL/DropListService.cs @@ -463,12 +463,15 @@ namespace BLL /// public static ListItem[] GetBidType() { - ListItem[] list = new ListItem[5]; - list[0] = new ListItem("招标", "公开招标"); - list[1] = new ListItem("谈判", "邀请招标"); - list[2] = new ListItem("询比 ", "询比价"); - list[3] = new ListItem("竞价", "竞争性谈判"); - list[4] = new ListItem("直接分包", "单一来源"); + ListItem[] list = new ListItem[8]; + list[0] = new ListItem("公开招标", "公开招标"); + list[1] = new ListItem("邀请招标", "邀请招标"); + list[2] = new ListItem("公开询比 ", "公开询比"); + list[3] = new ListItem("邀请询比 ", "邀请询比"); + list[4] = new ListItem("公开谈判", "公开谈判"); + list[5] = new ListItem("邀请谈判", "邀请谈判"); + list[6] = new ListItem("竞价", "竞价"); + list[7] = new ListItem("直接分包", "直接分包"); return list; } diff --git a/SGGL/BLL/PHTGL/BiddingManagement/BidDocumentsReviewService.cs b/SGGL/BLL/PHTGL/BiddingManagement/BidDocumentsReviewService.cs index 840d9350..28803f2d 100644 --- a/SGGL/BLL/PHTGL/BiddingManagement/BidDocumentsReviewService.cs +++ b/SGGL/BLL/PHTGL/BiddingManagement/BidDocumentsReviewService.cs @@ -127,8 +127,8 @@ namespace BLL /// 是否显示请选择 public static void InitGetBidTypeDropDownList(FineUIPro.DropDownList dropName, bool isShowPlease) { - dropName.DataValueField = "Text"; - dropName.DataTextField = "Value"; + dropName.DataValueField = "Value"; + dropName.DataTextField = "Text"; dropName.DataSource = BLL.DropListService.GetBidType(); dropName.DataBind(); if (isShowPlease)