jianghaiqing 7 months ago
commit 25d729d99b

@ -10483,6 +10483,7 @@ namespace Myshipping.Application
/// <summary>
/// 设置小票截止时间
/// </summary>
/// <paramref name="extId"/>拓展数据ID
/// <paramref name="bookId"/>订舱ID
/// <paramref name="date"/>截止时间

@ -52,6 +52,8 @@ namespace Myshipping.Application.Service
.WhereIF(!string.IsNullOrEmpty(input.CustName), u => u.CustName.Contains(input.CustName))
.WhereIF(!string.IsNullOrEmpty(input.Carrier), u => u.Carrier.Contains(input.Carrier))
.WhereIF(!string.IsNullOrEmpty(input.TemplateName), u => u.TemplateName.Contains(input.TemplateName))
.WhereIF(!string.IsNullOrEmpty(input.ContractNO), u => u.ContractNO.Contains(input.ContractNO))
.WhereIF(!string.IsNullOrEmpty(input.BookingAccount), u => u.BookingAccount.Contains(input.BookingAccount))
.WhereIF(!string.IsNullOrEmpty(input.CarrierId), u => u.CarrierId == input.CarrierId);
if (!string.IsNullOrEmpty(input.SortField) || input.MultiSort == null || input.MultiSort.Count == 0)

@ -404,5 +404,15 @@ namespace Myshipping.Application
/// </summary>
public string TemplateName { get; set; }
/// <summary>
/// 合约号
/// </summary>
public string ContractNO { get; set; }
/// <summary>
/// 订舱账号
/// </summary>
public string BookingAccount { get; set; }
}
}

@ -48,9 +48,14 @@ namespace Myshipping.Core
//用户信息
var listSyncToDjy = new List<DjyCustomerFromCustomerUserDto>();
var dbUsers = await repoUser.AsQueryable().Filter(null, true).Where(x => x.TenantId == tenant.Id && x.IsDeleted == false).ToListAsync();
var dbUsers = await repoUser.AsQueryable().Filter(null, true).Where(x => x.TenantId == tenant.Id && x.AdminType == AdminType.None && x.IsDeleted == false).ToListAsync();
foreach (var user in dbUsers)
{
if (user.Name.EndsWith("(离职)"))
{
continue;
}
listSyncToDjy.Add(new DjyCustomerFromCustomerUserDto()
{
Id = user.Id,

@ -16,6 +16,7 @@ using System.Text.RegularExpressions;
using NPOI.Util;
using StackExchange.Profiling.Internal;
using Microsoft.AspNetCore.Authorization;
using static NPOI.HSSF.Util.HSSFColor;
namespace Myshipping.Core.Service
{
@ -410,10 +411,12 @@ namespace Myshipping.Core.Service
var dbContactList = await _repContact.AsQueryable().Filter(null, true).Where(x => x.CustomerId == cust.Id).ToListAsync();
foreach (var usr in dto.UserList)
{
DjyCustomerContact contact = dbContactList.FirstOrDefault(x => x.CustSysId == usr.Id);
//不存在,新增
if (dbContactList.Count(x => x.CustSysId == usr.Id) == 0)
if (contact == null)
{
var contact = new DjyCustomerContact()
contact = new DjyCustomerContact()
{
CustomerId = cust.Id,
Name = usr.Name,
@ -425,6 +428,25 @@ namespace Myshipping.Core.Service
await _repContact.InsertAsync(contact);
}
else
{
contact.CustomerId = cust.Id;
contact.Name = usr.Name;
contact.Email = usr.Email;
contact.Tel = usr.Phone;
contact.CustSysId = usr.Id;
contact.DjyGid = usr.DjyGid;
await _repContact.UpdateAsync(contact);
dbContactList.Remove(contact);
}
}
//删除没有的用户
foreach (var contact in dbContactList)
{
await _repContact.DeleteAsync(contact);
}
}

@ -217,6 +217,12 @@ public class SysUserService : ISysUserService, IDynamicApiController, ITransient
}
//客户端用户信息同步给运营端往来单位
if (App.Configuration["RunType"] is CommonConst.RUN_TYPE_CUST)
{
var evtPub = App.GetService<IEventPublisher>();
await evtPub.PublishAsync(new ChannelEventSource($"DjySync:TenantUserToCustomer", UserManager.TENANT_ID));
}
}
@ -254,6 +260,13 @@ public class SysUserService : ISysUserService, IDynamicApiController, ITransient
}
//客户端用户信息同步给运营端往来单位
if (App.Configuration["RunType"] is CommonConst.RUN_TYPE_CUST)
{
var evtPub = App.GetService<IEventPublisher>();
await evtPub.PublishAsync(new ChannelEventSource($"DjySync:TenantUserToCustomer", UserManager.TENANT_ID));
}
}
/// <summary>

Loading…
Cancel
Save