版本号

optimize
wet 1 year ago
parent 932b3ebaca
commit a93dbc5daf

@ -975,5 +975,9 @@ namespace Myshipping.Application.Entity
/// </summary>
public string ForeignAgent { get; set; }
/// <summary>
/// 版本号
/// </summary>
public string VERSION { get; set; }
}
}

@ -995,6 +995,15 @@ namespace Myshipping.Application
throw Oops.Bah("当前PONO已存在,请勿重复录入!");
}
}
//版本号
if (!string.IsNullOrWhiteSpace(input.VERSION)&& input.Id!=0)
{
var et = await _rep.AsQueryable().Filter(null, true).Where(x => x.IsDeleted == false && x.VERSION == input.VERSION && x.Id == input.Id).FirstAsync();
if (et == null)
{
throw Oops.Bah("当前版本号不一致,请刷新后在保存单据");
}
}
var entity = input.Adapt<BookingOrder>();
if (!string.IsNullOrEmpty(input.VESSEL) && !string.IsNullOrEmpty(input.VOYNO))
{
@ -1015,7 +1024,7 @@ namespace Myshipping.Application
entity.VOYNO = entity.VOYNOINNER;
}
entity.VERSION = Guid.NewGuid().ToString();
entity.BOOKINGNO = Yitter.IdGenerator.YitIdHelper.NextId().ToString();
await _rep.InsertAsync(entity);
if (input.ctnInputs != null)
@ -1641,28 +1650,35 @@ namespace Myshipping.Application
await _ctndetailrep.UpdateAsync(x => ctnlist.Contains((long)x.CTNID), x => new BookingCtnDetail { IsDeleted = true });
await _rep.UpdateAsync(x => x.Id == Id, x => new BookingOrder { IsDeleted = true });
await _bookingEDIExt.UpdateAsync(x => x.BookingId == Id && x.IsDeleted == false, x => new BookingEDIExt { IsDeleted = true });
_logger.LogInformation(Id + "删除成功!");
_logger.LogInformation(mblno + "删除成功!");
}
else
{
var re = NoDeleted[0] as JObject;
string result = re.GetStringValue("Result");
throw Oops.Bah(result);
}
} else if (jobj.GetIntValue("Code") == 201) {
if (re.GetIntValue("Code") == 201)
{
var ctnlist = await _repCtn.AsQueryable().Where(x => x.BILLID == Id).Select(x => x.Id).ToListAsync();
await _repCtn.UpdateAsync(x => x.BILLID == Id, x => new BookingCtn { IsDeleted = true });
await _ctndetailrep.UpdateAsync(x => ctnlist.Contains((long)x.CTNID), x => new BookingCtnDetail { IsDeleted = true });
await _rep.UpdateAsync(x => x.Id == Id, x => new BookingOrder { IsDeleted = true });
await _bookingEDIExt.UpdateAsync(x => x.BookingId == Id && x.IsDeleted == false, x => new BookingEDIExt { IsDeleted = true });
_logger.LogInformation(mblno + "删除成功!");
var ctnlist = await _repCtn.AsQueryable().Where(x => x.BILLID == Id).Select(x => x.Id).ToListAsync();
await _repCtn.UpdateAsync(x => x.BILLID == Id, x => new BookingCtn { IsDeleted = true });
await _ctndetailrep.UpdateAsync(x => ctnlist.Contains((long)x.CTNID), x => new BookingCtnDetail { IsDeleted = true });
await _rep.UpdateAsync(x => x.Id == Id, x => new BookingOrder { IsDeleted = true });
await _bookingEDIExt.UpdateAsync(x => x.BookingId == Id && x.IsDeleted == false, x => new BookingEDIExt { IsDeleted = true });
_logger.LogInformation(Id + "删除成功!");
}
else
{
string result = re.GetStringValue("Result");
throw Oops.Bah(result);
}
}
}
else
{
throw Oops.Bah("接口调用异常");
throw Oops.Bah(mblno + "删除单据失败");
}
}
#region 消息队列推送删除信息

@ -803,5 +803,9 @@ namespace Myshipping.Application
/// 境外代理
/// </summary>
public string ForeignAgent { get; set; }
/// <summary>
/// 版本号
/// </summary>
public string VERSION { get; set; }
}
}

Loading…
Cancel
Save