booking_auth_dev
wet 2 years ago
commit 56bb38cab8

@ -4705,7 +4705,8 @@
<summary>
打印
</summary>
<param name="bookingId"></param>
<param name="bookingId">订舱Id</param>
<param name="type">打印模板类型,根据字典传值</param>
<returns></returns>
</member>
<member name="M:Myshipping.Application.BookingOrderService.SendXHZ(System.Int64)">

@ -1121,7 +1121,8 @@ namespace Myshipping.Application
/// <summary>
/// 打印
/// </summary>
/// <param name="bookingId"></param>
/// <param name="bookingId">订舱Id</param>
/// <param name="type">打印模板类型,根据字典传值</param>
/// <returns></returns>
[HttpGet("/BookingOrder/Print")]
public async Task<IActionResult> Print(long bookingId, string type)

@ -37,9 +37,10 @@ namespace Myshipping.Application
public async Task<dynamic> Page([FromQuery] QueryBookingTemplateInput input)
{
var entities = await _rep.AsQueryable()
.WhereIF(!string.IsNullOrEmpty(input.Title), u => u.Title.Contains(input.Title))
.WhereIF(input.Type.HasValue, u => u.Type == input.Type)
.ToPagedListAsync(input.PageNo, input.PageSize);
.Where(m => m.CreatedUserId == UserManager.UserId)
.WhereIF(!string.IsNullOrEmpty(input.Title), u => u.Title.Contains(input.Title))
.WhereIF(input.Type.HasValue, u => u.Type == input.Type)
.ToPagedListAsync(input.PageNo, input.PageSize);
return entities.XnPagedResult();
}

@ -185,5 +185,157 @@ namespace Myshipping.Core.Entity
}
[SugarTable("user_baseinfo")]
[Description("平台用户baseinfo")]
public class PingTaiUserBaseInfo : PingTaiDbEntity
{
/// <summary>
///
/// </summary>
public string GID { get; set; }
/// <summary>
///
/// </summary>
public string USERID { get; set; }
/// <summary>
/// 所属分公司简称
/// </summary>
public string COMPANYNAME { get; set; }
/// <summary>
/// 部门名称
/// </summary>
public string DEPTNAME { get; set; }
/// <summary>
///
/// </summary>
public string OFFICEPHONE { get; set; }
/// <summary>
///
/// </summary>
public string HOMEPHONE { get; set; }
/// <summary>
///
/// </summary>
public string MOBILE { get; set; }
/// <summary>
///
/// </summary>
public string FAX { get; set; }
/// <summary>
///
/// </summary>
public string EMAIL1 { get; set; }
/// <summary>
///
/// </summary>
public string EMAIL2 { get; set; }
/// <summary>
///
/// </summary>
public string HOMEADDRESS { get; set; }
/// <summary>
///
/// </summary>
public string REMARK { get; set; }
/// <summary>
///
/// </summary>
public string CREATEUSER { get; set; }
/// <summary>
///
/// </summary>
public DateTime? CREATETIME { get; set; }
/// <summary>
///
/// </summary>
public string MODIFIEDUSER { get; set; }
/// <summary>
///
/// </summary>
public DateTime? MODIFIEDTIME { get; set; }
/// <summary>
///
/// </summary>
public string EMERGUSER { get; set; }
/// <summary>
///
/// </summary>
public string EMERGPHONE { get; set; }
/// <summary>
///
/// </summary>
public string EMERGEMAIL { get; set; }
/// <summary>
///
/// </summary>
public string POSTCODE { get; set; }
/// <summary>
///
/// </summary>
public string QQ { get; set; }
/// <summary>
///
/// </summary>
public string MSN { get; set; }
/// <summary>
///
/// </summary>
public string FINANCESOFTCODE { get; set; }
/// <summary>
///
/// </summary>
public string IMAGEURL { get; set; }
/// <summary>
///
/// </summary>
public string SIGNATUREURL { get; set; }
/// <summary>
///
/// </summary>
public string FaSongFangDaiMa { get; set; }
/// <summary>
///
/// </summary>
public string JieShouFangDaiMa { get; set; }
/// <summary>
///
/// </summary>
public string QdPortUserName { get; set; }
/// <summary>
///
/// </summary>
public string QdPortPassword { get; set; }
}
}

