|
|
@ -40,6 +40,7 @@ using Microsoft.AspNetCore.Components.Routing; |
|
|
|
using System.Globalization; |
|
|
|
using FastReport; |
|
|
|
using Microsoft.Extensions.Logging; |
|
|
|
using OfficeOpenXml.FormulaParsing.Excel.Functions.Math; |
|
|
|
|
|
|
|
|
|
|
|
namespace ICS.Application.Business.Service |
|
|
@ -460,9 +461,17 @@ namespace ICS.Application.Business.Service |
|
|
|
{ |
|
|
|
var item = data[i]; |
|
|
|
|
|
|
|
var entity = _customerRepository.FirstOrDefault(x => x.CusCode == item.CusCode); |
|
|
|
var entity = _customerRepository.FirstOrDefault(x => x.CusCode == item.CusCode|| x.CusName == item.CusName); |
|
|
|
if (entity == null) |
|
|
|
{ |
|
|
|
|
|
|
|
//var count = _customerRepository.Count(x => x.CusName == item.CusName);
|
|
|
|
// if (count > 0)
|
|
|
|
// {
|
|
|
|
// throw new UserFriendlyException(L("HasExistsCurrentCode", "客户档案"));
|
|
|
|
// }
|
|
|
|
|
|
|
|
|
|
|
|
entity = new IcsCustomer(); |
|
|
|
entity = ObjectMapper.Map<IcsCustomer>(item); |
|
|
|
//调用领域服务
|
|
|
|