Browse Source

属性和属性值排序问题,设备仓位排序问题,

ingredientmanage
zhaoy 5 months ago
parent
commit
c8a4062cfc
3 changed files with 15 additions and 6 deletions
  1. +13
    -4
      BPA.SAAS.Manage.Application/DataBase/Services/GoodsAttributeService.cs
  2. +1
    -1
      BPA.SAAS.Manage.Application/DataBase/Services/GoodsService.cs
  3. +1
    -1
      BPA.SAAS.Manage.Application/Device/Services/WarehouseTemplateService.cs

+ 13
- 4
BPA.SAAS.Manage.Application/DataBase/Services/GoodsAttributeService.cs View File

@@ -6,6 +6,7 @@ using BPA.SAAS.Manage.Application.DataBase.Dtos.GoodsAttribute;
using StackExchange.Profiling.Internal;



namespace BPA.Franchisee.Application.FranchiseeCenter.GoodsServices
{
public class GoodsAttributeService: IGoodsAttributeService, ITransient
@@ -123,7 +124,7 @@ namespace BPA.Franchisee.Application.FranchiseeCenter.GoodsServices
foreach (var item in dto.GoodsAttributeValueList)
{
var updateselect = dellist.FirstOrDefault(x => x.Id == item.Id);
if (updateselect!=null)
if (updateselect != null)
{
if (updateselect.AttributeValue != item.AttributeValue || updateselect.Sort != item.Sort)
{
@@ -136,8 +137,7 @@ namespace BPA.Franchisee.Application.FranchiseeCenter.GoodsServices
res = await _db.Updateable(GoodsAttributeValue).IgnoreColumns(ignoreAllNullColumns: true).ExecuteCommandAsync();
}
}
//查询id是否存在
if (string.IsNullOrWhiteSpace(item.GoodsAttributeId))
else
{
//新增
BPA_GoodsAttributeValue GoodsAttributeValue = new();
@@ -196,7 +196,16 @@ namespace BPA.Franchisee.Application.FranchiseeCenter.GoodsServices
{
// 查询数据库中是否存在未删除的商品
var resEntitites = _db.Queryable<BPA_GoodsAttribute>().In(Ids).ToList();
var res =await _db.Deleteable(resEntitites).ExecuteCommandAsync();
var goodsTechnologyAction = _db.Queryable<BPA_GoodsTechnologyAction>()
.InnerJoin<BPA_GoodsAttributeValue>((o, cus) => o.GoodsAttributeId.Contains(cus.Id))
.InnerJoin<BPA_GoodsAttribute>((o, cus, oritem) =>cus.GoodsAttributeId == oritem.Id && Ids.Contains(oritem.Id))
.ToList(); // 将查询结果转换为列表
if (goodsTechnologyAction.Count()>0)
{
throw Oops.Oh("该属性已经使用无法删除!");
}
var res =await _db.Deleteable(resEntitites).ExecuteCommandAsync();
if (res > 0)
{
var resEntititesattr = _db.Queryable<BPA_GoodsAttributeValue>().In("GoodsAttributeId", Ids).ToList();


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

@@ -563,7 +563,7 @@ namespace BPA.SAAS.Manage.Application.DataBase.Services
{
var res = await _db.Queryable<BPA_GoodsInfo>()
.Where((a) => a.IsDeleted == 0 && a.Id == id)
.OrderBy(a => a.CreateAt, OrderByType.Desc)
.OrderBy(a => a.Sort, OrderByType.Asc)
.Select((a) => new GoodsInfoBaseView
{
Id = a.Id,


+ 1
- 1
BPA.SAAS.Manage.Application/Device/Services/WarehouseTemplateService.cs View File

@@ -39,7 +39,7 @@ namespace BPA.SAAS.Manage.Application.Device.Services
})
.Mapper(x =>
{
x.WarehousePostion= _db.Queryable <BPA_WarehousePostion>().Where(t=>t.TemplateId==x.Id).ToList();
x.WarehousePostion= _db.Queryable <BPA_WarehousePostion>().Where(t=>t.TemplateId==x.Id).OrderBy(x=>x.Code, OrderByType.Asc).ToList();
})
.OrderBy(a => a.CreateAt, OrderByType.Desc)
.ToPageListAsync(inputDto.Current, inputDto.PageSize, total);


Loading…
Cancel
Save