@ -23,11 +23,12 @@ namespace Myshipping.Core.Job
{
Log.Information($"UserSyncWorker {DateTime.Now}");
var tenantId = 142307070918780L;
var roleId = 175633246363717L;//普通用户
var tenantId = 349708986646597L;
var roleId = 355651062833221L;//普通用户
var _sugerClient = App.GetService<ISqlSugarClient>();
_sugerClient.QueryFilter.Clear();
var _repPingTaiUser = App.GetService<SqlSugarRepository<PingTaiUser>>();
var _repPingTaiUserBase = App.GetService<SqlSugarRepository<PingTaiUserBaseInfo>>();
var _repUser = App.GetService<SqlSugarRepository<SysUser>>();
var _repEmp = App.GetService<SqlSugarRepository<SysEmp>>();
var _repOrg = App.GetService<SqlSugarRepository<SysOrg>>();
@ -41,7 +42,18 @@ namespace Myshipping.Core.Job
var keyDES = App.GetOptions<EncryptKeyOptions>().DES;
var org = _repOrg.FirstOrDefault(x => x.TenantId == tenantId);
if (org == null)
{
Log.Error($"用户数据同步失败:未找到任何组织");
return;
}
var pos = _repPos.FirstOrDefault(x => x.TenantId == tenantId);
if (pos == null)
{
Log.Error($"用户数据同步失败:未找到任何职位");
return;
}
_sugerClient.Ado.BeginTran(System.Data.IsolationLevel.ReadCommitted);
try
@ -59,11 +71,17 @@ namespace Myshipping.Core.Job
sysUser = sysUsers.First(x => x.Account == user.CODENAME);
}
var ub = _repPingTaiUserBase.FirstOrDefault(x => x.USERID == user.GID);
sysUser.Account = user.CODENAME;
sysUser.Password = DESCEncryption.Encrypt(user.PASSWORD, keyDES);
sysUser.TenantId = tenantId;
sysUser.Name = user.SHOWNAME;
sysUser.AdminType = AdminType.None;
sysUser.DjyUserId = user.GID;
sysUser.NickName = user.SHOWNAME;
sysUser.Phone = ub.MOBILE;
sysUser.Email = ub.EMAIL1;
if (!existUser)
{
@ -85,19 +103,27 @@ namespace Myshipping.Core.Job
userrole.SysRoleId = roleId;
userrole.SysUserId = sysUser.Id;
_repUserRole.Insert(userrole);
Log.Information($"新用户,插入:{sysUser.Name}");
}
else
{
_repUser.Update(sysUser);
Log.Information($"老用户,更新:{sysUser.Name}");
}
}
_sugerClient.Ado.CommitTran();
Log.Information($"用户数据同步完成");
}
catch
catch (Exception ex)
{
_sugerClient.Ado.RollbackTran();
throw;
Log.Error($"用户数据同步失败:{ex.Message}");
Log.Error($"{ex.StackTrace}");
}
}

