|
|
|
@ -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 样本业务提取帮助类
|
|
|
|
|