diff --git a/Myshipping.Application/Service/TaskManagePlat/Dtos/TaskManageMapper.cs b/Myshipping.Application/Service/TaskManagePlat/Dtos/TaskManageMapper.cs index 99328ed7..d23d9d13 100644 --- a/Myshipping.Application/Service/TaskManagePlat/Dtos/TaskManageMapper.cs +++ b/Myshipping.Application/Service/TaskManagePlat/Dtos/TaskManageMapper.cs @@ -354,6 +354,30 @@ namespace Myshipping.Application .Map(dest => dest.CreatedUserName, src => src.CreatedUserName) .Map(dest => dest.UpdatedUserId, src => src.UpdatedUserId.ToString()) .Map(dest => dest.UpdatedUserName, src => src.UpdatedUserName); + + + config.ForType() + .Map(dest => dest.Shipper, src => src.SHIPPER) + .Map(dest => dest.Consignee, src => src.CONSIGNEE) + .Map(dest => dest.NotifyParty, src => src.NOTIFYPARTY) + .Map(dest => dest.Marks, src => src.MARKS) + .Map(dest => dest.Description, src => src.DESCRIPTION) + .Map(dest => dest.Remark, src => src.REMARK) + .Map(dest => dest.BLFRT, src => src.BLFRT) + .Map(dest => dest.Service, src => src.SERVICE) + .Map(dest => dest.IssueType, src => src.ISSUETYPE) + .Map(dest => dest.PortLoadId, src => src.PORT_LOADID) + .Map(dest => dest.PortLoad, src => src.PORT_LOAD) + .Map(dest => dest.PortDischargeId, src => src.PORT_DISCHARGEID) + .Map(dest => dest.PortDischarge, src => src.PORT_DISCHARGE) + .Map(dest => dest.PortTransId, src => src.PORT_TRANSID) + .Map(dest => dest.PortTrans, src => src.PORT_TRANS) + .Map(dest => dest.DestinationId, src => src.DESTINATION_ID) + .Map(dest => dest.Destination, src => src.DESTINATION) + .Map(dest => dest.KindPKGS, src => src.KIND_PKGS) + .Map(dest => dest.PKGS, src => src.PKGS) + .Map(dest => dest.ThirdPayAddr, src => src.THIRDPAYADDR); } + } } diff --git a/Myshipping.Application/Service/TaskManagePlat/Dtos/TaskSIFeedBackResultBusiDto.cs b/Myshipping.Application/Service/TaskManagePlat/Dtos/TaskSIFeedBackResultBusiDto.cs new file mode 100644 index 00000000..cdb77a0d --- /dev/null +++ b/Myshipping.Application/Service/TaskManagePlat/Dtos/TaskSIFeedBackResultBusiDto.cs @@ -0,0 +1,111 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace Myshipping.Application +{ + public class TaskSIFeedBackResultBusiDto + { + /// + /// 发货人 + /// + public string Shipper { get; set; } + /// + /// 收货人 + /// + public string Consignee { get; set; } + /// + /// 通知人 + /// + public string NotifyParty { get; set; } + /// + /// 唛头 + /// + public string Marks { get; set; } + /// + /// 货描 + /// + public string Description { get; set; } + /// + /// 截单备注 + /// + public string Remark { get; set; } + /// + /// 付费方式 + /// + public string BLFRT { get; set; } + /// + /// 运输条款 + /// + /// CY-CY + public string Service { get; set; } + /// + /// 签单方式 + /// + /// TELEX + public string IssueType { get; set; } + /// + /// 装货港代码 + /// + /// CNTAO + public string PortLoadId { get; set; } + /// + /// 装货港 + /// + public string PortLoad { get; set; } + /// + /// 卸货港代码 + /// + /// GUPIT + public string PortDischargeId { get; set; } + /// + /// 卸货港 + /// + public string PortDischarge { get; set; } + /// + /// 中转港代码 + /// + /// GUPIT + public string PortTransId { get; set; } + /// + /// 中转港 + /// + public string PortTrans { get; set; } + /// + /// 目的地代码 + /// + /// GUPIT + public string DestinationId { get; set; } + /// + /// 目的地 + /// + public string Destination { get; set; } + /// + /// 件数 + /// + public int? PKGS { get; set; } + /// + /// 包装 + /// + public string KindPKGS { get; set; } + /// + /// 毛重 + /// + public decimal? KGS { get; set; } + /// + /// 尺寸 + /// + public decimal? CBM { get; set; } + /// + /// 第三付款地 + /// + public string ThirdPayAddr { get; set; } + + /// + /// 箱信息 + /// + public List ContaList { get; set; } + } +} diff --git a/Myshipping.Application/Service/TaskManagePlat/Dtos/TaskSIFeedBackResultContaDto.cs b/Myshipping.Application/Service/TaskManagePlat/Dtos/TaskSIFeedBackResultContaDto.cs new file mode 100644 index 00000000..63728170 --- /dev/null +++ b/Myshipping.Application/Service/TaskManagePlat/Dtos/TaskSIFeedBackResultContaDto.cs @@ -0,0 +1,56 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace Myshipping.Application +{ + /// + /// SI集装箱 + /// + public class TaskSIFeedBackResultContaDto + { + /// + /// 集装箱号 + /// + /// RFCU2088064 + public string ContaNo { get; set; } + + /// + /// 铅封号 + /// + /// T090518 + public string SealNo { get; set; } + + /// + /// 件数 + /// + /// 222 + public int PKGS { get; set; } + + /// + /// 重量 + /// + /// 1651 + public decimal? KGS { get; set; } + + /// + /// 尺寸 + /// + /// 9.67 + public decimal? CBM { get; set; } + + /// + /// 箱型代码 + /// + /// 20GP + public string ContaType { get; set; } + + /// + /// 箱型 + /// + /// 20GP + public string ContaTypeName { get; set; } + } +} diff --git a/Myshipping.Application/Service/TaskManagePlat/Dtos/TaskSIFeedBackResultDto.cs b/Myshipping.Application/Service/TaskManagePlat/Dtos/TaskSIFeedBackResultDto.cs new file mode 100644 index 00000000..5ad1b027 --- /dev/null +++ b/Myshipping.Application/Service/TaskManagePlat/Dtos/TaskSIFeedBackResultDto.cs @@ -0,0 +1,40 @@ +using System; +using System.Collections.Generic; +using System.ComponentModel.DataAnnotations; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace Myshipping.Application +{ + /// + /// SI详情 + /// + public class TaskSIFeedBackResultDto + { + // + /// 任务主键 + /// + public string TaskId { get; set; } + + /// + /// 订舱详情 + /// + public TaskBookingOrderDto BookingOrder { get; set; } + + /// + /// SI详情 + /// + public TaskSIFeedBackResultBusiDto BusiInfo { get; set; } + + /// + /// SI与订舱主信息比对差异字段列表 + /// + public List SICompareOrderKeyList { get; set; } + + /// + /// SI与订舱集装箱比对差异字段列表 + /// + public List SICompareOrderContaKeyList { get; set; } + } +} diff --git a/Myshipping.Application/Service/TaskManagePlat/Interface/ITaskManageService.cs b/Myshipping.Application/Service/TaskManagePlat/Interface/ITaskManageService.cs index cde968b6..51196ee6 100644 --- a/Myshipping.Application/Service/TaskManagePlat/Interface/ITaskManageService.cs +++ b/Myshipping.Application/Service/TaskManagePlat/Interface/ITaskManageService.cs @@ -174,5 +174,23 @@ namespace Myshipping.Application /// 排序方法,默认降序 /// 返回结果 Task LaraPaperRecordExport(string sortField, int pageNo = 1, int pageSize = 30, bool descSort = true); + + /// + /// 保存SI信息 + /// + /// 订舱信息 + /// 返回结果 + Task SaveBookingSI(BookingOrderDto model); + + + /// + /// 获取SI反馈信息 + /// + /// 任务主键 + /// 返回结果 + Task GetSIFeedBackInfo(string taskPKId); + + + } } diff --git a/Myshipping.Application/Service/TaskManagePlat/TaskManageService.cs b/Myshipping.Application/Service/TaskManagePlat/TaskManageService.cs index 5aa6e6c2..86933370 100644 --- a/Myshipping.Application/Service/TaskManagePlat/TaskManageService.cs +++ b/Myshipping.Application/Service/TaskManagePlat/TaskManageService.cs @@ -2435,7 +2435,7 @@ namespace Myshipping.Application /// 页码容量 /// 排序方法,默认降序 /// 返回结果 - [HttpGet("/TaskManage/GetLaraPaperRecordPage")] + [HttpGet("/TaskManage/LaraPaperRecordExport")] public async Task LaraPaperRecordExport([FromQuery] string sortField,[FromQuery] int pageNo = 1, [FromQuery] int pageSize = 30, [FromQuery] bool descSort = true) { QueryTaskManageBaseDto querySearch = new QueryTaskManageBaseDto @@ -2465,6 +2465,7 @@ namespace Myshipping.Application return new FileStreamResult(ms, "application/vnd.ms-excel") { FileDownloadName = $"{DateTime.Now.ToString("yyyyMMddHHmmss")}_LaraPaperRecord.xls" }; } + #region 导出提单纸登记记录生成Excel /// /// 导出提单纸登记记录生成Excel /// @@ -2529,6 +2530,159 @@ namespace Myshipping.Application return ms; } + #endregion + + /// + /// 保存SI信息 + /// + /// 订舱信息 + /// 返回结果 + [HttpPost("/TaskManage/GetSIFeedBackInfo")] + public async Task SaveBookingSI(BookingOrderDto model) + { + TaskManageOrderResultDto result = new TaskManageOrderResultDto(); + + try + { + + } + catch(Exception ex) + { + + } + + return result; + } + + + /// + /// 获取SI反馈信息 + /// + /// 任务主键 + /// 返回结果 + [HttpGet("/TaskManage/GetSIFeedBackInfo")] + public async Task GetSIFeedBackInfo(string taskPKId) + { + TaskSIFeedBackResultDto model = new TaskSIFeedBackResultDto(); + + try + { + var taskInfo = _taskBaseInfoRepository.AsQueryable().First(t => t.PK_ID == taskPKId); + + if (taskInfo == null) + Oops.Oh($"任务信息获取失败"); + + if (string.IsNullOrWhiteSpace(taskInfo.BOOK_ORDER_NO)) + Oops.Oh($"任务信息的订舱主键不存在"); + + if (taskInfo.TASK_TYPE != TaskBusiTypeEnum.SI_FEEDBACK.ToString()) + Oops.Oh($"当前任务类型不是{TaskBusiTypeEnum.SI_FEEDBACK.GetDescription()}"); + + var orderInfo = _bookingOrderRepository.AsQueryable() + .First(t => t.Id == long.Parse(taskInfo.BOOK_ORDER_NO)); + + model.TaskId = taskInfo.PK_ID; + + var siFeedBackList = _taskSIFeedBackInfoRepository.EntityContext.Queryable() + .InnerJoin((si, ctn) => si.PK_ID == ctn.P_PKID) + .Where((si, ctn) => si.TASK_PKID == model.TaskId && si.TenantId == UserManager.TENANT_ID) + .Select((si, ctn) => new { si = si, ctn = ctn }).ToList(); + + if (siFeedBackList.Count == 0) + Oops.Oh($"SI反馈信息不存在"); + + var siFeedBackInfo = siFeedBackList.FirstOrDefault().si.Adapt(); + + siFeedBackInfo.ContaList = siFeedBackList.Select(t => t.ctn.Adapt()).ToList(); + + model.BusiInfo = siFeedBackInfo; + + if (orderInfo != null) + { + //订舱 + model.BookingOrder = orderInfo.Adapt(); + } + + //进行数据比对确认差异字段KEY + } + catch (Exception ex) + { + throw Oops.Bah($"获取获取单票账单详情异常,{0}", ex.Message); + } + return model; + } + +// private async Task InnerCompareDiff() +// { +// var compareField = new string[] { "SHIPPER", "CONSIGNEE", "NOTIFYPARTY", "MARKS", "DESCRIPTION", "BLFRT", "SERVICE", "ISSUETYPE", "PORTLOAD", "PORTDISCHARGE", "TRANSPORT", "DESTINATION", "PKGS", "KGS", "CBM", "KINDPKGS", "THIRDPAYADDR" }; +// var listDiffField = new List(); +// var bookProps = typeof(OP_SEAE_ORDER).GetProperties(); +// var feedProps = typeof(OP_SEAE_SI_FEEDBACK).GetProperties(); +// foreach (var prop in compareField) +// { +// var pBook = bookProps.First(p => p.Name == prop); +// var bookVal = pBook.GetValue(bill.order); +// var pFeed = feedProps.First(p => p.Name == prop); +// var feedVal = pFeed.GetValue(siFeedback); +// if (pBook.PropertyType == typeof(string)) +// { +// string st1 = bookVal as string; +// string st2 = feedVal as string; +// st1 = ProcessString(st1); +// st2 = ProcessString(st2); + +// if (st1 != st2) +// { +// listDiffField.Add(prop); +// } +// } +// else if (pBook.PropertyType == typeof(int?)) +// { +// var dt1 = bookVal as int?; +// var dt2 = feedVal as int?; +// if (dt1 != dt2) +// { +// listDiffField.Add(prop); +// } +// } +// else if (pBook.PropertyType == typeof(decimal?)) +// { +// var dt1 = bookVal as decimal?; +// var dt2 = feedVal as decimal?; +// if (dt1 != dt2) +// { +// listDiffField.Add(prop); +// } +// } +// } + +// ViewData["DiffFields"] = listDiffField; +//#endregion + +// #region 箱信息对比 +// var listDiffCtn = new List(); +// var ctns = bookingDB.Ctns.Where(c => c.ORDNO == bill.order.ORDNO).ToList(); +// foreach (var cc in feedbackCtn) +// { +// var ctnB = ctns.FirstOrDefault(c => c.CNTRNO == cc.CNTRNO); +// if (ctnB == null) +// { +// listDiffCtn.Add(cc.CNTRNO); +// } +// else +// { +// if (cc.KGS != ctnB.KGS +// || cc.PKGS != ctnB.PKGS +// || cc.SEALNO != ctnB.SEALNO +// || cc.CTNALL != ctnB.CTNALL +// || cc.CBM != ctnB.CBM) +// { +// listDiffCtn.Add(cc.CNTRNO); +// } +// } +// } +// ViewData["DiffCtns"] = listDiffCtn; +// } } #region 样本业务提取帮助类