修改我的任务,查询我的SI

optimize
jianghaiqing 2 years ago
parent dbef8b5306
commit ddf73c2315

@ -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<TaskSIFeedBackInfo, TaskSIFeedBackResultBusiDto>()
.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);
}
}
}

@ -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
{
/// <summary>
/// 发货人
/// </summary>
public string Shipper { get; set; }
/// <summary>
/// 收货人
/// </summary>
public string Consignee { get; set; }
/// <summary>
/// 通知人
/// </summary>
public string NotifyParty { get; set; }
/// <summary>
/// 唛头
/// </summary>
public string Marks { get; set; }
/// <summary>
/// 货描
/// </summary>
public string Description { get; set; }
/// <summary>
/// 截单备注
/// </summary>
public string Remark { get; set; }
/// <summary>
/// 付费方式
/// </summary>
public string BLFRT { get; set; }
/// <summary>
/// 运输条款
/// </summary>
/// <example>CY-CY</example>
public string Service { get; set; }
/// <summary>
/// 签单方式
/// </summary>
/// <example>TELEX</example>
public string IssueType { get; set; }
/// <summary>
/// 装货港代码
/// </summary>
/// <example>CNTAO</example>
public string PortLoadId { get; set; }
/// <summary>
/// 装货港
/// </summary>
public string PortLoad { get; set; }
/// <summary>
/// 卸货港代码
/// </summary>
/// <example>GUPIT</example>
public string PortDischargeId { get; set; }
/// <summary>
/// 卸货港
/// </summary>
public string PortDischarge { get; set; }
/// <summary>
/// 中转港代码
/// </summary>
/// <example>GUPIT</example>
public string PortTransId { get; set; }
/// <summary>
/// 中转港
/// </summary>
public string PortTrans { get; set; }
/// <summary>
/// 目的地代码
/// </summary>
/// <example>GUPIT</example>
public string DestinationId { get; set; }
/// <summary>
/// 目的地
/// </summary>
public string Destination { get; set; }
/// <summary>
/// 件数
/// </summary>
public int? PKGS { get; set; }
/// <summary>
/// 包装
/// </summary>
public string KindPKGS { get; set; }
/// <summary>
/// 毛重
/// </summary>
public decimal? KGS { get; set; }
/// <summary>
/// 尺寸
/// </summary>
public decimal? CBM { get; set; }
/// <summary>
/// 第三付款地
/// </summary>
public string ThirdPayAddr { get; set; }
/// <summary>
/// 箱信息
/// </summary>
public List<TaskSIFeedBackResultContaDto> ContaList { get; set; }
}
}

@ -0,0 +1,56 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Myshipping.Application
{
/// <summary>
/// SI集装箱
/// </summary>
public class TaskSIFeedBackResultContaDto
{
/// <summary>
/// 集装箱号
/// </summary>
/// <example>RFCU2088064</example>
public string ContaNo { get; set; }
/// <summary>
/// 铅封号
/// </summary>
/// <example>T090518</example>
public string SealNo { get; set; }
/// <summary>
/// 件数
/// </summary>
/// <example>222</example>
public int PKGS { get; set; }
/// <summary>
/// 重量
/// </summary>
/// <example>1651</example>
public decimal? KGS { get; set; }
/// <summary>
/// 尺寸
/// </summary>
/// <example>9.67</example>
public decimal? CBM { get; set; }
/// <summary>
/// 箱型代码
/// </summary>
/// <example>20GP</example>
public string ContaType { get; set; }
/// <summary>
/// 箱型
/// </summary>
/// <example>20GP</example>
public string ContaTypeName { get; set; }
}
}

@ -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
{
/// <summary>
/// SI详情
/// </summary>
public class TaskSIFeedBackResultDto
{
// <summary>
/// 任务主键
/// </summary>
public string TaskId { get; set; }
/// <summary>
/// 订舱详情
/// </summary>
public TaskBookingOrderDto BookingOrder { get; set; }
/// <summary>
/// SI详情
/// </summary>
public TaskSIFeedBackResultBusiDto BusiInfo { get; set; }
/// <summary>
/// SI与订舱主信息比对差异字段列表
/// </summary>
public List<string> SICompareOrderKeyList { get; set; }
/// <summary>
/// SI与订舱集装箱比对差异字段列表
/// </summary>
public List<string> SICompareOrderContaKeyList { get; set; }
}
}

@ -174,5 +174,23 @@ namespace Myshipping.Application
/// <param name="descSort">排序方法,默认降序</param>
/// <returns>返回结果</returns>
Task<IActionResult> LaraPaperRecordExport(string sortField, int pageNo = 1, int pageSize = 30, bool descSort = true);
/// <summary>
/// 保存SI信息
/// </summary>
/// <param name="model">订舱信息</param>
/// <returns>返回结果</returns>
Task<TaskManageOrderResultDto> SaveBookingSI(BookingOrderDto model);
/// <summary>
/// 获取SI反馈信息
/// </summary>
/// <param name="taskPKId">任务主键</param>
/// <returns>返回结果</returns>
Task<TaskSIFeedBackResultDto> GetSIFeedBackInfo(string taskPKId);
}
}

@ -2435,7 +2435,7 @@ namespace Myshipping.Application
/// <param name="pageSize">页码容量</param>
/// <param name="descSort">排序方法,默认降序</param>
/// <returns>返回结果</returns>
[HttpGet("/TaskManage/GetLaraPaperRecordPage")]
[HttpGet("/TaskManage/LaraPaperRecordExport")]
public async Task<IActionResult> 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
/// <summary>
/// 导出提单纸登记记录生成Excel
/// </summary>
@ -2529,6 +2530,159 @@ namespace Myshipping.Application
return ms;
}
#endregion
/// <summary>
/// 保存SI信息
/// </summary>
/// <param name="model">订舱信息</param>
/// <returns>返回结果</returns>
[HttpPost("/TaskManage/GetSIFeedBackInfo")]
public async Task<TaskManageOrderResultDto> SaveBookingSI(BookingOrderDto model)
{
TaskManageOrderResultDto result = new TaskManageOrderResultDto();
try
{
}
catch(Exception ex)
{
}
return result;
}
/// <summary>
/// 获取SI反馈信息
/// </summary>
/// <param name="taskPKId">任务主键</param>
/// <returns>返回结果</returns>
[HttpGet("/TaskManage/GetSIFeedBackInfo")]
public async Task<TaskSIFeedBackResultDto> 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<TaskSIFeedBackInfo>()
.InnerJoin<TaskSIFeedBackContaInfo>((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<TaskSIFeedBackResultBusiDto>();
siFeedBackInfo.ContaList = siFeedBackList.Select(t => t.ctn.Adapt<TaskSIFeedBackResultContaDto>()).ToList();
model.BusiInfo = siFeedBackInfo;
if (orderInfo != null)
{
//订舱
model.BookingOrder = orderInfo.Adapt<TaskBookingOrderDto>();
}
//进行数据比对确认差异字段KEY
}
catch (Exception ex)
{
throw Oops.Bah($"获取获取单票账单详情异常,{0}", ex.Message);
}
return model;
}
// private async Task<string> 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<string>();
// 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<string>();
// 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 样本业务提取帮助类

Loading…
Cancel
Save