jianghaiqing 5 months ago
commit 14ae281351

@ -1740,7 +1740,7 @@ namespace Myshipping.Application
entity.BOOKINGNO = Yitter.IdGenerator.YitIdHelper.NextId().ToString(); entity.BOOKINGNO = Yitter.IdGenerator.YitIdHelper.NextId().ToString();
entity.BSDATE = DateTime.Today; entity.BSDATE = DateTime.Today;
entity.BSNO = null; //entity.BSNO = null;
await _rep.InsertAsync(entity); await _rep.InsertAsync(entity);
if (!string.IsNullOrEmpty(reqId)) if (!string.IsNullOrEmpty(reqId))

@ -2732,6 +2732,44 @@ namespace Myshipping.Application
} }
/// <summary>
/// 接收其他系统上传订舱数据
/// </summary>
/// <param name="dto"></param>
/// <returns></returns>
[HttpPost("/DataSync/UploadOrderData"), AllowAnonymous, ApiUser(ApiCode = "UploadOrderData")]
public async Task UploadOrderData(BookingOrderDto dto)
{
var saveDto = dto.Adapt<SaveBookingOrderInput>();
var dbModel = await _rep.AsQueryable().Filter(null, true).FirstAsync(x => x.TenantId == UserManager.TENANT_ID && x.BSNO == dto.BSNO);
if (dbModel != null)
{
dto.Id = dbModel.Id;
saveDto.Id = dbModel.Id;
var compareModel = dbModel.Adapt<BookingOrderDto>();
var propsOrder = typeof(BookingOrderDto).GetProperties();
var changeFileds = new List<string>();
foreach (var prop in propsOrder)
{
if (prop.Name != "ctnInputs" && prop.Name != "BookingEDIExt" && prop.Name != "ExtendState")
{
var v1 = prop.GetValue(compareModel);
var v2 = prop.GetValue(dto);
if (v1 != v2)
{
changeFileds.Add(prop.Name);
}
}
}
saveDto.ChangedFields = changeFileds;
}
await _bookingorderservice.Save(saveDto);
}
#endregion #endregion
#region 下载数据 #region 下载数据

Loading…
Cancel
Save