@ -2294,6 +2294,151 @@
</summary>
</member>
<member name="P:Myshipping.Core.Entity.PingTaiUserBaseInfo.GID">
<summary>
</summary>
</member>
<member name="P:Myshipping.Core.Entity.PingTaiUserBaseInfo.USERID">
<summary>
</summary>
</member>
<member name="P:Myshipping.Core.Entity.PingTaiUserBaseInfo.COMPANYNAME">
<summary>
所属分公司简称
</summary>
</member>
<member name="P:Myshipping.Core.Entity.PingTaiUserBaseInfo.DEPTNAME">
<summary>
部门名称
</summary>
</member>
<member name="P:Myshipping.Core.Entity.PingTaiUserBaseInfo.OFFICEPHONE">
<summary>
</summary>
</member>
<member name="P:Myshipping.Core.Entity.PingTaiUserBaseInfo.HOMEPHONE">
<summary>
</summary>
</member>
<member name="P:Myshipping.Core.Entity.PingTaiUserBaseInfo.MOBILE">
<summary>
</summary>
</member>
<member name="P:Myshipping.Core.Entity.PingTaiUserBaseInfo.FAX">
<summary>
</summary>
</member>
<member name="P:Myshipping.Core.Entity.PingTaiUserBaseInfo.EMAIL1">
<summary>
</summary>
</member>
<member name="P:Myshipping.Core.Entity.PingTaiUserBaseInfo.EMAIL2">
<summary>
</summary>
</member>
<member name="P:Myshipping.Core.Entity.PingTaiUserBaseInfo.HOMEADDRESS">
<summary>
</summary>
</member>
<member name="P:Myshipping.Core.Entity.PingTaiUserBaseInfo.REMARK">
<summary>
</summary>
</member>
<member name="P:Myshipping.Core.Entity.PingTaiUserBaseInfo.CREATEUSER">
<summary>
</summary>
</member>
<member name="P:Myshipping.Core.Entity.PingTaiUserBaseInfo.CREATETIME">
<summary>
</summary>
</member>
<member name="P:Myshipping.Core.Entity.PingTaiUserBaseInfo.MODIFIEDUSER">
<summary>
</summary>
</member>
<member name="P:Myshipping.Core.Entity.PingTaiUserBaseInfo.MODIFIEDTIME">
<summary>
</summary>
</member>
<member name="P:Myshipping.Core.Entity.PingTaiUserBaseInfo.EMERGUSER">
<summary>
</summary>
</member>
<member name="P:Myshipping.Core.Entity.PingTaiUserBaseInfo.EMERGPHONE">
<summary>
</summary>
</member>
<member name="P:Myshipping.Core.Entity.PingTaiUserBaseInfo.EMERGEMAIL">
<summary>
</summary>
</member>
<member name="P:Myshipping.Core.Entity.PingTaiUserBaseInfo.POSTCODE">
<summary>
</summary>
</member>
<member name="P:Myshipping.Core.Entity.PingTaiUserBaseInfo.QQ">
<summary>
</summary>
</member>
<member name="P:Myshipping.Core.Entity.PingTaiUserBaseInfo.MSN">
<summary>
</summary>
</member>
<member name="P:Myshipping.Core.Entity.PingTaiUserBaseInfo.FINANCESOFTCODE">
<summary>
</summary>
</member>
<member name="P:Myshipping.Core.Entity.PingTaiUserBaseInfo.IMAGEURL">
<summary>
</summary>
</member>
<member name="P:Myshipping.Core.Entity.PingTaiUserBaseInfo.SIGNATUREURL">
<summary>
</summary>
</member>
<member name="P:Myshipping.Core.Entity.PingTaiUserBaseInfo.FaSongFangDaiMa">
<summary>
</summary>
</member>
<member name="P:Myshipping.Core.Entity.PingTaiUserBaseInfo.JieShouFangDaiMa">
<summary>
</summary>
</member>
<member name="P:Myshipping.Core.Entity.PingTaiUserBaseInfo.QdPortUserName">
<summary>
</summary>
</member>
<member name="P:Myshipping.Core.Entity.PingTaiUserBaseInfo.QdPortPassword">
<summary>
</summary>
</member>
<member name="T:Myshipping.Core.Entity.SysApp">
<summary>
系统应用表

