订舱关系人

booking_auth_dev
wanghaomei 2 years ago
parent 40f2930eb9
commit 1fea7bb844

@ -6571,6 +6571,270 @@
备注
</summary>
</member>
<member name="T:Myshipping.Application.BookingOrderContactService">
<summary>
订舱关系人服务
</summary>
</member>
<member name="M:Myshipping.Application.BookingOrderContactService.Page(Myshipping.Application.QueryBookingOrderContactInput)">
<summary>
分页查询订舱关系人
</summary>
<param name="input"></param>
<returns></returns>
</member>
<member name="M:Myshipping.Application.BookingOrderContactService.Add(Myshipping.Application.AddBookingOrderContactInput)">
<summary>
增加订舱关系人
</summary>
<param name="input"></param>
<returns></returns>
</member>
<member name="M:Myshipping.Application.BookingOrderContactService.Update(Myshipping.Application.UpdateBookingOrderContactInput)">
<summary>
更新订舱关系人
</summary>
<param name="input"></param>
<returns></returns>
</member>
<member name="M:Myshipping.Application.BookingOrderContactService.Delete(Myshipping.Application.GetBookingOrderContactInput)">
<summary>
删除订舱关系人
</summary>
<param name="input"></param>
<returns></returns>
</member>
<member name="M:Myshipping.Application.BookingOrderContactService.Get(Myshipping.Application.GetBookingOrderContactInput)">
<summary>
获取订舱关系人
</summary>
<param name="input"></param>
<returns></returns>
</member>
<member name="M:Myshipping.Application.BookingOrderContactService.ListByOrder(System.Int64)">
<summary>
根据订舱ID获取关系人
</summary>
<param name="bookingId"></param>
<returns></returns>
</member>
<member name="M:Myshipping.Application.BookingOrderContactService.SaveBatch(System.Collections.Generic.List{Myshipping.Application.UpdateBookingOrderContactInput})">
<summary>
批量保存关系人(同时新增、删除、修改)
</summary>
<param name="input"></param>
<returns></returns>
</member>
<member name="T:Myshipping.Application.BookingOrderContactDto">
<summary>
订舱关系人输出参数
</summary>
</member>
<member name="P:Myshipping.Application.BookingOrderContactDto.Id">
<summary>
主键
</summary>
</member>
<member name="P:Myshipping.Application.BookingOrderContactDto.BookingId">
<summary>
订舱Id
</summary>
</member>
<member name="P:Myshipping.Application.BookingOrderContactDto.RoleCode">
<summary>
角色代码
</summary>
</member>
<member name="P:Myshipping.Application.BookingOrderContactDto.Name">
<summary>
名称
</summary>
</member>
<member name="P:Myshipping.Application.BookingOrderContactDto.Tel">
<summary>
电话
</summary>
</member>
<member name="P:Myshipping.Application.BookingOrderContactDto.Email">
<summary>
邮箱
</summary>
</member>
<member name="P:Myshipping.Application.BookingOrderContactDto.Sort">
<summary>
排序号
</summary>
</member>
<member name="P:Myshipping.Application.BookingOrderContactDto.Remark">
<summary>
备注
</summary>
</member>
<member name="P:Myshipping.Application.BookingOrderContactDto.TenantId">
<summary>
租户ID
</summary>
</member>
<member name="T:Myshipping.Application.BookingOrderContactInput">
<summary>
订舱关系人输入参数
</summary>
</member>
<member name="P:Myshipping.Application.BookingOrderContactInput.BookingId">
<summary>
订舱Id
</summary>
</member>
<member name="P:Myshipping.Application.BookingOrderContactInput.RoleCode">
<summary>
角色代码
</summary>
</member>
<member name="P:Myshipping.Application.BookingOrderContactInput.Name">
<summary>
名称
</summary>
</member>
<member name="P:Myshipping.Application.BookingOrderContactInput.Tel">
<summary>
电话
</summary>
</member>
<member name="P:Myshipping.Application.BookingOrderContactInput.Email">
<summary>
邮箱
</summary>
</member>
<member name="P:Myshipping.Application.BookingOrderContactInput.Sort">
<summary>
排序号
</summary>
</member>
<member name="P:Myshipping.Application.BookingOrderContactInput.Remark">
<summary>
备注
</summary>
</member>
<member name="T:Myshipping.Application.AddBookingOrderContactInput">
<summary>
订舱关系人新增输入参数
</summary>
</member>
<member name="T:Myshipping.Application.UpdateBookingOrderContactInput">
<summary>
订舱关系人修改输入参数
</summary>
</member>
<member name="P:Myshipping.Application.UpdateBookingOrderContactInput.Id">
<summary>
主键
</summary>
</member>
<member name="T:Myshipping.Application.GetBookingOrderContactInput">
<summary>
订舱关系人获取(删除)输入参数
</summary>
</member>
<member name="P:Myshipping.Application.GetBookingOrderContactInput.Id">
<summary>
主键
</summary>
</member>
<member name="T:Myshipping.Application.QueryBookingOrderContactInput">
<summary>
订舱关系人查询输入参数
</summary>
</member>
<member name="P:Myshipping.Application.QueryBookingOrderContactInput.Id">
<summary>
主键
</summary>
</member>
<member name="P:Myshipping.Application.QueryBookingOrderContactInput.BookingId">
<summary>
订舱Id
</summary>
</member>
<member name="P:Myshipping.Application.QueryBookingOrderContactInput.RoleCode">
<summary>
角色代码
</summary>
</member>
<member name="P:Myshipping.Application.QueryBookingOrderContactInput.Name">
<summary>
名称
</summary>
</member>
<member name="P:Myshipping.Application.QueryBookingOrderContactInput.Tel">
<summary>
电话
</summary>
</member>
<member name="P:Myshipping.Application.QueryBookingOrderContactInput.Email">
<summary>
邮箱
</summary>
</member>
<member name="P:Myshipping.Application.QueryBookingOrderContactInput.Sort">
<summary>
排序号
</summary>
</member>
<member name="P:Myshipping.Application.QueryBookingOrderContactInput.Remark">
<summary>
备注
</summary>
</member>
<member name="P:Myshipping.Application.QueryBookingOrderContactInput.TenantId">
<summary>
租户ID
</summary>
</member>
<member name="T:Myshipping.Application.BookingOrderContactOutput">
<summary>
订舱关系人输出参数
</summary>
</member>
<member name="P:Myshipping.Application.BookingOrderContactOutput.Id">
<summary>
主键
</summary>
</member>
<member name="P:Myshipping.Application.BookingOrderContactOutput.BookingId">
<summary>
订舱Id
</summary>
</member>
<member name="P:Myshipping.Application.BookingOrderContactOutput.RoleCode">
<summary>
角色代码
</summary>
</member>
<member name="P:Myshipping.Application.BookingOrderContactOutput.Name">
<summary>
名称
</summary>
</member>
<member name="P:Myshipping.Application.BookingOrderContactOutput.Tel">
<summary>
电话
</summary>
</member>
<member name="P:Myshipping.Application.BookingOrderContactOutput.Email">
<summary>
邮箱
</summary>
</member>
<member name="P:Myshipping.Application.BookingOrderContactOutput.Sort">
<summary>
排序号
</summary>
</member>
<member name="P:Myshipping.Application.BookingOrderContactOutput.Remark">
<summary>
备注
</summary>
</member>
<member name="T:Myshipping.Application.BookingOrderService">
<summary>
订舱服务
@ -6680,7 +6944,7 @@
<summary>
放舱发送
</summary>
<param name="input"></param>
<param name="bookingId"></param>
<returns></returns>
</member>
<member name="M:Myshipping.Application.BookingOrderService.LetterYardPdf(System.Int64)">

