修改扣费

dev
jianghaiqing 3 weeks ago
parent 46a67d44f4
commit 5979bc96e6

@ -109,6 +109,33 @@ namespace DS.WMS.Core.Op.Method
*/
var tenantDb = saasService.GetBizDbScopeById(user.TenantId);
List<IConditionalModel> whereList = null;
string blNo = string.Empty;
string etdStart = string.Empty;
string etdEnd = string.Empty;
if (!querySearch.QueryCondition.IsNullOrEmpty())
{
whereList = querySearch.GetConditionalModels(db);
//if (whereList.Any(t => ((ConditionalModel)t).FieldName.Equals("blNo", StringComparison.OrdinalIgnoreCase)))
//{
// var t = whereList.FirstOrDefault(t => ((ConditionalModel)t).FieldName.Equals("blNo", StringComparison.OrdinalIgnoreCase));
// blNo = ((ConditionalModel)t).FieldValue;
// whereList.Remove(t);
//}
//if (whereList.Any(t => ((ConditionalModel)t).FieldName.Equals("etd", StringComparison.OrdinalIgnoreCase)))
//{
// var t = whereList.FirstOrDefault(t => ((ConditionalModel)t).FieldName.Equals("etd", StringComparison.OrdinalIgnoreCase));
// blNo = ((ConditionalModel)t).FieldValue;
// whereList.Remove(t);
//}
}
var query = tenantDb.Queryable<SeaExport>().ClearFilter(typeof(IOrgId))
.LeftJoin<BLIssueManageBase>((l, r) => l.Id == r.BookingId)
.WhereIF(querySearch.OtherQueryCondition != null && !string.IsNullOrWhiteSpace(querySearch.OtherQueryCondition.QueryTabCode)
@ -129,9 +156,8 @@ namespace DS.WMS.Core.Op.Method
BLIssueMangeQueryExtDto otherQuery = null;
if (!querySearch.QueryCondition.IsNullOrEmpty())
if (whereList != null)
{
var whereList = querySearch.GetConditionalModels(db);
query = query.Where(whereList);
}
@ -204,7 +230,7 @@ namespace DS.WMS.Core.Op.Method
}
}
return DataResult<List<BLIssueManageBaseDto>>.Success(resultList);
return DataResult<List<BLIssueManageBaseDto>>.PageList(result.Count, resultList, MultiLanguageConst.DataQuerySuccess);
}
#endregion
@ -279,40 +305,13 @@ namespace DS.WMS.Core.Op.Method
continue;
}
resultList.Add(new BLIssueManageBaseDto
{
Id = start,
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,
BusiType = BLIssueBusiTypeEnum.SeaExport.ToString(),
BusiTypeName = BLIssueBusiTypeEnum.SeaExport.GetDescription(),
BLType = BLTypeEnum.BL.ToString(),
BLTypeName = BLTypeEnum.BL.GetDescription(),
Doc = data.order.Doc,
DocName = data.order.DocName,
});
resultList.Add(GetInitInfo(start, data.order));
start++;
}
}
return DataResult<List<BLIssueManageBaseDto>>.Success(resultList);
return DataResult<List<BLIssueManageBaseDto>>.PageList(result.Count, resultList, MultiLanguageConst.DataQuerySuccess);
}
#endregion
@ -363,32 +362,7 @@ namespace DS.WMS.Core.Op.Method
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(),
BusiType = BLIssueBusiTypeEnum.SeaExport.ToString(),
BusiTypeName = BLIssueBusiTypeEnum.SeaExport.GetDescription(),
StlDate = data.order.StlDate,
};
var dto = GetReadSaveInfo(data.order);
var saveRlt = await Save(dto);
@ -584,32 +558,7 @@ namespace DS.WMS.Core.Op.Method
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(),
BusiType = BLIssueBusiTypeEnum.SeaExport.ToString(),
BusiTypeName = BLIssueBusiTypeEnum.SeaExport.GetDescription(),
StlDate = data.order.StlDate,
};
var dto = GetReadSaveInfo(data.order);
var saveRlt = await Save(dto);
@ -767,32 +716,7 @@ namespace DS.WMS.Core.Op.Method
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(),
BusiType = BLIssueBusiTypeEnum.SeaExport.ToString(),
BusiTypeName = BLIssueBusiTypeEnum.SeaExport.GetDescription(),
StlDate = data.order.StlDate,
};
var dto = GetReadSaveInfo(data.order);
var saveRlt = await Save(dto);
@ -945,32 +869,7 @@ namespace DS.WMS.Core.Op.Method
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(),
BusiType = BLIssueBusiTypeEnum.SeaExport.ToString(),
BusiTypeName = BLIssueBusiTypeEnum.SeaExport.GetDescription(),
StlDate = data.order.StlDate,
};
var dto = GetReadSaveInfo(data.order);
var saveRlt = await Save(dto);
@ -1133,32 +1032,7 @@ namespace DS.WMS.Core.Op.Method
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(),
BusiType = BLIssueBusiTypeEnum.SeaExport.ToString(),
BusiTypeName = BLIssueBusiTypeEnum.SeaExport.GetDescription(),
StlDate = data.order.StlDate,
};
var dto = GetReadSaveInfo(data.order);
var saveRlt = await Save(dto);
@ -1352,32 +1226,7 @@ namespace DS.WMS.Core.Op.Method
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(),
BusiType = BLIssueBusiTypeEnum.SeaExport.ToString(),
BusiTypeName = BLIssueBusiTypeEnum.SeaExport.GetDescription(),
StlDate = data.order.StlDate,
};
var dto = GetReadSaveInfo(data.order);
var saveRlt = await Save(dto);
@ -1460,32 +1309,7 @@ namespace DS.WMS.Core.Op.Method
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(),
BusiType = BLIssueBusiTypeEnum.SeaExport.ToString(),
BusiTypeName = BLIssueBusiTypeEnum.SeaExport.GetDescription(),
StlDate = data.order.StlDate,
};
var dto = GetReadSaveInfo(data.order);
var saveRlt = await Save(dto);
@ -1566,32 +1390,7 @@ namespace DS.WMS.Core.Op.Method
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(),
BusiType = BLIssueBusiTypeEnum.SeaExport.ToString(),
BusiTypeName = BLIssueBusiTypeEnum.SeaExport.GetDescription(),
StlDate = data.order.StlDate,
};
var dto = GetReadSaveInfo(data.order);
var saveRlt = await Save(dto);
@ -1686,5 +1485,83 @@ namespace DS.WMS.Core.Op.Method
return DataResult<List<BLOverdueFeeDto>>.Success(list);
}
#endregion
#region 获取初始化提单管理详情
/// <summary>
/// 获取初始化提单管理详情
/// </summary>
/// <param name="tempId">临时ID</param>
/// <param name="order">订单详情</param>
/// <param name="busiTypeEnum">业务类型</param>
/// <returns></returns>
private BLIssueManageBaseDto GetInitInfo(long tempId,SeaExport order, BLIssueBusiTypeEnum busiTypeEnum = BLIssueBusiTypeEnum.SeaExport)
{
return new BLIssueManageBaseDto
{
Id = tempId,
BookingId = order.Id,
BLNo = order.MBLNO,
CustomerId = order.CustomerId,
CustomerName = order.CustomerName,
SaleId = order.SaleId,
Sale = order.Sale,
IssueType = order.IssueType,
IssueTypeCode = order.IssueTypeCode,
IssuePlaceCode = order.IssuePlaceCode,
IssuePlace = order.IssuePlace,
LoadPortId = order.LoadPortId,
LoadPortCode = order.LoadPortCode,
LoadPort = order.LoadPort,
DischargePortId = order.DischargePortId,
DischargePortCode = order.DischargePortCode,
DischargePort = order.DischargePort,
CustomerService = order.CustomerService,
CustomerServiceName = order.CustomerServiceName,
BusiType = busiTypeEnum.ToString(),
BusiTypeName = busiTypeEnum.GetDescription(),
BLType = BLTypeEnum.BL.ToString(),
BLTypeName = BLTypeEnum.BL.GetDescription(),
Doc = order.Doc,
DocName = order.DocName,
};
}
#endregion
#region 获取待保存提单管理详情
/// <summary>
/// 获取待保存提单管理详情
/// </summary>
/// <param name="order">订单详情</param>
/// <param name="busiTypeEnum">业务类型</param>
/// <returns></returns>
private BLIssueManageBaseInputDto GetReadSaveInfo(SeaExport order, BLIssueBusiTypeEnum busiTypeEnum = BLIssueBusiTypeEnum.SeaExport)
{
return new BLIssueManageBaseInputDto
{
BookingId = order.Id,
BLNo = order.MBLNO,
CustomerId = order.CustomerId,
CustomerName = order.CustomerName,
SaleId = order.SaleId,
Sale = order.Sale,
IssueType = order.IssueType,
IssueTypeCode = order.IssueTypeCode,
IssuePlaceCode = order.IssuePlaceCode,
IssuePlace = order.IssuePlace,
LoadPortId = order.LoadPortId,
LoadPortCode = order.LoadPortCode,
LoadPort = order.LoadPort,
DischargePortId = order.DischargePortId,
DischargePortCode = order.DischargePortCode,
DischargePort = order.DischargePort,
CustomerService = order.CustomerService,
CustomerServiceName = order.CustomerServiceName,
BusiType = busiTypeEnum.ToString(),
BusiTypeName = busiTypeEnum.GetDescription(),
BLType = BLTypeEnum.BL.ToString(),
BLTypeName = BLTypeEnum.BL.GetDescription(),
};
}
#endregion
}
}

@ -3060,6 +3060,7 @@ namespace DS.WMS.Core.Op.Method
//这里更新订舱的详情
SeaExportOpenEditReq bkModel = new SeaExportOpenEditReq
{
Id = model.bookingOrderId,
MBLNO = bookingSlotBase.SlotBookingNo.Trim(),
ContractNo = !string.IsNullOrWhiteSpace(bookingSlotBase.ContractNo) ? bookingSlotBase.ContractNo : "",
Vessel = bookingSlotBase.Vessel?.ToUpper()?.Trim(),

@ -142,7 +142,7 @@ namespace DS.WMS.Core.Op.Method
string feeType = $"{(int)model.BSType}_{(int)model.SendType}";
var c = tenantDb.Queryable<DJYChargeFee>().Filter(null, true).Count(x => x.BillId == id && x.FeeType == feeType);
var c = tenantDb.Queryable<DJYChargeFee>().Filter(null, true).Count(x => x.BillId == id && x.MBLNO == orderInfo.MBLNO && x.FeeType == feeType);
if (c > 0)
{
Logger.Log(NLog.LogLevel.Info, $"{batchId}-已存在扣费记录id{id},提单号:{orderInfo.MBLNO} feeType={feeType}");

Loading…
Cancel
Save