|
|
|
@ -68,6 +68,7 @@ using DS.Module.Core.Enums;
|
|
|
|
|
using DS.WMS.Core.Application.Dtos;
|
|
|
|
|
using iText.Layout.Element;
|
|
|
|
|
using AngleSharp.Html;
|
|
|
|
|
using DS.WMS.Core.Op.Dtos.Enum;
|
|
|
|
|
|
|
|
|
|
namespace DS.WMS.Core.Op.Method
|
|
|
|
|
{
|
|
|
|
@ -170,6 +171,10 @@ namespace DS.WMS.Core.Op.Method
|
|
|
|
|
DischargePort = data.order.DischargePort,
|
|
|
|
|
CustomerService = data.order.CustomerService,
|
|
|
|
|
CustomerServiceName = data.order.CustomerServiceName,
|
|
|
|
|
BusiType = BLIssueBusiTypeEnum.SeaExport.ToString(),
|
|
|
|
|
BusiTypeName = BLIssueBusiTypeEnum.SeaExport.GetDescription(),
|
|
|
|
|
BLType = BLTypeEnum.BL.ToString(),
|
|
|
|
|
BLTypeName = BLTypeEnum.BL.GetDescription(),
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
start++;
|
|
|
|
@ -259,6 +264,8 @@ namespace DS.WMS.Core.Op.Method
|
|
|
|
|
DischargePort = data.order.DischargePort,
|
|
|
|
|
CustomerService = data.order.CustomerService,
|
|
|
|
|
CustomerServiceName = data.order.CustomerServiceName,
|
|
|
|
|
BLType = BLTypeEnum.BL.ToString(),
|
|
|
|
|
BLTypeName = BLTypeEnum.BL.GetDescription(),
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
var saveRlt = await Save(dto);
|
|
|
|
@ -274,6 +281,9 @@ namespace DS.WMS.Core.Op.Method
|
|
|
|
|
blModel.CheckInUserName = user.UserName;
|
|
|
|
|
blModel.CheckInDate = nowDate;
|
|
|
|
|
blModel.CheckInNote = model.Notes;
|
|
|
|
|
blModel.Status = BLIssueStatusEnum.CheckIn.ToString();
|
|
|
|
|
blModel.StatusName = BLIssueStatusEnum.CheckIn.GetDescription();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
await tenantDb.Updateable<BLIssueManageBase>(blModel)
|
|
|
|
|
.UpdateColumns(x => new
|
|
|
|
@ -283,6 +293,8 @@ namespace DS.WMS.Core.Op.Method
|
|
|
|
|
x.CheckInUserName,
|
|
|
|
|
x.CheckInDate,
|
|
|
|
|
x.CheckInNote,
|
|
|
|
|
x.Status,
|
|
|
|
|
x.StatusName
|
|
|
|
|
}).ExecuteCommandAsync();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@ -381,6 +393,8 @@ namespace DS.WMS.Core.Op.Method
|
|
|
|
|
blModel.CheckInUserName = null;
|
|
|
|
|
blModel.CheckInDate = null;
|
|
|
|
|
blModel.CheckInNote = null;
|
|
|
|
|
blModel.Status = null;
|
|
|
|
|
blModel.StatusName = null;
|
|
|
|
|
|
|
|
|
|
await tenantDb.Updateable<BLIssueManageBase>(blModel)
|
|
|
|
|
.UpdateColumns(x => new
|
|
|
|
@ -390,6 +404,8 @@ namespace DS.WMS.Core.Op.Method
|
|
|
|
|
x.CheckInUserName,
|
|
|
|
|
x.CheckInDate,
|
|
|
|
|
x.CheckInNote,
|
|
|
|
|
x.Status,
|
|
|
|
|
x.StatusName
|
|
|
|
|
}).ExecuteCommandAsync();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@ -480,6 +496,8 @@ namespace DS.WMS.Core.Op.Method
|
|
|
|
|
blModel.CheckOutUserName = user.UserName;
|
|
|
|
|
blModel.CheckOutDate = nowDate;
|
|
|
|
|
blModel.CheckOutNote = model.Notes;
|
|
|
|
|
blModel.Status = BLIssueStatusEnum.CheckOut.ToString();
|
|
|
|
|
blModel.StatusName = BLIssueStatusEnum.CheckOut.GetDescription();
|
|
|
|
|
|
|
|
|
|
await tenantDb.Updateable<BLIssueManageBase>(blModel)
|
|
|
|
|
.UpdateColumns(x => new
|
|
|
|
@ -489,6 +507,8 @@ namespace DS.WMS.Core.Op.Method
|
|
|
|
|
x.CheckOutUserName,
|
|
|
|
|
x.CheckOutDate,
|
|
|
|
|
x.CheckOutNote,
|
|
|
|
|
x.Status,
|
|
|
|
|
x.StatusName
|
|
|
|
|
}).ExecuteCommandAsync();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@ -551,6 +571,8 @@ namespace DS.WMS.Core.Op.Method
|
|
|
|
|
blModel.CheckOutUserName = null;
|
|
|
|
|
blModel.CheckOutDate = null;
|
|
|
|
|
blModel.CheckOutNote = null;
|
|
|
|
|
blModel.Status = null;
|
|
|
|
|
blModel.StatusName = null;
|
|
|
|
|
|
|
|
|
|
await tenantDb.Updateable<BLIssueManageBase>(blModel)
|
|
|
|
|
.UpdateColumns(x => new
|
|
|
|
@ -560,6 +582,8 @@ namespace DS.WMS.Core.Op.Method
|
|
|
|
|
x.CheckOutUserName,
|
|
|
|
|
x.CheckOutDate,
|
|
|
|
|
x.CheckOutNote,
|
|
|
|
|
x.Status,
|
|
|
|
|
x.StatusName
|
|
|
|
|
}).ExecuteCommandAsync();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@ -592,7 +616,98 @@ namespace DS.WMS.Core.Op.Method
|
|
|
|
|
/// <returns>返回回执</returns>
|
|
|
|
|
public async Task<DataResult> ShipCertCheckIn(ShipCertCheckInOutDto model)
|
|
|
|
|
{
|
|
|
|
|
return null;
|
|
|
|
|
var tenantDb = saasService.GetBizDbScopeById(user.TenantId);
|
|
|
|
|
|
|
|
|
|
if (model.bookids.Length == 0)
|
|
|
|
|
return DataResult.Failed("请求参数错误,请选择提单记录");
|
|
|
|
|
|
|
|
|
|
var orderList = tenantDb.Queryable<SeaExport>().ClearFilter(typeof(IOrgId))
|
|
|
|
|
.LeftJoin<BLIssueManageBase>((l, r) => l.Id == r.BookingId)
|
|
|
|
|
.Where((l, r) => model.bookids.Contains(l.Id) && l.Deleted == false)
|
|
|
|
|
.Select((l, r) => new { order = l, bl = r })
|
|
|
|
|
.ToList();
|
|
|
|
|
|
|
|
|
|
if (orderList.Count != model.bookids.Length)
|
|
|
|
|
{
|
|
|
|
|
return DataResult.Failed("部分订单查询失败,请重新查询台账");
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
DateTime nowDate = DateTime.Now;
|
|
|
|
|
|
|
|
|
|
foreach (var data in orderList)
|
|
|
|
|
{
|
|
|
|
|
var blModel = data.bl;
|
|
|
|
|
|
|
|
|
|
if (blModel == null || blModel.Id == 0)
|
|
|
|
|
{
|
|
|
|
|
var dto = new BLIssueManageBaseInputDto
|
|
|
|
|
{
|
|
|
|
|
BookingId = data.order.Id,
|
|
|
|
|
BLNo = data.order.MBLNO,
|
|
|
|
|
CustomerId = data.order.CustomerId,
|
|
|
|
|
CustomerName = data.order.CustomerName,
|
|
|
|
|
SaleId = data.order.SaleId,
|
|
|
|
|
Sale = data.order.Sale,
|
|
|
|
|
IssueType = data.order.IssueType,
|
|
|
|
|
IssueTypeCode = data.order.IssueTypeCode,
|
|
|
|
|
IssuePlaceCode = data.order.IssuePlaceCode,
|
|
|
|
|
IssuePlace = data.order.IssuePlace,
|
|
|
|
|
LoadPortId = data.order.LoadPortId,
|
|
|
|
|
LoadPortCode = data.order.LoadPortCode,
|
|
|
|
|
LoadPort = data.order.LoadPort,
|
|
|
|
|
DischargePortId = data.order.DischargePortId,
|
|
|
|
|
DischargePortCode = data.order.DischargePortCode,
|
|
|
|
|
DischargePort = data.order.DischargePort,
|
|
|
|
|
CustomerService = data.order.CustomerService,
|
|
|
|
|
CustomerServiceName = data.order.CustomerServiceName,
|
|
|
|
|
BLType = BLTypeEnum.BL.ToString(),
|
|
|
|
|
BLTypeName = BLTypeEnum.BL.GetDescription(),
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
var saveRlt = await Save(dto);
|
|
|
|
|
|
|
|
|
|
if (saveRlt.Succeeded)
|
|
|
|
|
blModel = saveRlt.Data;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (!blModel.IsShipCertCheckIn)
|
|
|
|
|
{
|
|
|
|
|
blModel.IsShipCertCheckIn = true;
|
|
|
|
|
blModel.IsShipCertificate = true;
|
|
|
|
|
blModel.ShipCertCheckInBy = long.Parse(user.UserId);
|
|
|
|
|
blModel.ShipCertCheckInUserName = user.UserName;
|
|
|
|
|
blModel.ShipCertCheckInDate = nowDate;
|
|
|
|
|
blModel.ShipCertCheckInNote = model.Notes;
|
|
|
|
|
|
|
|
|
|
await tenantDb.Updateable<BLIssueManageBase>(blModel)
|
|
|
|
|
.UpdateColumns(x => new
|
|
|
|
|
{
|
|
|
|
|
x.IsShipCertificate,
|
|
|
|
|
x.IsShipCertCheckIn,
|
|
|
|
|
x.ShipCertCheckInBy,
|
|
|
|
|
x.ShipCertCheckInUserName,
|
|
|
|
|
x.ShipCertCheckInDate,
|
|
|
|
|
x.ShipCertCheckInNote,
|
|
|
|
|
}).ExecuteCommandAsync();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
var log = new BLIssueManageLog
|
|
|
|
|
{
|
|
|
|
|
Pid = blModel.Id,
|
|
|
|
|
ActionCode = BLIssueActionEnum.ShipCertCheckIn.ToString(),
|
|
|
|
|
ActionName = BLIssueActionEnum.ShipCertCheckIn.GetDescription(),
|
|
|
|
|
Note = model.Notes,
|
|
|
|
|
Result = "成功",
|
|
|
|
|
CreateBy = long.Parse(user.UserId),
|
|
|
|
|
CreateUserName = user.UserName,
|
|
|
|
|
CreateTime = nowDate,
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
await tenantDb.Insertable<BLIssueManageLog>(log).ExecuteCommandAsync();
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return DataResult.Successed("成功");
|
|
|
|
|
}
|
|
|
|
|
#endregion
|
|
|
|
|
|
|
|
|
@ -604,7 +719,67 @@ namespace DS.WMS.Core.Op.Method
|
|
|
|
|
/// <returns>返回回执</returns>
|
|
|
|
|
public async Task<DataResult> ShipCertCheckInCancel(ShipCertCheckInOutDto model)
|
|
|
|
|
{
|
|
|
|
|
return null;
|
|
|
|
|
var tenantDb = saasService.GetBizDbScopeById(user.TenantId);
|
|
|
|
|
|
|
|
|
|
if (model.bookids.Length == 0)
|
|
|
|
|
return DataResult.Failed("请求参数错误,请选择提单记录");
|
|
|
|
|
|
|
|
|
|
var orderList = tenantDb.Queryable<SeaExport>().ClearFilter(typeof(IOrgId))
|
|
|
|
|
.LeftJoin<BLIssueManageBase>((l, r) => l.Id == r.BookingId)
|
|
|
|
|
.Where((l, r) => model.bookids.Contains(l.Id) && l.Deleted == false)
|
|
|
|
|
.Select((l, r) => new { order = l, bl = r })
|
|
|
|
|
.ToList();
|
|
|
|
|
|
|
|
|
|
if (orderList.Count != model.bookids.Length)
|
|
|
|
|
{
|
|
|
|
|
return DataResult.Failed("部分订单查询失败,请重新查询台账");
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
DateTime nowDate = DateTime.Now;
|
|
|
|
|
|
|
|
|
|
foreach (var data in orderList)
|
|
|
|
|
{
|
|
|
|
|
var blModel = data.bl;
|
|
|
|
|
|
|
|
|
|
if (blModel != null && blModel.Id > 0)
|
|
|
|
|
{
|
|
|
|
|
if (blModel.IsShipCertCheckIn)
|
|
|
|
|
{
|
|
|
|
|
blModel.IsShipCertCheckIn = false;
|
|
|
|
|
blModel.ShipCertCheckInBy = 0;
|
|
|
|
|
blModel.ShipCertCheckInUserName = null;
|
|
|
|
|
blModel.ShipCertCheckInDate = null;
|
|
|
|
|
blModel.ShipCertCheckInNote = null;
|
|
|
|
|
|
|
|
|
|
await tenantDb.Updateable<BLIssueManageBase>(blModel)
|
|
|
|
|
.UpdateColumns(x => new
|
|
|
|
|
{
|
|
|
|
|
x.IsShipCertCheckIn,
|
|
|
|
|
x.ShipCertCheckInBy,
|
|
|
|
|
x.ShipCertCheckInUserName,
|
|
|
|
|
x.ShipCertCheckInDate,
|
|
|
|
|
x.ShipCertCheckInNote,
|
|
|
|
|
}).ExecuteCommandAsync();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
var log = new BLIssueManageLog
|
|
|
|
|
{
|
|
|
|
|
Pid = blModel.Id,
|
|
|
|
|
ActionCode = BLIssueActionEnum.ShipCertCheckInCancel.ToString(),
|
|
|
|
|
ActionName = BLIssueActionEnum.ShipCertCheckInCancel.GetDescription(),
|
|
|
|
|
Note = model.Notes,
|
|
|
|
|
Result = "成功",
|
|
|
|
|
CreateBy = long.Parse(user.UserId),
|
|
|
|
|
CreateUserName = user.UserName,
|
|
|
|
|
CreateTime = nowDate,
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
await tenantDb.Insertable<BLIssueManageLog>(log).ExecuteCommandAsync();
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return DataResult.Successed("成功");
|
|
|
|
|
}
|
|
|
|
|
#endregion
|
|
|
|
|
|
|
|
|
@ -616,7 +791,95 @@ namespace DS.WMS.Core.Op.Method
|
|
|
|
|
/// <returns>返回回执</returns>
|
|
|
|
|
public async Task<DataResult> ShipCertCheckOut(ShipCertCheckInOutDto model)
|
|
|
|
|
{
|
|
|
|
|
return null;
|
|
|
|
|
var tenantDb = saasService.GetBizDbScopeById(user.TenantId);
|
|
|
|
|
|
|
|
|
|
if (model.bookids.Length == 0)
|
|
|
|
|
return DataResult.Failed("请求参数错误,请选择提单记录");
|
|
|
|
|
|
|
|
|
|
var orderList = tenantDb.Queryable<SeaExport>().ClearFilter(typeof(IOrgId))
|
|
|
|
|
.LeftJoin<BLIssueManageBase>((l, r) => l.Id == r.BookingId)
|
|
|
|
|
.Where((l, r) => model.bookids.Contains(l.Id) && l.Deleted == false)
|
|
|
|
|
.Select((l, r) => new { order = l, bl = r })
|
|
|
|
|
.ToList();
|
|
|
|
|
|
|
|
|
|
if (orderList.Count != model.bookids.Length)
|
|
|
|
|
{
|
|
|
|
|
return DataResult.Failed("部分订单查询失败,请重新查询台账");
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
DateTime nowDate = DateTime.Now;
|
|
|
|
|
|
|
|
|
|
foreach (var data in orderList)
|
|
|
|
|
{
|
|
|
|
|
var blModel = data.bl;
|
|
|
|
|
|
|
|
|
|
if (blModel == null || blModel.Id == 0)
|
|
|
|
|
{
|
|
|
|
|
var dto = new BLIssueManageBaseInputDto
|
|
|
|
|
{
|
|
|
|
|
BookingId = data.order.Id,
|
|
|
|
|
BLNo = data.order.MBLNO,
|
|
|
|
|
CustomerId = data.order.CustomerId,
|
|
|
|
|
CustomerName = data.order.CustomerName,
|
|
|
|
|
SaleId = data.order.SaleId,
|
|
|
|
|
Sale = data.order.Sale,
|
|
|
|
|
IssueType = data.order.IssueType,
|
|
|
|
|
IssueTypeCode = data.order.IssueTypeCode,
|
|
|
|
|
IssuePlaceCode = data.order.IssuePlaceCode,
|
|
|
|
|
IssuePlace = data.order.IssuePlace,
|
|
|
|
|
LoadPortId = data.order.LoadPortId,
|
|
|
|
|
LoadPortCode = data.order.LoadPortCode,
|
|
|
|
|
LoadPort = data.order.LoadPort,
|
|
|
|
|
DischargePortId = data.order.DischargePortId,
|
|
|
|
|
DischargePortCode = data.order.DischargePortCode,
|
|
|
|
|
DischargePort = data.order.DischargePort,
|
|
|
|
|
CustomerService = data.order.CustomerService,
|
|
|
|
|
CustomerServiceName = data.order.CustomerServiceName,
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
var saveRlt = await Save(dto);
|
|
|
|
|
|
|
|
|
|
if (saveRlt.Succeeded)
|
|
|
|
|
blModel = saveRlt.Data;
|
|
|
|
|
}
|
|
|
|
|
if (!blModel.IsShipCertCheckOut)
|
|
|
|
|
{
|
|
|
|
|
blModel.IsShipCertCheckOut = true;
|
|
|
|
|
blModel.IsShipCertificate = true;
|
|
|
|
|
blModel.ShipCertCheckOutBy = long.Parse(user.UserId);
|
|
|
|
|
blModel.ShipCertCheckOutUserName = user.UserName;
|
|
|
|
|
blModel.ShipCertCheckOutDate = nowDate;
|
|
|
|
|
blModel.ShipCertCheckOutNote = model.Notes;
|
|
|
|
|
|
|
|
|
|
await tenantDb.Updateable<BLIssueManageBase>(blModel)
|
|
|
|
|
.UpdateColumns(x => new
|
|
|
|
|
{
|
|
|
|
|
x.IsShipCertificate,
|
|
|
|
|
x.IsShipCertCheckOut,
|
|
|
|
|
x.ShipCertCheckOutBy,
|
|
|
|
|
x.ShipCertCheckOutUserName,
|
|
|
|
|
x.ShipCertCheckOutDate,
|
|
|
|
|
x.ShipCertCheckOutNote,
|
|
|
|
|
}).ExecuteCommandAsync();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
var log = new BLIssueManageLog
|
|
|
|
|
{
|
|
|
|
|
Pid = blModel.Id,
|
|
|
|
|
ActionCode = BLIssueActionEnum.ShipCertCheckOut.ToString(),
|
|
|
|
|
ActionName = BLIssueActionEnum.ShipCertCheckOut.GetDescription(),
|
|
|
|
|
Note = model.Notes,
|
|
|
|
|
Result = "成功",
|
|
|
|
|
CreateBy = long.Parse(user.UserId),
|
|
|
|
|
CreateUserName = user.UserName,
|
|
|
|
|
CreateTime = nowDate,
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
await tenantDb.Insertable<BLIssueManageLog>(log).ExecuteCommandAsync();
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return DataResult.Successed("成功");
|
|
|
|
|
}
|
|
|
|
|
#endregion
|
|
|
|
|
|
|
|
|
@ -628,7 +891,67 @@ namespace DS.WMS.Core.Op.Method
|
|
|
|
|
/// <returns>返回回执</returns>
|
|
|
|
|
public async Task<DataResult> ShipCertCheckOutCancel(ShipCertCheckInOutDto model)
|
|
|
|
|
{
|
|
|
|
|
return null;
|
|
|
|
|
var tenantDb = saasService.GetBizDbScopeById(user.TenantId);
|
|
|
|
|
|
|
|
|
|
if (model.bookids.Length == 0)
|
|
|
|
|
return DataResult.Failed("请求参数错误,请选择提单记录");
|
|
|
|
|
|
|
|
|
|
var orderList = tenantDb.Queryable<SeaExport>().ClearFilter(typeof(IOrgId))
|
|
|
|
|
.LeftJoin<BLIssueManageBase>((l, r) => l.Id == r.BookingId)
|
|
|
|
|
.Where((l, r) => model.bookids.Contains(l.Id) && l.Deleted == false)
|
|
|
|
|
.Select((l, r) => new { order = l, bl = r })
|
|
|
|
|
.ToList();
|
|
|
|
|
|
|
|
|
|
if (orderList.Count != model.bookids.Length)
|
|
|
|
|
{
|
|
|
|
|
return DataResult.Failed("部分订单查询失败,请重新查询台账");
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
DateTime nowDate = DateTime.Now;
|
|
|
|
|
|
|
|
|
|
foreach (var data in orderList)
|
|
|
|
|
{
|
|
|
|
|
var blModel = data.bl;
|
|
|
|
|
|
|
|
|
|
if (blModel != null && blModel.Id > 0)
|
|
|
|
|
{
|
|
|
|
|
if (blModel.IsShipCertCheckOut)
|
|
|
|
|
{
|
|
|
|
|
blModel.IsShipCertCheckOut = false;
|
|
|
|
|
blModel.ShipCertCheckOutBy = 0;
|
|
|
|
|
blModel.ShipCertCheckOutUserName = null;
|
|
|
|
|
blModel.ShipCertCheckOutDate = null;
|
|
|
|
|
blModel.ShipCertCheckOutNote = null;
|
|
|
|
|
|
|
|
|
|
await tenantDb.Updateable<BLIssueManageBase>(blModel)
|
|
|
|
|
.UpdateColumns(x => new
|
|
|
|
|
{
|
|
|
|
|
x.IsShipCertCheckOut,
|
|
|
|
|
x.ShipCertCheckOutBy,
|
|
|
|
|
x.ShipCertCheckOutUserName,
|
|
|
|
|
x.ShipCertCheckOutDate,
|
|
|
|
|
x.ShipCertCheckOutNote,
|
|
|
|
|
}).ExecuteCommandAsync();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
var log = new BLIssueManageLog
|
|
|
|
|
{
|
|
|
|
|
Pid = blModel.Id,
|
|
|
|
|
ActionCode = BLIssueActionEnum.ShipCertCheckOutCancel.ToString(),
|
|
|
|
|
ActionName = BLIssueActionEnum.ShipCertCheckOutCancel.GetDescription(),
|
|
|
|
|
Note = model.Notes,
|
|
|
|
|
Result = "成功",
|
|
|
|
|
CreateBy = long.Parse(user.UserId),
|
|
|
|
|
CreateUserName = user.UserName,
|
|
|
|
|
CreateTime = nowDate,
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
await tenantDb.Insertable<BLIssueManageLog>(log).ExecuteCommandAsync();
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return DataResult.Successed("成功");
|
|
|
|
|
}
|
|
|
|
|
#endregion
|
|
|
|
|
|
|
|
|
@ -640,9 +963,105 @@ namespace DS.WMS.Core.Op.Method
|
|
|
|
|
/// <returns>返回回执</returns>
|
|
|
|
|
public async Task<DataResult> BLCheckChangeEndorse(BLCheckInOutDto model)
|
|
|
|
|
{
|
|
|
|
|
return null;
|
|
|
|
|
}
|
|
|
|
|
#endregion
|
|
|
|
|
/*
|
|
|
|
|
只能提单签入才能换单背书
|
|
|
|
|
*/
|
|
|
|
|
var tenantDb = saasService.GetBizDbScopeById(user.TenantId);
|
|
|
|
|
|
|
|
|
|
if (model.bookids.Length == 0)
|
|
|
|
|
return DataResult.Failed("请求参数错误,请选择提单记录");
|
|
|
|
|
|
|
|
|
|
var orderList = tenantDb.Queryable<SeaExport>().ClearFilter(typeof(IOrgId))
|
|
|
|
|
.LeftJoin<BLIssueManageBase>((l, r) => l.Id == r.BookingId)
|
|
|
|
|
.Where((l, r) => model.bookids.Contains(l.Id) && l.Deleted == false)
|
|
|
|
|
.Select((l, r) => new { order = l, bl = r })
|
|
|
|
|
.ToList();
|
|
|
|
|
|
|
|
|
|
if (orderList.Count != model.bookids.Length)
|
|
|
|
|
{
|
|
|
|
|
return DataResult.Failed("部分订单查询失败,请重新查询台账");
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (orderList.Any(p => !p.bl.IsCheckIn))
|
|
|
|
|
{
|
|
|
|
|
string s = string.Join(",", orderList.Where(p => !p.bl.IsCheckIn)
|
|
|
|
|
.Select(b => b.bl.BLNo).ToArray());
|
|
|
|
|
|
|
|
|
|
return DataResult.Failed($"提单号:{s} 不能操作,只有已提单已签入才能进行 提单换签(背书)");
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
DateTime nowDate = DateTime.Now;
|
|
|
|
|
|
|
|
|
|
foreach (var data in orderList)
|
|
|
|
|
{
|
|
|
|
|
var blModel = data.bl;
|
|
|
|
|
|
|
|
|
|
if (blModel == null || blModel.Id == 0)
|
|
|
|
|
{
|
|
|
|
|
var dto = new BLIssueManageBaseInputDto
|
|
|
|
|
{
|
|
|
|
|
BookingId = data.order.Id,
|
|
|
|
|
BLNo = data.order.MBLNO,
|
|
|
|
|
CustomerId = data.order.CustomerId,
|
|
|
|
|
CustomerName = data.order.CustomerName,
|
|
|
|
|
SaleId = data.order.SaleId,
|
|
|
|
|
Sale = data.order.Sale,
|
|
|
|
|
IssueType = data.order.IssueType,
|
|
|
|
|
IssueTypeCode = data.order.IssueTypeCode,
|
|
|
|
|
IssuePlaceCode = data.order.IssuePlaceCode,
|
|
|
|
|
IssuePlace = data.order.IssuePlace,
|
|
|
|
|
LoadPortId = data.order.LoadPortId,
|
|
|
|
|
LoadPortCode = data.order.LoadPortCode,
|
|
|
|
|
LoadPort = data.order.LoadPort,
|
|
|
|
|
DischargePortId = data.order.DischargePortId,
|
|
|
|
|
DischargePortCode = data.order.DischargePortCode,
|
|
|
|
|
DischargePort = data.order.DischargePort,
|
|
|
|
|
CustomerService = data.order.CustomerService,
|
|
|
|
|
CustomerServiceName = data.order.CustomerServiceName,
|
|
|
|
|
BLType = BLTypeEnum.BL.ToString(),
|
|
|
|
|
BLTypeName = BLTypeEnum.BL.GetDescription(),
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
var saveRlt = await Save(dto);
|
|
|
|
|
|
|
|
|
|
if (saveRlt.Succeeded)
|
|
|
|
|
blModel = saveRlt.Data;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (blModel.IsCheckIn)
|
|
|
|
|
{
|
|
|
|
|
blModel.Status = BLIssueStatusEnum.ChangeEndorse.ToString();
|
|
|
|
|
blModel.StatusName = BLIssueStatusEnum.ChangeEndorse.GetDescription();
|
|
|
|
|
blModel.IsChangeEndorse = true;
|
|
|
|
|
|
|
|
|
|
await tenantDb.Updateable<BLIssueManageBase>(blModel)
|
|
|
|
|
.UpdateColumns(x => new
|
|
|
|
|
{
|
|
|
|
|
x.Status,
|
|
|
|
|
x.StatusName,
|
|
|
|
|
x.IsChangeEndorse,
|
|
|
|
|
}).ExecuteCommandAsync();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
var log = new BLIssueManageLog
|
|
|
|
|
{
|
|
|
|
|
Pid = blModel.Id,
|
|
|
|
|
ActionCode = BLIssueActionEnum.ChangeEndorse.ToString(),
|
|
|
|
|
ActionName = BLIssueActionEnum.ChangeEndorse.GetDescription(),
|
|
|
|
|
Note = model.Notes,
|
|
|
|
|
Result = "成功",
|
|
|
|
|
CreateBy = long.Parse(user.UserId),
|
|
|
|
|
CreateUserName = user.UserName,
|
|
|
|
|
CreateTime = nowDate,
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
await tenantDb.Insertable<BLIssueManageLog>(log).ExecuteCommandAsync();
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return DataResult.Successed("成功");
|
|
|
|
|
}
|
|
|
|
|
#endregion
|
|
|
|
|
|
|
|
|
|
#region 取消提单换签(背书)
|
|
|
|
|
/// <summary>
|
|
|
|
@ -652,7 +1071,103 @@ namespace DS.WMS.Core.Op.Method
|
|
|
|
|
/// <returns>返回回执</returns>
|
|
|
|
|
public async Task<DataResult> BLCheckChangeEndorseCancel(BLCheckInOutDto model)
|
|
|
|
|
{
|
|
|
|
|
return null;
|
|
|
|
|
/*
|
|
|
|
|
只能提单签入才能换单背书
|
|
|
|
|
*/
|
|
|
|
|
var tenantDb = saasService.GetBizDbScopeById(user.TenantId);
|
|
|
|
|
|
|
|
|
|
if (model.bookids.Length == 0)
|
|
|
|
|
return DataResult.Failed("请求参数错误,请选择提单记录");
|
|
|
|
|
|
|
|
|
|
var orderList = tenantDb.Queryable<SeaExport>().ClearFilter(typeof(IOrgId))
|
|
|
|
|
.LeftJoin<BLIssueManageBase>((l, r) => l.Id == r.BookingId)
|
|
|
|
|
.Where((l, r) => model.bookids.Contains(l.Id) && l.Deleted == false)
|
|
|
|
|
.Select((l, r) => new { order = l, bl = r })
|
|
|
|
|
.ToList();
|
|
|
|
|
|
|
|
|
|
if (orderList.Count != model.bookids.Length)
|
|
|
|
|
{
|
|
|
|
|
return DataResult.Failed("部分订单查询失败,请重新查询台账");
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (orderList.Any(p => !p.bl.IsCheckIn))
|
|
|
|
|
{
|
|
|
|
|
string s = string.Join(",", orderList.Where(p => !p.bl.IsCheckIn)
|
|
|
|
|
.Select(b => b.bl.BLNo).ToArray());
|
|
|
|
|
|
|
|
|
|
return DataResult.Failed($"提单号:{s} 不能操作,只有已提单已签入才能进行 提单换签(背书)");
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
DateTime nowDate = DateTime.Now;
|
|
|
|
|
|
|
|
|
|
foreach (var data in orderList)
|
|
|
|
|
{
|
|
|
|
|
var blModel = data.bl;
|
|
|
|
|
|
|
|
|
|
if (blModel == null || blModel.Id == 0)
|
|
|
|
|
{
|
|
|
|
|
var dto = new BLIssueManageBaseInputDto
|
|
|
|
|
{
|
|
|
|
|
BookingId = data.order.Id,
|
|
|
|
|
BLNo = data.order.MBLNO,
|
|
|
|
|
CustomerId = data.order.CustomerId,
|
|
|
|
|
CustomerName = data.order.CustomerName,
|
|
|
|
|
SaleId = data.order.SaleId,
|
|
|
|
|
Sale = data.order.Sale,
|
|
|
|
|
IssueType = data.order.IssueType,
|
|
|
|
|
IssueTypeCode = data.order.IssueTypeCode,
|
|
|
|
|
IssuePlaceCode = data.order.IssuePlaceCode,
|
|
|
|
|
IssuePlace = data.order.IssuePlace,
|
|
|
|
|
LoadPortId = data.order.LoadPortId,
|
|
|
|
|
LoadPortCode = data.order.LoadPortCode,
|
|
|
|
|
LoadPort = data.order.LoadPort,
|
|
|
|
|
DischargePortId = data.order.DischargePortId,
|
|
|
|
|
DischargePortCode = data.order.DischargePortCode,
|
|
|
|
|
DischargePort = data.order.DischargePort,
|
|
|
|
|
CustomerService = data.order.CustomerService,
|
|
|
|
|
CustomerServiceName = data.order.CustomerServiceName,
|
|
|
|
|
BLType = BLTypeEnum.BL.ToString(),
|
|
|
|
|
BLTypeName = BLTypeEnum.BL.GetDescription(),
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
var saveRlt = await Save(dto);
|
|
|
|
|
|
|
|
|
|
if (saveRlt.Succeeded)
|
|
|
|
|
blModel = saveRlt.Data;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (blModel.IsChangeEndorse)
|
|
|
|
|
{
|
|
|
|
|
blModel.Status = null;
|
|
|
|
|
blModel.StatusName = null;
|
|
|
|
|
blModel.IsChangeEndorse = false;
|
|
|
|
|
|
|
|
|
|
await tenantDb.Updateable<BLIssueManageBase>(blModel)
|
|
|
|
|
.UpdateColumns(x => new
|
|
|
|
|
{
|
|
|
|
|
x.Status,
|
|
|
|
|
x.StatusName,
|
|
|
|
|
x.IsChangeEndorse,
|
|
|
|
|
}).ExecuteCommandAsync();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
var log = new BLIssueManageLog
|
|
|
|
|
{
|
|
|
|
|
Pid = blModel.Id,
|
|
|
|
|
ActionCode = BLIssueActionEnum.ChangeEndorseCancel.ToString(),
|
|
|
|
|
ActionName = BLIssueActionEnum.ChangeEndorseCancel.GetDescription(),
|
|
|
|
|
Note = model.Notes,
|
|
|
|
|
Result = "成功",
|
|
|
|
|
CreateBy = long.Parse(user.UserId),
|
|
|
|
|
CreateUserName = user.UserName,
|
|
|
|
|
CreateTime = nowDate,
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
await tenantDb.Insertable<BLIssueManageLog>(log).ExecuteCommandAsync();
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return DataResult.Successed("成功");
|
|
|
|
|
}
|
|
|
|
|
#endregion
|
|
|
|
|
|
|
|
|
@ -664,7 +1179,100 @@ namespace DS.WMS.Core.Op.Method
|
|
|
|
|
/// <returns>返回回执</returns>
|
|
|
|
|
public async Task<DataResult> BLRejectReleaseNotice(BLCheckInOutDto model)
|
|
|
|
|
{
|
|
|
|
|
return null;
|
|
|
|
|
var tenantDb = saasService.GetBizDbScopeById(user.TenantId);
|
|
|
|
|
|
|
|
|
|
if (model.bookids.Length == 0)
|
|
|
|
|
return DataResult.Failed("请求参数错误,请选择提单记录");
|
|
|
|
|
|
|
|
|
|
var orderList = tenantDb.Queryable<SeaExport>().ClearFilter(typeof(IOrgId))
|
|
|
|
|
.LeftJoin<BLIssueManageBase>((l, r) => l.Id == r.BookingId)
|
|
|
|
|
.Where((l, r) => model.bookids.Contains(l.Id) && l.Deleted == false)
|
|
|
|
|
.Select((l, r) => new { order = l, bl = r })
|
|
|
|
|
.ToList();
|
|
|
|
|
|
|
|
|
|
if (orderList.Count != model.bookids.Length)
|
|
|
|
|
{
|
|
|
|
|
return DataResult.Failed("部分订单查询失败,请重新查询台账");
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (orderList.Any(p => !p.bl.IsCheckIn))
|
|
|
|
|
{
|
|
|
|
|
string s = string.Join(",", orderList.Where(p => !p.bl.IsCheckIn)
|
|
|
|
|
.Select(b => b.bl.BLNo).ToArray());
|
|
|
|
|
|
|
|
|
|
return DataResult.Failed($"提单号:{s} 不能操作,只有已提单已签入才能进行 驳回放单通知");
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
DateTime nowDate = DateTime.Now;
|
|
|
|
|
|
|
|
|
|
foreach (var data in orderList)
|
|
|
|
|
{
|
|
|
|
|
var blModel = data.bl;
|
|
|
|
|
|
|
|
|
|
if (blModel == null || blModel.Id == 0)
|
|
|
|
|
{
|
|
|
|
|
var dto = new BLIssueManageBaseInputDto
|
|
|
|
|
{
|
|
|
|
|
BookingId = data.order.Id,
|
|
|
|
|
BLNo = data.order.MBLNO,
|
|
|
|
|
CustomerId = data.order.CustomerId,
|
|
|
|
|
CustomerName = data.order.CustomerName,
|
|
|
|
|
SaleId = data.order.SaleId,
|
|
|
|
|
Sale = data.order.Sale,
|
|
|
|
|
IssueType = data.order.IssueType,
|
|
|
|
|
IssueTypeCode = data.order.IssueTypeCode,
|
|
|
|
|
IssuePlaceCode = data.order.IssuePlaceCode,
|
|
|
|
|
IssuePlace = data.order.IssuePlace,
|
|
|
|
|
LoadPortId = data.order.LoadPortId,
|
|
|
|
|
LoadPortCode = data.order.LoadPortCode,
|
|
|
|
|
LoadPort = data.order.LoadPort,
|
|
|
|
|
DischargePortId = data.order.DischargePortId,
|
|
|
|
|
DischargePortCode = data.order.DischargePortCode,
|
|
|
|
|
DischargePort = data.order.DischargePort,
|
|
|
|
|
CustomerService = data.order.CustomerService,
|
|
|
|
|
CustomerServiceName = data.order.CustomerServiceName,
|
|
|
|
|
BLType = BLTypeEnum.BL.ToString(),
|
|
|
|
|
BLTypeName = BLTypeEnum.BL.GetDescription(),
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
var saveRlt = await Save(dto);
|
|
|
|
|
|
|
|
|
|
if (saveRlt.Succeeded)
|
|
|
|
|
blModel = saveRlt.Data;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (blModel.IsCheckIn)
|
|
|
|
|
{
|
|
|
|
|
blModel.Status = BLIssueStatusEnum.RejectReleaeNotice.ToString();
|
|
|
|
|
blModel.StatusName = BLIssueStatusEnum.RejectReleaeNotice.GetDescription();
|
|
|
|
|
blModel.IsChangeEndorse = true;
|
|
|
|
|
|
|
|
|
|
await tenantDb.Updateable<BLIssueManageBase>(blModel)
|
|
|
|
|
.UpdateColumns(x => new
|
|
|
|
|
{
|
|
|
|
|
x.Status,
|
|
|
|
|
x.StatusName,
|
|
|
|
|
x.IsChangeEndorse,
|
|
|
|
|
}).ExecuteCommandAsync();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
var log = new BLIssueManageLog
|
|
|
|
|
{
|
|
|
|
|
Pid = blModel.Id,
|
|
|
|
|
ActionCode = BLIssueActionEnum.RejectReleaeNotice.ToString(),
|
|
|
|
|
ActionName = BLIssueActionEnum.RejectReleaeNotice.GetDescription(),
|
|
|
|
|
Note = model.Notes,
|
|
|
|
|
Result = "成功",
|
|
|
|
|
CreateBy = long.Parse(user.UserId),
|
|
|
|
|
CreateUserName = user.UserName,
|
|
|
|
|
CreateTime = nowDate,
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
await tenantDb.Insertable<BLIssueManageLog>(log).ExecuteCommandAsync();
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return DataResult.Successed("成功");
|
|
|
|
|
}
|
|
|
|
|
#endregion
|
|
|
|
|
|
|
|
|
@ -676,7 +1284,98 @@ namespace DS.WMS.Core.Op.Method
|
|
|
|
|
/// <returns>返回回执</returns>
|
|
|
|
|
public async Task<DataResult> BLModify(BLCheckInOutDto model)
|
|
|
|
|
{
|
|
|
|
|
return null;
|
|
|
|
|
var tenantDb = saasService.GetBizDbScopeById(user.TenantId);
|
|
|
|
|
|
|
|
|
|
if (model.bookids.Length == 0)
|
|
|
|
|
return DataResult.Failed("请求参数错误,请选择提单记录");
|
|
|
|
|
|
|
|
|
|
var orderList = tenantDb.Queryable<SeaExport>().ClearFilter(typeof(IOrgId))
|
|
|
|
|
.LeftJoin<BLIssueManageBase>((l, r) => l.Id == r.BookingId)
|
|
|
|
|
.Where((l, r) => model.bookids.Contains(l.Id) && l.Deleted == false)
|
|
|
|
|
.Select((l, r) => new { order = l, bl = r })
|
|
|
|
|
.ToList();
|
|
|
|
|
|
|
|
|
|
if (orderList.Count != model.bookids.Length)
|
|
|
|
|
{
|
|
|
|
|
return DataResult.Failed("部分订单查询失败,请重新查询台账");
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (orderList.Any(p => !p.bl.IsCheckIn))
|
|
|
|
|
{
|
|
|
|
|
string s = string.Join(",", orderList.Where(p => !p.bl.IsCheckIn)
|
|
|
|
|
.Select(b => b.bl.BLNo).ToArray());
|
|
|
|
|
|
|
|
|
|
return DataResult.Failed($"提单号:{s} 不能操作,只有已提单已签入才能进行 更改提单(其他)");
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
DateTime nowDate = DateTime.Now;
|
|
|
|
|
|
|
|
|
|
foreach (var data in orderList)
|
|
|
|
|
{
|
|
|
|
|
var blModel = data.bl;
|
|
|
|
|
|
|
|
|
|
if (blModel == null || blModel.Id == 0)
|
|
|
|
|
{
|
|
|
|
|
var dto = new BLIssueManageBaseInputDto
|
|
|
|
|
{
|
|
|
|
|
BookingId = data.order.Id,
|
|
|
|
|
BLNo = data.order.MBLNO,
|
|
|
|
|
CustomerId = data.order.CustomerId,
|
|
|
|
|
CustomerName = data.order.CustomerName,
|
|
|
|
|
SaleId = data.order.SaleId,
|
|
|
|
|
Sale = data.order.Sale,
|
|
|
|
|
IssueType = data.order.IssueType,
|
|
|
|
|
IssueTypeCode = data.order.IssueTypeCode,
|
|
|
|
|
IssuePlaceCode = data.order.IssuePlaceCode,
|
|
|
|
|
IssuePlace = data.order.IssuePlace,
|
|
|
|
|
LoadPortId = data.order.LoadPortId,
|
|
|
|
|
LoadPortCode = data.order.LoadPortCode,
|
|
|
|
|
LoadPort = data.order.LoadPort,
|
|
|
|
|
DischargePortId = data.order.DischargePortId,
|
|
|
|
|
DischargePortCode = data.order.DischargePortCode,
|
|
|
|
|
DischargePort = data.order.DischargePort,
|
|
|
|
|
CustomerService = data.order.CustomerService,
|
|
|
|
|
CustomerServiceName = data.order.CustomerServiceName,
|
|
|
|
|
BLType = BLTypeEnum.BL.ToString(),
|
|
|
|
|
BLTypeName = BLTypeEnum.BL.GetDescription(),
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
var saveRlt = await Save(dto);
|
|
|
|
|
|
|
|
|
|
if (saveRlt.Succeeded)
|
|
|
|
|
blModel = saveRlt.Data;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (blModel.IsCheckIn)
|
|
|
|
|
{
|
|
|
|
|
blModel.Status = BLIssueStatusEnum.BLModify.ToString();
|
|
|
|
|
blModel.StatusName = BLIssueStatusEnum.BLModify.GetDescription();
|
|
|
|
|
|
|
|
|
|
await tenantDb.Updateable<BLIssueManageBase>(blModel)
|
|
|
|
|
.UpdateColumns(x => new
|
|
|
|
|
{
|
|
|
|
|
x.Status,
|
|
|
|
|
x.StatusName,
|
|
|
|
|
}).ExecuteCommandAsync();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
var log = new BLIssueManageLog
|
|
|
|
|
{
|
|
|
|
|
Pid = blModel.Id,
|
|
|
|
|
ActionCode = BLIssueActionEnum.RejectReleaeNotice.ToString(),
|
|
|
|
|
ActionName = BLIssueActionEnum.RejectReleaeNotice.GetDescription(),
|
|
|
|
|
Note = model.Notes,
|
|
|
|
|
Result = "成功",
|
|
|
|
|
CreateBy = long.Parse(user.UserId),
|
|
|
|
|
CreateUserName = user.UserName,
|
|
|
|
|
CreateTime = nowDate,
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
await tenantDb.Insertable<BLIssueManageLog>(log).ExecuteCommandAsync();
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return DataResult.Successed("成功");
|
|
|
|
|
}
|
|
|
|
|
#endregion
|
|
|
|
|
|
|
|
|
@ -688,7 +1387,98 @@ namespace DS.WMS.Core.Op.Method
|
|
|
|
|
/// <returns>返回回执</returns>
|
|
|
|
|
public async Task<DataResult> BLModifyStatus(BLCheckInOutDto model)
|
|
|
|
|
{
|
|
|
|
|
return null;
|
|
|
|
|
var tenantDb = saasService.GetBizDbScopeById(user.TenantId);
|
|
|
|
|
|
|
|
|
|
if (model.bookids.Length == 0)
|
|
|
|
|
return DataResult.Failed("请求参数错误,请选择提单记录");
|
|
|
|
|
|
|
|
|
|
var orderList = tenantDb.Queryable<SeaExport>().ClearFilter(typeof(IOrgId))
|
|
|
|
|
.LeftJoin<BLIssueManageBase>((l, r) => l.Id == r.BookingId)
|
|
|
|
|
.Where((l, r) => model.bookids.Contains(l.Id) && l.Deleted == false)
|
|
|
|
|
.Select((l, r) => new { order = l, bl = r })
|
|
|
|
|
.ToList();
|
|
|
|
|
|
|
|
|
|
if (orderList.Count != model.bookids.Length)
|
|
|
|
|
{
|
|
|
|
|
return DataResult.Failed("部分订单查询失败,请重新查询台账");
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (orderList.Any(p => !p.bl.IsCheckIn))
|
|
|
|
|
{
|
|
|
|
|
string s = string.Join(",", orderList.Where(p => !p.bl.IsCheckIn)
|
|
|
|
|
.Select(b => b.bl.BLNo).ToArray());
|
|
|
|
|
|
|
|
|
|
return DataResult.Failed($"提单号:{s} 不能操作,只有已提单已签入才能进行 状态更改");
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
DateTime nowDate = DateTime.Now;
|
|
|
|
|
|
|
|
|
|
foreach (var data in orderList)
|
|
|
|
|
{
|
|
|
|
|
var blModel = data.bl;
|
|
|
|
|
|
|
|
|
|
if (blModel == null || blModel.Id == 0)
|
|
|
|
|
{
|
|
|
|
|
var dto = new BLIssueManageBaseInputDto
|
|
|
|
|
{
|
|
|
|
|
BookingId = data.order.Id,
|
|
|
|
|
BLNo = data.order.MBLNO,
|
|
|
|
|
CustomerId = data.order.CustomerId,
|
|
|
|
|
CustomerName = data.order.CustomerName,
|
|
|
|
|
SaleId = data.order.SaleId,
|
|
|
|
|
Sale = data.order.Sale,
|
|
|
|
|
IssueType = data.order.IssueType,
|
|
|
|
|
IssueTypeCode = data.order.IssueTypeCode,
|
|
|
|
|
IssuePlaceCode = data.order.IssuePlaceCode,
|
|
|
|
|
IssuePlace = data.order.IssuePlace,
|
|
|
|
|
LoadPortId = data.order.LoadPortId,
|
|
|
|
|
LoadPortCode = data.order.LoadPortCode,
|
|
|
|
|
LoadPort = data.order.LoadPort,
|
|
|
|
|
DischargePortId = data.order.DischargePortId,
|
|
|
|
|
DischargePortCode = data.order.DischargePortCode,
|
|
|
|
|
DischargePort = data.order.DischargePort,
|
|
|
|
|
CustomerService = data.order.CustomerService,
|
|
|
|
|
CustomerServiceName = data.order.CustomerServiceName,
|
|
|
|
|
BLType = BLTypeEnum.BL.ToString(),
|
|
|
|
|
BLTypeName = BLTypeEnum.BL.GetDescription(),
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
var saveRlt = await Save(dto);
|
|
|
|
|
|
|
|
|
|
if (saveRlt.Succeeded)
|
|
|
|
|
blModel = saveRlt.Data;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (blModel.IsCheckIn)
|
|
|
|
|
{
|
|
|
|
|
blModel.Status = BLIssueStatusEnum.StatusModify.ToString();
|
|
|
|
|
blModel.StatusName = BLIssueStatusEnum.StatusModify.GetDescription();
|
|
|
|
|
|
|
|
|
|
await tenantDb.Updateable<BLIssueManageBase>(blModel)
|
|
|
|
|
.UpdateColumns(x => new
|
|
|
|
|
{
|
|
|
|
|
x.Status,
|
|
|
|
|
x.StatusName,
|
|
|
|
|
}).ExecuteCommandAsync();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
var log = new BLIssueManageLog
|
|
|
|
|
{
|
|
|
|
|
Pid = blModel.Id,
|
|
|
|
|
ActionCode = BLIssueActionEnum.StatusModify.ToString(),
|
|
|
|
|
ActionName = BLIssueActionEnum.StatusModify.GetDescription(),
|
|
|
|
|
Note = model.Notes,
|
|
|
|
|
Result = "成功",
|
|
|
|
|
CreateBy = long.Parse(user.UserId),
|
|
|
|
|
CreateUserName = user.UserName,
|
|
|
|
|
CreateTime = nowDate,
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
await tenantDb.Insertable<BLIssueManageLog>(log).ExecuteCommandAsync();
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return DataResult.Successed("成功");
|
|
|
|
|
}
|
|
|
|
|
#endregion
|
|
|
|
|
|
|
|
|
|