@@ -1,38 +1,38 @@ | |||
using BPA.SAAS.KitChenManage.Core; | |||
using BPA.SAAS.Manage.Application.AExternalPlatform.BaseDto; | |||
using BPA.SAAS.Manage.Application.AExternalPlatform.Enum; | |||
using BPA.SAAS.Manage.Application.AExternalPlatform.Service.DiningPlate.Dtos; | |||
using BPA.SAAS.Manage.Application.AExternalPlatform.Service.DiningPlate.Services; | |||
using BPA.SAAS.Manage.Comm.Util; | |||
using Newtonsoft.Json; | |||
using System; | |||
using System.Collections.Generic; | |||
using System.Linq; | |||
using System.Text; | |||
using System.Threading.Tasks; | |||
//using BPA.SAAS.KitChenManage.Core; | |||
//using BPA.SAAS.Manage.Application.AExternalPlatform.BaseDto; | |||
//using BPA.SAAS.Manage.Application.AExternalPlatform.Enum; | |||
//using BPA.SAAS.Manage.Application.AExternalPlatform.Service.DiningPlate.Dtos; | |||
//using BPA.SAAS.Manage.Application.AExternalPlatform.Service.DiningPlate.Services; | |||
//using BPA.SAAS.Manage.Comm.Util; | |||
//using Newtonsoft.Json; | |||
//using System; | |||
//using System.Collections.Generic; | |||
//using System.Linq; | |||
//using System.Text; | |||
//using System.Threading.Tasks; | |||
namespace BPA.SAAS.Manage.Application.AExternalPlatform.Service.DiningPlate | |||
{ | |||
//namespace BPA.SAAS.Manage.Application.AExternalPlatform.Service.DiningPlate | |||
//{ | |||
[ApiDescriptionSettings("开放平台", Tag = "餐盘管理"), AllowAnonymous] | |||
public class DiningPlateServices: IDynamicApiController | |||
{ | |||
// [ApiDescriptionSettings("开放平台", Tag = "餐盘管理"), AllowAnonymous] | |||
// public class DiningPlateServices: IDynamicApiController | |||
// { | |||
private readonly IDiningPlateService _diningPlateService; | |||
public DiningPlateServices(IDiningPlateService diningPlateService) | |||
{ | |||
_diningPlateService = diningPlateService; | |||
} | |||
// private readonly IDiningPlateService _diningPlateService; | |||
// public DiningPlateServices(IDiningPlateService diningPlateService) | |||
// { | |||
// _diningPlateService = diningPlateService; | |||
// } | |||
/// <summary> | |||
/// 根据二维码修改餐盘信息(有就修改没有就新增) | |||
/// </summary> | |||
/// <param name="inputDto"></param> | |||
/// <returns></returns> | |||
[HttpPost("/api/ExternalPlatform/Device/EditDiningPlateByQRCode")] | |||
public async Task<bool> EditDiningPlateByQRCode(DiningPlateCreateOrUpdataDto inputDto) | |||
{ | |||
return await _diningPlateService.EditDiningPlateByQRCode(inputDto); | |||
} | |||
} | |||
} | |||
// /// <summary> | |||
// /// 根据二维码修改餐盘信息(有就修改没有就新增) | |||
// /// </summary> | |||
// /// <param name="inputDto"></param> | |||
// /// <returns></returns> | |||
// [HttpPost("/api/ExternalPlatform/Device/EditDiningPlateByQRCode")] | |||
// public async Task<bool> EditDiningPlateByQRCode(DiningPlateCreateOrUpdataDto inputDto) | |||
// { | |||
// return await _diningPlateService.EditDiningPlateByQRCode(inputDto); | |||
// } | |||
// } | |||
//} |
@@ -34,10 +34,10 @@ namespace BPA.SAAS.Manage.Application.AExternalPlatform.Service.WeighingService. | |||
public string Name { get; set; } | |||
// vip价格 | |||
public double VipPrice { get; set; } | |||
public decimal VipPrice { get; set; } | |||
// 价格 | |||
public double Price { get; set; } | |||
public decimal Price { get; set; } | |||
//排序 | |||
public int Sort { get; set; } | |||
@@ -1,4 +1,5 @@ | |||
using System; | |||
using BPA.SAAS.Manage.Application.AExternalPlatform.Service.WeighingService.Dtos; | |||
using System; | |||
using System.Collections.Generic; | |||
using System.Linq; | |||
using System.Text; | |||
@@ -8,5 +9,11 @@ namespace BPA.SAAS.Manage.Application.AExternalPlatform.Service.WeighingService. | |||
{ | |||
public interface IWeighingService | |||
{ | |||
/// <summary> | |||
/// 获取商品信息 | |||
/// </summary> | |||
/// <returns></returns> | |||
Task<List<GoodsTypeDto>> GetGoodsInfo(); | |||
} | |||
} |
@@ -9,18 +9,19 @@ using System.Threading.Tasks; | |||
namespace BPA.SAAS.Manage.Application.AExternalPlatform.Service.WeighingService.Services | |||
{ | |||
public class WeighingService: IWeighingService, ITransient | |||
public class WeighingService : IWeighingService, ITransient | |||
{ | |||
/// <summary> | |||
/// 获取商品信息 | |||
/// </summary> | |||
/// <returns></returns> | |||
[HttpPost("/api/ExternalPlatform/WeighingService/GetGoodsInfo")] | |||
public async Task<List<GoodsTypeDto>> GetGoodsInfo() | |||
{ | |||
//获取商品类型 | |||
var goodsType =await SqlSugarDb.Db.Queryable<BPA_GoodsType>().OrderBy(x=>x.Sort) | |||
.Select(x=>new GoodsTypeDto() | |||
var goodsType = await SqlSugarDb.Db.Queryable<BPA_GoodsType>().OrderBy(x => x.Sort) | |||
.Select(x => new GoodsTypeDto() | |||
{ | |||
Id = x.Id, | |||
Name = x.Name, | |||
@@ -28,27 +29,35 @@ namespace BPA.SAAS.Manage.Application.AExternalPlatform.Service.WeighingService. | |||
}).ToListAsync(); | |||
//获取商品 | |||
var goods = await SqlSugarDb.Db.Queryable<BPA_GoodsInfo>().OrderBy(x => x.Sort) | |||
var goodsList = 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, | |||
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) | |||
////获取商品属性价格 | |||
//var goodsPriceList = await SqlSugarDb.Db.Queryable<BPA_GoodsAttributePrice>().ToListAsync(); | |||
//foreach (var goods in goodsList) | |||
//{ | |||
// var data = goodsPriceList.Where(x=>x.GoodsId==goods.Id).ToList(); | |||
// if (data!=null) | |||
// { | |||
// goods.Price = data.FirstOrDefault()!.Price; | |||
// goods.VipPrice = goods.Price; | |||
// } | |||
//} | |||
foreach (var item in goodsType) | |||
{ | |||
var data= goods.Where(x=>x.GoodsTypeId==item.Id).ToList(); | |||
item.Foods = data; | |||
} | |||
foreach (var item in goodsType) | |||
{ | |||
var data = goodsList.Where(x => x.GoodsTypeId == item.Id).ToList(); | |||
item.Foods = data; | |||
} | |||
return goodsType; | |||
return goodsType; | |||
} | |||
} | |||
} |
@@ -1,4 +1,5 @@ | |||
using BPA.SAAS.Manage.Application.AExternalPlatform.Service.CheckService.Services; | |||
using BPA.SAAS.Manage.Application.AExternalPlatform.Service.WeighingService.Dtos; | |||
using BPA.SAAS.Manage.Application.AExternalPlatform.Service.WeighingService.Services; | |||
using System; | |||
using System.Collections.Generic; | |||
@@ -20,5 +21,14 @@ namespace BPA.SAAS.Manage.Application.AExternalPlatform.Service.WeighingService | |||
} | |||
/// <summary> | |||
/// 获取商品信息 | |||
/// </summary> | |||
/// <returns></returns> | |||
[HttpPost("/api/ExternalPlatform/WeighingService/GetGoodsInfo")] | |||
public async Task<List<GoodsTypeDto>> GetGoodsInfo() | |||
{ | |||
return await _weighingService.GetGoodsInfo(); | |||
} | |||
} | |||
} |
@@ -75,12 +75,21 @@ namespace BPA.SAAS.Manage.Web.Core | |||
var key = httpRequest.Headers["key"]; | |||
var sign = httpRequest.Headers["sign"]; | |||
List<PropertyInfo> proplist = new List<PropertyInfo>(); | |||
foreach (var parameter in parameters) | |||
if (parameters.Count<=0) | |||
{ | |||
var stingA = DtoValidator.GetSign(parameter.Value); | |||
//var sign = DtoValidator.GetAttributePrice(parameter.Value, "sign"); | |||
await _checkServices.CheckSign(key, stingA, sign); | |||
await _checkServices.CheckSign(key, "", sign); | |||
} | |||
else | |||
{ | |||
foreach (var parameter in parameters) | |||
{ | |||
var stingA = DtoValidator.GetSign(parameter.Value); | |||
//var sign = DtoValidator.GetAttributePrice(parameter.Value, "sign"); | |||
await _checkServices.CheckSign(key, stingA, sign); | |||
} | |||
} | |||
} | |||
//============== 这里是执行方法之后获取数据 ==================== | |||