wanghaomei 2 years ago
commit 2857eaa867

@ -12042,6 +12042,56 @@
提单用纸数
</summary>
</member>
<member name="T:Myshipping.Application.LaraPaperRegistPostDto">
<summary>
</summary>
</member>
<member name="P:Myshipping.Application.LaraPaperRegistPostDto.NumberFrom">
<summary>
</summary>
</member>
<member name="P:Myshipping.Application.LaraPaperRegistPostDto.NumberTo">
<summary>
</summary>
</member>
<member name="P:Myshipping.Application.LaraPaperRegistPostDto.PageNumbers">
<summary>
</summary>
</member>
<member name="P:Myshipping.Application.LaraPaperRegistPostDto.PageSum">
<summary>
</summary>
</member>
<member name="P:Myshipping.Application.LaraPaperRegistPostDto.ORDNO">
<summary>
</summary>
</member>
<member name="P:Myshipping.Application.LaraPaperRegistPostDto.TaskId">
<summary>
</summary>
</member>
<member name="P:Myshipping.Application.LaraPaperRegistPostDto.MBLNO">
<summary>
</summary>
</member>
<member name="P:Myshipping.Application.LaraPaperRegistPostDto.OriginalDownTime">
<summary>
</summary>
</member>
<member name="P:Myshipping.Application.LaraPaperRegistPostDto.ISSUETYPE">
<summary>
</summary>
</member>
<member name="T:Myshipping.Application.QueryTaskManageDto">
<summary>
我的任务查询
@ -12971,6 +13021,21 @@
<param name="PKIds">任务主键数组</param>
<returns>返回结果</returns>
</member>
<member name="M:Myshipping.Application.ITaskManageService.LaraPaperRegist(System.String[])">
<summary>
LARA提单纸登记
</summary>
<param name="PKIds">任务主键数组</param>
<returns>返回结果</returns>
</member>
<member name="M:Myshipping.Application.ITaskManageService.LaraPaperRegistPost(System.String,Myshipping.Application.LaraPaperRegistPostDto)">
<summary>
请求提单纸登记
</summary>
<param name="taskPKIds">任务主键</param>
<param name="model">提单纸登记请求参数</param>
<returns></returns>
</member>
<member name="T:Myshipping.Application.TaskManageService">
<summary>
任务管理
@ -13073,5 +13138,20 @@
<param name="PKIds">任务主键数组</param>
<returns>返回结果</returns>
</member>
<member name="M:Myshipping.Application.TaskManageService.LaraPaperRegistPost(System.String,Myshipping.Application.LaraPaperRegistPostDto)">
<summary>
请求提单纸登记
</summary>
<param name="taskPKIds">任务主键</param>
<param name="model">提单纸登记请求参数</param>
<returns></returns>
</member>
<member name="M:Myshipping.Application.TaskManageService.LaraPaperRegist(System.String[])">
<summary>
LARA提单纸登记
</summary>
<param name="PKIds">任务主键数组</param>
<returns>返回结果</returns>
</member>
</members>
</doc>

@ -60,14 +60,29 @@ namespace Myshipping.Application
#region 上传数据
/// <summary>
/// 同步客户
/// </summary>
/// <param name="model"></param>
/// <returns></returns>
[HttpPost("/DataSync/SyncCustomer"), ApiUser]
public async Task<long> SyncCustomer(DjyCustomerSyncDto model)
{
return 0;
}
#endregion
#region 下载数据

@ -0,0 +1,59 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Myshipping.Application
{
/// <summary>
///
/// </summary>
public class LaraPaperRegistPostDto
{
/// <summary>
///
/// </summary>
public string NumberFrom { get; set; }
/// <summary>
///
/// </summary>
public string NumberTo { get; set; }
/// <summary>
///
/// </summary>
public string PageNumbers { get; set; }
/// <summary>
///
/// </summary>
public int PageSum { get; set; }
/// <summary>
///
/// </summary>
public string ORDNO { get; set; }
/// <summary>
///
/// </summary>
public string TaskId { get; set; }
/// <summary>
///
/// </summary>
public string MBLNO { get; set; }
/// <summary>
///
/// </summary>
public DateTime OriginalDownTime { get; set; } = DateTime.MinValue;
/// <summary>
///
/// </summary>
public string ISSUETYPE { get; set; }
}
}

