From cd07269680aeaed9bd70cec6c4b5a5b4c141b649 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E4=BD=95=E7=BE=8E=E8=8D=A3?= <10755671+mei-rong-he@user.noreply.gitee.com> Date: Thu, 19 Sep 2024 09:36:52 +0800 Subject: [PATCH] =?UTF-8?q?=E7=94=A8=E6=88=B7=E5=88=97=E8=A1=A8=E6=B7=BB?= =?UTF-8?q?=E5=8A=A0=E5=AD=97=E6=AE=B5=E6=98=AF=E5=90=A6=E4=B8=8A=E4=BC=A0?= =?UTF-8?q?=E7=AD=BE=E5=90=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- APT.BaseData.Data/Mapping/FM/FMUserMap.cs | 85 ++-- APT.BaseData.Domain/Entities/FM/T_FM_USER.cs | 372 +++++++++--------- .../Controllers/Api/UserController.cs | 19 +- 3 files changed, 248 insertions(+), 228 deletions(-) diff --git a/APT.BaseData.Data/Mapping/FM/FMUserMap.cs b/APT.BaseData.Data/Mapping/FM/FMUserMap.cs index 0ece2cc..7174937 100644 --- a/APT.BaseData.Data/Mapping/FM/FMUserMap.cs +++ b/APT.BaseData.Data/Mapping/FM/FMUserMap.cs @@ -1,42 +1,43 @@ -using APT.Infrastructure.EF.Map; -using APT.BaseData.Domain.Entities.FM; -using Microsoft.EntityFrameworkCore.Metadata.Builders; -using Microsoft.EntityFrameworkCore; - -namespace APT.BaseData.Data.Mapping.FM -{ - public class FMUserMap : APTEntityBaseMap - { - public override void Configure(EntityTypeBuilder builder) - { - base.Configure(builder); - builder.Property(t => t.NAME) - .HasMaxLength(50); - - builder.Property(t => t.NAME_ACRONYM).HasMaxLength(100); - builder.Property(t => t.CODE).IsRequired() - .HasMaxLength(50); - - - builder.Property(t => t.PHONE) - .HasMaxLength(50); - - builder.Property(t => t.PASSWORD) - .HasMaxLength(128); - - - builder.Property(t => t.REMARK).HasMaxLength(300); - - builder.HasOne(t => t.Nav_Department).WithMany(t => t.Nav_UserList).HasForeignKey(t => t.DEPARTMENT_ID).OnDelete(DeleteBehavior.Restrict); - - builder.HasOne(t => t.Nav_Person).WithOne(t => t.Nav_User).HasForeignKey(t => t.PERSON_ID).OnDelete(DeleteBehavior.Restrict); - builder.Ignore(t => t.TEAMNAME); - builder.Ignore(t => t.Team); - builder.Property(t => t.ID_CARD) - .HasMaxLength(50); - builder.HasOne(t => t.Nav_ApproveRole).WithMany().HasForeignKey(t => t.APPROVE_ROLE_ID).OnDelete(DeleteBehavior.Restrict); - builder.Ignore(t => t.TEAM_ID); - builder.Ignore(t => t.Tenant); - } - } -} +using APT.Infrastructure.EF.Map; +using APT.BaseData.Domain.Entities.FM; +using Microsoft.EntityFrameworkCore.Metadata.Builders; +using Microsoft.EntityFrameworkCore; + +namespace APT.BaseData.Data.Mapping.FM +{ + public class FMUserMap : APTEntityBaseMap + { + public override void Configure(EntityTypeBuilder builder) + { + base.Configure(builder); + builder.Property(t => t.NAME) + .HasMaxLength(50); + + builder.Property(t => t.NAME_ACRONYM).HasMaxLength(100); + builder.Property(t => t.CODE).IsRequired() + .HasMaxLength(50); + + + builder.Property(t => t.PHONE) + .HasMaxLength(50); + + builder.Property(t => t.PASSWORD) + .HasMaxLength(128); + + + builder.Property(t => t.REMARK).HasMaxLength(300); + + builder.HasOne(t => t.Nav_Department).WithMany(t => t.Nav_UserList).HasForeignKey(t => t.DEPARTMENT_ID).OnDelete(DeleteBehavior.Restrict); + + builder.HasOne(t => t.Nav_Person).WithOne(t => t.Nav_User).HasForeignKey(t => t.PERSON_ID).OnDelete(DeleteBehavior.Restrict); + builder.Ignore(t => t.TEAMNAME); + builder.Ignore(t => t.Team); + builder.Property(t => t.ID_CARD) + .HasMaxLength(50); + builder.HasOne(t => t.Nav_ApproveRole).WithMany().HasForeignKey(t => t.APPROVE_ROLE_ID).OnDelete(DeleteBehavior.Restrict); + builder.Ignore(t => t.TEAM_ID); + builder.Ignore(t => t.Tenant); + builder.Ignore(t => t.IS_SIGN); + } + } +} diff --git a/APT.BaseData.Domain/Entities/FM/T_FM_USER.cs b/APT.BaseData.Domain/Entities/FM/T_FM_USER.cs index ff8ef62..1a14693 100644 --- a/APT.BaseData.Domain/Entities/FM/T_FM_USER.cs +++ b/APT.BaseData.Domain/Entities/FM/T_FM_USER.cs @@ -1,185 +1,187 @@ -using APT.BaseData.Domain.Enums; -using APT.Infrastructure.Core; -using APT.Infrastructure.Utility; -using APT.MS.Domain.Entities.PF; -using System; -using System.Collections.Generic; -using System.ComponentModel; - -namespace APT.BaseData.Domain.Entities.FM -{ - [Description("用户表")] - /// - /// 用户 - /// - [Redis("ID","ID","CODE")] - [DataClassIndex(new string[] { "CODE", "ORG_ID" }, true)] - [IgnoreT4] public partial class T_FM_USER : MesEntityBase - { - [Description("姓名")] - /// - /// 姓名 - /// - [AcronymField("NAME_ACRONYM")] - public string NAME { get; set; } - - /// - /// 名称首字母缩写 - /// - [Description("名称首字母缩写")] - public string NAME_ACRONYM { get; set; } - [Description("编码")] - /// - /// 编码,即为登入账号 - /// - - public string CODE { get; set; } - [Description("密码")] - /// - /// 密码 - /// - public string PASSWORD { get; set; } - [Description("手机")] - - /// 手机号 - public string PHONE { get; set; } - - [Description("部门ID")] - /// - /// 部门ID - /// - public Guid? DEPARTMENT_ID { get; set; } - - - /// - /// FMEnableStatusEnum(0启用1停用) - /// - [Description("启用标志")] - [EnumName("FMEnableStatusEnum")] - public int ENABLE_STATUS { get; set; } - - - [Description("备注")] - public string REMARK { get; set; } - - /// - /// 用于记录用户设置的打印机 - /// - [Description("打印机ID")] - public Guid? PRINTER_ID { get; set; } - - - [Description("人员ID")] - public Guid? PERSON_ID { get; set; } - - [Description("租户")] - public string Tenant { get; set; } - - [Description("导航:人员")] - /// - /// 部门 - /// - /// - public virtual T_FM_PERSON Nav_Person { get; set; } - - - - [Description("导航:部门")] - /// - /// 部门 - /// - /// - public virtual T_FM_DEPARTMENT Nav_Department { get; set; } - [Description("导航:角色列表")] - public virtual ICollection Nav_BelongRoles { get; set; } - [Description("导航:角色组列表")] - public virtual ICollection Nav_BelongRoleGroups { get; set; } - [Description("导航:用户组列表")] - public virtual ICollection Nav_BelongUserGroups { get; set; } - - /// - /// 头像文件 - /// - [Description("导航:头像文件")] - public virtual List Nav_UserPhotoFiles { get; set; } - - /// - /// 头像文件 - /// - [Description("导航:签名照片")] - public virtual List Nav_UserSignFiles { get; set; } - - /// - /// 头像文件 - /// - [Description("班组ID")] - [DataFieldIngore] - public T_FM_TEAM Team { get; set; } - - /// - /// 性别 - /// - [Description("性别")] - [FormFieldTable] - [FormFieldEdit] - [FormFieldQuery] - [EnumName("FMSexEnum")] - public int SEX { get; set; } - /// - /// 班组 - /// - [Description("班组")] - [FormFieldTable] - [FormFieldQuery] - [DataFieldIngore] - public string TEAMNAME { get; set; } - /// - /// 班组ID - /// - [Description("班组ID")] - [FormFieldTable] - [FormFieldQuery] - [DataFieldIngore] - public Guid? TEAM_ID { get; set; } - /// - /// 班组 - /// - [Description("身份证号")] - [FormFieldTable] - [FormFieldQuery] - [DataFieldLength(50)] - public string ID_CARD { get; set; } - /// - /// 班组 - /// - [Description("入职时间")] - [FormFieldTable] - [FormFieldQuery] - public DateTime ENTRYTIME { get; set; } - /// - /// 班组 - /// - [Description("离职时间")] - [FormFieldTable] - [FormFieldQuery] - public DateTime? DEPARTURETIME { get; set; } - /// - /// 班组 - /// - [Description("工龄")] - [FormFieldTable] - [FormFieldQuery] - public int WORKINGYEAR { get; set; } - [Description("人员ID")] - [DataFieldForeignKey("Nav_ApproveRole")] - - public Guid? APPROVE_ROLE_ID { get; set; } - - [Description("导航属性:审批角色")] - public virtual T_PF_APPROVAL_ROLE Nav_ApproveRole { get; set; } - - [Description("生产单元")] - public virtual ICollection Nav_ProdutionUnit { get; set; } - - } -} +using APT.BaseData.Domain.Enums; +using APT.Infrastructure.Core; +using APT.Infrastructure.Utility; +using APT.MS.Domain.Entities.PF; +using System; +using System.Collections.Generic; +using System.ComponentModel; + +namespace APT.BaseData.Domain.Entities.FM +{ + [Description("用户表")] + /// + /// 用户 + /// + [Redis("ID","ID","CODE")] + [DataClassIndex(new string[] { "CODE", "ORG_ID" }, true)] + [IgnoreT4] public partial class T_FM_USER : MesEntityBase + { + [Description("姓名")] + /// + /// 姓名 + /// + [AcronymField("NAME_ACRONYM")] + public string NAME { get; set; } + + /// + /// 名称首字母缩写 + /// + [Description("名称首字母缩写")] + public string NAME_ACRONYM { get; set; } + [Description("编码")] + /// + /// 编码,即为登入账号 + /// + + public string CODE { get; set; } + [Description("密码")] + /// + /// 密码 + /// + public string PASSWORD { get; set; } + [Description("手机")] + + /// 手机号 + public string PHONE { get; set; } + + [Description("部门ID")] + /// + /// 部门ID + /// + public Guid? DEPARTMENT_ID { get; set; } + + + /// + /// FMEnableStatusEnum(0启用1停用) + /// + [Description("启用标志")] + [EnumName("FMEnableStatusEnum")] + public int ENABLE_STATUS { get; set; } + + + [Description("备注")] + public string REMARK { get; set; } + + /// + /// 用于记录用户设置的打印机 + /// + [Description("打印机ID")] + public Guid? PRINTER_ID { get; set; } + + + [Description("人员ID")] + public Guid? PERSON_ID { get; set; } + + [Description("租户")] + public string Tenant { get; set; } + + [Description("导航:人员")] + /// + /// 部门 + /// + /// + public virtual T_FM_PERSON Nav_Person { get; set; } + + + + [Description("导航:部门")] + /// + /// 部门 + /// + /// + public virtual T_FM_DEPARTMENT Nav_Department { get; set; } + [Description("导航:角色列表")] + public virtual ICollection Nav_BelongRoles { get; set; } + [Description("导航:角色组列表")] + public virtual ICollection Nav_BelongRoleGroups { get; set; } + [Description("导航:用户组列表")] + public virtual ICollection Nav_BelongUserGroups { get; set; } + + /// + /// 头像文件 + /// + [Description("导航:头像文件")] + public virtual List Nav_UserPhotoFiles { get; set; } + + /// + /// 头像文件 + /// + [Description("导航:签名照片")] + public virtual List Nav_UserSignFiles { get; set; } + + /// + /// 头像文件 + /// + [Description("班组ID")] + [DataFieldIngore] + public T_FM_TEAM Team { get; set; } + + /// + /// 性别 + /// + [Description("性别")] + [FormFieldTable] + [FormFieldEdit] + [FormFieldQuery] + [EnumName("FMSexEnum")] + public int SEX { get; set; } + /// + /// 班组 + /// + [Description("班组")] + [FormFieldTable] + [FormFieldQuery] + [DataFieldIngore] + public string TEAMNAME { get; set; } + /// + /// 班组ID + /// + [Description("班组ID")] + [FormFieldTable] + [FormFieldQuery] + [DataFieldIngore] + public Guid? TEAM_ID { get; set; } + /// + /// 班组 + /// + [Description("身份证号")] + [FormFieldTable] + [FormFieldQuery] + [DataFieldLength(50)] + public string ID_CARD { get; set; } + /// + /// 班组 + /// + [Description("入职时间")] + [FormFieldTable] + [FormFieldQuery] + public DateTime ENTRYTIME { get; set; } + /// + /// 班组 + /// + [Description("离职时间")] + [FormFieldTable] + [FormFieldQuery] + public DateTime? DEPARTURETIME { get; set; } + /// + /// 班组 + /// + [Description("工龄")] + [FormFieldTable] + [FormFieldQuery] + public int WORKINGYEAR { get; set; } + [Description("人员ID")] + [DataFieldForeignKey("Nav_ApproveRole")] + + public Guid? APPROVE_ROLE_ID { get; set; } + + [Description("导航属性:审批角色")] + public virtual T_PF_APPROVAL_ROLE Nav_ApproveRole { get; set; } + + [Description("生产单元")] + public virtual ICollection Nav_ProdutionUnit { get; set; } + [Description("是否上传签名")] + [DataFieldIngore] + public string IS_SIGN { get; set; } + } +} diff --git a/APT.MicroApi/APT.FM.WebApi/Controllers/Api/UserController.cs b/APT.MicroApi/APT.FM.WebApi/Controllers/Api/UserController.cs index 3b1fad9..76732a2 100644 --- a/APT.MicroApi/APT.FM.WebApi/Controllers/Api/UserController.cs +++ b/APT.MicroApi/APT.FM.WebApi/Controllers/Api/UserController.cs @@ -136,7 +136,24 @@ namespace APT.FM.WebApi.Controllers.Api.FM { express = express.And(t => t.Nav_BelongRoles.Any(i => i.Nav_BelongRole.NAME.Contains(pageFilter.Parameter1))); } - var result = this.WitOrderPaged(express, pageFilter); + var result = this.WitOrderPaged(express, pageFilter); + if (result.Data.Count() > 0) + { + var userIds = result.Data.Select(t => t.ID).ToList(); + var signs = this.GetEntities(t => userIds.Contains(t.USER_ID), new BaseFilter(pageFilter.OrgId)); + result.Data.ForEach(t => + { + var temp = signs.FirstOrDefault(m => m.USER_ID == t.ID); + if (temp != null) + { + t.IS_SIGN = "是"; + } + else + { + t.IS_SIGN = "否"; + } + }); + } return result; //if (string.IsNullOrEmpty(pageFilter.Parameter1)) //{