修改约号管理

optimize
jianghaiqing 1 year ago
parent 0425e5f362
commit 2e2d3c8d20

@ -30,5 +30,20 @@ namespace Myshipping.Application
/// 合约号备注
/// </summary>
public string CONTRACT_NOTE { get; set; }
/// <summary>
/// 航线代码
/// </summary>
public string LANE_CODE { get; set; }
/// <summary>
/// 目的港代码
/// </summary>
public string POD_CODE { get; set; }
/// <summary>
/// 船公司代码
/// </summary>
public string CARRIER_CODE { get; set; }
}
}

@ -31,6 +31,23 @@ namespace Myshipping.Application
/// </summary>
/// <example>测试1</example>
public string ContractNote { get; set; }
/// <summary>
/// 航线代码
/// </summary>
/// <example>测试1</example>
public string LaneCode { get; set; }
/// <summary>
/// 目的港代码
/// </summary>
/// <example>测试1</example>
public string PODCode { get; set; }
/// <summary>
/// 船公司代码
/// </summary>
public string CarrierCode { get; set;}
}

@ -75,7 +75,10 @@ namespace Myshipping.Application
.Map(dest => dest.Id, src => src.Id)
.Map(dest => dest.ContractNo, src => src.CONTRACT_NO)
.Map(dest => dest.ContractName, src => src.CONTRACT_NAME)
.Map(dest => dest.ContractNote, src => src.CONTRACT_NOTE);
.Map(dest => dest.ContractNote, src => src.CONTRACT_NOTE)
.Map(dest => dest.LaneCode, src => src.LANE_CODE)
.Map(dest => dest.PODCode, src => src.POD_CODE)
.Map(dest => dest.CarrierCode, src => src.CARRIER_CODE);
config.ForType<ParaContractNoInfo, ParaContractNoShowDto>()
.Map(dest => dest.Id, src => src.Id)
@ -87,14 +90,20 @@ namespace Myshipping.Application
.Map(dest => dest.CreateTime, src => src.CreatedTime)
.Map(dest => dest.UpdateUserId, src => src.UpdatedUserId)
.Map(dest => dest.UpdateUserName, src => src.UpdatedUserName)
.Map(dest => dest.UpdateTime, src => src.UpdatedTime.HasValue ? src.UpdatedTime.Value.ToString("yyyy-MM-dd HH:mm:ss") : "");
.Map(dest => dest.UpdateTime, src => src.UpdatedTime.HasValue ? src.UpdatedTime.Value.ToString("yyyy-MM-dd HH:mm:ss") : "")
.Map(dest => dest.LaneCode, src => src.LANE_CODE)
.Map(dest => dest.PODCode, src => src.POD_CODE)
.Map(dest => dest.CarrierCode, src => src.CARRIER_CODE);
config.ForType<ParaContractNoDto, ParaContractNoInfo>()
.Map(dest => dest.Id, src => !string.IsNullOrWhiteSpace(src.Id) ? long.Parse(src.Id) : 0)
.Map(dest => dest.CONTRACT_NO, src => src.ContractNo)
.Map(dest => dest.CONTRACT_NAME, src => src.ContractName)
.Map(dest => dest.CONTRACT_NOTE, src => src.ContractNote);
.Map(dest => dest.CONTRACT_NOTE, src => src.ContractNote)
.Map(dest => dest.LANE_CODE, src => src.LaneCode)
.Map(dest => dest.POD_CODE, src => src.PODCode)
.Map(dest => dest.CARRIER_CODE, src => src.CarrierCode);
}
}
}

@ -101,8 +101,12 @@ namespace Myshipping.Application
/// </summary>
/// <param name="queryItem">检索值</param>
/// <param name="top">默认最大行数</param>
/// <param name="carrier">船公司代码</param>
/// <param name="lane">航线代码</param>
/// <param name="pod">目的港代码</param>
/// <returns>返回回执</returns>
Task<List<ParaContractNoShowDto>> QuerytParaContractNoInfo(string queryItem, int top = 10);
Task<List<ParaContractNoShowDto>> QuerytParaContractNoInfo(string queryItem, int top = 10,
string carrier = "", string lane = "",string pod = "");
/// <summary>
/// 作废约号参数

@ -609,6 +609,8 @@ namespace Myshipping.Application
info.CONTRACT_NO = model.ContractNo?.Trim();
info.CONTRACT_NAME = model.ContractName?.Trim();
info.CONTRACT_NOTE = model.ContractNote?.Trim();
info.LANE_CODE = model.LaneCode?.Trim();
info.POD_CODE = model.PODCode?.Trim();
await _paraContractNoInfoRepository.AsUpdateable(info).IgnoreColumns(it => new
{
@ -671,14 +673,19 @@ namespace Myshipping.Application
/// </summary>
/// <param name="queryItem">检索值</param>
/// <param name="top">默认最大行数</param>
/// <param name="carrier">船公司代码</param>
/// <param name="lane">航线代码</param>
/// <param name="pod">目的港代码</param>
/// <returns>返回回执</returns>
[HttpGet("/Para/QuerytParaContractNoInfo")]
public async Task<List<ParaContractNoShowDto>> QuerytParaContractNoInfo([FromQuery] string queryItem, [FromQuery] int top = 10)
public async Task<List<ParaContractNoShowDto>> QuerytParaContractNoInfo([FromQuery] string queryItem, [FromQuery] int top = 10,
[FromQuery] string carrier = "", [FromQuery] string lane = "", [FromQuery] string pod = "")
{
List<ParaContractNoShowDto> list = new List<ParaContractNoShowDto>();
try
{
var query = _paraContractNoInfoRepository.AsQueryable();
if (!string.IsNullOrWhiteSpace(queryItem))
@ -690,6 +697,25 @@ namespace Myshipping.Application
);
}
if (!string.IsNullOrWhiteSpace(carrier))
{
query = query.Where(t => t.CARRIER_CODE.Equals(carrier));
}
else
{
throw Oops.Bah($"检索约号失败,船公司不能为空");
}
if (!string.IsNullOrWhiteSpace(lane))
{
query = query.Where(t => t.LANE_CODE.Contains(lane));
}
if (!string.IsNullOrWhiteSpace(pod))
{
query = query.Where(t => t.POD_CODE.Contains(pod));
}
query = query.OrderBy("CONTRACT_NO asc");
var currList = await query.Take(top).ToListAsync();

Loading…
Cancel
Save