Browse Source

提交

master
gwbvipvip 6 months ago
parent
commit
9f17279214
29 changed files with 856 additions and 32 deletions
  1. +0
    -0
      BPA.SAAS.KitChenManage.Application/AExternalPlatform1/BaseDto/BaseEPDto.cs
  2. +0
    -0
      BPA.SAAS.KitChenManage.Application/AExternalPlatform1/BaseDto/DtoValidator.cs
  3. +0
    -0
      BPA.SAAS.KitChenManage.Application/AExternalPlatform1/BaseDto/ResultSAASManageDto.cs
  4. +0
    -0
      BPA.SAAS.KitChenManage.Application/AExternalPlatform1/BaseDto/UserAnalysis.cs
  5. +0
    -0
      BPA.SAAS.KitChenManage.Application/AExternalPlatform1/Enum/ErrorCodeEnum.cs
  6. +0
    -0
      BPA.SAAS.KitChenManage.Application/AExternalPlatform1/Service/Authorization/AuthServices.cs
  7. +0
    -0
      BPA.SAAS.KitChenManage.Application/AExternalPlatform1/Service/Authorization/Dtos/StoreAuthDto.cs
  8. +0
    -0
      BPA.SAAS.KitChenManage.Application/AExternalPlatform1/Service/Authorization/Services/AuthService.cs
  9. +0
    -0
      BPA.SAAS.KitChenManage.Application/AExternalPlatform1/Service/Authorization/Services/IAuthService.cs
  10. +0
    -0
      BPA.SAAS.KitChenManage.Application/AExternalPlatform1/Service/CheckService/CheckServices.cs
  11. +0
    -0
      BPA.SAAS.KitChenManage.Application/AExternalPlatform1/Service/CheckService/Services/CheckServices.cs
  12. +0
    -0
      BPA.SAAS.KitChenManage.Application/AExternalPlatform1/Service/CheckService/Services/ICheckServices.cs
  13. +99
    -0
      BPA.SAAS.KitChenManage.Application/AExternalPlatform1/Service/Goods/Dtos/ResultGoodsResultDto.cs
  14. +71
    -0
      BPA.SAAS.KitChenManage.Application/AExternalPlatform1/Service/Goods/Services/GoodsServices.cs
  15. +18
    -0
      BPA.SAAS.KitChenManage.Application/AExternalPlatform1/Service/Goods/Services/IGoodsServices.cs
  16. +0
    -0
      BPA.SAAS.KitChenManage.Application/AExternalPlatform1/Service/Platform/Material/MaterialServices.cs
  17. +0
    -0
      BPA.SAAS.KitChenManage.Application/AExternalPlatform1/Service/Platform/Material/Services/IMaterialServices.cs
  18. +0
    -0
      BPA.SAAS.KitChenManage.Application/AExternalPlatform1/Service/Platform/Material/Services/MaterialService.cs
  19. +3
    -0
      BPA.SAAS.KitChenManage.Application/BPA.SAAS.KitChenManage.Application.csproj
  20. +317
    -0
      BPA.SAAS.KitChenManage.Application/BPA.SAAS.KitChenManage.Application.xml
  21. +30
    -2
      BPA.SAAS.KitChenManage.Application/Device/DevicePushRecodeServices.cs
  22. +22
    -0
      BPA.SAAS.KitChenManage.Application/Device/Dtos/DeviceGoodsInputDto.cs
  23. +90
    -29
      BPA.SAAS.KitChenManage.Application/Device/Services/DevicePushRecodeService.cs
  24. +19
    -1
      BPA.SAAS.KitChenManage.Application/Device/Services/IDevicePushRecodeService.cs
  25. +99
    -0
      BPA.SAAS.KitChenManage.Application/Food/Dtos/ResultSAASManageDto.cs
  26. +11
    -0
      BPA.SAAS.KitChenManage.Application/Food/FoodMenuServices.cs
  27. +49
    -0
      BPA.SAAS.KitChenManage.Application/Food/Services/FoodMenuService.cs
  28. +6
    -0
      BPA.SAAS.KitChenManage.Application/Food/Services/IFoodMenuService.cs
  29. +22
    -0
      BPA.SAAS.KitChenManage.Core/Model/BPA_DeviceGoods.cs

BPA.SAAS.KitChenManage.Application/AExternalPlatform/BaseDto/BaseEPDto.cs → BPA.SAAS.KitChenManage.Application/AExternalPlatform1/BaseDto/BaseEPDto.cs View File


BPA.SAAS.KitChenManage.Application/AExternalPlatform/BaseDto/DtoValidator.cs → BPA.SAAS.KitChenManage.Application/AExternalPlatform1/BaseDto/DtoValidator.cs View File


BPA.SAAS.KitChenManage.Application/AExternalPlatform/BaseDto/ResultSAASManageDto.cs → BPA.SAAS.KitChenManage.Application/AExternalPlatform1/BaseDto/ResultSAASManageDto.cs View File


BPA.SAAS.KitChenManage.Application/AExternalPlatform/BaseDto/UserAnalysis.cs → BPA.SAAS.KitChenManage.Application/AExternalPlatform1/BaseDto/UserAnalysis.cs View File


BPA.SAAS.KitChenManage.Application/AExternalPlatform/Enum/ErrorCodeEnum.cs → BPA.SAAS.KitChenManage.Application/AExternalPlatform1/Enum/ErrorCodeEnum.cs View File


BPA.SAAS.KitChenManage.Application/AExternalPlatform/Service/Authorization/AuthServices.cs → BPA.SAAS.KitChenManage.Application/AExternalPlatform1/Service/Authorization/AuthServices.cs View File


