wet 2 years ago
commit 45d10c95c7

@ -104,5 +104,10 @@ namespace Myshipping.Application.Entity
/// 主单号
/// </summary>
public string MBL_NO { get; set; }
/// <summary>
/// 是否合计项
/// </summary>
public int IS_TOTAL { get; set; }
}
}

@ -0,0 +1,70 @@
using Myshipping.Application.Entity;
using SqlSugar;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Myshipping.Application
{
/// <summary>
/// 任务单票账单主信息
/// </summary>
[SugarTable("task_per_bill_base")]
[Description("任务单票账单主信息")]
public class TaskPerBillBaseInfo : TaskManageDbEntity
{
/// <summary>
/// 任务主键(父主键)
/// </summary>
public string TASK_PKID { get; set; }
/// <summary>
/// 主单号
/// </summary>
public string MBL_NO { get; set; }
/// <summary>
/// 发票号
/// </summary>
public string INVOICE_NO { get; set; }
/// <summary>
/// 取消号
/// </summary>
public string CANCEL_NO { get; set; }
/// <summary>
/// 合计金额
/// </summary>
public decimal TOTAL_AMOUNT { get; set; }
/// <summary>
/// 是否东胜接收 1-是 0-否
/// </summary>
public int IS_DONGSH_RECV { get; set; } = 0;
/// <summary>
/// 是否东胜接收回执 1-是 0-否
/// </summary>
public int IS_DONGSH_RESULT { get; set; } = 0;
/// <summary>
/// 东胜接收时间
/// </summary>
public Nullable<DateTime> DONGSH_RECV_TIME { get; set; }
/// <summary>
/// 东胜回执时间
/// </summary>
public Nullable<DateTime> DONGSH_RESULT_TIME { get; set; }
/// <summary>
/// 东胜反馈原因
/// </summary>
public string DONGSH_RECV_REASON { get; set; }
}
}

@ -14,6 +14,7 @@
<ItemGroup>
<Compile Remove="Entity\DjyBooking.cs" />
<Compile Remove="Enum\TaskCategoryEnum.cs" />
<Compile Remove="Service\BookingCtnDetail\BookingCtnDetailService.cs" />
<Compile Remove="Service\BookingCtnDetail\IBookingCtnDetailService.cs" />
<Compile Remove="Service\BookingCtn\BookingCtnService.cs" />

@ -53,12 +53,24 @@ namespace Myshipping.Application
/// <example></example>
public string TaskSource { get; set; }
/// <summary>
/// 任务分类
/// </summary>
/// <example></example>
public string TaskCategory { get; set; }
/// <summary>
/// 接收人
/// </summary>
/// <example></example>
public string TaskRecvName { get; set; }
/// <summary>
/// 任务状态
/// </summary>
/// <example></example>
public string Status { get; set; }
/// <summary>
/// 当前页码
/// </summary>

@ -160,5 +160,25 @@ namespace Myshipping.Application
/// </summary>
public string TenantName { get; set; }
/// <summary>
/// 任务完成方式 MANUAL-手工
/// </summary>
public string ComplateDeal { get; set; }
/// <summary>
/// 任务完成方式名称 MANUAL-手工
/// </summary>
public string ComplateDealName { get; set; }
/// <summary>
/// 签单方式(来自订舱)
/// </summary>
public string IssueType { get; set; }
/// <summary>
/// 签单方式名称(来自订舱)
/// </summary>
public string IssueTypeName { get; set; }
}
}

@ -0,0 +1,49 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Myshipping.Application
{
/// <summary>
///
/// </summary>
public class TaskInvoiceBillBaseInfo
{
/// <summary>
/// 任务主键
/// </summary>
public string TaskId { get; set; }
/// <summary>
/// 订舱详情
/// </summary>
public TaskBookingOrderDto BookingOrder { get; set; }
/// <summary>
/// 费用明细
/// </summary>
public List<TaskInvoiceBillFeeDto> FeeList { get; set; }
/// <summary>
/// 人民币合计
/// </summary>
public decimal TotalAmountCNY { get; set; }
/// <summary>
/// 美金合计
/// </summary>
public decimal TotalAmountUSD { get; set; }
/// <summary>
/// 任务人间列表
/// </summary>
public List<TaskManageOrderFileInfo> TaskFile { get; set; }
/// <summary>
/// 发送历史明细
/// </summary>
public List<TaskInvoiceBillFileHis> InvoiceBillSendList { get; set; }
}
}

