jianghaiqing 1 year ago
commit 651cff8933

@ -13,7 +13,7 @@ namespace Myshipping.Application.Entity
/// </summary> /// </summary>
[SugarTable("booking_auto_yard_import")] [SugarTable("booking_auto_yard_import")]
[Description("场站自动引入信息")] [Description("场站自动引入信息")]
public class Booking_AutoYardImport public class BookingAutoYardImport
{ {
/// <summary> /// <summary>
/// 主键 /// 主键
@ -40,5 +40,21 @@ namespace Myshipping.Application.Entity
/// 比对数据时填写的箱信息JSON /// 比对数据时填写的箱信息JSON
/// </summary> /// </summary>
public string CtnJson { get; set; } public string CtnJson { get; set; }
/// <summary>
/// 只读标志
/// </summary>
public bool IsRead { get; set; }
/// <summary>
/// 读取时间
/// </summary>
public DateTime? ReadTime { get; set; }
/// <summary>
/// 读取人
/// </summary>
public string ReadUser { get; set; }
} }
} }

@ -42,5 +42,9 @@ namespace Myshipping.Application.Entity
public int print { get; set; } public int print { get; set; }
/// <summary>
/// 是否封账
/// </summary>
public bool IsLockBooking { get; set; }
} }
} }

@ -144,6 +144,12 @@ namespace Myshipping.Application.Enum
/// </summary> /// </summary>
[ErrorCodeItemMetadata("附件不存在")] [ErrorCodeItemMetadata("附件不存在")]
BOOK200, BOOK200,
/// <summary>
/// 请上传正确数据
/// </summary>
[ErrorCodeItemMetadata("请上传正确数据")]
BOOK201,
#endregion #endregion
} }
} }

