|
|
@@ -101,8 +101,7 @@ namespace BPA.SAAS.Manage.Application.DataBase.Services |
|
|
|
GoodsTypeName = b.IsDeleted == 0 ? b.Name : "", |
|
|
|
Descritption = a.Descritption, |
|
|
|
IsDeleted = a.IsDeleted, |
|
|
|
|
|
|
|
// CreateAt = a.CreateAt, |
|
|
|
CreateAt = a.CreateAt, |
|
|
|
GoodsUintId = a.GoodsUintId, |
|
|
|
ForeignKeyRe = a.ForeignKeyRe, |
|
|
|
Design = a.Design, |
|
|
@@ -111,6 +110,7 @@ namespace BPA.SAAS.Manage.Application.DataBase.Services |
|
|
|
IsAttrubute = a.IsAttrubute, |
|
|
|
Goodstechnology = SqlFunc.Subqueryable<BPA_GoodsTechnologyAction>().Where(p => p.GoodsId == a.Id).WhereIF(!string.IsNullOrWhiteSpace(dto.DeviceId), p => p.DeviceId == dto.DeviceId).ToList(), |
|
|
|
}).ToListAsync(); |
|
|
|
res = res.OrderByDescending(t => t.CreateAt).ThenBy(t => t.Id).ToList(); |
|
|
|
if (!string.IsNullOrWhiteSpace(dto.DeviceId)) |
|
|
|
{ |
|
|
|
var goodsId = await _db.Queryable<BPA_GoodsTechnologyAction>().Where(t => t.DeviceId == dto.DeviceId).Select(q => q.GoodsId).Distinct().ToListAsync(); |
|
|
@@ -242,8 +242,8 @@ namespace BPA.SAAS.Manage.Application.DataBase.Services |
|
|
|
GoodsId = a.GoodsId, |
|
|
|
GoodsName = goodsList.FirstOrDefault(t => t.Id == a.GoodsId)?.Name, |
|
|
|
ImgUrl = goodsList.FirstOrDefault(t => t.Id == a.GoodsId)?.ImgUrl, |
|
|
|
CreateAt = goodsList.FirstOrDefault(t=>t.Id == a.GoodsId)?.CreateAt |
|
|
|
}).OrderByDescending(g => g.CreateAt).ToList() |
|
|
|
CreateAt = goodsList.FirstOrDefault(t => t.Id == a.GoodsId)?.CreateAt |
|
|
|
}).OrderByDescending(g => g.CreateAt).ThenBy(g => g.GoodsId).ToList() |
|
|
|
}); |
|
|
|
} |
|
|
|
foreach (var item in classifyDataList) |
|
|
@@ -1751,17 +1751,28 @@ namespace BPA.SAAS.Manage.Application.DataBase.Services |
|
|
|
{ |
|
|
|
var result = new List<GoodsChooseDto>(); |
|
|
|
var goodsList = await _db.Queryable<BPA_GoodsInfo>().ToListAsync(); |
|
|
|
if(Path.GetExtension(dto.File.FileName) == ".zip") |
|
|
|
var tempList = await _db.Queryable<BPA_TechnologyExportRecode>().Where(t => !string.IsNullOrWhiteSpace(t.TemplatePath)).Select(t => t.TemplatePath).ToListAsync(); |
|
|
|
var fileNames = new List<string>(); |
|
|
|
foreach (var temp in tempList) |
|
|
|
{ |
|
|
|
var uri = new Uri(temp); |
|
|
|
string fileName = Path.GetFileName(uri.LocalPath); |
|
|
|
fileNames.Add(fileName); |
|
|
|
} |
|
|
|
if (Path.GetExtension(dto.File.FileName) == ".zip") |
|
|
|
{ |
|
|
|
using var archive = new ZipArchive(dto.File.OpenReadStream(), ZipArchiveMode.Read); |
|
|
|
foreach (var entry in archive.Entries) |
|
|
|
{ |
|
|
|
var sheetNameList = GetSheetNameList(entry.Open()); |
|
|
|
var fileNameList = archive.Entries.Select(a => a.Name).ToList(); |
|
|
|
var intersectingFiles = fileNames.Intersect(fileNameList); |
|
|
|
if (goodsList.Any(t => t.Name == sheetNameList[0])) |
|
|
|
result.Add(new GoodsChooseDto |
|
|
|
{ |
|
|
|
GoodsName = sheetNameList[0], |
|
|
|
IsSkip = false |
|
|
|
IsSkip = false, |
|
|
|
AllGoodCount = intersectingFiles.Any() ? fileNameList.Count() - 1 : fileNameList.Count() |
|
|
|
}); |
|
|
|
} |
|
|
|
} |
|
|
@@ -1775,7 +1786,8 @@ namespace BPA.SAAS.Manage.Application.DataBase.Services |
|
|
|
result.Add(new GoodsChooseDto |
|
|
|
{ |
|
|
|
GoodsName = sheetNameList[0], |
|
|
|
IsSkip = false |
|
|
|
IsSkip = false, |
|
|
|
AllGoodCount = 1 |
|
|
|
}); |
|
|
|
} |
|
|
|
} |
|
|
|