@ -0,0 +1,69 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Myshipping.Application
{
/// <summary>
/// 航次账单费用
/// </summary>
public class TaskInvoiceBillFeeDto
{
/// <summary>
/// 主键
/// </summary>
public string PKId { get; set; }
/// <summary>
/// 任务主键
/// </summary>
public string TaskPKId { get; set; }
/// <summary>
/// 主单号
/// </summary>
public string MBLNo { get; set; }
/// <summary>
/// 费用代码
/// </summary>
public string FeeCode { get; set; }
/// <summary>
/// 费用名称
/// </summary>
public string FeeName { get; set; }
/// <summary>
/// 费用金额
/// </summary>
public decimal Amount { get; set; }
/// <summary>
/// 币制
/// </summary>
public string Currency { get; set; }
/// <summary>
/// 顺序号
/// </summary>
public int SortNo { get; set; }
/// <summary>
///
/// </summary>
public int S20 { get; set; }
/// <summary>
///
/// </summary>
public int S40 { get; set; }
/// <summary>
///
/// </summary>
public int S45 { get; set; }
}
}

@ -0,0 +1,69 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Myshipping.Application
{
/// <summary>
///
/// </summary>
public class TaskInvoiceBillFileHis
{
/// <summary>
/// 主键
/// </summary>
public string PKId { get; set; }
/// <summary>
/// 任务主键
/// </summary>
public string TaskPKId { get; set; }
/// <summary>
/// 主单号
/// </summary>
public string MBLNo { get; set; }
/// <summary>
/// 文件路径s
/// </summary>
public string FilePath { get; set; }
/// <summary>
/// 创建时间
/// </summary>
public DateTime CreatedTime { get; set; }
/// <summary>
/// 发送人ID
/// </summary>
public Nullable<long> SendUserId { get; set; }
/// <summary>
/// 发送人名称
/// </summary>
public string SendUserName { get; set; }
/// <summary>
/// 发送时间
/// </summary>
public Nullable<DateTime> SendTime { get; set; }
/// <summary>
/// 状态
/// </summary>
public string Stuats { get; set; }
/// <summary>
/// 状态名称
/// </summary>
public string StuatsName { get; set; }
/// <summary>
/// 发送结果
/// </summary>
public string SendResult { get; set; }
}
}

@ -61,7 +61,8 @@ namespace Myshipping.Application
.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);
.Map(dest => dest.IS_DONGSHENG, src => src.IsDongSheng)
.Map(dest => dest.IS_TOTAL, src => src.IsTotal);
config.ForType<TaskManageOrderVGMFeedBackInfo, TaskVGMFeedBackInfo>()
.Map(dest => dest.CONTA_NO, src => src.ContaNo)
@ -95,13 +96,17 @@ namespace Myshipping.Application
.Map(dest => dest.CompleteDate, src => src.COMPLETE_DATE)
.Map(dest => dest.BookOrderNo, src => src.BOOK_ORDER_NO)
.Map(dest => dest.ResultNote, src => src.RESULT_NOTE)
.Map(dest => dest.ETD, src => src.ETD)
.Map(dest => dest.ETD, src => src.ETD.HasValue? src.ETD.Value.ToString("yyyy-MM-dd HH:mm:ss"):"")
.Map(dest => dest.CreatedTime, src => src.CreatedTime)
.Map(dest => dest.UpdatedTime, src => src.UpdatedTime)
.Map(dest => dest.UpdatedTime, src => src.UpdatedTime.HasValue ? src.UpdatedTime.Value.ToString("yyyy-MM-dd HH:mm:ss") : "")
.Map(dest => dest.CreatedUserId, src => src.CreatedUserId)
.Map(dest => dest.CreatedUserName, src => src.CreatedUserName)
.Map(dest => dest.UpdatedUserId, src => src.UpdatedUserId)
.Map(dest => dest.UpdatedUserName, src => src.UpdatedUserName);
.Map(dest => dest.UpdatedUserName, src => src.UpdatedUserName)
.Map(dest => dest.ComplateDeal, src => src.COMPLETE_DEAL)
.Map(dest => dest.ComplateDealName, src => src.COMPLETE_DEAL_NAME)
.Map(dest => dest.IssueType, src => src.ISSUE_TYPE)
.Map(dest => dest.IssueTypeName, src => src.ISSUE_TYPE_NAME);
config.ForType<TaskBaseInfoDto, TaskBaseInfo>()
.Map(dest => dest.PK_ID, src => src.PKId)
@ -290,6 +295,17 @@ namespace Myshipping.Application
.Map(dest => dest.Marks, src => src.MARKS)
.Map(dest => dest.Description, src => src.DESCRIPTION)
.Map(dest => dest.Remark, src => src.REMARK);
config.ForType<TaskBillFeeDetailInfo,TaskInvoiceBillFeeDto > ()
.Map(dest => dest.SortNo, src => src.SORT_NO)
.Map(dest => dest.FeeCode, src => src.FEE_CODE)
.Map(dest => dest.FeeName, src => src.FEE_NAME)
.Map(dest => dest.Amount, src => src.AMOUNT)
.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);
}
}
}

