From 4a9a425651eb5dee4d63c8cb5e788391dc33e135 Mon Sep 17 00:00:00 2001
From: wet <1034391973@qq.com>
Date: Thu, 29 Dec 2022 11:38:12 +0800
Subject: [PATCH] =?UTF-8?q?=E6=89=93=E5=8D=B0?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../Entity/BookingExcelTemplate.cs | 26 ++++++
.../Entity/BookingExcelTemplateSub.cs | 36 ++++++++
.../Myshipping.Application.csproj | 5 ++
.../Myshipping.Application.xml | 41 +++++++++
.../BookingOrder/BookingOrderService.cs | 3 +
.../BookingPrintTemplateService.cs | 2 +-
.../BookingTemplate/BookingTemplateService.cs | 89 +++++++++++++++----
.../Dto/BookingExcelTemplateDto.cs | 29 ++++++
8 files changed, 214 insertions(+), 17 deletions(-)
create mode 100644 Myshipping.Application/Entity/BookingExcelTemplate.cs
create mode 100644 Myshipping.Application/Entity/BookingExcelTemplateSub.cs
create mode 100644 Myshipping.Application/Service/BookingTemplate/Dto/BookingExcelTemplateDto.cs
diff --git a/Myshipping.Application/Entity/BookingExcelTemplate.cs b/Myshipping.Application/Entity/BookingExcelTemplate.cs
new file mode 100644
index 00000000..153e1d7a
--- /dev/null
+++ b/Myshipping.Application/Entity/BookingExcelTemplate.cs
@@ -0,0 +1,26 @@
+using System;
+using SqlSugar;
+using System.ComponentModel;
+using Myshipping.Core.Entity;
+namespace Myshipping.Application.Entity
+{
+ ///
+ /// EXCEl打印模板
+ ///
+ [SugarTable("booking_exceltemplate")]
+ [Description("EXCEl打印模板")]
+ public class BookingExcelTemplate : DBEntityTenant
+ {
+
+ ///
+ /// 模板名称
+ ///
+ public string Name { get; set; }
+
+ ///
+ /// 分类
+ ///
+ public string Type { get; set; }
+
+ }
+}
\ No newline at end of file
diff --git a/Myshipping.Application/Entity/BookingExcelTemplateSub.cs b/Myshipping.Application/Entity/BookingExcelTemplateSub.cs
new file mode 100644
index 00000000..248d8305
--- /dev/null
+++ b/Myshipping.Application/Entity/BookingExcelTemplateSub.cs
@@ -0,0 +1,36 @@
+using System;
+using SqlSugar;
+using System.ComponentModel;
+using Myshipping.Core.Entity;
+namespace Myshipping.Application.Entity
+{
+ ///
+ /// 订舱状态
+ ///
+ [SugarTable("booking_exceltemplate_sub")]
+ [Description("EXCEL模板明细")]
+ public class BookingExcelTemplateSub : PrimaryKeyEntity
+ {
+ ///
+ /// 父键
+ ///
+ public long? Pid { get; set; }
+ ///
+ /// 字段名称
+ ///
+ public string Field { get; set; }
+ ///
+ /// 行
+ ///
+ public int Row { get; set; }
+ ///
+ /// 列
+ ///
+ public int Column { get; set; }
+
+ ///
+ /// 默认内容
+ ///
+ public string Describe { get; set; }
+ }
+}
\ No newline at end of file
diff --git a/Myshipping.Application/Myshipping.Application.csproj b/Myshipping.Application/Myshipping.Application.csproj
index a22ccd2b..9e56b9d2 100644
--- a/Myshipping.Application/Myshipping.Application.csproj
+++ b/Myshipping.Application/Myshipping.Application.csproj
@@ -30,6 +30,11 @@
+
+
+
+
+
diff --git a/Myshipping.Application/Myshipping.Application.xml b/Myshipping.Application/Myshipping.Application.xml
index 584e0ce5..a67cd1e8 100644
--- a/Myshipping.Application/Myshipping.Application.xml
+++ b/Myshipping.Application/Myshipping.Application.xml
@@ -9280,6 +9280,12 @@
+
+
+ 下拉获取字段名称
+
+
+
订舱模板输入参数
@@ -11193,6 +11199,41 @@
称重方式
+
+
+ 用户任务统计展示
+
+
+
+
+ 级别分层(1-异常/个人/公共 2-待处理/已完成/已取消/已挂起 3-按照任务类型展示)
+
+
+
+
+ 排序值
+
+
+
+
+ 展示代码
+
+
+
+
+ 展示名称
+
+
+
+
+ 记录条数
+
+
+
+
+ 执行KEY
+
+
diff --git a/Myshipping.Application/Service/BookingOrder/BookingOrderService.cs b/Myshipping.Application/Service/BookingOrder/BookingOrderService.cs
index c415fb2d..cdbd8ffe 100644
--- a/Myshipping.Application/Service/BookingOrder/BookingOrderService.cs
+++ b/Myshipping.Application/Service/BookingOrder/BookingOrderService.cs
@@ -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,
diff --git a/Myshipping.Application/Service/BookingPrintTemplate/BookingPrintTemplateService.cs b/Myshipping.Application/Service/BookingPrintTemplate/BookingPrintTemplateService.cs
index 694554d2..cd0f0835 100644
--- a/Myshipping.Application/Service/BookingPrintTemplate/BookingPrintTemplateService.cs
+++ b/Myshipping.Application/Service/BookingPrintTemplate/BookingPrintTemplateService.cs
@@ -289,7 +289,7 @@ namespace Myshipping.Application
public async Task GetPrinttemplateRightList(long userId)
{
var list = await _repRight.AsQueryable().InnerJoin((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,
diff --git a/Myshipping.Application/Service/BookingTemplate/BookingTemplateService.cs b/Myshipping.Application/Service/BookingTemplate/BookingTemplateService.cs
index b951c3e2..c21c821b 100644
--- a/Myshipping.Application/Service/BookingTemplate/BookingTemplateService.cs
+++ b/Myshipping.Application/Service/BookingTemplate/BookingTemplateService.cs
@@ -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 _rep;
+ private readonly SqlSugarRepository _repOrder;
+ private readonly SqlSugarRepository _excelrep;
+ private readonly SqlSugarRepository _excelsubrep;
private readonly ILogger _logger;
- public BookingTemplateService(SqlSugarRepository rep, ILogger logger)
+ public BookingTemplateService(SqlSugarRepository rep, SqlSugarRepository repOrder, SqlSugarRepository excelrep, SqlSugarRepository excelsubrep, ILogger logger)
{
+ _excelrep = excelrep;
+ _excelsubrep = excelsubrep;
+ _repOrder = repOrder;
_rep = rep;
_logger = logger;
}
@@ -36,11 +45,11 @@ namespace Myshipping.Application
[HttpGet("/BookingTemplate/page")]
public async Task 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);
}
+ ///
+ /// 下拉获取字段名称
+ ///
+ ///
+ [HttpGet("/BookingTemplate/GetFieldName")]
+ public async Task GetFieldName()
+ {
+ BookingOrder order = new BookingOrder();
+ Dictionary dic = new Dictionary();
+ 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;
+ }
+ ///
+ /// 新增编辑excel模板
+ ///
+ ///
+ ///
+ [HttpGet("/BookingTemplate/GetFieldName")]
+ public async Task 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;
+ }
+
+
+
+
+
+
- /////
- ///// 获取订舱模板列表
- /////
- /////
- /////
- //[HttpGet("/BookingTemplate/list")]
- //public async Task List([FromQuery] QueryBookingTemplateInput input)
- //{
- // return await _rep.ToListAsync();
- //}
}
}
diff --git a/Myshipping.Application/Service/BookingTemplate/Dto/BookingExcelTemplateDto.cs b/Myshipping.Application/Service/BookingTemplate/Dto/BookingExcelTemplateDto.cs
new file mode 100644
index 00000000..82c0fb52
--- /dev/null
+++ b/Myshipping.Application/Service/BookingTemplate/Dto/BookingExcelTemplateDto.cs
@@ -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
+ {
+ ///
+ /// 业务id
+ ///
+ public long Id { get; set; }
+ ///
+ /// 模板名称
+ ///
+ public string Name { get; set; }
+
+ ///
+ /// 分类
+ ///
+ public string Type { get; set; }
+
+
+ public List children { get; set; }
+ }
+}