diff --git a/BPA.SAAS.KitChenManage.Application/AExternalPlatform1/Service/Goods/Dtos/ResultGoodsResultDto.cs b/BPA.SAAS.KitChenManage.Application/AExternalPlatform1/Service/Goods/Dtos/ResultGoodsResultDto.cs index 1f92c82..b852c6d 100644 --- a/BPA.SAAS.KitChenManage.Application/AExternalPlatform1/Service/Goods/Dtos/ResultGoodsResultDto.cs +++ b/BPA.SAAS.KitChenManage.Application/AExternalPlatform1/Service/Goods/Dtos/ResultGoodsResultDto.cs @@ -37,6 +37,21 @@ namespace BPA.SAAS.KitChenManage.Application.AExternalPlatform1.Service.Goods.Dt public int timestamp { get; set; } } + public class ResultGoodsClassifyResultDto + { + public int statusCode { get; set; } + + public List data { get; set; } + + public string succeeded { get; set; } + + public string errors { get; set; } + + public string extras { get; set; } + + public int timestamp { get; set; } + } + public class ResultDeviceResultDto { public int statusCode { get; set; } @@ -55,20 +70,33 @@ namespace BPA.SAAS.KitChenManage.Application.AExternalPlatform1.Service.Goods.Dt public class GoodsAndDeviceResultDto { public List GoodsInfoList { get; set; } + public List GoodsClassifyList { get; set; } public DeviceInfoQueryDto DeviceInfo { get;set; } } + public class GoodsClassifyResultDto + { + public string GoodsClassifyId { get; set; } + public string GoodsClassifyName { get; set; } + public List GoodsList { get; set; } + } + + public class GoodsDataResultDto + { + public string GoodsId { get; set; } + public string GoodsName { get; set; } + public string ImgUrl { get; set; } + } + public class GoodsTypeResultDto { public string GoodsTypeId { get; set; } public string GoodsTypeName { get; set; } - public List GoodsAttributeList { get; set; } public List GoodsInfoList { get; set; } - } @@ -78,6 +106,8 @@ namespace BPA.SAAS.KitChenManage.Application.AExternalPlatform1.Service.Goods.Dt public string GoodsAttributeName { get; set; } + public int Sort { get; set; } + public List GoodsAttributeValueList { get; set; } } @@ -86,6 +116,7 @@ namespace BPA.SAAS.KitChenManage.Application.AExternalPlatform1.Service.Goods.Dt public string GoodsAttributeId { get; set; } public string GoodsAttributeValueId { get; set; } public string AttributeValue { get; set; } + public int Sort { get; set; } } public class GoodsResultDto diff --git a/BPA.SAAS.KitChenManage.Application/AExternalPlatform1/Service/Goods/Services/GoodsServices.cs b/BPA.SAAS.KitChenManage.Application/AExternalPlatform1/Service/Goods/Services/GoodsServices.cs index a95b3a3..ded7dc5 100644 --- a/BPA.SAAS.KitChenManage.Application/AExternalPlatform1/Service/Goods/Services/GoodsServices.cs +++ b/BPA.SAAS.KitChenManage.Application/AExternalPlatform1/Service/Goods/Services/GoodsServices.cs @@ -30,16 +30,7 @@ namespace BPA.SAAS.KitChenManage.Application.AExternalPlatform1.Service.Goods.Se [HttpPost("/api/goods/Getdevicegoods")] public async Task GetDeviceGoods(string deviceId) { - var goodsId = await _db.Queryable() - .Where(x => x.AutoKey.ToString() == deviceId) - .Select(x => x.GoodsId) - .ToListAsync(); - var device = await _db.Queryable().FirstAsync(t => t.AutoKey.ToString() == deviceId); - if (device != null) - { - goodsId.Insert(0, device.DeviceId); - } - var data = await GetDeviceGoodspost(goodsId, deviceId); + var data = await GetDeviceGoodspost(deviceId); return data; } @@ -47,20 +38,22 @@ namespace BPA.SAAS.KitChenManage.Application.AExternalPlatform1.Service.Goods.Se /// /// 获取商品信息 /// - /// /// /// - public async Task GetDeviceGoodspost(List goodsList, string autoKey) + public async Task GetDeviceGoodspost(string autoKey) { try { var result = new ResultGoodsAndDeviceResultDto { statusCode = 200, data = new GoodsAndDeviceResultDto(), succeeded = "true" }; - Dictionary dic = new Dictionary(); + var dic = new Dictionary(); var goodsUrl = App.Configuration["baseurl"] + "api/goods/GetGoodsListByIds"; - var goodsInputData = JsonConvert.SerializeObject(goodsList); - var goodsJsonData = HttpHelper.PostData(goodsUrl, goodsInputData, Encoding.UTF8, "application/json", dic); + var goodsJsonData = HttpHelper.HttpGet(goodsUrl, $"?autoKey={autoKey}", dic, "application/json"); var goodsData = JsonConvert.DeserializeObject(goodsJsonData); result.data.GoodsInfoList = goodsData?.data; + var classifyUrl = App.Configuration["baseurl"] + "api/goods/GetGoodsClassifyByIds"; + var classifyJsonData = HttpHelper.HttpGet(classifyUrl, $"?autoKey={autoKey}", dic, "application/json"); + var classifyData = JsonConvert.DeserializeObject(classifyJsonData); + result.data.GoodsClassifyList = classifyData?.data; var deviceUrl = App.Configuration["baseurl"] + "api/device/getDeviceInfoByDeviceId"; var deviceInputData = JsonConvert.SerializeObject(autoKey); var deviceJsonData = HttpHelper.HttpGet(deviceUrl, $"?autoKey={autoKey}", dic, "application/json"); diff --git a/BPA.SAAS.KitChenManage.Application/BPA.SAAS.KitChenManage.Application.xml b/BPA.SAAS.KitChenManage.Application/BPA.SAAS.KitChenManage.Application.xml index 18e21c9..2715be8 100644 --- a/BPA.SAAS.KitChenManage.Application/BPA.SAAS.KitChenManage.Application.xml +++ b/BPA.SAAS.KitChenManage.Application/BPA.SAAS.KitChenManage.Application.xml @@ -206,11 +206,10 @@ - + 获取商品信息 -