@ -95,5 +95,11 @@ namespace Myshipping.Application
/// 主单号
/// </summary>
public string MBlNo { get; set; }
/// <summary>
/// 是否合计项
/// </summary>
public int IsTotal { get; set; }
}
}

@ -23,5 +23,10 @@ namespace Myshipping.Application
/// 文件名
/// </summary>
public string FileName { get; set; }
/// <summary>
/// 主键
/// </summary>
public string PKId { get; set; }
}
}

@ -0,0 +1,70 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Myshipping.Application
{
/// <summary>
/// 任务单票账单主信息
/// </summary>
public class TaskPerBillBaseInfoDto
{
/// <summary>
/// 主键
/// </summary>
public string PKId { get; set; }
/// <summary>
/// 任务主键
/// </summary>
public string TaskPKId { get; set; }
/// <summary>
/// 主单号
/// </summary>
public string MBLNo { get; set; }
/// <summary>
/// 合计金额
/// </summary>
public decimal TotalAmount { get; set; }
/// <summary>
/// 发票号
/// </summary>
public string InvoiceNo { get; set; }
/// <summary>
/// 取消号
/// </summary>
public string CancelNo { get; set; }
/// <summary>
/// 是否东胜接收 1-是 0-否
/// </summary>
public int IsDongshengRecv { get; set; } = 0;
/// <summary>
/// 是否东胜接收回执 1-是 0-否
/// </summary>
public int IsDongshengResult { get; set; } = 0;
/// <summary>
/// 东胜接收时间
/// </summary>
public Nullable<DateTime> DongshengRecvTime { get; set; }
/// <summary>
/// 东胜回执时间
/// </summary>
public Nullable<DateTime> DongshengResultTime { get; set; }
/// <summary>
/// 东胜反馈原因
/// </summary>
public string DongshengRecvReason { get; set; }
}
}

@ -0,0 +1,12 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Myshipping.Application
{
public class TaskPerBillFeeDto
{
}
}

@ -0,0 +1,31 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Myshipping.Application
{
public class TaskPerBillResultInfo
{
/// <summary>
/// 任务主键
/// </summary>
public string TaskId { get; set; }
/// <summary>
/// 订舱详情
/// </summary>
public TaskBookingOrderDto BookingOrder { get; set; }
/// <summary>
/// 费用明细
/// </summary>
public List<TaskPerBillFeeDto> FeeList { get; set; }
/// <summary>
/// 任务人间列表
/// </summary>
public List<TaskManageOrderFileInfo> TaskFile { get; set; }
}
}

@ -1,5 +1,6 @@
using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Mvc;
using Myshipping.Core;
using NPOI.POIFS.Crypt.Dsig;
using NPOI.SS.Formula.Functions;
using SqlSugar;
@ -42,7 +43,7 @@ namespace Myshipping.Application
/// </summary>
/// <param name="QuerySearch">任务台账查询请求</param>
/// <returns>返回结果</returns>
Task<dynamic> GetPageAsync(QueryTaskManageDto QuerySearch);
Task<SqlSugarPagedList<TaskBaseInfoDto>> GetPageAsync(QueryTaskManageDto QuerySearch);
/// <summary>
@ -149,6 +150,14 @@ namespace Myshipping.Application
/// <returns>返回结果</returns>
Task<TaskBookingOrderDto> GetBookingOrderInfo(string taskPKId);
/// <summary>
/// 获取单票账单详情
/// </summary>
/// <param name="taskPKId">任务主键</param>
/// <returns>返回结果</returns>
Task<TaskPerBillResultInfo> GetTaskPerBillInfo(string taskPKId);
}
}

