|
@ -53,6 +53,7 @@ namespace TaskJob.Services |
|
|
var factory = customConditions.Where(p => p.Name == "Factory").FirstOrDefault().Value; |
|
|
var factory = customConditions.Where(p => p.Name == "Factory").FirstOrDefault().Value; |
|
|
//_versionRepository.Delete(version);
|
|
|
//_versionRepository.Delete(version);
|
|
|
//_repository.Delete(version);
|
|
|
//_repository.Delete(version);
|
|
|
|
|
|
List<Win.Sfs.SettleAccount.Entities.SettleAccounts.SettleAccount> _setls = new List<Win.Sfs.SettleAccount.Entities.SettleAccounts.SettleAccount>(); |
|
|
|
|
|
|
|
|
var _id = Guid.NewGuid(); |
|
|
var _id = Guid.NewGuid(); |
|
|
foreach (var itm in fileName) |
|
|
foreach (var itm in fileName) |
|
@ -62,7 +63,7 @@ namespace TaskJob.Services |
|
|
|
|
|
|
|
|
var filePath = fileSavePath + itm;//获取到导入的excel
|
|
|
var filePath = fileSavePath + itm;//获取到导入的excel
|
|
|
var exten = Path.GetExtension(fileSavePath); |
|
|
var exten = Path.GetExtension(fileSavePath); |
|
|
List<Win.Sfs.SettleAccount.Entities.SettleAccounts.SettleAccount> _setls = new List<Win.Sfs.SettleAccount.Entities.SettleAccounts.SettleAccount>(); |
|
|
|
|
|
List<string> _errorList = new List<string>(); |
|
|
List<string> _errorList = new List<string>(); |
|
|
|
|
|
|
|
|
var checkList = new List<ErrorExportDto>(); |
|
|
var checkList = new List<ErrorExportDto>(); |
|
@ -130,29 +131,22 @@ namespace TaskJob.Services |
|
|
else |
|
|
else |
|
|
{ |
|
|
{ |
|
|
// _setls= _inputService.Input<Win.Sfs.SettleAccount.Entities.SettleAccounts.SettleAccount>(filePath);
|
|
|
// _setls= _inputService.Input<Win.Sfs.SettleAccount.Entities.SettleAccounts.SettleAccount>(filePath);
|
|
|
var errorlist=new List<ErrorExportDto>(); |
|
|
var errorlist = new List<ErrorExportDto>(); |
|
|
var dtoList = _inputService.Input<SettleAccountImportDto>(filePath,null,errorlist); |
|
|
var dtoList = _inputService.Input<SettleAccountImportDto>(filePath, null, errorlist); |
|
|
foreach (var dto in dtoList) |
|
|
foreach (var dto in dtoList) |
|
|
{ |
|
|
{ |
|
|
if (dto.KENNCode.Length == 6) |
|
|
if (dto.KENNCode.Length == 6) |
|
|
{ |
|
|
{ |
|
|
dto.KENNCode = "0" + dto.KENNCode; |
|
|
dto.KENNCode = "0" + dto.KENNCode; |
|
|
} |
|
|
} |
|
|
var _settleaccount=new Win.Sfs.SettleAccount.Entities.SettleAccounts.SettleAccount(Guid.NewGuid(), Guid.NewGuid(),dto.SettleYear, dto.KENNCode, |
|
|
var _settleaccount = new Win.Sfs.SettleAccount.Entities.SettleAccounts.SettleAccount(Guid.NewGuid(), Guid.NewGuid(), dto.SettleYear, dto.KENNCode, |
|
|
dto.ChassisNumber, dto.Model, dto.CP5A, dto.CP7, |
|
|
dto.ChassisNumber, dto.Model, dto.CP5A, dto.CP7, |
|
|
dto.MaterialCode, dto.Qty, dto.SettlementID, dto.SettlementSupplier, |
|
|
dto.MaterialCode, dto.Qty, dto.SettlementID, dto.SettlementSupplier, |
|
|
DateTime.Now.Month.ToString(), dto.SettleYear, _id, version, DateTime.Now,Guid.NewGuid()); |
|
|
DateTime.Now.Month.ToString(), dto.SettleYear, _id, version, DateTime.Now, Guid.NewGuid()); |
|
|
_setls.Add(_settleaccount); |
|
|
_setls.Add(_settleaccount); |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
var _ls = _setls; |
|
|
|
|
|
var a = _ls.Where(p => string.IsNullOrEmpty(p.KENNCode)); |
|
|
|
|
|
var query = from arc in _ls |
|
|
|
|
|
group arc by new { arc.ChassisNumber, arc.MaterialCode } into g |
|
|
|
|
|
where g.Count() > 1 |
|
|
|
|
|
select g; |
|
|
|
|
|
_repository.Insert(_setls); |
|
|
|
|
|
_versionRepository.Insert(_id,version, customerCode, customerCode); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@ -169,6 +163,14 @@ namespace TaskJob.Services |
|
|
throw e; |
|
|
throw e; |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
_setls = _setls.GroupBy(p => new { p.ChassisNumber, p.MaterialCode, p.KENNCode }).Select(p => p.FirstOrDefault()).ToList(); |
|
|
|
|
|
_repository.Insert(_setls); |
|
|
|
|
|
_versionRepository.Insert(_id, version, customerCode, customerCode); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
return id.ToString(); |
|
|
return id.ToString(); |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|