@ -731,7 +731,7 @@ namespace Myshipping.Application
/// <summary>
/// 放舱发送
/// </summary>
/// <param name="input"></param>
/// <param name="bookingId"></param>
/// <returns></returns>
[HttpPost("/BookingLetteryard/sendletteryard")]
public async Task SendLetterYard(long bookingId)

@ -0,0 +1,133 @@
using Myshipping.Core;
using Furion.DependencyInjection;
using Furion.DynamicApiController;
using Mapster;
using Microsoft.AspNetCore.Mvc;
using SqlSugar;
using System.Linq;
using System.Threading.Tasks;
using Myshipping.Application.Entity;
using Microsoft.Extensions.Logging;
using System.Collections.Generic;
namespace Myshipping.Application
{
/// <summary>
/// 订舱关系人服务
/// </summary>
[ApiDescriptionSettings("Application", Name = "BookingOrderContact", Order = 1)]
public class BookingOrderContactService : IBookingOrderContactService, IDynamicApiController, ITransient
{
private readonly SqlSugarRepository<BookingOrderContact> _rep;
private readonly ILogger<BookingOrderContact> _logger;
public BookingOrderContactService(SqlSugarRepository<BookingOrderContact> rep, ILogger<BookingOrderContact> logger)
{
_rep = rep;
_logger = logger;
}
/// <summary>
/// 分页查询订舱关系人
/// </summary>
/// <param name="input"></param>
/// <returns></returns>
[HttpGet("/BookingOrderContact/page")]
public async Task<dynamic> Page([FromQuery] QueryBookingOrderContactInput input)
{
var entities = await _rep.AsQueryable()
.WhereIF(!string.IsNullOrWhiteSpace(input.RoleCode), u => u.RoleCode.Contains(input.RoleCode.Trim()))
.WhereIF(!string.IsNullOrWhiteSpace(input.Name), u => u.Name.Contains(input.Name.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()))
.ToPagedListAsync(input.PageNo, input.PageSize);
return entities.XnPagedResult();
}
/// <summary>
/// 增加订舱关系人
/// </summary>
/// <param name="input"></param>
/// <returns></returns>
[HttpPost("/BookingOrderContact/add")]
public async Task Add(AddBookingOrderContactInput input)
{
var entity = input.Adapt<BookingOrderContact>();
await _rep.InsertAsync(entity);
}
/// <summary>
/// 更新订舱关系人
/// </summary>
/// <param name="input"></param>
/// <returns></returns>
[HttpPost("/BookingOrderContact/edit")]
public async Task Update(UpdateBookingOrderContactInput input)
{
var entity = input.Adapt<BookingOrderContact>();
await _rep.AsUpdateable(entity).IgnoreColumns(ignoreAllNullColumns: true).ExecuteCommandAsync();
}
/// <summary>
/// 删除订舱关系人
/// </summary>
/// <param name="input"></param>
/// <returns></returns>
[HttpPost("/BookingOrderContact/delete")]
public async Task Delete(GetBookingOrderContactInput input)
{
var entity = await _rep.FirstOrDefaultAsync(u => u.Id == input.Id);
await _rep.DeleteAsync(entity);
}
/// <summary>
/// 获取订舱关系人
/// </summary>
/// <param name="input"></param>
/// <returns></returns>
[HttpGet("/BookingOrderContact/detail")]
public async Task<BookingOrderContact> Get([FromQuery] GetBookingOrderContactInput input)
{
return await _rep.FirstOrDefaultAsync(u => u.Id == input.Id);
}
/// <summary>
/// 根据订舱ID获取关系人
/// </summary>
/// <param name="bookingId"></param>
/// <returns></returns>
[HttpGet("/BookingOrderContact/listbyorder")]
public async Task<List<BookingOrderContactOutput>> ListByOrder(long bookingId)
{
var list = await _rep.Where(x => x.BookingId == bookingId).ToListAsync();
return list.Adapt<List<BookingOrderContactOutput>>();
}
/// <summary>
/// 批量保存关系人(同时新增、删除、修改)
/// </summary>
/// <param name="input"></param>
/// <returns></returns>
[HttpPost("/BookingOrderContact/savebatch"), SqlSugarUnitOfWork]
public async Task SaveBatch(List<UpdateBookingOrderContactInput> input)
{
var bookingId = input.First().BookingId;
_rep.Delete(x => x.BookingId == bookingId);
foreach (var item in input)
{
await _rep.InsertAsync(item.Adapt<BookingOrderContact>());
}
}
///// <summary>
///// 获取订舱关系人列表
///// </summary>
///// <param name="input"></param>
///// <returns></returns>
//[HttpGet("/BookingOrderContact/list")]
//public async Task<dynamic> List([FromQuery] QueryBookingOrderContactInput input)
//{
// return await _rep.ToListAsync();
//}
}
}