BPA.SAAS.KitChenManage.Application/AExternalPlatform/Service/Authorization/Dtos/StoreAuthDto.cs → BPA.SAAS.KitChenManage.Application/AExternalPlatform1/Service/Authorization/Dtos/StoreAuthDto.cs View File


BPA.SAAS.KitChenManage.Application/AExternalPlatform/Service/Authorization/Services/AuthService.cs → BPA.SAAS.KitChenManage.Application/AExternalPlatform1/Service/Authorization/Services/AuthService.cs View File


BPA.SAAS.KitChenManage.Application/AExternalPlatform/Service/Authorization/Services/IAuthService.cs → BPA.SAAS.KitChenManage.Application/AExternalPlatform1/Service/Authorization/Services/IAuthService.cs View File


BPA.SAAS.KitChenManage.Application/AExternalPlatform/Service/CheckService/CheckServices.cs → BPA.SAAS.KitChenManage.Application/AExternalPlatform1/Service/CheckService/CheckServices.cs View File


BPA.SAAS.KitChenManage.Application/AExternalPlatform/Service/CheckService/Services/CheckServices.cs → BPA.SAAS.KitChenManage.Application/AExternalPlatform1/Service/CheckService/Services/CheckServices.cs View File


BPA.SAAS.KitChenManage.Application/AExternalPlatform/Service/CheckService/Services/ICheckServices.cs → BPA.SAAS.KitChenManage.Application/AExternalPlatform1/Service/CheckService/Services/ICheckServices.cs View File


+ 99
- 0
BPA.SAAS.KitChenManage.Application/AExternalPlatform1/Service/Goods/Dtos/ResultGoodsResultDto.cs View File

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

