zhangxiaofeng 7 months ago
commit 0709877c09

@ -57,6 +57,11 @@ namespace Myshipping.Application.EDI
var checkRlt = XiahuozhiHelpler.CheckGoodsDescriptionWithInput(order);
if(!checkRlt.Key)
{
return checkRlt;
}
var ctns = repCtn.Where(c => c.BILLID == bookingId).ToList();
var dictData = await cacheService.GetAllDictData();

@ -856,7 +856,7 @@ namespace Myshipping.Application.Entity
/// <summary>
/// 最后下货纸比对状态 NO_DIFF-无异常;DIFF-有差异;NO_YARD-无场站数据;EXPT-异常
/// </summary>
[Description("下货纸比对")]
[Description("下货纸比对状态")]
public string LstShipOrderCompareRlt { get; set; }
/// <summary>
@ -871,6 +871,7 @@ namespace Myshipping.Application.Entity
/// <summary>
/// 最后下货纸比对状态 NO_DIFF-无异常;DIFF-有差异;NO_YARD-无场站数据;EXPT-异常
/// </summary>
[Description("下货纸比对状态名称")]
public string LstShipOrderCompareRltName { get; set; }
/// <summary>
@ -1013,6 +1014,7 @@ namespace Myshipping.Application.Entity
/// <summary>
/// 最后格式单比对状态 NO_DIFF-无异常;DIFF-有差异;
/// </summary>
[Description("最后格式单比对状态")]
public string LstDraftCompareRlt { get; set; }
/// <summary>

@ -63,5 +63,19 @@ namespace Myshipping.Application.Entity.DraftCompare
[SugarColumn(ColumnName = "NOTES")]
[Description("备注")]
public string NOTES { get; set; }
/// <summary>
/// 比对类型 DRAFT-格式单比对SHIPORDER-下货纸比对
/// </summary>
[SugarColumn(ColumnName = "COMPARE_TYPE")]
[Description("比对类型")]
public string COMPARE_TYPE { get; set; }
/// <summary>
/// 比对完成时间
/// </summary>
[SugarColumn(ColumnName = "COMPARE_TIME")]
[Description("比对完成时间")]
public Nullable<DateTime> COMPARE_TIME { get; set; }
}
}

@ -1995,7 +1995,7 @@ namespace Myshipping.Application
if (string.IsNullOrEmpty(custOrder.CONSIGNEE) && !string.IsNullOrEmpty(custOrder.ConsigneeName))
{
custOrder.SHIPPER = @$"{custOrder.ConsigneeName}
custOrder.CONSIGNEE = @$"{custOrder.ConsigneeName}
{custOrder.ConsigneeAddress}
{custOrder.ConsigneeCountry} {custOrder.ConsigneeProvince} {custOrder.ConsigneeCity} {custOrder.ConsigneeCounty} {custOrder.ConsigneePostCode}
{custOrder.ConsigneeLastName} {custOrder.ConsigneeFirstName} {custOrder.ConsigneePhoneCountryCode} {custOrder.ConsigneePhoneCode} {custOrder.ConsigneePhone}".ToUpper();
@ -2003,7 +2003,7 @@ namespace Myshipping.Application
if (string.IsNullOrEmpty(custOrder.NOTIFYPARTY) && !string.IsNullOrEmpty(custOrder.NotifypartName))
{
custOrder.SHIPPER = @$"{custOrder.NotifypartName}
custOrder.NOTIFYPARTY = @$"{custOrder.NotifypartName}
{custOrder.NotifypartAddress}
{custOrder.NotifypartCountry} {custOrder.NotifypartProvince} {custOrder.NotifypartCity} {custOrder.NotifypartCounty} {custOrder.NotifypartPostCode}
{custOrder.NotifypartLastName} {custOrder.NotifypartFirstName} {custOrder.NotifypartPhoneCountryCode} {custOrder.NotifypartPhoneCode} {custOrder.NotifypartPhone}".ToUpper();

@ -6,7 +6,54 @@ using System.Threading.Tasks;
namespace Myshipping.Application
{
/// <summary>
/// 格式单反馈记录
/// </summary>
public class TaskDraftCompareFeedBackDto
{
/// <summary>
/// 订舱主键
/// </summary>
public long bookingId { get; set; }
/// <summary>
/// 提单号
/// </summary>
public string mblNo { get; set; }
/// <summary>
/// 比对主键
/// </summary>
public string taskCompareId { get; set; }
/// <summary>
/// 是否识别问题 1-时 0-否
/// </summary>
public bool isOCRError { get; set; }
/// <summary>
/// 是否订舱录入问题 1-是 0-否
/// </summary>
public bool isEditError { get; set; }
/// <summary>
/// 是否代理录入问题 1-是 0-否
/// </summary>
public bool isAgentError { get; set; }
/// <summary>
/// 备注
/// </summary>
public string notes { get; set; }
/// <summary>
/// 比对类型 DRAFT-格式单比对SHIPORDER-下货纸比对
/// </summary>
public string compareType { get; set; }
/// <summary>
/// 比对完成时间
/// </summary>
public Nullable<DateTime> compareTime { get; set; }
}
}

@ -93,6 +93,11 @@ namespace Myshipping.Application
/// 展示明细
/// </summary>
public List<CompareResultDetailInfo> ShowDetailList { get; set; }
/// <summary>
/// 人工反馈结果
/// </summary>
public FeedBackResult ManualFeedBackResult { get; set; }
}
/// <summary>
@ -248,4 +253,27 @@ namespace Myshipping.Application
/// </summary>
public int ExistsCtnNo { get; set; }
}
public class FeedBackResult
{
/// <summary>
/// 操作人
/// </summary>
public string OperUser { get; set; }
/// <summary>
/// 操作时间
/// </summary>
public DateTime OperTime { get; set; }
/// <summary>
/// 备注
/// </summary>
public string OperNote { get; set; }
/// <summary>
/// 原因
/// </summary>
public string Reason { get; set; }
}
}