@ -129,7 +129,7 @@ namespace Myshipping.Application
private readonly IBookingGoodsStatusConfigService _GoodsConfig; private readonly IBookingGoodsStatusConfigService _GoodsConfig;
private readonly SqlSugarRepository<BookingLineOpMgrConfig> _repLineOpMgrConfig; private readonly SqlSugarRepository<BookingLineOpMgrConfig> _repLineOpMgrConfig;
private readonly SqlSugarRepository<SysEmp> _repSysEmp; private readonly SqlSugarRepository<SysEmp> _repSysEmp;
private readonly SqlSugarRepository<Booking_AutoYardImport> _repAutoYard; private readonly SqlSugarRepository<BookingAutoYardImport> _repAutoYard;
private readonly SqlSugarRepository<BookingExtendState> _repextendstate; private readonly SqlSugarRepository<BookingExtendState> _repextendstate;
@ -156,7 +156,7 @@ namespace Myshipping.Application
SqlSugarRepository<BookingExcelTemplate> excelrep, SqlSugarRepository<DjyUserMailAccount> repUserMail, SqlSugarRepository<BookingGoodsStatus> goodsStatus, SqlSugarRepository<BookingGoodsStatusConfig> goodsStatusConfig, SqlSugarRepository<BookingExcelTemplate> excelrep, SqlSugarRepository<DjyUserMailAccount> repUserMail, SqlSugarRepository<BookingGoodsStatus> goodsStatus, SqlSugarRepository<BookingGoodsStatusConfig> goodsStatusConfig,
SqlSugarRepository<SysTenant> repTenant, SqlSugarRepository<BookingStatus> repBookingStatus, SqlSugarRepository<BookingEDIExt> bookingEDIExt, SqlSugarRepository<BookingServiceItem> serviceItem, SqlSugarRepository<SysTenant> repTenant, SqlSugarRepository<BookingStatus> repBookingStatus, SqlSugarRepository<BookingEDIExt> bookingEDIExt, SqlSugarRepository<BookingServiceItem> serviceItem,
SqlSugarRepository<ParaContractNoInfo> paraContractNoInfoRepository, IHttpContextAccessor httpContextAccessor, IBookingGoodsStatusConfigService GoodsConfig, SqlSugarRepository<DjyWebsiteAccountConfig> djyWebsiteAccountConfigRepository, SqlSugarRepository<ParaContractNoInfo> paraContractNoInfoRepository, IHttpContextAccessor httpContextAccessor, IBookingGoodsStatusConfigService GoodsConfig, SqlSugarRepository<DjyWebsiteAccountConfig> djyWebsiteAccountConfigRepository,
ISysOrgService orgService, SqlSugarRepository<BookingLineOpMgrConfig> repLineOpMgrConfig, SqlSugarRepository<SysEmp> repSysEmp, SqlSugarRepository<Booking_AutoYardImport> repAutoYard, ISysOrgService orgService, SqlSugarRepository<BookingLineOpMgrConfig> repLineOpMgrConfig, SqlSugarRepository<SysEmp> repSysEmp, SqlSugarRepository<BookingAutoYardImport> repAutoYard,
IServiceWorkFlowManageService serviceWorkFlowManageService) IServiceWorkFlowManageService serviceWorkFlowManageService)
{ {
this._logger = logger; this._logger = logger;
@ -926,7 +926,7 @@ namespace Myshipping.Application
entity.VOYNO = entity.VOYNOINNER; entity.VOYNO = entity.VOYNOINNER;
} }
entity.VERSION = Guid.NewGuid().ToString(); entity.VERSION = Guid.NewGuid().ToString();
//判断如果船名航次船公司变动 同步更新船期字段
if (entity.CARRIERID != mlist.CARRIERID || entity.VOYNO != mlist.VOYNO || entity.VESSEL != mlist.VESSEL) if (entity.CARRIERID != mlist.CARRIERID || entity.VOYNO != mlist.VOYNO || entity.VESSEL != mlist.VESSEL)
{ {
var vess = await _vesselInfo.AsQueryable().Filter(null, true).Where(x => x.IsDeleted == false && x.TenantId == UserManager.TENANT_ID && x.CARRIERID == entity.CARRIERID && var vess = await _vesselInfo.AsQueryable().Filter(null, true).Where(x => x.IsDeleted == false && x.TenantId == UserManager.TENANT_ID && x.CARRIERID == entity.CARRIERID &&
@ -978,6 +978,7 @@ namespace Myshipping.Application
it.ATA it.ATA
}).ExecuteCommandAsync(); }).ExecuteCommandAsync();
var ctnlist = await _repCtn.AsQueryable().Filter(null, true).Where(x => x.BILLID == input.Id && x.IsDeleted == false).Select(x => x.Id).ToListAsync(); var ctnlist = await _repCtn.AsQueryable().Filter(null, true).Where(x => x.BILLID == input.Id && x.IsDeleted == false).Select(x => x.Id).ToListAsync();
//删除箱信息 重新插入
await _repCtn.DeleteAsync(x => x.BILLID == input.Id); await _repCtn.DeleteAsync(x => x.BILLID == input.Id);
await _ctndetailrep.DeleteAsync(x => ctnlist.Contains((long)x.CTNID)); await _ctndetailrep.DeleteAsync(x => ctnlist.Contains((long)x.CTNID));
if (input.ctnInputs != null) if (input.ctnInputs != null)
@ -7928,12 +7929,15 @@ HLCUTA12307DPXJ3 以这票为例 6个柜
} }
_logger.LogInformation($"{bookId}({order.MBLNO})的箱封号自动引入完成"); _logger.LogInformation($"{bookId}({order.MBLNO})的箱封号自动引入完成");
}
//写入提示 //写入提示
await SaveAutoYardData(bookId, true, $"已自动引入", ctns.ToJson(), rtn.ToJson()); await SaveAutoYardData(bookId, true, $"已自动引入", ctns.ToJson(), rtn.ToJson());
}
else
{
//写入提示
await SaveAutoYardData(bookId, true, $"已自动引入", ctns.ToJson(), rtn.ToJson(), read: true);
}
} }
} }
@ -7942,17 +7946,23 @@ HLCUTA12307DPXJ3 以这票为例 6个柜
/// </summary> /// </summary>
/// <returns></returns> /// <returns></returns>
[NonAction] [NonAction]
private async Task SaveAutoYardData(long bookId, bool success, string content, string ctnJson, string yardJson) private async Task SaveAutoYardData(long bookId, bool success, string content, string ctnJson, string yardJson, bool read = false)
{ {
await _repAutoYard.DeleteAsync(x => x.Id == bookId); await _repAutoYard.DeleteAsync(x => x.Id == bookId);
//写入提示 //写入提示
var autoYard = new Booking_AutoYardImport(); var autoYard = new BookingAutoYardImport();
autoYard.Id = bookId; autoYard.Id = bookId;
autoYard.Status = success ? "已导入" : "未导入"; autoYard.Status = success ? "已导入" : "未导入";
autoYard.Content = content; autoYard.Content = content;
autoYard.CtnJson = ctnJson; autoYard.CtnJson = ctnJson;
autoYard.YardJson = yardJson; autoYard.YardJson = yardJson;
if (read) //未开启自动写入的用户,自动已读
{
autoYard.IsRead = true;
autoYard.ReadTime = DateTime.Now;
autoYard.ReadUser = "系统";
}
await _repAutoYard.InsertAsync(autoYard); await _repAutoYard.InsertAsync(autoYard);
} }
@ -9235,6 +9245,7 @@ HLCUTA12307DPXJ3 以这票为例 6个柜
extends.noApply = noApply; extends.noApply = noApply;
extends.applyNoPrint = applyNoPrint; extends.applyNoPrint = applyNoPrint;
extends.print = print; extends.print = print;
extends.IsLockBooking = false;
await _repextendstate.InsertAsync(extends); await _repextendstate.InsertAsync(extends);
} }
else else

