|
|
@@ -122,17 +122,42 @@ namespace BPA.SAAS.Manage.Application.DataBase.Services |
|
|
|
Id = x.Id.SelectAll(), |
|
|
|
}).OrderBy(x => x.Sort, OrderByType.Asc).ToList(); |
|
|
|
var Devicelist = await _db.Queryable<BPA_DeviceInfo>().ToListAsync(); |
|
|
|
var s = list.GroupBy(x => x.DeviceId).ToList(); |
|
|
|
for (int i = 0; i < s.Count; i++) |
|
|
|
var GoodsAttributeValue = await _db.Queryable<BPA_GoodsAttributeValue>().ToListAsync(); |
|
|
|
var sf = list.GroupBy(x => x.GoodsAttributeId).ToList(); |
|
|
|
for (int i = 0; i < sf.Count; i++) |
|
|
|
{ |
|
|
|
GoodsTechnologyActionListView item = new() |
|
|
|
var sd = GoodsAttributeValue?.Where(x => sf[i].Key.Contains(x.Id)).Select(x => x.AttributeValue).ToArray(); |
|
|
|
var nane =string.Join('-', sd); |
|
|
|
var s = sf[i].AsQueryable().ToList().GroupBy(x => x.DeviceId).ToList(); |
|
|
|
for (int t = 0; t < s.Count; t++) |
|
|
|
{ |
|
|
|
DeviceId = s[i].Key, |
|
|
|
DeviceName = Devicelist?.FirstOrDefault(x => x.Id == s[i].Key).DeviceName, |
|
|
|
Data = s[i].AsQueryable().ToList(), |
|
|
|
}; |
|
|
|
goodsTechnologyActionListViews.Add(item); |
|
|
|
GoodsTechnologyActionListView item = new() |
|
|
|
{ |
|
|
|
DeviceId = s[t].Key, |
|
|
|
DeviceName = Devicelist?.FirstOrDefault(x => x.Id == s[t].Key).DeviceName+ "【"+ nane+"】", |
|
|
|
Data = s[t].AsQueryable().ToList(), |
|
|
|
}; |
|
|
|
goodsTechnologyActionListViews.Add(item); |
|
|
|
} |
|
|
|
//GoodsTechnologyActionListView item = new() |
|
|
|
//{ |
|
|
|
// DeviceId = sf[i].Key, |
|
|
|
// DeviceName = Devicelist?.FirstOrDefault(x => x.Id == sf[i].Key).DeviceName, |
|
|
|
// Data = sf[i].AsQueryable().ToList(), |
|
|
|
//}; |
|
|
|
//goodsTechnologyActionListViews.Add(item); |
|
|
|
} |
|
|
|
//var s = list.GroupBy(x => x.DeviceId).ToList(); |
|
|
|
//for (int i = 0; i < s.Count; i++) |
|
|
|
//{ |
|
|
|
// GoodsTechnologyActionListView item = new() |
|
|
|
// { |
|
|
|
// DeviceId = s[i].Key, |
|
|
|
// DeviceName = Devicelist?.FirstOrDefault(x => x.Id == s[i].Key).DeviceName, |
|
|
|
// Data = s[i].AsQueryable().ToList(), |
|
|
|
// }; |
|
|
|
// goodsTechnologyActionListViews.Add(item); |
|
|
|
//} |
|
|
|
return goodsTechnologyActionListViews; |
|
|
|
} |
|
|
|
public async Task<bool> DeleteGoodsTechnologyAction(string id) |
|
|
@@ -178,12 +203,12 @@ namespace BPA.SAAS.Manage.Application.DataBase.Services |
|
|
|
Id = x.Id.SelectAll(), |
|
|
|
}).Mapper(a => |
|
|
|
{ |
|
|
|
a.GoodsTechnologyInfo = _db.Queryable<BPA_ProductFunction>().Where(d => d.DeviceVersionKey == a.ProductVersionId && d.Type==1).Select(d => new GoodsTechnologyInfo() |
|
|
|
{ |
|
|
|
DeviceTechnologyId = d.Id, |
|
|
|
DeviceVersionKey = d.DeviceVersionKey, |
|
|
|
Name = d.Name, |
|
|
|
}).ToList(); |
|
|
|
//a.GoodsTechnologyInfo = _db.Queryable<BPA_ProductFunction>().Where(d => d.DeviceVersionKey == a.ProductVersionId && d.Type==1).Select(d => new GoodsTechnologyInfo() |
|
|
|
//{ |
|
|
|
// DeviceTechnologyId = d.Id, |
|
|
|
// DeviceVersionKey = d.DeviceVersionKey, |
|
|
|
// Name = d.Name, |
|
|
|
//}).ToList(); |
|
|
|
}).ToListAsync(); |
|
|
|
return list; |
|
|
|
} |
|
|
|