修改联系人姓名

usertest
嵇文龙 4 months ago
parent d5113c3171
commit f2be20e91b

@ -1,6 +1,7 @@
using System.Runtime.Serialization;
using DS.Module.Core;
using DS.Module.Core.Extensions;
using FluentValidation;
using SqlSugar;
namespace DS.WMS.Core.Info.Dtos;
@ -20,20 +21,25 @@ public class ClientContactReq
public long ClientId { get; set; }
/// <summary>
/// Desc:联系人代码
/// Desc:联系人姓名
/// </summary>
public string CodeName { get; set; }
public string Name { get; set; }
/// <summary>
/// Desc:联系人简称
/// Desc:联系人英文名
/// </summary>
public string ShortName { get; set; }
public string? EnName { get; set; }
/// <summary>
/// Desc:职务
/// </summary>
public string Job { get; set; }
[IgnoreDataMember]
public string? Job => Jobs == null ? null : string.Join(",", Jobs);
/// <summary>
/// 职务
/// </summary>
public string[]? Jobs { get; set; }
/// <summary>
/// Desc:通讯地址
@ -68,72 +74,72 @@ public class ClientContactReq
/// <summary>
/// Desc:是否为操作
/// </summary>
public bool? IsOperator { get; set; } = false;
public bool IsOperator { get; set; }
/// <summary>
/// Desc:是否为财务
/// </summary>
public bool? IsFinancialStaff { get; set; } = false;
public bool IsFinancialStaff { get; set; }
/// <summary>
/// Desc:是否为销售
/// </summary>
public bool? IsSaleMan { get; set; } = false;
public bool IsSaleMan { get; set; }
/// <summary>
/// Desc:是否为其他
/// </summary>
public bool? IsOther { get; set; } = false;
public bool IsOther { get; set; }
/// <summary>
/// Desc:是否保险联系人
/// </summary>
public bool? IsInsurance { get; set; } = false;
public bool IsInsurance { get; set; }
/// <summary>
/// Desc:是否对账联系人
/// </summary>
public bool? IsCheckAccount { get; set; } = false;
public bool IsCheckAccount { get; set; }
/// <summary>
/// 提醒日期1
/// </summary>
public DateTime Anniversary1 { get; set; }
public DateTime? Anniversary1 { get; set; }
/// <summary>
/// 提醒日期2
/// </summary>
public DateTime Anniversary2 { get; set; }
public DateTime? Anniversary2 { get; set; }
/// <summary>
/// 提醒备注1
/// </summary>
public string AnniversaryNote1 { get; set; }
public string? AnniversaryNote1 { get; set; }
/// <summary>
/// 提醒备注2
/// </summary>
public string AnniversaryNote2 { get; set; }
public string? AnniversaryNote2 { get; set; }
///// <summary>
///// 船公司Id
///// </summary>
//public long? CarrierId { get; set; }
///// <summary>
///// 船公司
///// </summary>
//public string? Carrier { get; set; }
/// <summary>
/// 船公司Id
/// </summary>
public long CarrierId { get; set; } = 0;
/// <summary>
/// 船公司
/// </summary>
public string Carrier { get; set; }
/// <summary>
/// 状态 0 启用 1 禁用
/// </summary>
public StatusEnum? Status { get; set; } = StatusEnum.Enable;
public StatusEnum Status { get; set; } = StatusEnum.Enable;
/// <summary>
/// 备注
/// </summary>
public string Note { get; set; } = "";
public string? Note { get; set; }
}
/// <summary>
@ -146,9 +152,7 @@ public class ClientContactReqValidator : AbstractValidator<ClientContactReq>
/// </summary>
public ClientContactReqValidator()
{
this.RuleFor(o => o.CodeName)
.NotEmpty().WithName("联系人代码");
this.RuleFor(o => o.ShortName)
.NotEmpty().WithName("联系人简称");
this.RuleFor(o => o.Name)
.NotEmpty().WithName("联系人姓名");
}
}

