Browse Source

更新版本

branch_ccpg_220107
Administrator 3 years ago
parent
commit
f15ba605e9
  1. 7
      .vs/VSWorkspaceState.json
  2. 36
      src/Modules/SettleAccount/src/SettleAccount.Job/Services/SettleAccount/SettleAccountImportService.cs

7
.vs/VSWorkspaceState.json

@ -0,0 +1,7 @@
{
"ExpandedNodes": [
""
],
"SelectedNode": "\\WY.NewJit.sln (src\\Modules\\派格FIS\\WY.NewJit.sln)",
"PreviewInSolutionExplorer": false
}

36
src/Modules/SettleAccount/src/SettleAccount.Job/Services/SettleAccount/SettleAccountImportService.cs

@ -42,8 +42,8 @@ namespace TaskJob.Services
public string ImportFile(Guid id, List<string> fileName, List<string> realfileName, List<CustomCondition> customConditions)
{
IExporter _excel = new ExcelExporter();
string fileSavePath = Environment.CurrentDirectory + @"\wwwroot\files\host\my-file-container\";
var version = customConditions.Where(p => p.Name == "Version").FirstOrDefault().Value;
@ -53,6 +53,7 @@ namespace TaskJob.Services
var factory = customConditions.Where(p => p.Name == "Factory").FirstOrDefault().Value;
//_versionRepository.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();
foreach (var itm in fileName)
@ -62,9 +63,9 @@ namespace TaskJob.Services
var filePath = fileSavePath + itm;//获取到导入的excel
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>();
var checkList = new List<ErrorExportDto>();
//var _chList = await _relrepository.GetAllAsync(GuidGenerator.Create(), true);
//var _chls = _chList.Select(p => p.SettleMaterialCode).Distinct();
@ -130,29 +131,22 @@ namespace TaskJob.Services
else
{
// _setls= _inputService.Input<Win.Sfs.SettleAccount.Entities.SettleAccounts.SettleAccount>(filePath);
var errorlist=new List<ErrorExportDto>();
var dtoList = _inputService.Input<SettleAccountImportDto>(filePath,null,errorlist);
var errorlist = new List<ErrorExportDto>();
var dtoList = _inputService.Input<SettleAccountImportDto>(filePath, null, errorlist);
foreach (var dto in dtoList)
{
if (dto.KENNCode.Length == 6)
{
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.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);
}
}
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);
@ -160,7 +154,7 @@ namespace TaskJob.Services
#region
//var errorFileName = "错误文件.xlsx";
//checkList.Add(new ErrorExportDto(version, customerCode, string.Empty, string.Empty, string.Empty, string.Empty, string.Format("ERP物料号{0}底盘号 {1}有重复", "11111111111", "22222222222"), string.Empty));
//_service.ExportError<ErrorExportDto>(id,errorFileName, checkList);
#endregion
}
@ -169,6 +163,14 @@ namespace TaskJob.Services
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();
}
}

Loading…
Cancel
Save