修改相关bug
This commit is contained in:
@@ -30,19 +30,64 @@ public class OnboardingCompanyAddInput : ObCompany
|
||||
/// 公司业务编码。
|
||||
/// </summary>
|
||||
[global::System.ComponentModel.DataAnnotations.Required(ErrorMessage = "公司编码不能为空")]
|
||||
[global::System.ComponentModel.DataAnnotations.MaxLength(50, ErrorMessage = "公司编码不能超过50个字符")]
|
||||
public override string CompanyCode { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 公司名称。
|
||||
/// </summary>
|
||||
[global::System.ComponentModel.DataAnnotations.Required(ErrorMessage = "公司名称不能为空")]
|
||||
[global::System.ComponentModel.DataAnnotations.MaxLength(50, ErrorMessage = "公司名称不能超过50个字符")]
|
||||
public override string CompanyName { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 合同甲方完整法定名称。
|
||||
/// </summary>
|
||||
[global::System.ComponentModel.DataAnnotations.Required(ErrorMessage = "合同甲方全称不能为空")]
|
||||
[global::System.ComponentModel.DataAnnotations.MaxLength(100, ErrorMessage = "合同甲方全称不能超过100个字符")]
|
||||
public override string LegalName { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 统一社会信用代码。
|
||||
/// </summary>
|
||||
[global::System.ComponentModel.DataAnnotations.MaxLength(18, ErrorMessage = "统一社会信用代码不能超过18位")]
|
||||
public override string UnifiedSocialCreditCode { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 法定代表人姓名。
|
||||
/// </summary>
|
||||
[global::System.ComponentModel.DataAnnotations.MaxLength(20, ErrorMessage = "法定代表人不能超过20个字符")]
|
||||
public override string LegalRepresentative { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 工商注册地址。
|
||||
/// </summary>
|
||||
[global::System.ComponentModel.DataAnnotations.MaxLength(150, ErrorMessage = "注册地址不能超过150个字符")]
|
||||
public override string RegisteredAddress { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 公司联系电话。
|
||||
/// </summary>
|
||||
[global::System.ComponentModel.DataAnnotations.MaxLength(20, ErrorMessage = "联系电话不能超过20个字符")]
|
||||
public override string ContactPhone { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 契约锁默认业务分类 Id;每个签约公司独立配置。
|
||||
/// </summary>
|
||||
[global::System.ComponentModel.DataAnnotations.MaxLength(19, ErrorMessage = "契约锁业务分类Id不能超过19位数字")]
|
||||
public override string QiyuesuoCategoryId { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 契约锁企业印章 Id;每个签约公司独立配置。
|
||||
/// </summary>
|
||||
[global::System.ComponentModel.DataAnnotations.MaxLength(19, ErrorMessage = "契约锁印章Id不能超过19位数字")]
|
||||
public override string QiyuesuoSealId { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 业务备注。
|
||||
/// </summary>
|
||||
[global::System.ComponentModel.DataAnnotations.MaxLength(300, ErrorMessage = "备注不能超过300个字符")]
|
||||
public override string Remark { get; set; }
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
||||
@@ -138,10 +138,16 @@ public class OnboardingCompanyService : DbRepository<ObCompany>, IOnboardingComp
|
||||
throw Oops.Bah("契约锁默认业务分类 Id 和企业印章 Id 必须同时填写");
|
||||
if (!hasCategoryId)
|
||||
return;
|
||||
if (!company.QiyuesuoCategoryId.All(char.IsDigit)
|
||||
|| !company.QiyuesuoSealId.All(char.IsDigit))
|
||||
{
|
||||
throw Oops.Bah("契约锁默认业务分类 Id 和企业印章 Id 只能填写纯数字");
|
||||
}
|
||||
|
||||
if (!long.TryParse(company.QiyuesuoCategoryId, out _)
|
||||
|| !long.TryParse(company.QiyuesuoSealId, out _))
|
||||
{
|
||||
throw Oops.Bah("契约锁默认业务分类 Id 和企业印章 Id 只能填写数字");
|
||||
throw Oops.Bah("契约锁默认业务分类 Id 和企业印章 Id 超出有效数字范围(最大支持19位长整数)");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user