@ -1,5 +1,8 @@
using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Mvc;
using NPOI.POIFS.Crypt.Dsig;
using NPOI.SS.Formula.Functions;
using SqlSugar;
using System;
using System.Collections.Generic;
using System.Linq;
@ -78,5 +81,21 @@ namespace Myshipping.Application
/// <returns>返回结果</returns>
Task<List<LaraPaperCalcInfo>> LaraPaperCalc(string[] PKIds);
/// <summary>
/// LARA提单纸登记
/// </summary>
/// <param name="PKIds">任务主键数组</param>
/// <returns>返回结果</returns>
Task<TaskManageOrderResultDto> LaraPaperRegist(string[] PKIds);
/// <summary>
/// 请求提单纸登记
/// </summary>
/// <param name="taskPKIds">任务主键</param>
/// <param name="model">提单纸登记请求参数</param>
/// <returns></returns>
Task<TaskManageOrderResultDto> LaraPaperRegistPost(string taskPKIds, LaraPaperRegistPostDto model);
}
}

@ -53,7 +53,9 @@ namespace Myshipping.Application
private readonly SqlSugarRepository<TaskStatManageInfo> _taskStatManageInfoRepository;
private readonly SqlSugarRepository<TaskOriginalDownloadHisInfo> _taskOriginalDownloadHisInfoRepository;
private readonly SqlSugarRepository<TaskChargesHisInfo> _taskChargesHisInfoRepository;
private readonly SqlSugarRepository<BookingOrder> _bookingOrderRepository;
private readonly IDjyWebsiteAccountConfigService _webAccountConfig;
private readonly ISysCacheService _cache;
private readonly ILogger<BookingOrderService> _logger;
@ -72,6 +74,7 @@ namespace Myshipping.Application
SqlSugarRepository<TaskStatManageInfo> taskStatManageInfoRepository,
SqlSugarRepository<TaskOriginalDownloadHisInfo> taskOriginalDownloadHisInfoRepository,
SqlSugarRepository<TaskChargesHisInfo> taskChargesHisInfoRepository,
SqlSugarRepository<BookingOrder> bookingOrderRepository,
IDjyWebsiteAccountConfigService webAccountConfig,
ISysCacheService cache,
ILogger<BookingOrderService> logger)
@ -87,6 +90,7 @@ namespace Myshipping.Application
_taskStatManageInfoRepository = taskStatManageInfoRepository;
_taskOriginalDownloadHisInfoRepository = taskOriginalDownloadHisInfoRepository;
_taskChargesHisInfoRepository = taskChargesHisInfoRepository;
_bookingOrderRepository = bookingOrderRepository;
_webAccountConfig = webAccountConfig;
_cache = cache;
@ -1099,12 +1103,13 @@ namespace Myshipping.Application
}
#endregion
#region 提单纸页数计算
/// <summary>
/// 提单纸页数计算
/// </summary>
/// <param name="PKIds">任务主键数组</param>
/// <returns>返回结果</returns>
[HttpPost("/TaskManage/LaraPaperCalc")]
public async Task<List<LaraPaperCalcInfo>> LaraPaperCalc(string[] PKIds)
{
List<LaraPaperCalcInfo> list = new List<LaraPaperCalcInfo>();
@ -1122,18 +1127,40 @@ namespace Myshipping.Application
if (mblnoList.Count > 0)
{
//根据主单号获取任务类型是DRAFT的任务取时间最新的
var taskList = _taskBaseInfoRepository.AsQueryable()
.LeftJoin(_taskFileInfoRepository.AsQueryable(), (tsk, file) => tsk.PK_ID == file.TASK_PKID)
.Where((tsk, file) => PKIds.Contains(tsk.PK_ID) && tsk.TASK_TYPE == TaskBusiTypeEnum.DRAFT.ToString() && file != null)
.OrderByDescending(tsk => tsk.CreatedTime)
var fileList = _taskBaseInfoRepository.EntityContext.Queryable<TaskBaseInfo>()
.InnerJoin<TaskFileInfo>((tsk, file) => tsk.PK_ID == file.TASK_PKID)
.Where((tsk, file) =>
tsk.TASK_TYPE == TaskBusiTypeEnum.DRAFT.ToString() && mblnoList.Contains(tsk.MBL_NO))
.Select((tsk, file) => new { tsk = tsk, file = file }).ToList();
var calcList = fileList.GroupBy(t => t.tsk.PK_ID)
.Select(a =>
{
var currList = a.ToList();
return new
{
tsk = currList.FirstOrDefault().tsk,
clist = a.Select(x => x.file).ToList()
};
}).OrderByDescending(t => t.tsk.CreatedTime).ToList();
list = mblnoList.Select((mbl,idx) => {
list = mblnoList.Select((mbl, idx) =>
{
var calcInfo = new LaraPaperCalcInfo();
calcInfo.MBLNo = mbl;
calcInfo.Indx = idx + 1;
var files = calcList.FirstOrDefault(t => t.tsk.MBL_NO.Equals(mbl, StringComparison.OrdinalIgnoreCase));
if (files != null)
{
calcInfo.DraftNum = files.clist.Select(t => t.FILE_NAME.GetPageNum()).Sum();
}
calcInfo.PaperNum = calcInfo.DraftNum * 3;
return calcInfo;
}).ToList();
@ -1141,12 +1168,87 @@ namespace Myshipping.Application
}
catch (Exception ex)
{
throw Oops.Bah($"完成任务异常,{0}", ex.Message);
throw Oops.Bah($"提单纸页数计算异常,{0}", ex.Message);
}
return list;
}
#endregion
/// <summary>
/// 请求提单纸登记
/// </summary>
/// <param name="taskPKIds">任务主键</param>
/// <param name="model">提单纸登记请求参数</param>
/// <returns></returns>
public async Task<TaskManageOrderResultDto> LaraPaperRegistPost(string taskPKIds, LaraPaperRegistPostDto model)
{
TaskManageOrderResultDto result = new TaskManageOrderResultDto();
string batchNo = IDGen.NextID().ToString();
_logger.LogInformation("批次={no} id={id} LARA提单纸登记开始", batchNo, taskPKIds);
try
{
}
catch (Exception ex)
{
throw Oops.Bah($"请求提单纸登记异常,{0}", ex.Message);
}
return result;
}
#region LARA提单纸登记
/// <summary>
/// LARA提单纸登记
/// </summary>
/// <param name="PKIds">任务主键数组</param>
/// <returns>返回结果</returns>
public async Task<TaskManageOrderResultDto> LaraPaperRegist(string[] PKIds)
{
TaskManageOrderResultDto result = new TaskManageOrderResultDto();
string batchNo = IDGen.NextID().ToString();
_logger.LogInformation("批次={no} ids={ids} LARA提单纸登记开始", batchNo, string.Join(",", PKIds));
try
{
}
catch (Exception ex)
{
throw Oops.Bah($"LARA提单纸登记异常,{0}", ex.Message);
}
return result;
}
#endregion
}
public static class DraftPaperExtension
{
public static int GetPageNum(this string Name)
{
try
{
if (string.IsNullOrWhiteSpace(Name))
return 0;
string s = Regex.Replace(Name.Substring(Name.LastIndexOf('-') + 1), "\\.[a-zA-Z]+", "");
return int.Parse(s);
}
catch(Exception ex)
{
throw Oops.Bah($"文件名{0} 取页数异常,{1}", Name, ex.Message);
}
}
}
}

@ -779,7 +779,7 @@ public class CommonDBService : ICommonDBService, IDynamicApiController, ITransie
public async Task AddOrUpdateMappingPackage([FromBody] MappingPackageDto dto)
{
var list = await _sysCacheService.GetAllMappingPackage();
var count = list.Where(x => x.Code == dto.Code && x.Module == dto.Module && x.GID != dto.GID).Count();
var count = list.Where(x => x.Code == dto.Code && x.Module == dto.Module &&x.CarrierCode==dto.CarrierCode && x.GID != dto.GID).Count();
if (count > 0)
{
throw Oops.Bah(ErrorCode.D1006);

Loading…
Cancel
Save