namespace BPA.SAAS.KitChenManage.Application.AExternalPlatform1.Service.Goods.Dtos
{
public class ResultGoodsResultDto
{
public int statusCode { get; set; }

public List<GoodsTypeResultDto> 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 GoodsTypeResultDto
{
public string GoodsTypeId { get; set; }

public string GoodsTypeName { get; set; }

public List<GoodsAttributeResultDto> GoodsAttributeList { get; set; }

public List<GoodsInfoResultDto> GoodsInfoList { get; set; }
}


public class GoodsAttributeResultDto
{
public string GoodsAttributeId { get; set; }

public string GoodsAttributeName { get; set; }

public List<GoodsAttributeValueResultDto> GoodsAttributeValueList { get; set; }
}

public class GoodsAttributeValueResultDto
{
public string GoodsAttributeId { get; set; }
public string GoodsAttributeValueId { get; set; }
public string AttributeValue { get; set; }
}

public class GoodsResultDto
{
public string TypeId { get; set; }

public string TypeName { get; set; }
}

public class GoodsInfoResultDto
{
public string GoodsId { get; set; }

public string GoodsName { get; set; }

public List<GoodsTechnologyActionResultDto> GoodsTechnologyActionList { get; set; }
}

public class GoodsTechnologyActionResultDto
{
/// <summary>
/// 步骤名称
/// </summary>
public string StepName { get; set; }
/// <summary>
/// 动作json
/// </summary>
public string ActionJson { get; set; }
/// <summary>
/// 商品属性id集合
/// </summary>
public string GoodsAttributeId { get; set; }
/// <summary>
/// 是否物料
/// </summary>
public bool IsBatch { get; set; }
/// <summary>
/// 动作value
/// </summary>
public string ChnologyId { get; set; }
public string GroupId { get; set; }
public int Sort { get; set; }
public string GoodsId { get; set; }
public string DeviceId { get; set; }
/// <summary>
/// 仓位模板
/// </summary>
public string WarehousrTemplateId { get; set; }
}
}

+ 71
- 0
BPA.SAAS.KitChenManage.Application/AExternalPlatform1/Service/Goods/Services/GoodsServices.cs View File

@@ -0,0 +1,71 @@
using BPA.SAAS.KitChenManage.Application.AExternalPlatform.BaseDto;
using BPA.SAAS.KitChenManage.Application.AExternalPlatform1.Service.Goods.Dtos;
using BPA.SAAS.KitChenManage.Comm.Tool;
using BPA.SAAS.KitChenManage.Core.Model;
using Newtonsoft.Json;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace BPA.SAAS.KitChenManage.Application.AExternalPlatform1.Service.Goods.Services
{

[ApiDescriptionSettings("开放平台", Tag = "商品信息"), AllowAnonymous, NonUnify]
public class Goods: IGoodsServices, ITransient,IDynamicApiController
{

private readonly ISqlSugarClient _db;
public Goods(ISqlSugarClient db)
{
_db = db;
}
/// <summary>
/// 获取设备物料信息
/// </summary>
/// <returns></returns>
[HttpPost("/api/goods/Getdevicegoods")]
public async Task<ResultGoodsResultDto> GetDeviceGoods(string deviceId)
{


var goodsId = await _db.Queryable<BPA_DeviceGoods>()
.Where(x => x.DeviceId == deviceId)
.Select(x => x.GoodsId)
.ToListAsync();

var data = await GetDeviceGoodspost(goodsId);

return data;
}


/// <summary>
/// 获取商品信息
/// </summary>
/// <param name="id"></param>
/// <returns></returns>
public async Task<ResultGoodsResultDto> GetDeviceGoodspost(List<string> goodsList)
{
try
{


Dictionary<string, string> dic = new Dictionary<string, string>();
var url = App.Configuration["baseurl"] + "api/goods/GetGoodsListByIds";
var inputData = JsonConvert.SerializeObject(goodsList);
var jsonData = HttpHelper.PostData(url, inputData, Encoding.UTF8, "application/json", dic);
var data = JsonConvert.DeserializeObject<ResultGoodsResultDto>(jsonData);
return data;
}
catch (Exception ex)
{

throw Oops.Oh("获取商品失败");
}


}
}
}

+ 18
- 0
BPA.SAAS.KitChenManage.Application/AExternalPlatform1/Service/Goods/Services/IGoodsServices.cs View File

@@ -0,0 +1,18 @@
using BPA.SAAS.KitChenManage.Application.AExternalPlatform1.Service.Goods.Dtos;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace BPA.SAAS.KitChenManage.Application.AExternalPlatform1.Service.Goods.Services
{
public interface IGoodsServices
{
/// <summary>
/// 获取设备物料信息
/// </summary>
/// <returns></returns>
Task<ResultGoodsResultDto> GetDeviceGoods(string deviceId);
}
}

BPA.SAAS.KitChenManage.Application/AExternalPlatform/Service/Platform/Material/MaterialServices.cs → BPA.SAAS.KitChenManage.Application/AExternalPlatform1/Service/Platform/Material/MaterialServices.cs View File


BPA.SAAS.KitChenManage.Application/AExternalPlatform/Service/Platform/Material/Services/IMaterialServices.cs → BPA.SAAS.KitChenManage.Application/AExternalPlatform1/Service/Platform/Material/Services/IMaterialServices.cs View File


BPA.SAAS.KitChenManage.Application/AExternalPlatform/Service/Platform/Material/Services/MaterialService.cs → BPA.SAAS.KitChenManage.Application/AExternalPlatform1/Service/Platform/Material/Services/MaterialService.cs View File


+ 3
- 0
BPA.SAAS.KitChenManage.Application/BPA.SAAS.KitChenManage.Application.csproj View File

@@ -10,8 +10,11 @@


<ItemGroup>
<Compile Remove="AExternalPlatform - 复制\**" />
<Compile Remove="AExternalPlatform\**" />
<EmbeddedResource Remove="AExternalPlatform - 复制\**" />
<EmbeddedResource Remove="AExternalPlatform\**" />
<None Remove="AExternalPlatform - 复制\**" />
<None Remove="AExternalPlatform\**" />
</ItemGroup>



+ 317
- 0
BPA.SAAS.KitChenManage.Application/BPA.SAAS.KitChenManage.Application.xml View File

@@ -4,6 +4,221 @@
<name>BPA.SAAS.KitChenManage.Application</name>
</assembly>
<members>
<member name="T:BPA.SAAS.KitChenManage.Application.AExternalPlatform.BaseDto.DtoValidator">
<summary>
Dto参数验证
</summary>
</member>
<member name="M:BPA.SAAS.KitChenManage.Application.AExternalPlatform.BaseDto.DtoValidator.GetSign``1(``0,System.Int32)">
<summary>
获取签名
</summary>
<typeparam name="T"></typeparam>
<param name="t"></param>
<param name="otype">0-不排序 1-按名称ASCII排序</param>
<returns></returns>
</member>
<member name="T:BPA.SAAS.KitChenManage.Application.AExternalPlatform.Enum.ErrorCodeEnum">
<summary>
系统错误码
</summary>
</member>
<member name="F:BPA.SAAS.KitChenManage.Application.AExternalPlatform.Enum.ErrorCodeEnum.Code1000">
<summary>
用户没有注册
</summary>
</member>
<member name="F:BPA.SAAS.KitChenManage.Application.AExternalPlatform.Enum.ErrorCodeEnum.Code1001">
<summary>
操作错误
</summary>
</member>
<member name="F:BPA.SAAS.KitChenManage.Application.AExternalPlatform.Enum.ErrorCodeEnum.Code1002">
<summary>
重复添加
</summary>
</member>
<member name="F:BPA.SAAS.KitChenManage.Application.AExternalPlatform.Enum.ErrorCodeEnum.Code1003">
<summary>
操作数据不存在
</summary>
</member>
<member name="F:BPA.SAAS.KitChenManage.Application.AExternalPlatform.Enum.ErrorCodeEnum.Code1004">
<summary>
key不正确
</summary>
</member>
<member name="F:BPA.SAAS.KitChenManage.Application.AExternalPlatform.Enum.ErrorCodeEnum.Code1005">
<summary>
签名错误
</summary>
</member>
<member name="F:BPA.SAAS.KitChenManage.Application.AExternalPlatform.Enum.ErrorCodeEnum.Code1006">
<summary>
签名错误
</summary>
</member>
<member name="M:BPA.SAAS.KitChenManage.Application.AExternalPlatform.Service.Authorization.AuthServices.GetListStoreAuthKey(BPA.SAAS.KitChenManage.Application.AExternalPlatform.BaseDto.BaseEPDto)">
<summary>
获取店铺授权码列表
</summary>
<param name="input"></param>
<returns></returns>
</member>
<member name="M:BPA.SAAS.KitChenManage.Application.AExternalPlatform.Service.Authorization.AuthServices.GetStoreAuthKey(BPA.SAAS.KitChenManage.Application.AExternalPlatform.Service.Authorization.Dtos.StoreAuthDto)">
<summary>
获取店铺授权码
</summary>
<param name="input"></param>
<returns></returns>
</member>
<member name="M:BPA.SAAS.KitChenManage.Application.AExternalPlatform.Service.Authorization.AuthServices.AddStoreAuthKey(BPA.SAAS.KitChenManage.Application.AExternalPlatform.Service.Authorization.Dtos.StoreAuthDto)">
<summary>
添加店铺授权码
</summary>
<returns></returns>
</member>
<member name="M:BPA.SAAS.KitChenManage.Application.AExternalPlatform.Service.Authorization.AuthServices.UpdateStoreAuthKey(BPA.SAAS.KitChenManage.Application.AExternalPlatform.Service.Authorization.Dtos.StoreAuthDto)">
<summary>
修改店铺授权码
</summary>
<param name="id"></param>
<returns></returns>
</member>
<member name="M:BPA.SAAS.KitChenManage.Application.AExternalPlatform.Service.Authorization.Services.AuthService.GetListStoreAuthKey(BPA.SAAS.KitChenManage.Application.AExternalPlatform.BaseDto.BaseEPDto)">
<summary>
获取店铺授权码列表
</summary>
<param name="input"></param>
<returns></returns>
</member>
<member name="M:BPA.SAAS.KitChenManage.Application.AExternalPlatform.Service.Authorization.Services.AuthService.GetStoreAuthKey(BPA.SAAS.KitChenManage.Application.AExternalPlatform.Service.Authorization.Dtos.StoreAuthDto)">
<summary>
获取店铺授权码
</summary>
<param name="input"></param>
<returns></returns>
</member>
<member name="M:BPA.SAAS.KitChenManage.Application.AExternalPlatform.Service.Authorization.Services.AuthService.AddStoreAuthKey(BPA.SAAS.KitChenManage.Application.AExternalPlatform.Service.Authorization.Dtos.StoreAuthDto)">
<summary>
添加店铺授权码
</summary>
<returns></returns>
</member>
<member name="M:BPA.SAAS.KitChenManage.Application.AExternalPlatform.Service.Authorization.Services.AuthService.UpdateStoreAuthKey(BPA.SAAS.KitChenManage.Application.AExternalPlatform.Service.Authorization.Dtos.StoreAuthDto)">
<summary>
修改店铺授权码
</summary>
<param name="id"></param>
<returns></returns>
</member>
<member name="M:BPA.SAAS.KitChenManage.Application.AExternalPlatform.Service.Authorization.Services.IAuthService.GetListStoreAuthKey(BPA.SAAS.KitChenManage.Application.AExternalPlatform.BaseDto.BaseEPDto)">
<summary>
获取店铺授权码列表
</summary>
<param name="input"></param>
<returns></returns>
</member>
<member name="M:BPA.SAAS.KitChenManage.Application.AExternalPlatform.Service.Authorization.Services.IAuthService.GetStoreAuthKey(BPA.SAAS.KitChenManage.Application.AExternalPlatform.Service.Authorization.Dtos.StoreAuthDto)">
<summary>
获取店铺授权码
</summary>
<param name="input"></param>
<returns></returns>
</member>
<member name="M:BPA.SAAS.KitChenManage.Application.AExternalPlatform.Service.Authorization.Services.IAuthService.AddStoreAuthKey(BPA.SAAS.KitChenManage.Application.AExternalPlatform.Service.Authorization.Dtos.StoreAuthDto)">
<summary>
添加店铺授权码
</summary>
<returns></returns>
</member>
<member name="M:BPA.SAAS.KitChenManage.Application.AExternalPlatform.Service.Authorization.Services.IAuthService.UpdateStoreAuthKey(BPA.SAAS.KitChenManage.Application.AExternalPlatform.Service.Authorization.Dtos.StoreAuthDto)">
<summary>
修改店铺授权码
</summary>
<param name="id"></param>
<returns></returns>
</member>
<member name="M:BPA.SAAS.KitChenManage.Application.AExternalPlatform.Service.CheckService.Services.CheckServices.CheckSign``1(``0)">
<summary>
检查Sign
</summary>
</member>
<member name="M:BPA.SAAS.KitChenManage.Application.AExternalPlatform.Service.CheckService.Services.CheckServices.GetModelValue``1(``0,System.String)">
<summary>
获取模型值
</summary>
<typeparam name="T"></typeparam>
<param name="t"></param>
<returns></returns>
</member>
<member name="M:BPA.SAAS.KitChenManage.Application.AExternalPlatform.Service.CheckService.Services.CheckServices.CheckKey(System.String)">
<summary>
检查店铺key验证
</summary>
<param name="key"></param>
</member>
<member name="M:BPA.SAAS.KitChenManage.Application.AExternalPlatform.Service.CheckService.Services.CheckServices.CheckTenant(System.String)">
<summary>
检查租户
</summary>
<param name="id"></param>
<returns></returns>
</member>
<member name="M:BPA.SAAS.KitChenManage.Application.AExternalPlatform.Service.CheckService.Services.ICheckServices.CheckSign``1(``0)">
<summary>
检查Sign
</summary>
</member>
<member name="P:BPA.SAAS.KitChenManage.Application.AExternalPlatform1.Service.Goods.Dtos.GoodsTechnologyActionResultDto.StepName">
<summary>
步骤名称
</summary>
</member>
<member name="P:BPA.SAAS.KitChenManage.Application.AExternalPlatform1.Service.Goods.Dtos.GoodsTechnologyActionResultDto.ActionJson">
<summary>
动作json
</summary>
</member>
<member name="P:BPA.SAAS.KitChenManage.Application.AExternalPlatform1.Service.Goods.Dtos.GoodsTechnologyActionResultDto.GoodsAttributeId">
<summary>
商品属性id集合
</summary>
</member>
<member name="P:BPA.SAAS.KitChenManage.Application.AExternalPlatform1.Service.Goods.Dtos.GoodsTechnologyActionResultDto.IsBatch">
<summary>
是否物料
</summary>
</member>
<member name="P:BPA.SAAS.KitChenManage.Application.AExternalPlatform1.Service.Goods.Dtos.GoodsTechnologyActionResultDto.ChnologyId">
<summary>
动作value
</summary>
</member>
<member name="P:BPA.SAAS.KitChenManage.Application.AExternalPlatform1.Service.Goods.Dtos.GoodsTechnologyActionResultDto.WarehousrTemplateId">
<summary>
仓位模板
</summary>
</member>
<member name="M:BPA.SAAS.KitChenManage.Application.AExternalPlatform1.Service.Goods.Services.Goods.GetDeviceGoods(System.String)">
<summary>
获取设备物料信息
</summary>
<returns></returns>
</member>
<member name="M:BPA.SAAS.KitChenManage.Application.AExternalPlatform1.Service.Goods.Services.Goods.GetDeviceGoodspost(System.Collections.Generic.List{System.String})">
<summary>
获取商品信息
</summary>
<param name="id"></param>
<returns></returns>
</member>
<member name="M:BPA.SAAS.KitChenManage.Application.AExternalPlatform1.Service.Goods.Services.IGoodsServices.GetDeviceGoods(System.String)">
<summary>
获取设备物料信息
</summary>
<returns></returns>
</member>
<member name="M:BPA.SAAS.KitChenManage.Application.Authorization.AuthorizationServices.PageStoreAuthorization(BPA.SAAS.KitChenManage.Core.Base.PageInputBase)">
<summary>
分页店铺授权码
@@ -171,6 +386,20 @@
<param name="input"></param>
<returns></returns>
</member>
<member name="M:BPA.SAAS.KitChenManage.Application.Device.DevicePushRecodeServices.GetDeviceGoods(System.String)">
<summary>
获取设备商品
</summary>
<param name="deviceId"></param>
<returns></returns>
</member>
<member name="M:BPA.SAAS.KitChenManage.Application.Device.DevicePushRecodeServices.EditDeviceGoods(BPA.SAAS.KitChenManage.Application.Device.Dtos.DeviceGoodsInputDto)">
<summary>
编辑设备商品
</summary>
<param name="inputDto"></param>
<returns></returns>
</member>
<member name="P:BPA.SAAS.KitChenManage.Application.Device.Dtos.ProductTopics.Topics">
<summary>
Topics类
@@ -339,6 +568,20 @@
<param name="callbackUrl"></param>
<returns></returns>
</member>
<member name="M:BPA.SAAS.KitChenManage.Application.Device.Services.DevicePushRecodeService.GetDeviceGoods(System.String)">
<summary>
获取设备商品
</summary>
<param name="deviceId"></param>
<returns></returns>
</member>
<member name="M:BPA.SAAS.KitChenManage.Application.Device.Services.DevicePushRecodeService.EditDeviceGoods(BPA.SAAS.KitChenManage.Application.Device.Dtos.DeviceGoodsInputDto)">
<summary>
编辑设备商品
</summary>
<param name="inputDto"></param>
<returns></returns>
</member>
<member name="M:BPA.SAAS.KitChenManage.Application.Device.Services.IDevicePushRecodeService.Page(BPA.SAAS.KitChenManage.Application.Device.Dtos.DevicePushRecodeDtoPageInput)">
<summary>
分页
@@ -367,6 +610,20 @@
<param name="input"></param>
<returns></returns>
</member>
<member name="M:BPA.SAAS.KitChenManage.Application.Device.Services.IDevicePushRecodeService.GetDeviceGoods(System.String)">
<summary>
获取设备商品
</summary>
<param name="deviceId"></param>
<returns></returns>
</member>
<member name="M:BPA.SAAS.KitChenManage.Application.Device.Services.IDevicePushRecodeService.EditDeviceGoods(BPA.SAAS.KitChenManage.Application.Device.Dtos.DeviceGoodsInputDto)">
<summary>
编辑设备商品
</summary>
<param name="inputDto"></param>
<returns></returns>
</member>
<member name="P:BPA.SAAS.KitChenManage.Application.Food.Dtos.FoodMenuBaseDto.GoodsIds">
<summary>
商品菜品id
@@ -377,6 +634,36 @@
菜谱信息表
</summary>
</member>
<member name="P:BPA.SAAS.KitChenManage.Application.Food.Dtos.GoodsTechnologyActionResultDto.StepName">
<summary>
步骤名称
</summary>
</member>
<member name="P:BPA.SAAS.KitChenManage.Application.Food.Dtos.GoodsTechnologyActionResultDto.ActionJson">
<summary>
动作json
</summary>
</member>
<member name="P:BPA.SAAS.KitChenManage.Application.Food.Dtos.GoodsTechnologyActionResultDto.GoodsAttributeId">
<summary>
商品属性id集合
</summary>
</member>
<member name="P:BPA.SAAS.KitChenManage.Application.Food.Dtos.GoodsTechnologyActionResultDto.IsBatch">
<summary>
是否物料
</summary>
</member>
<member name="P:BPA.SAAS.KitChenManage.Application.Food.Dtos.GoodsTechnologyActionResultDto.ChnologyId">
<summary>
动作value
</summary>
</member>
<member name="P:BPA.SAAS.KitChenManage.Application.Food.Dtos.GoodsTechnologyActionResultDto.WarehousrTemplateId">
<summary>
仓位模板
</summary>
</member>
<member name="M:BPA.SAAS.KitChenManage.Application.Food.FoodMenuServices.Page(BPA.SAAS.KitChenManage.Application.Food.Dtos.FoodMenuDtoPageInput)">
<summary>
分页查询
@@ -419,6 +706,12 @@
<param name="foodMenuId"></param>
<returns></returns>
</member>
<member name="M:BPA.SAAS.KitChenManage.Application.Food.FoodMenuServices.GetDeviceGoods(System.String)">
<summary>
获取设备物料信息
</summary>
<returns></returns>
</member>
<member name="M:BPA.SAAS.KitChenManage.Application.Food.Services.FoodMenuService.Page(BPA.SAAS.KitChenManage.Application.Food.Dtos.FoodMenuDtoPageInput)">
<summary>
分页
@@ -461,6 +754,19 @@
<param name="foodMenuId"></param>
<returns></returns>
</member>
<member name="M:BPA.SAAS.KitChenManage.Application.Food.Services.FoodMenuService.GetDeviceGoods(System.String)">
<summary>
获取设备物料信息
</summary>
<returns></returns>
</member>
<member name="M:BPA.SAAS.KitChenManage.Application.Food.Services.FoodMenuService.GetDeviceGoodspost(System.Collections.Generic.List{System.String})">
<summary>
获取商品信息
</summary>
<param name="id"></param>
<returns></returns>
</member>
<member name="M:BPA.SAAS.KitChenManage.Application.Food.Services.IFoodMenuService.Page(BPA.SAAS.KitChenManage.Application.Food.Dtos.FoodMenuDtoPageInput)">
<summary>
分页
@@ -503,6 +809,12 @@
<param name="foodMenuId"></param>
<returns></returns>
</member>
<member name="M:BPA.SAAS.KitChenManage.Application.Food.Services.IFoodMenuService.GetDeviceGoods(System.String)">
<summary>
获取设备物料信息
</summary>
<returns></returns>
</member>
<member name="M:BPA.SAAS.KitChenManage.Application.Push.Comm.CommDefaultHandle.GetDynamic(System.Object,System.Object)">
<summary>
映射数据
@@ -803,5 +1115,10 @@
<param name="input"></param>
<returns></returns>
</member>
<member name="M:BPA.SAAS.Manage.Application.AExternalPlatform.Service.CheckService.CheckServices.CheckSign``1(``0)">
<summary>
检查Sign
</summary>
</member>
</members>
</doc>

+ 30
- 2
BPA.SAAS.KitChenManage.Application/Device/DevicePushRecodeServices.cs View File

@@ -17,9 +17,9 @@ namespace BPA.SAAS.KitChenManage.Application.Device
{
_devicePushRecodeService= devicePushRecodeService;
}
public async Task<string> Test()
public async Task Test()
{
return await _devicePushRecodeService.Test();
await _devicePushRecodeService.Test();
}
/// <summary>
/// 分页
@@ -72,5 +72,33 @@ namespace BPA.SAAS.KitChenManage.Application.Device
{
return await _devicePushRecodeService.Delete(input);
}



#region 设备商品

/// <summary>
/// 获取设备商品
/// </summary>
/// <param name="deviceId"></param>
/// <returns></returns>
[HttpPost("/api/devicepushrecode/getdevicegoods")]
public async Task<List<Goods>> GetDeviceGoods(string deviceId)
{
return await _devicePushRecodeService.GetDeviceGoods(deviceId);
}

/// <summary>
/// 编辑设备商品
/// </summary>
/// <param name="inputDto"></param>
/// <returns></returns>
[HttpPost("/api/devicepushrecode/editdevicegoods")]
public async Task<bool> EditDeviceGoods(DeviceGoodsInputDto inputDto)
{
return await _devicePushRecodeService.EditDeviceGoods(inputDto);
}

#endregion
}
}