@ -0,0 +1,57 @@
using System;
using Myshipping.Core;
namespace Myshipping.Application
{
/// <summary>
/// 订舱关系人输出参数
/// </summary>
public class BookingOrderContactDto
{
/// <summary>
/// 主键
/// </summary>
public long? Id { get; set; }
/// <summary>
/// 订舱Id
/// </summary>
public long? BookingId { get; set; }
/// <summary>
/// 角色代码
/// </summary>
public string RoleCode { get; set; }
/// <summary>
/// 名称
/// </summary>
public string Name { get; set; }
/// <summary>
/// 电话
/// </summary>
public string Tel { get; set; }
/// <summary>
/// 邮箱
/// </summary>
public string Email { get; set; }
/// <summary>
/// 排序号
/// </summary>
public int? Sort { get; set; }
/// <summary>
/// 备注
/// </summary>
public string Remark { get; set; }
/// <summary>
/// 租户ID
/// </summary>
public long? TenantId { get; set; }
}
}

@ -0,0 +1,136 @@
using Myshipping.Core;
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
namespace Myshipping.Application
{
/// <summary>
/// 订舱关系人输入参数
/// </summary>
public class BookingOrderContactInput
{
/// <summary>
/// 订舱Id
/// </summary>
public virtual long BookingId { get; set; }
/// <summary>
/// 角色代码
/// </summary>
public virtual string RoleCode { get; set; }
/// <summary>
/// 名称
/// </summary>
public virtual string Name { get; set; }
/// <summary>
/// 电话
/// </summary>
public virtual string Tel { get; set; }
/// <summary>
/// 邮箱
/// </summary>
public virtual string Email { get; set; }
/// <summary>
/// 排序号
/// </summary>
public virtual int Sort { get; set; }
/// <summary>
/// 备注
/// </summary>
public virtual string Remark { get; set; }
}
/// <summary>
/// 订舱关系人新增输入参数
/// </summary>
public class AddBookingOrderContactInput : BookingOrderContactInput
{
}
/// <summary>
/// 订舱关系人修改输入参数
/// </summary>
public class UpdateBookingOrderContactInput : BookingOrderContactInput
{
/// <summary>
/// 主键
/// </summary>
[Required(ErrorMessage = "主键不能为空")]
public long Id { get; set; }
}
/// <summary>
/// 订舱关系人获取(删除)输入参数
/// </summary>
public class GetBookingOrderContactInput
{
/// <summary>
/// 主键
/// </summary>
[Required(ErrorMessage = "主键不能为空")]
public long Id { get; set; }
}
/// <summary>
/// 订舱关系人查询输入参数
/// </summary>
public class QueryBookingOrderContactInput : PageInputBase
{
/// <summary>
/// 主键
/// </summary>
public virtual long Id { get; set; }
/// <summary>
/// 订舱Id
/// </summary>
public virtual long BookingId { get; set; }
/// <summary>
/// 角色代码
/// </summary>
public virtual string RoleCode { get; set; }
/// <summary>
/// 名称
/// </summary>
public virtual string Name { get; set; }
/// <summary>
/// 电话
/// </summary>
public virtual string Tel { get; set; }
/// <summary>
/// 邮箱
/// </summary>
public virtual string Email { get; set; }
/// <summary>
/// 排序号
/// </summary>
public virtual int Sort { get; set; }
/// <summary>
/// 备注
/// </summary>
public virtual string Remark { get; set; }
/// <summary>
/// 租户ID
/// </summary>
public virtual long TenantId { get; set; }
}
}

