Quellcode durchsuchen

提交

groupmealmanage
gwbvipvip vor 8 Monaten
Ursprung
Commit
ff19832050
7 geänderte Dateien mit 139 neuen und 0 gelöschten Zeilen
  1. BIN
     
  2. BIN
     
  3. +1
    -0
      BPA.SAAS.Manage.Application/AExternalPlatform/Service/Goods/Services/GoodsService.cs
  4. +48
    -0
      BPA.SAAS.Manage.Application/AExternalPlatform/Service/WeighingService/Dtos/GoodsDto.cs
  5. +12
    -0
      BPA.SAAS.Manage.Application/AExternalPlatform/Service/WeighingService/Services/IWeighingService.cs
  6. +54
    -0
      BPA.SAAS.Manage.Application/AExternalPlatform/Service/WeighingService/Services/WeighingService.cs
  7. +24
    -0
      BPA.SAAS.Manage.Application/AExternalPlatform/Service/WeighingService/WeighingServices.cs


+ 1
- 0
BPA.SAAS.Manage.Application/AExternalPlatform/Service/Goods/Services/GoodsService.cs Datei anzeigen

@@ -52,6 +52,7 @@ namespace BPA.SAAS.Manage.Application.AExternalPlatform.Service.Goods.Services
Data = data
};
}

/// <summary>
/// 添加商品
/// </summary>


+ 48
- 0
BPA.SAAS.Manage.Application/AExternalPlatform/Service/WeighingService/Dtos/GoodsDto.cs Datei anzeigen

@@ -0,0 +1,48 @@
using BPA.SAAS.Manage.Application.DataBase.Dtos.Goods;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace BPA.SAAS.Manage.Application.AExternalPlatform.Service.WeighingService.Dtos
{

public class GoodsTypeDto
{
//类别ID
public string Id { get; set; }
//类别名称
public string Name { get; set; }
//排序
public int Sort { get; set; }

public string TypeId { get; set; }

public List<GoodsDto> Foods;
}

public class GoodsDto
{
// 编号
public string Id { get; set; }

// 图片地址
public string Cover{ get; set; }

// 名称
public string Name { get; set; }

// vip价格
public double VipPrice { get; set; }

// 价格
public double Price { get; set; }

//排序
public int Sort { get; set; }

public string GoodsTypeId { get; set; }

}
}

+ 12
- 0
BPA.SAAS.Manage.Application/AExternalPlatform/Service/WeighingService/Services/IWeighingService.cs Datei anzeigen

@@ -0,0 +1,12 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace BPA.SAAS.Manage.Application.AExternalPlatform.Service.WeighingService.Services
{
public interface IWeighingService
{
}
}

+ 54
- 0
BPA.SAAS.Manage.Application/AExternalPlatform/Service/WeighingService/Services/WeighingService.cs Datei anzeigen

@@ -0,0 +1,54 @@
using BPA.KitChen.GroupMeal.SqlSugar;
using BPA.SAAS.Manage.Application.AExternalPlatform.Service.WeighingService.Dtos;
using BPA.SAAS.Manage.Core.DataBase;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace BPA.SAAS.Manage.Application.AExternalPlatform.Service.WeighingService.Services
{
public class WeighingService: IWeighingService, ITransient
{

/// <summary>
/// 获取商品信息
/// </summary>
/// <returns></returns>
public async Task<List<GoodsTypeDto>> GetGoodsInfo()
{
//获取商品类型
var goodsType =await SqlSugarDb.Db.Queryable<BPA_GoodsType>().OrderBy(x=>x.Sort)
.Select(x=>new GoodsTypeDto()
{
Id = x.Id,
Name = x.Name,
Sort = x.Sort,
}).ToListAsync();

//获取商品
var goods = await SqlSugarDb.Db.Queryable<BPA_GoodsInfo>().OrderBy(x => x.Sort)
.Select(x => new GoodsDto()
{
Id=x.Id,
Name=x.Name,
Sort=x.Sort,
Cover=x.ImgUrl,
GoodsTypeId = x.GoodsTypeId,
}).ToListAsync();

//获取商品属性价格
// var goodsPrice= await SqlSugarDb.Db.Queryable<BPA_GoodsInfo>().OrderBy(x => x.Sort)

foreach (var item in goodsType)
{
var data= goods.Where(x=>x.GoodsTypeId==item.Id).ToList();
item.Foods = data;
}

return goodsType;
}
}
}

+ 24
- 0
BPA.SAAS.Manage.Application/AExternalPlatform/Service/WeighingService/WeighingServices.cs Datei anzeigen

@@ -0,0 +1,24 @@
using BPA.SAAS.Manage.Application.AExternalPlatform.Service.CheckService.Services;
using BPA.SAAS.Manage.Application.AExternalPlatform.Service.WeighingService.Services;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace BPA.SAAS.Manage.Application.AExternalPlatform.Service.WeighingService
{

[ApiDescriptionSettings("开放平台", Tag = "称重接口"), AllowAnonymous]
public class WeighingServices: IDynamicApiController
{

private readonly IWeighingService _weighingService;
public WeighingServices(IWeighingService weighingService)
{
_weighingService = weighingService;
}


}
}

Laden…
Abbrechen
Speichern