Browse Source

更新版本

Agv分支2024-11-19
赵新宇 4 months ago
parent
commit
d05b91726d
  1. 32
      be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Requests/DeliverRequests/DeliverRequestAppService.cs

32
be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Requests/DeliverRequests/DeliverRequestAppService.cs

@ -111,10 +111,31 @@ public class DeliverRequestAppService :
return dictionary;
}
private async Task CheckSalePrice(List<DeliverRequest> requests)
/// <summary>
/// 成品发运价格校验
/// </summary>
/// <param name="ids"></param>
/// <param name="truckNumber"></param>
/// <returns></returns>
/// <exception cref="UserFriendlyException"></exception>
[HttpPost("check-sale-price")]
public async Task<List<string>> CheckSalePriceAsync(List<Guid> ids, string truckNumber)
{
if (string.IsNullOrEmpty(truckNumber))
{
throw new UserFriendlyException($"车牌号不能为空");
}
var entitys = await _repository.GetListAsync(r => ids.Contains(r.Id), true).ConfigureAwait(false);
if (entitys.Select(r => r.CustomerCode).Distinct().Count() > 1)
{
throw new UserFriendlyException($"所选申请涉及多个客户不能创建为一个发货单,请重新选择!");
}
//一车发运车牌号相同
entitys.ForEach(r => { r.MesTruckNumber = truckNumber; });
Check.NotNull(entitys, typeof(DeliverRequest).Name);
List<string> errors=new List<string>();
foreach (var request in requests)
foreach (var request in entitys)
{
foreach (var itm in request.Details)
{
@ -125,12 +146,7 @@ public class DeliverRequestAppService :
}
}
}
if (errors.Count > 0)
{
throw new UserFriendlyException($"{string.Format(",",errors.ToArray())+""}");
}
return errors;
}
private async Task CheckCustomerItem(DeliverRequest request)

Loading…
Cancel
Save