@ -42,28 +42,29 @@ namespace Myshipping.Core.Service
public async Task<dynamic> Page([FromQuery] QueryDjyCustomerInput input)
{
var entities = await _rep.AsQueryable()
.WhereIF(!string.IsNullOrWhiteSpace(input.CodeName), u => u.CodeName.Contains(input.CodeName.Trim()))
.WhereIF(!string.IsNullOrWhiteSpace(input.ShortName), u => u.ShortName.Contains(input.ShortName.Trim()))
.WhereIF(!string.IsNullOrWhiteSpace(input.FullName), u => u.FullName.Contains(input.FullName.Trim()))
.WhereIF(!string.IsNullOrWhiteSpace(input.Chief), u => u.Chief.Contains(input.Chief.Trim()))
.WhereIF(!string.IsNullOrWhiteSpace(input.Tel), u => u.Tel.Contains(input.Tel.Trim()))
.WhereIF(!string.IsNullOrWhiteSpace(input.Email), u => u.Email.Contains(input.Email.Trim()))
.WhereIF(!string.IsNullOrWhiteSpace(input.QQ), u => u.QQ.Contains(input.QQ.Trim()))
.WhereIF(!string.IsNullOrWhiteSpace(input.WebUrl), u => u.WebUrl.Contains(input.WebUrl.Trim()))
.WhereIF(!string.IsNullOrWhiteSpace(input.Province), u => u.Province.Contains(input.Province.Trim()))
.WhereIF(!string.IsNullOrWhiteSpace(input.City), u => u.City.Contains(input.City.Trim()))
.WhereIF(!string.IsNullOrWhiteSpace(input.Addr), u => u.Addr.Contains(input.Addr.Trim()))
.WhereIF(!string.IsNullOrWhiteSpace(input.FullNameEN), u => u.FullNameEN.Contains(input.FullNameEN.Trim()))
.WhereIF(!string.IsNullOrWhiteSpace(input.AddrEN), u => u.AddrEN.Contains(input.AddrEN.Trim()))
.WhereIF(!string.IsNullOrWhiteSpace(input.PropString), u => u.PropString.Contains(input.PropString.Trim()))
.WhereIF(!string.IsNullOrWhiteSpace(input.InvTitle), u => u.InvTitle.Contains(input.InvTitle.Trim()))
.WhereIF(!string.IsNullOrWhiteSpace(input.TaxNO), u => u.TaxNO.Contains(input.TaxNO.Trim()))
.WhereIF(!string.IsNullOrWhiteSpace(input.InvAddrTel), u => u.InvAddrTel.Contains(input.InvAddrTel.Trim()))
.WhereIF(!string.IsNullOrWhiteSpace(input.RMBBank), u => u.RMBBank.Contains(input.RMBBank.Trim()))
.WhereIF(!string.IsNullOrWhiteSpace(input.RmbAccount), u => u.RmbAccount.Contains(input.RmbAccount.Trim()))
.WhereIF(!string.IsNullOrWhiteSpace(input.USDBank), u => u.USDBank.Contains(input.USDBank.Trim()))
.WhereIF(!string.IsNullOrWhiteSpace(input.USDAccount), u => u.USDAccount.Contains(input.USDAccount.Trim()))
.ToPagedListAsync(input.PageNo, input.PageSize);
.Where(m => m.CreatedUserId == UserManager.UserId)
.WhereIF(!string.IsNullOrWhiteSpace(input.CodeName), u => u.CodeName.Contains(input.CodeName.Trim()))
.WhereIF(!string.IsNullOrWhiteSpace(input.ShortName), u => u.ShortName.Contains(input.ShortName.Trim()))
.WhereIF(!string.IsNullOrWhiteSpace(input.FullName), u => u.FullName.Contains(input.FullName.Trim()))
.WhereIF(!string.IsNullOrWhiteSpace(input.Chief), u => u.Chief.Contains(input.Chief.Trim()))
.WhereIF(!string.IsNullOrWhiteSpace(input.Tel), u => u.Tel.Contains(input.Tel.Trim()))
.WhereIF(!string.IsNullOrWhiteSpace(input.Email), u => u.Email.Contains(input.Email.Trim()))
.WhereIF(!string.IsNullOrWhiteSpace(input.QQ), u => u.QQ.Contains(input.QQ.Trim()))
.WhereIF(!string.IsNullOrWhiteSpace(input.WebUrl), u => u.WebUrl.Contains(input.WebUrl.Trim()))
.WhereIF(!string.IsNullOrWhiteSpace(input.Province), u => u.Province.Contains(input.Province.Trim()))
.WhereIF(!string.IsNullOrWhiteSpace(input.City), u => u.City.Contains(input.City.Trim()))
.WhereIF(!string.IsNullOrWhiteSpace(input.Addr), u => u.Addr.Contains(input.Addr.Trim()))
.WhereIF(!string.IsNullOrWhiteSpace(input.FullNameEN), u => u.FullNameEN.Contains(input.FullNameEN.Trim()))
.WhereIF(!string.IsNullOrWhiteSpace(input.AddrEN), u => u.AddrEN.Contains(input.AddrEN.Trim()))
.WhereIF(!string.IsNullOrWhiteSpace(input.PropString), u => u.PropString.Contains(input.PropString.Trim()))
.WhereIF(!string.IsNullOrWhiteSpace(input.InvTitle), u => u.InvTitle.Contains(input.InvTitle.Trim()))
.WhereIF(!string.IsNullOrWhiteSpace(input.TaxNO), u => u.TaxNO.Contains(input.TaxNO.Trim()))
.WhereIF(!string.IsNullOrWhiteSpace(input.InvAddrTel), u => u.InvAddrTel.Contains(input.InvAddrTel.Trim()))
.WhereIF(!string.IsNullOrWhiteSpace(input.RMBBank), u => u.RMBBank.Contains(input.RMBBank.Trim()))
.WhereIF(!string.IsNullOrWhiteSpace(input.RmbAccount), u => u.RmbAccount.Contains(input.RmbAccount.Trim()))
.WhereIF(!string.IsNullOrWhiteSpace(input.USDBank), u => u.USDBank.Contains(input.USDBank.Trim()))
.WhereIF(!string.IsNullOrWhiteSpace(input.USDAccount), u => u.USDAccount.Contains(input.USDAccount.Trim()))
.ToPagedListAsync(input.PageNo, input.PageSize);
return entities.XnPagedResult();
}
@ -73,13 +74,14 @@ namespace Myshipping.Core.Service
/// <param name="input"></param>
/// <returns></returns>
[HttpPost("/DjyCustomer/add"), SqlSugarUnitOfWork]
public async Task Add(AddDjyCustomerInput input)
public async Task<long> Add(AddDjyCustomerInput input)
{
var entity = input.Adapt<DjyCustomer>();
await _rep.InsertAsync(entity);
var contactList = input.Contacts.Adapt<List<DjyCustomerContact>>();
contactList.ForEach(x => x.CustomerId = entity.Id);
await _repContact.InsertAsync(contactList);
return entity.Id;
}
/// <summary>
@ -88,7 +90,7 @@ namespace Myshipping.Core.Service
/// <param name="input"></param>
/// <returns></returns>
[HttpPost("/DjyCustomer/edit"), SqlSugarUnitOfWork]
public async Task Update(UpdateDjyCustomerInput input)
public async Task<long> Update(UpdateDjyCustomerInput input)
{
var find = await _rep.FirstOrDefaultAsync(u => u.Id == input.Id);
if (find == null)
@ -102,6 +104,7 @@ namespace Myshipping.Core.Service
var contactList = input.Contacts.Adapt<List<DjyCustomerContact>>();
contactList.ForEach(x => x.CustomerId = entity.Id);
await _repContact.InsertAsync(contactList);
return entity.Id;
}
/// <summary>