@ -0,0 +1,52 @@
using System;
namespace Myshipping.Application
{
/// <summary>
/// 订舱关系人输出参数
/// </summary>
public class BookingOrderContactOutput
{
/// <summary>
/// 主键
/// </summary>
public long Id { get; set; }
/// <summary>
/// 订舱Id
/// </summary>
public long BookingId { get; set; }
/// <summary>
/// 角色代码
/// </summary>
public string RoleCode { get; set; }
/// <summary>
/// 名称
/// </summary>
public string Name { get; set; }
/// <summary>
/// 电话
/// </summary>
public string Tel { get; set; }
/// <summary>
/// 邮箱
/// </summary>
public string Email { get; set; }
/// <summary>
/// 排序号
/// </summary>
public int Sort { get; set; }
/// <summary>
/// 备注
/// </summary>
public string Remark { get; set; }
}
}

@ -0,0 +1,16 @@
using Myshipping.Core;
using Microsoft.AspNetCore.Mvc;
using System.Threading.Tasks;
using Myshipping.Application.Entity;
namespace Myshipping.Application
{
public interface IBookingOrderContactService
{
Task<dynamic> Page([FromQuery] QueryBookingOrderContactInput input);
Task Add(AddBookingOrderContactInput input);
Task Update(UpdateBookingOrderContactInput input);
Task Delete(GetBookingOrderContactInput input);
Task<BookingOrderContact> Get([FromQuery] GetBookingOrderContactInput input);
//Task<dynamic> List([FromQuery] QueryBookingOrderContactInput input);
}
}

