批量删除

optimize
wet 2 years ago
parent a83e717b53
commit 608671235a

@ -725,17 +725,32 @@ namespace Myshipping.Application
/// <summary>
/// 删除订舱
/// </summary>
/// <param name="Id"></param>
/// <param name="Ids"></param>
/// <returns></returns>
[SqlSugarUnitOfWork]
[HttpPost("/BookingOrder/Delete")]
public async Task Delete(long Id)
public async Task Delete(string Ids)
{
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 });
_logger.LogInformation(Id + "删除成功!");
var arr = Ids.Split(",");
if (arr.Count() > 0)
{
foreach (var ar in arr)
{
long Id = Convert.ToInt64(ar);
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 });
_logger.LogInformation(Id + "删除成功!");
}
}
else {
throw Oops.Bah("请上传正确参数");
}
}

@ -199,7 +199,7 @@ public static class JsonUtil
if(Regex.IsMatch(sourceVal.ToString(), @"[\u4e00-\u9fa5]")&& propName.ToUpper() == "MBLNO")
{
return "提单号存在中文字符";
}
if (Regex.IsMatch(sourceVal.ToString(), @"[\u4e00-\u9fa5]") && propName.ToUpper() == "HBLNO")
@ -268,11 +268,6 @@ public static class JsonUtil
{
return "订舱编号存在中文字符";
}
if (Regex.IsMatch(sourceVal.ToString(), @"[\u4e00-\u9fa5]") && propName.ToUpper() == "BOOKINGNO")
{
return "订舱编号存在中文字符";
}
if (Regex.IsMatch(sourceVal.ToString(), @"[\u4e00-\u9fa5]") && propName.ToUpper() == "PONO")
{

Loading…
Cancel
Save