@ -348,7 +348,7 @@ namespace Myshipping.Application
/// <summary>
/// 获取查询参数
/// </summary>
/// <param name="ParaType">参数类型 STATUS-任务状态;TASK_TYPE-任务类型;SOURCE-任务来源</param>
/// <param name="ParaType">参数类型 STATUS-任务状态;TASK_TYPE-任务类型;SOURCE-任务来源 CATEGORY-分类</param>
/// <returns>返回回执</returns>
/// <example>TASK_TYPE</example>
[HttpGet("/TaskManage/GetParaInfo")]
@ -371,6 +371,10 @@ namespace Myshipping.Application
{
dict = EnumUtil.GetEnumDictionaryWithKey(typeof(TaskSourceEnum));
}
else if (ParaType == "CATEGORY")
{
dict = EnumUtil.GetEnumDictionaryWithKey(typeof(TaskStatLevelEnum));
}
result.succ = true;
result.rows = dict.Select(t => new { Code = t.Key, Name = t.Value }).ToList();
@ -419,7 +423,7 @@ namespace Myshipping.Application
var statList = _taskStatManageInfoRepository.AsQueryable().Where(t => (t.USER_ID == userTendInfo.User.Id
&& t.STAT_TYPE == TaskStatLevelEnum.PERSON.ToString()) || (t.COMP_ID == userTendInfo.Tend.Id && t.STAT_TYPE == TaskStatLevelEnum.PUBLIC.ToString())).ToList();
if (isReCalc)
if (true)
{
//任务列表分组统计
var groupList = _taskBaseInfoRepository.AsQueryable()
@ -441,7 +445,7 @@ namespace Myshipping.Application
.Where(t => t.IsExcept == 0 && t.IsPublic == 0).ToList();
var publicList = groupList
.Where(t => t.IsExcept == 1 && t.IsPublic == 1).ToList();
.Where(t => t.IsExcept == 0 && t.IsPublic == 1).ToList();
#region 异常
if (exceptList.Count > 0)
@ -613,7 +617,7 @@ namespace Myshipping.Application
/// <param name="QuerySearch">任务台账查询请求</param>
/// <returns>返回结果</returns>
[HttpPost("/TaskManage/GetPage")]
public async Task<dynamic> GetPageAsync(QueryTaskManageDto QuerySearch)
public async Task<SqlSugarPagedList<TaskBaseInfoDto>> GetPageAsync(QueryTaskManageDto QuerySearch)
{
List<string> mblList = new List<string>();
@ -678,16 +682,15 @@ namespace Myshipping.Application
.WhereIF(taskDateEnd != DateTime.MinValue, t => t.CreatedTime < taskDateEnd)
.WhereIF(!string.IsNullOrWhiteSpace(QuerySearch.TaskType), t => t.TASK_TYPE.Equals(QuerySearch.TaskType, StringComparison.OrdinalIgnoreCase))
.WhereIF(!string.IsNullOrWhiteSpace(QuerySearch.TaskSource), t => t.TASK_SOURCE.Equals(QuerySearch.TaskSource, StringComparison.OrdinalIgnoreCase))
.WhereIF(!string.IsNullOrWhiteSpace(QuerySearch.TaskCategory) && QuerySearch.TaskCategory == TaskStatLevelEnum.EXCPTION.ToString(), t => t.IS_EXCEPT == 1)
.WhereIF(!string.IsNullOrWhiteSpace(QuerySearch.TaskCategory) && QuerySearch.TaskCategory == TaskStatLevelEnum.PUBLIC.ToString(), t => t.IS_PUBLIC == 1)
.WhereIF(!string.IsNullOrWhiteSpace(QuerySearch.TaskCategory) && QuerySearch.TaskCategory == TaskStatLevelEnum.PERSON.ToString(), t => t.IS_PUBLIC == 0 && t.IS_EXCEPT == 0)
.WhereIF(!string.IsNullOrWhiteSpace(QuerySearch.Status), t => t.STATUS.Equals(QuerySearch.Status, StringComparison.OrdinalIgnoreCase))
.OrderBy(entityOrderCol + (QuerySearch.descSort ? " asc " : " desc "))
.ToPagedListAsync(QuerySearch.PageNo, QuerySearch.PageSize);
return new
{
PageNo = entities.PageIndex,
PageSize = entities.PageSize,
TotalPage = entities.TotalPages,
TotalRows = entities.TotalCount,
Rows = entities.Items.Select(t => t.Adapt<TaskBaseInfoDto>()).ToList()
};
return entities.Adapt<SqlSugarPagedList<TaskBaseInfoDto>>();
}
#endregion
@ -2214,6 +2217,120 @@ namespace Myshipping.Application
*/
}
#endregion
#region 获取航次账单详情
/// <summary>
/// 获取航次账单详情
/// </summary>
/// <param name="taskPKId">任务主键</param>
/// <returns>返回结果</returns>
[HttpGet("/TaskManage/GetInvoiceBillInfo")]
public async Task<TaskInvoiceBillBaseInfo> GetInvoiceBillInfo([FromQuery] string taskPKId)
{
TaskInvoiceBillBaseInfo model = new TaskInvoiceBillBaseInfo();
string batchNo = IDGen.NextID().ToString();
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.INVOICE_BILL_MAIL.ToString())
Oops.Oh($"当前任务类型不是{TaskBusiTypeEnum.INVOICE_BILL_MAIL.GetDescription()}");
var orderInfo = _bookingOrderRepository.AsQueryable()
.First(t => t.Id == long.Parse(taskInfo.BOOK_ORDER_NO));
model.TaskId = taskInfo.PK_ID;
if (orderInfo != null)
{
//订舱
model.BookingOrder = orderInfo.Adapt<TaskBookingOrderDto>();
}
//获取文件
var fileList = _taskFileInfoRepository.AsQueryable().Where(t => t.TASK_PKID == taskInfo.PK_ID).ToList();
model.TaskFile = fileList.Adapt<List<TaskManageOrderFileInfo>>();
var feeList = _taskBillFeeDetailInfoRepository.AsQueryable().Where(t => t.TASK_PKID == taskInfo.PK_ID).ToList();
model.FeeList = feeList.Where(t => t.IS_TOTAL == 0).Select(t=>t.Adapt<TaskInvoiceBillFeeDto>()).ToList();
var totalUSD = feeList.FirstOrDefault(t => t.IS_TOTAL == 1 && t.FEE_NAME == "TotalUSD" && t.CURRENCY == "USD");
model.TotalAmountUSD = totalUSD != null ? totalUSD.TOTAL_AMOUNT : 0;
var totalCNY = feeList.FirstOrDefault(t => t.IS_TOTAL == 1 && t.FEE_NAME == "TotalCNY" && t.CURRENCY == "CNY");
model.TotalAmountCNY = totalCNY != null ? totalCNY.TOTAL_AMOUNT : 0;
model.InvoiceBillSendList = new List<TaskInvoiceBillFileHis>();
}
catch (Exception ex)
{
throw Oops.Bah($"获取获取航次账单详情异常,{0}", ex.Message);
}
return model;
}
#endregion
/// <summary>
/// 获取单票账单详情
/// </summary>
/// <param name="taskPKId">任务主键</param>
/// <returns>返回结果</returns>
public async Task<TaskPerBillResultInfo> GetTaskPerBillInfo(string taskPKId)
{
TaskPerBillResultInfo model = new TaskPerBillResultInfo();
string batchNo = IDGen.NextID().ToString();
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.PER_BILL.ToString())
Oops.Oh($"当前任务类型不是{TaskBusiTypeEnum.PER_BILL.GetDescription()}");
var orderInfo = _bookingOrderRepository.AsQueryable()
.First(t => t.Id == long.Parse(taskInfo.BOOK_ORDER_NO));
model.TaskId = taskInfo.PK_ID;
if (orderInfo != null)
{
//订舱
model.BookingOrder = orderInfo.Adapt<TaskBookingOrderDto>();
}
//获取文件
var fileList = _taskFileInfoRepository.AsQueryable().Where(t => t.TASK_PKID == taskInfo.PK_ID).ToList();
model.TaskFile = fileList.Adapt<List<TaskManageOrderFileInfo>>();
var feeList = _taskBillFeeDetailInfoRepository.AsQueryable().Where(t => t.TASK_PKID == taskInfo.PK_ID).ToList();
model.FeeList = feeList.Where(t => t.IS_TOTAL == 0).Select(t => t.Adapt<TaskPerBillFeeDto>()).ToList();
}
catch (Exception ex)
{
throw Oops.Bah($"获取获取单票账单详情异常,{0}", ex.Message);
}
return model;
}
}
#region 样本业务提取帮助类

Loading…
Cancel
Save