wanghaomei 2 years ago
commit 9bd70346c1

@ -9923,6 +9923,101 @@
修改者名称
</summary>
</member>
<member name="T:Myshipping.Application.QueryParaGoodsDto">
<summary>
品名参数台账查询
</summary>
</member>
<member name="P:Myshipping.Application.QueryParaGoodsDto.GoodsCode">
<summary>
品名编码
</summary>
<example></example>
</member>
<member name="P:Myshipping.Application.QueryParaGoodsDto.GoodsNameCN">
<summary>
品名中文
</summary>
<example></example>
</member>
<member name="P:Myshipping.Application.QueryParaGoodsDto.GoodsNameEN">
<summary>
品名英文
</summary>
<example></example>
</member>
<member name="P:Myshipping.Application.QueryParaGoodsDto.GoodsDesp">
<summary>
品名描述
</summary>
<example></example>
</member>
<member name="P:Myshipping.Application.QueryParaGoodsDto.GoodsCategory">
<summary>
品名分类
</summary>
<example>02</example>
</member>
<member name="P:Myshipping.Application.QueryParaGoodsDto.CreateUserName">
<summary>
创建者名称
</summary>
<example></example>
</member>
<member name="P:Myshipping.Application.QueryParaGoodsDto.UpdateUserName">
<summary>
修改者名称
</summary>
<example></example>
</member>
<member name="P:Myshipping.Application.QueryParaGoodsDto.CreateTimeBegin">
<summary>
创建时间开始
</summary>
<example>2022-01-01</example>
</member>
<member name="P:Myshipping.Application.QueryParaGoodsDto.CreateTimeEnd">
<summary>
创建时间结束
</summary>
<example>2023-07-01</example>
</member>
<member name="P:Myshipping.Application.QueryParaGoodsDto.UpdateTimeBegin">
<summary>
更新时间开始
</summary>
<example></example>
</member>
<member name="P:Myshipping.Application.QueryParaGoodsDto.UpdateTimeEnd">
<summary>
更新时间结束
</summary>
<example></example>
</member>
<member name="P:Myshipping.Application.QueryParaGoodsDto.PageNo">
<summary>
当前页码
</summary>
<example>1</example>
</member>
<member name="P:Myshipping.Application.QueryParaGoodsDto.PageSize">
<summary>
页码容量
</summary>
<example>20</example>
</member>
<member name="P:Myshipping.Application.QueryParaGoodsDto.SortField">
<summary>
排序字段
</summary>
<example>GoodsCode</example>
</member>
<member name="P:Myshipping.Application.QueryParaGoodsDto.descSort">
<summary>
排序方法,默认降序
</summary>
<example>true</example>
</member>
<member name="M:Myshipping.Application.IParaService.SaveParaGoodsInfo(Myshipping.Application.ParaGoodsDto)">
<summary>
保存品名参数
@ -9951,9 +10046,16 @@
<param name="queryItem">检索值</param>
<returns>返回回执</returns>
</member>
<member name="M:Myshipping.Application.IParaService.GetParaGoodsPageAsync(Myshipping.Application.QueryParaGoodsDto)">
<summary>
品名参数台账查询
</summary>
<param name="QuerySearch">品名参数台账查询请求</param>
<returns>返回结果</returns>
</member>
<member name="T:Myshipping.Application.ParaService">
<summary>
订舱业务参数
</summary>
</member>
<member name="M:Myshipping.Application.ParaService.SaveParaGoodsInfo(Myshipping.Application.ParaGoodsDto)">
@ -9985,6 +10087,13 @@
<param name="top">默认最大行数</param>
<returns>返回回执</returns>
</member>
<member name="M:Myshipping.Application.ParaService.GetParaGoodsPageAsync(Myshipping.Application.QueryParaGoodsDto)">
<summary>
品名参数台账查询
</summary>
<param name="QuerySearch">品名参数台账查询请求</param>
<returns>返回结果</returns>
</member>
<member name="P:Myshipping.Application.RulesEngineOrderBookingContaCargoInfo.PKGs">
<summary>
件数

