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