jianghaiqing 10 months ago
commit 4efdff7f9b

@ -9855,7 +9855,7 @@ namespace Myshipping.Application
await _rep.AsUpdateable(order).IgnoreColumns().ExecuteCommandAsync();
// 记录日志
await SaveLog(order, oldOrder, "即时刷新船期");
await SaveLog(order, oldOrder, "手动刷新船期");
await SendBookingOrder(new long[] { Id });
if (!string.IsNullOrEmpty(order.VESSEL) && !string.IsNullOrEmpty(order.VOYNO))
@ -9979,7 +9979,8 @@ namespace Myshipping.Application
await _rep.UpdateAsync(x => x.Id == bookingId, x => new BookingOrder { BSSTATUSNAME = StatusName });
// 记录日志
var newOrder = new BookingOrder() { BSSTATUSNAME = StatusName };
var newOrder = order.Adapt<BookingOrder>();
newOrder.BSSTATUSNAME = StatusName;
await SaveLog(newOrder, order, "更新货物状态");
}
}
@ -10486,6 +10487,8 @@ namespace Myshipping.Application
var model = _rep.AsQueryable().Filter(null, true)
.First(a => a.Id == bookingId);
var oldModel = model.Adapt<BookingOrder>();
model.BSSTATUSNAME = maxStatus.ShowName;
//model.VERSION = IDGen.NextID().ToString().Replace("-", "");
@ -10497,6 +10500,9 @@ namespace Myshipping.Application
//it.VERSION
}).ExecuteCommand();
// 保存日志
await SaveLog(model, oldModel, "设置货物状态");
//推送东胜
if (isAutoSyncDS)
await SendBookingOrder(new long[] { bookingId });
@ -10577,6 +10583,8 @@ namespace Myshipping.Application
var model = _rep.AsQueryable().Filter(null, true)
.First(a => a.Id == bookingId);
var oldModel = model.Adapt<BookingOrder>();
if (maxStatus != null)
{
model.BSSTATUSNAME = maxStatus.ShowName;
@ -10596,6 +10604,9 @@ namespace Myshipping.Application
//it.VERSION
}).ExecuteCommand();
// 保存日志
await SaveLog(model, oldModel, "取消设置货物状态");
//推送东胜
if (isAutoSyncDS)
//推送东胜
@ -10611,8 +10622,9 @@ namespace Myshipping.Application
/// </summary>
/// <param name="bookingId"></param>
/// <param name="isAutoSyncDS">是否默认同步东胜 true-自动同步 false-不自动同步</param>
/// <param name="fromFunc">调用方模块名</param>
/// <returns></returns>
public async Task SetBookingGoodsStatus(long bookingId, bool isAutoSyncDS = false)
public async Task SetBookingGoodsStatus(long bookingId, bool isAutoSyncDS = false, string fromFunc = null)
{
var bookingOrder = _rep.AsQueryable().Filter(null, true)
.First(a => a.Id == bookingId);
@ -10639,6 +10651,8 @@ namespace Myshipping.Application
var model = _rep.AsQueryable().Filter(null, true)
.First(a => a.Id == bookingId);
var oldModel = model.Adapt<BookingOrder>();
if (maxStatus != null)
{
model.BSSTATUSNAME = maxStatus.ShowName;
@ -10658,6 +10672,9 @@ namespace Myshipping.Application
//it.VERSION
}).ExecuteCommand();
// 保存日志
await SaveLog(model, oldModel, fromFunc);
//推送东胜
if (isAutoSyncDS)
//推送东胜