@ -0,0 +1,104 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Myshipping.Application
{
/// <summary>
/// 品名参数台账查询
/// </summary>
public class QueryParaGoodsDto
{
/// <summary>
/// 品名编码
/// </summary>
/// <example></example>
public string GoodsCode { get; set; }
/// <summary>
/// 品名中文
/// </summary>
/// <example></example>
public string GoodsNameCN { get; set; }
/// <summary>
/// 品名英文
/// </summary>
/// <example></example>
public string GoodsNameEN { get; set; }
/// <summary>
/// 品名描述
/// </summary>
/// <example></example>
public string GoodsDesp { get; set; }
/// <summary>
/// 品名分类
/// </summary>
/// <example>02</example>
public string GoodsCategory { get; set; }
/// <summary>
/// 创建者名称
/// </summary>
/// <example></example>
public string CreateUserName { get; set; }
/// <summary>
/// 修改者名称
/// </summary>
/// <example></example>
public string UpdateUserName { get; set; }
/// <summary>
/// 创建时间开始
/// </summary>
/// <example>2022-01-01</example>
public string CreateTimeBegin { get; set; }
/// <summary>
/// 创建时间结束
/// </summary>
/// <example>2023-07-01</example>
public string CreateTimeEnd { get; set; }
/// <summary>
/// 更新时间开始
/// </summary>
/// <example></example>
public string UpdateTimeBegin { get; set; }
/// <summary>
/// 更新时间结束
/// </summary>
/// <example></example>
public string UpdateTimeEnd { get; set; }
/// <summary>
/// 当前页码
/// </summary>
/// <example>1</example>
public int PageNo { get; set; } = 1;
/// <summary>
/// 页码容量
/// </summary>
/// <example>20</example>
public int PageSize { get; set; } = 20;
/// <summary>
/// 排序字段
/// </summary>
/// <example>GoodsCode</example>
public string SortField { get; set; }
/// <summary>
/// 排序方法,默认降序
/// </summary>
/// <example>true</example>
public bool descSort { get; set; } = true;
}
}

@ -36,6 +36,13 @@ namespace Myshipping.Application
/// <returns>返回回执</returns>
Task<List<ParaGoodsDto>> QueryParaGoodsInfo(string queryItem, int top = 10);
/// <summary>
/// 品名参数台账查询
/// </summary>
/// <param name="QuerySearch">品名参数台账查询请求</param>
/// <returns>返回结果</returns>
Task<dynamic> GetParaGoodsPageAsync(QueryParaGoodsDto QuerySearch);
///// <summary>
///// 保存品名分类参数
///// </summary>