@ -44,6 +44,6 @@ namespace Myshipping.Application
/// </summary>
/// <param name="model">请求详情</param>
/// <returns>返回回执</returns>
Task<TaskManageExcuteResultDto> SaveDraftCompareManual(TaskDraftCompareFeedBackDto model);
Task SaveDraftCompareManual(TaskDraftCompareFeedBackDto model);
}
}

@ -48,6 +48,7 @@ namespace Myshipping.Application
private readonly SqlSugarRepository<SysUser> _sysUserRepository;
private readonly IBookingOrderService _bookingOrderService;
private readonly SqlSugarRepository<DraftCompareFeedBackRecord> _draftCompareFeedBackRecordRepository;
private readonly IBookingValueAddedService _bookingValueAddedService;
const string CONST_DRAFT_FILE_CODE = "draft";
const string CONST_DRAFT_FILE_NAME = "格式单";
@ -56,7 +57,7 @@ namespace Myshipping.Application
public TaskDraftCompareService(ISysCacheService cache, ILogger<TaskDraftCompareService> logger,
SqlSugarRepository<BookingOrder> bookingOrderRepository, SqlSugarRepository<BookingCtn> bookingOrderContaRepository,
SqlSugarRepository<BookingFile> bookingFileRepository, SqlSugarRepository<SysUser> sysUserRepository, IBookingOrderService bookingOrderService,
SqlSugarRepository<DraftCompareFeedBackRecord> draftCompareFeedBackRecordRepository)
SqlSugarRepository<DraftCompareFeedBackRecord> draftCompareFeedBackRecordRepository, IBookingValueAddedService bookingValueAddedService)
{
_cache = cache;
_logger = logger;
@ -68,6 +69,7 @@ namespace Myshipping.Application
_bookingOrderService = bookingOrderService;
_draftCompareFeedBackRecordRepository = draftCompareFeedBackRecordRepository;
_bookingValueAddedService = bookingValueAddedService;
}
#region 执行邮件Draft比对
@ -549,6 +551,25 @@ namespace Myshipping.Application
if (lastFileInfo != null)
result.extra3 = lastFileInfo.Id;
if (result != null && result.extra != null && !string.IsNullOrWhiteSpace(result.extra.TaskCompareId))
{
var feedBack = _draftCompareFeedBackRecordRepository.AsQueryable().First(a => a.BOOKING_ID == bookingId
&& a.TASK_COMPARE_ID == result.extra.TaskCompareId);
if (feedBack != null)
{
result.extra.ManualFeedBackResult = new FeedBackResult
{
OperNote = feedBack.NOTES,
OperTime = feedBack.CreatedTime.Value,
OperUser = feedBack.CreatedUserName,
Reason = (feedBack.IS_OCR_ERROR?"识别问题 ":"")+ (feedBack.IS_EDIT_ERROR ? "录入问题 " : "")+ (feedBack.IS_AGENT_ERROR ? "代理录入问题 " : "")
};
}
}
}
catch (Exception ex)
{
@ -856,25 +877,107 @@ namespace Myshipping.Application
/// </summary>
/// <param name="model">请求详情</param>
/// <returns>返回回执</returns>
public async Task<TaskManageExcuteResultDto> SaveDraftCompareManual(TaskDraftCompareFeedBackDto model)
[HttpPost("/TaskDraftCompare/SaveDraftCompareManual")]
public async Task SaveDraftCompareManual(TaskDraftCompareFeedBackDto model)
{
TaskManageExcuteResultDto result = new TaskManageExcuteResultDto();
if (model.bookingId <= 0)
throw Oops.Oh($"订舱ID不能为空");
try
var order = _bookingOrderRepository.AsQueryable().First(a => a.Id == model.bookingId);
if (order == null)
throw Oops.Oh($"订舱详情获取失败,订舱信息不存在或已作废");
if (!model.isOCRError && !model.isEditError && !model.isAgentError)
{
DraftCompareFeedBackRecord entity = new DraftCompareFeedBackRecord {
//BOOKING_ID = model.
throw Oops.Oh($"至少选择一个原因");
}
_logger.LogInformation("请求比对反馈model={msg}", JSON.Serialize(model));
DateTime nowDate = DateTime.Now;
DraftCompareFeedBackRecord entity = new DraftCompareFeedBackRecord
{
BOOKING_ID = model.bookingId,
IS_AGENT_ERROR = model.isAgentError,
IS_OCR_ERROR = model.isOCRError,
IS_EDIT_ERROR = model.isEditError,
NOTES = model.notes,
COMPARE_TYPE = model.compareType,
COMPARE_TIME = model.compareTime,
TASK_COMPARE_ID = model.taskCompareId,
CreatedUserId = UserManager.UserId,
CreatedUserName = UserManager.Name,
CreatedTime = nowDate,
UpdatedTime = nowDate
};
//新增完记录
await _draftCompareFeedBackRecordRepository.InsertAsync(entity);
}
catch (Exception ex)
_logger.LogInformation("请求比对反馈写入表完成id={id}", model.bookingId);
var oldOrder = _bookingOrderRepository.AsQueryable().First(a => a.Id == model.bookingId);
//更新订舱相关的格式单比对状态
if (model.compareType.Equals("DRAFT", StringComparison.OrdinalIgnoreCase))
{
result.succ = false;
result.msg = $"保存格式单比对反馈异常,{ex.Message}";
_logger.LogInformation("请求比对反馈选择修正 compareType={compare}id={id}", model.compareType, model.bookingId);
order.LstDraftCompareRlt = "NO DIFF";
order.UpdatedTime = nowDate;
order.UpdatedUserId = UserManager.UserId;
order.UpdatedUserName = UserManager.Name;
await _bookingOrderRepository.AsUpdateable(order).UpdateColumns(t => new
{
t.LstDraftCompareRlt,
t.UpdatedUserId,
t.UpdatedUserName,
t.UpdatedTime,
}).ExecuteCommandAsync();
_logger.LogInformation("请求比对反馈更新订舱状态完成id={id}", model.bookingId);
// 保存日志
await _bookingOrderService.SaveLog(order, oldOrder, "格式单比对反馈回写");
}
else if (model.compareType.Equals("SHIPORDER", StringComparison.OrdinalIgnoreCase))
{
_logger.LogInformation("请求比对反馈选择修正 compareType={compare}id={id}", model.compareType, model.bookingId);
return result;
order.LstShipOrderCompareRlt = "NO_DIFF";
order.LstShipOrderCompareRltName = "正常";
order.UpdatedTime = nowDate;
order.UpdatedUserId = UserManager.UserId;
order.UpdatedUserName = UserManager.Name;
await _bookingOrderRepository.AsUpdateable(order).UpdateColumns(t => new
{
t.LstShipOrderCompareRlt,
t.LstShipOrderCompareRltName,
t.UpdatedUserId,
t.UpdatedUserName,
t.UpdatedTime,
}).ExecuteCommandAsync();
// 保存日志
await _bookingOrderService.SaveLog(order, oldOrder, "格式单比对反馈回写");
_logger.LogInformation("请求比对反馈更新订舱状态完成id={id}", model.bookingId);
//比对成功后触发下货纸比对状态
var saveStatusRlt = await _bookingValueAddedService.SaveServiceStatus(new ModifyServiceProjectStatusDto
{
BookingId = model.bookingId,
SourceType = TrackingSourceTypeEnum.AUTO,
StatusCodes = new List<ModifyServiceProjectStatusDetailDto> {
new ModifyServiceProjectStatusDetailDto { StatusCode = "XHZBDCHG" } }
});
_logger.LogInformation("异步推送下货纸比对状态完成,结果={rlt}", JSON.Serialize(saveStatusRlt));
}
}
#endregion
}

