@@ -0,0 +1,25 @@ | |||
<Project Sdk="Microsoft.NET.Sdk"> | |||
<PropertyGroup> | |||
<TargetFramework>net6.0</TargetFramework> | |||
<NoWarn>1701;1702;1591</NoWarn> | |||
<DocumentationFile>BPA.SAAS.KitChenManageOrder.Application.xml</DocumentationFile> | |||
<ImplicitUsings>enable</ImplicitUsings> | |||
</PropertyGroup> | |||
<ItemGroup> | |||
<None Remove="BPA.SAAS.KitChenManageOrder.Application.xml" /> | |||
</ItemGroup> | |||
<ItemGroup> | |||
<ProjectReference Include="..\BPA.SAAS.KitChenManageOrder.Core\BPA.SAAS.KitChenManageOrder.Core.csproj" /> | |||
</ItemGroup> | |||
<ItemGroup> | |||
<PackageReference Include="NPOI" Version="2.6.2" /> | |||
</ItemGroup> | |||
</Project> |
@@ -0,0 +1,500 @@ | |||
<?xml version="1.0"?> | |||
<doc> | |||
<assembly> | |||
<name>BPA.SAAS.KitChenManageOrder.Application</name> | |||
</assembly> | |||
<members> | |||
<member name="T:BPA.SAAS.KitChenManageOrder.Application.BaseDto.DtoValidator"> | |||
<summary> | |||
Dto参数验证 | |||
</summary> | |||
</member> | |||
<member name="T:BPA.SAAS.KitChenManageOrder.Application.BaseDto.XnInputBase"> | |||
<summary> | |||
通用输入扩展参数(带权限) | |||
</summary> | |||
</member> | |||
<member name="P:BPA.SAAS.KitChenManageOrder.Application.BaseDto.XnInputBase.GrantMenuIdList"> | |||
<summary> | |||
授权菜单 | |||
</summary> | |||
</member> | |||
<member name="P:BPA.SAAS.KitChenManageOrder.Application.BaseDto.XnInputBase.GrantRoleIdList"> | |||
<summary> | |||
授权角色 | |||
</summary> | |||
</member> | |||
<member name="P:BPA.SAAS.KitChenManageOrder.Application.BaseDto.XnInputBase.GrantOrgIdList"> | |||
<summary> | |||
授权数据 | |||
</summary> | |||
</member> | |||
<member name="P:BPA.SAAS.KitChenManageOrder.Application.BaseDto.XnInputBase.SearchValue"> | |||
<summary> | |||
搜索值 | |||
</summary> | |||
</member> | |||
<member name="P:BPA.SAAS.KitChenManageOrder.Application.BaseDto.XnInputBase.SearchBeginTime"> | |||
<summary> | |||
搜索开始时间 | |||
</summary> | |||
</member> | |||
<member name="P:BPA.SAAS.KitChenManageOrder.Application.BaseDto.XnInputBase.SearchEndTime"> | |||
<summary> | |||
搜索结束时间 | |||
</summary> | |||
</member> | |||
<member name="P:BPA.SAAS.KitChenManageOrder.Application.BaseDto.XnInputBase.SortField"> | |||
<summary> | |||
排序字段 | |||
</summary> | |||
</member> | |||
<member name="P:BPA.SAAS.KitChenManageOrder.Application.BaseDto.XnInputBase.SortOrder"> | |||
<summary> | |||
排序方法,默认升序,否则降序(配合antd前端,约定参数为 Ascend,Dscend) | |||
</summary> | |||
</member> | |||
<member name="P:BPA.SAAS.KitChenManageOrder.Application.BaseDto.XnInputBase.DescStr"> | |||
<summary> | |||
降序排序(不要问我为什么是descend不是desc,前端约定参数就是这样) | |||
</summary> | |||
</member> | |||
<member name="T:BPA.SAAS.KitChenManageOrder.Application.BaseDto.PageInputBase"> | |||
<summary> | |||
通用分页输入参数 | |||
</summary> | |||
</member> | |||
<member name="F:BPA.SAAS.KitChenManageOrder.Application.BaseDto.PageInputBase.current"> | |||
<summary> | |||
当前页码 | |||
</summary> | |||
</member> | |||
<member name="F:BPA.SAAS.KitChenManageOrder.Application.BaseDto.PageInputBase.pagesize"> | |||
<summary> | |||
页码容量 | |||
</summary> | |||
</member> | |||
<member name="P:BPA.SAAS.KitChenManageOrder.Application.BaseDto.PageUtil.Data"> | |||
<summary> | |||
Data | |||
</summary> | |||
</member> | |||
<member name="P:BPA.SAAS.KitChenManageOrder.Application.BaseDto.PageUtil.Total"> | |||
<summary> | |||
Total | |||
</summary> | |||
</member> | |||
<member name="F:BPA.SAAS.KitChenManageOrder.Application.Service.PageInputDto.current"> | |||
<summary> | |||
当前页码 | |||
</summary> | |||
</member> | |||
<member name="F:BPA.SAAS.KitChenManageOrder.Application.Service.PageInputDto.pagesize"> | |||
<summary> | |||
页码容量 | |||
</summary> | |||
</member> | |||
<member name="P:BPA.SAAS.KitChenManageOrder.Application.Service.PageOutDto.Data"> | |||
<summary> | |||
Data | |||
</summary> | |||
</member> | |||
<member name="P:BPA.SAAS.KitChenManageOrder.Application.Service.PageOutDto.Total"> | |||
<summary> | |||
Total | |||
</summary> | |||
</member> | |||
<member name="P:BPA.SAAS.KitChenManageOrder.Application.Service.Order.Dtos.OrderInsertDto.StoreId"> | |||
<summary> | |||
场景id | |||
</summary> | |||
</member> | |||
<member name="P:BPA.SAAS.KitChenManageOrder.Application.Service.Order.Dtos.OrderInsertDto.TradeNo"> | |||
<summary> | |||
商户订单号,由商家自定义 | |||
</summary> | |||
</member> | |||
<member name="P:BPA.SAAS.KitChenManageOrder.Application.Service.Order.Dtos.OrderInsertDto.TotalAmount"> | |||
<summary> | |||
订单总金额 | |||
</summary> | |||
</member> | |||
<member name="P:BPA.SAAS.KitChenManageOrder.Application.Service.Order.Dtos.OrderInsertDto.OrderCount"> | |||
<summary> | |||
订单数量 | |||
</summary> | |||
</member> | |||
<member name="P:BPA.SAAS.KitChenManageOrder.Application.Service.Order.Dtos.OrderInsertDto.Subject"> | |||
<summary> | |||
订单标题 | |||
</summary> | |||
</member> | |||
<member name="P:BPA.SAAS.KitChenManageOrder.Application.Service.Order.Dtos.Orderdetail.isCustom"> | |||
<summary> | |||
是否自定义配方 | |||
</summary> | |||
</member> | |||
<member name="P:BPA.SAAS.KitChenManageOrder.Application.Service.Order.Dtos.Orderdetail.FormulaDetail"> | |||
<summary> | |||
工艺配方详情 | |||
</summary> | |||
</member> | |||
<member name="P:BPA.SAAS.KitChenManageOrder.Application.Service.Order.Dtos.OrderViewDto.StoreId"> | |||
<summary> | |||
场景id | |||
</summary> | |||
</member> | |||
<member name="P:BPA.SAAS.KitChenManageOrder.Application.Service.Order.Dtos.OrderViewDto.OrderNumber"> | |||
<summary> | |||
平台订单号 | |||
</summary> | |||
</member> | |||
<member name="P:BPA.SAAS.KitChenManageOrder.Application.Service.Order.Dtos.OrderViewDto.TradeNo"> | |||
<summary> | |||
商户订单号,由商家自定义 | |||
</summary> | |||
</member> | |||
<member name="P:BPA.SAAS.KitChenManageOrder.Application.Service.Order.Dtos.OrderViewDto.OrderStatus"> | |||
<summary> | |||
订单状态 0成功,1失败 | |||
</summary> | |||
</member> | |||
<member name="P:BPA.SAAS.KitChenManageOrder.Application.Service.Order.Dtos.OrderViewDto.TotalAmount"> | |||
<summary> | |||
订单总金额 | |||
</summary> | |||
</member> | |||
<member name="P:BPA.SAAS.KitChenManageOrder.Application.Service.Order.Dtos.OrderViewDto.OrderCount"> | |||
<summary> | |||
订单数量 | |||
</summary> | |||
</member> | |||
<member name="P:BPA.SAAS.KitChenManageOrder.Application.Service.Order.Dtos.OrderViewDto.Subject"> | |||
<summary> | |||
订单标题 | |||
</summary> | |||
</member> | |||
<member name="P:BPA.SAAS.KitChenManageOrder.Application.Service.Order.Dtos.OrderdetaiViewDto.OrderId"> | |||
<summary> | |||
主订单表Id | |||
</summary> | |||
</member> | |||
<member name="P:BPA.SAAS.KitChenManageOrder.Application.Service.Order.Dtos.OrderdetaiViewDto.isCustom"> | |||
<summary> | |||
是否自定义配方 | |||
</summary> | |||
</member> | |||
<member name="P:BPA.SAAS.KitChenManageOrder.Application.Service.Order.Dtos.OrderdetaiViewDto.FormulaDetail"> | |||
<summary> | |||
工艺配方详情 | |||
</summary> | |||
</member> | |||
<member name="F:BPA.SAAS.KitChenManageOrder.Application.Service.Order.OrderService.db"> | |||
<summary> | |||
核心对象:拥有完整的SqlSugar全部功能 | |||
</summary> | |||
</member> | |||
<member name="M:BPA.SAAS.KitChenManageOrder.Application.Service.Order.OrderService.#ctor(SqlSugar.ISqlSugarClient)"> | |||
<summary> | |||
construct | |||
</summary> | |||
<param name="sqlSugarRepository"></param> | |||
</member> | |||
<member name="M:BPA.SAAS.KitChenManageOrder.Application.Service.Order.OrderService.AddOrder(BPA.SAAS.KitChenManageOrder.Application.Service.Order.Dtos.OrderInsertDto)"> | |||
<summary> | |||
创建订单 | |||
</summary> | |||
<param name="dto"></param> | |||
<returns></returns> | |||
</member> | |||
<member name="M:BPA.SAAS.KitChenManageOrder.Application.Service.Order.OrderService.GetOrder(BPA.SAAS.KitChenManageOrder.Core.Entity.Base.OrderQueryDto)"> | |||
<summary> | |||
查询订单 | |||
</summary> | |||
<param name="dto"></param> | |||
<returns></returns> | |||
</member> | |||
<member name="M:BPA.SAAS.KitChenManageOrder.Application.Service.ThirdAuthorize.ThirdAuthorize.Page(BPA.SAAS.KitChenManageOrder.Application.Service.ThirdAuthorize.Dtos.ThirdAuthorizeInfoDto)"> | |||
<summary> | |||
获取第三方 | |||
</summary> | |||
<param name="inputDto"></param> | |||
<returns></returns> | |||
</member> | |||
<member name="M:BPA.SAAS.KitChenManageOrder.Application.Service.ThirdAuthorize.ThirdAuthorize.Create(BPA.SAAS.KitChenManageOrder.Core.Entity.BPA_ShopAuthorize)"> | |||
<summary> | |||
创建 授权 | |||
</summary> | |||
<param name="inputDto"></param> | |||
<returns></returns> | |||
</member> | |||
<member name="M:BPA.SAAS.KitChenManageOrder.Application.Service.ThirdAuthorize.ThirdAuthorize.Update(BPA.SAAS.KitChenManageOrder.Core.Entity.BPA_ShopAuthorize)"> | |||
<summary> | |||
修改 重新赋值授权码 | |||
</summary> | |||
<param name="inputDto"></param> | |||
<returns></returns> | |||
</member> | |||
<member name="M:BPA.SAAS.KitChenManageOrder.Application.Service.ThirdAuthorize.ThirdAuthorize.Del(System.String)"> | |||
<summary> | |||
修改 重新赋值授权码 | |||
</summary> | |||
<param name="inputDto"></param> | |||
<returns></returns> | |||
</member> | |||
<member name="T:BPA.KitChen.StoreManagement.Application.Service.OrderManage.Dtos.OrderFlowQuery"> | |||
<summary> | |||
订单流水查询 | |||
</summary> | |||
</member> | |||
<member name="P:BPA.KitChen.StoreManagement.Application.Service.OrderManage.Dtos.OrderFlowQuery.Id"> | |||
<summary> | |||
订单Id | |||
</summary> | |||
</member> | |||
<member name="P:BPA.KitChen.StoreManagement.Application.Service.OrderManage.Dtos.OrderFlowQuery.FranchiseeId"> | |||
<summary> | |||
加盟商编号 | |||
</summary> | |||
</member> | |||
<member name="P:BPA.KitChen.StoreManagement.Application.Service.OrderManage.Dtos.OrderFlowQuery.FranchiseeName"> | |||
<summary> | |||
加盟商名称 | |||
</summary> | |||
</member> | |||
<member name="P:BPA.KitChen.StoreManagement.Application.Service.OrderManage.Dtos.OrderFlowQuery.StoreId"> | |||
<summary> | |||
店铺名称编号(设备名称编号) | |||
</summary> | |||
</member> | |||
<member name="P:BPA.KitChen.StoreManagement.Application.Service.OrderManage.Dtos.OrderFlowQuery.StoreName"> | |||
<summary> | |||
店铺名称 | |||
</summary> | |||
</member> | |||
<member name="P:BPA.KitChen.StoreManagement.Application.Service.OrderManage.Dtos.OrderFlowQuery.GoodsId"> | |||
<summary> | |||
商品key | |||
</summary> | |||
</member> | |||
<member name="P:BPA.KitChen.StoreManagement.Application.Service.OrderManage.Dtos.OrderFlowQuery.GoodsName"> | |||
<summary> | |||
商品名称 | |||
</summary> | |||
</member> | |||
<member name="P:BPA.KitChen.StoreManagement.Application.Service.OrderManage.Dtos.OrderFlowQuery.GoodsTypeId"> | |||
<summary> | |||
商品类型编号 | |||
</summary> | |||
</member> | |||
<member name="P:BPA.KitChen.StoreManagement.Application.Service.OrderManage.Dtos.OrderFlowQuery.GoodsTypeName"> | |||
<summary> | |||
商品类型名称 | |||
</summary> | |||
</member> | |||
<member name="P:BPA.KitChen.StoreManagement.Application.Service.OrderManage.Dtos.OrderFlowQuery.StoreTypeId"> | |||
<summary> | |||
店铺分类编号(设备类型关联值) | |||
</summary> | |||
</member> | |||
<member name="P:BPA.KitChen.StoreManagement.Application.Service.OrderManage.Dtos.OrderFlowQuery.StoreTypeName"> | |||
<summary> | |||
店铺分类名称(设备类型名称) | |||
</summary> | |||
</member> | |||
<member name="P:BPA.KitChen.StoreManagement.Application.Service.OrderManage.Dtos.OrderFlowQuery.Order_Number"> | |||
<summary> | |||
订单编号 | |||
</summary> | |||
</member> | |||
<member name="P:BPA.KitChen.StoreManagement.Application.Service.OrderManage.Dtos.OrderFlowQuery.Order_OriginalMoney"> | |||
<summary> | |||
应付金额 | |||
</summary> | |||
</member> | |||
<member name="P:BPA.KitChen.StoreManagement.Application.Service.OrderManage.Dtos.OrderFlowQuery.Order_RealMoney"> | |||
<summary> | |||
实付金额 | |||
</summary> | |||
</member> | |||
<member name="P:BPA.KitChen.StoreManagement.Application.Service.OrderManage.Dtos.OrderFlowQuery.PayMode"> | |||
<summary> | |||
支付方式(微信支付) | |||
</summary> | |||
</member> | |||
<member name="P:BPA.KitChen.StoreManagement.Application.Service.OrderManage.Dtos.OrderFlowQuery.Order_Count"> | |||
<summary> | |||
订单汇总数量 | |||
</summary> | |||
</member> | |||
<member name="P:BPA.KitChen.StoreManagement.Application.Service.OrderManage.Dtos.OrderFlowQuery.Order_CreateTime"> | |||
<summary> | |||
订单开始时间 | |||
</summary> | |||
</member> | |||
<member name="P:BPA.KitChen.StoreManagement.Application.Service.OrderManage.Dtos.OrderFlowQuery.Order_EndTime"> | |||
<summary> | |||
订单结束时间 | |||
</summary> | |||
</member> | |||
<member name="P:BPA.KitChen.StoreManagement.Application.Service.OrderManage.Dtos.OrderFlowQuery.PlaceMode"> | |||
<summary> | |||
订单类型 | |||
0-->正常 | |||
1--立即吃面 | |||
2-->其他 | |||
</summary> | |||
</member> | |||
<member name="P:BPA.KitChen.StoreManagement.Application.Service.OrderManage.Dtos.OrderFlowQuery.Customer_Name"> | |||
<summary> | |||
</summary> | |||
</member> | |||
<member name="P:BPA.KitChen.StoreManagement.Application.Service.OrderManage.Dtos.OrderFlowQuery.Customer_Tel"> | |||
<summary> | |||
</summary> | |||
</member> | |||
<member name="P:BPA.KitChen.StoreManagement.Application.Service.OrderManage.Dtos.OrderSumQuery.Id"> | |||
<summary> | |||
订单Id | |||
</summary> | |||
</member> | |||
<member name="P:BPA.KitChen.StoreManagement.Application.Service.OrderManage.Dtos.OrderSumQuery.FranchiseeId"> | |||
<summary> | |||
加盟商编号 | |||
</summary> | |||
</member> | |||
<member name="P:BPA.KitChen.StoreManagement.Application.Service.OrderManage.Dtos.OrderSumQuery.FranchiseeName"> | |||
<summary> | |||
加盟商名称 | |||
</summary> | |||
</member> | |||
<member name="P:BPA.KitChen.StoreManagement.Application.Service.OrderManage.Dtos.OrderSumQuery.StoreId"> | |||
<summary> | |||
店铺名称编号(设备名称编号) | |||
</summary> | |||
</member> | |||
<member name="P:BPA.KitChen.StoreManagement.Application.Service.OrderManage.Dtos.OrderSumQuery.StoreName"> | |||
<summary> | |||
店铺名称 | |||
</summary> | |||
</member> | |||
<member name="P:BPA.KitChen.StoreManagement.Application.Service.OrderManage.Dtos.OrderSumQuery.GoodsId"> | |||
<summary> | |||
商品key | |||
</summary> | |||
</member> | |||
<member name="P:BPA.KitChen.StoreManagement.Application.Service.OrderManage.Dtos.OrderSumQuery.GoodsName"> | |||
<summary> | |||
商品名称 | |||
</summary> | |||
</member> | |||
<member name="P:BPA.KitChen.StoreManagement.Application.Service.OrderManage.Dtos.OrderSumQuery.GoodsTypeId"> | |||
<summary> | |||
商品类型编号 | |||
</summary> | |||
</member> | |||
<member name="P:BPA.KitChen.StoreManagement.Application.Service.OrderManage.Dtos.OrderSumQuery.GoodsTypeName"> | |||
<summary> | |||
商品类型名称 | |||
</summary> | |||
</member> | |||
<member name="P:BPA.KitChen.StoreManagement.Application.Service.OrderManage.Dtos.OrderSumQuery.StoreTypeId"> | |||
<summary> | |||
店铺分类编号(设备类型关联值) | |||
</summary> | |||
</member> | |||
<member name="P:BPA.KitChen.StoreManagement.Application.Service.OrderManage.Dtos.OrderSumQuery.StoreTypeName"> | |||
<summary> | |||
店铺分类名称(设备类型名称) | |||
</summary> | |||
</member> | |||
<member name="P:BPA.KitChen.StoreManagement.Application.Service.OrderManage.Dtos.OrderSumQuery.Order_Number"> | |||
<summary> | |||
订单编号 | |||
</summary> | |||
</member> | |||
<member name="P:BPA.KitChen.StoreManagement.Application.Service.OrderManage.Dtos.OrderSumQuery.Order_OriginalMoney"> | |||
<summary> | |||
应付金额 | |||
</summary> | |||
</member> | |||
<member name="P:BPA.KitChen.StoreManagement.Application.Service.OrderManage.Dtos.OrderSumQuery.Order_RealMoney"> | |||
<summary> | |||
实付金额 | |||
</summary> | |||
</member> | |||
<member name="P:BPA.KitChen.StoreManagement.Application.Service.OrderManage.Dtos.OrderSumQuery.PayMode"> | |||
<summary> | |||
支付方式(微信支付) | |||
</summary> | |||
</member> | |||
<member name="P:BPA.KitChen.StoreManagement.Application.Service.OrderManage.Dtos.OrderSumQuery.SumOrder"> | |||
<summary> | |||
订单汇总数量 | |||
</summary> | |||
</member> | |||
<member name="P:BPA.KitChen.StoreManagement.Application.Service.OrderManage.Dtos.OrderSumQuery.Order_CreateTime"> | |||
<summary> | |||
订单开始时间 | |||
</summary> | |||
</member> | |||
<member name="P:BPA.KitChen.StoreManagement.Application.Service.OrderManage.Dtos.OrderSumQuery.Order_EndTime"> | |||
<summary> | |||
订单结束时间 | |||
</summary> | |||
</member> | |||
<member name="P:BPA.KitChen.StoreManagement.Application.Service.OrderManage.Dtos.OrderQueryInputDto.Id"> | |||
<summary> | |||
订单Id | |||
</summary> | |||
</member> | |||
<member name="P:BPA.KitChen.StoreManagement.Application.Service.OrderManage.Dtos.OrderQueryInputDto.FranchiseeId"> | |||
<summary> | |||
加盟商编号 | |||
</summary> | |||
</member> | |||
<member name="P:BPA.KitChen.StoreManagement.Application.Service.OrderManage.Dtos.OrderQueryInputDto.order_Number"> | |||
<summary> | |||
订单号 | |||
</summary> | |||
</member> | |||
<member name="P:BPA.KitChen.StoreManagement.Application.Service.OrderManage.Dtos.OrderQueryInputDto.StoreId"> | |||
<summary> | |||
店铺名称编号(设备名称编号) | |||
</summary> | |||
</member> | |||
<!-- Badly formed XML comment ignored for member "P:BPA.KitChen.StoreManagement.Application.Service.OrderManage.Dtos.OrderQueryInputDto.GoodsId" --> | |||
<member name="P:BPA.KitChen.StoreManagement.Application.Service.OrderManage.Dtos.OrderQueryInputDto.GoodsTypeId"> | |||
<summary> | |||
商品类型编号 | |||
</summary> | |||
</member> | |||
<member name="P:BPA.KitChen.StoreManagement.Application.Service.OrderManage.Dtos.OrderQueryInputDto.StoreTypeId"> | |||
<summary> | |||
店铺分类编号(设备类型关联值) | |||
</summary> | |||
</member> | |||
<member name="P:BPA.KitChen.StoreManagement.Application.Service.OrderManage.Dtos.OrderQueryInputDto.Order_CreateTime"> | |||
<summary> | |||
订单开始时间 | |||
</summary> | |||
</member> | |||
<member name="P:BPA.KitChen.StoreManagement.Application.Service.OrderManage.Dtos.OrderQueryInputDto.Order_EndTime"> | |||
<summary> | |||
订单结束时间 | |||
</summary> | |||
</member> | |||
<member name="P:BPA.KitChen.StoreManagement.Application.Service.OrderManage.Dtos.OrderQueryInputDto.OrderStatus"> | |||
<summary> | |||
订单状态 | |||
</summary> | |||
</member> | |||
<member name="P:BPA.KitChen.StoreManagement.Application.Service.OrderManage.Dtos.OrderQueryInputDto.PayMode"> | |||
<summary> | |||
支付渠道 0微信 1支付宝 2 余额 3银联 | |||
</summary> | |||
</member> | |||
</members> | |||
</doc> |
@@ -0,0 +1,18 @@ | |||
| |||
using BPA.SAAS.KitChenManageOrder.Core.Entity; | |||
using BPA.SAAS.KitChenManageOrder.Core.Enum; | |||
using MySqlConnector; | |||
using System.Collections.Generic; | |||
using System.ComponentModel.DataAnnotations; | |||
namespace BPA.SAAS.KitChenManageOrder.Application.BaseDto | |||
{ | |||
/// <summary> | |||
/// Dto参数验证 | |||
/// </summary> | |||
public class DtoValidator | |||
{ | |||
} | |||
} |
@@ -0,0 +1,116 @@ | |||
using System; | |||
using System.Collections.Generic; | |||
using System.ComponentModel.DataAnnotations; | |||
using System.Linq; | |||
using System.Text; | |||
using System.Threading.Tasks; | |||
namespace BPA.SAAS.KitChenManageOrder.Application.BaseDto | |||
{ | |||
/// <summary> | |||
/// 通用输入扩展参数(带权限) | |||
/// </summary> | |||
public class XnInputBase : PageInputBase | |||
{ | |||
/// <summary> | |||
/// 授权菜单 | |||
/// </summary> | |||
public List<string> GrantMenuIdList { get; set; } = new List<string>(); | |||
/// <summary> | |||
/// 授权角色 | |||
/// </summary> | |||
public List<string> GrantRoleIdList { get; set; } = new List<string>(); | |||
/// <summary> | |||
/// 授权数据 | |||
/// </summary> | |||
public List<string> GrantOrgIdList { get; set; } = new List<string>(); | |||
/// <summary> | |||
/// 搜索值 | |||
/// </summary> | |||
public virtual string SearchValue { get; set; } | |||
/// <summary> | |||
/// 搜索开始时间 | |||
/// </summary> | |||
public virtual string SearchBeginTime { get; set; } | |||
/// <summary> | |||
/// 搜索结束时间 | |||
/// </summary> | |||
public virtual string SearchEndTime { get; set; } | |||
/// <summary> | |||
/// 排序字段 | |||
/// </summary> | |||
public virtual string SortField { get; set; } | |||
/// <summary> | |||
/// 排序方法,默认升序,否则降序(配合antd前端,约定参数为 Ascend,Dscend) | |||
/// </summary> | |||
public virtual string SortOrder { get; set; } | |||
/// <summary> | |||
/// 降序排序(不要问我为什么是descend不是desc,前端约定参数就是这样) | |||
/// </summary> | |||
public virtual string DescStr { get; set; } = "descend"; | |||
/// <summary> | |||
/// 复杂查询条件 | |||
/// </summary> | |||
// public virtual List<Condition> SearchParameters { get; set; } = new(); | |||
} | |||
/// <summary> | |||
/// 通用分页输入参数 | |||
/// </summary> | |||
public class PageInputBase | |||
{ | |||
public string bomId { get; set; } | |||
public string chnologyId { get; set; } | |||
/// <summary> | |||
/// 当前页码 | |||
/// </summary> | |||
private int current; | |||
public virtual int Current | |||
{ | |||
get | |||
{ | |||
return current; | |||
} | |||
set | |||
{ | |||
current = value; | |||
if (current <= 0) | |||
{ | |||
current = 1; | |||
} | |||
} | |||
} | |||
//public int? Status { get; set; } | |||
/// <summary> | |||
/// 页码容量 | |||
/// </summary> | |||
private int pagesize; | |||
public virtual int PageSize | |||
{ | |||
get | |||
{ | |||
return pagesize; | |||
} | |||
set | |||
{ | |||
pagesize = value; | |||
if (pagesize <= 0) | |||
{ | |||
pagesize = 20; | |||
} | |||
} | |||
} | |||
} | |||
} |
@@ -0,0 +1,23 @@ | |||
using System; | |||
using System.Collections.Generic; | |||
using System.Linq; | |||
using System.Text; | |||
using System.Threading.Tasks; | |||
namespace BPA.SAAS.KitChenManageOrder.Application.BaseDto | |||
{ | |||
public class PageUtil | |||
{ | |||
/// <summary> | |||
/// Data | |||
/// </summary> | |||
public object Data { get; set; } | |||
/// <summary> | |||
/// Total | |||
/// </summary> | |||
public int Total { get; set; } | |||
} | |||
} |
@@ -0,0 +1,46 @@ | |||
using System; | |||
using System.Collections.Generic; | |||
using System.Linq; | |||
using System.Text; | |||
using System.Threading.Tasks; | |||
namespace BPA.SAAS.KitChenManageOrder.Application.BaseDto | |||
{ | |||
public class ResultEntity | |||
{ | |||
public bool IsSuccess { get; set; } | |||
public string Msg { get; set; } | |||
public Object Data { get; set; } | |||
} | |||
public class ResultEntity<T> | |||
{ | |||
public bool IsSuccess { get; set; } | |||
public string Msg { get; set; } | |||
public T Data { get; set; } | |||
} | |||
public class Result<T> | |||
{ | |||
public int StatusCode { get; set; } | |||
public ResultEntity<T> Data { get; set; } | |||
public string Succeeded { get; set; } | |||
public object Errors { get; set; } | |||
public object Extras { get; set; } | |||
public string Timestamp { get; set; } | |||
} | |||
} |
@@ -0,0 +1,15 @@ | |||
global using Furion; | |||
global using Furion.DataEncryption; | |||
global using Furion.DataValidation; | |||
global using Furion.DependencyInjection; | |||
global using Furion.DynamicApiController; | |||
global using Furion.Extensions; | |||
global using Furion.FriendlyException; | |||
global using Furion.Logging; | |||
global using Mapster; | |||
global using Microsoft.AspNetCore.Authorization; | |||
global using Microsoft.AspNetCore.Http; | |||
global using Microsoft.AspNetCore.Mvc; | |||
global using Microsoft.CodeAnalysis; | |||
global using SqlSugar; | |||
global using System.ComponentModel.DataAnnotations; |
@@ -0,0 +1,68 @@ | |||
using System; | |||
using System.Collections.Generic; | |||
using System.Linq; | |||
using System.Text; | |||
using System.Threading.Tasks; | |||
namespace BPA.SAAS.KitChenManageOrder.Application.Service | |||
{ | |||
public class PageInputDto | |||
{ | |||
/// <summary> | |||
/// 当前页码 | |||
/// </summary> | |||
private int current; | |||
public virtual int Current | |||
{ | |||
get | |||
{ | |||
return current; | |||
} | |||
set | |||
{ | |||
current = value; | |||
if (current <= 0) | |||
{ | |||
current = 1; | |||
} | |||
} | |||
} | |||
//public int? Status { get; set; } | |||
/// <summary> | |||
/// 页码容量 | |||
/// </summary> | |||
private int pagesize; | |||
public virtual int PageSize | |||
{ | |||
get | |||
{ | |||
return pagesize; | |||
} | |||
set | |||
{ | |||
pagesize = value; | |||
if (pagesize <= 0) | |||
{ | |||
pagesize = 20; | |||
} | |||
} | |||
} | |||
} | |||
public class PageOutDto | |||
{ | |||
/// <summary> | |||
/// Data | |||
/// </summary> | |||
public object Data { get; set; } | |||
/// <summary> | |||
/// Total | |||
/// </summary> | |||
public int Total { get; set; } | |||
} | |||
} |
@@ -0,0 +1,200 @@ | |||
using BPA.SAAS.KitChenManageOrder.Application.BaseDto; | |||
using System; | |||
using System.Collections.Generic; | |||
using System.ComponentModel.DataAnnotations; | |||
using System.Linq; | |||
using System.Text; | |||
using System.Threading.Tasks; | |||
namespace BPA.KitChen.StoreManagement.Application.Service.OrderManage.Dtos | |||
{ | |||
/// <summary> | |||
/// 订单流水查询 | |||
/// </summary> | |||
public class OrderFlowQuery : PageInputBase | |||
{ | |||
/// <summary> | |||
/// 订单Id | |||
/// </summary> | |||
public string Id { get; set; } | |||
public string orderFlowId { get; set; } | |||
/// <summary> | |||
/// 加盟商编号 | |||
/// </summary> | |||
public string FranchiseeId { get; set; } | |||
/// <summary> | |||
/// 加盟商名称 | |||
/// </summary> | |||
public string FranchiseeName { get; set; } | |||
/// <summary> | |||
/// 店铺名称编号(设备名称编号) | |||
/// </summary> | |||
public string StoreId { get; set; } | |||
/// <summary> | |||
/// 店铺名称 | |||
/// </summary> | |||
public string StoreName { get; set; } | |||
/// <summary> | |||
/// 商品key | |||
/// </summary> | |||
public string GoodsId { get; set; } | |||
/// <summary> | |||
/// 商品名称 | |||
/// </summary> | |||
public string GoodsName { get; set; } | |||
/// <summary> | |||
/// 商品类型编号 | |||
/// </summary> | |||
public string GoodsTypeId { get; set; } | |||
/// <summary> | |||
/// 商品类型名称 | |||
/// </summary> | |||
public string GoodsTypeName { get; set; } | |||
/// <summary> | |||
/// 店铺分类编号(设备类型关联值) | |||
/// </summary> | |||
public string StoreTypeId { get; set; } | |||
/// <summary> | |||
/// 店铺分类名称(设备类型名称) | |||
/// </summary> | |||
public string StoreTypeName { get; set; } | |||
/// <summary> | |||
/// 订单编号 | |||
/// </summary> | |||
public string Order_Number { get; set; } | |||
/// <summary> | |||
/// 应付金额 | |||
/// </summary> | |||
public decimal? Order_OriginalMoney { get; set; } | |||
/// <summary> | |||
/// 实付金额 | |||
/// </summary> | |||
public decimal? Order_RealMoney { get; set; } | |||
public decimal? RefundOriginalMoney { get; set; } | |||
public decimal? RefundRealMoney { get; set; } | |||
/// <summary> | |||
/// 支付方式(微信支付) | |||
/// </summary> | |||
public int PayMode { get; set; } | |||
public int Order_Status { get; set; } | |||
/// <summary> | |||
/// 订单汇总数量 | |||
/// </summary> | |||
public int Order_Count { get; set; } | |||
/// <summary> | |||
/// 订单开始时间 | |||
/// </summary> | |||
public DateTime Order_CreateTime { get; set; } | |||
/// <summary> | |||
/// 订单结束时间 | |||
/// </summary> | |||
public DateTime? Order_EndTime { get; set; } | |||
/// <summary> | |||
/// 订单类型 | |||
/// 0-->正常 | |||
/// 1--立即吃面 | |||
/// 2-->其他 | |||
/// </summary> | |||
public int PlaceMode { get; set; } | |||
/// <summary> | |||
/// | |||
/// </summary> | |||
public string Customer_Name { get; set; } | |||
/// <summary> | |||
/// | |||
/// </summary> | |||
public string Customer_Tel { get; set; } | |||
public int CountNumber { get; set; } | |||
public int WechatIsCheck { get; set; } | |||
} | |||
public class OrderSumQuery : PageInputBase | |||
{ | |||
/// <summary> | |||
/// 订单Id | |||
/// </summary> | |||
public string Id { get; set; } | |||
/// <summary> | |||
/// 加盟商编号 | |||
/// </summary> | |||
public string FranchiseeId { get; set; } | |||
/// <summary> | |||
/// 加盟商名称 | |||
/// </summary> | |||
public string FranchiseeName { get; set; } | |||
/// <summary> | |||
/// 店铺名称编号(设备名称编号) | |||
/// </summary> | |||
public string StoreId { get; set; } | |||
/// <summary> | |||
/// 店铺名称 | |||
/// </summary> | |||
public string StoreName { get; set; } | |||
/// <summary> | |||
/// 商品key | |||
/// </summary> | |||
public string GoodsId { get; set; } | |||
/// <summary> | |||
/// 商品名称 | |||
/// </summary> | |||
public string GoodsName { get; set; } | |||
/// <summary> | |||
/// 商品类型编号 | |||
/// </summary> | |||
public string GoodsTypeId { get; set; } | |||
/// <summary> | |||
/// 商品类型名称 | |||
/// </summary> | |||
public string GoodsTypeName { get; set; } | |||
/// <summary> | |||
/// 店铺分类编号(设备类型关联值) | |||
/// </summary> | |||
public string StoreTypeId { get; set; } | |||
/// <summary> | |||
/// 店铺分类名称(设备类型名称) | |||
/// </summary> | |||
public string StoreTypeName { get; set; } | |||
/// <summary> | |||
/// 订单编号 | |||
/// </summary> | |||
public string Order_Number { get; set; } | |||
/// <summary> | |||
/// 应付金额 | |||
/// </summary> | |||
public decimal? Order_OriginalMoney { get; set; } | |||
/// <summary> | |||
/// 实付金额 | |||
/// </summary> | |||
public decimal? Order_RealMoney { get; set; } | |||
public decimal? DiscountMoney { get; set; } | |||
/// <summary> | |||
/// 支付方式(微信支付) | |||
/// </summary> | |||
public int PayMode { get; set; } | |||
/// <summary> | |||
/// 订单汇总数量 | |||
/// </summary> | |||
public int SumOrder { get; set; } | |||
public int OrderNum { get; set; } | |||
public int BoxNum { get; set; } | |||
public int NowNum { get; set; } | |||
public int Abandoned { get; set; } | |||
public int Refund { get; set; } | |||
public decimal refundMoney { get; set; } | |||
public int refundNum { get; set; } | |||
public int Customer { get; set; } | |||
public int CountDetail { get; set; } | |||
/// <summary> | |||
/// 订单开始时间 | |||
/// </summary> | |||
public DateTime? Order_CreateTime { get; set; } | |||
/// <summary> | |||
/// 订单结束时间 | |||
/// </summary> | |||
public DateTime? Order_EndTime { get; set; } | |||
} | |||
} |
@@ -0,0 +1,69 @@ | |||
using System; | |||
using System.Collections.Generic; | |||
using System.Linq; | |||
using System.Text; | |||
using System.Threading.Tasks; | |||
namespace BPA.SAAS.KitChenManageOrder.Application.Service.Order.Dtos | |||
{ | |||
public class OrderInsertDto | |||
{ | |||
/// <summary> | |||
///场景id | |||
/// </summary> | |||
public string StoreId { get; set; } | |||
/// <summary> | |||
/// 商户订单号,由商家自定义 | |||
/// </summary> | |||
public string TradeNo { get; set; } | |||
///// <summary> | |||
///// 订单状态 0未付款,1已付款,-1退单申请,-2退单中,-3已退单,-4取消交易 -5撤销申请 | |||
///// </summary> | |||
//public int OrderStatus { get; set; } | |||
/// <summary> | |||
/// 订单总金额 | |||
/// </summary> | |||
public decimal TotalAmount { get; set; } | |||
/// <summary> | |||
/// 订单数量 | |||
/// </summary> | |||
public int OrderCount { get; set; } | |||
/// <summary> | |||
/// 订单标题 | |||
/// </summary> | |||
public string Subject { get; set; } | |||
public List<Orderdetail> Orderdetail { get; set; } | |||
} | |||
public class Orderdetail | |||
{ | |||
public string GoodsNumber { get; set; } | |||
public string GoodsId { get; set; } | |||
public string GoodsName { get; set; } | |||
public List<GoodsAttr> GoodsAttr { get; set; } | |||
/// <summary> | |||
/// 是否自定义配方 | |||
/// </summary> | |||
public bool isCustom { get; set; } | |||
/// <summary> | |||
/// 工艺配方详情 | |||
/// </summary> | |||
public List<FormulaDetail> FormulaDetail { get; set; } | |||
} | |||
public class GoodsAttr | |||
{ | |||
public string GoodsId { get; set; } | |||
public string AttributeId { get; set; } | |||
public string AttributeName { get; set; } | |||
public int Count { get; set; } | |||
public decimal Price { get; set; } | |||
} | |||
public class FormulaDetail | |||
{ | |||
public string DeviceId { get; set; } | |||
public string GoodsId { get; set; } | |||
public string TechnologyId { get; set; } | |||
public string ActionName { get; set; } | |||
public string ActionValue { get; set; } | |||
public int Sort { get; set; } | |||
} | |||
} |
@@ -0,0 +1,66 @@ | |||
using BPA.SAAS.KitChenManageOrder.Application.BaseDto; | |||
using SqlSugar; | |||
using System; | |||
using System.Collections.Generic; | |||
using System.ComponentModel.DataAnnotations; | |||
using System.Linq; | |||
using System.Text; | |||
using System.Threading.Tasks; | |||
namespace BPA.KitChen.StoreManagement.Application.Service.OrderManage.Dtos | |||
{ | |||
public class OrderQueryInputDto : PageInputBase | |||
{ | |||
/// <summary> | |||
/// 订单Id | |||
/// </summary> | |||
public string Id { get; set; } | |||
/// <summary> | |||
/// 加盟商编号 | |||
/// </summary> | |||
public string FranchiseeId { get; set; } | |||
/// <summary> | |||
/// 订单号 | |||
/// </summary> | |||
public string order_Number { get; set; } | |||
public string Customer_Tel { get; set; } | |||
/// <summary> | |||
/// 店铺名称编号(设备名称编号) | |||
/// </summary> | |||
public string[] StoreId { get; set; } | |||
/// <summary> | |||
/// <summary> | |||
/// 商品key | |||
/// </summary> | |||
public string[] GoodsId { get; set; } | |||
/// <summary> | |||
/// 商品类型编号 | |||
/// </summary> | |||
public string[] GoodsTypeId { get; set; } | |||
/// <summary> | |||
/// 店铺分类编号(设备类型关联值) | |||
/// </summary> | |||
public string StoreTypeId { get; set; } | |||
/// <summary> | |||
/// 订单开始时间 | |||
/// </summary> | |||
public DateTime? Order_CreateTime { get; set; } | |||
/// <summary> | |||
/// 订单结束时间 | |||
/// </summary> | |||
public DateTime? Order_EndTime { get; set; } | |||
public bool isreport { get; set; } = false; | |||
public bool IsExport { get; set; } = false; | |||
/// <summary> | |||
/// 订单状态 | |||
/// </summary> | |||
public int? OrderStatus { get; set; } | |||
/// <summary> | |||
/// 支付渠道 0微信 1支付宝 2 余额 3银联 | |||
/// </summary> | |||
public int? PayMode { get; set; } | |||
} | |||
} |
@@ -0,0 +1,20 @@ | |||
using System; | |||
using System.Collections.Generic; | |||
using System.Linq; | |||
using System.Text; | |||
using System.Threading.Tasks; | |||
namespace BPA.SAAS.KitChenManageOrder.Application.Service.Order.Dtos | |||
{ | |||
public class OrderQueryPageDto | |||
{ | |||
public int Current { get; set; } | |||
public int PageSize { get; set; } | |||
public string TradeNo { get; set; } | |||
public string OrderNumber { get; set; } | |||
public string GoodsName { get; set; } | |||
public string StoreId { get; set; } | |||
public string Subject { get; set; } | |||
public DateTime? CreateAt { get; set; } | |||
} | |||
} |
@@ -0,0 +1,84 @@ | |||
using System; | |||
using System.Collections.Generic; | |||
using System.Linq; | |||
using System.Text; | |||
using System.Threading.Tasks; | |||
namespace BPA.SAAS.KitChenManageOrder.Application.Service.Order.Dtos | |||
{ | |||
public class OrderViewDto | |||
{ | |||
public string Id { get; set; } | |||
/// <summary> | |||
///场景id | |||
/// </summary> | |||
public string StoreId { get; set; } | |||
/// <summary> | |||
/// 平台订单号 | |||
/// </summary> | |||
public string OrderNumber { get; set; } | |||
/// <summary> | |||
/// 商户订单号,由商家自定义 | |||
/// </summary> | |||
public string TradeNo { get; set; } | |||
/// <summary> | |||
/// 订单状态 0成功,1失败 | |||
/// </summary> | |||
public int OrderStatus { get; set; } | |||
/// <summary> | |||
/// 订单总金额 | |||
/// </summary> | |||
public decimal TotalAmount { get; set; } | |||
/// <summary> | |||
/// 订单数量 | |||
/// </summary> | |||
public int OrderCount { get; set; } | |||
/// <summary> | |||
/// 订单标题 | |||
/// </summary> | |||
public string Subject { get; set; } | |||
public DateTime CreatedAt { get; set; } | |||
public List<OrderdetaiViewDto> Orderdetail { get; set; } | |||
} | |||
public class OrderdetaiViewDto | |||
{ | |||
public string Id { get; set; } | |||
/// <summary> | |||
/// 主订单表Id | |||
/// </summary> | |||
public string OrderId { get; set; } | |||
public string GoodsNumber { get; set; } | |||
public string GoodsId { get; set; } | |||
public string GoodsName { get; set; } | |||
public List<GoodsAttrViewDto> GoodsAttr { get; set; } | |||
/// <summary> | |||
/// 是否自定义配方 | |||
/// </summary> | |||
public bool isCustom { get; set; } | |||
/// <summary> | |||
/// 工艺配方详情 | |||
/// </summary> | |||
public List<FormulaDetailViewDto> FormulaDetail { get; set; } | |||
} | |||
public class GoodsAttrViewDto | |||
{ | |||
public string Id { get; set; } | |||
public string GoodsId { get; set; } | |||
public string SuborderId { get; set; } | |||
public string AttributeId { get; set; } | |||
public string AttributeName { get; set; } | |||
public int Count { get; set; } | |||
public decimal Price { get; set; } | |||
} | |||
public class FormulaDetailViewDto | |||
{ | |||
public string Id { get; set; } | |||
public string SuborderId { get; set; } | |||
public string DeviceId { get; set; } | |||
public string GoodsId { get; set; } | |||
public string TechnologyId { get; set; } | |||
public string ActionName { get; set; } | |||
public string ActionValue { get; set; } | |||
public int Sort { get; set; } | |||
} | |||
} |
@@ -0,0 +1,12 @@ | |||
using System; | |||
using System.Collections.Generic; | |||
using System.Linq; | |||
using System.Text; | |||
using System.Threading.Tasks; | |||
namespace BPA.SAAS.KitChenManageOrder.Application.Service.Order | |||
{ | |||
public interface IOrderService | |||
{ | |||
} | |||
} |
@@ -0,0 +1,671 @@ | |||
using BPA.SAAS.KitChenManageOrder.Application.BaseDto; | |||
using BPA.SAAS.KitChenManageOrder.Core.Common.Const; | |||
using BPA.KitChen.StoreManagement.Application.Service.OrderManage.Dtos; | |||
using Furion.DatabaseAccessor; | |||
using Furion; | |||
using Furion.DependencyInjection; | |||
using Furion.DynamicApiController; | |||
using Microsoft.AspNetCore.Mvc; | |||
using SqlSugar; | |||
using System; | |||
using System.Collections.Generic; | |||
using System.Linq; | |||
using System.Text; | |||
using System.Threading.Tasks; | |||
using BPA.SAAS.KitChenManageOrder.Core.Entity; | |||
using Microsoft.AspNetCore.Authorization; | |||
using Microsoft.AspNetCore.Hosting; | |||
using NPOI.SS.UserModel; | |||
using NPOI.XSSF.UserModel; | |||
using BPA.SAAS.KitChenManageOrder.Application.Service.Order.Dtos; | |||
using Org.BouncyCastle.Crypto; | |||
using BPA.SAAS.KitChenManageOrder.Core.Entity.Base; | |||
using StackExchange.Profiling.Internal; | |||
using NPOI.SS.Formula.Functions; | |||
using BPA.SAAS.KitChenManageOrder.Core; | |||
namespace BPA.SAAS.KitChenManageOrder.Application.Service.Order | |||
{ | |||
[ApiDescriptionSettings("订单管理", Tag = "订单管理"), AllowAnonymous] | |||
public class OrderService : IDynamicApiController, ITransient, IOrderService | |||
{ | |||
/// <summary> | |||
/// 核心对象:拥有完整的SqlSugar全部功能 | |||
/// </summary> | |||
private readonly ISqlSugarClient db; | |||
/// <summary> | |||
/// construct | |||
/// </summary> | |||
/// <param name="sqlSugarRepository"></param> | |||
public OrderService(ISqlSugarClient _db) | |||
{ | |||
db = _db; | |||
} | |||
/// <summary> | |||
/// 创建订单 | |||
/// </summary> | |||
/// <param name="dto"></param> | |||
/// <returns></returns> | |||
[HttpPost("/api/ExternalPlatform/Order/CreateOrder")] | |||
public async Task<bool> AddOrder(OrderInsertDto dto) | |||
{ | |||
try | |||
{ | |||
db.Ado.BeginTran(); | |||
var check=db.Queryable<BPA_Order>().Where(x => x.TradeNo == dto.TradeNo).Any(); | |||
if (check) throw Oops.Oh("订单已存在"); | |||
BPA_Order _order = new(); | |||
_order.Id = Guid.NewGuid().ToString(); | |||
_order.StoreId = dto.StoreId; | |||
_order.TradeNo = dto.TradeNo; | |||
_order.TotalAmount = dto.TotalAmount; | |||
_order.OrderCount = dto.OrderCount; | |||
_order.Subject = dto.Subject; | |||
_order.OrderNumber = DateTime.Now.ToString("yyyMMddhhmmss"); | |||
_order.CreateAt = DateTime.Now; | |||
_order.GroupId = CurrentUser.GroupId; | |||
List<BPA_SubOrder> SubOrdeList = new(); | |||
List<BPA_OrderGoodsArrt> OrderGoodsArrtList = new(); | |||
List<BPA_OrderGoodsTechnology> OrderGoodsTechnologyList = new(); | |||
if (dto.Orderdetail != null) | |||
{ | |||
for (int i = 0; i < dto.Orderdetail.Count; i++) | |||
{ | |||
BPA_SubOrder _subOrder = new(); | |||
_subOrder.Id = Guid.NewGuid().ToString(); | |||
_subOrder.OrderId = _order.Id; | |||
_subOrder.GoodsNumber = dto.Orderdetail[i].GoodsNumber; | |||
_subOrder.GoodsId = dto.Orderdetail[i].GoodsId; | |||
_subOrder.GoodsName = dto.Orderdetail[i].GoodsName; | |||
_subOrder.GoodsId = dto.Orderdetail[i].GoodsId; | |||
_subOrder.isCustom = dto.Orderdetail[i].isCustom; | |||
_subOrder.CreateAt = DateTime.Now; | |||
SubOrdeList.Add(_subOrder); | |||
for (int t = 0; t < dto.Orderdetail[i].GoodsAttr.Count(); t++) | |||
{ | |||
BPA_OrderGoodsArrt goodsAttr = new(); | |||
goodsAttr.Id = Guid.NewGuid().ToString(); | |||
goodsAttr.SuborderId= _subOrder.Id; | |||
goodsAttr.GoodsId = dto.Orderdetail[i].GoodsAttr[t].GoodsId; | |||
goodsAttr.AttributeId = dto.Orderdetail[i].GoodsAttr[t].AttributeId; | |||
goodsAttr.AttributeName = dto.Orderdetail[i].GoodsAttr[t].AttributeName; | |||
goodsAttr.Count = dto.Orderdetail[i].GoodsAttr[t].Count; | |||
goodsAttr.Price = dto.Orderdetail[i].GoodsAttr[t].Price; | |||
goodsAttr.CreateAt = DateTime.Now; | |||
OrderGoodsArrtList.Add(goodsAttr); | |||
} | |||
for (int y = 0; y < dto.Orderdetail[i].FormulaDetail.Count; y++) | |||
{ | |||
BPA_OrderGoodsTechnology orderGoodsTechnology = new(); | |||
orderGoodsTechnology.Id = Guid.NewGuid().ToString(); | |||
orderGoodsTechnology.SuborderId = _subOrder.Id; | |||
orderGoodsTechnology.DeviceId = dto.Orderdetail[i].FormulaDetail[y].DeviceId; | |||
orderGoodsTechnology.GoodsId = dto.Orderdetail[i].FormulaDetail[y].GoodsId; | |||
orderGoodsTechnology.TechnologyId = dto.Orderdetail[i].FormulaDetail[y].TechnologyId; | |||
orderGoodsTechnology.ActionName = dto.Orderdetail[i].FormulaDetail[y].ActionName; | |||
orderGoodsTechnology.ActionValue = dto.Orderdetail[i].FormulaDetail[y].ActionValue; | |||
orderGoodsTechnology.Sort = dto.Orderdetail[i].FormulaDetail[y].Sort; | |||
orderGoodsTechnology.CreateAt = DateTime.Now; | |||
OrderGoodsTechnologyList.Add(orderGoodsTechnology); | |||
} | |||
} | |||
} | |||
await db.Insertable(_order).ExecuteCommandAsync(); | |||
await db.Insertable(SubOrdeList).ExecuteCommandAsync(); | |||
await db.Insertable(OrderGoodsArrtList).ExecuteCommandAsync(); | |||
await db.Insertable(OrderGoodsTechnologyList).ExecuteCommandAsync(); | |||
db.Ado.CommitTran(); | |||
return true; | |||
} | |||
catch (Exception ex) | |||
{ | |||
db.Ado.RollbackTran(); | |||
throw Oops.Oh("创建订单失败,失败信息:"+ ex.Message); | |||
} | |||
} | |||
/// <summary> | |||
/// 查询订单 | |||
/// </summary> | |||
/// <param name="dto"></param> | |||
/// <returns></returns> | |||
[HttpPost("/api/ExternalPlatform/Order/GetOrder")] | |||
public async Task<List<OrderViewDto>> GetOrder(OrderQueryDto dto) | |||
{ | |||
var list=await db.Queryable<BPA_Order>() | |||
.WhereIF(!string.IsNullOrWhiteSpace(dto.TradeNo),x=>x.TradeNo== dto.TradeNo) | |||
.WhereIF(!string.IsNullOrWhiteSpace(dto.OrderNumber), x => x.OrderNumber == dto.OrderNumber) | |||
.Select(x=>new OrderViewDto() { Id=x.Id.SelectAll()}) | |||
.Mapper(x => | |||
{ | |||
var de=db.Queryable<BPA_SubOrder>().Where(p => p.OrderId == x.Id) | |||
.WhereIF(!string.IsNullOrWhiteSpace(dto.GoodsName), x => x.GoodsName.Contains(dto.GoodsName)) | |||
.Select(x => new OrderdetaiViewDto() {Id=x.Id.SelectAll() }) | |||
.Mapper(g => | |||
{ | |||
var GoodsAttr = db.Queryable<BPA_OrderGoodsArrt>().Where(x => x.SuborderId == g.Id).Select(x => new GoodsAttrViewDto() { Id = x.Id.SelectAll() }).ToList(); | |||
g.GoodsAttr = GoodsAttr; | |||
var FormulaDetail = db.Queryable<BPA_OrderGoodsTechnology>().Where(x => x.SuborderId == g.Id).Select(x => new FormulaDetailViewDto() { Id = x.Id.SelectAll() }).ToList(); | |||
g.FormulaDetail = FormulaDetail; | |||
}).ToList(); | |||
x.Orderdetail = de; | |||
}) .ToListAsync(); | |||
return list; | |||
} | |||
[HttpPost("/api/Order/GetOrderPageList")] | |||
public async Task<PageUtil> GetOrder(OrderQueryPageDto dto) | |||
{ | |||
RefAsync<int> total = 0; | |||
var list = await db.Queryable<BPA_Order>() | |||
.WhereIF(!string.IsNullOrWhiteSpace(dto.TradeNo), x => x.TradeNo == dto.TradeNo) | |||
.WhereIF(!string.IsNullOrWhiteSpace(dto.OrderNumber), x => x.OrderNumber == dto.OrderNumber) | |||
.WhereIF(!string.IsNullOrWhiteSpace(dto.StoreId), x => x.StoreId == dto.StoreId) | |||
.WhereIF(!string.IsNullOrWhiteSpace(dto.Subject), x => x.Subject == dto.Subject) | |||
.WhereIF(!string.IsNullOrWhiteSpace(dto.CreateAt.ToString()), x => x.CreateAt == dto.CreateAt) | |||
.Select(x => new OrderViewDto() { Id = x.Id.SelectAll(),CreatedAt=x.CreateAt }) | |||
.Mapper(x => | |||
{ | |||
var de = db.Queryable<BPA_SubOrder>().Where(p => p.OrderId == x.Id) | |||
.WhereIF(!string.IsNullOrWhiteSpace(dto.GoodsName), x => x.GoodsName.Contains(dto.GoodsName)) | |||
.Select(x => new OrderdetaiViewDto() { Id = x.Id.SelectAll() }) | |||
.Mapper(g => | |||
{ | |||
var GoodsAttr = db.Queryable<BPA_OrderGoodsArrt>().Where(x => x.SuborderId == g.Id).Select(x => new GoodsAttrViewDto() { Id = x.Id.SelectAll() }).ToList(); | |||
g.GoodsAttr = GoodsAttr; | |||
var FormulaDetail = db.Queryable<BPA_OrderGoodsTechnology>().Where(x => x.SuborderId == g.Id).Select(x => new FormulaDetailViewDto() { Id = x.Id.SelectAll() }).ToList(); | |||
g.FormulaDetail = FormulaDetail; | |||
}).ToList(); | |||
x.Orderdetail = de; | |||
}).ToPageListAsync(dto.Current, dto.PageSize, total); | |||
PageUtil util = new PageUtil() | |||
{ | |||
Total = total, | |||
Data = list | |||
}; | |||
return util; | |||
} | |||
#region | |||
// /// <summary> | |||
// /// 订单明细 | |||
// /// </summary> | |||
// /// <param name="dto"></param> | |||
// /// <returns></returns> | |||
// [HttpPost("/api/Order/PostDetail")] | |||
// public PageUtil PostDetail(OrderQueryInputDto dto) | |||
// { | |||
// //根据对应的条件查询和排序 | |||
// string strWhere = string.Empty; | |||
// int total = 0; | |||
// List<OrderFlowQuery> res = new List<OrderFlowQuery>(); | |||
// //if (!string.IsNullOrEmpty(dto.StoreTypeId))//店铺分类 | |||
// //{ | |||
// // strWhere += $" and d.Id='{dto.StoreTypeId}'"; | |||
// //} | |||
// if (dto.StoreId != null && dto.StoreId.Length > 0)//店铺名称 | |||
// { | |||
// strWhere += $" and a.StoreId in ("; | |||
// for (int i = 0; i < dto.StoreId.Length; i++) | |||
// { | |||
// strWhere += $"'{dto.StoreId[i]}',"; | |||
// } | |||
// strWhere = strWhere.Substring(0, strWhere.LastIndexOf(',')); | |||
// strWhere += ")"; | |||
// } | |||
// if (dto.GoodsId != null && dto.GoodsId.Length > 0)//商品名称 | |||
// { | |||
// strWhere += $" and a.GoodId in ("; | |||
// for (int i = 0; i < dto.GoodsId.Length; i++) | |||
// { | |||
// strWhere += $"'{dto.GoodsId[i]}',"; | |||
// } | |||
// strWhere = strWhere.Substring(0, strWhere.LastIndexOf(',')); | |||
// strWhere += ")"; | |||
// } | |||
// if (!dto.isreport) | |||
// { | |||
// if (!string.IsNullOrWhiteSpace(CustomerIds))//屏蔽查询人 | |||
// { | |||
// string key = ""; | |||
// string[] CustomerId = CustomerIds.Split(','); | |||
// for (int i = 0; i < CustomerId.Length; i++) | |||
// { | |||
// key += $"'{CustomerId[i]}',"; | |||
// } | |||
// key = key.Substring(0, key.LastIndexOf(',')); | |||
// strWhere += $" and a.Customer_ID not in (" + key + ")"; | |||
// } | |||
// strWhere += $" and a.StoreId not in ('" + StoreId + "')"; | |||
// } | |||
// //if (!string.IsNullOrEmpty(dto.Customer_Tel)) | |||
// //{ | |||
// // strWhere += $" and g.Phone='{dto.Customer_Tel}'"; | |||
// //} | |||
// if (dto.GoodsTypeId != null && dto.GoodsTypeId.Length > 0)//商品类型 | |||
// { | |||
// strWhere += $" and e.Goods_TypeID in ("; | |||
// for (int i = 0; i < dto.GoodsTypeId.Length; i++) | |||
// { | |||
// strWhere += $"'{dto.GoodsTypeId[i]}',"; | |||
// } | |||
// strWhere = strWhere.Substring(0, strWhere.LastIndexOf(',')); | |||
// strWhere += ")"; | |||
// } | |||
// //默认当天时间 | |||
// if (string.IsNullOrEmpty(dto.Order_CreateTime.ToString())) | |||
// { | |||
// dto.Order_CreateTime = DateTime.Now; | |||
// } | |||
// if (string.IsNullOrEmpty(dto.Order_EndTime.ToString())) | |||
// { | |||
// dto.Order_EndTime = DateTime.Now; | |||
// } | |||
// var GroupId = App.User.FindFirst(ClaimConst.GroupId)?.Value; | |||
// if (!string.IsNullOrWhiteSpace(GroupId)) | |||
// { | |||
// strWhere += $" and a.GroupId = '" + GroupId + "'"; | |||
// } | |||
// if (dto.OrderStatus != null) | |||
// { | |||
// strWhere += $" and a.Order_Status = " + dto.OrderStatus; | |||
// } | |||
// var temp1 = Convert.ToDateTime(dto.Order_CreateTime.Value.ToString("yyyy-MM-dd")); | |||
// var temp2 = Convert.ToDateTime(dto.Order_EndTime.Value.AddDays(1).ToString("yyyy-MM-dd")); | |||
// if (!dto.isreport) | |||
// { | |||
// var lastDay = DateTime.Now.AddDays(1 - DateTime.Now.Day).AddMonths(-1).Date; | |||
// if (temp1 < lastDay) | |||
// { | |||
// temp1 = lastDay; | |||
// } | |||
// if (temp2 < lastDay) | |||
// { | |||
// temp2 = lastDay; | |||
// } | |||
// } | |||
// string sql = @"SELECT | |||
//UUID() as orderFlowId, | |||
// a.OrderInfo_Id AS Id, | |||
// a.RefundStatus, | |||
// a.StoreId, | |||
// a.StoreName, | |||
// (case when a.RefundStatus<0 then a.Order_RealMoney else 0 end ) AS Order_RealMoney, | |||
// (case when a.RefundStatus<0 then a.Order_OriginalMoney else 0 end ) AS Order_OriginalMoney, | |||
// (case when a.RefundStatus>=0 then a.Order_RealMoney else 0 end ) AS RefundRealMoney, | |||
// (case when a.RefundStatus>=0 then a.Order_OriginalMoney else 0 end ) AS RefundOriginalMoney, | |||
// a.Transaction_ID AS Order_Number, | |||
// a.Order_CreateTime AS Order_CreateTime, | |||
// a.PlaceMode AS PayMode, | |||
// a.Order_Status AS Order_Status, | |||
// a.Customer_ID AS Customer_Name, | |||
// a.Customer_ID AS Customer_Tel, | |||
// 1 as order_Count | |||
// FROM | |||
// (SELECT | |||
// c.`OrderInfo_Id` AS `OrderInfo_Id`, | |||
// c.`Order_Status` AS `Order_Status`, | |||
// c.`Order_CreateTime` AS `Order_CreateTime`, | |||
// c.`StoreId` AS `StoreId`, | |||
// c.`StoreName` AS `StoreName`, | |||
// c.`Order_OriginalMoney` AS `Order_OriginalMoney`, | |||
// c.`Order_RealMoney` AS `Order_RealMoney`, | |||
// c.`PlaceMode` AS `PlaceMode`, | |||
// c.`Customer_ID` AS `Customer_ID`, | |||
// c.`Transaction_ID` AS `Transaction_ID`, | |||
// c.`RefundStatus` AS `RefundStatus`, | |||
// c.`GroupId` AS `GroupId`, | |||
// c.`order_Count` AS `order_Count` | |||
//FROM | |||
// ( | |||
// SELECT | |||
// `a`.`Id` AS `OrderInfo_Id`, | |||
// `a`.`OrderStatus` AS `Order_Status`, | |||
// `a`.`CreatedAt` AS `Order_CreateTime`, | |||
// `a`.`OrgId` AS `StoreId`, | |||
// `a`.`OrgId` AS `StoreName`, | |||
// `a`.`OrderOriginalMoney` AS `Order_OriginalMoney`, | |||
// `a`.`OrderRealMoney` AS `Order_RealMoney`,(((( | |||
// `a`.`OrderRealMoney` + ifnull( `a`.`DiscountMoney`, 0 )) + ifnull( json_extract( `a`.`PriceCollection`, '$.CouponPrice' ), 0 )) + ifnull( json_extract( `a`.`PriceCollection`, '$.ActivityPrice' ), 0 )) + ifnull( json_extract( `a`.`PriceCollection`, '$.Vip' ), 0 )) AS `OrderRealMoney`, | |||
// `a`.`OrderType` AS `PlaceMode`, | |||
// `a`.`CustomerId` AS `Customer_ID`, | |||
// `a`.`OrderCount` AS `order_Count`, | |||
// `a`.`TransactionId` AS `Transaction_ID`,-( | |||
// 1 | |||
// ) AS `RefundStatus`, | |||
// `a`.`GroupId` AS `GroupId` | |||
// FROM | |||
// `bpa_order` `a` | |||
// WHERE | |||
// ( length( `a`.`TransactionId` ) > 1 )) AS c UNION ALL | |||
//SELECT | |||
// `a`.`OrderInfo_Id` AS `OrderInfo_Id`, | |||
// `a`.`Order_Status` AS `Order_Status`, | |||
// `b`.`RefundTime` AS `Order_CreateTime`, | |||
// `a`.`StoreId` AS `StoreId`, | |||
// `a`.`StoreName` AS `StoreName`, | |||
// `a`.`Order_OriginalMoney` AS `Order_OriginalMoney`, | |||
// `a`.`Order_RealMoney` AS `Order_RealMoney`, | |||
// `a`.`PlaceMode` AS `PlaceMode`, | |||
// `a`.`Customer_ID` AS `Customer_ID`, | |||
// `a`.`Transaction_ID` AS `Transaction_ID`, | |||
// `b`.`RefundResult` AS `RefundStatus`, | |||
// `a`.`GroupId` AS `GroupId`, | |||
// `a`.`order_Count` AS `order_Count` | |||
//FROM | |||
// ( | |||
// `bpa_orderrefundlog` `b` | |||
// LEFT JOIN ( | |||
// SELECT | |||
// `a`.`Id` AS `OrderInfo_Id`, | |||
// `a`.`OrderStatus` AS `Order_Status`, | |||
// `a`.`CreatedAt` AS `Order_CreateTime`, | |||
// `a`.`OrgId` AS `StoreId`, | |||
// `a`.`OrgId` AS `StoreName`, | |||
// `a`.`OrderOriginalMoney` AS `Order_OriginalMoney`, | |||
// `a`.`OrderRealMoney` AS `Order_RealMoney`,(((( | |||
// `a`.`OrderRealMoney` + ifnull( `a`.`DiscountMoney`, 0 )) + ifnull( json_extract( `a`.`PriceCollection`, '$.CouponPrice' ), 0 )) + ifnull( json_extract( `a`.`PriceCollection`, '$.ActivityPrice' ), 0 )) + ifnull( json_extract( `a`.`PriceCollection`, '$.Vip' ), 0 )) AS `OrderRealMoney`, | |||
// `a`.`OrderType` AS `PlaceMode`, | |||
// `a`.`CustomerId` AS `Customer_ID`, | |||
// `a`.`OrderCount` AS `order_Count`, | |||
// `a`.`TransactionId` AS `Transaction_ID`,-( | |||
// 1 | |||
// ) AS `RefundStatus`, | |||
// `a`.`GroupId` AS `GroupId` | |||
// FROM | |||
// `bpa_order` `a` | |||
// WHERE | |||
// ( length( `a`.`TransactionId` ) > 1 )) `a` ON (( | |||
// `a`.`OrderInfo_Id` = `b`.`OrderId` | |||
// ))) | |||
//WHERE | |||
// ( | |||
// `b`.`Stutas` = 202)) a | |||
// where a.RefundStatus is not NULL and | |||
// a.Order_CreateTime >='" + temp1.ToString("yyyy-MM-dd HH:mm:ss") + @"' and a.Order_CreateTime <'" + temp2.ToString("yyyy-MM-dd HH:mm:ss") + @"' | |||
// " + strWhere + ""; | |||
// res = db.SqlQueryable<OrderFlowQuery>(sql) | |||
// .WhereIF(dto.PayMode.HasValue, (b) => b.PayMode == dto.PayMode) | |||
// .OrderBy(a => a.Order_CreateTime, OrderByType.Desc).ToPageList(dto.Current, dto.PageSize, ref total); | |||
// var ids = res.Select(x => x.Id).ToList(); | |||
// var orders = db.Queryable<BPA_Order>().Where(x => ids.Contains(x.Id)).ToList(); | |||
// foreach (var item in res) | |||
// { | |||
// item.PayMode = orders.FirstOrDefault(x => x.Id == item.Id)?.PayMode ?? 0; | |||
// } | |||
// PageUtil unit = new PageUtil() | |||
// { | |||
// Data = res, | |||
// Total = total, | |||
// }; | |||
// return unit; | |||
// } | |||
// [HttpPost("/api/Order/GetFlowExport"), ApiDescriptionSettings(SplitCamelCase = false), AllowAnonymous, NonUnify] | |||
// public ResultEntity OrderDetailFlowExport([FromBody] OrderQueryInputDto dto) | |||
// { | |||
// List<OrderFlowQuery> orderFlows = OrderDetailFlowExportData(dto); | |||
// return new ResultEntity() | |||
// { | |||
// Data = orderFlows, | |||
// IsSuccess = orderFlows.Count > 0, | |||
// }; | |||
// string fielName = DateTime.Now.ToString("yyyyMMddHHmmss"); | |||
// var currentUseId = "OrderFlow"; | |||
// var rootPath = _hostingEnvironment.ContentRootPath + "orderExcels\\"; | |||
// if (System.IO.Directory.Exists(rootPath) == false) | |||
// System.IO.Directory.CreateDirectory(rootPath); | |||
// var newFile = rootPath + "\\" + fielName + ".xlsx"; | |||
// if (System.IO.File.Exists(newFile)) | |||
// { | |||
// System.IO.File.Delete(newFile); | |||
// } | |||
// using (var fs = new FileStream(newFile, FileMode.Create, FileAccess.Write)) | |||
// { | |||
// IWorkbook workbook = new XSSFWorkbook(); | |||
// var sheet = workbook.CreateSheet("orders"); | |||
// var header = sheet.CreateRow(0); | |||
// header.CreateCell(1).SetCellValue("店铺名称 "); | |||
// header.CreateCell(2).SetCellValue("交易单号"); | |||
// header.CreateCell(3).SetCellValue("应付金额"); | |||
// header.CreateCell(4).SetCellValue("实付金额 "); | |||
// header.CreateCell(5).SetCellValue("应退金额"); | |||
// header.CreateCell(6).SetCellValue("实退金额"); | |||
// header.CreateCell(7).SetCellValue("菜品数量"); | |||
// header.CreateCell(8).SetCellValue("下单时间"); | |||
// var rowIndex = 1; | |||
// foreach (var item in orderFlows) | |||
// { | |||
// var datarow = sheet.CreateRow(rowIndex); | |||
// datarow.CreateCell(0).SetCellValue(item.StoreName); | |||
// datarow.CreateCell(1).SetCellValue(item.Order_Number); | |||
// datarow.CreateCell(2).SetCellValue(item.Order_OriginalMoney.Value.ToString("#0.00")); | |||
// datarow.CreateCell(3).SetCellValue(item.Order_RealMoney.Value.ToString("#0.00")); | |||
// datarow.CreateCell(4).SetCellValue(item.RefundOriginalMoney.Value.ToString("#0.00")); | |||
// datarow.CreateCell(5).SetCellValue(item.RefundRealMoney.Value.ToString("#0.00")); | |||
// datarow.CreateCell(6).SetCellValue(item.Order_Count); | |||
// datarow.CreateCell(7).SetCellValue(item.Order_CreateTime.ToString("yyyy-MM-dd HH:mm:ss")); | |||
// rowIndex++; | |||
// } | |||
// workbook.Write(fs); | |||
// } | |||
// var memory = new MemoryStream(); | |||
// using (var stream = new FileStream(newFile, FileMode.Open)) | |||
// { | |||
// stream.CopyTo(memory); | |||
// } | |||
// memory.Position = 0; | |||
// var result = new FileStreamResult(memory, "application/octet-stream") | |||
// { | |||
// FileDownloadName = fielName + ".xlsx" | |||
// }; | |||
// // return result; | |||
// } | |||
// private List<OrderFlowQuery> OrderDetailFlowExportData(OrderQueryInputDto dto) | |||
// { | |||
// //根据对应的条件查询和排序 | |||
// string strWhere = string.Empty; | |||
// int total = 0; | |||
// List<OrderFlowQuery> res = new List<OrderFlowQuery>(); | |||
// if (!string.IsNullOrEmpty(dto.StoreTypeId))//店铺分类 | |||
// { | |||
// strWhere += $" and d.Id='{dto.StoreTypeId}'"; | |||
// } | |||
// if (dto.StoreId != null && dto.StoreId.Length > 0)//店铺名称 | |||
// { | |||
// strWhere += $" and a.StoreId in ("; | |||
// for (int i = 0; i < dto.StoreId.Length; i++) | |||
// { | |||
// strWhere += $"'{dto.StoreId[i]}',"; | |||
// } | |||
// strWhere = strWhere.Substring(0, strWhere.LastIndexOf(',')); | |||
// strWhere += ")"; | |||
// } | |||
// if (dto.GoodsId != null && dto.GoodsId.Length > 0)//商品名称 | |||
// { | |||
// strWhere += $" and a.GoodId in ("; | |||
// for (int i = 0; i < dto.GoodsId.Length; i++) | |||
// { | |||
// strWhere += $"'{dto.GoodsId[i]}',"; | |||
// } | |||
// strWhere = strWhere.Substring(0, strWhere.LastIndexOf(',')); | |||
// strWhere += ")"; | |||
// } | |||
// if (!dto.isreport) | |||
// { | |||
// if (!string.IsNullOrWhiteSpace(CustomerIds))//屏蔽查询人 | |||
// { | |||
// string key = ""; | |||
// string[] CustomerId = CustomerIds.Split(','); | |||
// for (int i = 0; i < CustomerId.Length; i++) | |||
// { | |||
// key += $"'{CustomerId[i]}',"; | |||
// } | |||
// key = key.Substring(0, key.LastIndexOf(',')); | |||
// strWhere += $" and a.Customer_ID not in (" + key + ")"; | |||
// } | |||
// strWhere += $" and a.StoreId not in ('" + StoreId + "')"; | |||
// } | |||
// if (!string.IsNullOrEmpty(dto.Customer_Tel)) | |||
// { | |||
// strWhere += $" and g.Phone='{dto.Customer_Tel}'"; | |||
// } | |||
// if (dto.GoodsTypeId != null && dto.GoodsTypeId.Length > 0)//商品类型 | |||
// { | |||
// strWhere += $" and e.Goods_TypeID in ("; | |||
// for (int i = 0; i < dto.GoodsTypeId.Length; i++) | |||
// { | |||
// strWhere += $"'{dto.GoodsTypeId[i]}',"; | |||
// } | |||
// strWhere = strWhere.Substring(0, strWhere.LastIndexOf(',')); | |||
// strWhere += ")"; | |||
// } | |||
// //默认当天时间 | |||
// if (string.IsNullOrEmpty(dto.Order_CreateTime.ToString())) | |||
// { | |||
// dto.Order_CreateTime = DateTime.Now; | |||
// } | |||
// if (string.IsNullOrEmpty(dto.Order_EndTime.ToString())) | |||
// { | |||
// dto.Order_EndTime = DateTime.Now; | |||
// } | |||
// var GroupId = App.User.FindFirst(ClaimConst.GroupId)?.Value; | |||
// if (!string.IsNullOrWhiteSpace(GroupId)) | |||
// { | |||
// strWhere += $" and a.GroupId = '" + GroupId + "'"; | |||
// } | |||
// if (dto.OrderStatus != null) | |||
// { | |||
// strWhere += $" and a.OrderStatus = " + dto.OrderStatus; | |||
// } | |||
// var temp1 = Convert.ToDateTime(dto.Order_CreateTime.Value.ToString("yyyy-MM-dd")); | |||
// var temp2 = Convert.ToDateTime(dto.Order_EndTime.Value.AddDays(1).ToString("yyyy-MM-dd")); | |||
// if (!dto.isreport) | |||
// { | |||
// var lastDay = DateTime.Now.AddDays(1 - DateTime.Now.Day).AddMonths(-1).Date; | |||
// if (temp1 < lastDay) | |||
// { | |||
// temp1 = lastDay; | |||
// } | |||
// if (temp2 < lastDay) | |||
// { | |||
// temp2 = lastDay; | |||
// } | |||
// } | |||
// string sql = @"SELECT | |||
// a.OrderInfo_Id AS Id, | |||
// a.RefundStatus, | |||
// a.StoreId, | |||
// a.StoreName, | |||
// (case when a.RefundStatus<0 then a.Order_RealMoney else 0 end ) AS Order_RealMoney, | |||
// (case when a.RefundStatus<0 then a.Order_OriginalMoney else 0 end ) AS Order_OriginalMoney, | |||
// (case when a.RefundStatus>=0 then a.Order_RealMoney else 0 end ) AS RefundRealMoney, | |||
// (case when a.RefundStatus>=0 then a.Order_OriginalMoney else 0 end ) AS RefundOriginalMoney, | |||
// a.Transaction_ID AS Order_Number, | |||
// a.Order_CreateTime AS Order_CreateTime, | |||
// a.PlaceMode AS PayMode, | |||
// a.Order_Status AS Order_Status, | |||
// g.NickName AS Customer_Name, | |||
// g.Phone AS Customer_Tel, | |||
// 1 as order_Count | |||
// FROM | |||
// V_AllOrder a | |||
// LEFT JOIN BPA_MemberInfo g ON ( a.Customer_ID = LOWER(g.Id) ) | |||
// where a.RefundStatus is not NULL and | |||
// a.Order_CreateTime >='" + temp1.ToString("yyyy-MM-dd HH:mm:ss") + @"' and a.Order_CreateTime <'" + temp2.ToString("yyyy-MM-dd HH:mm:ss") + @"' | |||
// " + strWhere + ""; | |||
// res = db.SqlQueryable<OrderFlowQuery>(sql) | |||
// .WhereIF(dto.PayMode.HasValue, (b) => b.PayMode == dto.PayMode) | |||
// .OrderBy(a => a.Order_CreateTime, OrderByType.Desc).ToList(); | |||
// return res; | |||
// } | |||
// #region 第三方订单 | |||
// /// <summary> | |||
// /// 获取第三方 | |||
// /// </summary> | |||
// /// <param name="inputDto"></param> | |||
// /// <returns></returns> | |||
// [HttpPost("/api/Order/ThirdOrderPage")] | |||
// public async Task<PageUtil> ThirdOrderPageAsync(ThirdOrderInputDto inputDto) | |||
// { | |||
// var total = new RefAsync<int>(); | |||
// var data = await db.Queryable<BPA_ThirdOrder>() | |||
// .OrderBy(a => a.CreateAt, OrderByType.Desc) | |||
// .WhereIF(!string.IsNullOrEmpty(inputDto.OrderNum),x=>x.OrderNum.Contains(inputDto.OrderNum)) | |||
// .Select(x=>new ThirdOrderDto() | |||
// { | |||
// Id = x.Id.SelectAll() | |||
// }) | |||
// .ToPageListAsync(inputDto.Current, inputDto.PageSize, total); | |||
// var ids = data.Select(x => x.Id).ToList(); | |||
// var thirdOrderInfos = await db.Queryable<BPA_ThirdOrderInfo>() | |||
// .Where(x=>ids.Contains(x.ThirdOrderId)) | |||
// .ToListAsync(); | |||
// foreach (var item in data) | |||
// { | |||
// var thisData = thirdOrderInfos.Where(x => x.ThirdOrderId == item.Id).ToList(); | |||
// item.ThirdOrderInfos= thisData; | |||
// } | |||
// return new PageUtil() | |||
// { | |||
// Data = data, | |||
// Total = total | |||
// }; | |||
// } | |||
// /// <summary> | |||
// /// 获取第三方订单详情 | |||
// /// </summary> | |||
// /// <param name="thirdOrderId"></param> | |||
// /// <returns></returns> | |||
// [HttpGet("/api/Order/GetThirdOrderInfo")] | |||
// public async Task<ThirdOrderDto> GetThirdOrderInfo(string thirdOrderId) | |||
// { | |||
// var data = await db.Queryable<BPA_ThirdOrder>() | |||
// .Where(x=>x.Id==thirdOrderId) | |||
// .OrderBy(a => a.CreateAt, OrderByType.Desc) | |||
// .Select(x => new ThirdOrderDto() | |||
// { | |||
// Id = x.Id.SelectAll() | |||
// }).FirstAsync(); | |||
// var thirdOrderInfos = await db.Queryable<BPA_ThirdOrderInfo>() | |||
// .Where(x => x.ThirdOrderId==thirdOrderId) | |||
// .ToListAsync(); | |||
// data.ThirdOrderInfos = thirdOrderInfos; | |||
// return data; | |||
// } | |||
// #endregion | |||
#endregion | |||
} | |||
} |
@@ -0,0 +1,14 @@ | |||
using BPA.SAAS.KitChenManageOrder.Application.BaseDto; | |||
using System; | |||
using System.Collections.Generic; | |||
using System.Linq; | |||
using System.Text; | |||
using System.Threading.Tasks; | |||
namespace BPA.SAAS.KitChenManageOrder.Application.Service.ThirdAuthorize.Dtos | |||
{ | |||
public class ThirdAuthorizeInfoDto: PageInputBase | |||
{ | |||
} | |||
} |
@@ -0,0 +1,14 @@ | |||
using BPA.SAAS.KitChenManageOrder.Core.Entity; | |||
using System; | |||
using System.Collections.Generic; | |||
using System.Linq; | |||
using System.Text; | |||
using System.Threading.Tasks; | |||
namespace BPA.SAAS.KitChenManageOrder.Application.Service.ThirdAuthorize | |||
{ | |||
public interface IThirdAuthorize | |||
{ | |||
Task<BPA_ShopAuthorize> GetStoreAuthorization(string key); | |||
} | |||
} |
@@ -0,0 +1,109 @@ | |||
using BPA.SAAS.KitChenManageOrder.Application.BaseDto; | |||
using BPA.SAAS.KitChenManageOrder.Application.Service.Order; | |||
using BPA.SAAS.KitChenManageOrder.Application.Service.Order.Dtos; | |||
using BPA.SAAS.KitChenManageOrder.Application.Service.ThirdAuthorize.Dtos; | |||
using BPA.SAAS.KitChenManageOrder.Core.Entity; | |||
using Furion.DependencyInjection; | |||
using Furion.DynamicApiController; | |||
using Furion.FriendlyException; | |||
using Microsoft.AspNetCore.Hosting; | |||
using Microsoft.AspNetCore.Mvc; | |||
using SqlSugar; | |||
using System; | |||
using System.Collections.Generic; | |||
using System.Linq; | |||
using System.Text; | |||
using System.Threading.Tasks; | |||
namespace BPA.SAAS.KitChenManageOrder.Application.Service.ThirdAuthorize | |||
{ | |||
[ApiDescriptionSettings("订单管理", Tag = "第三方授权", SplitCamelCase = false)] | |||
public class ThirdAuthorize : IDynamicApiController, ITransient, IThirdAuthorize | |||
{ | |||
private readonly ISqlSugarClient db; | |||
public ThirdAuthorize(IWebHostEnvironment hostingEnvironment, ISqlSugarClient _db) | |||
{ | |||
db = _db; | |||
} | |||
/// <summary> | |||
/// 获取第三方 | |||
/// </summary> | |||
/// <param name="inputDto"></param> | |||
/// <returns></returns> | |||
[HttpPost("/api/ThirdAuthorize/Page")] | |||
public async Task<PageUtil> Page(ThirdAuthorizeInfoDto inputDto) | |||
{ | |||
var total = new RefAsync<int>(); | |||
var data = await db.Queryable<BPA_ShopAuthorize>() | |||
.OrderBy(a => a.CreateAt, OrderByType.Desc) | |||
.ToPageListAsync(inputDto.Current, inputDto.PageSize, total); | |||
return new PageUtil() | |||
{ | |||
Data = data, | |||
Total = total | |||
}; | |||
} | |||
/// <summary> | |||
/// 创建 授权 | |||
/// </summary> | |||
/// <param name="inputDto"></param> | |||
/// <returns></returns> | |||
[HttpPost("/api/ThirdAuthorize/Create")] | |||
public async Task<bool> Create(BPA_ShopAuthorize inputDto) | |||
{ | |||
var data=await db.Queryable<BPA_ShopAuthorize>().Where(x=>x.StoreId==inputDto.StoreId).FirstAsync(); | |||
if (data != null) | |||
{ | |||
throw Oops.Oh($"店铺已授权"); | |||
} | |||
inputDto.AuthorizeCode=Guid.NewGuid().ToString(); | |||
var res=await db.Insertable(inputDto).ExecuteCommandAsync(); | |||
return res > 0; | |||
} | |||
/// <summary> | |||
/// 修改 重新赋值授权码 | |||
/// </summary> | |||
/// <param name="inputDto"></param> | |||
/// <returns></returns> | |||
[HttpPost("/api/ThirdAuthorize/Update")] | |||
public async Task<bool> Update(BPA_ShopAuthorize inputDto) | |||
{ | |||
var data = await db.Queryable<BPA_ShopAuthorize>().Where(x =>x.Id==inputDto.Id).FirstAsync(); | |||
data.AuthorizeCode = Guid.NewGuid().ToString(); | |||
var res=await db.Updateable(data).ExecuteCommandAsync(); | |||
return res > 0; | |||
} | |||
/// <summary> | |||
/// 修改 重新赋值授权码 | |||
/// </summary> | |||
/// <param name="inputDto"></param> | |||
/// <returns></returns> | |||
[HttpPost("/api/ThirdAuthorize/Del")] | |||
public async Task<bool> Del(string id) | |||
{ | |||
var res = await db.Deleteable<BPA_ShopAuthorize>() | |||
.Where(it => it.Id == id) | |||
.ExecuteCommandAsync(); | |||
return res > 0; | |||
} | |||
public async Task<BPA_ShopAuthorize> GetStoreAuthorization(string key) | |||
{ | |||
var data = await db.Queryable<BPA_ShopAuthorize>().FirstAsync(x => x.AuthorizeCode == key); | |||
if (data == null) | |||
{ | |||
throw Oops.Oh("授权信息不存在"); | |||
} | |||
return data; | |||
} | |||
} | |||
} |
@@ -0,0 +1,23 @@ | |||
<Project Sdk="Microsoft.NET.Sdk"> | |||
<PropertyGroup> | |||
<TargetFramework>net6.0</TargetFramework> | |||
<NoWarn>1701;1702;1591</NoWarn> | |||
<DocumentationFile>BPA.SAAS.KitChenManageOrder.Core.xml</DocumentationFile> | |||
</PropertyGroup> | |||
<ItemGroup> | |||
<None Remove="BPA.SAAS.KitChenManageOrder.Core.xml" /> | |||
</ItemGroup> | |||
<ItemGroup> | |||
<PackageReference Include="Furion.Extras.Authentication.JwtBearer" Version="4.8.8.5" /> | |||
<PackageReference Include="Furion.Extras.ObjectMapper.Mapster" Version="4.8.8.5" /> | |||
<PackageReference Include="Furion.Pure" Version="4.8.8.5" /> | |||
<PackageReference Include="SqlSugarCore" Version="5.1.4.67" /> | |||
</ItemGroup> | |||
</Project> |
@@ -0,0 +1,697 @@ | |||
<?xml version="1.0"?> | |||
<doc> | |||
<assembly> | |||
<name>BPA.SAAS.KitChenManageOrder.Core</name> | |||
</assembly> | |||
<members> | |||
<member name="F:BPA.SAAS.KitChenManageOrder.Core.Common.Const.ClaimConst.CLAINM_USERID"> | |||
<summary> | |||
用户Id | |||
</summary> | |||
</member> | |||
<member name="F:BPA.SAAS.KitChenManageOrder.Core.Common.Const.ClaimConst.CLAINM_ACCOUNT"> | |||
<summary> | |||
账号 | |||
</summary> | |||
</member> | |||
<member name="F:BPA.SAAS.KitChenManageOrder.Core.Common.Const.ClaimConst.CLAINM_NAME"> | |||
<summary> | |||
名称 | |||
</summary> | |||
</member> | |||
<member name="F:BPA.SAAS.KitChenManageOrder.Core.Common.Const.ClaimConst.CLAINM_SUPERADMIN"> | |||
<summary> | |||
是否超级管理 | |||
</summary> | |||
</member> | |||
<member name="F:BPA.SAAS.KitChenManageOrder.Core.Common.Const.ClaimConst.LoginType"> | |||
<summary> | |||
登录类型1平台用户登录,0加盟商登录 | |||
</summary> | |||
</member> | |||
<member name="F:BPA.SAAS.KitChenManageOrder.Core.Common.Const.ClaimConst.FranchID"> | |||
<summary> | |||
加盟商编号 | |||
</summary> | |||
</member> | |||
<member name="F:BPA.SAAS.KitChenManageOrder.Core.Common.Const.ClaimConst.FranchTel"> | |||
<summary> | |||
加盟商通知手机号 | |||
</summary> | |||
</member> | |||
<member name="F:BPA.SAAS.KitChenManageOrder.Core.Common.Const.ClaimConst.GroupId"> | |||
<summary> | |||
加盟商组id | |||
</summary> | |||
</member> | |||
<member name="F:BPA.SAAS.KitChenManageOrder.Core.Common.Const.ClaimConst.RoleId"> | |||
<summary> | |||
权限 | |||
</summary> | |||
</member> | |||
<member name="T:BPA.SAAS.KitChenManageOrder.Core.Common.CurrentUser"> | |||
<summary> | |||
当前用户 | |||
</summary> | |||
</member> | |||
<member name="M:BPA.SAAS.KitChenManageOrder.Core.Common.HttpHelper.HttpGet(System.String,System.String,System.Collections.Generic.Dictionary{System.String,System.String},System.String)"> | |||
<summary> | |||
Get 请求 | |||
</summary> | |||
<param name="url"></param> | |||
<param name="postDataStr"></param> | |||
<param name="headers"></param> | |||
<param name="platform"></param> | |||
<param name="contentType"></param> | |||
<returns></returns> | |||
</member> | |||
<member name="T:BPA.SAAS.KitChenManageOrder.Core.DbContext"> | |||
<summary> | |||
数据库上下文对象 | |||
</summary> | |||
</member> | |||
<member name="M:BPA.SAAS.KitChenManageOrder.Core.DbContext.AddSqlsugarSetup(Microsoft.Extensions.DependencyInjection.IServiceCollection,Microsoft.Extensions.Configuration.IConfiguration)"> | |||
<summary> | |||
SqlSugar 数据库实例 | |||
</summary> | |||
</member> | |||
<member name="M:BPA.SAAS.KitChenManageOrder.Core.DbContext.DataExecuting(SqlSugar.SqlSugarClient)"> | |||
<summary> | |||
附默认值 | |||
</summary> | |||
<param name="db"></param> | |||
</member> | |||
<member name="M:BPA.SAAS.KitChenManageOrder.Core.DbContext.InsertByObject(SqlSugar.DataFilterModel)"> | |||
<summary> | |||
插入数据时附默认值 | |||
</summary> | |||
<param name="entityInfo"></param> | |||
</member> | |||
<member name="T:BPA.SAAS.KitChenManageOrder.Core.Entity.Base.IBaseEntity"> | |||
<summary> | |||
基础类型 | |||
</summary> | |||
</member> | |||
<member name="P:BPA.SAAS.KitChenManageOrder.Core.Entity.Base.IBaseEntity.Id"> | |||
<summary> | |||
主键 Guid | |||
</summary> | |||
</member> | |||
<member name="T:BPA.SAAS.KitChenManageOrder.Core.Entity.Base.IBaseOPEntity"> | |||
<summary> | |||
修改人修改时间 | |||
</summary> | |||
</member> | |||
<member name="P:BPA.SAAS.KitChenManageOrder.Core.Entity.Base.IBaseOPEntity.IsDeleted"> | |||
<summary> | |||
删除标识 | |||
0=> 正常使用 | |||
1=> 已经被标记删除 | |||
</summary> | |||
</member> | |||
<member name="P:BPA.SAAS.KitChenManageOrder.Core.Entity.Base.IBaseOPEntity.DeleteAt"> | |||
<summary> | |||
删除时间 | |||
</summary> | |||
</member> | |||
<member name="P:BPA.SAAS.KitChenManageOrder.Core.Entity.Base.IBaseOPEntity.DeleteBy"> | |||
<summary> | |||
删除人 | |||
</summary> | |||
</member> | |||
<member name="P:BPA.SAAS.KitChenManageOrder.Core.Entity.Base.IBaseOPEntity.UpdateAt"> | |||
<summary> | |||
更新时间 | |||
</summary> | |||
</member> | |||
<member name="P:BPA.SAAS.KitChenManageOrder.Core.Entity.Base.IBaseOPEntity.UpdateBy"> | |||
<summary> | |||
更新人 | |||
</summary> | |||
</member> | |||
<member name="P:BPA.SAAS.KitChenManageOrder.Core.Entity.Base.IBaseOPEntity.CreateAt"> | |||
<summary> | |||
创建时间 | |||
</summary> | |||
</member> | |||
<member name="P:BPA.SAAS.KitChenManageOrder.Core.Entity.Base.IBaseOPEntity.CreateBy"> | |||
<summary> | |||
创建人 | |||
</summary> | |||
</member> | |||
<member name="M:BPA.SAAS.KitChenManageOrder.Core.Entity.Base.IBaseOPEntity.Create"> | |||
<summary> | |||
新增 | |||
</summary> | |||
</member> | |||
<member name="M:BPA.SAAS.KitChenManageOrder.Core.Entity.Base.IBaseOPEntity.Modify"> | |||
<summary> | |||
修改 | |||
</summary> | |||
</member> | |||
<member name="M:BPA.SAAS.KitChenManageOrder.Core.Entity.Base.IBaseOPEntity.Delete"> | |||
<summary> | |||
删除 | |||
</summary> | |||
</member> | |||
<member name="P:BPA.SAAS.KitChenManageOrder.Core.Entity.Base.IDeleted.IsDeleted"> | |||
<summary> | |||
是否删除 | |||
</summary> | |||
</member> | |||
<member name="T:BPA.SAAS.KitChenManageOrder.Core.Entity.Base.IEntity"> | |||
<summary> | |||
自定义实体基类 | |||
</summary> | |||
</member> | |||
<member name="P:BPA.SAAS.KitChenManageOrder.Core.Entity.Base.IEntity.Status"> | |||
<summary> | |||
状态 | |||
</summary> | |||
</member> | |||
<member name="P:BPA.SAAS.KitChenManageOrder.Core.Entity.BPA_Order.StoreId"> | |||
<summary> | |||
场景id | |||
</summary> | |||
</member> | |||
<member name="P:BPA.SAAS.KitChenManageOrder.Core.Entity.BPA_Order.TradeNo"> | |||
<summary> | |||
商户订单号,由商家自定义 | |||
</summary> | |||
</member> | |||
<member name="P:BPA.SAAS.KitChenManageOrder.Core.Entity.BPA_Order.OrderStatus"> | |||
<summary> | |||
订单状态 0成功 1失败 | |||
</summary> | |||
</member> | |||
<member name="P:BPA.SAAS.KitChenManageOrder.Core.Entity.BPA_Order.TotalAmount"> | |||
<summary> | |||
订单总金额 | |||
</summary> | |||
</member> | |||
<member name="P:BPA.SAAS.KitChenManageOrder.Core.Entity.BPA_Order.OrderCount"> | |||
<summary> | |||
订单数量 | |||
</summary> | |||
</member> | |||
<member name="P:BPA.SAAS.KitChenManageOrder.Core.Entity.BPA_Order.Subject"> | |||
<summary> | |||
订单标题 | |||
</summary> | |||
</member> | |||
<member name="P:BPA.SAAS.KitChenManageOrder.Core.Entity.BPA_OrderRefundLog.Id"> | |||
<summary> | |||
</summary> | |||
</member> | |||
<member name="P:BPA.SAAS.KitChenManageOrder.Core.Entity.BPA_OrderRefundLog.OrderNumber"> | |||
<summary> | |||
订单号(自己系统) | |||
</summary> | |||
</member> | |||
<member name="P:BPA.SAAS.KitChenManageOrder.Core.Entity.BPA_OrderRefundLog.TradeNo"> | |||
<summary> | |||
订单号(第三方) | |||
</summary> | |||
</member> | |||
<member name="P:BPA.SAAS.KitChenManageOrder.Core.Entity.BPA_OrderRefundLog.TransactionId"> | |||
<summary> | |||
交易号 | |||
</summary> | |||
</member> | |||
<member name="P:BPA.SAAS.KitChenManageOrder.Core.Entity.BPA_OrderRefundLog.ReturnId"> | |||
<summary> | |||
售后表Id(null表示为售前退款) | |||
</summary> | |||
</member> | |||
<member name="P:BPA.SAAS.KitChenManageOrder.Core.Entity.BPA_OrderRefundLog.OrderId"> | |||
<summary> | |||
主订单id | |||
</summary> | |||
</member> | |||
<member name="P:BPA.SAAS.KitChenManageOrder.Core.Entity.BPA_OrderRefundLog.SubOrderId"> | |||
<summary> | |||
子订单id | |||
</summary> | |||
</member> | |||
<member name="P:BPA.SAAS.KitChenManageOrder.Core.Entity.BPA_OrderRefundLog.RefundMoney"> | |||
<summary> | |||
退款金额() | |||
</summary> | |||
</member> | |||
<member name="P:BPA.SAAS.KitChenManageOrder.Core.Entity.BPA_OrderRefundLog.RefundType"> | |||
<summary> | |||
退款类型0:售前退款(商品未制作时退款) 1 售后退款 (商品已经开始进行制作) | |||
</summary> | |||
</member> | |||
<member name="P:BPA.SAAS.KitChenManageOrder.Core.Entity.BPA_OrderRefundLog.RefundResult"> | |||
<summary> | |||
退款结果 0 成功 1失败 | |||
</summary> | |||
</member> | |||
<member name="P:BPA.SAAS.KitChenManageOrder.Core.Entity.BPA_OrderRefundLog.RefundDesc"> | |||
<summary> | |||
退款描述 退款成功;账户余额不足;退款金额大于订单金额..etc | |||
</summary> | |||
</member> | |||
<member name="P:BPA.SAAS.KitChenManageOrder.Core.Entity.BPA_OrderRefundLog.RefundSource"> | |||
<summary> | |||
退款来源(退款到什么地方) 0微信 1支付宝 2 余额 | |||
</summary> | |||
</member> | |||
<member name="P:BPA.SAAS.KitChenManageOrder.Core.Entity.BPA_OrderRefundLog.RefundCallType"> | |||
<summary> | |||
退款调用方式 0 小程序调用退款 1 saas调用退款 2 第三方调用退款 4.POS | |||
</summary> | |||
</member> | |||
<member name="P:BPA.SAAS.KitChenManageOrder.Core.Entity.BPA_OrderRefundLog.RefundTime"> | |||
<summary> | |||
退款时间 | |||
</summary> | |||
</member> | |||
<member name="P:BPA.SAAS.KitChenManageOrder.Core.Entity.BPA_OrderRefundLog.CreatedAt"> | |||
<summary> | |||
创建于 | |||
</summary> | |||
</member> | |||
<member name="P:BPA.SAAS.KitChenManageOrder.Core.Entity.BPA_OrderRefundLog.CreatedBy"> | |||
<summary> | |||
创建人 | |||
</summary> | |||
</member> | |||
<member name="P:BPA.SAAS.KitChenManageOrder.Core.Entity.BPA_OrderRefundLog.UpdatedAt"> | |||
<summary> | |||
更新于 | |||
</summary> | |||
</member> | |||
<member name="P:BPA.SAAS.KitChenManageOrder.Core.Entity.BPA_OrderRefundLog.UpdatedBy"> | |||
<summary> | |||
更新人 | |||
</summary> | |||
</member> | |||
<member name="P:BPA.SAAS.KitChenManageOrder.Core.Entity.BPA_OrderRefundLog.Stutas"> | |||
<summary> | |||
退款状态 | |||
</summary> | |||
</member> | |||
<member name="F:BPA.SAAS.KitChenManageOrder.Core.Entity.RefundStatus.PartRefund"> | |||
<summary> | |||
申请部分退款 | |||
</summary> | |||
</member> | |||
<member name="F:BPA.SAAS.KitChenManageOrder.Core.Entity.RefundStatus.PartRefundWait"> | |||
<summary> | |||
部分退款处理中 | |||
</summary> | |||
</member> | |||
<member name="F:BPA.SAAS.KitChenManageOrder.Core.Entity.RefundStatus.PartRefundOk"> | |||
<summary> | |||
部分退款成功 | |||
</summary> | |||
</member> | |||
<member name="F:BPA.SAAS.KitChenManageOrder.Core.Entity.RefundStatus.PartRefundCancel"> | |||
<summary> | |||
取消部分退款 | |||
</summary> | |||
</member> | |||
<member name="F:BPA.SAAS.KitChenManageOrder.Core.Entity.RefundStatus.PartRefundError"> | |||
<summary> | |||
部分退款失败 | |||
</summary> | |||
</member> | |||
<member name="F:BPA.SAAS.KitChenManageOrder.Core.Entity.RefundStatus.FullRefund"> | |||
<summary> | |||
申请全额退款 | |||
</summary> | |||
</member> | |||
<member name="F:BPA.SAAS.KitChenManageOrder.Core.Entity.RefundStatus.FullRefundWait"> | |||
<summary> | |||
全额退款处理中 | |||
</summary> | |||
</member> | |||
<member name="F:BPA.SAAS.KitChenManageOrder.Core.Entity.RefundStatus.FullRefundOk"> | |||
<summary> | |||
全额退款成功 | |||
</summary> | |||
</member> | |||
<member name="F:BPA.SAAS.KitChenManageOrder.Core.Entity.RefundStatus.FullRefundCancel"> | |||
<summary> | |||
取消全额退款 | |||
</summary> | |||
</member> | |||
<member name="F:BPA.SAAS.KitChenManageOrder.Core.Entity.RefundStatus.FullRefundError"> | |||
<summary> | |||
全额退款失败 | |||
</summary> | |||
</member> | |||
<member name="P:BPA.SAAS.KitChenManageOrder.Core.Entity.BPA_SubOrder.OrderId"> | |||
<summary> | |||
主订单表Id | |||
</summary> | |||
</member> | |||
<member name="P:BPA.SAAS.KitChenManageOrder.Core.Entity.BPA_SubOrder.GoodsId"> | |||
<summary> | |||
商品表Id | |||
</summary> | |||
</member> | |||
<member name="P:BPA.SAAS.KitChenManageOrder.Core.Entity.BPA_SubOrder.isCustom"> | |||
<summary> | |||
是否自定义配方 | |||
</summary> | |||
</member> | |||
<member name="P:BPA.SAAS.KitChenManageOrder.Core.Entity.BPA_SubOrder.GoodsNumber"> | |||
<summary> | |||
商品编号(第三方商品编号) | |||
</summary> | |||
</member> | |||
<member name="T:BPA.SAAS.KitChenManageOrder.Core.Enum.AccountType"> | |||
<summary> | |||
分账账户类型 | |||
</summary> | |||
</member> | |||
<member name="F:BPA.SAAS.KitChenManageOrder.Core.Enum.AccountType.MERCHANT"> | |||
<summary> | |||
商户 | |||
</summary> | |||
</member> | |||
<member name="F:BPA.SAAS.KitChenManageOrder.Core.Enum.AccountType.PERSONAL"> | |||
<summary> | |||
个人 | |||
</summary> | |||
</member> | |||
<member name="T:BPA.SAAS.KitChenManageOrder.Core.Enum.CommonStatus"> | |||
<summary> | |||
公共状态 | |||
</summary> | |||
</member> | |||
<member name="F:BPA.SAAS.KitChenManageOrder.Core.Enum.CommonStatus.ENABLE"> | |||
<summary> | |||
正常 | |||
</summary> | |||
</member> | |||
<member name="F:BPA.SAAS.KitChenManageOrder.Core.Enum.CommonStatus.DISABLE"> | |||
<summary> | |||
停用 | |||
</summary> | |||
</member> | |||
<member name="F:BPA.SAAS.KitChenManageOrder.Core.Enum.CommonStatus.DELETED"> | |||
<summary> | |||
删除 | |||
</summary> | |||
</member> | |||
<member name="F:BPA.SAAS.KitChenManageOrder.Core.Enum.MenuTypeEnums.Handle"> | |||
<summary> | |||
数据操作类型 | |||
</summary> | |||
</member> | |||
<member name="F:BPA.SAAS.KitChenManageOrder.Core.Enum.MenuTypeEnums.Normal"> | |||
<summary> | |||
普通菜单 | |||
</summary> | |||
</member> | |||
<member name="T:BPA.SAAS.KitChenManageOrder.Core.Enum.AdminEnums"> | |||
<summary> | |||
账号类型 | |||
</summary> | |||
</member> | |||
<member name="F:BPA.SAAS.KitChenManageOrder.Core.Enum.AdminEnums.SuperAdmin"> | |||
<summary> | |||
超级管理员 | |||
</summary> | |||
</member> | |||
<member name="F:BPA.SAAS.KitChenManageOrder.Core.Enum.AdminEnums.Admin"> | |||
<summary> | |||
管理员 | |||
</summary> | |||
</member> | |||
<member name="F:BPA.SAAS.KitChenManageOrder.Core.Enum.AdminEnums.None"> | |||
<summary> | |||
普通账号 | |||
</summary> | |||
</member> | |||
<member name="T:BPA.SAAS.KitChenManageOrder.Core.Enum.PlatformType"> | |||
<summary> | |||
会员平台 | |||
</summary> | |||
</member> | |||
<member name="F:BPA.SAAS.KitChenManageOrder.Core.Enum.PlatformType.Default"> | |||
<summary> | |||
默认 | |||
</summary> | |||
</member> | |||
<member name="F:BPA.SAAS.KitChenManageOrder.Core.Enum.PlatformType.WeChat"> | |||
<summary> | |||
微信 | |||
</summary> | |||
</member> | |||
<member name="F:BPA.SAAS.KitChenManageOrder.Core.Enum.PlatformType.Alipay"> | |||
<summary> | |||
支付宝 | |||
</summary> | |||
</member> | |||
<member name="F:BPA.SAAS.KitChenManageOrder.Core.Enum.PlatformType.POS"> | |||
<summary> | |||
POS | |||
</summary> | |||
</member> | |||
<member name="F:BPA.SAAS.KitChenManageOrder.Core.Enum.PlatformType.Card"> | |||
<summary> | |||
card | |||
</summary> | |||
</member> | |||
<member name="F:BPA.SAAS.KitChenManageOrder.Core.Enum.DataScopeType.ALL"> | |||
<summary> | |||
全部数据 | |||
</summary> | |||
</member> | |||
<member name="F:BPA.SAAS.KitChenManageOrder.Core.Enum.DataScopeType.DEPT_WITH_CHILD"> | |||
<summary> | |||
本部门及以下数据 | |||
</summary> | |||
</member> | |||
<member name="F:BPA.SAAS.KitChenManageOrder.Core.Enum.DataScopeType.DEPT"> | |||
<summary> | |||
本部门数据 | |||
</summary> | |||
</member> | |||
<member name="F:BPA.SAAS.KitChenManageOrder.Core.Enum.DataScopeType.SELF"> | |||
<summary> | |||
仅本人数据 | |||
</summary> | |||
</member> | |||
<member name="F:BPA.SAAS.KitChenManageOrder.Core.Enum.DataScopeType.DEFINE"> | |||
<summary> | |||
自定义数据 | |||
</summary> | |||
</member> | |||
<member name="T:BPA.SAAS.KitChenManageOrder.Core.Enum.GoodsAttribute"> | |||
<summary> | |||
商品属性 | |||
</summary> | |||
</member> | |||
<member name="F:BPA.SAAS.KitChenManageOrder.Core.Enum.GoodsAttribute.SingleGoods"> | |||
<summary> | |||
单品 | |||
</summary> | |||
</member> | |||
<member name="F:BPA.SAAS.KitChenManageOrder.Core.Enum.GoodsAttribute.ComboGoods"> | |||
<summary> | |||
套餐 | |||
</summary> | |||
</member> | |||
<member name="T:BPA.SAAS.KitChenManageOrder.Core.Enum.IntegralEnum.IntegSourceType"> | |||
<summary> | |||
积分增加/减少类型 | |||
</summary> | |||
</member> | |||
<member name="T:BPA.SAAS.KitChenManageOrder.Core.Enum.IntegralEnum.allTypes"> | |||
<summary> | |||
小类方案类型 | |||
</summary> | |||
</member> | |||
<member name="T:BPA.SAAS.KitChenManageOrder.Core.Enum.MenuOpenType"> | |||
<summary> | |||
系统菜单类型 | |||
</summary> | |||
</member> | |||
<member name="F:BPA.SAAS.KitChenManageOrder.Core.Enum.MenuOpenType.NONE"> | |||
<summary> | |||
无 | |||
</summary> | |||
</member> | |||
<member name="F:BPA.SAAS.KitChenManageOrder.Core.Enum.MenuOpenType.COMPONENT"> | |||
<summary> | |||
组件 | |||
</summary> | |||
</member> | |||
<member name="F:BPA.SAAS.KitChenManageOrder.Core.Enum.MenuOpenType.INNER"> | |||
<summary> | |||
内链 | |||
</summary> | |||
</member> | |||
<member name="F:BPA.SAAS.KitChenManageOrder.Core.Enum.MenuOpenType.OUTER"> | |||
<summary> | |||
外链 | |||
</summary> | |||
</member> | |||
<member name="F:BPA.SAAS.KitChenManageOrder.Core.Enum.MenuType.DIR"> | |||
<summary> | |||
目录 | |||
</summary> | |||
</member> | |||
<member name="F:BPA.SAAS.KitChenManageOrder.Core.Enum.MenuType.MENU"> | |||
<summary> | |||
菜单 | |||
</summary> | |||
</member> | |||
<member name="F:BPA.SAAS.KitChenManageOrder.Core.Enum.MenuType.BTN"> | |||
<summary> | |||
按钮 | |||
</summary> | |||
</member> | |||
<member name="F:BPA.SAAS.KitChenManageOrder.Core.Enum.OrgType.ORG"> | |||
<summary> | |||
机构部门 | |||
</summary> | |||
</member> | |||
<member name="F:BPA.SAAS.KitChenManageOrder.Core.Enum.OrgType.DEVLIVERY"> | |||
<summary> | |||
配送中心 | |||
</summary> | |||
</member> | |||
<member name="F:BPA.SAAS.KitChenManageOrder.Core.Enum.OrgType.STORE"> | |||
<summary> | |||
门店 | |||
</summary> | |||
</member> | |||
<member name="F:BPA.SAAS.KitChenManageOrder.Core.Enum.OrgType.FranchiseeSTORE"> | |||
<summary> | |||
门店 | |||
</summary> | |||
</member> | |||
<member name="F:BPA.SAAS.KitChenManageOrder.Core.Enum.SRDUserType.USER"> | |||
<summary> | |||
人员 | |||
</summary> | |||
</member> | |||
<member name="F:BPA.SAAS.KitChenManageOrder.Core.Enum.SRDUserType.USERTYPE"> | |||
<summary> | |||
人员分类 | |||
</summary> | |||
</member> | |||
<member name="F:BPA.SAAS.KitChenManageOrder.Core.Enum.RSDGroupType.RSD"> | |||
<summary> | |||
设备 | |||
</summary> | |||
</member> | |||
<member name="F:BPA.SAAS.KitChenManageOrder.Core.Enum.RSDGroupType.RSDGROUP"> | |||
<summary> | |||
设备分组 | |||
</summary> | |||
</member> | |||
<member name="F:BPA.SAAS.KitChenManageOrder.Core.Enum.StatusEntity.ENABLE"> | |||
<summary> | |||
正常 | |||
</summary> | |||
</member> | |||
<member name="F:BPA.SAAS.KitChenManageOrder.Core.Enum.StatusEntity.DISABLE"> | |||
<summary> | |||
停用 | |||
</summary> | |||
</member> | |||
<member name="F:BPA.SAAS.KitChenManageOrder.Core.Enum.TransactionType.Recharge"> | |||
<summary> | |||
充值 | |||
</summary> | |||
</member> | |||
<member name="F:BPA.SAAS.KitChenManageOrder.Core.Enum.TransactionType.Consume"> | |||
<summary> | |||
消费 | |||
</summary> | |||
</member> | |||
<member name="F:BPA.SAAS.KitChenManageOrder.Core.Enum.TransactionType.Refund"> | |||
<summary> | |||
退款 | |||
</summary> | |||
</member> | |||
<member name="M:BPA.SAAS.KitChenManageOrder.Core.SqlSugarDb.TableFilterItem(SqlSugar.SqlSugarClient)"> | |||
<summary> | |||
全局过滤 | |||
</summary> | |||
</member> | |||
<member name="M:BPA.SAAS.KitChenManageOrder.Core.SqlSugarDb.DataExecuting(SqlSugar.SqlSugarClient)"> | |||
<summary> | |||
附默认值 | |||
</summary> | |||
<param name="db"></param> | |||
</member> | |||
<member name="M:BPA.SAAS.KitChenManageOrder.Core.SqlSugarDb.InsertByObject(SqlSugar.DataFilterModel)"> | |||
<summary> | |||
插入数据时附默认值 | |||
</summary> | |||
<param name="entityInfo"></param> | |||
</member> | |||
<member name="M:BPA.SAAS.KitChenManageOrder.Core.SqlSugarDb.UpdateByObject(System.Object,SqlSugar.DataFilterModel)"> | |||
<summary> | |||
修改数据时附默认值 | |||
</summary> | |||
<param name="oldValue"></param> | |||
<param name="entityInfo"></param> | |||
</member> | |||
<member name="P:BPA.Kitchen.Core.RabbitMq.Config.AcceptEntity.QueeName"> | |||
<summary> | |||
队列名称 | |||
</summary> | |||
</member> | |||
<member name="P:BPA.Kitchen.Core.RabbitMq.Config.AcceptEntity.SendType"> | |||
<summary> | |||
推送模式 | |||
</summary> | |||
</member> | |||
<member name="P:BPA.Kitchen.Core.RabbitMq.Config.AcceptEntity.ExchangeName"> | |||
<summary> | |||
管道名称 | |||
</summary> | |||
</member> | |||
<member name="P:BPA.Kitchen.Core.RabbitMq.Config.AcceptEntity.RouteName"> | |||
<summary> | |||
路由名称 | |||
</summary> | |||
</member> | |||
<member name="F:BPA.Kitchen.Core.RabbitMq.Config.MQEnum.Sub"> | |||
<summary> | |||
订阅模式 | |||
</summary> | |||
</member> | |||
<member name="F:BPA.Kitchen.Core.RabbitMq.Config.MQEnum.Push"> | |||
<summary> | |||
推送模式 | |||
</summary> | |||
</member> | |||
<member name="F:BPA.Kitchen.Core.RabbitMq.Config.MQEnum.Top"> | |||
<summary> | |||
主路由模式 | |||
</summary> | |||
</member> | |||
<member name="P:BPA.Kitchen.Core.RabbitMq.Config.PushEntity`1.BodyData"> | |||
<summary> | |||
推送内容 | |||
</summary> | |||
</member> | |||
<member name="P:BPA.Kitchen.Core.RabbitMq.Config.PushEntity`1.SendType"> | |||
<summary> | |||
推送模式 | |||
</summary> | |||
</member> | |||
<member name="P:BPA.Kitchen.Core.RabbitMq.Config.PushEntity`1.ExchangeName"> | |||
<summary> | |||
管道名称 | |||
</summary> | |||
</member> | |||
<member name="P:BPA.Kitchen.Core.RabbitMq.Config.PushEntity`1.RouteName"> | |||
<summary> | |||
路由名称 | |||
</summary> | |||
</member> | |||
</members> | |||
</doc> |
@@ -0,0 +1,57 @@ | |||
using System; | |||
using System.Collections.Generic; | |||
using System.Linq; | |||
using System.Text; | |||
using System.Threading.Tasks; | |||
namespace BPA.SAAS.KitChenManageOrder.Core.Common.Const | |||
{ | |||
public class ClaimConst | |||
{ | |||
/// <summary> | |||
/// 用户Id | |||
/// </summary> | |||
public const string CLAINM_USERID = "UserId"; | |||
/// <summary> | |||
/// 账号 | |||
/// </summary> | |||
public const string CLAINM_ACCOUNT = "Account"; | |||
/// <summary> | |||
/// 名称 | |||
/// </summary> | |||
public const string CLAINM_NAME = "Name"; | |||
/// <summary> | |||
/// 是否超级管理 | |||
/// </summary> | |||
public const string CLAINM_SUPERADMIN = "SuperAdmin"; | |||
/// <summary> | |||
/// 登录类型1平台用户登录,0加盟商登录 | |||
/// </summary> | |||
public const string LoginType = "LoginType"; | |||
/// <summary> | |||
/// 加盟商编号 | |||
/// </summary> | |||
public const string FranchID = "FranchID"; | |||
/// <summary> | |||
/// 加盟商通知手机号 | |||
/// </summary> | |||
public const string FranchTel = "18782023833"; | |||
/// <summary> | |||
/// 加盟商组id | |||
/// </summary> | |||
public const string GroupId = "GroupId"; | |||
/// <summary> | |||
/// 权限 | |||
/// </summary> | |||
public const string RoleId = "RoleId"; | |||
public const string OrgId = ""; | |||
public const string SupplyPlatformId = "SupplyPlatformId"; | |||
} | |||
} |
@@ -0,0 +1,14 @@ | |||
| |||
using System; | |||
using System.Collections.Generic; | |||
using System.Linq; | |||
using System.Text; | |||
using System.Threading.Tasks; | |||
namespace BPA.SAAS.KitChenManageOrder.Core.Common | |||
{ | |||
public class CosConfig | |||
{ | |||
public static CosInfoOptions cosInfoOptions; | |||
} | |||
} |
@@ -0,0 +1,26 @@ | |||
using Furion.ConfigurableOptions; | |||
using System; | |||
using System.Collections.Generic; | |||
using System.Linq; | |||
using System.Text; | |||
using System.Threading.Tasks; | |||
namespace BPA.SAAS.KitChenManageOrder.Core.Common | |||
{ | |||
public class CosInfoOptions : IConfigurableOptions | |||
{ | |||
public string AppId { get; set; } | |||
public string Region { get; set; } | |||
public string Bucket { get; set; } | |||
public string SecretId { get; set; } | |||
public string SecretKey { get; set; } | |||
public CosInfoOptions(string appid, string region, string bucket, string secretId, string secretKey) | |||
{ | |||
AppId = appid; | |||
Region = region; | |||
Bucket = bucket; | |||
SecretId = secretId; | |||
SecretKey = secretKey; | |||
} | |||
} | |||
} |
@@ -0,0 +1,25 @@ | |||
using BPA.SAAS.KitChenManageOrder.Core.Common.Const; | |||
using Furion; | |||
using System; | |||
using System.Collections.Generic; | |||
using System.Linq; | |||
using System.Security.Claims; | |||
using System.Text; | |||
using System.Threading.Tasks; | |||
namespace BPA.SAAS.KitChenManageOrder.Core.Common | |||
{ | |||
/// <summary> | |||
/// 当前用户 | |||
/// </summary> | |||
public class CurrentUser | |||
{ | |||
public static string? UserId => App.User?.FindFirst(ClaimConst.CLAINM_USERID)?.Value; | |||
public static string? TenantId => App.User?.FindFirst(ClaimConst.GroupId)?.Value; | |||
public static string? Account => App.User?.FindFirst(ClaimConst.CLAINM_ACCOUNT)?.Value; | |||
public static string? RoleId => App.User?.FindFirst(ClaimConst.RoleId)?.Value; | |||
} | |||
} |
@@ -0,0 +1,97 @@ | |||
using Furion; | |||
using Furion.FriendlyException; | |||
using System; | |||
using System.Collections.Generic; | |||
using System.IO; | |||
using System.Linq; | |||
using System.Net; | |||
using System.Net.Http; | |||
using System.Reflection.PortableExecutable; | |||
using System.Security.Policy; | |||
using System.Text; | |||
using System.Threading.Tasks; | |||
namespace BPA.SAAS.KitChenManageOrder.Core.Common | |||
{ | |||
public static class HttpHelper | |||
{ | |||
private static readonly HttpClient client = new HttpClient(); | |||
/// <summary> | |||
/// Get 请求 | |||
/// </summary> | |||
/// <param name="url"></param> | |||
/// <param name="postDataStr"></param> | |||
/// <param name="headers"></param> | |||
/// <param name="platform"></param> | |||
/// <param name="contentType"></param> | |||
/// <returns></returns> | |||
public static string HttpGet(string url, string postDataStr, Dictionary<string, string> headers, string contentType = "") | |||
{ | |||
var result = string.Empty; | |||
try | |||
{ | |||
HttpWebRequest request = (HttpWebRequest)WebRequest.Create(url + postDataStr); | |||
request.ServicePoint.Expect100Continue = false; //加了这一行代码 就OK了 | |||
request.Method = "GET"; | |||
request.ContentType = contentType; | |||
foreach (KeyValuePair<string, string> kv in headers) | |||
{ | |||
request.Headers.Add(kv.Key, kv.Value); | |||
} | |||
HttpWebResponse response = (HttpWebResponse)request.GetResponse(); | |||
Stream myResponseStream = response.GetResponseStream(); | |||
StreamReader myStreamReader = new StreamReader(myResponseStream, Encoding.GetEncoding("utf-8")); | |||
result = myStreamReader.ReadToEnd(); | |||
myStreamReader.Close(); | |||
myResponseStream.Close(); | |||
} | |||
catch (Exception ex) | |||
{ | |||
throw Oops.Oh( ex.Message); | |||
} | |||
return result; | |||
} | |||
public static string PostData(string url, string postData, Encoding encoding, string ContentType, Dictionary<string, string> headers) | |||
{ | |||
try | |||
{ | |||
HttpWebRequest myReq = (HttpWebRequest)HttpWebRequest.Create(url); | |||
myReq.Method = "POST"; | |||
myReq.Timeout = 600 * 60; | |||
byte[] byteArray = encoding.GetBytes(postData); | |||
myReq.ContentType = ContentType; | |||
//对键值对进行遍历 | |||
foreach (KeyValuePair<string, string> kv in headers) | |||
{ | |||
myReq.Headers.Add(kv.Key, kv.Value); | |||
} | |||
Stream dataStream = myReq.GetRequestStream(); | |||
dataStream.Write(byteArray, 0, byteArray.Length); | |||
dataStream.Close(); | |||
HttpWebResponse HttpWResp = (HttpWebResponse)myReq.GetResponse(); | |||
dataStream = HttpWResp.GetResponseStream(); | |||
string result = ""; | |||
using (StreamReader myStreamReader = new StreamReader(dataStream, encoding)) | |||
{ | |||
result = myStreamReader.ReadToEnd(); | |||
myStreamReader.Close(); | |||
} | |||
dataStream.Close(); | |||
HttpWResp.Close(); | |||
return result; | |||
} | |||
catch (System.Exception ex) | |||
{ | |||
throw ex; | |||
} | |||
} | |||
} | |||
} |
@@ -0,0 +1,28 @@ | |||
using System; | |||
using System.Collections.Generic; | |||
using System.Linq; | |||
using System.Text; | |||
using System.Threading.Tasks; | |||
namespace BPA.Kitchen.Core.RabbitMq.Config | |||
{ | |||
public class AcceptEntity | |||
{ | |||
/// <summary> | |||
/// 队列名称 | |||
/// </summary> | |||
public String QueeName { get; set; } | |||
/// <summary> | |||
/// 推送模式 | |||
/// </summary> | |||
public MQEnum SendType { get; set; } | |||
/// <summary> | |||
/// 管道名称 | |||
/// </summary> | |||
public String ExchangeName { get; set; } | |||
/// <summary> | |||
/// 路由名称 | |||
/// </summary> | |||
public String RouteName { get; set; } | |||
} | |||
} |
@@ -0,0 +1,13 @@ | |||
using System; | |||
using System.Collections.Generic; | |||
using System.Linq; | |||
using System.Text; | |||
using System.Threading.Tasks; | |||
namespace BPA.Kitchen.Core.RabbitMq.Config | |||
{ | |||
public interface IAccept | |||
{ | |||
void AcceptMQ<T>(string msg); | |||
} | |||
} |
@@ -0,0 +1,26 @@ | |||
using System; | |||
using System.Collections.Generic; | |||
using System.ComponentModel; | |||
using System.Text; | |||
namespace BPA.Kitchen.Core.RabbitMq.Config | |||
{ | |||
public enum MQEnum | |||
{ | |||
/// <summary> | |||
/// 订阅模式 | |||
/// </summary> | |||
[Description("订阅模式")] | |||
Sub = 10, | |||
/// <summary> | |||
/// 推送模式 | |||
/// </summary> | |||
[Description("推送模式")] | |||
Push = 20, | |||
/// <summary> | |||
/// 主路由模式 | |||
/// </summary> | |||
[Description("主路由模式")] | |||
Top = 30 | |||
} | |||
} |
@@ -0,0 +1,111 @@ | |||
| |||
//using EasyNetQ; | |||
using System; | |||
using System.Collections.Generic; | |||
using System.Linq.Expressions; | |||
using System.Text; | |||
using System.Threading.Tasks; | |||
using System.Linq.Expressions; | |||
namespace BPA.Kitchen.Core.RabbitMq.Config | |||
{ | |||
//public class MQFactory | |||
//{ | |||
// private volatile static IBus Bus = null; | |||
// /// <summary> | |||
// /// 创建链接 | |||
// /// </summary> | |||
// /// <returns></returns> | |||
// public static IBus CreateMQ() | |||
// { | |||
// Console.WriteLine("MQ地址:" + Furion.App.Configuration["RabbitMQ"].ToString()); | |||
// if (Bus == null) | |||
// Bus = RabbitHutch.CreateBus(Furion.App.Configuration["RabbitMQ"].ToString()); | |||
// return Bus; | |||
// } | |||
// /// <summary> | |||
// /// 释放链接 | |||
// /// </summary> | |||
// public static void DisposeBus() | |||
// { | |||
// Bus?.Dispose(); | |||
// } | |||
// /// <summary> | |||
// /// 同步执行 | |||
// /// </summary> | |||
// /// <typeparam name="T"></typeparam> | |||
// /// <param name="Param"></param> | |||
// /// <returns></returns> | |||
// public static bool SendMQ<T>(PushEntity<T> Param) | |||
// { | |||
// try | |||
// { | |||
// if (Bus == null) | |||
// CreateMQ(); | |||
// new PushManage().SendMQ(Param, Bus); | |||
// return true; | |||
// } | |||
// catch (Exception ex) | |||
// { | |||
// Console.WriteLine(ex); | |||
// //BPALog.WriteLog(ex.Message, LogEnum.Error, ex: ex); | |||
// return false; | |||
// } | |||
// } | |||
// /// <summary> | |||
// /// 推荐异步执行 | |||
// /// </summary> | |||
// /// <typeparam name="T"></typeparam> | |||
// /// <param name="Param"></param> | |||
// /// <returns></returns> | |||
// public static async Task SendMQAsync<T>(PushEntity<T> Param) where T : class | |||
// { | |||
// if (Bus == null) | |||
// CreateMQ(); | |||
// await new PushManage().SendMQAsync(Param, Bus); | |||
// } | |||
// /// <summary> | |||
// /// 订阅消息 | |||
// /// </summary> | |||
// /// <typeparam name="TAccept"></typeparam> | |||
// /// <param name="Args"></param> | |||
// public static void Subscriber<TAccept, T>(AcceptEntity Args) where TAccept : IAccept, new() where T : new() | |||
// { | |||
// //if (Bus == null) | |||
// // CreateMQ(); | |||
// //if (string.IsNullOrEmpty(Args.ExchangeName)) | |||
// // return; | |||
// //Expression<Action<IAccept>> methodCall; | |||
// //IExchange EX = null; | |||
// //if (Args.SendType == MQEnum.Sub) | |||
// //{ | |||
// // EX = Bus.Advanced.ExchangeDeclare(Args.ExchangeName, ExchangeType.Fanout); | |||
// //} | |||
// //if (Args.SendType == MQEnum.Push) | |||
// //{ | |||
// // EX = Bus.Advanced.ExchangeDeclare(Args.ExchangeName, ExchangeType.Direct); | |||
// //} | |||
// //if (Args.SendType == MQEnum.Top) | |||
// //{ | |||
// // EX = Bus.Advanced.ExchangeDeclare(Args.ExchangeName, ExchangeType.Topic); | |||
// //} | |||
// //IQueue queue = Bus.Advanced.QueueDeclare(Args.QueeName ?? null); | |||
// //Bus.Advanced.Bind(EX, queue, Args.RouteName); | |||
// //Bus.Advanced.Consume(queue, (body, properties, info) => Task.Factory.StartNew(() => | |||
// //{ | |||
// // try | |||
// // { | |||
// // var message = Encoding.UTF8.GetString(body); | |||
// // //处理消息 | |||
// // methodCall = job => job.AcceptMQ<T>(message); | |||
// // methodCall.Compile()(new TAccept()); | |||
// // } | |||
// // catch (Exception ex) | |||
// // { | |||
// // throw ex; | |||
// // } | |||
// //})); | |||
// } | |||
//} | |||
} |
@@ -0,0 +1,26 @@ | |||
using System; | |||
using System.Collections.Generic; | |||
using System.Text; | |||
namespace BPA.Kitchen.Core.RabbitMq.Config | |||
{ | |||
public class PushEntity<T> | |||
{ | |||
/// <summary> | |||
/// 推送内容 | |||
/// </summary> | |||
public T BodyData { get; set; } | |||
/// <summary> | |||
/// 推送模式 | |||
/// </summary> | |||
public MQEnum SendType { get; set; } | |||
/// <summary> | |||
/// 管道名称 | |||
/// </summary> | |||
public String ExchangeName { get; set; } | |||
/// <summary> | |||
/// 路由名称 | |||
/// </summary> | |||
public String RouteName { get; set; } | |||
} | |||
} |
@@ -0,0 +1,81 @@ | |||
//using EasyNetQ; | |||
//using EasyNetQ.Topology; | |||
using System; | |||
using System.Collections.Generic; | |||
using System.Text; | |||
using Newtonsoft.Json; | |||
using System.Threading.Tasks; | |||
namespace BPA.Kitchen.Core.RabbitMq.Config | |||
{ | |||
//public class PushManage | |||
//{ | |||
// /// <summary> | |||
// /// 发布消息队列异步 | |||
// /// </summary> | |||
// /// <typeparam name="T"></typeparam> | |||
// /// <param name="Param"></param> | |||
// /// <param name="Bus"></param> | |||
// /// <returns></returns> | |||
// public async Task SendMQAsync<T>(PushEntity<T> Param, IBus Bus) | |||
// { | |||
// ////one to one | |||
// //var msg = new Message<T>(Param.BodyData); | |||
// //IExchange EX = null; | |||
// //if (Param.SendType == MQEnum.Sub) | |||
// //{ | |||
// // EX = Bus.Advanced.ExchangeDeclare(Param.ExchangeName, ExchangeType.Fanout); | |||
// //} | |||
// //if (Param.SendType == MQEnum.Push) | |||
// //{ | |||
// // EX = Bus.Advanced.ExchangeDeclare(Param.ExchangeName, ExchangeType.Direct); | |||
// //} | |||
// //if (Param.SendType == MQEnum.Top) | |||
// //{ | |||
// // EX = Bus.Advanced.ExchangeDeclare(Param.ExchangeName, ExchangeType.Topic); | |||
// //} | |||
// //await Bus.Advanced.PublishAsync(EX, Param.RouteName, false, msg).ContinueWith(t => | |||
// //{ | |||
// // //消息投递失败 | |||
// // if (!t.IsCompleted && t.IsFaulted) | |||
// // { | |||
// // // //将消息记录到数据库轮询 | |||
// // // IRepository Repository = new Repository(); | |||
// // // SystemLog Log = new SystemLog | |||
// // // { | |||
// // // LogName = "消息队列", | |||
// // // Source = "发布队列", | |||
// // // EventData = JsonConvert.SerializeObject(Param.BodyData) | |||
// // // }; | |||
// // // Repository.Insert(Log); | |||
// // } | |||
// //}); | |||
// } | |||
// /// <summary> | |||
// /// 发布消息队列同步 | |||
// /// </summary> | |||
// /// <typeparam name="T"></typeparam> | |||
// /// <param name="Param"></param> | |||
// /// <param name="Bus"></param> | |||
// public void SendMQ<T>(PushEntity<T> Param, IBus Bus) | |||
// { | |||
// ////one to one | |||
// //var msg = new Message<T>(Param.BodyData); | |||
// //IExchange EX = null; | |||
// //if (Param.SendType == MQEnum.Sub) | |||
// //{ | |||
// // EX = Bus.Advanced.ExchangeDeclare(Param.ExchangeName, ExchangeType.Fanout); | |||
// //} | |||
// //if (Param.SendType == MQEnum.Push) | |||
// //{ | |||
// // EX = Bus.Advanced.ExchangeDeclare(Param.ExchangeName, ExchangeType.Direct); | |||
// //} | |||
// //if (Param.SendType == MQEnum.Top) | |||
// //{ | |||
// // EX = Bus.Advanced.ExchangeDeclare(Param.ExchangeName, ExchangeType.Topic); | |||
// //} | |||
// //Bus.Advanced.Publish(EX, Param.RouteName, false, msg); | |||
// } | |||
//} | |||
} |
@@ -0,0 +1,74 @@ | |||
using BPA.Kitchen.Core.RabbitMq.Config; | |||
using System; | |||
using System.Collections.Generic; | |||
using System.Linq.Expressions; | |||
using System.Text; | |||
using System.Threading.Tasks; | |||
namespace BPA.Kitchen.Core.RabbitMq.Publisher | |||
{ | |||
public class ServiceQueryPush | |||
{ | |||
public static ServiceQueryPush QueryPush => new Lazy<ServiceQueryPush>().Value; | |||
public async Task<bool> PushMQAsync<T>(T Entity,string Key, MQEnum MQType = MQEnum.Push) where T : class, new() | |||
{ | |||
//推送模式 | |||
//推送模式下需指定管道名称和路由键值名称 | |||
//消息只会被发送到指定的队列中去 | |||
//订阅模式 | |||
//订阅模式下只需指定管道名称 | |||
//消息会被发送到该管道下的所有队列中 | |||
//主题路由模式 | |||
//路由模式下需指定管道名称和路由值 | |||
//消息会被发送到该管道下,和路由值匹配的队列中去 | |||
PushEntity<T> entity = new PushEntity<T>(); | |||
entity.BodyData = Entity; | |||
entity.SendType = MQType; | |||
if (MQType == MQEnum.Push) | |||
{ | |||
entity.ExchangeName = "Message.Direct"; | |||
entity.RouteName = Key; | |||
} | |||
else if (MQType == MQEnum.Sub) | |||
{ | |||
entity.ExchangeName = "Message.Fanout"; | |||
} | |||
else | |||
{ | |||
entity.ExchangeName = "Message.Topic"; | |||
entity.RouteName = Key; | |||
} | |||
return true;// await MQFactory.SendMQAsync(entity).ContinueWith(t => { return t.IsCompleted ? true : false; }); | |||
} | |||
public bool PushMQ<T>(T Entity, string Key, MQEnum MQType = MQEnum.Push) | |||
{ | |||
//推送模式 | |||
//推送模式下需指定管道名称和路由键值名称 | |||
//消息只会被发送到指定的队列中去 | |||
//订阅模式 | |||
//订阅模式下只需指定管道名称 | |||
//消息会被发送到该管道下的所有队列中 | |||
//主题路由模式 | |||
//路由模式下需指定管道名称和路由值 | |||
//消息会被发送到该管道下,和路由值匹配的队列中去 | |||
PushEntity<T> entity = new PushEntity<T>(); | |||
entity.BodyData = Entity; | |||
entity.SendType = MQType; | |||
if (MQType == MQEnum.Push) | |||
{ | |||
entity.ExchangeName = "Message.Direct"; | |||
entity.RouteName = Key; | |||
} | |||
else if (MQType == MQEnum.Sub) | |||
{ | |||
entity.ExchangeName = "Message.Fanout"; | |||
} | |||
else | |||
{ | |||
entity.ExchangeName = "Message.Topic"; | |||
entity.RouteName = Key; | |||
} | |||
return true;// MQFactory.SendMQ(entity); | |||
} | |||
} | |||
} |
@@ -0,0 +1,17 @@ | |||
using System; | |||
using System.Collections.Generic; | |||
using System.Linq; | |||
using System.Text; | |||
using System.Threading.Tasks; | |||
namespace BPA.SAAS.KitChenManageOrder.Core | |||
{ | |||
public class CurrentUser | |||
{ | |||
public static string MessageId { get; set; } | |||
public static string GroupId { get; set; } | |||
public static string key { get; set; } | |||
} | |||
} |
@@ -0,0 +1,116 @@ | |||
using BPA.SAAS.KitChenManageOrder.Core.Common; | |||
using BPA.SAAS.KitChenManageOrder.Core.Common.Const; | |||
using BPA.SAAS.KitChenManageOrder.Core.Entity.Base; | |||
using Furion; | |||
using Microsoft.Extensions.Configuration; | |||
using Microsoft.Extensions.DependencyInjection; | |||
using SqlSugar; | |||
using System; | |||
using System.Collections.Generic; | |||
using System.Linq; | |||
namespace BPA.SAAS.KitChenManageOrder.Core | |||
{ | |||
/// <summary> | |||
/// 数据库上下文对象 | |||
/// </summary> | |||
public static class DbContext | |||
{ | |||
public static SqlSugarScope Db { get; set; } | |||
/// <summary> | |||
/// SqlSugar 数据库实例 | |||
/// </summary> | |||
public static void AddSqlsugarSetup(this IServiceCollection services, IConfiguration configuration) | |||
{ | |||
var connectionConfigs = App.GetConfig<List<ConnectionConfig>>("ConnectionConfigs"); | |||
//如果多个数数据库传 List<ConnectionConfig> | |||
var configConnection = new ConnectionConfig() | |||
{ | |||
ConnectionString = connectionConfigs[0].ConnectionString, | |||
DbType = SqlSugar.DbType.MySql,//设置数据库类型 | |||
IsAutoCloseConnection = true,//自动释放数据务,如果存在事务,在事务结束后释放 | |||
InitKeyType = InitKeyType.Attribute, //从实体特性中读取主键自增列信息 | |||
ConfigId = "default", | |||
}; | |||
var connectionConfigslog = App.GetConfig<List<ConnectionConfig>>("ConnectionConfigslog"); | |||
var configConnectionlog = new ConnectionConfig() | |||
{ | |||
ConnectionString = connectionConfigslog[0].ConnectionString, | |||
DbType = SqlSugar.DbType.MySql,//设置数据库类型 | |||
IsAutoCloseConnection = true,//自动释放数据务,如果存在事务,在事务结束后释放 | |||
InitKeyType = InitKeyType.Attribute, //从实体特性中读取主键自增列信息 | |||
ConfigId = "default", | |||
}; | |||
SqlSugarDb.SqlSugarScope(configConnectionlog); | |||
SqlSugarScope sqlSugar = new SqlSugarScope(configConnection, | |||
db => | |||
{ | |||
//过滤已删除数据 | |||
db.QueryFilter.AddTableFilter<IDeleted>(it => it.IsDeleted == 0); | |||
//db.QueryFilter.AddTableFilter<IStatus>(it => it.Status == 0); | |||
if (CurrentUser.GroupId != null || App.User?.FindFirst(ClaimConst.GroupId)?.Value!=null) | |||
{ | |||
//非管理员账户过滤加盟商数据 | |||
var groupId = CurrentUser.GroupId==null?App.User?.FindFirst(ClaimConst.GroupId)?.Value: CurrentUser.GroupId; | |||
db.QueryFilter.AddTableFilter<IGroupId>(it => it.GroupId == groupId); | |||
} | |||
db.Aop.DataExecuting = (oldValue, entityInfo) => | |||
{ | |||
//新增添加加盟商id赋值 | |||
//var groupId = App.User?.FindFirst(ClaimConst.GroupId)?.Value; | |||
//if (entityInfo.PropertyName == "GroupId" && entityInfo.OperationType == DataFilterType.InsertByObject) | |||
//{ | |||
// if (oldValue == null || oldValue == Convert.DBNull) | |||
// { | |||
// entityInfo.SetValue(groupId); | |||
// } | |||
//} | |||
DataExecuting(db); | |||
}; | |||
//单例参数配置,所有上下文生效 | |||
db.Aop.OnLogExecuting = (sql, pars) => | |||
{ | |||
//Console.WriteLine(sql);//输出sql | |||
Console.WriteLine($"当前SQL语句:【{sql}】,参数:【{string.Join(",", pars.Select(t => t.Value))}】"); | |||
}; | |||
}); | |||
services.AddSingleton<ISqlSugarClient>(sqlSugar);//这边是SqlSugarScope用AddSingleton | |||
} | |||
/// <summary> | |||
/// 附默认值 | |||
/// </summary> | |||
/// <param name="db"></param> | |||
private static void DataExecuting(SqlSugarClient db) | |||
{ | |||
//全局字段赋值 | |||
db.Aop.DataExecuting = (oldValue, entityInfo) => | |||
{ | |||
InsertByObject(entityInfo); | |||
//UpdateByObject(oldValue, entityInfo); | |||
}; | |||
} | |||
/// <summary> | |||
///插入数据时附默认值 | |||
/// </summary> | |||
/// <param name="entityInfo"></param> | |||
private static void InsertByObject(DataFilterModel entityInfo) | |||
{ | |||
if (entityInfo.OperationType != DataFilterType.InsertByObject) return; | |||
switch (entityInfo.PropertyName) | |||
{ | |||
case "CreateAt": | |||
entityInfo.SetValue(DateTime.Now); | |||
break; | |||
case "CreateBy": | |||
entityInfo.SetValue(""); | |||
break; | |||
case "GroupId": | |||
entityInfo.SetValue(App.User?.FindFirst(App.User?.FindFirst(ClaimConst.GroupId)?.Value == null?CurrentUser.GroupId: App.User?.FindFirst(ClaimConst.GroupId)?.Value)); | |||
break; | |||
} | |||
} | |||
} | |||
} |
@@ -0,0 +1,42 @@ | |||
using BPA.SAAS.KitChenManageOrder.Core.Entity.Base; | |||
using SqlSugar; | |||
using System; | |||
using System.Collections.Generic; | |||
using System.Linq; | |||
using System.Text; | |||
using System.Threading.Tasks; | |||
namespace BPA.SAAS.KitChenManageOrder.Core.Entity | |||
{ | |||
[SugarTable("bpa_order")] | |||
public class BPA_Order: IBaseEntity,IGroupId | |||
{ | |||
/// <summary> | |||
///场景id | |||
/// </summary> | |||
public string StoreId { get; set; } | |||
public string OrderNumber { get; set; } | |||
/// <summary> | |||
/// 商户订单号,由商家自定义 | |||
/// </summary> | |||
public string TradeNo { get; set; } | |||
/// <summary> | |||
/// 订单状态 0成功 1失败 | |||
/// </summary> | |||
public int OrderStatus { get; set; } | |||
/// <summary> | |||
/// 订单总金额 | |||
/// </summary> | |||
public decimal TotalAmount { get; set; } | |||
/// <summary> | |||
/// 订单数量 | |||
/// </summary> | |||
public int OrderCount { get; set; } | |||
/// <summary> | |||
/// 订单标题 | |||
/// </summary> | |||
public string Subject { get; set; } | |||
public string GroupId { get ; set; } | |||
} | |||
} |
@@ -0,0 +1,22 @@ | |||
using SqlSugar; | |||
using System; | |||
using System.Collections.Generic; | |||
using System.Linq; | |||
using System.Text; | |||
using System.Threading.Tasks; | |||
namespace BPA.SAAS.KitChenManageOrder.Core.Entity | |||
{ | |||
[SugarTable("bpa_ordergoodsarrt")] | |||
public class BPA_OrderGoodsArrt | |||
{ | |||
public string Id { get; set; } | |||
public string SuborderId { get; set; } | |||
public string GoodsId { get; set; } | |||
public string AttributeId { get; set; } | |||
public string AttributeName { get; set; } | |||
public int Count { get; set; } | |||
public decimal Price { get; set; } | |||
public DateTime CreateAt { get; set; } | |||
} | |||
} |
@@ -0,0 +1,21 @@ | |||
using System; | |||
using System.Collections.Generic; | |||
using System.Linq; | |||
using System.Text; | |||
using System.Threading.Tasks; | |||
namespace BPA.SAAS.KitChenManageOrder.Core.Entity | |||
{ | |||
public class BPA_OrderGoodsTechnology | |||
{ | |||
public string Id { get; set; } | |||
public string SuborderId { get; set; } | |||
public string DeviceId { get; set; } | |||
public string GoodsId { get; set; } | |||
public string TechnologyId { get; set; } | |||
public string ActionName { get; set; } | |||
public string ActionValue { get; set; } | |||
public int Sort { get; set; } | |||
public DateTime CreateAt { get; set; } | |||
} | |||
} |
@@ -0,0 +1,173 @@ | |||
using BPA.SAAS.KitChenManageOrder.Core.Entity.Base; | |||
using SqlSugar; | |||
using System; | |||
using System.Collections.Generic; | |||
using System.Linq; | |||
using System.Text; | |||
using System.Threading.Tasks; | |||
namespace BPA.SAAS.KitChenManageOrder.Core.Entity | |||
{ | |||
[SugarTable("BPA_OrderRefundLog")] | |||
public class BPA_OrderRefundLog: IGroupId | |||
{ | |||
/// <summary> | |||
/// | |||
/// </summary> | |||
public string Id { get; set; } = Guid.NewGuid().ToString(); | |||
/// <summary> | |||
/// 订单号(自己系统) | |||
/// </summary> | |||
public System.String OrderNumber { get; set; } | |||
/// <summary> | |||
/// 订单号(第三方) | |||
/// </summary> | |||
public System.String TradeNo { get; set; } | |||
/// <summary> | |||
/// 交易号 | |||
/// </summary> | |||
public System.String TransactionId { get; set; } | |||
/// <summary> | |||
/// 售后表Id(null表示为售前退款) | |||
/// </summary> | |||
public System.String ReturnId { get; set; } | |||
/// <summary> | |||
/// 主订单id | |||
/// </summary> | |||
public System.String OrderId { get; set; } | |||
/// <summary> | |||
/// 子订单id | |||
/// </summary> | |||
public System.String SubOrderId { get; set; } | |||
/// <summary> | |||
/// 退款金额() | |||
/// </summary> | |||
public System.Decimal RefundMoney { get; set; } | |||
/// <summary> | |||
/// 退款类型0:售前退款(商品未制作时退款) 1 售后退款 (商品已经开始进行制作) | |||
/// </summary> | |||
public System.Int32 RefundType { get; set; } | |||
/// <summary> | |||
/// 退款结果 0 成功 1失败 | |||
/// </summary> | |||
public System.Int32 RefundResult { get; set; } | |||
/// <summary> | |||
/// 退款描述 退款成功;账户余额不足;退款金额大于订单金额..etc | |||
/// </summary> | |||
public System.String RefundDesc { get; set; } | |||
/// <summary> | |||
/// 退款来源(退款到什么地方) 0微信 1支付宝 2 余额 | |||
/// </summary> | |||
public System.Int32 RefundSource { get; set; } | |||
/// <summary> | |||
/// 退款调用方式 0 小程序调用退款 1 saas调用退款 2 第三方调用退款 4.POS | |||
/// </summary> | |||
public System.Int32 RefundCallType { get; set; } | |||
/// <summary> | |||
/// 退款时间 | |||
/// </summary> | |||
public System.DateTime? RefundTime { get; set; } | |||
/// <summary> | |||
/// 创建于 | |||
/// </summary> | |||
public System.DateTime? CreatedAt { get; set; } | |||
/// <summary> | |||
/// 创建人 | |||
/// </summary> | |||
public System.String CreatedBy { get; set; } | |||
/// <summary> | |||
/// 更新于 | |||
/// </summary> | |||
public System.DateTime? UpdatedAt { get; set; } | |||
/// <summary> | |||
/// 更新人 | |||
/// </summary> | |||
public System.String UpdatedBy { get; set; } | |||
/// <summary> | |||
/// 退款状态 | |||
/// </summary> | |||
public RefundStatus Stutas { get; set; } | |||
public string GroupId { get; set; } | |||
} | |||
public enum RefundStatus | |||
{ | |||
/// <summary> | |||
/// 申请部分退款 | |||
/// </summary> | |||
PartRefund = 10, | |||
/// <summary> | |||
/// 部分退款处理中 | |||
/// </summary> | |||
PartRefundWait = 101, | |||
/// <summary> | |||
/// 部分退款成功 | |||
/// </summary> | |||
PartRefundOk = 102, | |||
/// <summary> | |||
/// 取消部分退款 | |||
/// </summary> | |||
PartRefundCancel = 103, | |||
/// <summary> | |||
/// 部分退款失败 | |||
/// </summary> | |||
PartRefundError = 104, | |||
/// <summary> | |||
/// 申请全额退款 | |||
/// </summary> | |||
FullRefund = 20, | |||
/// <summary> | |||
/// 全额退款处理中 | |||
/// </summary> | |||
FullRefundWait = 201, | |||
/// <summary> | |||
/// 全额退款成功 | |||
/// </summary> | |||
FullRefundOk = 202, | |||
/// <summary> | |||
/// 取消全额退款 | |||
/// </summary> | |||
FullRefundCancel = 203, | |||
/// <summary> | |||
/// 全额退款失败 | |||
/// </summary> | |||
FullRefundError = 204, | |||
} | |||
} |
@@ -0,0 +1,16 @@ | |||
using BPA.SAAS.KitChenManageOrder.Core.Entity.Base; | |||
using System; | |||
using System.Collections.Generic; | |||
using System.Linq; | |||
using System.Text; | |||
using System.Threading.Tasks; | |||
namespace BPA.SAAS.KitChenManageOrder.Core.Entity | |||
{ | |||
public class BPA_ShopAuthorize: IBaseEntity, IGroupId | |||
{ | |||
public string StoreId { get; set; } | |||
public string AuthorizeCode { get; set; } | |||
public string GroupId { get; set; } | |||
} | |||
} |
@@ -0,0 +1,29 @@ | |||
using BPA.SAAS.KitChenManageOrder.Core.Entity.Base; | |||
using SqlSugar; | |||
namespace BPA.SAAS.KitChenManageOrder.Core.Entity | |||
{ | |||
[SugarTable("bpa_suborder")] | |||
public class BPA_SubOrder: IBaseEntity, IGroupId | |||
{ | |||
/// <summary> | |||
/// 主订单表Id | |||
/// </summary> | |||
public string OrderId { get; set; } | |||
/// <summary> | |||
/// 商品表Id | |||
/// </summary> | |||
public string GoodsId { get; set; } | |||
public string GoodsName { get; set; } | |||
/// <summary> | |||
/// 是否自定义配方 | |||
/// </summary> | |||
public bool isCustom { get; set; } | |||
/// <summary> | |||
/// 商品编号(第三方商品编号) | |||
/// </summary> | |||
public string GoodsNumber { get; set; } | |||
public string GroupId { get ; set; } | |||
} | |||
} |
@@ -0,0 +1,21 @@ | |||
using BPA.SAAS.KitChenManageOrder.Core.Entity.Base; | |||
using System; | |||
using System.Collections.Generic; | |||
using System.Linq; | |||
using System.Text; | |||
using System.Threading.Tasks; | |||
namespace BPA.SAAS.KitChenManageOrder.Core.Entity | |||
{ | |||
public class BPA_ThirdpartyreQuestLog : IBaseEntity, IGroupId | |||
{ | |||
public string RequestUrl { get; set; } | |||
public string ReauestParm { get; set; } | |||
public string ReauestMethod { get; set; } | |||
public string Satas { get; set; } | |||
public string ResultParm { get; set; } | |||
public string IP { get; set; } | |||
public int IsDeleted { get; set; } | |||
public string GroupId { get ; set; } | |||
} | |||
} |
@@ -0,0 +1,25 @@ | |||
using Furion; | |||
using SqlSugar; | |||
using System; | |||
using System.Collections.Generic; | |||
using System.Linq; | |||
using System.Text; | |||
using System.Threading.Tasks; | |||
namespace BPA.SAAS.KitChenManageOrder.Core.Entity.Base | |||
{ | |||
/// <summary> | |||
/// 基础类型 | |||
/// </summary> | |||
public abstract class IBaseEntity | |||
{ | |||
/// <summary> | |||
/// 主键 Guid | |||
/// </summary> | |||
[SugarColumn(IsPrimaryKey = true, ColumnDataType = "Nvarchar(64)", IsNullable = false)] | |||
public string Id { get; set; } = Guid.NewGuid().ToString(); | |||
public DateTime CreateAt { get; set; } = DateTime.Now; | |||
public string CreateBy { get; set; } | |||
} | |||
} |
@@ -0,0 +1,19 @@ | |||
| |||
using BPA.SAAS.KitChenManageOrder.Core.Common.Const; | |||
using Furion; | |||
using SqlSugar; | |||
using System; | |||
using System.Collections.Generic; | |||
using System.Linq; | |||
using System.Text; | |||
using System.Threading.Tasks; | |||
namespace BPA.SAAS.KitChenManageOrder.Core.Entity.Base | |||
{ | |||
public class IBaseGroupIdEntity: IEntity, IGroupId | |||
{ | |||
[SugarColumn(ColumnDataType = "nvarchar(64)", ColumnDescription = "GroupId", IsNullable = true)] | |||
public string GroupId { get; set; } = App.User?.FindFirst(ClaimConst.GroupId)?.Value; | |||
} | |||
} |
@@ -0,0 +1,128 @@ | |||
using BPA.SAAS.KitChenManageOrder.Core.Common.Const; | |||
using Furion; | |||
using SqlSugar; | |||
using System; | |||
using System.Collections.Generic; | |||
using System.Linq; | |||
using System.Text; | |||
using System.Threading.Tasks; | |||
namespace BPA.SAAS.KitChenManageOrder.Core.Entity.Base | |||
{ | |||
/// <summary> | |||
/// 修改人修改时间 | |||
/// </summary> | |||
public class IBaseOPEntity : IBaseEntity | |||
{ | |||
/// <summary> | |||
/// 删除标识 | |||
/// 0=> 正常使用 | |||
/// 1=> 已经被标记删除 | |||
/// </summary> | |||
[SugarColumn(ColumnDataType = "int", ColumnDescription = "是否删除", IsNullable = false)] | |||
public int IsDeleted { get; set; } = 0; | |||
/// <summary> | |||
/// 删除时间 | |||
/// </summary> | |||
[SugarColumn(ColumnDataType = "DateTime", ColumnDescription = "删除时间", IsNullable = true)] | |||
public DateTime? DeleteAt { get; set; } | |||
/// <summary> | |||
/// 删除人 | |||
/// </summary> | |||
[SugarColumn(ColumnDataType = "nvarchar(64)", ColumnDescription = "删除人", IsNullable = true)] | |||
public string DeleteBy { get; set; } | |||
/// <summary> | |||
/// 更新时间 | |||
/// </summary> | |||
[SugarColumn(ColumnDataType = "DateTime", ColumnDescription = "更新时间", IsNullable = true)] | |||
public DateTime? UpdateAt { get; set; } | |||
/// <summary> | |||
/// 更新人 | |||
/// </summary> | |||
[SugarColumn(ColumnDataType = "nvarchar(64)", ColumnDescription = "更新人", IsNullable = true)] | |||
public string UpdateBy { get; set; } | |||
/// <summary> | |||
/// 创建时间 | |||
/// </summary> | |||
[SugarColumn(ColumnDataType = "DateTime", ColumnDescription = "创建时间", IsNullable = true)] | |||
public DateTime CreateAt { get; set; } = DateTime.Now; | |||
/// <summary> | |||
/// 创建人 | |||
/// </summary> | |||
[SugarColumn(ColumnDataType = "nvarchar(64)", ColumnDescription = "创建人", IsNullable = true)] | |||
public string CreateBy { get; set; } | |||
/// <summary> | |||
/// 新增 | |||
/// </summary> | |||
public virtual void Create() | |||
{ | |||
var userId = App.User?.FindFirst(ClaimConst.CLAINM_USERID)?.Value; | |||
var userName = App.User?.FindFirst(ClaimConst.CLAINM_ACCOUNT)?.Value; | |||
this.Id = Guid.NewGuid().ToString(); | |||
this.CreateAt = DateTime.Now; | |||
if (!string.IsNullOrEmpty(userId)) | |||
{ | |||
this.CreateBy = userId; | |||
} | |||
else | |||
{ | |||
this.CreateBy = "admin"; | |||
} | |||
} | |||
public virtual void Create(DateTime data) | |||
{ | |||
var userId = App.User?.FindFirst(ClaimConst.CLAINM_USERID)?.Value; | |||
var userName = App.User?.FindFirst(ClaimConst.CLAINM_ACCOUNT)?.Value; | |||
this.Id = Guid.NewGuid().ToString(); | |||
this.CreateAt = data; | |||
if (!string.IsNullOrEmpty(userId)) | |||
{ | |||
this.CreateBy = userId; | |||
} | |||
else | |||
{ | |||
this.CreateBy = "admin"; | |||
} | |||
} | |||
/// <summary> | |||
/// 修改 | |||
/// </summary> | |||
public void Modify() | |||
{ | |||
var userId = App.User?.FindFirst(ClaimConst.CLAINM_USERID)?.Value; | |||
var userName = App.User?.FindFirst(ClaimConst.CLAINM_ACCOUNT)?.Value; | |||
this.UpdateAt = DateTime.Now; | |||
if (!string.IsNullOrEmpty(userId)) | |||
{ | |||
this.UpdateBy = userId; | |||
} | |||
else | |||
{ | |||
this.UpdateBy = "admin"; | |||
} | |||
} | |||
/// <summary> | |||
/// 删除 | |||
/// </summary> | |||
public void Delete() | |||
{ | |||
var userId = App.User?.FindFirst(ClaimConst.CLAINM_USERID)?.Value; | |||
var userName = App.User?.FindFirst(ClaimConst.CLAINM_ACCOUNT)?.Value; | |||
this.DeleteAt = DateTime.Now; | |||
if (!string.IsNullOrEmpty(userId)) | |||
{ | |||
this.DeleteBy = userId; | |||
} | |||
else | |||
{ | |||
this.DeleteBy = "admin"; | |||
} | |||
} | |||
} | |||
} |
@@ -0,0 +1,16 @@ | |||
using System; | |||
using System.Collections.Generic; | |||
using System.Linq; | |||
using System.Text; | |||
using System.Threading.Tasks; | |||
namespace BPA.SAAS.KitChenManageOrder.Core.Entity.Base | |||
{ | |||
public interface IDeleted | |||
{ | |||
/// <summary> | |||
/// 是否删除 | |||
/// </summary> | |||
public int IsDeleted { get; set; } | |||
} | |||
} |
@@ -0,0 +1,21 @@ | |||
using BPA.SAAS.KitChenManageOrder.Core.Enum; | |||
using Furion; | |||
using SqlSugar; | |||
using System; | |||
namespace BPA.SAAS.KitChenManageOrder.Core.Entity.Base | |||
{ | |||
/// <summary> | |||
/// 自定义实体基类 | |||
/// </summary> | |||
public abstract class IEntity: IBaseOPEntity | |||
{ | |||
/// <summary> | |||
/// 状态 | |||
/// </summary> | |||
[SugarColumn(ColumnDataType = "int", ColumnDescription = "状态", IsNullable = false)] | |||
public CommonStatus Status { get; set; } = CommonStatus.ENABLE; | |||
} | |||
} |
@@ -0,0 +1,13 @@ | |||
using System; | |||
using System.Collections.Generic; | |||
using System.Linq; | |||
using System.Text; | |||
using System.Threading.Tasks; | |||
namespace BPA.SAAS.KitChenManageOrder.Core.Entity.Base | |||
{ | |||
public interface IGroupId | |||
{ | |||
public string GroupId { get; set; } | |||
} | |||
} |
@@ -0,0 +1,15 @@ | |||
using System; | |||
using System.Collections.Generic; | |||
using System.Linq; | |||
using System.Text; | |||
using System.Threading.Tasks; | |||
namespace BPA.SAAS.KitChenManageOrder.Core.Entity.Base | |||
{ | |||
public class OrderQueryDto | |||
{ | |||
public string TradeNo { get; set; } | |||
public string OrderNumber { get; set; } | |||
public string GoodsName { get; set; } | |||
} | |||
} |
@@ -0,0 +1,27 @@ | |||
using System; | |||
using System.Collections.Generic; | |||
using System.ComponentModel; | |||
using System.Linq; | |||
using System.Text; | |||
using System.Threading.Tasks; | |||
namespace BPA.SAAS.KitChenManageOrder.Core.Enum | |||
{ | |||
/// <summary> | |||
/// 分账账户类型 | |||
/// </summary> | |||
public enum AccountType | |||
{ | |||
/// <summary> | |||
/// 商户 | |||
/// </summary> | |||
[Description("商户")] | |||
MERCHANT = 0, | |||
/// <summary> | |||
/// 个人 | |||
/// </summary> | |||
[Description("个人")] | |||
PERSONAL = 1, | |||
} | |||
} |
@@ -0,0 +1,95 @@ | |||
using System.ComponentModel; | |||
namespace BPA.SAAS.KitChenManageOrder.Core.Enum | |||
{ | |||
/// <summary> | |||
/// 公共状态 | |||
/// </summary> | |||
public enum CommonStatus | |||
{ | |||
/// <summary> | |||
/// 正常 | |||
/// </summary> | |||
[Description("正常")] | |||
ENABLE = 0, | |||
/// <summary> | |||
/// 停用 | |||
/// </summary> | |||
[Description("停用")] | |||
DISABLE = 1, | |||
/// <summary> | |||
/// 删除 | |||
/// </summary> | |||
[Description("删除")] | |||
DELETED = 2 | |||
} | |||
public enum MenuTypeEnums | |||
{ | |||
/// <summary> | |||
/// 数据操作类型 | |||
/// </summary> | |||
Handle, | |||
/// <summary> | |||
/// 普通菜单 | |||
/// </summary> | |||
Normal | |||
} | |||
/// <summary> | |||
/// 账号类型 | |||
/// </summary> | |||
public enum AdminEnums | |||
{ | |||
/// <summary> | |||
/// 超级管理员 | |||
/// </summary> | |||
[Description("超级管理员")] | |||
SuperAdmin = 1, | |||
/// <summary> | |||
/// 管理员 | |||
/// </summary> | |||
[Description("管理员")] | |||
Admin = 2, | |||
/// <summary> | |||
/// 普通账号 | |||
/// </summary> | |||
[Description("普通账号")] | |||
None = 3 | |||
} | |||
/// <summary> | |||
/// 会员平台 | |||
/// </summary> | |||
public enum PlatformType | |||
{ | |||
/// <summary> | |||
/// 默认 | |||
/// </summary> | |||
[Description("默认")] | |||
Default = 0, | |||
/// <summary> | |||
/// 微信 | |||
/// </summary> | |||
[Description("微信")] | |||
WeChat=1, | |||
/// <summary> | |||
/// 支付宝 | |||
/// </summary> | |||
[Description("支付宝")] | |||
Alipay = 2, | |||
/// <summary> | |||
/// POS | |||
/// </summary> | |||
[Description("pos")] | |||
POS = 3, | |||
/// <summary> | |||
/// card | |||
/// </summary> | |||
[Description("储值卡")] | |||
Card = 4, | |||
} | |||
} |
@@ -0,0 +1,21 @@ | |||
using System; | |||
using System.Collections.Generic; | |||
using System.ComponentModel; | |||
using System.Linq; | |||
using System.Text; | |||
using System.Threading.Tasks; | |||
namespace BPA.SAAS.KitChenManageOrder.Core.Enum | |||
{ | |||
public enum CouponUseType | |||
{ | |||
[Description("未使用")] | |||
NoUse=1, | |||
[Description("已核销")] | |||
WriteOff=2, | |||
[Description("占用中")] | |||
Occupied=3, | |||
[Description("已失效")] | |||
Invalidation=4 | |||
} | |||
} |
@@ -0,0 +1,42 @@ | |||
using System; | |||
using System.Collections.Generic; | |||
using System.ComponentModel; | |||
using System.Linq; | |||
using System.Text; | |||
using System.Threading.Tasks; | |||
namespace BPA.SAAS.KitChenManageOrder.Core.Enum | |||
{ | |||
public enum DataScopeType | |||
{ | |||
/// <summary> | |||
/// 全部数据 | |||
/// </summary> | |||
[Description("全部数据")] | |||
ALL = 1, | |||
/// <summary> | |||
/// 本部门及以下数据 | |||
/// </summary> | |||
[Description("本部门及以下数据")] | |||
DEPT_WITH_CHILD = 2, | |||
/// <summary> | |||
/// 本部门数据 | |||
/// </summary> | |||
[Description("本部门数据")] | |||
DEPT = 3, | |||
/// <summary> | |||
/// 仅本人数据 | |||
/// </summary> | |||
[Description("仅本人数据")] | |||
SELF = 4, | |||
/// <summary> | |||
/// 自定义数据 | |||
/// </summary> | |||
[Description("自定义数据")] | |||
DEFINE = 5 | |||
} | |||
} |
@@ -0,0 +1,36 @@ | |||
/** | |||
* 命名空间: BPA.Kitchen.Core.Common.Enum | |||
* | |||
* 功 能: N/A | |||
* 类 名: GoodsAttribute | |||
* | |||
* Ver 变更日期 负责人 变更内容 | |||
* ─────────────────────────────────── | |||
* V0.01 2022/6/24 10:04:06 唐学波 初版 | |||
* | |||
* Copyright (c) 2022 BlackB Corporation. All rights reserved. | |||
*/ | |||
using System; | |||
using System.Collections.Generic; | |||
using System.Linq; | |||
using System.Text; | |||
using System.Threading.Tasks; | |||
namespace BPA.SAAS.KitChenManageOrder.Core.Enum | |||
{ | |||
/// <summary> | |||
/// 商品属性 | |||
/// </summary> | |||
public enum GoodsAttribute | |||
{ | |||
/// <summary> | |||
/// 单品 | |||
/// </summary> | |||
SingleGoods = 0, | |||
/// <summary> | |||
/// 套餐 | |||
/// </summary> | |||
ComboGoods = 1, | |||
} | |||
} |
@@ -0,0 +1,44 @@ | |||
using System; | |||
using System.Collections.Generic; | |||
using System.Linq; | |||
using System.Text; | |||
using System.Threading.Tasks; | |||
namespace BPA.SAAS.KitChenManageOrder.Core.Enum | |||
{ | |||
public class IntegralEnum | |||
{ | |||
public enum CalculateType | |||
{ | |||
积分方案 = 1, | |||
多倍积分 = 2, | |||
独立计算 = 3 | |||
} | |||
/// <summary> | |||
/// 积分增加/减少类型 | |||
/// </summary> | |||
public enum IntegSourceType | |||
{ | |||
订单消费 = 1, | |||
活动赠送 = 2, | |||
后台补充 = 3, | |||
积分兑换 = 4, | |||
} | |||
/// <summary> | |||
/// 小类方案类型 | |||
/// </summary> | |||
public enum allTypes | |||
{ | |||
common = 0, | |||
price = 1, | |||
big = 2, | |||
small = 3, | |||
count = 4, | |||
persons = 5, | |||
number = 6 | |||
} | |||
} | |||
} |
@@ -0,0 +1,34 @@ | |||
using System.ComponentModel; | |||
namespace BPA.SAAS.KitChenManageOrder.Core.Enum | |||
{ | |||
/// <summary> | |||
/// 系统菜单类型 | |||
/// </summary> | |||
public enum MenuOpenType | |||
{ | |||
/// <summary> | |||
/// 无 | |||
/// </summary> | |||
[Description("无")] | |||
NONE = 0, | |||
/// <summary> | |||
/// 组件 | |||
/// </summary> | |||
[Description("组件")] | |||
COMPONENT = 1, | |||
/// <summary> | |||
/// 内链 | |||
/// </summary> | |||
[Description("内链")] | |||
INNER = 2, | |||
/// <summary> | |||
/// 外链 | |||
/// </summary> | |||
[Description("外链")] | |||
OUTER = 3 | |||
} | |||
} |
@@ -0,0 +1,25 @@ | |||
using System.ComponentModel; | |||
namespace BPA.SAAS.KitChenManageOrder.Core.Enum | |||
{ | |||
public enum MenuType | |||
{ | |||
/// <summary> | |||
/// 目录 | |||
/// </summary> | |||
[Description("目录")] | |||
DIR = 0, | |||
/// <summary> | |||
/// 菜单 | |||
/// </summary> | |||
[Description("菜单")] | |||
MENU = 1, | |||
/// <summary> | |||
/// 按钮 | |||
/// </summary> | |||
[Description("按钮")] | |||
BTN = 2 | |||
} | |||
} |
@@ -0,0 +1,21 @@ | |||
using System; | |||
using System.Collections.Generic; | |||
using System.Linq; | |||
using System.Text; | |||
using System.Threading.Tasks; | |||
namespace BPA.SAAS.KitChenManageOrder.Core.Enum | |||
{ | |||
public class OrderEnum | |||
{ | |||
public enum SubOrderCookingStutas | |||
{ | |||
WaitMake = 0, | |||
Making = 1, | |||
WaitTake = 2, | |||
TakeCompleted = 3, | |||
Normal = 99998, | |||
Error = 99999 | |||
} | |||
} | |||
} |
@@ -0,0 +1,35 @@ | |||
using System; | |||
using System.Collections.Generic; | |||
using System.ComponentModel; | |||
using System.Linq; | |||
using System.Text; | |||
using System.Threading.Tasks; | |||
namespace BPA.SAAS.KitChenManageOrder.Core.Enum | |||
{ | |||
public enum OrgType | |||
{ | |||
/// <summary> | |||
/// 机构部门 | |||
/// </summary> | |||
[Description("机构部门")] | |||
ORG = 0, | |||
/// <summary> | |||
/// 配送中心 | |||
/// </summary> | |||
[Description("配送中心")] | |||
DEVLIVERY = 1, | |||
/// <summary> | |||
/// 门店 | |||
/// </summary> | |||
[Description("门店")] | |||
STORE = 2, | |||
/// <summary> | |||
/// 门店 | |||
/// </summary> | |||
[Description("加盟店")] | |||
FranchiseeSTORE = 3 | |||
} | |||
} |
@@ -0,0 +1,39 @@ | |||
using System; | |||
using System.Collections.Generic; | |||
using System.ComponentModel; | |||
using System.Linq; | |||
using System.Text; | |||
using System.Threading.Tasks; | |||
namespace BPA.SAAS.KitChenManageOrder.Core.Enum | |||
{ | |||
public enum SRDUserType | |||
{ | |||
/// <summary> | |||
/// 人员 | |||
/// </summary> | |||
[Description("人员")] | |||
USER = 0, | |||
/// <summary> | |||
/// 人员分类 | |||
/// </summary> | |||
[Description("人员分类")] | |||
USERTYPE = 1, | |||
} | |||
public enum RSDGroupType | |||
{ | |||
/// <summary> | |||
/// 设备 | |||
/// </summary> | |||
[Description("设备")] | |||
RSD = 0, | |||
/// <summary> | |||
/// 设备分组 | |||
/// </summary> | |||
[Description("设备分组")] | |||
RSDGROUP = 1, | |||
} | |||
} |
@@ -0,0 +1,24 @@ | |||
using System; | |||
using System.Collections.Generic; | |||
using System.ComponentModel; | |||
using System.Linq; | |||
using System.Text; | |||
using System.Threading.Tasks; | |||
namespace BPA.SAAS.KitChenManageOrder.Core.Enum | |||
{ | |||
public enum StatusEntity | |||
{ | |||
/// <summary> | |||
/// 正常 | |||
/// </summary> | |||
[Description("正常")] | |||
ENABLE = 0, | |||
/// <summary> | |||
/// 停用 | |||
/// </summary> | |||
[Description("停用")] | |||
DISABLE = 1, | |||
} | |||
} |
@@ -0,0 +1,24 @@ | |||
using System; | |||
using System.Collections.Generic; | |||
using System.Linq; | |||
using System.Text; | |||
using System.Threading.Tasks; | |||
namespace BPA.SAAS.KitChenManageOrder.Core.Enum | |||
{ | |||
public enum TransactionType | |||
{ | |||
/// <summary> | |||
/// 充值 | |||
/// </summary> | |||
Recharge=1, | |||
/// <summary> | |||
/// 消费 | |||
/// </summary> | |||
Consume = 2, | |||
/// <summary> | |||
/// 退款 | |||
/// </summary> | |||
Refund = 3, | |||
} | |||
} |
@@ -0,0 +1,112 @@ | |||
using BPA.SAAS.KitChenManageOrder.Core.Entity.Base; | |||
using SqlSugar; | |||
using System; | |||
using System.Collections.Generic; | |||
using System.Linq; | |||
using System.Text; | |||
using System.Threading.Tasks; | |||
namespace BPA.SAAS.KitChenManageOrder.Core | |||
{ | |||
public class SqlSugarDb | |||
{ | |||
public static SqlSugarScope Db { get; set; } | |||
public static SqlSugarScope SqlSugarScope(ConnectionConfig configConnection) | |||
{ | |||
//全局过滤 | |||
Db = new SqlSugarScope(configConnection, db => | |||
{ | |||
//全局过滤 | |||
TableFilterItem(db); | |||
db.Aop.OnLogExecuting = (sql, pars) => | |||
{ | |||
//sql 执行前 | |||
}; | |||
db.Aop.OnLogExecuted = (sql, pars) => | |||
{ | |||
//sql 执行后 | |||
}; | |||
db.Aop.OnError = ex => | |||
{ | |||
//sql 异常 | |||
}; | |||
}); | |||
return Db; | |||
} | |||
#region 全局过滤器及配置 | |||
/// <summary> | |||
/// 全局过滤 | |||
/// </summary> | |||
private static void TableFilterItem(SqlSugarClient db) | |||
{ | |||
//添加默认值 | |||
DataExecuting(db); | |||
db.QueryFilter.AddTableFilter<IGroupId>(it => it.GroupId == CurrentUser.GroupId); | |||
} | |||
/// <summary> | |||
/// 附默认值 | |||
/// </summary> | |||
/// <param name="db"></param> | |||
private static void DataExecuting(SqlSugarClient db) | |||
{ | |||
//全局字段赋值 | |||
db.Aop.DataExecuting = (oldValue, entityInfo) => | |||
{ | |||
InsertByObject(entityInfo); | |||
UpdateByObject(oldValue, entityInfo); | |||
}; | |||
} | |||
/// <summary> | |||
///插入数据时附默认值 | |||
/// </summary> | |||
/// <param name="entityInfo"></param> | |||
private static void InsertByObject(DataFilterModel entityInfo) | |||
{ | |||
if (entityInfo.OperationType != DataFilterType.InsertByObject) return; | |||
switch (entityInfo.PropertyName) | |||
{ | |||
case "CreateAt": | |||
entityInfo.SetValue(DateTime.Now); | |||
break; | |||
case "CreateBy": | |||
entityInfo.SetValue(""); | |||
break; | |||
case "GroupId": | |||
entityInfo.SetValue(CurrentUser.GroupId); | |||
break; | |||
} | |||
} | |||
/// <summary> | |||
/// 修改数据时附默认值 | |||
/// </summary> | |||
/// <param name="oldValue"></param> | |||
/// <param name="entityInfo"></param> | |||
private static void UpdateByObject(object oldValue, DataFilterModel entityInfo) | |||
{ | |||
if (entityInfo.OperationType != DataFilterType.UpdateByObject) return; | |||
switch (entityInfo.PropertyName) | |||
{ | |||
case "UpdateAt": | |||
entityInfo.SetValue(DateTime.Now); | |||
break; | |||
case "UpdateBy": | |||
entityInfo.SetValue(""); | |||
break; | |||
} | |||
} | |||
#endregion | |||
} | |||
} |
@@ -0,0 +1,26 @@ | |||
<Project Sdk="Microsoft.NET.Sdk"> | |||
<PropertyGroup> | |||
<TargetFramework>net6.0</TargetFramework> | |||
<NoWarn>1701;1702;1591</NoWarn> | |||
<DocumentationFile>BPA.SAAS.KitChenManageOrder.Web.Core.xml</DocumentationFile> | |||
</PropertyGroup> | |||
<ItemGroup> | |||
<None Remove="BPA.SAAS.KitChenManageOrder.Web.Core.xml" /> | |||
</ItemGroup> | |||
<ItemGroup> | |||
<PackageReference Include="FluentValidation.AspNetCore" Version="11.3.0" /> | |||
</ItemGroup> | |||
<ItemGroup> | |||
<ProjectReference Include="..\BPA.SAAS.KitChenManageOrder.Application\BPA.SAAS.KitChenManageOrder.Application.csproj" /> | |||
</ItemGroup> | |||
</Project> |
@@ -0,0 +1,225 @@ | |||
<?xml version="1.0"?> | |||
<doc> | |||
<assembly> | |||
<name>BPA.SAAS.KitChenManageOrder.Web.Core</name> | |||
</assembly> | |||
<members> | |||
<member name="M:BPA.SAAS.KitChenManageOrder.Web.Core.Handlers.CheckHandler.CheckSign(System.String,System.String,System.String)"> | |||
<summary> | |||
检查Sign | |||
</summary> | |||
</member> | |||
<member name="M:BPA.SAAS.KitChenManageOrder.Web.Core.Handlers.CheckHandler.CheckKey(System.String)"> | |||
<summary> | |||
检查平key验证 | |||
</summary> | |||
<param name="key"></param> | |||
</member> | |||
<member name="M:BPA.SAAS.KitChenManageOrder.Web.Core.Handlers.CheckHandler.CheckTenant(System.String)"> | |||
<summary> | |||
检查租户 | |||
</summary> | |||
<param name="id"></param> | |||
<returns></returns> | |||
</member> | |||
<member name="T:BPA.SAAS.KitChenManageOrder.Web.Core.Handlers.DtoValidator"> | |||
<summary> | |||
Dto参数验证 | |||
</summary> | |||
</member> | |||
<member name="M:BPA.SAAS.KitChenManageOrder.Web.Core.Handlers.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="M:BPA.SAAS.KitChenManageOrder.Web.Core.Handlers.DtoValidator.GetSign(System.Object)"> | |||
<summary> | |||
获取签名 | |||
</summary> | |||
<param name="t"></param> | |||
<returns></returns> | |||
</member> | |||
<member name="M:BPA.SAAS.KitChenManageOrder.Web.Core.Handlers.DtoValidator.GetAttributePrice(System.Object,System.String)"> | |||
<summary> | |||
获取属性值 | |||
</summary> | |||
<param name="obj"></param> | |||
<param name="name"></param> | |||
<returns></returns> | |||
</member> | |||
<member name="P:BPA.SAAS.KitChenManageOrder.Web.Core.Handlers.Dto.CompanyDto.Name"> | |||
<summary> | |||
加盟商名称 | |||
</summary> | |||
</member> | |||
<member name="P:BPA.SAAS.KitChenManageOrder.Web.Core.Handlers.Dto.CompanyDto.AdminName"> | |||
<summary> | |||
管理员姓名 | |||
</summary> | |||
</member> | |||
<member name="P:BPA.SAAS.KitChenManageOrder.Web.Core.Handlers.Dto.CompanyDto.Email"> | |||
<summary> | |||
邮箱账号 | |||
</summary> | |||
</member> | |||
<member name="P:BPA.SAAS.KitChenManageOrder.Web.Core.Handlers.Dto.CompanyDto.Phone"> | |||
<summary> | |||
电话 | |||
</summary> | |||
</member> | |||
<member name="P:BPA.SAAS.KitChenManageOrder.Web.Core.Handlers.Dto.CompanyDto.Remark"> | |||
<summary> | |||
备注 | |||
</summary> | |||
</member> | |||
<member name="P:BPA.SAAS.KitChenManageOrder.Web.Core.Handlers.Dto.CompanyDto.Code"> | |||
<summary> | |||
logo | |||
</summary> | |||
</member> | |||
<member name="P:BPA.SAAS.KitChenManageOrder.Web.Core.Handlers.Dto.CompanyDto.Status"> | |||
<summary> | |||
状态 【正常 停用】默认 正常 | |||
</summary> | |||
</member> | |||
<member name="P:BPA.SAAS.KitChenManageOrder.Web.Core.Handlers.Dto.CompanyDto.Type"> | |||
<summary> | |||
所属平台 0 团餐 1门店 2 后厨 3公共 | |||
</summary> | |||
</member> | |||
<member name="P:BPA.SAAS.KitChenManageOrder.Web.Core.Handlers.Dto.StoreAuthorizationDto.PeriodValidity"> | |||
<summary> | |||
有效期 长期有效为空 | |||
</summary> | |||
</member> | |||
<member name="T:BPA.SAAS.KitChenManageOrder.Web.Core.Handlers.ErrorCodeEnum"> | |||
<summary> | |||
系统错误码 | |||
</summary> | |||
</member> | |||
<member name="F:BPA.SAAS.KitChenManageOrder.Web.Core.Handlers.ErrorCodeEnum.Code1000"> | |||
<summary> | |||
用户没有注册 | |||
</summary> | |||
</member> | |||
<member name="F:BPA.SAAS.KitChenManageOrder.Web.Core.Handlers.ErrorCodeEnum.Code1001"> | |||
<summary> | |||
操作错误 | |||
</summary> | |||
</member> | |||
<member name="F:BPA.SAAS.KitChenManageOrder.Web.Core.Handlers.ErrorCodeEnum.Code1002"> | |||
<summary> | |||
重复添加 | |||
</summary> | |||
</member> | |||
<member name="F:BPA.SAAS.KitChenManageOrder.Web.Core.Handlers.ErrorCodeEnum.Code1003"> | |||
<summary> | |||
操作数据不存在 | |||
</summary> | |||
</member> | |||
<member name="F:BPA.SAAS.KitChenManageOrder.Web.Core.Handlers.ErrorCodeEnum.Code1004"> | |||
<summary> | |||
key不正确 | |||
</summary> | |||
</member> | |||
<member name="F:BPA.SAAS.KitChenManageOrder.Web.Core.Handlers.ErrorCodeEnum.Code1005"> | |||
<summary> | |||
签名错误 | |||
</summary> | |||
</member> | |||
<member name="F:BPA.SAAS.KitChenManageOrder.Web.Core.Handlers.ErrorCodeEnum.Code1006"> | |||
<summary> | |||
签名错误 | |||
</summary> | |||
</member> | |||
<member name="F:BPA.SAAS.KitChenManageOrder.Web.Core.Handlers.ErrorCodeEnum.Code1007"> | |||
<summary> | |||
系统异常 | |||
</summary> | |||
</member> | |||
<member name="F:BPA.SAAS.KitChenManageOrder.Web.Core.Handlers.ErrorCodeEnum.Code1008"> | |||
<summary> | |||
商品不存在 | |||
</summary> | |||
</member> | |||
<member name="F:BPA.SAAS.KitChenManageOrder.Web.Core.Handlers.ErrorCodeEnum.Code1009"> | |||
<summary> | |||
场景id不能为空 | |||
</summary> | |||
</member> | |||
<member name="F:BPA.SAAS.KitChenManageOrder.Web.Core.Handlers.ErrorCodeEnum.Code10010"> | |||
<summary> | |||
产品不存在 | |||
</summary> | |||
</member> | |||
<member name="F:BPA.SAAS.KitChenManageOrder.Web.Core.Handlers.ErrorCodeEnum.Code10011"> | |||
<summary> | |||
产品版本不存在 | |||
</summary> | |||
</member> | |||
<member name="F:BPA.SAAS.KitChenManageOrder.Web.Core.Handlers.ErrorCodeEnum.Code10012"> | |||
<summary> | |||
设备不存在 | |||
</summary> | |||
</member> | |||
<member name="F:BPA.SAAS.KitChenManageOrder.Web.Core.Handlers.ErrorCodeEnum.Code10013"> | |||
<summary> | |||
产品标签不存在 | |||
</summary> | |||
</member> | |||
<member name="F:BPA.SAAS.KitChenManageOrder.Web.Core.Handlers.ErrorCodeEnum.Code10014"> | |||
<summary> | |||
授权过期 | |||
</summary> | |||
</member> | |||
<member name="F:BPA.SAAS.KitChenManageOrder.Web.Core.Handlers.ErrorCodeEnum.Code10015"> | |||
<summary> | |||
配方不存在 | |||
</summary> | |||
</member> | |||
<member name="F:BPA.SAAS.KitChenManageOrder.Web.Core.Handlers.ErrorCodeEnum.Code10016"> | |||
<summary> | |||
下发错误 | |||
</summary> | |||
</member> | |||
<member name="F:BPA.SAAS.KitChenManageOrder.Web.Core.Handlers.ErrorCodeEnum.Code10017"> | |||
<summary> | |||
名称或编码重复 | |||
</summary> | |||
</member> | |||
<member name="F:BPA.SAAS.KitChenManageOrder.Web.Core.Handlers.ErrorCodeEnum.Code10018"> | |||
<summary> | |||
模板名称不能重复 | |||
</summary> | |||
</member> | |||
<member name="F:BPA.SAAS.KitChenManageOrder.Web.Core.Handlers.ErrorCodeEnum.Code10019"> | |||
<summary> | |||
设备id不能为空 | |||
</summary> | |||
</member> | |||
<member name="F:BPA.SAAS.KitChenManageOrder.Web.Core.Handlers.ErrorCodeEnum.Code10020"> | |||
<summary> | |||
模板名称不能为空 | |||
</summary> | |||
</member> | |||
<member name="F:BPA.SAAS.KitChenManageOrder.Web.Core.Handlers.ErrorCodeEnum.Code10021"> | |||
<summary> | |||
获取场景数据失败 | |||
</summary> | |||
</member> | |||
<member name="F:BPA.SAAS.KitChenManageOrder.Web.Core.Handlers.ErrorCodeEnum.Code10022"> | |||
<summary> | |||
场景不存在 | |||
</summary> | |||
</member> | |||
<member name="F:BPA.SAAS.KitChenManageOrder.Web.Core.Handlers.ErrorCodeEnum.Code10023"> | |||
<summary> | |||
店铺授权失败 | |||
</summary> | |||
</member> | |||
</members> | |||
</doc> |
@@ -0,0 +1,82 @@ | |||
using BPA.SAAS.KitChenManageOrder.Application.Service.ThirdAuthorize; | |||
using BPA.SAAS.KitChenManageOrder.Core; | |||
using BPA.SAAS.KitChenManageOrder.Core.Common; | |||
using BPA.SAAS.KitChenManageOrder.Web.Core.Handlers.Dto; | |||
using Furion; | |||
using Furion.DataEncryption; | |||
using Furion.FriendlyException; | |||
using Furion.RemoteRequest.Extensions; | |||
using Newtonsoft.Json; | |||
using System; | |||
using System.Collections.Generic; | |||
using System.Linq; | |||
using System.Text; | |||
using System.Threading.Tasks; | |||
using CurrentUser = BPA.SAAS.KitChenManageOrder.Core.CurrentUser; | |||
namespace BPA.SAAS.KitChenManageOrder.Web.Core.Handlers | |||
{ | |||
public class CheckHandler | |||
{ | |||
/// <summary> | |||
///检查Sign | |||
/// </summary> | |||
public async Task CheckSign(string key, string signStr, string signMd5) | |||
{ | |||
//检查key | |||
await CheckKey(key); | |||
//var thisSign = signStr + "&key=" + key; | |||
//var vvv = MD5Encryption.Encrypt(thisSign.ToUpper()).ToUpper(); | |||
//var vvvvv = thisSign.ToUpper(); | |||
//if (MD5Encryption.Encrypt(thisSign.ToUpper()).ToUpper() != signMd5.ToUpper()) | |||
//{ | |||
// throw Oops.Oh(ErrorCodeEnum.Code1005); | |||
//} | |||
} | |||
/// <summary> | |||
/// 检查平key验证 | |||
/// </summary> | |||
/// <param name="key"></param> | |||
private async Task CheckKey(string key) | |||
{ | |||
Dictionary<string, string> dic = new Dictionary<string, string>(); | |||
var url = App.Configuration["SAAS_KitManage"] + "api/authorization/getstoreauthorization?key="+ key; | |||
var jsonData = HttpHelper.HttpGet(url, null, dic, "application/json"); | |||
var data = JsonConvert.DeserializeObject<ResultSAASManageDto<StoreAuthorizationDto>>(jsonData); | |||
if (data.statusCode != 200) throw Oops.Oh(data.errors); | |||
if (data.data == null) throw Oops.Oh(ErrorCodeEnum.Code10023); | |||
await CheckTenant(data.data.GroupId); | |||
} | |||
/// <summary> | |||
/// 检查租户 | |||
/// </summary> | |||
/// <param name="id"></param> | |||
/// <returns></returns> | |||
private async Task CheckTenant(string tenantId) | |||
{ | |||
try | |||
{ | |||
Dictionary<string, string> dic = new Dictionary<string, string>(); | |||
var url = App.Configuration["SAAS_Manage"] + "api/authorization/GetCompanyById?id=" + tenantId; | |||
var jsonData =await url.GetAsStringAsync();// HttpHelper.HttpGet(url, null, dic, "application/json"); | |||
var data = JsonConvert.DeserializeObject<CompanyDto>(jsonData); | |||
// if (data.statusCode != 200) throw Oops.Oh(ErrorCodeEnum.Code10016); | |||
if (data == null) throw Oops.Oh(ErrorCodeEnum.Code10016); | |||
CurrentUser.GroupId = tenantId; | |||
} | |||
catch (Exception e) | |||
{ | |||
throw Oops.Oh("请求错误"); | |||
} | |||
} | |||
} | |||
} |
@@ -0,0 +1,47 @@ | |||
using BPA.SAAS.KitChenManageOrder.Core.Enum; | |||
using System; | |||
using System.Collections.Generic; | |||
using System.Linq; | |||
using System.Text; | |||
using System.Threading.Tasks; | |||
namespace BPA.SAAS.KitChenManageOrder.Web.Core.Handlers.Dto | |||
{ | |||
public class CompanyDto | |||
{ | |||
public string Id { get; set; } | |||
/// <summary> | |||
/// 加盟商名称 | |||
/// </summary> | |||
public string Name { get; set; } | |||
/// <summary> | |||
/// 管理员姓名 | |||
/// </summary> | |||
public string AdminName { get; set; } | |||
/// <summary> | |||
/// 邮箱账号 | |||
/// </summary> | |||
public string Email { get; set; } | |||
/// <summary> | |||
/// 电话 | |||
/// </summary> | |||
public string Phone { get; set; } | |||
/// <summary> | |||
/// 备注 | |||
/// </summary> | |||
public string Remark { get; set; } | |||
/// <summary> | |||
/// logo | |||
/// </summary> | |||
public string Code { get; set; } | |||
/// <summary> | |||
/// 状态 【正常 停用】默认 正常 | |||
/// </summary> | |||
public CommonStatus Status { get; set; } = CommonStatus.ENABLE; | |||
/// <summary> | |||
/// 所属平台 0 团餐 1门店 2 后厨 3公共 | |||
/// </summary> | |||
public int Type { get; set; } | |||
} | |||
} |
@@ -0,0 +1,25 @@ | |||
using System; | |||
using System.Collections.Generic; | |||
using System.Linq; | |||
using System.Text; | |||
using System.Threading.Tasks; | |||
namespace BPA.SAAS.KitChenManageOrder.Web.Core.Handlers.Dto | |||
{ | |||
public class ResultSAASManageDto<T> | |||
{ | |||
public int statusCode { get; set; } | |||
public T data { get; set; } | |||
public string succeeded { get; set; } | |||
public string errors { get; set; } | |||
public string extras { get; set; } | |||
public int timestamp { get; set; } | |||
} | |||
} |
@@ -0,0 +1,24 @@ | |||
using System; | |||
using System.Collections.Generic; | |||
using System.Linq; | |||
using System.Text; | |||
using System.Threading.Tasks; | |||
namespace BPA.SAAS.KitChenManageOrder.Web.Core.Handlers.Dto | |||
{ | |||
public class StoreAuthorizationDto | |||
{ | |||
public string Id { get; set; } | |||
public string StoreId { get; set; } | |||
public string Key { get; set; } | |||
public string GroupId { get; set; } | |||
/// <summary> | |||
/// 有效期 长期有效为空 | |||
/// </summary> | |||
public DateTime? PeriodValidity { get; set; } | |||
public DateTime UpdateAt { get; set; } | |||
} | |||
} |
@@ -0,0 +1,142 @@ | |||
using Newtonsoft.Json; | |||
using NPOI.Util.ArrayExtensions; | |||
using System; | |||
using System.Collections.Generic; | |||
using System.Linq; | |||
using System.Reflection; | |||
using System.Text; | |||
using System.Threading.Tasks; | |||
namespace BPA.SAAS.KitChenManageOrder.Web.Core.Handlers | |||
{ | |||
/// <summary> | |||
/// Dto参数验证 | |||
/// </summary> | |||
public static class DtoValidator | |||
{ | |||
/// <summary> | |||
/// 获取签名 | |||
/// </summary> | |||
/// <typeparam name="T"></typeparam> | |||
/// <param name="t"></param> | |||
/// <param name="otype">0-不排序 1-按名称ASCII排序</param> | |||
/// <returns></returns> | |||
public static string GetSign<T>(T t, int otype = 1) | |||
{ | |||
string retstr = ""; | |||
//定义PropertyInfo的List | |||
List<PropertyInfo> proplist = new List<PropertyInfo>(); | |||
//遍历泛型类的每个属性加入到List里面 | |||
Array.ForEach<PropertyInfo>(typeof(T).GetProperties(), | |||
p => proplist.Add(p)); | |||
//根据参数进行排序 0-不排序 1-按名称ASCII码排序 | |||
if (otype == 1) | |||
proplist = proplist.OrderBy(k => k.Name).ToList(); | |||
//遍历List泛型生成我们要签名的字符串 | |||
proplist.ForEach(p => | |||
{ | |||
if (p.Name.ToLower() != "sign".ToLower()) | |||
{ | |||
if (p.GetValue(t, null) != null && p.GetValue(t, null).ToString() != "") | |||
{ | |||
retstr = retstr + p.Name + "=" + p.GetValue(t, null) + "&"; | |||
} | |||
} | |||
}); | |||
//把字符串最后一位截断 | |||
retstr = retstr.Substring(0, retstr.Length - 1); | |||
//输出字符串 | |||
return retstr; | |||
} | |||
/// <summary> | |||
/// 获取签名 | |||
/// </summary> | |||
/// <param name="t"></param> | |||
/// <returns></returns> | |||
public static string GetSign(object t) | |||
{ | |||
string retstr = ""; | |||
//定义PropertyInfo的List | |||
List<PropertyInfo> proplist = new List<PropertyInfo>(); | |||
//遍历泛型类的每个属性加入到List里面 | |||
Array.ForEach<PropertyInfo>(t.GetType().GetProperties(), | |||
p => proplist.Add(p)); | |||
//根据参数进行排序 0-不排序 1-按名称ASCII码排序 | |||
proplist = proplist.OrderBy(k => k.Name).ToList(); | |||
//遍历List泛型生成我们要签名的字符串 | |||
proplist.ForEach(p => | |||
{ | |||
if (p.Name.ToLower() != "sign".ToLower()) | |||
{ | |||
if (p.GetValue(t, null) != null && p.GetValue(t, null).ToString() != "") | |||
{ | |||
var type = p.GetValue(t, null).GetType().FullName; | |||
if (type == "System.String" || type == "System.Boolean" || type == "System.Int32" || type == "System.DateTime") | |||
{ | |||
retstr = retstr + p.Name + "=" + p.GetValue(t, null) + "&"; | |||
} | |||
else | |||
{ | |||
var jsonSetting = new JsonSerializerSettings { NullValueHandling = NullValueHandling.Ignore }; | |||
retstr = retstr + p.Name + "=" + JsonConvert.SerializeObject(p.GetValue(t, null), Formatting.None, jsonSetting) + "&"; | |||
} | |||
} | |||
} | |||
}); | |||
//把字符串最后一位截断 | |||
retstr = retstr.Substring(0, retstr.Length - 1); | |||
//输出字符串 | |||
return retstr; | |||
} | |||
/// <summary> | |||
/// 获取属性值 | |||
/// </summary> | |||
/// <param name="obj"></param> | |||
/// <param name="name"></param> | |||
/// <returns></returns> | |||
public static string GetAttributePrice(object obj, string name) | |||
{ | |||
string retstr = ""; | |||
//定义PropertyInfo的List | |||
List<PropertyInfo> proplist = new List<PropertyInfo>(); | |||
//遍历泛型类的每个属性加入到List里面 | |||
Array.ForEach<PropertyInfo>(obj.GetType().GetProperties(), | |||
p => proplist.Add(p)); | |||
//根据参数进行排序 0-不排序 1-按名称ASCII码排序 | |||
proplist = proplist.OrderBy(k => k.Name).ToList(); | |||
//遍历List泛型生成我们要签名的字符串 | |||
proplist.ForEach(p => | |||
{ | |||
if (p.Name.ToLower() == name.ToLower()) | |||
{ | |||
if (p.GetValue(obj, null).GetType().FullName.Contains("System.Collections.Generic.List")) | |||
{ | |||
retstr = JsonConvert.SerializeObject(p.GetValue(obj, null)); | |||
} | |||
else | |||
{ | |||
retstr = p.GetValue(obj, null)?.ToString(); | |||
} | |||
} | |||
}); | |||
//输出字符串 | |||
return retstr; | |||
} | |||
} | |||
} |
@@ -0,0 +1,149 @@ | |||
using Furion.FriendlyException; | |||
using System; | |||
using System.Collections.Generic; | |||
using System.ComponentModel; | |||
using System.Linq; | |||
using System.Text; | |||
using System.Threading.Tasks; | |||
namespace BPA.SAAS.KitChenManageOrder.Web.Core.Handlers | |||
{ | |||
/// <summary> | |||
/// 系统错误码 | |||
/// </summary> | |||
[ErrorCodeType] | |||
[Description("系统错误码")] | |||
public enum ErrorCodeEnum | |||
{ | |||
/// <summary> | |||
/// 用户没有注册 | |||
/// </summary> | |||
[ErrorCodeItemMetadata("用户没有注册")] | |||
Code1000, | |||
/// <summary> | |||
/// 操作错误 | |||
/// </summary> | |||
[ErrorCodeItemMetadata("操作错误")] | |||
Code1001, | |||
/// <summary> | |||
/// 重复添加 | |||
/// </summary> | |||
[ErrorCodeItemMetadata("重复添加")] | |||
Code1002, | |||
/// <summary> | |||
/// 操作数据不存在 | |||
/// </summary> | |||
[ErrorCodeItemMetadata("操作数据不存在")] | |||
Code1003, | |||
/// <summary> | |||
/// key不正确 | |||
/// </summary> | |||
[ErrorCodeItemMetadata("key不正确")] | |||
Code1004, | |||
/// <summary> | |||
/// 签名错误 | |||
/// </summary> | |||
[ErrorCodeItemMetadata("签名错误")] | |||
Code1005, | |||
/// <summary> | |||
/// 签名错误 | |||
/// </summary> | |||
[ErrorCodeItemMetadata("签名过期")] | |||
Code1006, | |||
/// <summary> | |||
/// 系统异常 | |||
/// </summary> | |||
[ErrorCodeItemMetadata("系统异常")] | |||
Code1007, | |||
/// <summary> | |||
/// 商品不存在 | |||
/// </summary> | |||
[ErrorCodeItemMetadata("商品不存在")] | |||
Code1008, | |||
/// <summary> | |||
/// 场景id不能为空 | |||
/// </summary> | |||
[ErrorCodeItemMetadata("场景id不能为空")] | |||
Code1009, | |||
/// <summary> | |||
/// 产品不存在 | |||
/// </summary> | |||
[ErrorCodeItemMetadata("产品不存在")] | |||
Code10010, | |||
/// <summary> | |||
/// 产品版本不存在 | |||
/// </summary> | |||
[ErrorCodeItemMetadata("产品版本不存在")] | |||
Code10011, | |||
/// <summary> | |||
/// 设备不存在 | |||
/// </summary> | |||
[ErrorCodeItemMetadata("设备不存在")] | |||
Code10012, | |||
/// <summary> | |||
/// 产品标签不存在 | |||
/// </summary> | |||
[ErrorCodeItemMetadata("产品标签不存在")] | |||
Code10013, | |||
/// <summary> | |||
/// 授权过期 | |||
/// </summary> | |||
[ErrorCodeItemMetadata("授权过期")] | |||
Code10014, | |||
/// <summary> | |||
/// 配方不存在 | |||
/// </summary> | |||
[ErrorCodeItemMetadata("配方不存在")] | |||
Code10015, | |||
/// <summary> | |||
/// 下发错误 | |||
/// </summary> | |||
[ErrorCodeItemMetadata("操作成功,下发错误")] | |||
Code10016, | |||
/// <summary> | |||
/// 名称或编码重复 | |||
/// </summary> | |||
[ErrorCodeItemMetadata("名称或编码重复")] | |||
Code10017, | |||
/// <summary> | |||
/// 模板名称不能重复 | |||
/// </summary> | |||
[ErrorCodeItemMetadata("模板名称不能重复")] | |||
Code10018, | |||
/// <summary> | |||
/// 设备id不能为空 | |||
/// </summary> | |||
[ErrorCodeItemMetadata("设备id不能为空")] | |||
Code10019, | |||
/// <summary> | |||
/// 模板名称不能为空 | |||
/// </summary> | |||
[ErrorCodeItemMetadata("模板名称不能为空")] | |||
Code10020, | |||
/// <summary> | |||
/// 获取场景数据失败 | |||
/// </summary> | |||
[ErrorCodeItemMetadata("获取场景数据失败")] | |||
Code10021, | |||
/// <summary> | |||
/// 场景不存在 | |||
/// </summary> | |||
[ErrorCodeItemMetadata("场景不存在")] | |||
Code10022, | |||
/// <summary> | |||
/// 店铺授权失败 | |||
/// </summary> | |||
[ErrorCodeItemMetadata("店铺授权失败")] | |||
Code10023, | |||
} | |||
} |
@@ -0,0 +1,17 @@ | |||
using Furion.Authorization; | |||
using Microsoft.AspNetCore.Authorization; | |||
using Microsoft.AspNetCore.Http; | |||
using System.Threading.Tasks; | |||
namespace BPA.SAAS.KitChenManageOrder.Web.Core | |||
{ | |||
public class JwtHandler : AppAuthorizeHandler | |||
{ | |||
public override Task<bool> PipelineAsync(AuthorizationHandlerContext context, DefaultHttpContext httpContext) | |||
{ | |||
// 这里写您的授权判断逻辑,授权通过返回 true,否则返回 false | |||
return Task.FromResult(true); | |||
} | |||
} | |||
} |
@@ -0,0 +1,109 @@ | |||
using BPA.SAAS.KitChenManageOrder.Application.BaseDto; | |||
using BPA.SAAS.KitChenManageOrder.Core; | |||
using BPA.SAAS.KitChenManageOrder.Core.Entity; | |||
using Furion.FriendlyException; | |||
using Microsoft.AspNetCore.Http; | |||
using Microsoft.AspNetCore.Mvc.Controllers; | |||
using Microsoft.AspNetCore.Mvc.Filters; | |||
using Newtonsoft.Json; | |||
using System; | |||
using System.Collections.Generic; | |||
using System.Linq; | |||
using System.Reflection; | |||
using System.Text; | |||
using System.Threading.Tasks; | |||
namespace BPA.SAAS.KitChenManageOrder.Web.Core.Handlers | |||
{ | |||
public class RequestAuditFiltercs : IAsyncActionFilter | |||
{ | |||
private readonly CheckHandler _checkServices; | |||
public RequestAuditFiltercs() | |||
{ | |||
_checkServices = new CheckHandler(); | |||
} | |||
public async Task OnActionExecutionAsync(ActionExecutingContext context, ActionExecutionDelegate next) | |||
{ | |||
CurrentUser.MessageId = Guid.NewGuid().ToString(); | |||
//============== 这里是执行方法之前获取数据 ==================== | |||
// 获取 HttpContext 和 HttpRequest 对象 | |||
var httpContext = context.HttpContext; | |||
var httpRequest = httpContext.Request; | |||
// 获取客户端 Ipv4 地址 | |||
var remoteIPv4 = httpContext.GetRemoteIpAddressToIPv4(); | |||
// 获取请求的 Url 地址 | |||
var requestUrl = httpRequest.GetRequestUrlAddress(); | |||
// 获取来源 Url 地址 | |||
var refererUrl = httpRequest.GetRefererUrlAddress(); | |||
// 获取控制器、路由信息 | |||
var actionDescriptor = context.ActionDescriptor as ControllerActionDescriptor; | |||
// 获取请求的方法 | |||
var method = actionDescriptor.MethodInfo; | |||
// 获取请求参数(写入日志,需序列化成字符串后存储) | |||
var parameters = context.ActionArguments; | |||
//foreach (var parameter in parameters) | |||
//{ | |||
// var stingA = DtoValidator.GetSign(parameter.Value); | |||
// var vvvv = stingA; | |||
//} | |||
if (requestUrl.ToUpper().Contains("ExternalPlatform".ToUpper())) | |||
{ | |||
var key = httpRequest.Headers["key"]; | |||
var sign = httpRequest.Headers["sign"]; | |||
List<PropertyInfo> proplist = new List<PropertyInfo>(); | |||
if(string.IsNullOrWhiteSpace(key)) throw Oops.Oh(ErrorCodeEnum.Code1005); | |||
// if (string.IsNullOrWhiteSpace(sign)) throw Oops.Oh(ErrorCodeEnum.Code1005); | |||
foreach (var parameter in parameters) | |||
{ | |||
// var stingA = DtoValidator.GetSign(parameter.Value); | |||
//var sign = DtoValidator.GetAttributePrice(parameter.Value, "sign"); | |||
await _checkServices.CheckSign(key, "", sign); | |||
} | |||
} | |||
//============== 这里是执行方法之后获取数据 ==================== | |||
var actionContext = await next(); | |||
// 获取返回的结果 | |||
var returnResult = actionContext.Result; | |||
// 判断是否请求成功,没有异常就是请求成功 | |||
var isRequestSucceed = actionContext.Exception == null; | |||
if (requestUrl.ToUpper().Contains("ExternalPlatform".ToUpper())) | |||
{ | |||
try | |||
{ | |||
//记录日志 | |||
await SqlSugarDb.Db.Insertable(new BPA_ThirdpartyreQuestLog() | |||
{ | |||
Id = CurrentUser.MessageId, | |||
CreateBy = DateTime.Now.ToString(), | |||
GroupId = CurrentUser.GroupId, | |||
RequestUrl = requestUrl, | |||
ReauestMethod = httpRequest.Method, | |||
ReauestParm = JsonConvert.SerializeObject(parameters), | |||
ResultParm = !isRequestSucceed ? actionContext.Exception.ToString() : JsonConvert.SerializeObject(returnResult), | |||
IP = remoteIPv4 | |||
}).ExecuteCommandAsync(); | |||
} | |||
catch (Exception e) | |||
{ | |||
} | |||
} | |||
} | |||
} | |||
} |
@@ -0,0 +1,61 @@ | |||
using BPA.SAAS.KitChenManageOrder.Core; | |||
using BPA.SAAS.KitChenManageOrder.Web.Core.Handlers; | |||
using FluentValidation.AspNetCore; | |||
using Furion; | |||
using Microsoft.AspNetCore.Builder; | |||
using Microsoft.AspNetCore.Hosting; | |||
using Microsoft.Extensions.DependencyInjection; | |||
using Microsoft.Extensions.Hosting; | |||
using Newtonsoft.Json; | |||
namespace BPA.SAAS.KitChenManageOrder.Web.Core | |||
{ | |||
public class Startup : AppStartup | |||
{ | |||
public void ConfigureServices(IServiceCollection services) | |||
{ | |||
services.AddConsoleFormatter(); | |||
services.AddJwt<JwtHandler>(); | |||
services.AddRemoteRequest(); | |||
services.AddControllersWithViews() | |||
.AddFluentValidation(fv => | |||
{ | |||
fv.RegisterValidatorsFromAssemblies(App.Assemblies); | |||
}) | |||
.AddNewtonsoftJson(options => | |||
{ | |||
options.SerializerSettings.ReferenceLoopHandling = ReferenceLoopHandling.Ignore; | |||
options.SerializerSettings.DateFormatString = "yyyy-MM-dd HH:mm:ss"; | |||
}); | |||
services.AddCorsAccessor(); | |||
services.AddSqlsugarSetup(App.Configuration); | |||
services.AddControllers() | |||
.AddInjectWithUnifyResult(); | |||
services.AddMvcFilter<RequestAuditFiltercs>(); | |||
} | |||
public void Configure(IApplicationBuilder app, IWebHostEnvironment env) | |||
{ | |||
if (env.IsDevelopment()) | |||
{ | |||
app.UseDeveloperExceptionPage(); | |||
} | |||
app.UseHttpsRedirection(); | |||
app.UseRouting(); | |||
app.UseCorsAccessor(); | |||
app.UseAuthentication(); | |||
app.UseAuthorization(); | |||
app.UseInject(string.Empty); | |||
app.UseEndpoints(endpoints => | |||
{ | |||
endpoints.MapControllers(); | |||
}); | |||
} | |||
} | |||
} |
@@ -0,0 +1,22 @@ | |||
<Project Sdk="Microsoft.NET.Sdk.Web"> | |||
<PropertyGroup> | |||
<TargetFramework>net6.0</TargetFramework> | |||
<ImplicitUsings>enable</ImplicitUsings> | |||
<SatelliteResourceLanguages>en-US</SatelliteResourceLanguages> | |||
<PublishReadyToRunComposite>true</PublishReadyToRunComposite> | |||
</PropertyGroup> | |||
<ItemGroup> | |||
<ProjectReference Include="..\BPA.SAAS.KitChenManageOrder.Web.Core\BPA.SAAS.KitChenManageOrder.Web.Core.csproj" /> | |||
</ItemGroup> | |||
<ProjectExtensions> | |||
<VisualStudio> | |||
<UserProperties properties_4launchsettings_1json__JsonSchema="" /> | |||
</VisualStudio> | |||
</ProjectExtensions> | |||
</Project> |
@@ -0,0 +1,9 @@ | |||
<?xml version="1.0" encoding="utf-8"?> | |||
<Project ToolsVersion="Current" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> | |||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|AnyCPU'"> | |||
<DebuggerFlavor>ProjectDebugger</DebuggerFlavor> | |||
</PropertyGroup> | |||
<PropertyGroup> | |||
<ActiveDebugProfile>BPA.SAAS.KitChenManageOrder.Web.Entry</ActiveDebugProfile> | |||
</PropertyGroup> | |||
</Project> |
@@ -0,0 +1 @@ | |||
Serve.Run(RunOptions.Default.WithArgs(args)); |
@@ -0,0 +1,31 @@ | |||
{ | |||
"$schema": "http://json.schemastore.org/launchsettings.json", | |||
"iisSettings": { | |||
"windowsAuthentication": false, | |||
"anonymousAuthentication": true, | |||
"iisExpress": { | |||
"applicationUrl": "http://localhost:53785", | |||
"sslPort": 44342 | |||
} | |||
}, | |||
"profiles": { | |||
"IIS Express": { | |||
"commandName": "IISExpress", | |||
"launchBrowser": true, | |||
"launchUrl": "", | |||
"environmentVariables": { | |||
"ASPNETCORE_ENVIRONMENT": "Development" | |||
} | |||
}, | |||
"BPA.SAAS.KitChenManageOrder.Web.Entry": { | |||
"commandName": "Project", | |||
"dotnetRunMessages": true, | |||
"launchBrowser": true, | |||
"launchUrl": "", | |||
"applicationUrl": "http://192.168.1.19:5005", | |||
"environmentVariables": { | |||
"ASPNETCORE_ENVIRONMENT": "Development" | |||
} | |||
} | |||
} | |||
} |
@@ -0,0 +1,23 @@ | |||
using Furion; | |||
using System.Reflection; | |||
namespace BPA.SAAS.KitChenManageOrder.Web.Entry | |||
{ | |||
public class SingleFilePublish : ISingleFilePublish | |||
{ | |||
public Assembly[] IncludeAssemblies() | |||
{ | |||
return Array.Empty<Assembly>(); | |||
} | |||
public string[] IncludeAssemblyNames() | |||
{ | |||
return new[] | |||
{ | |||
"BPA.SAAS.KitChenManageOrder.Application", | |||
"BPA.SAAS.KitChenManageOrder.Core", | |||
"BPA.SAAS.KitChenManageOrder.Web.Core" | |||
}; | |||
} | |||
} | |||
} |
@@ -0,0 +1,10 @@ | |||
{ | |||
"$schema": "https://gitee.com/dotnetchina/Furion/raw/v4/schemas/v4/furion-schema.json", | |||
"Logging": { | |||
"LogLevel": { | |||
"Default": "Information", | |||
"Microsoft.AspNetCore": "Warning", | |||
"Microsoft.EntityFrameworkCore": "Information" | |||
} | |||
} | |||
} |
@@ -0,0 +1,27 @@ | |||
{ | |||
"$schema": "https://gitee.com/dotnetchina/Furion/raw/v4/schemas/v4/furion-schema.json", | |||
"Logging": { | |||
"LogLevel": { | |||
"Default": "Information", | |||
"Microsoft.AspNetCore": "Warning", | |||
"Microsoft.EntityFrameworkCore": "Information" | |||
} | |||
}, | |||
"AllowedHosts": "*", | |||
"SAAS_Manage": "http://192.168.1.19:5006/", | |||
"SAAS_KitManage": "http://192.168.1.19:5007/", | |||
"ConnectionConfigs": [ | |||
{ | |||
"ConnectionString": "server=10.2.1.21;Database=bpa_kitchen_kitchenorder;Uid=root;Pwd=cygadmin;Allow Zero Datetime=True;Convert Zero Datetime=True;", | |||
"DbType": "Mysql", | |||
"IsAutoCloseConnection": true | |||
} | |||
], | |||
"ConnectionConfigslog": [ | |||
{ | |||
"ConnectionString": "server=10.2.1.21;Database=bpa_kitchen_kitchenlog;Uid=root;Pwd=cygadmin;Allow Zero Datetime=True;Convert Zero Datetime=True;", | |||
"DbType": "Mysql", | |||
"IsAutoCloseConnection": true | |||
} | |||
] | |||
} |
@@ -0,0 +1,43 @@ | |||
| |||
Microsoft Visual Studio Solution File, Format Version 12.00 | |||
# Visual Studio Version 17 | |||
VisualStudioVersion = 17.4.33205.214 | |||
MinimumVisualStudioVersion = 10.0.40219.1 | |||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "BPA.SAAS.KitChenManageOrder.Application", "BPA.SAAS.KitChenManageOrder.Application\BPA.SAAS.KitChenManageOrder.Application.csproj", "{8C8D6B49-95AE-4584-B5B4-05A68796DEAB}" | |||
EndProject | |||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "BPA.SAAS.KitChenManageOrder.Core", "BPA.SAAS.KitChenManageOrder.Core\BPA.SAAS.KitChenManageOrder.Core.csproj", "{C222A590-D582-4962-8847-32CC5E2F60E4}" | |||
EndProject | |||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "BPA.SAAS.KitChenManageOrder.Web.Core", "BPA.SAAS.KitChenManageOrder.Web.Core\BPA.SAAS.KitChenManageOrder.Web.Core.csproj", "{351994A0-01F5-475A-B54B-C60F93ED6697}" | |||
EndProject | |||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "BPA.SAAS.KitChenManageOrder.Web.Entry", "BPA.SAAS.KitChenManageOrder.Web.Entry\BPA.SAAS.KitChenManageOrder.Web.Entry.csproj", "{5C6F0558-000E-4963-919F-62789927E3B3}" | |||
EndProject | |||
Global | |||
GlobalSection(SolutionConfigurationPlatforms) = preSolution | |||
Debug|Any CPU = Debug|Any CPU | |||
Release|Any CPU = Release|Any CPU | |||
EndGlobalSection | |||
GlobalSection(ProjectConfigurationPlatforms) = postSolution | |||
{8C8D6B49-95AE-4584-B5B4-05A68796DEAB}.Debug|Any CPU.ActiveCfg = Debug|Any CPU | |||
{8C8D6B49-95AE-4584-B5B4-05A68796DEAB}.Debug|Any CPU.Build.0 = Debug|Any CPU | |||
{8C8D6B49-95AE-4584-B5B4-05A68796DEAB}.Release|Any CPU.ActiveCfg = Release|Any CPU | |||
{8C8D6B49-95AE-4584-B5B4-05A68796DEAB}.Release|Any CPU.Build.0 = Release|Any CPU | |||
{C222A590-D582-4962-8847-32CC5E2F60E4}.Debug|Any CPU.ActiveCfg = Debug|Any CPU | |||
{C222A590-D582-4962-8847-32CC5E2F60E4}.Debug|Any CPU.Build.0 = Debug|Any CPU | |||
{C222A590-D582-4962-8847-32CC5E2F60E4}.Release|Any CPU.ActiveCfg = Release|Any CPU | |||
{C222A590-D582-4962-8847-32CC5E2F60E4}.Release|Any CPU.Build.0 = Release|Any CPU | |||
{351994A0-01F5-475A-B54B-C60F93ED6697}.Debug|Any CPU.ActiveCfg = Debug|Any CPU | |||
{351994A0-01F5-475A-B54B-C60F93ED6697}.Debug|Any CPU.Build.0 = Debug|Any CPU | |||
{351994A0-01F5-475A-B54B-C60F93ED6697}.Release|Any CPU.ActiveCfg = Release|Any CPU | |||
{351994A0-01F5-475A-B54B-C60F93ED6697}.Release|Any CPU.Build.0 = Release|Any CPU | |||
{5C6F0558-000E-4963-919F-62789927E3B3}.Debug|Any CPU.ActiveCfg = Debug|Any CPU | |||
{5C6F0558-000E-4963-919F-62789927E3B3}.Debug|Any CPU.Build.0 = Debug|Any CPU | |||
{5C6F0558-000E-4963-919F-62789927E3B3}.Release|Any CPU.ActiveCfg = Release|Any CPU | |||
{5C6F0558-000E-4963-919F-62789927E3B3}.Release|Any CPU.Build.0 = Release|Any CPU | |||
EndGlobalSection | |||
GlobalSection(SolutionProperties) = preSolution | |||
HideSolutionNode = FALSE | |||
EndGlobalSection | |||
GlobalSection(ExtensibilityGlobals) = postSolution | |||
SolutionGuid = {65F657E6-8CE3-4E5E-A009-670FA4A23B0C} | |||
EndGlobalSection | |||
EndGlobal |