@ -1,4 +1,6 @@
using System.Runtime.Serialization;
using DS.Module.Core;
using DS.Module.Core.Extensions;
namespace DS.WMS.Core.Info.Dtos;
@ -18,20 +20,25 @@ public class ClientContactRes
public long ClientId { get; set; }
/// <summary>
/// Desc:联系人代码
/// Desc:联系人姓名
/// </summary>
public string CodeName { get; set; }
public string Name { get; set; }
/// <summary>
/// Desc:联系人简称
/// Desc:联系人英文名
/// </summary>
public string ShortName { get; set; }
public string? EnName { get; set; }
/// <summary>
/// Desc:职务
/// </summary>
public string Job { get; set; }
[IgnoreDataMember]
public string? Job { get; set; }
/// <summary>
/// 职务
/// </summary>
public string[]? Jobs => Job.IsNullOrEmpty() ? [] : Job.Split([','], StringSplitOptions.RemoveEmptyEntries);
/// <summary>
/// Desc:通讯地址
@ -66,71 +73,73 @@ public class ClientContactRes
/// <summary>
/// Desc:是否为操作
/// </summary>
public bool? IsOperator { get; set; } = false;
public bool IsOperator { get; set; }
/// <summary>
/// Desc:是否为财务
/// </summary>
public bool? IsFinancialStaff { get; set; } = false;
public bool IsFinancialStaff { get; set; }
/// <summary>
/// Desc:是否为销售
/// </summary>
public bool? IsSaleMan { get; set; } = false;
public bool IsSaleMan { get; set; }
/// <summary>
/// Desc:是否为其他
/// </summary>
public bool? IsOther { get; set; } = false;
public bool IsOther { get; set; }
/// <summary>
/// Desc:是否保险联系人
/// </summary>
public bool? IsInsurance { get; set; } = false;
public bool IsInsurance { get; set; }
/// <summary>
/// Desc:是否对账联系人
/// </summary>
public bool? IsCheckAccount { get; set; } = false;
public bool IsCheckAccount { get; set; }
/// <summary>
/// 提醒日期1
/// </summary>
public DateTime Anniversary1 { get; set; }
public DateTime? Anniversary1 { get; set; }
/// <summary>
/// 提醒日期2
/// </summary>
public DateTime Anniversary2 { get; set; }
public DateTime? Anniversary2 { get; set; }
/// <summary>
/// 提醒备注1
/// </summary>
public string AnniversaryNote1 { get; set; }
public string? AnniversaryNote1 { get; set; }
/// <summary>
/// 提醒备注2
/// </summary>
public string AnniversaryNote2 { get; set; }
/// <summary>
/// 船公司Id
/// </summary>
public long CarrierId { get; set; }
/// <summary>
/// 船公司
/// </summary>
public string Carrier { get; set; }
public string? AnniversaryNote2 { get; set; }
///// <summary>
///// 船公司Id
///// </summary>
//public long? CarrierId { get; set; }
///// <summary>
///// 船公司
///// </summary>
//public string? Carrier { get; set; }
/// <summary>
/// 状态 0 启用 1 禁用
/// </summary>
public StatusEnum? Status { get; set; } = StatusEnum.Enable;
public StatusEnum Status { get; set; } = StatusEnum.Enable;
/// <summary>
/// 备注
/// </summary>
public string Note { get; set; } = "";
public string? Note { get; set; }
/// <summary>
/// 创建时间
/// </summary>

