zhaoy 8 mesi fa
parent
commit
d4f999db30
3 ha cambiato i file con 42 aggiunte e 20 eliminazioni
  1. +1
    -4
      BPA.SAAS.Manage.Application/DataBase/Services/GoodsService.cs
  2. +39
    -14
      BPA.SAAS.Manage.Application/DataBase/Services/GoodsTechnologyService.cs
  3. +2
    -2
      BPA.SAAS.Manage.Application/Device/Services/ProductService.cs

+ 1
- 4
BPA.SAAS.Manage.Application/DataBase/Services/GoodsService.cs Vedi File

@@ -286,10 +286,7 @@ namespace BPA.SAAS.Manage.Application.DataBase.Services
BomId= b.BoomId,
IsMain = a.IsMain,
GoodsAttributeValueId=b.GoodsAttributeValueId,
}).Mapper(x =>
{
var AttributeValue = _db.Queryable<BPA_GoodsAttributeValue>().Where(p => x.GoodsAttributeValueId.Contains(p.Id)).Select(p=>p.AttributeValue).ToArray();
x.GoodsAttributeValue =string.Join("-", AttributeValue);
GoodsAttributeValue=b.GoodsAttributeValue,
})
.ToPageListAsync(dto.Current, dto.PageSize, total);
PageUtil util = new PageUtil()


+ 39
- 14
BPA.SAAS.Manage.Application/DataBase/Services/GoodsTechnologyService.cs Vedi File

@@ -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;
}


+ 2
- 2
BPA.SAAS.Manage.Application/Device/Services/ProductService.cs Vedi File

@@ -98,8 +98,8 @@ namespace BPA.SAAS.Manage.Application.Device.Services
public async Task<bool> UpdateProduct(ProductBaseDto inputDto)
{
var data = await _db.Queryable<BPA_Product>().Where(x => x.Id == inputDto.Id).FirstAsync();
//var check = _db.Queryable<BPA_Product>().Where(x => x.Name == inputDto.Name || x.Code == inputDto.Code).Any();
//if (check) throw Oops.Oh("产品名称和标识不能重复");
var check = _db.Queryable<BPA_Product>().Where(x => (x.Name == inputDto.Name || x.Code == inputDto.Code) && x.Id != inputDto.Id).Any();
if (check) throw Oops.Oh("产品名称和标识不能重复");
if (data != null)
{
var res = _db.Updateable<BPA_Product>()


Caricamento…
Annulla
Salva