|
|
|
@ -30,6 +30,7 @@ using Myshipping.Application.Event;
|
|
|
|
|
using Microsoft.AspNetCore.Authorization;
|
|
|
|
|
using Furion.DatabaseAccessor;
|
|
|
|
|
using static ICSharpCode.SharpZipLib.Zip.ExtendedUnixData;
|
|
|
|
|
using Myshipping.Application.Service.BookingOrder.Dto;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
namespace Myshipping.Application
|
|
|
|
@ -113,7 +114,7 @@ namespace Myshipping.Application
|
|
|
|
|
/// <param name="input"></param>
|
|
|
|
|
/// <returns></returns>
|
|
|
|
|
[HttpPost("/BookingSlot/save")]
|
|
|
|
|
public async Task<BookingSlotBaseSaveDto> Save(BookingSlotBaseSaveDto input)
|
|
|
|
|
public async Task<BookingSlotBaseSaveOutput> Save(BookingSlotBaseSaveInput input)
|
|
|
|
|
{
|
|
|
|
|
BookingSlotBase model = null;
|
|
|
|
|
if (input.Id > 0) //修改
|
|
|
|
@ -125,6 +126,7 @@ namespace Myshipping.Application
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
model = _repBase.FirstOrDefault(x => x.Id == input.Id);
|
|
|
|
|
var oldObj = model.Adapt<BookingSlotBaseSaveInput>();
|
|
|
|
|
|
|
|
|
|
input.Adapt(model);
|
|
|
|
|
|
|
|
|
@ -137,6 +139,8 @@ namespace Myshipping.Application
|
|
|
|
|
newCtn.SLOT_ID = model.Id;
|
|
|
|
|
await _repCtn.InsertAsync(newCtn);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
await InsLog("Update", model.Id, typeof(BookingSlotBaseSaveInput), oldObj, input, "CtnList");
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
@ -210,13 +214,30 @@ namespace Myshipping.Application
|
|
|
|
|
/// <param name="id"></param>
|
|
|
|
|
/// <returns></returns>
|
|
|
|
|
[HttpGet("/BookingSlot/detail")]
|
|
|
|
|
public async Task<BookingSlotBaseSaveDto> Detail(long id)
|
|
|
|
|
public async Task<BookingSlotBaseSaveOutput> Detail(long id)
|
|
|
|
|
{
|
|
|
|
|
var slotBase = await _repBase.FirstOrDefaultAsync(u => u.Id == id);
|
|
|
|
|
var ctns = await _repCtn.Where(x => x.SLOT_ID == id).ToListAsync();
|
|
|
|
|
|
|
|
|
|
var rtn = slotBase.Adapt<BookingSlotBaseSaveDto>();
|
|
|
|
|
var rtn = slotBase.Adapt<BookingSlotBaseSaveOutput>();
|
|
|
|
|
rtn.CtnList = ctns.Adapt<List<BookingSlotCtnSaveInput>>();
|
|
|
|
|
|
|
|
|
|
List<BookingLogDto> list = new List<BookingLogDto>();
|
|
|
|
|
var main = await _repBookingLog.AsQueryable().Where(u => u.BookingId == slotBase.Id).ToListAsync();
|
|
|
|
|
var mailidlist = main.Select(x => x.Id).ToList();
|
|
|
|
|
list = main.Adapt<List<BookingLogDto>>();
|
|
|
|
|
if (list != null)
|
|
|
|
|
{
|
|
|
|
|
var bookinglogdetail = await _repBookingLogDetail.AsQueryable().Where(x => mailidlist.Contains(x.PId)).ToListAsync();
|
|
|
|
|
foreach (var item in list)
|
|
|
|
|
{
|
|
|
|
|
var details = bookinglogdetail.Where(x => x.PId == item.Id).ToList();
|
|
|
|
|
item.details = details;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
rtn.LogList = list;
|
|
|
|
|
|
|
|
|
|
return rtn;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@ -272,7 +293,7 @@ namespace Myshipping.Application
|
|
|
|
|
await _repCtn.InsertAsync(newCtn);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
await InsLog("update", model.Id, typeof(BookingSlotBaseApiSaveDto), oldObj, dto.DataObj, "CtnList");
|
|
|
|
|
await InsLog("Update", model.Id, typeof(BookingSlotBaseApiSaveDto), oldObj, dto.DataObj, "CtnList");
|
|
|
|
|
}
|
|
|
|
|
else if (dto.OpType == "del")
|
|
|
|
|
{
|
|
|
|
|