@ -8285,6 +8285,13 @@
<param name="input"></param>
<returns></returns>
</member>
<member name="M:Myshipping.Core.Service.DjyCustomerService.ListContact(System.Int64)">
<summary>
根据客户id获取所有联系人
</summary>
<param name="customerId"></param>
<returns></returns>
</member>
<member name="T:Myshipping.Core.Service.DjyCustomerContactDto">
<summary>
订舱客户联系人输出参数

@ -144,6 +144,18 @@ namespace Myshipping.Core.Service
return custOut;
}
/// <summary>
/// 根据客户id获取所有联系人
/// </summary>
/// <param name="customerId"></param>
/// <returns></returns>
[HttpGet("/DjyCustomer/contacts")]
public async Task<List<DjyCustomerContactOutput>> ListContact(long customerId)
{
var list = await _repContact.Where(x => x.CustomerId == customerId).OrderBy(x => x.Sort).ToListAsync();
return list.Adapt<List<DjyCustomerContactOutput>>();
}
///// <summary>
///// 获取客户列表
///// </summary>
@ -154,5 +166,8 @@ namespace Myshipping.Core.Service
//{
// return await _rep.ToListAsync();
//}
}
}

@ -2,6 +2,8 @@
using Microsoft.AspNetCore.Mvc;
using System.Threading.Tasks;
using Myshipping.Core.Entity;
using System.Collections.Generic;
namespace Myshipping.Core.Service
{
public interface IDjyCustomerService
@ -12,5 +14,6 @@ namespace Myshipping.Core.Service
Task Delete(GetDjyCustomerInput input);
Task<DjyCustomerOutput> Detail([FromQuery] GetDjyCustomerInput input);
//Task<dynamic> List([FromQuery] QueryBookingCustomerInput input);
Task<List<DjyCustomerContactOutput>> ListContact(long customerId);
}
}

Loading…
Cancel
Save