修改取消状态

新增订舱批量更新
master
jianghaiqing 6 months ago
parent 5b77d7937d
commit 57589e668f

@ -135,6 +135,11 @@ namespace Myshipping.Application.Event
messageInfo.Main.TaskTitle = $"重要提醒-计费周发生变更 {vesselVoyno} {etd} BLNo:{mblNo}";
messageInfo.Main.TaskDesp = $"重要提醒-计费周发生变更 {vesselVoyno} {etd} BLNo:{mblNo}";
messageInfo.Main.CautionNoticeInfo = new TaskManageOrderCautionNoticeInfo
{
};
var rlt = await service.CreateTaskJob(messageInfo);
}
}

@ -12758,5 +12758,68 @@ namespace Myshipping.Application
}
#endregion
#region 批量更新订舱的详情
/// <summary>
/// 批量更新订舱的详情
/// </summary>
/// <param name="dto">请求参数</param>
/// <returns></returns>
[HttpPost("/BookingOrder/BatchUpdateOrder")]
public async Task BatchUpdateOrder(BatchUpdate dto)
{
if (dto == null)
{
throw Oops.Bah("请求参数不能为空");
}
if(dto.Id.Count == 0)
throw Oops.Bah("未选中需要更新的订舱数据,请重新选择");
string version = Guid.NewGuid().ToString();
// 记录日志
var oldOrderList = await _rep.AsQueryable().Filter(null, true).Where(x => dto.Id.Contains(x.Id) && x.IsDeleted == false).ToListAsync();
if(dto.Id.Count != oldOrderList.Count)
throw Oops.Bah("订舱数据获取失败,部分订舱数据未获取到,订舱数据为空或已作废");
//oldOrderList.ForEach()
foreach (var oldOrder in oldOrderList)
{
var newOrder = oldOrder.Adapt<BookingOrder>();
newOrder.VERSION = version;
newOrder.VESSEL = dto.VESSEL;
newOrder.VOYNOINNER = dto.VOYNOINNER;
newOrder.ETD = dto.ETD;
newOrder.VOYNO = dto.VOYNO;
newOrder.PORTDISCHARGEID = dto.PORTDISCHARGEID;
newOrder.PORTDISCHARGE = dto.PORTDISCHARGE;
newOrder.DESTINATIONID = dto.DESTINATIONID;
newOrder.DESTINATION = dto.DESTINATION;
newOrder.CLOSINGDATE = dto.CLOSINGDATE;
newOrder.CLOSEDOCDATE = dto.CLOSEDOCDATE;
await SaveLog(newOrder, oldOrder, "批量编辑台账");
}
await _rep.UpdateAsync(x => dto.Id.Contains(x.Id), x => new BookingOrder
{
VERSION = version,
VESSEL = dto.VESSEL,
VOYNOINNER = dto.VOYNOINNER,
ETD = dto.ETD,
VOYNO = dto.VOYNO,
PORTDISCHARGEID = dto.PORTDISCHARGEID,
PORTDISCHARGE = dto.PORTDISCHARGE,
DESTINATIONID = dto.DESTINATIONID,
DESTINATION = dto.DESTINATION,
CLOSINGDATE = dto.CLOSINGDATE,
CLOSEDOCDATE = dto.CLOSEDOCDATE
});
await SendBookingOrder(dto.Id.ToArray());
}
#endregion
}
}

@ -62,6 +62,11 @@ namespace Myshipping.Application.Service.BookingOrder.Dto
/// 截单日期
/// </summary>
public DateTime? CLOSEDOCDATE { get; set; }
/// <summary>
/// 强制更新字段列表(默认只更新有值的字段,如果需要强制更新为空请将字段填写到此列表)
/// </summary>
public List<string> enforceUpdateField { get; set; }
}
/// <summary>

@ -149,6 +149,11 @@ namespace Myshipping.Application
/// <returns>返回回执</returns>
Task<BookingOrderOutput> Save(SaveBookingOrderInput input);
/// <summary>
/// 批量更新订舱的详情
/// </summary>
/// <param name="dto">请求参数</param>
/// <returns></returns>
Task BatchUpdateOrder(BatchUpdate dto);
}
}

@ -57,5 +57,7 @@ namespace Myshipping.Application
/// 用户名称
/// </summary>
public string userName { get; set; }
}
}

@ -1604,7 +1604,8 @@ namespace Myshipping.Application
if (b.StatusSKUCode.Equals(st.StatusCode, StringComparison.OrdinalIgnoreCase))
return true;
if (b.SubStatusList != null && b.SubStatusList.Any(c => c.StatusSKUCode.Equals(st.StatusCode, StringComparison.OrdinalIgnoreCase)))
if (b.SubStatusList != null && b.SubStatusList.Any(c => !string.IsNullOrWhiteSpace(c.StatusSKUCode)
&& c.StatusSKUCode.Equals(st.StatusCode, StringComparison.OrdinalIgnoreCase)))
return true;
return false;
@ -1617,7 +1618,7 @@ namespace Myshipping.Application
=> a.Main.SERVICE_WF_ID == rt.WFPKId).ToList();
if(runList.Any(b
=>b.Detail.STATUS_SKU_CODE.Equals(st.StatusCode,StringComparison.OrdinalIgnoreCase)))
=> b.Detail != null && !string.IsNullOrWhiteSpace(b.Detail.STATUS_SKU_CODE) && b.Detail.STATUS_SKU_CODE.Equals(st.StatusCode,StringComparison.OrdinalIgnoreCase)))
{
var detail = runList.FirstOrDefault(b
=> b.Detail.STATUS_SKU_CODE.Equals(st.StatusCode, StringComparison.OrdinalIgnoreCase));

Loading…
Cancel
Save