optimize
wet 2 years ago
parent 04cba339c3
commit 4a9a425651

@ -0,0 +1,26 @@
using System;
using SqlSugar;
using System.ComponentModel;
using Myshipping.Core.Entity;
namespace Myshipping.Application.Entity
{
/// <summary>
/// EXCEl打印模板
/// </summary>
[SugarTable("booking_exceltemplate")]
[Description("EXCEl打印模板")]
public class BookingExcelTemplate : DBEntityTenant
{
/// <summary>
/// 模板名称
/// </summary>
public string Name { get; set; }
/// <summary>
/// 分类
/// </summary>
public string Type { get; set; }
}
}

@ -0,0 +1,36 @@
using System;
using SqlSugar;
using System.ComponentModel;
using Myshipping.Core.Entity;
namespace Myshipping.Application.Entity
{
/// <summary>
/// 订舱状态
/// </summary>
[SugarTable("booking_exceltemplate_sub")]
[Description("EXCEL模板明细")]
public class BookingExcelTemplateSub : PrimaryKeyEntity
{
/// <summary>
/// 父键
/// </summary>
public long? Pid { get; set; }
/// <summary>
/// 字段名称
/// </summary>
public string Field { get; set; }
/// <summary>
/// 行
/// </summary>
public int Row { get; set; }
/// <summary>
/// 列
/// </summary>
public int Column { get; set; }
/// <summary>
/// 默认内容
/// </summary>
public string Describe { get; set; }
}
}

@ -30,6 +30,11 @@
</Content>
</ItemGroup>
<ItemGroup>
<PackageReference Include="NPOI" Version="2.6.0" />
<PackageReference Include="Npoi.Mapper" Version="4.1.0" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\Myshipping.Core\Myshipping.Core.csproj" />
</ItemGroup>

@ -9280,6 +9280,12 @@
<param name="input"></param>
<returns></returns>
</member>
<member name="M:Myshipping.Application.BookingTemplateService.GetFieldName">
<summary>
下拉获取字段名称
</summary>
<returns></returns>
</member>
<member name="T:Myshipping.Application.BookingTemplateInput">
<summary>
订舱模板输入参数
@ -11193,6 +11199,41 @@
称重方式
</summary>
</member>
<member name="T:Myshipping.Application.TaskUserStatItem">
<summary>
用户任务统计展示
</summary>
</member>
<member name="P:Myshipping.Application.TaskUserStatItem.Level">
<summary>
级别分层1-异常/个人/公共 2-待处理/已完成/已取消/已挂起 3-按照任务类型展示)
</summary>
</member>
<member name="P:Myshipping.Application.TaskUserStatItem.SortNo">
<summary>
排序值
</summary>
</member>
<member name="P:Myshipping.Application.TaskUserStatItem.Key">
<summary>
展示代码
</summary>
</member>
<member name="P:Myshipping.Application.TaskUserStatItem.Name">
<summary>
展示名称
</summary>
</member>
<member name="P:Myshipping.Application.TaskUserStatItem.Total">
<summary>
记录条数
</summary>
</member>
<member name="P:Myshipping.Application.TaskUserStatItem.ActionKey">
<summary>
执行KEY
</summary>
</member>
<member name="T:Myshipping.Application.ITaskManageService">
<summary>