+ 22
- 0
BPA.SAAS.KitChenManage.Application/Device/Dtos/DeviceGoodsInputDto.cs View File

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

namespace BPA.SAAS.KitChenManage.Application.Device.Dtos
{
public class DeviceGoodsInputDto
{
public string DeviceId { get; set; }

public List<Goods> GoodsList { get; set; }
}

public class Goods
{
public string GoodsId { get; set; }

public string GoodsName { get; set; }
}
}

+ 90
- 29
BPA.SAAS.KitChenManage.Application/Device/Services/DevicePushRecodeService.cs View File

@@ -29,7 +29,7 @@ using uPLibrary.Networking.M2Mqtt;

namespace BPA.SAAS.KitChenManage.Application.Device.Services
{
public class DevicePushRecodeService: IDevicePushRecodeService, ITransient
public class DevicePushRecodeService : IDevicePushRecodeService, ITransient
{
private readonly ISqlSugarClient _db;
private readonly IMqttClient _mqttClient;
@@ -39,21 +39,14 @@ namespace BPA.SAAS.KitChenManage.Application.Device.Services
public DevicePushRecodeService(ISqlSugarClient db, IMqttClient mqttClient)
{
_db = db;
_mqttClient=mqttClient;
_mqttClient = mqttClient;
mqttServer = new(mqttClient);
}
public async Task<string> Test()
public async Task Test()
{
var getGoodsAttributeurl = "http://localhost:5009/api/ExternalPlatform/Goods/GetGoodsPageList";//获取商品属性
var key = "47e5c071-6283-4d9d-8dcb-36ba95aa8db9";
var str = "current=1&pageSize=10&"+ key;
var sign = MD5Encryption.Encrypt(str.ToUpper());
var respon = await getGoodsAttributeurl.SetHeaders(new
{
sign= sign,
key = key
}).SetHttpMethod(HttpMethod.Get).SetBody("{\"current\":1,\"pageSize\":10}", "application/json").PostAsStringAsync();
return respon;
string Topic = "2222";
var sd=await mqttServer.Publish(Topic, new PushData() { Data = "123456"}, "1");
//return respon;
}
/// <summary>
/// 分页
@@ -63,25 +56,25 @@ namespace BPA.SAAS.KitChenManage.Application.Device.Services
public async Task<PageUtil> Page(DevicePushRecodeDtoPageInput input)
{
RefAsync<int> total = 0;
var res = await _db.Queryable<BPA_DevicePushRecode>().Where(x=>x.Type== input.Type)
.WhereIF(!string.IsNullOrWhiteSpace(input.DeviceName),x=>x.DeviceName.Contains(input.DeviceName))
.WhereIF(!string.IsNullOrWhiteSpace(input.Status), x => x.Status==Convert.ToInt32(input.Status))
.Select(t => new
var res = await _db.Queryable<BPA_DevicePushRecode>().Where(x => x.Type == input.Type)
.WhereIF(!string.IsNullOrWhiteSpace(input.DeviceName), x => x.DeviceName.Contains(input.DeviceName))
.WhereIF(!string.IsNullOrWhiteSpace(input.Status), x => x.Status == Convert.ToInt32(input.Status))
.Select(t => new
{
CreateAt = t.CreateAt,
CreateBy = t.CreateBy,
Id = t.Id,
DeviceId = t.DeviceId,
DeviceName= t.DeviceName,
Type =t.Type,
Topic=t.Topic,
DataResore=t.DataResore,
Status=t.Status,
Description=t.Description,
MessageId=t.MessageId,
TopicRely=t.TopicRely,
DataResoreRely=t.DataResoreRely,
DescriptionRely=t.DescriptionRely,
DeviceName = t.DeviceName,
Type = t.Type,
Topic = t.Topic,
DataResore = t.DataResore,
Status = t.Status,
Description = t.Description,
MessageId = t.MessageId,
TopicRely = t.TopicRely,
DataResoreRely = t.DataResoreRely,
DescriptionRely = t.DescriptionRely,
}).OrderBy(x => x.CreateAt, OrderByType.Desc).ToPageListAsync(input.Current, input.PageSize, total);
PageUtil util = new PageUtil()
{
@@ -203,14 +196,15 @@ namespace BPA.SAAS.KitChenManage.Application.Device.Services
data.DataResoreRely = "";
// data.MessageId= messageId;
var respush = await mqttServer.Publish(data.Topic, new PushData() { Data = data.DataResore, DeviceId = data.DeviceAutoKey }, data.MessageId);
if (respush!= "success")
if (respush != "success")
{
data.Description = respush;
data.Status = 2;
}
var res = await _db.Updateable(data).ExecuteCommandAsync();
var trigger = TriggerBuilder.Default.WithInterval(TimeSpan.FromSeconds(10)).WithRepeatCount(1).Build();
TaskServicesManager.GetOrAdd(data.MessageId.ToString(), async (provider, token) => {
TaskServicesManager.GetOrAdd(data.MessageId.ToString(), async (provider, token) =>
{
await CallBackDevicePushRecode(data.MessageId.ToString(), groupId);
}, trigger);
await BindMqReceived(data.MessageId.ToString(), groupId,"");
@@ -333,5 +327,72 @@ namespace BPA.SAAS.KitChenManage.Application.Device.Services
}
});
}





#region 设备商品

/// <summary>
/// 获取设备商品
/// </summary>
/// <param name="deviceId"></param>
/// <returns></returns>
public async Task<List<Goods>> GetDeviceGoods(string deviceId)
{
var result = new List<Goods>();

result = await _db.Queryable<BPA_DeviceGoods>()
.Select(x => new Goods()
{
GoodsId = x.GoodsId,
GoodsName = x.GoodsName
}).ToListAsync();

return result;
}

/// <summary>
/// 编辑设备商品
/// </summary>
/// <param name="inputDto"></param>
/// <returns></returns>
public async Task<bool> EditDeviceGoods(DeviceGoodsInputDto inputDto)
{
try
{
_db.Ado.BeginTran();

//删除店铺商品
await _db.Deleteable<BPA_DeviceGoods>().Where(it => it.DeviceId == inputDto.DeviceId).ExecuteCommandAsync();

var list = new List<BPA_DeviceGoods>();
foreach (var item in inputDto.GoodsList)
{
list.Add(new BPA_DeviceGoods()
{
Id=Guid.NewGuid().ToString(),
DeviceId = inputDto.DeviceId,
GoodsId = item.GoodsId,
GoodsName = item.GoodsName,
});
}
var res = await _db.Insertable(list).ExecuteCommandAsync();


_db.Ado.CommitTran();

return res > 0;
}
catch (Exception e)
{
_db.Ado.RollbackTran();
return false;
}
}

#endregion

}
}

+ 19
- 1
BPA.SAAS.KitChenManage.Application/Device/Services/IDevicePushRecodeService.cs View File

@@ -10,7 +10,7 @@ namespace BPA.SAAS.KitChenManage.Application.Device.Services
{
public interface IDevicePushRecodeService
{
Task<string> Test();
Task Test();
/// <summary>
/// 分页
/// </summary>
@@ -36,5 +36,23 @@ namespace BPA.SAAS.KitChenManage.Application.Device.Services
/// <param name="input"></param>
/// <returns></returns>
Task<bool> Delete(List<string> input);

#region 设备商品

/// <summary>
/// 获取设备商品
/// </summary>
/// <param name="deviceId"></param>
/// <returns></returns>
Task<List<Goods>> GetDeviceGoods(string deviceId);

/// <summary>
/// 编辑设备商品
/// </summary>
/// <param name="inputDto"></param>
/// <returns></returns>
Task<bool> EditDeviceGoods(DeviceGoodsInputDto inputDto);

#endregion
}
}

+ 99
- 0
BPA.SAAS.KitChenManage.Application/Food/Dtos/ResultSAASManageDto.cs View File

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

namespace BPA.SAAS.KitChenManage.Application.Food.Dtos
{
public class ResultSAASManageDto
{
public int statusCode { get; set; }

public List<GoodsTypeResultDto> 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 GoodsTypeResultDto
{
public string GoodsTypeId { get; set; }

public string GoodsTypeName { get; set; }

public List<GoodsAttributeResultDto> GoodsAttributeList { get; set; }

public List<GoodsInfoResultDto> GoodsInfoList { get; set; }
}


public class GoodsAttributeResultDto
{
public string GoodsAttributeId { get; set; }

public string GoodsAttributeName { get; set; }

public List<GoodsAttributeValueResultDto> GoodsAttributeValueList { get; set; }
}

public class GoodsAttributeValueResultDto
{
public string GoodsAttributeId { get; set; }
public string GoodsAttributeValueId { get; set; }
public string AttributeValue { get; set; }
}

public class GoodsResultDto
{
public string TypeId { get; set; }

public string TypeName { get; set; }
}

public class GoodsInfoResultDto
{
public string GoodsId { get; set; }

public string GoodsName { get; set; }

public List<GoodsTechnologyActionResultDto> GoodsTechnologyActionList { get; set; }
}

public class GoodsTechnologyActionResultDto
{
/// <summary>
/// 步骤名称
/// </summary>
public string StepName { get; set; }
/// <summary>
/// 动作json
/// </summary>
public string ActionJson { get; set; }
/// <summary>
/// 商品属性id集合
/// </summary>
public string GoodsAttributeId { get; set; }
/// <summary>
/// 是否物料
/// </summary>
public bool IsBatch { get; set; }
/// <summary>
/// 动作value
/// </summary>
public string ChnologyId { get; set; }
public string GroupId { get; set; }
public int Sort { get; set; }
public string GoodsId { get; set; }
public string DeviceId { get; set; }
/// <summary>
/// 仓位模板
/// </summary>
public string WarehousrTemplateId { get; set; }
}
}

+ 11
- 0
BPA.SAAS.KitChenManage.Application/Food/FoodMenuServices.cs View File

@@ -81,5 +81,16 @@ namespace BPA.SAAS.KitChenManage.Application.Food
{
return await _foodmenuService.GetFoodMenuGoods(foodMenuId);
}

/// <summary>
/// 获取设备物料信息
/// </summary>
/// <returns></returns>
[HttpGet("/api/foodmenu/getdevicegoods")]
public async Task<ResultSAASManageDto> GetDeviceGoods(string deviceId)
{
return await _foodmenuService.GetDeviceGoods(deviceId);
}
}
}