@ -16,137 +16,136 @@ public class InfoClientContact : BaseModelV2<long>
public long ClientId { get; set; }
/// <summary>
/// Desc:联系人代码
/// 姓名
/// </summary>
[SugarColumn(ColumnDescription = "联系人代码", Length = 6)]
public string CodeName { get; set; }
[SugarColumn(ColumnDescription = "姓名", Length = 20)]
public string Name { get; set; }
/// <summary>
/// Desc:联系人简称
/// 英文名
/// </summary>
[SugarColumn(ColumnDescription = "联系人简称", Length = 20)]
public string ShortName { get; set; }
[SugarColumn(ColumnDescription = "英文名", Length = 50, IsNullable = true)]
public string? EnName { get; set; }
/// <summary>
/// Desc:职务
/// </summary>
[SugarColumn(ColumnDescription = "职务", Length = 50, IsNullable = true)]
public string Job { get; set; }
[SugarColumn(ColumnDescription = "职务", Length = 500, IsNullable = true)]
public string? Job { get; set; }
/// <summary>
/// Desc:通讯地址
/// </summary>
[SugarColumn(ColumnDescription = "通讯地址", Length = 100, IsNullable = true)]
public string Address { get; set; }
public string? Address { get; set; }
/// <summary>
/// Desc:邮箱
/// </summary>
[SugarColumn(ColumnDescription = "邮箱", Length = 50, IsNullable = true)]
public string Email { get; set; }
public string? Email { get; set; }
/// <summary>
/// Desc:手机
/// </summary>
[SugarColumn(ColumnDescription = "手机", Length = 50, IsNullable = true)]
public string Mobile { get; set; }
public string? Mobile { get; set; }
/// <summary>
/// Desc:电话
/// </summary>
[SugarColumn(ColumnDescription = "电话", Length = 50, IsNullable = true)]
public string Tel { get; set; }
public string? Tel { get; set; }
/// <summary>
/// Desc:传真
/// </summary>
[SugarColumn(ColumnDescription = "传真", Length = 50, IsNullable = true)]
public string Fax { get; set; }
public string? Fax { get; set; }
/// <summary>
/// Desc:QQ
/// </summary>
[SugarColumn(ColumnDescription = "QQ", Length = 50, IsNullable = true)]
public string QQ { get; set; }
public string? QQ { get; set; }
/// <summary>
/// Desc:是否为操作
/// </summary>
[SugarColumn(ColumnDescription = "是否为操作",DefaultValue = "0")]
public bool? IsOperator { get; set; } = false;
[SugarColumn(ColumnDescription = "是否为操作", DefaultValue = "0")]
public bool IsOperator { get; set; }
/// <summary>
/// Desc:是否为财务
/// </summary>
[SugarColumn(ColumnDescription = "是否为财务",DefaultValue = "0")]
public bool? IsFinancialStaff { get; set; } = false;
[SugarColumn(ColumnDescription = "是否为财务", DefaultValue = "0")]
public bool IsFinancialStaff { get; set; }
/// <summary>
/// Desc:是否为销售
/// </summary>
[SugarColumn(ColumnDescription = "是否为销售",DefaultValue = "0")]
public bool? IsSaleMan { get; set; } = false;
[SugarColumn(ColumnDescription = "是否为销售", DefaultValue = "0")]
public bool IsSaleMan { get; set; }
/// <summary>
/// Desc:是否为其他
/// </summary>
[SugarColumn(ColumnDescription = "是否为其他",DefaultValue = "0")]
public bool? IsOther { get; set; } = false;
[SugarColumn(ColumnDescription = "是否为其他", DefaultValue = "0")]
public bool IsOther { get; set; }
/// <summary>
/// Desc:是否保险联系人
/// </summary>
[SugarColumn(ColumnDescription = "是否保险联系人",DefaultValue = "0")]
public bool? IsInsurance { get; set; } = false;
[SugarColumn(ColumnDescription = "是否保险联系人", DefaultValue = "0")]
public bool IsInsurance { get; set; }
/// <summary>
/// Desc:是否对账联系人
/// </summary>
[SugarColumn(ColumnDescription = "是否对账联系人",DefaultValue = "0")]
public bool? IsCheckAccount { get; set; } = false;
[SugarColumn(ColumnDescription = "是否对账联系人", DefaultValue = "0")]
public bool IsCheckAccount { get; set; }
/// <summary>
/// 提醒日期1
/// </summary>
[SugarColumn(ColumnDescription = "提醒日期1", IsNullable = true)]
public DateTime Anniversary1 { get; set; }
public DateTime? Anniversary1 { get; set; }
/// <summary>
/// 提醒日期2
/// </summary>
[SugarColumn(ColumnDescription = "提醒日期2", IsNullable = true)]
public DateTime Anniversary2 { get; set; }
public DateTime? Anniversary2 { get; set; }
/// <summary>
/// 提醒备注1
/// </summary>
[SugarColumn(ColumnDescription = "提醒备注1", Length = 200, IsNullable = true)]
public string AnniversaryNote1 { get; set; }
public string? AnniversaryNote1 { get; set; }
/// <summary>
/// 提醒备注2
/// </summary>
[SugarColumn(ColumnDescription = "提醒备注2", Length = 200, IsNullable = true)]
public string AnniversaryNote2 { get; set; }
public string? AnniversaryNote2 { get; set; }
/// <summary>
/// 状态 0启用 1禁用
/// </summary>
[SugarColumn(ColumnDescription = "状态",DefaultValue = "0")]
public StatusEnum? Status { get; set; } = StatusEnum.Enable;
[SugarColumn(ColumnDescription = "状态", DefaultValue = "0")]
public StatusEnum Status { get; set; } = StatusEnum.Enable;
///// <summary>
///// 船公司Id
///// </summary>
//[SugarColumn(ColumnDescription = "船公司Id", IsNullable = true)]
//public long? CarrierId { get; set; }
/// <summary>
/// 船公司Id
/// </summary>
[SugarColumn(ColumnDescription = "船公司Id", IsNullable = true, DefaultValue = "0")]
public long CarrierId { get; set; }
/// <summary>
/// 船公司
/// </summary>
[SugarColumn(ColumnDescription = "船公司", IsNullable = true, Length = 100)]
public string Carrier { get; set; }
///// <summary>
///// 船公司
///// </summary>
//[SugarColumn(ColumnDescription = "船公司", IsNullable = true, Length = 100)]
//public string? Carrier { get; set; }
/// <summary>
/// 机构Id