@ -931,6 +931,9 @@ namespace Myshipping.Application
}
_logger.LogInformation("调用运踪接口提单号:" + item.MBLNO + " 调用运踪接口");
if (item.isBook&&(string.IsNullOrWhiteSpace(item.CARRIERID)|| string.IsNullOrWhiteSpace(item.CARRIER) || string.IsNullOrWhiteSpace(item.MBLNO))) {
throw Oops.Bah("订阅目的港船公司或提单号不能为空!");
}
billTraceList.Add(new BillTraceList
{
BusinessId = item.BusinessId,

@ -289,7 +289,7 @@ namespace Myshipping.Application
public async Task<dynamic> GetPrinttemplateRightList(long userId)
{
var list = await _repRight.AsQueryable().InnerJoin<BookingPrintTemplate>((d, t) => d.PrintTemplateId == t.Id && t.TenantId == UserManager.TENANT_ID).
WhereIF(userId != 0, x => x.SysUserId == userId).
WhereIF(userId != 0, d => d.SysUserId == userId).
Select((d, t) => new
{
TypeCode = t.TypeCode,

@ -10,6 +10,9 @@ using Myshipping.Application.Entity;
using Microsoft.Extensions.Logging;
using Furion.FriendlyException;
using Myshipping.Application.Enum;
using System.ComponentModel;
using System.Collections.Generic;
using Myshipping.Application.Service.BookingTemplate.Dto;
namespace Myshipping.Application
{
@ -20,10 +23,16 @@ namespace Myshipping.Application
public class BookingTemplateService : IBookingTemplateService, IDynamicApiController, ITransient
{
private readonly SqlSugarRepository<BookingTemplate> _rep;
private readonly SqlSugarRepository<BookingOrder> _repOrder;
private readonly SqlSugarRepository<BookingExcelTemplate> _excelrep;
private readonly SqlSugarRepository<BookingExcelTemplateSub> _excelsubrep;
private readonly ILogger<BookingTemplate> _logger;
public BookingTemplateService(SqlSugarRepository<BookingTemplate> rep, ILogger<BookingTemplate> logger)
public BookingTemplateService(SqlSugarRepository<BookingTemplate> rep, SqlSugarRepository<BookingOrder> repOrder, SqlSugarRepository<BookingExcelTemplate> excelrep, SqlSugarRepository<BookingExcelTemplateSub> excelsubrep, ILogger<BookingTemplate> logger)
{
_excelrep = excelrep;
_excelsubrep = excelsubrep;
_repOrder = repOrder;
_rep = rep;
_logger = logger;
}
@ -36,11 +45,11 @@ namespace Myshipping.Application
[HttpGet("/BookingTemplate/page")]
public async Task<dynamic> Page([FromQuery] QueryBookingTemplateInput input)
{
var entities = await _rep.AsQueryable()
.Where(m => m.CreatedUserId == UserManager.UserId)
.WhereIF(!string.IsNullOrEmpty(input.Title), u => u.Title.Contains(input.Title))
.WhereIF(!string.IsNullOrEmpty(input.Type), u =>u.Type.Contains(input.Type))
.ToPagedListAsync(input.PageNo, input.PageSize);
var entities = await _rep.AsQueryable()
.Where(m => m.CreatedUserId == UserManager.UserId)
.WhereIF(!string.IsNullOrEmpty(input.Title), u => u.Title.Contains(input.Title))
.WhereIF(!string.IsNullOrEmpty(input.Type), u => u.Type.Contains(input.Type))
.ToPagedListAsync(input.PageNo, input.PageSize);
return entities.XnPagedResult();
}
@ -103,16 +112,64 @@ namespace Myshipping.Application
{
return await _rep.FirstOrDefaultAsync(u => u.Id == input.Id);
}
/// <summary>
/// 下拉获取字段名称
/// </summary>
/// <returns></returns>
[HttpGet("/BookingTemplate/GetFieldName")]
public async Task<dynamic> GetFieldName()
{
BookingOrder order = new BookingOrder();
Dictionary<string, string> dic = new Dictionary<string, string>();
foreach (PropertyDescriptor descriptor in TypeDescriptor.GetProperties(order))
{
string name = descriptor.Name;
if (name == "TenantId" || name == "CreatedTime" || name == "UpdatedTime" || name == "CreatedUserId" || name == "CreatedUserName")
{
continue;
}
if (!string.IsNullOrWhiteSpace(descriptor.Description))
{
dic.Add(descriptor.Name, descriptor.Description);
}
}
return dic;
}
/// <summary>
/// 新增编辑excel模板
/// </summary>
/// <param name="dto"></param>
/// <returns></returns>
[HttpGet("/BookingTemplate/GetFieldName")]
public async Task<dynamic> AddOrUpdateExcelTemplate(BookingExcelTemplateDto dto) {
if (dto.Id == 0)
{
BookingExcelTemplate bookingExcel = new BookingExcelTemplate();
bookingExcel.Name = dto.Name;
bookingExcel.Type = dto.Type;
await _excelrep.InsertAsync(bookingExcel);
}
else {
}
return null;
}
///// <summary>
///// 获取订舱模板列表
///// </summary>
///// <param name="input"></param>
///// <returns></returns>
//[HttpGet("/BookingTemplate/list")]
//public async Task<dynamic> List([FromQuery] QueryBookingTemplateInput input)
//{
// return await _rep.ToListAsync();
//}
}
}

@ -0,0 +1,29 @@
using Myshipping.Application.Entity;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Myshipping.Application.Service.BookingTemplate.Dto
{
public class BookingExcelTemplateDto
{
/// <summary>
/// 业务id
/// </summary>
public long Id { get; set; }
/// <summary>
/// 模板名称
/// </summary>
public string Name { get; set; }
/// <summary>
/// 分类
/// </summary>
public string Type { get; set; }
public List<BookingExcelTemplateSub> children { get; set; }
}
}
Loading…
Cancel
Save