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
{
@ -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,7 +856,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)
@ -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)
@ -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)
@ -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,
@ -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,
@ -2071,8 +2064,10 @@ namespace Myshipping.Application
_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",
@ -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

@ -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并返回初始数据

@ -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
{
@ -55,7 +56,8 @@ namespace Myshipping.Application
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) {
if (order == null || order.Count == 0)
{
throw Oops.Bah("存在未订阅单据");
}
@ -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