From d849507d63f802921a076674d47fd08c67708df5 Mon Sep 17 00:00:00 2001 From: jianghaiqing Date: Mon, 26 Dec 2022 16:04:17 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E4=BB=BB=E5=8A=A1=E6=96=B9?= =?UTF-8?q?=E6=B3=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Entity/TaskManagePlat/TaskBaseInfo.cs | 5 + .../TaskManagePlat/TaskBillFeeDetailInfo.cs | 5 + .../Myshipping.Application.xml | 83 ++++++++++- .../TaskManagePlat/Dtos/TaskManageMapper.cs | 29 ++++ .../Dtos/TaskManageOrderFeeInfo.cs | 5 + .../Dtos/TaskManageOrderFileInfo.cs | 27 ++++ .../Dtos/TaskManageOrderMailInfo.cs | 19 +++ .../Dtos/TaskManageOrderMessageMainInfo.cs | 15 ++ .../Dtos/TaskManageOrderSIFeedBackInfo.cs | 13 +- .../Interface/ITaskManageService.cs | 7 + .../TaskManagePlat/TaskManageService.cs | 136 ++++++++++++++++++ 11 files changed, 342 insertions(+), 2 deletions(-) create mode 100644 Myshipping.Application/Service/TaskManagePlat/Dtos/TaskManageOrderFileInfo.cs create mode 100644 Myshipping.Application/Service/TaskManagePlat/Dtos/TaskManageOrderMailInfo.cs diff --git a/Myshipping.Application/Entity/TaskManagePlat/TaskBaseInfo.cs b/Myshipping.Application/Entity/TaskManagePlat/TaskBaseInfo.cs index a5867514..2ce5e0a1 100644 --- a/Myshipping.Application/Entity/TaskManagePlat/TaskBaseInfo.cs +++ b/Myshipping.Application/Entity/TaskManagePlat/TaskBaseInfo.cs @@ -101,5 +101,10 @@ namespace Myshipping.Application.Entity /// 订舱业务主键 /// public string BOOK_ORDER_NO { get; set; } + + /// + /// 反馈结果 + /// + public string RESULT_NOTE { get; set; } } } diff --git a/Myshipping.Application/Entity/TaskManagePlat/TaskBillFeeDetailInfo.cs b/Myshipping.Application/Entity/TaskManagePlat/TaskBillFeeDetailInfo.cs index 79de38fc..e3cfef54 100644 --- a/Myshipping.Application/Entity/TaskManagePlat/TaskBillFeeDetailInfo.cs +++ b/Myshipping.Application/Entity/TaskManagePlat/TaskBillFeeDetailInfo.cs @@ -99,5 +99,10 @@ namespace Myshipping.Application.Entity /// 是否东胜接收 1-是 0-否 /// public int IS_DONGSHENG { get; set; } + + /// + /// 主单号 + /// + public string MBL_NO { get; set; } } } diff --git a/Myshipping.Application/Myshipping.Application.xml b/Myshipping.Application/Myshipping.Application.xml index 6b1b610a..ea286d22 100644 --- a/Myshipping.Application/Myshipping.Application.xml +++ b/Myshipping.Application/Myshipping.Application.xml @@ -3636,6 +3636,11 @@ 订舱业务主键 + + + 反馈结果 + + 任务账单费用明细 @@ -3726,6 +3731,11 @@ 是否东胜接收 1-是 0-否 + + + 主单号 + + 任务邮件表 @@ -10506,6 +10516,41 @@ 是否东胜接收 1-是 0-否 + + + 主单号 + + + + + + + + + + 文件路径 + + + + + 文件类型 + + + + + 文件名 + + + + + 邮件 + + + + + 邮件路径 + + @@ -10632,6 +10677,11 @@ 主单号 + + + 反馈结果 + + 是否异常 1-异常 0-未异常 @@ -10677,6 +10727,16 @@ VGM反馈详情列表 + + + 附件列表 + + + + + 邮件列表 + + 回执 @@ -10823,16 +10883,19 @@ 运输条款 + CY-CY 签单方式 + TELEX 装货港代码 + CNTAO @@ -10841,8 +10904,9 @@ - 卸港代码 + 卸货港代码 + GUPIT @@ -10853,6 +10917,7 @@ 中转港代码 + GUPIT @@ -10863,6 +10928,7 @@ 目的地代码 + GUPIT @@ -10956,6 +11022,13 @@ 任务详情 返回回执 + + + 获取查询参数 + + 参数类型 STATUS-任务状态;TASK_TYPE-任务类型;SOURCE-任务来源 + 返回回执 + 任务管理 @@ -10975,5 +11048,13 @@ 任务详情 返回回执 + + + 获取查询参数 + + 参数类型 STATUS-任务状态;TASK_TYPE-任务类型;SOURCE-任务来源 + 返回回执 + TASK_TYPE + diff --git a/Myshipping.Application/Service/TaskManagePlat/Dtos/TaskManageMapper.cs b/Myshipping.Application/Service/TaskManagePlat/Dtos/TaskManageMapper.cs index 53910eed..870815d0 100644 --- a/Myshipping.Application/Service/TaskManagePlat/Dtos/TaskManageMapper.cs +++ b/Myshipping.Application/Service/TaskManagePlat/Dtos/TaskManageMapper.cs @@ -43,6 +43,35 @@ namespace Myshipping.Application .Map(dest => dest.CBM, src => src.CBM) .Map(dest => dest.CONTA_TYPE, src => src.ContaType) .Map(dest => dest.CONTA_TYPE_NAME, src => src.ContaTypeName); + + + config.ForType() + .Map(dest => dest.SORT_NO, src => src.SortNo) + .Map(dest => dest.FEE_CODE, src => src.FeeCode) + .Map(dest => dest.FEE_NAME, src => src.FeeName) + .Map(dest => dest.AMOUNT, src => src.Amount) + .Map(dest => dest.AMOUNT_USD, src => src.AmountUSD) + .Map(dest => dest.CURRENCY, src => src.Currency) + .Map(dest => dest.S20, src => src.S20) + .Map(dest => dest.S40, src => src.S40) + .Map(dest => dest.S45, src => src.S45) + .Map(dest => dest.CTNALL, src => src.Ctnall) + .Map(dest => dest.QTY, src => src.Qty) + .Map(dest => dest.UNIT, src => src.Unit) + .Map(dest => dest.TAX_TYPE, src => src.TaxType) + .Map(dest => dest.RATE, src => src.Rate) + .Map(dest => dest.TOTAL_AMOUNT, src => src.TotalAmount) + .Map(dest => dest.IS_DONGSHENG, src => src.IsDongSheng); + + config.ForType() + .Map(dest => dest.CONTA_NO, src => src.ContaNo) + .Map(dest => dest.SEAL_NO, src => src.SealNo) + .Map(dest => dest.CONTA_TYPE, src => src.ContaType) + .Map(dest => dest.CONTA_TYPE_NAME, src => src.ContaTypeName) + .Map(dest => dest.KGS, src => src.KGS) + .Map(dest => dest.TAREWEIGHT, src => src.TAREWEIGHT) + .Map(dest => dest.WEIGHKGS, src => src.WEIGHKGS) + .Map(dest => dest.WEIGHTYPE, src => src.WEIGHTYPE); } } } diff --git a/Myshipping.Application/Service/TaskManagePlat/Dtos/TaskManageOrderFeeInfo.cs b/Myshipping.Application/Service/TaskManagePlat/Dtos/TaskManageOrderFeeInfo.cs index 290960ad..c7747b91 100644 --- a/Myshipping.Application/Service/TaskManagePlat/Dtos/TaskManageOrderFeeInfo.cs +++ b/Myshipping.Application/Service/TaskManagePlat/Dtos/TaskManageOrderFeeInfo.cs @@ -90,5 +90,10 @@ namespace Myshipping.Application /// 是否东胜接收 1-是 0-否 /// public int IsDongSheng { get; set; } + + /// + /// 主单号 + /// + public string MBlNo { get; set; } } } diff --git a/Myshipping.Application/Service/TaskManagePlat/Dtos/TaskManageOrderFileInfo.cs b/Myshipping.Application/Service/TaskManagePlat/Dtos/TaskManageOrderFileInfo.cs new file mode 100644 index 00000000..eae365d3 --- /dev/null +++ b/Myshipping.Application/Service/TaskManagePlat/Dtos/TaskManageOrderFileInfo.cs @@ -0,0 +1,27 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace Myshipping.Application +{ + /// + /// + /// + public class TaskManageOrderFileInfo + { + /// + /// 文件路径 + /// + public string FilePath { get; set; } + /// + /// 文件类型 + /// + public string FileType { get; set; } + /// + /// 文件名 + /// + public string FileName { get; set; } + } +} diff --git a/Myshipping.Application/Service/TaskManagePlat/Dtos/TaskManageOrderMailInfo.cs b/Myshipping.Application/Service/TaskManagePlat/Dtos/TaskManageOrderMailInfo.cs new file mode 100644 index 00000000..4a6f0aed --- /dev/null +++ b/Myshipping.Application/Service/TaskManagePlat/Dtos/TaskManageOrderMailInfo.cs @@ -0,0 +1,19 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace Myshipping.Application +{ + /// + /// 邮件 + /// + public class TaskManageOrderMailInfo + { + /// + /// 邮件路径 + /// + public string MailPath { get; set; } + } +} diff --git a/Myshipping.Application/Service/TaskManagePlat/Dtos/TaskManageOrderMessageMainInfo.cs b/Myshipping.Application/Service/TaskManagePlat/Dtos/TaskManageOrderMessageMainInfo.cs index 99405258..2aa3133a 100644 --- a/Myshipping.Application/Service/TaskManagePlat/Dtos/TaskManageOrderMessageMainInfo.cs +++ b/Myshipping.Application/Service/TaskManagePlat/Dtos/TaskManageOrderMessageMainInfo.cs @@ -48,6 +48,11 @@ namespace Myshipping.Application /// public string MBlNo { get; set; } + /// + /// 反馈结果 + /// + public string ResultNote { get; set; } + /// /// 是否异常 1-异常 0-未异常 /// @@ -92,5 +97,15 @@ namespace Myshipping.Application /// VGM反馈详情列表 /// public List VGMFeedBackList { get; set; } + + /// + /// 附件列表 + /// + public List FileList { get; set; } + + /// + /// 邮件列表 + /// + public List EmailList { get; set; } } } diff --git a/Myshipping.Application/Service/TaskManagePlat/Dtos/TaskManageOrderSIFeedBackInfo.cs b/Myshipping.Application/Service/TaskManagePlat/Dtos/TaskManageOrderSIFeedBackInfo.cs index c1da60b0..45e33e12 100644 --- a/Myshipping.Application/Service/TaskManagePlat/Dtos/TaskManageOrderSIFeedBackInfo.cs +++ b/Myshipping.Application/Service/TaskManagePlat/Dtos/TaskManageOrderSIFeedBackInfo.cs @@ -1,5 +1,6 @@ using System; using System.Collections.Generic; +using System.ComponentModel.DataAnnotations; using System.Linq; using System.Text; using System.Threading.Tasks; @@ -42,22 +43,28 @@ namespace Myshipping.Application /// /// 运输条款 /// + /// CY-CY public string Service { get; set; } /// /// 签单方式 /// + /// TELEX public string IssueType { get; set; } /// /// 装货港代码 /// + /// CNTAO + [MaxLength(5,ErrorMessage = "装货港代码需要5位编码")] public string PortLoadId { get; set; } /// /// 装货港 /// public string PortLoad { get; set; } /// - /// 卸港代码 + /// 卸货港代码 /// + /// GUPIT + [MaxLength(5, ErrorMessage = "卸货港代码需要5位编码")] public string PortDischargeId { get; set; } /// /// 卸货港 @@ -66,6 +73,8 @@ namespace Myshipping.Application /// /// 中转港代码 /// + /// GUPIT + [MaxLength(5, ErrorMessage = "中转港代码需要5位编码")] public string PortTransId { get; set; } /// /// 中转港 @@ -74,6 +83,8 @@ namespace Myshipping.Application /// /// 目的地代码 /// + /// GUPIT + [MaxLength(5, ErrorMessage = "目的地代码需要5位编码")] public string DestinationId { get; set; } /// /// 目的地 diff --git a/Myshipping.Application/Service/TaskManagePlat/Interface/ITaskManageService.cs b/Myshipping.Application/Service/TaskManagePlat/Interface/ITaskManageService.cs index 4e284763..1e9615aa 100644 --- a/Myshipping.Application/Service/TaskManagePlat/Interface/ITaskManageService.cs +++ b/Myshipping.Application/Service/TaskManagePlat/Interface/ITaskManageService.cs @@ -17,5 +17,12 @@ namespace Myshipping.Application /// 任务详情 /// 返回回执 Task CreateTaskJob(TaskManageOrderMessageInfo info); + + /// + /// 获取查询参数 + /// + /// 参数类型 STATUS-任务状态;TASK_TYPE-任务类型;SOURCE-任务来源 + /// 返回回执 + Task GetParaInfo(string ParaType); } } diff --git a/Myshipping.Application/Service/TaskManagePlat/TaskManageService.cs b/Myshipping.Application/Service/TaskManagePlat/TaskManageService.cs index b9319d73..df8f0b5f 100644 --- a/Myshipping.Application/Service/TaskManagePlat/TaskManageService.cs +++ b/Myshipping.Application/Service/TaskManagePlat/TaskManageService.cs @@ -2,14 +2,17 @@ using Furion.DistributedIDGenerator; using Furion.DynamicApiController; using Furion.FriendlyException; +using Furion.RemoteRequest; using Mapster; using Microsoft.AspNetCore.Authorization; using Microsoft.AspNetCore.Mvc; using Microsoft.Extensions.Logging; using Myshipping.Application.Entity; using Myshipping.Core; +using MySqlX.XDevAPI.Common; using System; using System.Collections.Generic; +using System.IO; using System.Linq; using System.Text; using System.Threading.Tasks; @@ -26,17 +29,29 @@ namespace Myshipping.Application private readonly SqlSugarRepository _taskBaseInfoRepository; private readonly SqlSugarRepository _taskSIFeedBackInfoRepository; private readonly SqlSugarRepository _taskSIFeedBackContaInfoRepository; + private readonly SqlSugarRepository _taskBillFeeDetailInfoRepository; + private readonly SqlSugarRepository _taskFileInfoRepository; + private readonly SqlSugarRepository _taskEmailInfoRepository; + private readonly SqlSugarRepository _taskVGMFeedBackInfoRepository; private readonly ILogger _logger; public TaskManageService(SqlSugarRepository taskBaseInfoRepository, SqlSugarRepository taskSIFeedBackInfoRepository, SqlSugarRepository taskSIFeedBackContaInfoRepository, + SqlSugarRepository taskBillFeeDetailInfoRepository, + SqlSugarRepository taskFileInfoRepository, + SqlSugarRepository taskEmailInfoRepository, + SqlSugarRepository taskVGMFeedBackInfoRepository, ILogger logger) { _taskBaseInfoRepository = taskBaseInfoRepository; _taskSIFeedBackInfoRepository = taskSIFeedBackInfoRepository; _taskSIFeedBackContaInfoRepository = taskSIFeedBackContaInfoRepository; + _taskBillFeeDetailInfoRepository = taskBillFeeDetailInfoRepository; + _taskFileInfoRepository = taskFileInfoRepository; + _taskEmailInfoRepository = taskEmailInfoRepository; + _taskVGMFeedBackInfoRepository = taskVGMFeedBackInfoRepository; _logger = logger; } @@ -120,6 +135,52 @@ namespace Myshipping.Application //新增 await _taskBaseInfoRepository.InsertAsync(taskInfo); + //附件 + if(info.Main.FileList != null && info.Main.FileList.Count > 0) + { + info.Main.FileList.ForEach(async file => { + var fileInfo = new TaskFileInfo(); + + fileInfo.PK_ID = IDGen.NextID().ToString(); + fileInfo.TASK_PKID = taskInfo.PK_ID; + + fileInfo.CreatedTime = taskInfo.CreatedTime; + fileInfo.UpdatedTime = taskInfo.CreatedTime; + + fileInfo.FILE_PATH = file.FilePath; + fileInfo.FILE_NAME = file.FileName; + fileInfo.FILE_TYPE = file.FileType; + + if(string.IsNullOrWhiteSpace(fileInfo.FILE_NAME)) + { + var fileModel = new FileInfo(file.FilePath); + + fileInfo.FILE_NAME = fileModel.Name; + fileInfo.FILE_TYPE = fileModel.Extension?.Replace(".",""); + } + + await _taskFileInfoRepository.InsertAsync(fileInfo); + }); + } + + //邮件 + if (info.Main.EmailList != null && info.Main.EmailList.Count > 0) + { + info.Main.EmailList.ForEach(async email => { + var emailInfo = new TaskEmailInfo(); + + emailInfo.PK_ID = IDGen.NextID().ToString(); + emailInfo.TASK_PKID = taskInfo.PK_ID; + + emailInfo.CreatedTime = taskInfo.CreatedTime; + emailInfo.UpdatedTime = taskInfo.CreatedTime; + + emailInfo.MAIL_PATH = email.MailPath; + + await _taskEmailInfoRepository.InsertAsync(emailInfo); + }); + } + //SI反馈入库 if (info.Main.TaskType == TaskBaseTypeEnum.SI_FEEDBACK) { @@ -153,6 +214,41 @@ namespace Myshipping.Application } } + //费用明细 + if(info.Main.TaskType == TaskBaseTypeEnum.INVOICE_BILL_MAIL || info.Main.TaskType == TaskBaseTypeEnum.PER_BILL) + { + if (info.Main.FeeList != null && info.Main.FeeList.Count > 0) + { + info.Main.FeeList.ForEach(async fee => { + var feeInfo = fee.Adapt(); + + feeInfo.PK_ID = IDGen.NextID().ToString(); + feeInfo.TASK_PKID = taskInfo.PK_ID; + + feeInfo.CreatedTime = taskInfo.CreatedTime; + feeInfo.UpdatedTime = taskInfo.CreatedTime; + + await _taskBillFeeDetailInfoRepository.InsertAsync(feeInfo); + }); + } + } + + //VGM反馈入库 + if (info.Main.VGMFeedBackList != null && info.Main.VGMFeedBackList.Count > 0) + { + info.Main.VGMFeedBackList.ForEach(async vgm => { + var vgmInfo = vgm.Adapt(); + + vgmInfo.PK_ID = IDGen.NextID().ToString(); + vgmInfo.TASK_PKID = taskInfo.PK_ID; + + vgmInfo.CreatedTime = taskInfo.CreatedTime; + vgmInfo.UpdatedTime = taskInfo.CreatedTime; + + await _taskVGMFeedBackInfoRepository.InsertAsync(vgmInfo); + }); + } + result.succ = true; result.msg = "新增任务成功"; } @@ -163,5 +259,45 @@ namespace Myshipping.Application return result; } + + + /// + /// 获取查询参数 + /// + /// 参数类型 STATUS-任务状态;TASK_TYPE-任务类型;SOURCE-任务来源 + /// 返回回执 + /// TASK_TYPE + [HttpGet("/TaskManage/GetParaInfo")] + public async Task GetParaInfo([QueryString]string ParaType) + { + TaskManageOrderResultDto result = new TaskManageOrderResultDto(); + try + { + Dictionary dict = new Dictionary(); + + if (ParaType == "STATUS") + { + dict = EnumUtil.GetEnumDictionary(typeof(TaskStatusEnum)); + } + else if (ParaType == "TASK_TYPE") + { + dict = EnumUtil.GetEnumDictionary(typeof(TaskBusiTypeEnum)); + } + else if (ParaType == "SOURCE") + { + dict = EnumUtil.GetEnumDictionary(typeof(TaskSourceEnum)); + } + + result.succ = true; + result.rows = dict.Select(t => new { Code = t.Value.ToString(), Name = t.Key }).ToList(); + } + catch (Exception ex) + { + result.succ = false; + result.msg = ex.Message; + } + + return result; + } } }