@ -5,6 +5,7 @@ using Mapster;
using Microsoft.AspNetCore.Mvc;
using Microsoft.Extensions.Logging;
using Myshipping.Application.Entity;
using Myshipping.Application.Helper;
using Myshipping.Core;
using NPOI.OpenXmlFormats.Wordprocessing;
using NPOI.SS.Formula.Functions;
@ -17,7 +18,7 @@ using System.Threading.Tasks;
namespace Myshipping.Application
{
/// <summary>
///
/// 订舱业务参数
/// </summary>
[ApiDescriptionSettings("Application", Name = "Para", Order = 10)]
public class ParaService : IParaService, IDynamicApiController
@ -222,6 +223,78 @@ namespace Myshipping.Application
return list;
}
/// <summary>
/// 品名参数台账查询
/// </summary>
/// <param name="QuerySearch">品名参数台账查询请求</param>
/// <returns>返回结果</returns>
[HttpPost("/Para/GetParaGoodsPage")]
public async Task<dynamic> GetParaGoodsPageAsync(QueryParaGoodsDto QuerySearch)
{
DateTime createBegin = DateTime.MinValue;
DateTime createEnd = DateTime.MinValue;
DateTime updateBegin = DateTime.MinValue;
DateTime updateEnd = DateTime.MinValue;
if (!string.IsNullOrWhiteSpace(QuerySearch.CreateTimeBegin))
{
if (!DateTime.TryParse(QuerySearch.CreateTimeBegin, out createBegin))
throw Oops.Oh($"创建开始日期格式错误,{QuerySearch.CreateTimeBegin}");
}
if (!string.IsNullOrWhiteSpace(QuerySearch.CreateTimeEnd))
{
if (!DateTime.TryParse(QuerySearch.CreateTimeEnd, out createEnd))
throw Oops.Oh($"创建结束日期格式错误,{QuerySearch.CreateTimeEnd}");
createEnd = createEnd.AddDays(1);
}
if (!string.IsNullOrWhiteSpace(QuerySearch.UpdateTimeBegin))
{
if (!DateTime.TryParse(QuerySearch.UpdateTimeBegin, out updateBegin))
throw Oops.Oh($"更新起始日期格式错误,{QuerySearch.UpdateTimeBegin}");
}
if (!string.IsNullOrWhiteSpace(QuerySearch.UpdateTimeEnd))
{
if (!DateTime.TryParse(QuerySearch.UpdateTimeEnd, out updateEnd))
throw Oops.Oh($"更新结束日期格式错误,{QuerySearch.UpdateTimeEnd}");
updateEnd = updateEnd.AddDays(1);
}
string entityOrderCol = "CreatedTime";
//这里因为返回给前端的台账数据是DTO所以这里排序时候需要转换成Entity对应的字段
if (!string.IsNullOrWhiteSpace(QuerySearch.SortField))
entityOrderCol = MapsterExtHelper.GetAdaptProperty<ParaGoodsDto, ParaGoodsInfo>(QuerySearch.SortField);
var entities = await _paraGoodsInfoRepository.AsQueryable().Filter(null, true)
.WhereIF(!string.IsNullOrWhiteSpace(QuerySearch.GoodsCode), t => t.GOODS_CODE.Contains(QuerySearch.GoodsCode.Trim(), StringComparison.OrdinalIgnoreCase))
.WhereIF(!string.IsNullOrWhiteSpace(QuerySearch.GoodsNameCN), t => t.GOODS_NAME_CN.Contains(QuerySearch.GoodsNameCN.Trim(), StringComparison.OrdinalIgnoreCase))
.WhereIF(createBegin != DateTime.MinValue, t => t.CreatedTime.HasValue && t.CreatedTime.Value >= createBegin)
.WhereIF(createEnd != DateTime.MinValue, t => t.CreatedTime.HasValue && t.CreatedTime.Value < createEnd)
.WhereIF(updateBegin != DateTime.MinValue, t => t.UpdatedTime.HasValue && t.UpdatedTime.Value >= updateBegin)
.WhereIF(updateEnd != DateTime.MinValue, t => t.UpdatedTime.HasValue && t.UpdatedTime.Value < updateEnd)
.WhereIF(!string.IsNullOrWhiteSpace(QuerySearch.GoodsDesp), t => t.GOODS_DESP.Contains(QuerySearch.GoodsDesp.Trim(), StringComparison.OrdinalIgnoreCase))
.WhereIF(!string.IsNullOrWhiteSpace(QuerySearch.GoodsNameEN), t => t.GOODS_NAME_EN.Contains(QuerySearch.GoodsNameEN.Trim(), StringComparison.OrdinalIgnoreCase))
.WhereIF(!string.IsNullOrWhiteSpace(QuerySearch.GoodsCategory), t => t.GOODS_CATEGORY.Equals(QuerySearch.GoodsCategory.Trim(), StringComparison.OrdinalIgnoreCase))
.WhereIF(!string.IsNullOrWhiteSpace(QuerySearch.CreateUserName), t => t.GOODS_NAME_EN.Contains(QuerySearch.CreateUserName.Trim(), StringComparison.OrdinalIgnoreCase))
.WhereIF(!string.IsNullOrWhiteSpace(QuerySearch.UpdateUserName), t => t.GOODS_NAME_EN.Contains(QuerySearch.UpdateUserName.Trim(), StringComparison.OrdinalIgnoreCase))
.OrderBy(entityOrderCol + (QuerySearch.descSort ? " asc " : " desc "))
.ToPagedListAsync(QuerySearch.PageNo, QuerySearch.PageSize);
return new
{
PageNo = entities.PageIndex,
PageSize = entities.PageSize,
TotalPage = entities.TotalPages,
TotalRows = entities.TotalCount,
Rows = entities.Items.Select(t => t.Adapt<ParaGoodsDto>()).ToList()
};
}
///// <summary>
///// 保存品名分类参数
///// </summary>

Loading…
Cancel
Save