@ -75,6 +75,7 @@ namespace Myshipping.Application
private readonly SqlSugarRepository<BookingStatusLogDetail> _statuslogdetail; private readonly SqlSugarRepository<BookingStatusLogDetail> _statuslogdetail;
private readonly SqlSugarRepository<BookingStatus> _repBookingStatus; private readonly SqlSugarRepository<BookingStatus> _repBookingStatus;
private readonly IBookingOrderService _bookingorderservice; private readonly IBookingOrderService _bookingorderservice;
private readonly SqlSugarRepository<BookingExtendState> _bookingextstate;
public DataSyncService(ILogger<DataSyncService> logger, ISysCacheService cache, SqlSugarRepository<BookingOrder> rep, SqlSugarRepository<BookingCtn> repCtn, public DataSyncService(ILogger<DataSyncService> logger, ISysCacheService cache, SqlSugarRepository<BookingOrder> rep, SqlSugarRepository<BookingCtn> repCtn,
@ -83,7 +84,7 @@ namespace Myshipping.Application
SqlSugarRepository<DjyCustomerContact> djycustomercontact, SqlSugarRepository<DjyVesselInfo> vesselinfo, SqlSugarRepository<BookingCtnDetail> ctndetailrep SqlSugarRepository<DjyCustomerContact> djycustomercontact, SqlSugarRepository<DjyVesselInfo> vesselinfo, SqlSugarRepository<BookingCtnDetail> ctndetailrep
, SqlSugarRepository<BookingEDIExt> bookingEDIExt, SqlSugarRepository<BookingLog> bookinglog, SqlSugarRepository<BookingLogDetail> bookinglogdetail, , SqlSugarRepository<BookingEDIExt> bookingEDIExt, SqlSugarRepository<BookingLog> bookinglog, SqlSugarRepository<BookingLogDetail> bookinglogdetail,
SqlSugarRepository<BookingGoodsStatus> goodsStatus, SqlSugarRepository<BookingGoodsStatusConfig> goodsStatusConfig, SqlSugarRepository<DjyTenantLine> repline, SqlSugarRepository<BookingGoodsStatus> goodsStatus, SqlSugarRepository<BookingGoodsStatusConfig> goodsStatusConfig, SqlSugarRepository<DjyTenantLine> repline,
SqlSugarRepository<BookingRemark> bookingremark, SqlSugarRepository<MappingCarrier> mapcarrier, SqlSugarRepository<CodeForwarder> codeForwarder, SqlSugarRepository<BookingRemark> bookingremark, SqlSugarRepository<MappingCarrier> mapcarrier, SqlSugarRepository<CodeForwarder> codeForwarder, SqlSugarRepository<BookingExtendState> bookingextstate,
SqlSugarRepository<CodePort> codePortRep, SqlSugarRepository<CodeLane> codeLaneRep, ICommonDBService commonDBService, SqlSugarRepository<RelaPortCarrierLane> relaPortLane, SqlSugarRepository<CodePort> codePortRep, SqlSugarRepository<CodeLane> codeLaneRep, ICommonDBService commonDBService, SqlSugarRepository<RelaPortCarrierLane> relaPortLane,
SqlSugarRepository<DjyWebsiteAccountConfig> accountconfig, SqlSugarRepository<BookingFile> bookingfile, IBookingOrderService bookingorderservice) SqlSugarRepository<DjyWebsiteAccountConfig> accountconfig, SqlSugarRepository<BookingFile> bookingfile, IBookingOrderService bookingorderservice)
{ {
@ -116,6 +117,7 @@ namespace Myshipping.Application
this._repStatuslog = statuslog; this._repStatuslog = statuslog;
this._statuslogdetail = statuslogdetail; this._statuslogdetail = statuslogdetail;
this._repBookingStatus = repBookingStatus; this._repBookingStatus = repBookingStatus;
this._bookingextstate = bookingextstate;
} }
@ -2585,6 +2587,45 @@ namespace Myshipping.Application
} }
} }
/// <summary>
/// 东胜封账
/// </summary>
/// <param dto=""></param>
/// <returns></returns>
[SqlSugarUnitOfWork]
[HttpPost("/DataSync/SaveBookingOrderLock"), ApiUser(ApiCode = "SaveBookingOrderLock")]
public async Task SaveBookingOrderLock(List<BookingOrderLock> dto) {
if (dto==null) {
throw Oops.Bah(BookingErrorCode.BOOK201);
}
foreach (var item in dto)
{
var extends = _bookingextstate.FirstOrDefault(x => x.bookingId == item.BookingId);
if (extends == null)
{
extends.bookingId = item.BookingId;
extends.IsLockBooking = item.LockStatus;
await _bookingextstate.InsertAsync(extends);
}
else
{
extends.IsLockBooking = item.LockStatus;
await _bookingextstate.AsUpdateable(extends).IgnoreColumns().ExecuteCommandAsync();
}
}
}
#endregion #endregion
} }
} }

@ -0,0 +1,23 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Myshipping.Application.Service.DataSync.Dto
{
public class BookingOrderLock
{
///// <summary>
///// 主键
///// </summary>
public long BookingId { get; set; }
/// <summary>
/// 锁定状态 false 解锁 true 锁定
/// </summary>
public bool LockStatus { get; set; }
}
}
Loading…
Cancel
Save