+ 49
- 0
BPA.SAAS.KitChenManage.Application/Food/Services/FoodMenuService.cs View File

@@ -1,9 +1,11 @@
using BPA.SAAS.KitChenManage.Application.Food.Dtos;
using BPA.SAAS.KitChenManage.Application.Store.Dtos;
using BPA.SAAS.KitChenManage.Application.Store.Services;
using BPA.SAAS.KitChenManage.Comm.Tool;
using BPA.SAAS.KitChenManage.Core.Base;
using BPA.SAAS.KitChenManage.Core.Model;
using Furion.LinqBuilder;
using Newtonsoft.Json;
using System;
using System.Collections.Generic;
using System.Linq;
@@ -127,5 +129,52 @@ namespace BPA.SAAS.KitChenManage.Application.Food.Services
{
return await _db.Queryable<BPA_FoodMenuGoods>().Where(x => x.FoodMenuId == foodMenuId).ToListAsync();
}


/// <summary>
/// 获取设备物料信息
/// </summary>
/// <returns></returns>
public async Task<ResultSAASManageDto> GetDeviceGoods(string deviceId)
{


var goodsId =await _db.Queryable<BPA_DeviceGoods>()
.Where(x => x.DeviceId == deviceId)
.Select(x => x.GoodsId)
.ToListAsync();

var data = await GetDeviceGoodspost(goodsId);

return data;
}