@ -7,44 +7,29 @@ using Furion.FriendlyException;
using Furion.JsonSerialization;
using Furion.RemoteRequest.Extensions;
using Mapster;
using MathNet.Numerics;
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc;
using Microsoft.AspNetCore.Rewrite;
using Microsoft.Extensions.Logging;
using Microsoft.Extensions.Options;
using Myshipping.Application.ConfigOption;
using Myshipping.Application.Entity;
using Myshipping.Application.Service.BookingOrder.Dto;
using Myshipping.Core;
using Myshipping.Core.Entity;
using Myshipping.Core.Service;
using MySqlX.XDevAPI.Common;
using NPOI.SS.Formula.Functions;
using Org.BouncyCastle.Crypto;
using Org.BouncyCastle.Utilities;
using SqlSugar;
using StackExchange.Profiling.Internal;
using System;
using System.Collections.Generic;
using System.Collections.Specialized;
using System.Diagnostics;
using System.IO;
using System.Linq;
using System.Net.Http;
using System.Net.NetworkInformation;
using System.Reflection.Metadata;
using System.Reflection.Metadata.Ecma335;
using System.Runtime.InteropServices;
using System.Text;
using System.Text.Json;
using System.Text.RegularExpressions;
using System.Threading;
using System.Threading.Tasks;
using System.Web;
using Ubiety.Dns.Core;
using Yitter.IdGenerator;
using static Aliyun.OSS.Model.CreateSelectObjectMetaInputFormatModel;
namespace Myshipping.Application
{
@ -124,7 +109,7 @@ namespace Myshipping.Application
/// <param name="bookingIds">订舱主键数组</param>
/// <returns>返回回执</returns>
[HttpPost("/BookingValueAdded/DownloadBookingConfirm")]
public async Task<TaskManageOrderResultDto> DownloadBookingConfirm([FromBody]long[] bookingIds)
public async Task<TaskManageOrderResultDto> DownloadBookingConfirm([FromBody] long[] bookingIds)
{
TaskManageOrderResultDto result = new TaskManageOrderResultDto();
@ -152,7 +137,7 @@ namespace Myshipping.Application
foreach (var bk in list)
{
var sortNo = noList.FirstOrDefault(a=>a.id == bk.Id).no;
var sortNo = noList.FirstOrDefault(a => a.id == bk.Id).no;
taskList.Add(Task.Run(() => InnerDownloadBookingConfirm(bk, batchNo, sortNo)));
}
@ -188,7 +173,7 @@ namespace Myshipping.Application
result.batchTotal = "- ";
}
if(fail > 0)
if (fail > 0)
{
result.batchTotal += "/" + fail.ToString();
}
@ -214,7 +199,7 @@ namespace Myshipping.Application
/// <param name="batchNo">批次号</param>
/// <param name="sortNo">请求顺序号</param>
/// <returns>返回回执</returns>
private async Task<TaskManageOrderResultDto> InnerDownloadBookingConfirm(BookingOrder bookingOrder,string batchNo, int sortNo)
private async Task<TaskManageOrderResultDto> InnerDownloadBookingConfirm(BookingOrder bookingOrder, string batchNo, int sortNo)
{
TaskManageOrderResultDto result = new TaskManageOrderResultDto();
@ -277,7 +262,7 @@ namespace Myshipping.Application
string webKey = string.Format(CONST_FORMAT_WEB, bcOrDraftRouteCfg.MapCode);
//获取个人对应的账户,这里GetAccountConfig逻辑优先取个人个人没有配置取公司对应配置
var userWebAccountConfig = GetAccountConfig(webKey, UserManager.UserId,UserManager.TENANT_ID).GetAwaiter()
var userWebAccountConfig = GetAccountConfig(webKey, UserManager.UserId, UserManager.TENANT_ID).GetAwaiter()
.GetResult();
_logger.LogInformation("批次={no} 获取获取网站的账户完成result={Num}", batchNo, JSON.Serialize(userWebAccountConfig));
@ -306,7 +291,7 @@ namespace Myshipping.Application
var timeDiff = ts.TotalMilliseconds;
_logger.LogInformation("批次={no} result={result} 请求BC远端下载结束 耗时:{timeDiff}ms. ", batchNo,
JSON.Serialize(rlt),timeDiff);
JSON.Serialize(rlt), timeDiff);
if (rlt.code == 200)
{
@ -420,7 +405,7 @@ namespace Myshipping.Application
/// <param name="bookingIds">订舱主键数组</param>
/// <returns></returns>
[HttpPost("/BookingValueAdded/DownloadDraft")]
public async Task<TaskManageOrderResultDto> DownloadDraft([FromBody]long[] bookingIds)
public async Task<TaskManageOrderResultDto> DownloadDraft([FromBody] long[] bookingIds)
{
TaskManageOrderResultDto result = new TaskManageOrderResultDto();
List<Task<TaskManageOrderResultDto>> taskList = new List<Task<TaskManageOrderResultDto>>();
@ -447,7 +432,7 @@ namespace Myshipping.Application
var noList = bookingIds.Select((a, idx) => new { no = idx + 1, id = a }).ToList();
foreach (var bk in list)
{
var sortNo = noList.FirstOrDefault(a=>a.id == bk.Id).no;
var sortNo = noList.FirstOrDefault(a => a.id == bk.Id).no;
taskList.Add(Task.Run(() => InnerDownloadDraft(bk, batchNo, sortNo)));
}
@ -509,7 +494,7 @@ namespace Myshipping.Application
/// <param name="batchNo">批次号</param>
/// <param name="sortNo">请求顺序号</param>
/// <returns>返回回执</returns>
private async Task<TaskManageOrderResultDto> InnerDownloadDraft(BookingOrder bookingOrder, string batchNo,int sortNo)
private async Task<TaskManageOrderResultDto> InnerDownloadDraft(BookingOrder bookingOrder, string batchNo, int sortNo)
{
TaskManageOrderResultDto result = new TaskManageOrderResultDto();
@ -524,9 +509,9 @@ namespace Myshipping.Application
4
5
*/
if(bookingOrder.CARRIERID.Equals("ESL", StringComparison.OrdinalIgnoreCase))
if (bookingOrder.CARRIERID.Equals("ESL", StringComparison.OrdinalIgnoreCase))
{
if(string.IsNullOrWhiteSpace(bookingOrder.TMBLNO))
if (string.IsNullOrWhiteSpace(bookingOrder.TMBLNO))
{
if (!string.IsNullOrWhiteSpace(bookingOrder.CUSTNO))
{
@ -602,7 +587,7 @@ namespace Myshipping.Application
string downloadFilePathRlt = string.Empty;
string erroMsg = string.Empty;
if(bcOrDraftRouteCfg.MapCode.Trim().Equals("ESL", StringComparison.OrdinalIgnoreCase))
if (bcOrDraftRouteCfg.MapCode.Trim().Equals("ESL", StringComparison.OrdinalIgnoreCase))
{
ESLDraftRequestDto requestDto = new ESLDraftRequestDto
{
@ -764,7 +749,8 @@ namespace Myshipping.Application
{
_logger.LogInformation("批次={no} 对应请求报文 request={res}", batchNo, JSON.Serialize(info));
var res = await url.OnClientCreating(client => {
var res = await url.OnClientCreating(client =>
{
// client 为 HttpClient 对象
client.Timeout = TimeSpan.FromMinutes(15); // 设置超时时间 15分钟
}).SetHttpMethod(HttpMethod.Post)
@ -816,7 +802,8 @@ namespace Myshipping.Application
{
_logger.LogInformation("批次={no} 对应请求报文 request={res}", batchNo, JSON.Serialize(info));
var res = await url.OnClientCreating(client => {
var res = await url.OnClientCreating(client =>
{
// client 为 HttpClient 对象
client.Timeout = TimeSpan.FromMinutes(15); // 设置超时时间 15分钟
}).SetHttpMethod(HttpMethod.Post)
@ -869,10 +856,11 @@ namespace Myshipping.Application
{
_logger.LogInformation("批次={no} 对应请求报文 request={res}", batchNo, JSON.Serialize(info));
var res = await url.OnClientCreating(client => {
var res = await url.OnClientCreating(client =>
{
// client 为 HttpClient 对象
client.Timeout = TimeSpan.FromMinutes(15); // 设置超时时间 15分钟
}).SetHttpMethod(HttpMethod.Post)
client.Timeout = TimeSpan.FromMinutes(15); // 设置超时时间 15分钟
}).SetHttpMethod(HttpMethod.Post)
.SetBody(JSON.Serialize(info), "application/json")
.SetContentEncoding(Encoding.UTF8)
.PostAsync();
@ -918,7 +906,8 @@ namespace Myshipping.Application
{
_logger.LogInformation("批次={no} 对应请求报文 request={res}", batchNo, JSON.Serialize(info));
var res = await url.OnClientCreating(client => {
var res = await url.OnClientCreating(client =>
{
// client 为 HttpClient 对象
client.Timeout = TimeSpan.FromMinutes(15); // 设置超时时间 15分钟
}).SetHttpMethod(HttpMethod.Post)
@ -1146,7 +1135,7 @@ namespace Myshipping.Application
if (rlt.status == 1)
{
if(rlt.data == null || string.IsNullOrWhiteSpace(rlt.data.esl_no))
if (rlt.data == null || string.IsNullOrWhiteSpace(rlt.data.esl_no))
{
_logger.LogInformation("批次={no} 舱位分配查询失败ESL号不存在", batchNo);
@ -1159,7 +1148,7 @@ namespace Myshipping.Application
*/
var bkInfo = _bookingOrderRepository.AsQueryable().First(a => a.Id == bookingOrder.Id);
if(bkInfo == null)
if (bkInfo == null)
{
_logger.LogInformation("批次={no} id={id} 订舱信息获取失败,无法更新", batchNo, bookingOrder.Id);
@ -1383,7 +1372,8 @@ namespace Myshipping.Application
{
_logger.LogInformation("批次={no} 对应请求报文 request={res}", batchNo, JSON.Serialize(info));
var res = await url.OnClientCreating(client => {
var res = await url.OnClientCreating(client =>
{
// client 为 HttpClient 对象
client.Timeout = TimeSpan.FromMinutes(15); // 设置超时时间 15分钟
}).SetHttpMethod(HttpMethod.Post)
@ -1419,7 +1409,7 @@ namespace Myshipping.Application
/// <param name="userId">用户ID</param>
/// <param name="tendId">租户ID</param>
/// <returns>返回账户配置</returns>
private async Task<DjyWebsiteAccountConfig> GetAccountConfig(string typeCode,long userId,long tendId)
private async Task<DjyWebsiteAccountConfig> GetAccountConfig(string typeCode, long userId, long tendId)
{
DjyWebsiteAccountConfig accountConfig = new DjyWebsiteAccountConfig();
accountConfig = await _djyWebsiteAccountConfigRepository.EntityContext.CopyNew().Queryable<DjyWebsiteAccountConfig>()
@ -1455,12 +1445,12 @@ namespace Myshipping.Application
2BC
*/
if(bookingOrderId < 0)
if (bookingOrderId < 0)
throw Oops.Oh($"订舱主键不能为空");
var bookingOrder = _bookingOrderRepository.AsQueryable().First(a => a.Id == bookingOrderId);
if(bookingOrder == null)
if (bookingOrder == null)
throw Oops.Oh($"订舱信息获取失败,订舱信息不存在或已作废");
//获取解析BC文件链接
@ -1501,11 +1491,11 @@ namespace Myshipping.Application
{
var currBC = bcParseRlt.data.BCList.FirstOrDefault();
if(!string.IsNullOrWhiteSpace(currBC.Vessel) && Regex.IsMatch(currBC.Vessel, "\\(||\\)||\\n"))
if (!string.IsNullOrWhiteSpace(currBC.Vessel) && Regex.IsMatch(currBC.Vessel, "\\(||\\)||\\n"))
{
if(Regex.IsMatch(currBC.Vessel, "\\(||\\)|"))
if (Regex.IsMatch(currBC.Vessel, "\\(||\\)|"))
{
currBC.Vessel = Regex.Match(currBC.Vessel,"\\w+\\s?\\n?\\s?\\w+(?=\\()").Value;
currBC.Vessel = Regex.Match(currBC.Vessel, "\\w+\\s?\\n?\\s?\\w+(?=\\()").Value;
}
if (Regex.IsMatch(currBC.Vessel, "\\n"))
@ -1526,7 +1516,8 @@ namespace Myshipping.Application
ETD = currBC.ETD
};
singleBCDto.BookingOrderBCDto = new BookingOrderBCDto {
singleBCDto.BookingOrderBCDto = new BookingOrderBCDto
{
MBLNO = bookingOrder.MBLNO,
CUSTNO = bookingOrder.CUSTNO,
CLOSEDOCDATE = bookingOrder.CLOSEDOCDATE,
@ -1542,7 +1533,7 @@ namespace Myshipping.Application
*/
//读取文件配置
var fileFullName = await FileAttachHelper.TempSaveWebFile(bookingOrder.Id.ToString(), file, batchNo);
var fileFullName = await FileAttachHelper.TempSaveWebFile(bookingOrder.Id.ToString(), file, batchNo);
_logger.LogInformation("批次={no} 完成文件保存 filepath={path}", batchNo, fileFullName);
@ -1557,7 +1548,7 @@ namespace Myshipping.Application
result.msg = $"解析BC失败原因{bcParseRlt.message}";
}
}
catch(Exception ex)
catch (Exception ex)
{
_logger.LogInformation("批次={no} 解析BC异常原因{error} ", batchNo, ex.Message);
@ -1580,7 +1571,7 @@ namespace Myshipping.Application
try
{
var response = await requestUrl.SetContentType("multipart/form-data")
var response = await requestUrl.SetContentType("multipart/form-data")
.SetBodyBytes((fileInfo.file.ToString(), fileInfo.fileBytes, HttpUtility.UrlEncode(fileInfo.fileName.ToString())))
.PostAsync();
@ -1637,7 +1628,7 @@ namespace Myshipping.Application
if (bookingOrder == null)
throw Oops.Bah($"订舱信息获取失败,订舱信息不存在或已作废");
var updateRlt = InnerBCUpdateBookingOrder(model, bookingOrder, batchNo,1).GetAwaiter().GetResult();
var updateRlt = InnerBCUpdateBookingOrder(model, bookingOrder, batchNo, 1).GetAwaiter().GetResult();
if (!updateRlt.succ)
throw Oops.Bah($"订舱信息更新失败,{updateRlt.msg}");
@ -1671,7 +1662,7 @@ namespace Myshipping.Application
var letterYardModel = _bookingLetteryardRepository.AsQueryable()
.First(x => x.BookingId == model.BookingOrderId);
if(letterYardModel != null)
if (letterYardModel != null)
letterYardDto.Id = letterYardModel.Id;
}
@ -1696,7 +1687,7 @@ namespace Myshipping.Application
//重新将暂存文件写入正式路径
//读取文件配置
var bookFilePath = await FileAttachHelper.MoveFile(bookingOrder.Id.ToString(), model.FileTempPath,batchNo);
var bookFilePath = await FileAttachHelper.MoveFile(bookingOrder.Id.ToString(), model.FileTempPath, batchNo);
//将BC引入的文件写入订舱的附件
await SaveEDIFile(bookingOrder.Id, bookFilePath, new System.IO.FileInfo(bookFilePath).Name,
@ -1729,7 +1720,7 @@ namespace Myshipping.Application
/// <param name="sortNo">顺序号</param>
/// <returns>返回回执</returns>
private async Task<TaskManageOrderResultDto> InnerBCUpdateBookingOrder(SingleBCDto model, BookingOrder bookingOrder,
string batchNo,int sortNo)
string batchNo, int sortNo)
{
TaskManageOrderResultDto result = new TaskManageOrderResultDto();
@ -1850,7 +1841,7 @@ namespace Myshipping.Application
/// <param name="batchBCList">批量BC更新列表</param>
/// <returns>返回回执</returns>
[HttpPost("/BookingValueAdded/BatchBCUpdate")]
public async Task<TaskManageOrderResultDto> BatchBCUpdate([FromBody]List<BatchBCDto> batchBCList)
public async Task<TaskManageOrderResultDto> BatchBCUpdate([FromBody] List<BatchBCDto> batchBCList)
{
TaskManageOrderResultDto result = new TaskManageOrderResultDto();
List<Task<TaskManageOrderResultDto>> taskList = new List<Task<TaskManageOrderResultDto>>();
@ -1859,7 +1850,7 @@ namespace Myshipping.Application
try
{
var bcTaskList = batchBCList.Select(a=>a.bcPKId).Distinct().ToList();
var bcTaskList = batchBCList.Select(a => a.bcPKId).Distinct().ToList();
var bkOrderList = batchBCList.Select(a => a.bkOrderId.Value).Distinct().ToList();
var bklist = _bookingOrderRepository.AsQueryable()
@ -1876,11 +1867,13 @@ namespace Myshipping.Application
{
var sortNo = noList.FirstOrDefault(a => a.id == bk.Id).no;
var currBC = batchBCList.Join(bclist, l => l.bcPKId, r => r.PK_ID, (l, r) => {
var currBC = batchBCList.Join(bclist, l => l.bcPKId, r => r.PK_ID, (l, r) =>
{
return r;
}).FirstOrDefault();
SingleBCDto singleBCDto = new SingleBCDto {
SingleBCDto singleBCDto = new SingleBCDto
{
BLNo = currBC.MBL_NO,
Vessel = currBC.VESSEL,
Voyage = currBC.VOYNO,
@ -1889,7 +1882,7 @@ namespace Myshipping.Application
VGMCutOffTime = currBC.VGM_CUTOFF_TIME,
ClosingDate = currBC.CUT_SINGLE_TIME
};
taskList.Add(Task.Run(() => InnerBCUpdateBookingOrder(singleBCDto,bk, batchNo, sortNo)));
taskList.Add(Task.Run(() => InnerBCUpdateBookingOrder(singleBCDto, bk, batchNo, sortNo)));
}
Task.WaitAll(taskList.ToArray());
@ -2063,20 +2056,22 @@ namespace Myshipping.Application
try
{
var bookingOrder = _bookingOrderRepository.AsQueryable().Filter(null,true)
.First(a=>a.Id == model.BookingId);
var bookingOrder = _bookingOrderRepository.AsQueryable().Filter(null, true)
.First(a => a.Id == model.BookingId);
if(bookingOrder == null)
if (bookingOrder == null)
throw Oops.Oh($"订舱信息获取失败,订舱信息不存在或已作废");
_logger.LogInformation("批次={no} 请求保存服务项目 modifyjson={msg}", batchNo, JSON.Serialize(model));
TrackingMessageInfo msgInfo = new TrackingMessageInfo {
Head = new TrackingMessageHeadInfo {
TrackingMessageInfo msgInfo = new TrackingMessageInfo
{
Head = new TrackingMessageHeadInfo
{
GID = IDGen.NextID().ToString(),
MessageType = "PROJECT",
ReceiverId = "ServiceProjectStatus",
ReceiverName= "服务项目和状态",
ReceiverName = "服务项目和状态",
SenderId = "BookingOrder",
SenderName = "海运订舱",
RequestDate = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss.fff"),
@ -2097,7 +2092,7 @@ namespace Myshipping.Application
OperUserId = UserManager.UserId.ToString(),
OperUserName = UserManager.Name,
SourceType = TrackingSourceTypeEnum.MANUAL,
ProjectList = model.ProjectCodes.Select(a=> new TrackingMessageMainProjectInfo
ProjectList = model.ProjectCodes.Select(a => new TrackingMessageMainProjectInfo
{
ServiceProjectCode = a,
}).ToList()
@ -2114,7 +2109,7 @@ namespace Myshipping.Application
var timeDiff = ts.TotalMilliseconds;
_logger.LogInformation("批次={no} 请求完成,耗时:{timeDiff}ms. 结果{msg} result={rlt}", batchNo, timeDiff, (rlt.succ ? "成功" : "失败")
,JSON.Serialize(rlt));
, JSON.Serialize(rlt));
if (!rlt.succ)
{
@ -2127,7 +2122,7 @@ namespace Myshipping.Application
}
}
catch(Exception ex)
catch (Exception ex)
{
result.succ = false;
result.msg = $"服务项目保存失败,原因:{ex.Message}";
@ -2309,7 +2304,7 @@ namespace Myshipping.Application
result.succ = true;
result.msg = "推送成功";
await _bookingOrderService.SetBookingGoodsStatus(bookingOrder.Id, true);
await _bookingOrderService.SetBookingGoodsStatus(bookingOrder.Id, true, "手动设置订舱货物状态(启用)");
}
}
@ -2403,7 +2398,7 @@ namespace Myshipping.Application
result.succ = true;
result.msg = "推送成功";
await _bookingOrderService.SetBookingGoodsStatus(bookingOrder.Id, true);
await _bookingOrderService.SetBookingGoodsStatus(bookingOrder.Id, true, "手动设置订舱货物状态(取消)");
}
}
@ -2439,7 +2434,8 @@ namespace Myshipping.Application
DateTime bDate = DateTime.Now;
QueryServiceProjectWithStatus queryInfo = new QueryServiceProjectWithStatus {
QueryServiceProjectWithStatus queryInfo = new QueryServiceProjectWithStatus
{
BookingId = model.BookingId,
QueryType = TrackingQueryTypeEnum.QUERY_SERVICE_PROJECT,
TenantId = bookingOrder.TenantId.Value
@ -2451,9 +2447,9 @@ namespace Myshipping.Application
TimeSpan ts = eDate.Subtract(bDate);
var timeDiff = ts.TotalMilliseconds;
_logger.LogInformation("批次={no} id={id} 单票请求服务项目结果 耗时:{timeDiff}ms. ", batchNo, model.BookingId,timeDiff);
_logger.LogInformation("批次={no} id={id} 单票请求服务项目结果 耗时:{timeDiff}ms. ", batchNo, model.BookingId, timeDiff);
}
catch(Exception ex)
catch (Exception ex)
{
result.succ = false;
result.msg = $"获取服务项目列表失败,原因:{ex.Message}";
@ -2537,9 +2533,9 @@ namespace Myshipping.Application
try
{
var rlt = await _bookingOrderService.SendBookingOrder(ids);
var rlt = await _bookingOrderService.SendBookingOrder(ids);
if(rlt != null)
if (rlt != null)
{
result.succ = true;
result.msg = "同步完成";
@ -2605,7 +2601,7 @@ namespace Myshipping.Application
var curStr = reader.GetString();
Int32 curVal = 0;
Int32.TryParse(curStr, out curVal);
return curVal;
return curVal;
}
else
{

@ -38,7 +38,7 @@ namespace Myshipping.Application
/// </summary>
/// <param name="model">订舱、截单EDI请求</param>
/// <returns>返回回执</returns>
Task<dynamic> SendBookingOrClosingEDI (BookingOrClosingEDIOrderDto model);
Task<dynamic> SendBookingOrClosingEDI(BookingOrClosingEDIOrderDto model);
Task BachUpdate(BatchUpdate dto);
@ -106,8 +106,9 @@ namespace Myshipping.Application
/// </summary>
/// <param name="bookingId"></param>
/// <param name="isAutoSyncDS">是否默认同步东胜 true-自动同步 false-不自动同步</param>
/// <param name="fromFunc">调用方模块名</param>
/// <returns></returns>
Task SetBookingGoodsStatus(long bookingId, bool isAutoSyncDS = false);
Task SetBookingGoodsStatus(long bookingId, bool isAutoSyncDS = false, string fromFunc = null);
/// <summary>
/// 检查是否VOLTA并返回初始数据

@ -509,7 +509,7 @@ namespace Myshipping.Application
model.ClosingTime = orderInfo.CLOSINGDATE;
if(orderInfo.CLOSINGDATE.HasValue)
if (orderInfo.CLOSINGDATE.HasValue)
{
model.ReturnTime = orderInfo.CLOSINGDATE.Value;
}
@ -641,7 +641,7 @@ namespace Myshipping.Application
if (lastBookingTruckModel.KGS.HasValue)
model.KGS = lastBookingTruckModel.KGS;
if(!string.IsNullOrWhiteSpace(lastBookingTruckModel.PayMethod))
if (!string.IsNullOrWhiteSpace(lastBookingTruckModel.PayMethod))
model.PayMethod = lastBookingTruckModel.PayMethod;
if (!string.IsNullOrWhiteSpace(lastBookingTruckModel.PayMethodName))
@ -794,7 +794,7 @@ namespace Myshipping.Application
string vesselVoyno = string.Empty;
if(!string.IsNullOrWhiteSpace(bookingOrder.VESSEL))
if (!string.IsNullOrWhiteSpace(bookingOrder.VESSEL))
{
vesselVoyno = bookingOrder.VESSEL;
}
@ -835,7 +835,7 @@ namespace Myshipping.Application
}
};
if(string.IsNullOrWhiteSpace(messageInfo.Main.TruckInfo.Vessel)
if (string.IsNullOrWhiteSpace(messageInfo.Main.TruckInfo.Vessel)
&& !string.IsNullOrWhiteSpace(bookingOrder.VESSEL))
{
messageInfo.Main.TruckInfo.Vessel = bookingOrder.VESSEL;
@ -913,7 +913,7 @@ namespace Myshipping.Application
_logger.LogInformation("批次={no} id={id} 更新订舱的货物状态完成", batchNo, bookingOrder.Id);
}
catch(Exception bkException)
catch (Exception bkException)
{
_logger.LogInformation("批次={no} id={id} 更新订舱的货物状态 YPC异常原因{erro}", batchNo, bookingOrder.Id, bkException.Message);
}
@ -1020,7 +1020,7 @@ namespace Myshipping.Application
/// <param name="isAfterDelete">是否撤销后自动删除 true-删除 false-不删除</param>
/// <returns>返回回执</returns>
[HttpGet("/BookingTruck/Cancel")]
public async Task<TaskManageOrderResultDto> Cancel([FromQuery]long id, [FromQuery] bool isAfterDelete = false)
public async Task<TaskManageOrderResultDto> Cancel([FromQuery] long id, [FromQuery] bool isAfterDelete = false)
{
/*
@ -1130,7 +1130,7 @@ namespace Myshipping.Application
/// <param name="batchNo">批次号</param>
/// <param name="isAfterDelete">是否撤销后自动删除 true-删除 false-不删除</param>
/// <returns>返回回执</returns>
private async Task<TaskManageOrderResultDto> InnerCancel(long id, string batchNo,bool isAfterDelete = false)
private async Task<TaskManageOrderResultDto> InnerCancel(long id, string batchNo, bool isAfterDelete = false)
{
/*
@ -1941,6 +1941,8 @@ namespace Myshipping.Application
if (bookingOrder != null)
{
var oldOrder = bookingOrder.Adapt<BookingOrder>();
_logger.LogInformation("判断回写需要更新去掉订舱的车队 id={id} truckid={truckid} truck={truck}",
bookingTruckInfo.BookingId.Value, bookingOrder.TRUCKERID, bookingOrder.TRUCKER);
@ -1955,6 +1957,9 @@ namespace Myshipping.Application
//it.VERSION
}).ExecuteCommand();
// 保存日志
await _bookingOrderService.SaveLog(bookingOrder, oldOrder, "派车任务回写");
var syncDongshengRlt = await _bookingOrderService.SendBookingOrder(new long[] { bookingTruckInfo.BookingId.Value });
_logger.LogInformation($"推送订舱同步东胜完毕id={bookingTruckInfo.BookingId.Value} rlt={JSON.Serialize(syncDongshengRlt)}");
@ -1976,6 +1981,8 @@ namespace Myshipping.Application
{
_logger.LogInformation("判断回写需要更新订舱的车队 id={id} truck={truck}", bookingTruckInfo.BookingId.Value, info.TruckName);
var oldOrder = bookingOrder.Adapt<BookingOrder>();
bookingOrder.TRUCKERID = info.TruckCode;
bookingOrder.TRUCKER = info.TruckName;
//bookingOrder.VERSION = IDGen.NextID().ToString().Replace("-", "");
@ -1987,6 +1994,9 @@ namespace Myshipping.Application
//it.VERSION
}).ExecuteCommand();
// 保存日志
await _bookingOrderService.SaveLog(bookingOrder, oldOrder, "派车任务回写");
//这里直接调用订舱服务的功能,担心有异常所以这里单独做了异常捕获
try
{

@ -157,6 +157,8 @@ namespace Myshipping.Application
_logger.LogInformation("手动更新船期:" + order.ToJsonString());
foreach (var it in order)
{
var oldOrder = it.Adapt<BookingOrder>();
bool flag = false;
if (it.StartETA != dto.ETA)
{
@ -209,6 +211,7 @@ namespace Myshipping.Application
{
issend = true;
await _order.AsUpdateable(it).IgnoreColumns().ExecuteCommandAsync();
await _bookingorderservice.SaveLog(it, oldOrder, "手动更新船期信息后批量更新订舱");
}
}
if (issend)

@ -16,6 +16,7 @@ using Furion.RemoteRequest.Extensions;
using System.Net.Http;
using Myshipping.Application.Service.BookingYunZong.Dto;
using Myshipping.Core.Entity;
using Mapster;
namespace Myshipping.Application
{
@ -54,8 +55,9 @@ namespace Myshipping.Application
[HttpPost("/BookingYunZong/RefreshYunZong")]
public async Task RefreshYunZong(long[] Ids)
{
var order = await _rep.AsQueryable().Filter(null, true).Where(x => Ids.Contains(x.Id)&&x.IsDeleted==false&&x.ParentId==0&&x.IsBookingYZ!="0").ToListAsync();
if (order==null|| order.Count==0) {
var order = await _rep.AsQueryable().Filter(null, true).Where(x => Ids.Contains(x.Id) && x.IsDeleted == false && x.ParentId == 0 && x.IsBookingYZ != "0").ToListAsync();
if (order == null || order.Count == 0)
{
throw Oops.Bah("存在未订阅单据");
}
@ -79,7 +81,7 @@ namespace Myshipping.Application
if (!string.IsNullOrEmpty(item.YARDID) && !string.IsNullOrEmpty(item.MBLNO))
{
var YARDID= _cache.GetAllMappingYard().Result.Where(x => x.Module == "BillTrace" && x.Code == item.YARDID).Select(x => x.MapCode).FirstOrDefault();
var YARDID = _cache.GetAllMappingYard().Result.Where(x => x.Module == "BillTrace" && x.Code == item.YARDID).Select(x => x.MapCode).FirstOrDefault();
JObject jobjczTemp = new JObject();
jobjczTemp.Add("web_code", new JValue(YARDID));
jobjczTemp.Add("bno", new JValue(item.MBLNO.Trim()));
@ -163,7 +165,7 @@ namespace Myshipping.Application
var mblno = item.GetValue("bno").ToString();
var bookingId = await _rep.AsQueryable().Filter(null, true).Where(x => x.MBLNO == mblno&&x.IsDeleted==false&&x.ParentId==0).Select(x => x.Id).FirstAsync();
var bookingId = await _rep.AsQueryable().Filter(null, true).Where(x => x.MBLNO == mblno && x.IsDeleted == false && x.ParentId == 0).Select(x => x.Id).FirstAsync();
var jarrInnerData = item.GetValue("data") as JArray;
List<YardDataDto> yarddto = new List<YardDataDto>();
@ -213,7 +215,7 @@ namespace Myshipping.Application
BookingStatusLogDetail.OPTime = dt.TiXiangShiJian;
await _statuslogdetail.InsertAsync(BookingStatusLogDetail);
}
await _bookingorderservice.AutoYardData(bookingId);
await _bookingorderservice.AutoYardData(bookingId);
}
if (xl > 0 && fcnum > 0)
{
@ -606,7 +608,7 @@ namespace Myshipping.Application
foreach (var it in neworder)
{
var _oldorder = it;
var _oldorder = it.Adapt<BookingOrder>();
if (it.ATD != SJLGShiJian)
{
it.ATD = SJLGShiJian;
@ -632,7 +634,7 @@ namespace Myshipping.Application
foreach (var it in neworder)
{
var _oldorder = it;
var _oldorder = it.Adapt<BookingOrder>();
if (it.StartETA != YJDGShiJian)
{
it.StartETA = YJDGShiJian;
@ -658,7 +660,7 @@ namespace Myshipping.Application
foreach (var it in neworder)
{
var _oldorder = it;
var _oldorder = it.Adapt<BookingOrder>();
if (it.StartATA != SJDGShiJian)
{
it.StartATA = SJDGShiJian;
@ -685,7 +687,7 @@ namespace Myshipping.Application
foreach (var it in neworder)
{
var _oldorder = it;
var _oldorder = it.Adapt<BookingOrder>();
if (it.YgtETD != YJLGShiJian)
{
it.YgtETD = YJLGShiJian;

@ -229,6 +229,8 @@ namespace Myshipping.Application
var entity = _bookingOrderRepository.AsQueryable().Filter(null, true)
.First(a => a.Id == bookingOrder.Id && !a.IsDeleted && a.TenantId == UserManager.TENANT_ID);
var oldEntity = entity.Adapt<BookingOrder>();
entity.LstDraftCompareRlt = compareResult.extra2.Any(a => a.IsDiff) ? "DIFF" : "NO DIFF";
entity.LstDraftCompareDate = nowDate;
@ -239,6 +241,9 @@ namespace Myshipping.Application
it.LstDraftCompareRlt
}).ExecuteCommandAsync();
// 保存日志
await _bookingOrderService.SaveLog(entity, oldEntity, "执行邮件Draft比对");
if (entity.LstDraftCompareRlt == "NO DIFF")
{
//推送状态 HDGSD-核对格式单
@ -784,6 +789,8 @@ namespace Myshipping.Application
var entity = _bookingOrderRepository.AsQueryable().Filter(null, true)
.First(a => a.Id == bookingOrder.Id && !a.IsDeleted && a.TenantId == UserManager.TENANT_ID);
var oldEntity = entity.Adapt<BookingOrder>();
entity.LstDraftCompareRlt = compareResult.extra2.Any(a => a.IsDiff) ? "DIFF" : "NO DIFF";
entity.LstDraftCompareDate = nowDate;
@ -795,6 +802,9 @@ namespace Myshipping.Application
}).ExecuteCommandAsync();
// 添加日志
await _bookingOrderService.SaveLog(entity, oldEntity, "执行邮件Draft比对含有附件");
if (entity.LstDraftCompareRlt == "NO DIFF")
{
//推送状态 HDGSD-核对格式单

Loading…
Cancel
Save