|
|
@ -75,7 +75,6 @@ namespace Win.Sfs.SettleAccount.Entities.Prices |
|
|
|
result.FindAll(t => !string.IsNullOrEmpty(t.ES1) || !string.IsNullOrEmpty(t.ES2)).ForEach(t => t.PartNo = t.PartNo + new string(' ', 6) + t.ES1 + t.ES2); |
|
|
|
var newPrice = ObjectMapper.Map<List<PriceListBJImportDto>, List<PriceListBJ>>(result); |
|
|
|
newPrice = newPrice.GroupBy(p => new { p.Date, p.ClientCode, p.LU, p.BeginDate, p.EndDate }).Select(p => p.FirstOrDefault()).ToList(); |
|
|
|
|
|
|
|
#region 校验
|
|
|
|
if (newPrice.Any()) |
|
|
|
{ |
|
|
@ -101,7 +100,6 @@ namespace Win.Sfs.SettleAccount.Entities.Prices |
|
|
|
return new JsonResult(new { code = ApplicationConsts.ImportFailCode, message = "导入失败", fileName }); |
|
|
|
} |
|
|
|
#endregion
|
|
|
|
|
|
|
|
newPrice.ForEach(t => t.IsCancel = true); |
|
|
|
newPrice.GroupBy(t => new { t.ClientCode, t.LU }) |
|
|
|
.SelectMany(t => |
|
|
@ -269,14 +267,10 @@ namespace Win.Sfs.SettleAccount.Entities.Prices |
|
|
|
} |
|
|
|
plist.Add(entity); |
|
|
|
} |
|
|
|
|
|
|
|
await _settleAccountDbContext.SaveChangesAsync().ConfigureAwait(false); |
|
|
|
var dto = ObjectMapper.Map<PriceListBJ, PriceListBJDto>(plist.FirstOrDefault()); |
|
|
|
return dto; |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#endregion
|
|
|
|
} |
|
|
|
} |
|
|
|