@ -9,8 +9,8 @@ namespace Myshipping.Core.Service
public interface IDjyCustomerService
{
Task<dynamic> Page([FromQuery] QueryDjyCustomerInput input);
Task Add(AddDjyCustomerInput input);
Task Update(UpdateDjyCustomerInput input);
Task<long> Add(AddDjyCustomerInput input);
Task<long> Update(UpdateDjyCustomerInput input);
Task Delete(GetDjyCustomerInput input);
Task<DjyCustomerOutput> Detail([FromQuery] GetDjyCustomerInput input);
//Task<dynamic> List([FromQuery] QueryBookingCustomerInput input);

@ -32,9 +32,10 @@ namespace Myshipping.Core.Service
public async Task<dynamic> Page([FromQuery] QueryDjyUserConfigInput input)
{
var entities = await _rep.AsQueryable()
.WhereIF(!string.IsNullOrWhiteSpace(input.Type), u => u.Type == input.Type)
.WhereIF(!string.IsNullOrWhiteSpace(input.ConfigJson), u => u.ConfigJson == input.ConfigJson)
.ToPagedListAsync(input.PageNo, input.PageSize);
.Where(m => m.CreatedUserId == UserManager.UserId)
.WhereIF(!string.IsNullOrWhiteSpace(input.Type), u => u.Type == input.Type)
.WhereIF(!string.IsNullOrWhiteSpace(input.ConfigJson), u => u.ConfigJson == input.ConfigJson)
.ToPagedListAsync(input.PageNo, input.PageSize);
return entities.XnPagedResult();
}

@ -36,8 +36,9 @@ namespace Myshipping.Core.Service
public async Task<dynamic> Page([FromQuery] QueryDjyUserMailAccountInput input)
{
var entities = await _rep.AsQueryable()
.WhereIF(!string.IsNullOrWhiteSpace(input.MailAccount), u => u.MailAccount.Contains(input.MailAccount.Trim()))
.ToPagedListAsync(input.PageNo, input.PageSize);
.Where(m => m.CreatedUserId == UserManager.UserId)
.WhereIF(!string.IsNullOrWhiteSpace(input.MailAccount), u => u.MailAccount.Contains(input.MailAccount.Trim()))
.ToPagedListAsync(input.PageNo, input.PageSize);
return entities.XnPagedResult();
}

@ -36,9 +36,10 @@ namespace Myshipping.Core.Service
public async Task<dynamic> Page([FromQuery] QueryDjyWebsiteAccountConfigInput input)
{
var entities = await _rep.AsQueryable()
.WhereIF(!string.IsNullOrWhiteSpace(input.TypeCode), u => u.TypeCode == input.TypeCode)
.WhereIF(!string.IsNullOrWhiteSpace(input.Account), u => u.Account.Contains(input.Account.Trim()))
.ToPagedListAsync(input.PageNo, input.PageSize);
.Where(m => m.CreatedUserId == UserManager.UserId)
.WhereIF(!string.IsNullOrWhiteSpace(input.TypeCode), u => u.TypeCode == input.TypeCode)
.WhereIF(!string.IsNullOrWhiteSpace(input.Account), u => u.Account.Contains(input.Account.Trim()))
.ToPagedListAsync(input.PageNo, input.PageSize);
return entities.XnPagedResult();
}
@ -48,7 +49,7 @@ namespace Myshipping.Core.Service
/// <param name="input"></param>
/// <returns></returns>
[HttpPost("/DjyWebsiteAccountConfig/add")]
public async Task Add(AddDjyWebsiteAccountConfigInput input)
public async Task<long> Add(AddDjyWebsiteAccountConfigInput input)
{
var cc = _rep.Count(x => x.TypeCode == input.TypeCode && x.CreatedUserId == UserManager.UserId);
if (cc > 0)
@ -58,6 +59,7 @@ namespace Myshipping.Core.Service
var entity = input.Adapt<DjyWebsiteAccountConfig>();
await _rep.InsertAsync(entity);
return entity.Id;
}
/// <summary>
@ -66,7 +68,7 @@ namespace Myshipping.Core.Service
/// <param name="input"></param>
/// <returns></returns>
[HttpPost("/DjyWebsiteAccountConfig/edit")]
public async Task Update(UpdateDjyWebsiteAccountConfigInput input)
public async Task<long> Update(UpdateDjyWebsiteAccountConfigInput input)
{
var cc = _rep.Count(x => x.TypeCode == input.TypeCode && x.CreatedUserId == UserManager.UserId && x.Id != input.Id);
if (cc > 0)
@ -76,6 +78,7 @@ namespace Myshipping.Core.Service
var entity = input.Adapt<DjyWebsiteAccountConfig>();
await _rep.AsUpdateable(entity).IgnoreColumns(ignoreAllNullColumns: true).ExecuteCommandAsync();
return entity.Id;
}
/// <summary>

@ -8,8 +8,8 @@ namespace Myshipping.Core.Service
public interface IDjyWebsiteAccountConfigService
{
Task<dynamic> Page([FromQuery] QueryDjyWebsiteAccountConfigInput input);
Task Add(AddDjyWebsiteAccountConfigInput input);
Task Update(UpdateDjyWebsiteAccountConfigInput input);
Task<long> Add(AddDjyWebsiteAccountConfigInput input);
Task<long> Update(UpdateDjyWebsiteAccountConfigInput input);
Task Delete(GetDjyWebsiteAccountConfigInput input);
}
}
Loading…
Cancel
Save