@ -10,6 +10,7 @@ using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Mvc;
using Microsoft.Extensions.Logging;
using Myshipping.Application.Entity;
using Myshipping.Application.Entity.DraftCompare;
using Myshipping.Core;
using Myshipping.Core.Entity;
using Myshipping.Core.Service;
@ -36,6 +37,7 @@ namespace Myshipping.Application
private readonly SqlSugarRepository<BookingOrder> _bookingOrderRepository;
private readonly SqlSugarRepository<BookingCtn> _bookingOrderContaRepository;
private readonly SqlSugarRepository<DraftCompareFeedBackRecord> _draftCompareFeedBackRecordRepository;
//private readonly SqlSugarRepository<SysUser> _userRepository;
private readonly IBookingValueAddedService _bookingValueAddedService;
@ -43,7 +45,8 @@ namespace Myshipping.Application
public TaskShippingOrderCompareService(ISysCacheService cache, ILogger<TaskShippingOrderCompareService> logger,
SqlSugarRepository<BookingOrder> bookingOrderRepository, SqlSugarRepository<BookingCtn> bookingOrderContaRepository,
IBookingValueAddedService bookingValueAddedService, IBookingOrderService bookingOrderService)
IBookingValueAddedService bookingValueAddedService, IBookingOrderService bookingOrderService,
SqlSugarRepository<DraftCompareFeedBackRecord> draftCompareFeedBackRecordRepository)
{
_cache = cache;
_logger = logger;
@ -53,6 +56,7 @@ namespace Myshipping.Application
_bookingValueAddedService = bookingValueAddedService;
_bookingOrderService = bookingOrderService;
_draftCompareFeedBackRecordRepository = draftCompareFeedBackRecordRepository;
}
/// <summary>
/// 执行下货纸比对
@ -636,6 +640,24 @@ namespace Myshipping.Application
_logger.LogInformation($"开始请求查询 msg={JSON.Serialize(msgModel)}");
result = await GetCompareResult(msgModel);
if (result != null && result.extra != null && !string.IsNullOrWhiteSpace(result.extra.TaskCompareId))
{
var feedBack = _draftCompareFeedBackRecordRepository.AsQueryable().First(a => a.BOOKING_ID == bookingId
&& a.TASK_COMPARE_ID == result.extra.TaskCompareId);
if (feedBack != null)
{
result.extra.ManualFeedBackResult = new FeedBackResult
{
OperNote = feedBack.NOTES,
OperTime = feedBack.CreatedTime.Value,
OperUser = feedBack.CreatedUserName,
Reason = (feedBack.IS_OCR_ERROR ? "识别问题 " : "") + (feedBack.IS_EDIT_ERROR ? "录入问题 " : "") + (feedBack.IS_AGENT_ERROR ? "代理录入问题 " : "")
};
}
}
}
catch (Exception ex)
{

@ -338,6 +338,14 @@ namespace Myshipping.Core
user.Password = DESCEncryption.Encrypt("123456", keyDES);
await repoUser.UpdateAsync(user);
//客户端用户信息同步给运营端往来单位
if (App.Configuration["RunType"] is CommonConst.RUN_TYPE_CUST)
{
var evtPub = App.GetService<IEventPublisher>();
await evtPub.PublishAsync(new ChannelEventSource($"DjySync:TenantUserToCustomer", tenant.Id));
}
}
}
}

@ -17,6 +17,7 @@ using NPOI.Util;
using StackExchange.Profiling.Internal;
using Microsoft.AspNetCore.Authorization;
using static NPOI.HSSF.Util.HSSFColor;
using TinyPinyin;
namespace Myshipping.Core.Service
{
@ -399,7 +400,7 @@ namespace Myshipping.Core.Service
FullName = dto.Name,
Email = dto.Email,
Tel = dto.Phone,
CodeName = "",
CodeName = PinyinHelper.GetPinyinInitials(shortName),
ShortName = shortName,
DjyGid = dto.DjyGid,
PropString = "[consignor]"

@ -429,6 +429,7 @@ public class SyncHisRecord: ISyncHisRecord,ITransient
public void SyncServiceProjectRecord4()
{
/*
SI
1

Loading…
Cancel
Save