@ -45,10 +45,10 @@ public class ClientContactService : ServiceBase, IClientContactService
{
if (req.Id == 0)
{
if (TenantDb.Queryable<InfoClientContact>().Where(x => x.CodeName == req.CodeName).Any())
{
return DataResult.Failed("客户联系人信息已存在!", MultiLanguageConst.ClientContactExist);
}
//if (TenantDb.Queryable<InfoClientContact>().Where(x => x.Name == req.Name).Any())
//{
// return DataResult.Failed("客户联系人信息已存在!", MultiLanguageConst.ClientContactExist);
//}
var data = req.Adapt<InfoClientContact>();

@ -2502,7 +2502,7 @@ namespace DS.WMS.Core.Op.Method
{
bookingContact = new BusinessOrderContact
{
Name = djyCustomerContactMan.ShortName,
Name = djyCustomerContactMan.Name,
BusinessId = id,
Email = djyCustomerContactMan.Email,
Note = djyCustomerContactMan.Note,
@ -2516,7 +2516,7 @@ namespace DS.WMS.Core.Op.Method
}
else
{
bookingContact.Name = djyCustomerContactMan.ShortName;
bookingContact.Name = djyCustomerContactMan.Name;
bookingContact.Email = djyCustomerContactMan.Email;
bookingContact.Note = djyCustomerContactMan.Note;
bookingContact.UpdateTime = DateTime.Now;

@ -638,7 +638,7 @@ public partial class SeaExportService : ISeaExportService
var defaultContact = sqlSugarScope.Queryable<InfoClientContact>().Where(x => x.ClientId == seaExport.CustomerId && x.IsOperator == true).First();
if (defaultContact.IsNotNull())
{
if (!contactLists.Where(x=>x.BusinessType == BusinessType.OceanShippingExport &&x.CustomerType == "controller"&& x.Name == defaultContact.ShortName).Any())
if (!contactLists.Where(x=>x.BusinessType == BusinessType.OceanShippingExport &&x.CustomerType == "controller"&& x.Name == defaultContact.Name).Any())
{
addList.Add(new BusinessOrderContact()
{
@ -647,7 +647,7 @@ public partial class SeaExportService : ISeaExportService
CustomerName = seaExport.CustomerName,
CustomerType = "controller",
CustomerTypeName="委托单位",
Name = defaultContact.ShortName,
Name = defaultContact.Name,
Tel = defaultContact.Tel,
Email = defaultContact.Email,
CustomerContactId = defaultContact.Id
@ -660,7 +660,7 @@ public partial class SeaExportService : ISeaExportService
var defaultContact = sqlSugarScope.Queryable<InfoClientContact>().Where(x => x.ClientId == seaExport.TruckerId && x.IsOperator == true).First();
if (defaultContact.IsNotNull())
{
if (!contactLists.Where(x => x.BusinessType == BusinessType.OceanShippingExport && x.CustomerType == "truck" && x.Name == defaultContact.ShortName).Any())
if (!contactLists.Where(x => x.BusinessType == BusinessType.OceanShippingExport && x.CustomerType == "truck" && x.Name == defaultContact.Name).Any())
{
addList.Add(new BusinessOrderContact()
{
@ -669,7 +669,7 @@ public partial class SeaExportService : ISeaExportService
CustomerName = seaExport.Trucker,
CustomerType = "truck",
CustomerTypeName = "车队",
Name = defaultContact.ShortName,
Name = defaultContact.Name,
Tel = defaultContact.Tel,
Email = defaultContact.Email,
CustomerContactId = defaultContact.Id
@ -682,7 +682,7 @@ public partial class SeaExportService : ISeaExportService
var defaultContact = sqlSugarScope.Queryable<InfoClientContact>().Where(x => x.ClientId == seaExport.YardId && x.IsOperator == true).First();
if (defaultContact.IsNotNull())
{
if (!contactLists.Where(x => x.BusinessType == BusinessType.OceanShippingExport && x.CustomerType == "yard" && x.Name == defaultContact.ShortName).Any())
if (!contactLists.Where(x => x.BusinessType == BusinessType.OceanShippingExport && x.CustomerType == "yard" && x.Name == defaultContact.Name).Any())
{
addList.Add(new BusinessOrderContact()
{
@ -691,7 +691,7 @@ public partial class SeaExportService : ISeaExportService
CustomerName = seaExport.Yard,
CustomerType = "yard",
CustomerTypeName = "场站",
Name = defaultContact.ShortName,
Name = defaultContact.Name,
Tel = defaultContact.Tel,
Email = defaultContact.Email,
CustomerContactId = defaultContact.Id
@ -704,7 +704,7 @@ public partial class SeaExportService : ISeaExportService
var defaultContact = sqlSugarScope.Queryable<InfoClientContact>().Where(x => x.ClientId == seaExport.ForwarderId && x.IsOperator == true).First();
if (defaultContact.IsNotNull())
{
if (!contactLists.Where(x => x.BusinessType == BusinessType.OceanShippingExport && x.CustomerType == "booking" && x.Name == defaultContact.ShortName).Any())
if (!contactLists.Where(x => x.BusinessType == BusinessType.OceanShippingExport && x.CustomerType == "booking" && x.Name == defaultContact.Name).Any())
{
addList.Add(new BusinessOrderContact()
{
@ -713,7 +713,7 @@ public partial class SeaExportService : ISeaExportService
CustomerName = seaExport.Forwarder,
CustomerType = "booking",
CustomerTypeName = "订舱公司",
Name = defaultContact.ShortName,
Name = defaultContact.Name,
Tel = defaultContact.Tel,
Email = defaultContact.Email,
CustomerContactId = defaultContact.Id

@ -1157,7 +1157,7 @@ namespace DS.WMS.Core.TaskPlat.Method
{
bookingContact = new BusinessOrderContact
{
Name = djyCustomerContactMan.ShortName,
Name = djyCustomerContactMan.Name,
BusinessId = id,
Email = djyCustomerContactMan.Email,
Note = djyCustomerContactMan.Note,
@ -1171,7 +1171,7 @@ namespace DS.WMS.Core.TaskPlat.Method
}
else
{
bookingContact.Name = djyCustomerContactMan.ShortName;
bookingContact.Name = djyCustomerContactMan.Name;
bookingContact.Email = djyCustomerContactMan.Email;
bookingContact.Note = djyCustomerContactMan.Note;
bookingContact.UpdateTime = DateTime.Now;

Loading…
Cancel
Save