sunpengfei
2025-08-07 a8b475881959d4a88d821951a615f03e7d0d1725
FlexJobApi.Core/Entities/Users/Enterprise.cs
@@ -1,4 +1,7 @@
using System;
using Furion.DatabaseAccessor;
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Metadata.Builders;
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.Linq;
@@ -10,7 +13,7 @@
    /// <summary>
    /// 企业
    /// </summary>
    public class Enterprise : CommonEntity
    public class Enterprise : CommonEntity, IEntityTypeBuilder<Enterprise>
    {
        public Enterprise()
        {
@@ -19,39 +22,49 @@
        }
        /// <summary>
        /// 企业认证方式
        /// 企业认证Id
        /// </summary>
        public EnumEnterpriseRealMethod? EnterpriseRealMethod { get; set; }
        public Guid EnterpriseAuthId { get; set; }
        /// <summary>
        /// 企业全称
        /// 企业认证
        /// </summary>
        [Required]
        [MaxLength(128)]
        public string EnterpriseName { get; set; }
        public EnterpriseAuth EnterpriseAuth { get; set; }
        /// <summary>
        /// 统一社会信用代码
        /// 所在省份编号
        /// </summary>
        [Required]
        [MaxLength(18)]
        public string SocietyCreditCode { get; set; }
        public string ProvinceCode { get; set; }
        /// <summary>
        /// 营业执照照片Id
        /// 所在省份
        /// </summary>
        public Guid? LicenseImageId { get; set; }
        public DictionaryData Province { get; set; }
        /// <summary>
        /// 营业执照照片
        /// 所在城市编号
        /// </summary>
        public FileVirtualPath LicenseImage { get; set; }
        public string CityCode { get; set; }
        /// <summary>
        /// 法人姓名
        /// 所在城市
        /// </summary>
        [MaxLength(32)]
        public string LegalPerson { get; set; }
        public DictionaryData City { get; set; }
        /// <summary>
        /// 所属行业编号
        /// </summary>
        public string IndustryTypeCode { get; set; }
        /// <summary>
        /// 所属行业
        /// </summary>
        public DictionaryData IndustryType { get; set; }
        /// <summary>
        /// 主营业务
        /// </summary>
        public string MainBusiness { get; set; }
        /// <summary>
        /// 联系人
@@ -63,71 +76,38 @@
        /// 联系电话
        /// </summary>
        [MaxLength(11)]
        public string ContactNumber { get; set; }
        public string ContactPhoneNumber { get; set; }
        /// <summary>
        /// 法人或经办人实名方式
        /// 联系邮箱
        /// </summary>
        public EnumPersonalRealMethod? PersonalRealMethod { get; set; }
        public string ContactEmail { get; set; }
        /// <summary>
        /// 法人或经办人姓名
        /// 支付通道
        /// </summary>
        [MaxLength(32)]
        public string Name { get; set; }
        public EnumPayAccess? PayAccess { get; set; }
        /// <summary>
        /// 法人或经办人身份证号
        /// 开户总行
        /// </summary>
        [MaxLength(18)]
        public string Identity { get; set; }
        public string BankName { get; set; }
        /// <summary>
        /// 法人或经办人身份证人像面Id
        /// 开户支行
        /// </summary>
        public Guid? IdentityImgId { get; set; }
        public string BankBranchName { get; set; }
        /// <summary>
        /// 法人或经办人身份证人像面
        /// </summary>
        public FileVirtualPath IdentityImg { get; set; }
        /// <summary>
        /// 法人或经办人身份证国徽面Id
        /// </summary>
        public Guid? IdentityBackImgId { get; set; }
        /// <summary>
        /// 法人或经办人身份证国徽面
        /// </summary>
        public FileVirtualPath IdentityBackImg { get; set; }
        /// <summary>
        /// 法人或经办人银行卡号
        /// 银行账户
        /// </summary>
        [MaxLength(32)]
        public string BankCard { get; set; }
        /// <summary>
        /// 法人或经办人银行卡照片Id
        /// 是否已校验银行账户
        /// </summary>
        public Guid? BankCardImgId { get; set; }
        /// <summary>
        /// 法人或经办人手机号
        /// </summary>
        [MaxLength(11)]
        public string PhoneNumber { get; set; }
        /// <summary>
        /// 是否委托经办人
        /// </summary>
        public bool? Proxy { get; set; }
        /// <summary>
        /// 企业授权书
        /// </summary>
        public string ProxyPowerAttorneyUrl { get; set; }
        public bool IsCheckedBankCard { get; set; }
        /// <summary>
        /// 实名通道
@@ -135,9 +115,29 @@
        public EnumRealAccess? RealAccess { get; set; }
        /// <summary>
        /// 是否实名
        /// 实名费用
        /// </summary>
        public bool IsReal { get; set; }
        public decimal? RealVerifyCost { get; set; }
        /// <summary>
        /// 签约费用
        /// </summary>
        public decimal? SignCost { get; set; }
        /// <summary>
        /// 一口价
        /// </summary>
        public decimal? MergeSignCost { get; set; }
        /// <summary>
        /// 短信通道
        /// </summary>
        public EnumSmsAccess? SmsAccess { get; set; }
        /// <summary>
        /// 短信费用
        /// </summary>
        public decimal SmsCost { get; set; }
        /// <summary>
        /// 部门
@@ -148,5 +148,27 @@
        /// 用户信息
        /// </summary>
        public List<UserInfo> UserInfos { get; set; }
        public void Configure(EntityTypeBuilder<Enterprise> entityBuilder, DbContext dbContext, Type dbContextLocator)
        {
            entityBuilder
                .HasOne(it => it.Province)
                .WithMany()
                .HasForeignKey(it => it.ProvinceCode)
                .HasPrincipalKey(it => it.Code)
                .OnDelete(DeleteBehavior.Restrict);
            entityBuilder
                .HasOne(it => it.City)
                .WithMany()
                .HasForeignKey(it => it.CityCode)
                .HasPrincipalKey(it => it.Code)
                .OnDelete(DeleteBehavior.Restrict);
            entityBuilder
                .HasOne(it => it.IndustryType)
                .WithMany()
                .HasForeignKey(it => it.IndustryTypeCode)
                .HasPrincipalKey(it => it.Code)
                .OnDelete(DeleteBehavior.Restrict);
        }
    }
}