/// <summary>
/// 获取商品信息
/// </summary>
/// <param name="id"></param>
/// <returns></returns>
public async Task<ResultSAASManageDto> GetDeviceGoodspost(List<string> goodsList)
{
try
{


Dictionary<string, string> dic = new Dictionary<string, string>();
var url = App.Configuration["baseurl"] + "api/goods/GetGoodsListByIds";
var inputData = JsonConvert.SerializeObject(goodsList);
var jsonData = HttpHelper.PostData(url, inputData, Encoding.UTF8, "application/json", dic);
var data = JsonConvert.DeserializeObject<ResultSAASManageDto>(jsonData);
return data;
}
catch (Exception ex)
{

throw Oops.Oh("获取商品失败");
}

}
}
}

+ 6
- 0
BPA.SAAS.KitChenManage.Application/Food/Services/IFoodMenuService.cs View File

@@ -48,5 +48,11 @@ namespace BPA.SAAS.KitChenManage.Application.Food.Services
/// <param name="foodMenuId"></param>
/// <returns></returns>
Task<List<BPA_FoodMenuGoods>> GetFoodMenuGoods(string foodMenuId);

/// <summary>
/// 获取设备物料信息
/// </summary>
/// <returns></returns>
Task<ResultSAASManageDto> GetDeviceGoods(string deviceId);
}
}

+ 22
- 0
BPA.SAAS.KitChenManage.Core/Model/BPA_DeviceGoods.cs View File

@@ -0,0 +1,22 @@
using BPA.SAAS.KitChenManage.Core.Base;
using SqlSugar;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace BPA.SAAS.KitChenManage.Core.Model
{

[SugarTable("bpa_devicegoods")]
public class BPA_DeviceGoods:IBaseEntity, IGroupId
{
public string DeviceId { get; set; }

public string GoodsId { get; set; }

public string GoodsName { get; set;}
public string GroupId { get; set; }
}
}

Loading…
Cancel
Save