Squashed commit of the following:
commitee0ee9b167Merge:e78ab0bcd4888dAuthor: liguoyang <Ligy.97@foxmail.com> Date: Tue Mar 19 12:07:22 2024 +0800 Merge branch 'development' of https://git.dlhis.com/liguoyang/jinko.yikatong into development commite78ab0baeaAuthor: liguoyang <Ligy.97@foxmail.com> Date: Tue Mar 19 12:06:13 2024 +0800 fix 增加权限控制 commit793a3325f2Author: liguoyang <Ligy.97@foxmail.com> Date: Tue Mar 19 10:24:41 2024 +0800 Squashed commit of the following: commit d4ab7d407a141b80024f85eeaab0062bea016051 Author: liguoyang <Ligy.97@foxmail.com> Date: Tue Mar 19 10:23:30 2024 +0800 merge error commit 6204fa4ed15e0be303f7eb62307476725b8e7e36 Merge: 7290f0b aaeacf4 Author: liguoyang <Ligy.97@foxmail.com> Date: Tue Mar 19 10:19:41 2024 +0800 Merge branch 'feat-PlacePermission' of https://git.dlhis.com/liguoyang/jinko.yikatong into feat-PlacePermission commit 7290f0bd822c0e2bd957908fd58f6e99f22ad46b Author: cheche <717840555@qq.com> Date: Tue Mar 12 15:05:28 2024 +0800 fix 获取用户权限设备 优化 commit 41b94fa3a9596a38cda1b4bf4f345ce13fe5677a Author: cheche <717840555@qq.com> Date: Tue Mar 12 13:13:23 2024 +0800 fix 第一 commit aaeacf4ffa778eb6a6104e2349357644d038151b Author: cheche <717840555@qq.com> Date: Tue Mar 12 15:05:28 2024 +0800 fix 获取用户权限设备 优化 commit 9e6099c52d0318cba35e7c082cb4d3085b46b0fa Author: cheche <717840555@qq.com> Date: Tue Mar 12 14:00:53 2024 +0800 fix 营业点配置权限 commit b4565e34f48da0e5ef1d3dffa59d0ccf0d950920 Author: cheche <717840555@qq.com> Date: Tue Mar 12 13:13:23 2024 +0800 fix 第一 commit153f0ecd2aAuthor: cheche <717840555@qq.com> Date: Tue Mar 19 09:58:31 2024 +0800 fix 返回支付方式中文描述 commite548c780b8Author: liguoyang <Ligy.97@foxmail.com> Date: Mon Mar 18 16:59:45 2024 +0800 fix 优化送餐 commitfa376f7671Author: liguoyang <Ligy.97@foxmail.com> Date: Mon Mar 18 16:11:45 2024 +0800 fix 参数结构调整 commit1b58ca69bfAuthor: liguoyang <Ligy.97@foxmail.com> Date: Mon Mar 18 15:57:18 2024 +0800 fix 餐次数据补充 commite8a98c614cAuthor: liguoyang <Ligy.97@foxmail.com> Date: Mon Mar 18 15:11:56 2024 +0800 add 补充实体变更 commit4651adedc3Author: liguoyang <Ligy.97@foxmail.com> Date: Mon Mar 18 15:11:38 2024 +0800 fix 优化查询,增加详情接口 commitad48e37273Author: liguoyang <Ligy.97@foxmail.com> Date: Mon Mar 18 15:09:16 2024 +0800 fix 枚举code过滤 commitabf2e2ed29Author: cheche <717840555@qq.com> Date: Mon Mar 18 14:44:15 2024 +0800 fix 获取订餐最晚时间 commit00869111dfAuthor: cheche <717840555@qq.com> Date: Mon Mar 18 14:21:19 2024 +0800 fix 检验权限修改 commit7b83014119Author: liguoyang <Ligy.97@foxmail.com> Date: Mon Mar 18 13:42:35 2024 +0800 fix 优化菜品保存和分页 commitfefc785b66Author: cheche <717840555@qq.com> Date: Mon Mar 18 14:17:19 2024 +0800 fix 修改营业点返回体 commit3b7874a2a0Author: cheche <717840555@qq.com> Date: Mon Mar 18 12:14:06 2024 +0800 fix currentUser commitc825531fdaAuthor: liguoyang <Ligy.97@foxmail.com> Date: Mon Mar 18 11:03:43 2024 +0800 fix 提交可编译版本 commit8f430bccd3Author: cheche <717840555@qq.com> Date: Mon Mar 18 11:48:38 2024 +0800 fix GetDishesMenusBookingResponse修改字段 commit69c60dc459Author: liguoyang <Ligy.97@foxmail.com> Date: Mon Mar 18 10:59:52 2024 +0800 fix 增加日期返回 commitfadee3861aAuthor: cheche <717840555@qq.com> Date: Mon Mar 18 11:01:31 2024 +0800 fix GetDishesMenusBookingSetting返回体修改 commit058b989eadAuthor: cheche <717840555@qq.com> Date: Mon Mar 18 10:54:28 2024 +0800 fix 获取营业点下面餐次 commita82e7ff798Author: liguoyang <Ligy.97@foxmail.com> Date: Mon Mar 18 10:28:56 2024 +0800 fix 命名空间调整 commit9acdab4e01Author: liguoyang <Ligy.97@foxmail.com> Date: Mon Mar 18 10:27:46 2024 +0800 fix 更新控制器名称 commit3005443392Author: liguoyang <Ligy.97@foxmail.com> Date: Mon Mar 18 10:01:03 2024 +0800 feat 菜品/菜单配置 commita59404711cAuthor: liguoyang <Ligy.97@foxmail.com> Date: Sun Mar 17 21:26:16 2024 +0800 feat 获取服务时间 commitba0fe3e67fAuthor: liguoyang <Ligy.97@foxmail.com> Date: Sun Mar 17 20:58:11 2024 +0800 fix 处理next空数组 commit97fb157c9fAuthor: liguoyang <Ligy.97@foxmail.com> Date: Fri Mar 15 20:49:44 2024 +0800 fix 营业点权限调整 commit70420b9668Author: cheche <717840555@qq.com> Date: Fri Mar 15 18:54:15 2024 +0800 fix 修改IBusinessPlacePermissionsService commit6f2383c663Author: cheche <717840555@qq.com> Date: Fri Mar 15 18:47:33 2024 +0800 fix api commit99e1c8f125Author: liguoyang <Ligy.97@foxmail.com> Date: Fri Mar 15 18:03:09 2024 +0800 fix 实体变更 commitd327e9e3aaAuthor: liguoyang <Ligy.97@foxmail.com> Date: Fri Mar 15 16:06:17 2024 +0800 fix 临时修改送餐代码 commit4825648e41Author: liguoyang <Ligy.97@foxmail.com> Date: Fri Mar 15 15:13:53 2024 +0800 fix 按基地分配获取值错误 commit8ed8addbf3Author: cheche <717840555@qq.com> Date: Fri Mar 15 15:10:55 2024 +0800 fix 表增加ITenantid commitcd4888d900Author: liguoyang <Ligy.97@foxmail.com> Date: Tue Mar 19 12:06:13 2024 +0800 fix 增加权限控制 commit1cd9b2467eAuthor: liguoyang <Ligy.97@foxmail.com> Date: Tue Mar 19 10:24:41 2024 +0800 Squashed commit of the following: commit d4ab7d407a141b80024f85eeaab0062bea016051 Author: liguoyang <Ligy.97@foxmail.com> Date: Tue Mar 19 10:23:30 2024 +0800 merge error commit 6204fa4ed15e0be303f7eb62307476725b8e7e36 Merge: 7290f0b aaeacf4 Author: liguoyang <Ligy.97@foxmail.com> Date: Tue Mar 19 10:19:41 2024 +0800 Merge branch 'feat-PlacePermission' of https://git.dlhis.com/liguoyang/jinko.yikatong into feat-PlacePermission commit 7290f0bd822c0e2bd957908fd58f6e99f22ad46b Author: cheche <717840555@qq.com> Date: Tue Mar 12 15:05:28 2024 +0800 fix 获取用户权限设备 优化 commit 41b94fa3a9596a38cda1b4bf4f345ce13fe5677a Author: cheche <717840555@qq.com> Date: Tue Mar 12 13:13:23 2024 +0800 fix 第一 commit aaeacf4ffa778eb6a6104e2349357644d038151b Author: cheche <717840555@qq.com> Date: Tue Mar 12 15:05:28 2024 +0800 fix 获取用户权限设备 优化 commit 9e6099c52d0318cba35e7c082cb4d3085b46b0fa Author: cheche <717840555@qq.com> Date: Tue Mar 12 14:00:53 2024 +0800 fix 营业点配置权限 commit b4565e34f48da0e5ef1d3dffa59d0ccf0d950920 Author: cheche <717840555@qq.com> Date: Tue Mar 12 13:13:23 2024 +0800 fix 第一 commited25ab626aAuthor: cheche <717840555@qq.com> Date: Tue Mar 19 09:58:31 2024 +0800 fix 返回支付方式中文描述 commitc4b48131d2Author: liguoyang <Ligy.97@foxmail.com> Date: Mon Mar 18 16:59:45 2024 +0800 fix 优化送餐 commit8f26e7e84bAuthor: liguoyang <Ligy.97@foxmail.com> Date: Mon Mar 18 16:11:45 2024 +0800 fix 参数结构调整 commit8307d1d941Author: liguoyang <Ligy.97@foxmail.com> Date: Mon Mar 18 15:57:18 2024 +0800 fix 餐次数据补充 commit068a5b9507Author: liguoyang <Ligy.97@foxmail.com> Date: Mon Mar 18 15:11:56 2024 +0800 add 补充实体变更 commit805f0f83d1Author: liguoyang <Ligy.97@foxmail.com> Date: Mon Mar 18 15:11:38 2024 +0800 fix 优化查询,增加详情接口 commit9ef57fba55Author: liguoyang <Ligy.97@foxmail.com> Date: Mon Mar 18 15:09:16 2024 +0800 fix 枚举code过滤 commit0124fa4bc9Author: cheche <717840555@qq.com> Date: Mon Mar 18 14:44:15 2024 +0800 fix 获取订餐最晚时间 commitfd4a925b4aAuthor: cheche <717840555@qq.com> Date: Mon Mar 18 14:21:19 2024 +0800 fix 检验权限修改 commite6dee2d504Merge:2cbf894b3b9962Author: cheche <717840555@qq.com> Date: Mon Mar 18 14:18:15 2024 +0800 fix 解决dishersservice冲突 commit2cbf894ea8Author: cheche <717840555@qq.com> Date: Mon Mar 18 14:17:19 2024 +0800 fix 修改营业点返回体 commitb3b99623e3Author: liguoyang <Ligy.97@foxmail.com> Date: Mon Mar 18 13:42:35 2024 +0800 fix 优化菜品保存和分页 commitfcc1f134edAuthor: cheche <717840555@qq.com> Date: Mon Mar 18 12:14:06 2024 +0800 fix currentUser commit253caf26c1Merge:c743d2d63ded81Author: cheche <717840555@qq.com> Date: Mon Mar 18 11:48:41 2024 +0800 Merge branch 'development' of https://git.dlhis.com/liguoyang/jinko.yikatong into development commitc743d2d1c5Author: cheche <717840555@qq.com> Date: Mon Mar 18 11:48:38 2024 +0800 fix GetDishesMenusBookingResponse修改字段 commit63ded819c5Merge:5fe41043b46ac2Author: liguoyang <Ligy.97@foxmail.com> Date: Mon Mar 18 11:03:45 2024 +0800 Merge branch 'development' of https://git.dlhis.com/liguoyang/jinko.yikatong into development commit5fe4104ff6Author: liguoyang <Ligy.97@foxmail.com> Date: Mon Mar 18 11:03:43 2024 +0800 fix 提交可编译版本 commit3b46ac25a7Merge:11a3a0aa2eca2cAuthor: cheche <717840555@qq.com> Date: Mon Mar 18 11:01:33 2024 +0800 Merge branch 'development' of https://git.dlhis.com/liguoyang/jinko.yikatong into development commit11a3a0adedAuthor: cheche <717840555@qq.com> Date: Mon Mar 18 11:01:31 2024 +0800 fix GetDishesMenusBookingSetting返回体修改 commita2eca2cdebAuthor: liguoyang <Ligy.97@foxmail.com> Date: Mon Mar 18 10:59:52 2024 +0800 fix 增加日期返回 commit0bed0bc97bAuthor: cheche <717840555@qq.com> Date: Mon Mar 18 10:54:28 2024 +0800 fix 获取营业点下面餐次 commitc1d84ae1c6Author: liguoyang <Ligy.97@foxmail.com> Date: Mon Mar 18 10:28:56 2024 +0800 fix 命名空间调整 commite2cc31003fAuthor: liguoyang <Ligy.97@foxmail.com> Date: Mon Mar 18 10:27:46 2024 +0800 fix 更新控制器名称 commitab406adecfAuthor: liguoyang <Ligy.97@foxmail.com> Date: Mon Mar 18 10:01:03 2024 +0800 feat 菜品/菜单配置 commit6ba2d7d6a2Author: liguoyang <Ligy.97@foxmail.com> Date: Sun Mar 17 21:26:16 2024 +0800 feat 获取服务时间 commit6872518b65Author: liguoyang <Ligy.97@foxmail.com> Date: Sun Mar 17 20:58:11 2024 +0800 fix 处理next空数组 commit423d90bf3dAuthor: liguoyang <Ligy.97@foxmail.com> Date: Fri Mar 15 20:49:44 2024 +0800 fix 营业点权限调整 commit220ff2d963Author: cheche <717840555@qq.com> Date: Fri Mar 15 18:54:15 2024 +0800 fix 修改IBusinessPlacePermissionsService commit72f93a59a6Author: cheche <717840555@qq.com> Date: Fri Mar 15 18:47:33 2024 +0800 fix api commit149660ca0fAuthor: liguoyang <Ligy.97@foxmail.com> Date: Fri Mar 15 18:03:09 2024 +0800 fix 实体变更 commit9a84143315Author: liguoyang <Ligy.97@foxmail.com> Date: Fri Mar 15 16:06:17 2024 +0800 fix 临时修改送餐代码 commit328ef5f42cAuthor: liguoyang <Ligy.97@foxmail.com> Date: Fri Mar 15 15:13:53 2024 +0800 fix 按基地分配获取值错误 commitea4a15c44bMerge:a3112eb255f4b4Author: liguoyang <Ligy.97@foxmail.com> Date: Fri Mar 15 15:13:37 2024 +0800 Merge branch 'development' of https://git.dlhis.com/liguoyang/jinko.yikatong into development commit255f4b4a13Author: cheche <717840555@qq.com> Date: Fri Mar 15 15:10:55 2024 +0800 fix 表增加ITenantid
This commit is contained in:
@@ -10,8 +10,4 @@
|
|||||||
<PackageReference Include="Kurisu.RemoteCall" Version="0.0.3" />
|
<PackageReference Include="Kurisu.RemoteCall" Version="0.0.3" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
|
||||||
<ItemGroup>
|
|
||||||
<Folder Include="Response\" />
|
|
||||||
</ItemGroup>
|
|
||||||
|
|
||||||
</Project>
|
</Project>
|
||||||
|
|||||||
20
Src/Dlhis.Basic.Api/Dtos/DishesMenuDetailDto.cs
Normal file
20
Src/Dlhis.Basic.Api/Dtos/DishesMenuDetailDto.cs
Normal file
@@ -0,0 +1,20 @@
|
|||||||
|
namespace Dlhis.Basic.Api.Dtos;
|
||||||
|
|
||||||
|
public class DishesMenuDetailDto
|
||||||
|
{
|
||||||
|
public DateTime Date { get; set; }
|
||||||
|
|
||||||
|
public long MenuId { get; set; }
|
||||||
|
|
||||||
|
public long DishesId { get; set; }
|
||||||
|
|
||||||
|
public string DishesCode { get; set; }
|
||||||
|
|
||||||
|
public string DishesName { get; set; }
|
||||||
|
|
||||||
|
public decimal Price { get; set; }
|
||||||
|
|
||||||
|
public int Number { get; set; }
|
||||||
|
|
||||||
|
public int Version { get; set; }
|
||||||
|
}
|
||||||
13
Src/Dlhis.Basic.Api/IBusinessPlacePermissionsApi.cs
Normal file
13
Src/Dlhis.Basic.Api/IBusinessPlacePermissionsApi.cs
Normal file
@@ -0,0 +1,13 @@
|
|||||||
|
using Dlhis.Basic.Api.Response;
|
||||||
|
using Kurisu.Core.Result;
|
||||||
|
using Kurisu.RemoteCall.Attributes;
|
||||||
|
|
||||||
|
namespace Dlhis.Basic.Api;
|
||||||
|
|
||||||
|
[EnableRemoteClient(Name = "basic-service", BaseUrl = "${InternalRequest:BasicRequestUrl}")]
|
||||||
|
public interface IBusinessPlacePermissionsApi
|
||||||
|
{
|
||||||
|
[Auth]
|
||||||
|
[Get("/api/businessplacepermissions/my")]
|
||||||
|
Task<DefaultApiResult<GetMyResponse>> GetMyAsync();
|
||||||
|
}
|
||||||
21
Src/Dlhis.Basic.Api/IDisheMenuApi.cs
Normal file
21
Src/Dlhis.Basic.Api/IDisheMenuApi.cs
Normal file
@@ -0,0 +1,21 @@
|
|||||||
|
using Dlhis.Basic.Api.Dtos;
|
||||||
|
using Kurisu.Core.Result;
|
||||||
|
using Kurisu.RemoteCall.Attributes;
|
||||||
|
|
||||||
|
namespace Dlhis.Basic.Api;
|
||||||
|
|
||||||
|
[EnableRemoteClient(Name = "basic-service", BaseUrl = "${InternalRequest:BasicRequestUrl}")]
|
||||||
|
public interface IDisheMenuApi
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="date"></param>
|
||||||
|
/// <param name="businessPlaceCode"></param>
|
||||||
|
/// <param name="shiftType"></param>
|
||||||
|
/// <param name="dishesCode"></param>
|
||||||
|
/// <returns></returns>
|
||||||
|
[Auth]
|
||||||
|
[Get("/api/dishesMenus/detail")]
|
||||||
|
Task<DefaultApiResult<DishesMenuDetailDto>> GetBookingDishesDetailAsync(DateTime date, Guid businessPlaceCode, int shiftType, string dishesCode);
|
||||||
|
}
|
||||||
@@ -0,0 +1,18 @@
|
|||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Text;
|
||||||
|
using System.Threading.Tasks;
|
||||||
|
|
||||||
|
namespace Dlhis.Basic.Api.Request
|
||||||
|
{
|
||||||
|
public class SaveBusinessPlacePermissionRequest
|
||||||
|
{
|
||||||
|
public long? Id { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 营业点
|
||||||
|
/// </summary>
|
||||||
|
public Guid BusinessPlaceCode { get; set; }
|
||||||
|
}
|
||||||
|
}
|
||||||
14
Src/Dlhis.Basic.Api/Response/BusinessPlaceDto.cs
Normal file
14
Src/Dlhis.Basic.Api/Response/BusinessPlaceDto.cs
Normal file
@@ -0,0 +1,14 @@
|
|||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Text;
|
||||||
|
using System.Threading.Tasks;
|
||||||
|
|
||||||
|
namespace Dlhis.Basic.Api.Response
|
||||||
|
{
|
||||||
|
public class BusinessPlaceDto
|
||||||
|
{
|
||||||
|
public Guid Code { get; set; }
|
||||||
|
public string Name { get; set; }
|
||||||
|
}
|
||||||
|
}
|
||||||
13
Src/Dlhis.Basic.Api/Response/GetMyResponse.cs
Normal file
13
Src/Dlhis.Basic.Api/Response/GetMyResponse.cs
Normal file
@@ -0,0 +1,13 @@
|
|||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Text;
|
||||||
|
using System.Threading.Tasks;
|
||||||
|
|
||||||
|
namespace Dlhis.Basic.Api.Response
|
||||||
|
{
|
||||||
|
public class GetMyResponse
|
||||||
|
{
|
||||||
|
public List<BusinessPlaceDto> dtos { get; set; }
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,59 @@
|
|||||||
|
using Dlhis.Basic.BusinessPlace.Request;
|
||||||
|
using Dlhis.Basic.BusinessPlace.Response;
|
||||||
|
using Dlhis.Basic.BusinessPlace.Services;
|
||||||
|
using Kurisu.Core.DataAccess.Dto;
|
||||||
|
using Microsoft.AspNetCore.Authorization;
|
||||||
|
using Microsoft.AspNetCore.Mvc;
|
||||||
|
|
||||||
|
namespace Dlhis.Basic.BusinessPlace.Controllers;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 营业点管理
|
||||||
|
/// </summary>
|
||||||
|
[Authorize]
|
||||||
|
[Route("api/[controller]")]
|
||||||
|
[ApiController]
|
||||||
|
public class BusinessPlacePermissionsController
|
||||||
|
{
|
||||||
|
private readonly IBusinessPlacePermissionsService _businessPlacePermissionsService;
|
||||||
|
|
||||||
|
public BusinessPlacePermissionsController(IBusinessPlacePermissionsService businessPlacePermissionsService)
|
||||||
|
{
|
||||||
|
_businessPlacePermissionsService = businessPlacePermissionsService;
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 分页
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="request"></param>
|
||||||
|
/// <returns></returns>
|
||||||
|
[Authorize(Roles = "admin,tenant-admin")]
|
||||||
|
[HttpGet("page")]
|
||||||
|
public async Task<Pagination<BusinessPlacePermissionPageResponse>> GetPageAsync([FromQuery] BusinessPlacePermissionPageRequest request)
|
||||||
|
{
|
||||||
|
return await _businessPlacePermissionsService.GetPageAsync(request);
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 获取我的营业点
|
||||||
|
/// </summary>
|
||||||
|
/// <returns></returns>
|
||||||
|
[HttpGet("my")]
|
||||||
|
public async Task<GetMyResponse> GetMy()
|
||||||
|
{
|
||||||
|
return await _businessPlacePermissionsService.GetMyAsync();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 保存营业点
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="request"></param>
|
||||||
|
/// <returns></returns>
|
||||||
|
[Authorize(Roles = "admin,tenant-admin")]
|
||||||
|
[HttpPost("save")]
|
||||||
|
public async Task SaveBusinessPlacePermissionAsync(SaveBusinessPlacePermissionRequest request)
|
||||||
|
{
|
||||||
|
await _businessPlacePermissionsService.SaveBusinessPlacePermissionAsync(request);
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -43,9 +43,9 @@ public class BusinessPlacesController : ControllerBase
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
[HttpGet("list")]
|
[HttpGet("list")]
|
||||||
public async Task<List<BusinessPlaceResponse>> GetOpenedListAsync()
|
public async Task<List<BusinessPlaceListResponse>> GetOpenedListAsync(Guid? placeCode)
|
||||||
{
|
{
|
||||||
return await _businessPlaceService.GetOpenedListAsync();
|
return await _businessPlaceService.GetOpenedListAsync(placeCode);
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
@@ -100,7 +100,7 @@ public class BusinessPlacesController : ControllerBase
|
|||||||
/// <param name="request"></param>
|
/// <param name="request"></param>
|
||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
[HttpGet("devicenos")]
|
[HttpGet("devicenos")]
|
||||||
public async Task<Pagination<DeviceCodeNameDetail>> GetDevicesByCode([FromQuery]BusinessPlaceGetByCodeRequest request)
|
public async Task<Pagination<DeviceCodeNameDetail>> GetDevicesByCode([FromQuery] BusinessPlaceGetByCodeRequest request)
|
||||||
{
|
{
|
||||||
return await _businessPlaceShiftService.GetDevicesByCode(request);
|
return await _businessPlaceShiftService.GetDevicesByCode(request);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -0,0 +1,7 @@
|
|||||||
|
using Kurisu.Core.DataAccess.Dto;
|
||||||
|
|
||||||
|
namespace Dlhis.Basic.BusinessPlace.Request;
|
||||||
|
|
||||||
|
public class BusinessPlacePermissionPageRequest : PageDto
|
||||||
|
{
|
||||||
|
}
|
||||||
@@ -0,0 +1,18 @@
|
|||||||
|
using SqlSugar;
|
||||||
|
|
||||||
|
namespace Dlhis.Basic.BusinessPlace.Request;
|
||||||
|
|
||||||
|
public class SaveBusinessPlacePermissionRequest
|
||||||
|
{
|
||||||
|
public long? Id { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 管理人员userId
|
||||||
|
/// </summary>
|
||||||
|
public int UserId { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 营业点
|
||||||
|
/// </summary>
|
||||||
|
public Guid BusinessPlaceCode { get; set; }
|
||||||
|
}
|
||||||
@@ -0,0 +1,8 @@
|
|||||||
|
namespace Dlhis.Basic.BusinessPlace.Response
|
||||||
|
{
|
||||||
|
public class BusinessPlaceDto
|
||||||
|
{
|
||||||
|
public Guid Code { get; set; }
|
||||||
|
public string Name { get; set; }
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,11 @@
|
|||||||
|
using Dlhis.Entity.Canteen.Enums;
|
||||||
|
|
||||||
|
namespace Dlhis.Basic.BusinessPlace.Response;
|
||||||
|
|
||||||
|
public class BusinessPlaceListResponse : BusinessPlaceResponse
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// 餐次
|
||||||
|
/// </summary>
|
||||||
|
public List<Dictionary<int, string>> ShiftTypes { get; set; }
|
||||||
|
}
|
||||||
@@ -0,0 +1,26 @@
|
|||||||
|
namespace Dlhis.Basic.BusinessPlace.Response;
|
||||||
|
|
||||||
|
public class BusinessPlacePermissionPageResponse
|
||||||
|
{
|
||||||
|
public long Id { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 用户id
|
||||||
|
/// </summary>
|
||||||
|
public string UserId { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 用户name
|
||||||
|
/// </summary>
|
||||||
|
public string UserName { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 营业点code
|
||||||
|
/// </summary>
|
||||||
|
public Guid BusinessPlaceCode { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 营业点名称
|
||||||
|
/// </summary>
|
||||||
|
public string BusinessPlaceName { get; set; }
|
||||||
|
}
|
||||||
@@ -50,12 +50,12 @@ public class BusinessPlaceResponse
|
|||||||
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 餐次code
|
/// 餐别code
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public Guid? ShiftCode { get; set; }
|
public Guid? ShiftCode { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 餐次名称
|
/// 餐别名称
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public string ShiftName { get; set; }
|
public string ShiftName { get; set; }
|
||||||
}
|
}
|
||||||
|
|||||||
7
Src/Dlhis.Basic/BusinessPlace/Response/GetMyResponse.cs
Normal file
7
Src/Dlhis.Basic/BusinessPlace/Response/GetMyResponse.cs
Normal file
@@ -0,0 +1,7 @@
|
|||||||
|
namespace Dlhis.Basic.BusinessPlace.Response
|
||||||
|
{
|
||||||
|
public class GetMyResponse
|
||||||
|
{
|
||||||
|
public List<BusinessPlaceDto> dtos { get; set; }
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,14 @@
|
|||||||
|
using Dlhis.Basic.BusinessPlace.Request;
|
||||||
|
using Dlhis.Basic.BusinessPlace.Response;
|
||||||
|
using Kurisu.Core.DataAccess.Dto;
|
||||||
|
|
||||||
|
namespace Dlhis.Basic.BusinessPlace.Services;
|
||||||
|
|
||||||
|
public interface IBusinessPlacePermissionsService : IScopeDependency
|
||||||
|
{
|
||||||
|
Task<Pagination<BusinessPlacePermissionPageResponse>> GetPageAsync(BusinessPlacePermissionPageRequest request);
|
||||||
|
|
||||||
|
Task SaveBusinessPlacePermissionAsync(SaveBusinessPlacePermissionRequest request);
|
||||||
|
|
||||||
|
Task<GetMyResponse> GetMyAsync();
|
||||||
|
}
|
||||||
@@ -17,7 +17,7 @@ public interface IBusinessPlaceService : IScopeDependency
|
|||||||
/// 获取可用的营业点
|
/// 获取可用的营业点
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
Task<List<BusinessPlaceResponse>> GetOpenedListAsync();
|
Task<List<BusinessPlaceListResponse>> GetOpenedListAsync(Guid? placeCode);
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 保存营业点
|
/// 保存营业点
|
||||||
|
|||||||
@@ -0,0 +1,66 @@
|
|||||||
|
using Dlhis.Basic.BusinessPlace.Request;
|
||||||
|
using Dlhis.Basic.BusinessPlace.Response;
|
||||||
|
using Dlhis.Entity.Basic.Entity;
|
||||||
|
using Kurisu.Core.DataAccess.Dto;
|
||||||
|
using Kurisu.Core.User.Abstractions;
|
||||||
|
using Kurisu.SqlSugar.Services;
|
||||||
|
using Mapster;
|
||||||
|
|
||||||
|
namespace Dlhis.Basic.BusinessPlace.Services.Implements;
|
||||||
|
|
||||||
|
public class BusinessPlacePermissionsService : IBusinessPlacePermissionsService
|
||||||
|
{
|
||||||
|
private readonly IDbContext _dbContext;
|
||||||
|
private readonly ICurrentUser _currentUser;
|
||||||
|
|
||||||
|
public BusinessPlacePermissionsService(IDbContext dbContext, ICurrentUser currentUser)
|
||||||
|
{
|
||||||
|
_dbContext = dbContext;
|
||||||
|
_currentUser = currentUser;
|
||||||
|
}
|
||||||
|
|
||||||
|
public async Task<Pagination<BusinessPlacePermissionPageResponse>> GetPageAsync(BusinessPlacePermissionPageRequest request)
|
||||||
|
{
|
||||||
|
throw new NotImplementedException();
|
||||||
|
}
|
||||||
|
|
||||||
|
public async Task<GetMyResponse> GetMyAsync()
|
||||||
|
{
|
||||||
|
var userId = _currentUser.GetIntSubjectId();
|
||||||
|
|
||||||
|
var guids = await _dbContext.Queryable<BusinessPlaceManagerRelationshipEntity>()
|
||||||
|
.Where(x => x.ManagerUserId == userId)
|
||||||
|
.Select(x => x.BusinessPlaceCode)
|
||||||
|
.Distinct()
|
||||||
|
.ToListAsync();
|
||||||
|
|
||||||
|
var dtos = await _dbContext.Queryable<BusinessPlaceEntity>()
|
||||||
|
.Where(x => guids.Contains(x.Code))
|
||||||
|
.Select<BusinessPlaceDto>()
|
||||||
|
.ToListAsync();
|
||||||
|
var myResponse = new GetMyResponse
|
||||||
|
{
|
||||||
|
dtos = dtos
|
||||||
|
};
|
||||||
|
return myResponse;
|
||||||
|
}
|
||||||
|
|
||||||
|
public async Task SaveBusinessPlacePermissionAsync(SaveBusinessPlacePermissionRequest request)
|
||||||
|
{
|
||||||
|
var userId = _currentUser.GetIntSubjectId();
|
||||||
|
if (request.Id.HasValue)
|
||||||
|
{
|
||||||
|
var entity = await _dbContext.Queryable<BusinessPlaceManagerRelationshipEntity>()
|
||||||
|
.Where(x => x.Id == request.Id).FirstAsync();
|
||||||
|
|
||||||
|
request.Adapt(entity);
|
||||||
|
await _dbContext.UpdateAsync(entity);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
var entity = request.Adapt<BusinessPlaceManagerRelationshipEntity>();
|
||||||
|
entity.ManagerUserId = userId;
|
||||||
|
await _dbContext.InsertAsync(entity);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -49,12 +49,46 @@ public class BusinessPlaceService : IBusinessPlaceService
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public async Task<List<BusinessPlaceResponse>> GetOpenedListAsync()
|
public async Task<List<BusinessPlaceListResponse>> GetOpenedListAsync(Guid? placeCode)
|
||||||
{
|
{
|
||||||
return await _dbContext.Queryable<BusinessPlaceEntity>()
|
var list = await _dbContext.Queryable<BusinessPlaceEntity>()
|
||||||
.Where(x => x.Status == CanteenBusinessPlaceStatusEnumType.Opened)
|
.LeftJoin<BusinessPlaceShiftRelationshipEntity>((x, ps) => x.Code == ps.PlaceCode)
|
||||||
.Select<BusinessPlaceResponse>()
|
.LeftJoin<BusinessShiftEntity>((x, ps, s) => s.Code == ps.ShiftCode)
|
||||||
|
.Where(x => x.Status == CanteenBusinessPlaceStatusEnumType.Opened)
|
||||||
|
.WhereIF(placeCode.HasValue, x => x.Code == placeCode)
|
||||||
|
.Select((x, ps, s) => new BusinessPlaceListResponse
|
||||||
|
{
|
||||||
|
Id = x.Id,
|
||||||
|
Code = x.Code,
|
||||||
|
Status = x.Status,
|
||||||
|
Name = x.Name,
|
||||||
|
Catalog = x.Catalog,
|
||||||
|
CustomCode = x.CustomCode,
|
||||||
|
Source = x.Source,
|
||||||
|
Supplier = x.Supplier,
|
||||||
|
ShiftCode = s.Code,
|
||||||
|
ShiftName = s.Name,
|
||||||
|
})
|
||||||
.ToListAsync();
|
.ToListAsync();
|
||||||
|
|
||||||
|
var shiftCodes = list.Where(x => x.ShiftCode.HasValue).Select(x => x.ShiftCode.Value).ToList();
|
||||||
|
|
||||||
|
var shiftTypes = await _dbContext.Queryable<BusinessShiftMealRelationshipEntity>()
|
||||||
|
.Where(x => shiftCodes.Contains(x.ShiftCode))
|
||||||
|
.Select(x => new { x.ShiftCode, x.ShiftType })
|
||||||
|
.ToListAsync();
|
||||||
|
|
||||||
|
list.ForEach(item =>
|
||||||
|
{
|
||||||
|
if (item.ShiftCode.HasValue)
|
||||||
|
{
|
||||||
|
item.ShiftTypes = shiftTypes.Where(x => x.ShiftCode == item.ShiftCode.Value)
|
||||||
|
.Select(x => new Dictionary<int, string>() { [(int)x.ShiftType] = x.ShiftType.GetDescription() })
|
||||||
|
.ToList();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
return list;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -1,4 +1,5 @@
|
|||||||
using System.ComponentModel.DataAnnotations;
|
using System.ComponentModel.DataAnnotations;
|
||||||
|
using Dlhis.Entity.Canteen.Enums;
|
||||||
using Kurisu.Core.CustomClass;
|
using Kurisu.Core.CustomClass;
|
||||||
|
|
||||||
namespace Dlhis.Basic.BusinessShift.Request;
|
namespace Dlhis.Basic.BusinessShift.Request;
|
||||||
@@ -13,9 +14,10 @@ public class BusinessPlaceShiftSaveMealShiftRequest : IValidatableObject
|
|||||||
public Guid ShiftCode { get; set; }
|
public Guid ShiftCode { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// mealshift
|
/// 餐次 ShiftEnumType
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public string ShiftType { get; set; }
|
[EnumDataType(typeof(ShiftEnumType))]
|
||||||
|
public ShiftEnumType ShiftType { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 序号
|
/// 序号
|
||||||
|
|||||||
@@ -1,4 +1,7 @@
|
|||||||
namespace Dlhis.Basic.BusinessShift.Response
|
using Dlhis.Entity.Canteen.Enums;
|
||||||
|
using Kurisu.AspNetCore.Utils.Extensions;
|
||||||
|
|
||||||
|
namespace Dlhis.Basic.BusinessShift.Response
|
||||||
{
|
{
|
||||||
public class MealShiftResponse
|
public class MealShiftResponse
|
||||||
{
|
{
|
||||||
@@ -6,9 +9,9 @@
|
|||||||
|
|
||||||
public Guid ShiftCode { get; set; }
|
public Guid ShiftCode { get; set; }
|
||||||
|
|
||||||
public string ShiftType { get; set; }
|
public ShiftEnumType ShiftType { get; set; }
|
||||||
|
|
||||||
public string Name { get; set; }
|
public string Name => ShiftType.GetDescription();
|
||||||
|
|
||||||
public TimeOnly Start { get; set; }
|
public TimeOnly Start { get; set; }
|
||||||
|
|
||||||
|
|||||||
@@ -38,14 +38,12 @@ public class BusinessPlaceShiftService : IBusinessPlaceShiftService
|
|||||||
|
|
||||||
//下级就餐时间段
|
//下级就餐时间段
|
||||||
var mealShifts = await _dbContext.Queryable<BusinessShiftMealRelationshipEntity>()
|
var mealShifts = await _dbContext.Queryable<BusinessShiftMealRelationshipEntity>()
|
||||||
.LeftJoin<BasicTypeEntity>((x, bt) => x.ShiftType == bt.Code)
|
|
||||||
.Where(x => shiftCodes.Contains(x.ShiftCode))
|
.Where(x => shiftCodes.Contains(x.ShiftCode))
|
||||||
.Select((x, bt) => new MealShiftResponse
|
.Select((x) => new MealShiftResponse
|
||||||
{
|
{
|
||||||
Id = x.Id,
|
Id = x.Id,
|
||||||
ShiftCode = x.ShiftCode,
|
ShiftCode = x.ShiftCode,
|
||||||
ShiftType = bt.Code,
|
ShiftType = x.ShiftType,
|
||||||
Name = bt.Display,
|
|
||||||
Start = x.Start,
|
Start = x.Start,
|
||||||
End = x.End,
|
End = x.End,
|
||||||
})
|
})
|
||||||
@@ -95,14 +93,11 @@ public class BusinessPlaceShiftService : IBusinessPlaceShiftService
|
|||||||
|
|
||||||
public async Task SaveMealShiftsAsync(List<BusinessPlaceShiftSaveMealShiftRequest> requests)
|
public async Task SaveMealShiftsAsync(List<BusinessPlaceShiftSaveMealShiftRequest> requests)
|
||||||
{
|
{
|
||||||
var mealShifts = await GetMealShiftAsync();
|
|
||||||
|
|
||||||
foreach (var request in requests)
|
foreach (var request in requests)
|
||||||
{
|
{
|
||||||
var shift = await CheckExistsShiftAsync(request.ShiftCode);
|
var shift = await CheckExistsShiftAsync(request.ShiftCode);
|
||||||
await CheckExistsMealShiftAsync(request);
|
await CheckExistsMealShiftAsync(request);
|
||||||
await DuplicateTimePeriodAsync(request);
|
await DuplicateTimePeriodAsync(request);
|
||||||
mealShifts.Contains(request.ShiftType).ThrowIfFalse($"{request.ShiftType}不存在");
|
|
||||||
|
|
||||||
if (!request.Id.HasValue)
|
if (!request.Id.HasValue)
|
||||||
{
|
{
|
||||||
@@ -312,11 +307,6 @@ public class BusinessPlaceShiftService : IBusinessPlaceShiftService
|
|||||||
return shift;
|
return shift;
|
||||||
}
|
}
|
||||||
|
|
||||||
private async Task<List<string>> GetMealShiftAsync()
|
|
||||||
{
|
|
||||||
return await _dbContext.Queryable<BasicTypeEntity>().Where(x => x.Type == "mealshift").Select(x => x.Code).ToListAsync();
|
|
||||||
}
|
|
||||||
|
|
||||||
private async Task CheckExistsMealShiftAsync(BusinessPlaceShiftSaveMealShiftRequest request)
|
private async Task CheckExistsMealShiftAsync(BusinessPlaceShiftSaveMealShiftRequest request)
|
||||||
{
|
{
|
||||||
var exists = await _dbContext.Queryable<BusinessShiftMealRelationshipEntity>()
|
var exists = await _dbContext.Queryable<BusinessShiftMealRelationshipEntity>()
|
||||||
|
|||||||
@@ -9,7 +9,7 @@ using Microsoft.AspNetCore.Mvc;
|
|||||||
|
|
||||||
namespace Dlhis.Basic.Device.Controllers;
|
namespace Dlhis.Basic.Device.Controllers;
|
||||||
|
|
||||||
[Authorize]
|
[Authorize(Roles = "admin,tenant-admin")]
|
||||||
[Route("api/[controller]")]
|
[Route("api/[controller]")]
|
||||||
[ApiController]
|
[ApiController]
|
||||||
public class DevicePermissionsController : ControllerBase
|
public class DevicePermissionsController : ControllerBase
|
||||||
|
|||||||
@@ -2,8 +2,6 @@
|
|||||||
using Dlhis.Basic.Device.Response;
|
using Dlhis.Basic.Device.Response;
|
||||||
using Dlhis.Basic.Device.Services;
|
using Dlhis.Basic.Device.Services;
|
||||||
using Kurisu.AspNetCore.DataAccess.SqlSugar.Aop;
|
using Kurisu.AspNetCore.DataAccess.SqlSugar.Aop;
|
||||||
using Kurisu.AspNetCore.EventBus.Abstractions;
|
|
||||||
using Kurisu.AspNetCore.Scope;
|
|
||||||
using Kurisu.Core.DataAccess.Dto;
|
using Kurisu.Core.DataAccess.Dto;
|
||||||
using Microsoft.AspNetCore.Authorization;
|
using Microsoft.AspNetCore.Authorization;
|
||||||
using Microsoft.AspNetCore.Mvc;
|
using Microsoft.AspNetCore.Mvc;
|
||||||
|
|||||||
@@ -11,6 +11,7 @@ using Kurisu.Core.DataAccess.Dto;
|
|||||||
using Kurisu.Core.DataAccess.Entity;
|
using Kurisu.Core.DataAccess.Entity;
|
||||||
using Kurisu.Core.User.Abstractions;
|
using Kurisu.Core.User.Abstractions;
|
||||||
using Kurisu.SqlSugar.Services;
|
using Kurisu.SqlSugar.Services;
|
||||||
|
using SqlSugar;
|
||||||
|
|
||||||
namespace Dlhis.Basic.Device.Services.Implements;
|
namespace Dlhis.Basic.Device.Services.Implements;
|
||||||
|
|
||||||
@@ -302,6 +303,9 @@ public class DevicePermissionService : IDevicePermissionService
|
|||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
public async Task<List<Guid>> GetAssignDeviceCodesAsync(string userNo)
|
public async Task<List<Guid>> GetAssignDeviceCodesAsync(string userNo)
|
||||||
{
|
{
|
||||||
|
var devices = await _dbContext.Queryable<DeviceEntity>().ToListAsync();
|
||||||
|
var deviceRegistries = await _dbContext.Queryable<DeviceRegistryEntity>().ToListAsync();
|
||||||
|
|
||||||
var gainfo = await _dbContext.Queryable<GainfoEntity>().Where(x => x.No == userNo).SingleAsync();
|
var gainfo = await _dbContext.Queryable<GainfoEntity>().Where(x => x.No == userNo).SingleAsync();
|
||||||
var gainfoGroups = await _dbContext.Queryable<GainfoGroupRelationshipEntity>().ToListAsync();
|
var gainfoGroups = await _dbContext.Queryable<GainfoGroupRelationshipEntity>().ToListAsync();
|
||||||
|
|
||||||
@@ -309,7 +313,7 @@ public class DevicePermissionService : IDevicePermissionService
|
|||||||
var deviceGroups = await _dbContext.Queryable<DeviceGroupEntity>().ToListAsync();
|
var deviceGroups = await _dbContext.Queryable<DeviceGroupEntity>().ToListAsync();
|
||||||
var deviceRelationships = await _dbContext.Queryable<DeviceGroupRelationshipEntity>().ToListAsync();
|
var deviceRelationships = await _dbContext.Queryable<DeviceGroupRelationshipEntity>().ToListAsync();
|
||||||
|
|
||||||
var result = GetAssignDeviceCodesInternal(gainfo, gainfoGroups, devicePermissions, deviceGroups, deviceRelationships);
|
var result = GetAssignDeviceCodesInternal(gainfo, gainfoGroups, devicePermissions, deviceGroups, deviceRelationships, deviceRegistries, devices);
|
||||||
return result.SelectMany(x => x.Codes).ToList();
|
return result.SelectMany(x => x.Codes).ToList();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -321,13 +325,22 @@ public class DevicePermissionService : IDevicePermissionService
|
|||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
public async Task<Pagination<AssigmentByCodeResponse>> GetAssigmentByCodeAsync(AssigmentByCodeRequest request)
|
public async Task<Pagination<AssigmentByCodeResponse>> GetAssigmentByCodeAsync(AssigmentByCodeRequest request)
|
||||||
{
|
{
|
||||||
|
var lst1 = new List<Guid>();
|
||||||
//所有设备guid
|
//所有设备guid
|
||||||
var gds = await GetAssignmentsAsync(DeviceAssignmentTypeEnumType.Device, AssignTypeEnumType.User, request.No);
|
var gds = await GetAssignmentsAsync(DeviceAssignmentTypeEnumType.Device, AssignTypeEnumType.User, request.No);
|
||||||
|
if (gds != null && gds.Count > 0)
|
||||||
|
{
|
||||||
|
lst1.AddRange(gds);
|
||||||
|
}
|
||||||
|
|
||||||
//所有设备组guid
|
//所有设备组guid
|
||||||
var ggs = await GetAssignmentsAsync(DeviceAssignmentTypeEnumType.Group, AssignTypeEnumType.User, request.No);
|
var ggs = await GetAssignmentsAsync(DeviceAssignmentTypeEnumType.Group, AssignTypeEnumType.User, request.No);
|
||||||
|
|
||||||
|
//所有营业点guid
|
||||||
|
var gps = await GetAssignmentsAsync(DeviceAssignmentTypeEnumType.BusinessPlace, AssignTypeEnumType.User, request.No);
|
||||||
|
|
||||||
var devices = await _dbContext.Queryable<DeviceEntity>().ToListAsync();
|
var devices = await _dbContext.Queryable<DeviceEntity>().ToListAsync();
|
||||||
|
var regiss = await _dbContext.Queryable<DeviceRegistryEntity>().ToListAsync();
|
||||||
|
|
||||||
if (ggs != null && ggs.Count > 0)
|
if (ggs != null && ggs.Count > 0)
|
||||||
{
|
{
|
||||||
@@ -337,11 +350,23 @@ public class DevicePermissionService : IDevicePermissionService
|
|||||||
.Where(x => x.GroupCode == gid)
|
.Where(x => x.GroupCode == gid)
|
||||||
.Select(x => x.DeviceCode)
|
.Select(x => x.DeviceCode)
|
||||||
.ToListAsync();
|
.ToListAsync();
|
||||||
gds.AddRange(ds);
|
lst1.AddRange(ds);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (gps != null && gps.Count > 0)
|
||||||
|
{
|
||||||
|
foreach (var placeCode in gps)
|
||||||
|
{
|
||||||
|
var nos = regiss.Where(x => x.BusinessPlaceCode == placeCode)
|
||||||
|
.Select(x => x.DeviceUniqueNo).ToList();
|
||||||
|
|
||||||
|
var dcodes = devices.Where(d => nos.Contains(d.UniqueNo))
|
||||||
|
.Select(d => d.Code).ToList();
|
||||||
|
lst1.AddRange(dcodes);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
var dds = gds.Distinct().ToList();
|
var dds = lst1.Distinct().ToList();
|
||||||
var lst = devices.Where(x => dds.Contains(x.Code))
|
var lst = devices.Where(x => dds.Contains(x.Code))
|
||||||
.Select(x => new AssigmentByCodeResponse
|
.Select(x => new AssigmentByCodeResponse
|
||||||
{
|
{
|
||||||
@@ -445,6 +470,9 @@ public class DevicePermissionService : IDevicePermissionService
|
|||||||
|
|
||||||
private async Task<Dictionary<string, List<UserTenantDeviceCodeDto>>> GetAssignDeviceCodesInternalAsync(List<string> userNos)
|
private async Task<Dictionary<string, List<UserTenantDeviceCodeDto>>> GetAssignDeviceCodesInternalAsync(List<string> userNos)
|
||||||
{
|
{
|
||||||
|
var devices = await _dbContext.Queryable<DeviceEntity>().ToListAsync();
|
||||||
|
var regiss = await _dbContext.Queryable<DeviceRegistryEntity>().Where(x => !SqlFunc.IsNullOrEmpty(x.BusinessPlaceCode)).ToListAsync();
|
||||||
|
|
||||||
var gainfos = await _dbContext.Queryable<GainfoEntity>().Where(x => userNos.Contains(x.No)).ToListAsync();
|
var gainfos = await _dbContext.Queryable<GainfoEntity>().Where(x => userNos.Contains(x.No)).ToListAsync();
|
||||||
if (!gainfos.Any())
|
if (!gainfos.Any())
|
||||||
{
|
{
|
||||||
@@ -460,23 +488,27 @@ public class DevicePermissionService : IDevicePermissionService
|
|||||||
|
|
||||||
foreach (var gainfo in gainfos)
|
foreach (var gainfo in gainfos)
|
||||||
{
|
{
|
||||||
var codes = GetAssignDeviceCodesInternal(gainfo, gainfoGroupRelationships, devicePermissions, deviceGroups, deviceRelationships);
|
var codes = GetAssignDeviceCodesInternal(gainfo, gainfoGroupRelationships, devicePermissions, deviceGroups, deviceRelationships, regiss, devices);
|
||||||
result.Add(gainfo.No, codes);
|
result.Add(gainfo.No, codes);
|
||||||
}
|
}
|
||||||
|
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
private static List<UserTenantDeviceCodeDto> GetAssignDeviceCodesInternal(
|
private static List<UserTenantDeviceCodeDto> GetAssignDeviceCodesInternal(
|
||||||
GainfoEntity gainfo,
|
GainfoEntity gainfo,
|
||||||
List<GainfoGroupRelationshipEntity> gainfoGroupRelationships,
|
List<GainfoGroupRelationshipEntity> gainfoGroupRelationships,
|
||||||
List<DevicePermissionEntity> devicePermissions,
|
List<DevicePermissionEntity> devicePermissions,
|
||||||
List<DeviceGroupEntity> deviceGroups,
|
List<DeviceGroupEntity> deviceGroups,
|
||||||
List<DeviceGroupRelationshipEntity> deviceGroupRelationships)
|
List<DeviceGroupRelationshipEntity> deviceGroupRelationships,
|
||||||
|
List<DeviceRegistryEntity> deviceRegistries,
|
||||||
|
List<DeviceEntity> devices
|
||||||
|
)
|
||||||
{
|
{
|
||||||
var userNo = gainfo.No;
|
var userNo = gainfo.No;
|
||||||
var deviceCodes = new List<UserTenantDeviceCodeDto>();
|
var deviceCodes = new List<UserTenantDeviceCodeDto>();
|
||||||
var deviceGroupCodes = new List<UserTenantDeviceCodeDto>();
|
var deviceGroupCodes = new List<UserTenantDeviceCodeDto>();
|
||||||
|
var placeCodes = new List<UserTenantDeviceCodeDto>();
|
||||||
|
|
||||||
//获取人员的分组,跨基地
|
//获取人员的分组,跨基地
|
||||||
var gainfoGroups = gainfoGroupRelationships.Where(x => x.UserNo == userNo).Select(x => x.GroupCode).ToList();
|
var gainfoGroups = gainfoGroupRelationships.Where(x => x.UserNo == userNo).Select(x => x.GroupCode).ToList();
|
||||||
@@ -484,32 +516,43 @@ public class DevicePermissionService : IDevicePermissionService
|
|||||||
//按用户
|
//按用户
|
||||||
var du = GetAssignCodesInternal(devicePermissions, deviceGroups, DeviceAssignmentTypeEnumType.Device, AssignTypeEnumType.User, userNo);
|
var du = GetAssignCodesInternal(devicePermissions, deviceGroups, DeviceAssignmentTypeEnumType.Device, AssignTypeEnumType.User, userNo);
|
||||||
var gu = GetAssignCodesInternal(devicePermissions, deviceGroups, DeviceAssignmentTypeEnumType.Group, AssignTypeEnumType.User, userNo);
|
var gu = GetAssignCodesInternal(devicePermissions, deviceGroups, DeviceAssignmentTypeEnumType.Group, AssignTypeEnumType.User, userNo);
|
||||||
|
var pu = GetAssignCodesInternal(devicePermissions, deviceGroups, DeviceAssignmentTypeEnumType.BusinessPlace, AssignTypeEnumType.User, userNo);
|
||||||
|
|
||||||
deviceCodes.AddRange(du);
|
deviceCodes.AddRange(du);
|
||||||
deviceGroupCodes.AddRange(gu);
|
deviceGroupCodes.AddRange(gu);
|
||||||
|
placeCodes.AddRange(pu);
|
||||||
|
|
||||||
//按用户组
|
//按用户组
|
||||||
foreach (var groupCode in gainfoGroups)
|
foreach (var groupCode in gainfoGroups)
|
||||||
{
|
{
|
||||||
var dg = GetAssignCodesInternal(devicePermissions, deviceGroups, DeviceAssignmentTypeEnumType.Device, AssignTypeEnumType.Group, groupCode.ToString());
|
var dg = GetAssignCodesInternal(devicePermissions, deviceGroups, DeviceAssignmentTypeEnumType.Device, AssignTypeEnumType.Group, groupCode.ToString());
|
||||||
var gg = GetAssignCodesInternal(devicePermissions, deviceGroups, DeviceAssignmentTypeEnumType.Group, AssignTypeEnumType.Group, groupCode.ToString());
|
var gg = GetAssignCodesInternal(devicePermissions, deviceGroups, DeviceAssignmentTypeEnumType.Group, AssignTypeEnumType.Group, groupCode.ToString());
|
||||||
|
var pg = GetAssignCodesInternal(devicePermissions, deviceGroups, DeviceAssignmentTypeEnumType.BusinessPlace, AssignTypeEnumType.Group, groupCode.ToString());
|
||||||
deviceCodes.AddRange(dg);
|
deviceCodes.AddRange(dg);
|
||||||
deviceGroupCodes.AddRange(gg);
|
deviceGroupCodes.AddRange(gg);
|
||||||
|
placeCodes.AddRange(pg);
|
||||||
}
|
}
|
||||||
|
|
||||||
//按部门
|
//按部门
|
||||||
var gainfoFactoryDevicePermissions = devicePermissions.Where(x => x.TenantId == gainfo.Factory).ToList();
|
var gainfoFactoryDevicePermissions = devicePermissions.Where(x => x.TenantId == gainfo.Factory).ToList();
|
||||||
var dd = GetAssignCodesInternal(gainfoFactoryDevicePermissions, deviceGroups, DeviceAssignmentTypeEnumType.Device, AssignTypeEnumType.Department, gainfo.DepartmentNo);
|
var dd = GetAssignCodesInternal(gainfoFactoryDevicePermissions, deviceGroups, DeviceAssignmentTypeEnumType.Device, AssignTypeEnumType.Department, gainfo.DepartmentNo);
|
||||||
var gd = GetAssignCodesInternal(gainfoFactoryDevicePermissions, deviceGroups, DeviceAssignmentTypeEnumType.Group, AssignTypeEnumType.Department, gainfo.DepartmentNo);
|
var gd = GetAssignCodesInternal(gainfoFactoryDevicePermissions, deviceGroups, DeviceAssignmentTypeEnumType.Group, AssignTypeEnumType.Department, gainfo.DepartmentNo);
|
||||||
|
var pd = GetAssignCodesInternal(gainfoFactoryDevicePermissions, deviceGroups, DeviceAssignmentTypeEnumType.BusinessPlace, AssignTypeEnumType.Department, gainfo.DepartmentNo);
|
||||||
deviceCodes.AddRange(dd);
|
deviceCodes.AddRange(dd);
|
||||||
deviceGroupCodes.AddRange(gd);
|
deviceGroupCodes.AddRange(gd);
|
||||||
|
placeCodes.AddRange(pd);
|
||||||
|
|
||||||
//按厂区
|
//按厂区
|
||||||
var dt = GetAssignCodesInternal(devicePermissions, deviceGroups, DeviceAssignmentTypeEnumType.Device, AssignTypeEnumType.Tenant, gainfo.Factory);
|
var dt = GetAssignCodesInternal(devicePermissions, deviceGroups, DeviceAssignmentTypeEnumType.Device, AssignTypeEnumType.Tenant, gainfo.Factory);
|
||||||
var gt = GetAssignCodesInternal(devicePermissions, deviceGroups, DeviceAssignmentTypeEnumType.Group, AssignTypeEnumType.Tenant, gainfo.Factory);
|
var gt = GetAssignCodesInternal(devicePermissions, deviceGroups, DeviceAssignmentTypeEnumType.Group, AssignTypeEnumType.Tenant, gainfo.Factory);
|
||||||
deviceCodes.AddRange(du);
|
var pt = GetAssignCodesInternal(devicePermissions, deviceGroups, DeviceAssignmentTypeEnumType.BusinessPlace, AssignTypeEnumType.Tenant, gainfo.Factory);
|
||||||
deviceGroupCodes.AddRange(gu);
|
placeCodes.AddRange(pt);
|
||||||
|
deviceCodes.AddRange(dt);
|
||||||
|
deviceGroupCodes.AddRange(gt);
|
||||||
|
|
||||||
var groupCodes = deviceGroupCodes.SelectMany(x => x.Codes).Distinct().ToList();
|
var groupCodes = deviceGroupCodes.SelectMany(x => x.Codes).Distinct().ToList();
|
||||||
|
var placecodes = placeCodes.SelectMany(x => x.Codes).Distinct().ToList();
|
||||||
|
|
||||||
var deveiceCodesByGroup = deviceGroupRelationships.Where(x => groupCodes.Contains(x.GroupCode)).GroupBy(x => x.TenantId)
|
var deveiceCodesByGroup = deviceGroupRelationships.Where(x => groupCodes.Contains(x.GroupCode)).GroupBy(x => x.TenantId)
|
||||||
.Select(x => new UserTenantDeviceCodeDto
|
.Select(x => new UserTenantDeviceCodeDto
|
||||||
{
|
{
|
||||||
@@ -517,7 +560,24 @@ public class DevicePermissionService : IDevicePermissionService
|
|||||||
Codes = x.Select(item => item.DeviceCode).Distinct().ToList()
|
Codes = x.Select(item => item.DeviceCode).Distinct().ToList()
|
||||||
});
|
});
|
||||||
|
|
||||||
|
var placeGroup = deviceRegistries.Where(x => placecodes.Contains((Guid)x.BusinessPlaceCode)).GroupBy(x => x.TenantId)
|
||||||
|
.Select(x => new UserTenantDeviceCodeDto
|
||||||
|
{
|
||||||
|
Tenant = x.Key,
|
||||||
|
}).ToList();
|
||||||
|
|
||||||
|
placeGroup.ForEach(t =>
|
||||||
|
{
|
||||||
|
var nos = deviceRegistries.Where(x => placecodes.Contains((Guid)x.BusinessPlaceCode))
|
||||||
|
.Where(x => x.TenantId == t.Tenant)
|
||||||
|
.Select(x => x.DeviceUniqueNo)
|
||||||
|
.ToList();
|
||||||
|
|
||||||
|
t.Codes = devices.Where(d => nos.Contains(d.UniqueNo)).Select(d => d.Code).ToList();
|
||||||
|
});
|
||||||
|
|
||||||
deviceCodes.AddRange(deveiceCodesByGroup);
|
deviceCodes.AddRange(deveiceCodesByGroup);
|
||||||
|
deviceCodes.AddRange(placeGroup);
|
||||||
|
|
||||||
return deviceCodes.GroupBy(x => x.Tenant).Select(x => new UserTenantDeviceCodeDto
|
return deviceCodes.GroupBy(x => x.Tenant).Select(x => new UserTenantDeviceCodeDto
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -48,19 +48,19 @@ public class DeviceService : IDeviceService
|
|||||||
var deviceUniqueNos = page.Data.Select(x => x.UniqueNo).ToList();
|
var deviceUniqueNos = page.Data.Select(x => x.UniqueNo).ToList();
|
||||||
|
|
||||||
var balanceInfos = await _dbContext.Queryable<BalanceRecordEntity>().Where(x => x.Type == BalanceRecordTypeEnumType.Out)
|
var balanceInfos = await _dbContext.Queryable<BalanceRecordEntity>().Where(x => x.Type == BalanceRecordTypeEnumType.Out)
|
||||||
.Where(x => deviceUniqueNos.Contains(x.DeviceInfo))
|
.Where(x => deviceUniqueNos.Contains(x.DeviceUniqueNo))
|
||||||
.Select(x => new
|
.Select(x => new
|
||||||
{
|
{
|
||||||
x.DeviceInfo,
|
x.DeviceUniqueNo,
|
||||||
Amount = SqlFunc.AggregateSum(x.Amount),
|
Amount = SqlFunc.AggregateSum(x.Amount),
|
||||||
UserCount = SqlFunc.AggregateDistinctCount(x.UserCode)
|
UserCount = SqlFunc.AggregateDistinctCount(x.UserCode)
|
||||||
})
|
})
|
||||||
.GroupBy(x => x.DeviceInfo)
|
.GroupBy(x => x.DeviceUniqueNo)
|
||||||
.ToListAsync();
|
.ToListAsync();
|
||||||
|
|
||||||
page.Data.ForEach(device =>
|
page.Data.ForEach(device =>
|
||||||
{
|
{
|
||||||
var info = balanceInfos.FirstOrDefault(x => x.DeviceInfo == device.UniqueNo);
|
var info = balanceInfos.FirstOrDefault(x => x.DeviceUniqueNo == device.UniqueNo);
|
||||||
if (info != null)
|
if (info != null)
|
||||||
{
|
{
|
||||||
device.Amount = info.Amount;
|
device.Amount = info.Amount;
|
||||||
|
|||||||
@@ -0,0 +1,44 @@
|
|||||||
|
using Dlhis.Basic.Dishes.Request;
|
||||||
|
using Dlhis.Basic.Dishes.Response;
|
||||||
|
using Dlhis.Basic.Dishes.Services;
|
||||||
|
using Microsoft.AspNetCore.Authorization;
|
||||||
|
using Microsoft.AspNetCore.Mvc;
|
||||||
|
|
||||||
|
namespace Dlhis.Basic.Dishes.Controller;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 菜品分类
|
||||||
|
/// </summary>
|
||||||
|
[Authorize]
|
||||||
|
[Route("api/[controller]")]
|
||||||
|
[ApiController]
|
||||||
|
public class DishesCategoriesController : ControllerBase
|
||||||
|
{
|
||||||
|
private readonly IDishesCategoryService _dishesCategoryService;
|
||||||
|
|
||||||
|
public DishesCategoriesController(IDishesCategoryService dishesCategoryService)
|
||||||
|
{
|
||||||
|
_dishesCategoryService = dishesCategoryService;
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 获取分类树
|
||||||
|
/// </summary>
|
||||||
|
/// <returns></returns>
|
||||||
|
[HttpGet("tree")]
|
||||||
|
public async Task<List<DishesCategoryTreeResponse>> TreeAsync()
|
||||||
|
{
|
||||||
|
return await _dishesCategoryService.TreeAsync();
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 保存分类
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="request"></param>
|
||||||
|
/// <returns></returns>
|
||||||
|
[HttpPost("save")]
|
||||||
|
public async Task SaveAsync(DishesCategorySaveRequest request)
|
||||||
|
{
|
||||||
|
await _dishesCategoryService.SaveAsync(request);
|
||||||
|
}
|
||||||
|
}
|
||||||
111
Src/Dlhis.Basic/Dishes/Controller/DishesMenusController.cs
Normal file
111
Src/Dlhis.Basic/Dishes/Controller/DishesMenusController.cs
Normal file
@@ -0,0 +1,111 @@
|
|||||||
|
using Dlhis.Basic.Dishes.Dto;
|
||||||
|
using Dlhis.Basic.Dishes.Request;
|
||||||
|
using Dlhis.Basic.Dishes.Response;
|
||||||
|
using Dlhis.Basic.Dishes.Services;
|
||||||
|
using Dlhis.Entity.Canteen.Enums;
|
||||||
|
using Kurisu.AspNetCore.DataAccess.SqlSugar.Aop;
|
||||||
|
using Kurisu.Core.DataAccess.Dto;
|
||||||
|
using Microsoft.AspNetCore.Authorization;
|
||||||
|
using Microsoft.AspNetCore.Mvc;
|
||||||
|
|
||||||
|
namespace Dlhis.Basic.Dishes.Controller;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 菜单菜品控制器
|
||||||
|
/// </summary>
|
||||||
|
[Authorize]
|
||||||
|
[Route("api/[controller]")]
|
||||||
|
[ApiController]
|
||||||
|
public class DishesMenusController : ControllerBase
|
||||||
|
{
|
||||||
|
private readonly IDishesMenuService _dishesMenuService;
|
||||||
|
private readonly IDishesService _dishesService;
|
||||||
|
|
||||||
|
public DishesMenusController(IDishesMenuService dishesMenuService, IDishesService dishesService)
|
||||||
|
{
|
||||||
|
_dishesMenuService = dishesMenuService;
|
||||||
|
_dishesService = dishesService;
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 菜单分页
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="request"></param>
|
||||||
|
/// <returns></returns>
|
||||||
|
[HttpGet("page")]
|
||||||
|
public async Task<Pagination<DishesMenuPageResponse>> GetDishesMenuPageAsync([FromQuery] DisheMenuPageRequest request)
|
||||||
|
{
|
||||||
|
return await _dishesMenuService.GetDishesMenuPageAsync(request);
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 菜单保存/更改
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="request"></param>
|
||||||
|
/// <returns></returns>
|
||||||
|
[HttpPost("save")]
|
||||||
|
[Transactional]
|
||||||
|
public async Task SaveDishesMenuAsync(DishesMenuSaveRequest request)
|
||||||
|
{
|
||||||
|
await _dishesMenuService.SaveDishesMenuAsync(request);
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 菜单明细
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="date"></param>
|
||||||
|
/// <param name="businessPlaceCode"></param>
|
||||||
|
/// <param name="shiftType"></param>
|
||||||
|
/// <param name="dishesCode"></param>
|
||||||
|
/// <returns></returns>
|
||||||
|
[HttpGet("detail")]
|
||||||
|
public async Task<DishesMenuDetailDto> GetBookingDishesDetailAsync(DateTime date, Guid businessPlaceCode, ShiftEnumType shiftType, string dishesCode)
|
||||||
|
{
|
||||||
|
return await _dishesMenuService.GetBookingDishesDetailAsync(date, businessPlaceCode, shiftType, dishesCode);
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 菜品分页
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="request"></param>
|
||||||
|
/// <returns></returns>
|
||||||
|
[HttpGet("dishes/page")]
|
||||||
|
public async Task<Pagination<DishesResponse>> GetDishesAsync([FromQuery] DishesPageRequest request)
|
||||||
|
{
|
||||||
|
return await _dishesService.GetDishesPageAsync(request);
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 菜品保存/更改
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="request"></param>
|
||||||
|
/// <returns></returns>
|
||||||
|
[HttpPost("dishes/save")]
|
||||||
|
public async Task SaveDishesAsync(DishesSaveRequest request)
|
||||||
|
{
|
||||||
|
await _dishesService.SaveDishesAsync(request);
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 根据id获取菜品详情
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="id"></param>
|
||||||
|
/// <returns></returns>
|
||||||
|
[HttpGet("dishes/detail/{id}")]
|
||||||
|
public async Task<DishesDetailResponse> GetDishesDetailByIdAsync(long id)
|
||||||
|
{
|
||||||
|
return await _dishesService.GetDishesDetailByIdAsync(id);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 获取预定送餐配置
|
||||||
|
/// </summary>
|
||||||
|
/// <returns></returns>
|
||||||
|
[HttpGet("setting")]
|
||||||
|
public async Task<GetDishesMenusBookingResponse> GetDishesMenusBookingSetting([FromQuery] GetDishesMenusBookingRequest request)
|
||||||
|
{
|
||||||
|
return await _dishesService.GetDishesMenusBookingSetting(request);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
20
Src/Dlhis.Basic/Dishes/Dto/DishesMenuDetailDto.cs
Normal file
20
Src/Dlhis.Basic/Dishes/Dto/DishesMenuDetailDto.cs
Normal file
@@ -0,0 +1,20 @@
|
|||||||
|
namespace Dlhis.Basic.Dishes.Dto;
|
||||||
|
|
||||||
|
public class DishesMenuDetailDto
|
||||||
|
{
|
||||||
|
public DateTime Date { get; set; }
|
||||||
|
|
||||||
|
public long MenuId { get; set; }
|
||||||
|
|
||||||
|
public long DishesId { get; set; }
|
||||||
|
|
||||||
|
public string DishesCode { get; set; }
|
||||||
|
|
||||||
|
public string DishesName { get; set; }
|
||||||
|
|
||||||
|
public decimal Price { get; set; }
|
||||||
|
|
||||||
|
public int Number { get; set; }
|
||||||
|
|
||||||
|
public int Version { get; set; }
|
||||||
|
}
|
||||||
22
Src/Dlhis.Basic/Dishes/Request/DisheMenuPageRequest.cs
Normal file
22
Src/Dlhis.Basic/Dishes/Request/DisheMenuPageRequest.cs
Normal file
@@ -0,0 +1,22 @@
|
|||||||
|
using Dlhis.Entity.Canteen.Enums;
|
||||||
|
using Kurisu.Core.DataAccess.Dto;
|
||||||
|
|
||||||
|
namespace Dlhis.Basic.Dishes.Request;
|
||||||
|
|
||||||
|
public class DisheMenuPageRequest : PageDto
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// 营业点code
|
||||||
|
/// </summary>
|
||||||
|
public Guid BusinessPlaceCode { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 餐次
|
||||||
|
/// </summary>
|
||||||
|
public List<ShiftEnumType> ShiftTypes { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 分类
|
||||||
|
/// </summary>
|
||||||
|
public Guid? CategoryCode { get; set; }
|
||||||
|
}
|
||||||
24
Src/Dlhis.Basic/Dishes/Request/DishesCategorySaveRequest.cs
Normal file
24
Src/Dlhis.Basic/Dishes/Request/DishesCategorySaveRequest.cs
Normal file
@@ -0,0 +1,24 @@
|
|||||||
|
using System.ComponentModel.DataAnnotations;
|
||||||
|
|
||||||
|
namespace Dlhis.Basic.Dishes.Request;
|
||||||
|
|
||||||
|
public class DishesCategorySaveRequest
|
||||||
|
{
|
||||||
|
public long? Id { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// PCode
|
||||||
|
/// </summary>
|
||||||
|
public Guid? PCode { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 分类名称
|
||||||
|
/// </summary>
|
||||||
|
[Required]
|
||||||
|
public string Name { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 序号
|
||||||
|
/// </summary>
|
||||||
|
public int Sequence { get; set; } = 100;
|
||||||
|
}
|
||||||
@@ -0,0 +1,39 @@
|
|||||||
|
using System.ComponentModel.DataAnnotations;
|
||||||
|
using Kurisu.AspNetCore.Utils.Extensions;
|
||||||
|
|
||||||
|
namespace Dlhis.Basic.Dishes.Request;
|
||||||
|
|
||||||
|
public class DishesMenuNameDateSaveRequest : IValidatableObject
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// 菜单编码
|
||||||
|
/// </summary>
|
||||||
|
public string CustomCode { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 菜单日期
|
||||||
|
/// </summary>
|
||||||
|
public DateTime Date { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 餐次数据
|
||||||
|
/// </summary>
|
||||||
|
public List<DishesMenuShiftTypeSaveRequest> ShiftTypes { get; set; }
|
||||||
|
|
||||||
|
|
||||||
|
public IEnumerable<ValidationResult> Validate(ValidationContext validationContext)
|
||||||
|
{
|
||||||
|
if (Date < DateTime.Today)
|
||||||
|
{
|
||||||
|
yield return new ValidationResult("菜单日期不能小于当天");
|
||||||
|
}
|
||||||
|
|
||||||
|
//格式化
|
||||||
|
Date = Date.Date;
|
||||||
|
|
||||||
|
if (CustomCode.IsEmpty())
|
||||||
|
{
|
||||||
|
CustomCode = Date.ToString("yyyy-MM-dd");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
18
Src/Dlhis.Basic/Dishes/Request/DishesMenuSaveRequest.cs
Normal file
18
Src/Dlhis.Basic/Dishes/Request/DishesMenuSaveRequest.cs
Normal file
@@ -0,0 +1,18 @@
|
|||||||
|
using System.ComponentModel.DataAnnotations;
|
||||||
|
|
||||||
|
namespace Dlhis.Basic.Dishes.Request;
|
||||||
|
|
||||||
|
public class DishesMenuSaveRequest : IValidatableObject
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// 营业点code
|
||||||
|
/// </summary>
|
||||||
|
public Guid BusinessPlaceCode { get; set; }
|
||||||
|
|
||||||
|
public List<DishesMenuNameDateSaveRequest> Items { get; set; }
|
||||||
|
|
||||||
|
public IEnumerable<ValidationResult> Validate(ValidationContext validationContext)
|
||||||
|
{
|
||||||
|
yield break;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,18 @@
|
|||||||
|
using System.ComponentModel.DataAnnotations;
|
||||||
|
using Dlhis.Entity.Canteen.Enums;
|
||||||
|
|
||||||
|
namespace Dlhis.Basic.Dishes.Request;
|
||||||
|
|
||||||
|
public class DishesMenuShiftTypeSaveRequest
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// 餐次段
|
||||||
|
/// </summary>
|
||||||
|
[EnumDataType(typeof(ShiftEnumType))]
|
||||||
|
public ShiftEnumType ShiftType { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 菜品
|
||||||
|
/// </summary>
|
||||||
|
public List<MenuDishesSaveRequest> Dishes { get; set; }
|
||||||
|
}
|
||||||
11
Src/Dlhis.Basic/Dishes/Request/DishesPageRequest.cs
Normal file
11
Src/Dlhis.Basic/Dishes/Request/DishesPageRequest.cs
Normal file
@@ -0,0 +1,11 @@
|
|||||||
|
using Kurisu.Core.DataAccess.Dto;
|
||||||
|
|
||||||
|
namespace Dlhis.Basic.Dishes.Request;
|
||||||
|
|
||||||
|
public class DishesPageRequest : PageDto
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// 营业点
|
||||||
|
/// </summary>
|
||||||
|
public List<Guid> BusinessPlaceCodes { get; set; }
|
||||||
|
}
|
||||||
59
Src/Dlhis.Basic/Dishes/Request/DishesSaveRequest.cs
Normal file
59
Src/Dlhis.Basic/Dishes/Request/DishesSaveRequest.cs
Normal file
@@ -0,0 +1,59 @@
|
|||||||
|
using System.ComponentModel.DataAnnotations;
|
||||||
|
|
||||||
|
namespace Dlhis.Basic.Dishes.Request;
|
||||||
|
|
||||||
|
public class DishesSaveRequest
|
||||||
|
{
|
||||||
|
public long? Id { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 分类
|
||||||
|
/// </summary>
|
||||||
|
[Required]
|
||||||
|
public Guid CategoryCode { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 营业点
|
||||||
|
/// </summary>
|
||||||
|
[Required]
|
||||||
|
public Guid BusinessPlaceCode { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 菜品名称
|
||||||
|
/// </summary>
|
||||||
|
[Required]
|
||||||
|
public string Name { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 菜单编码
|
||||||
|
/// </summary>
|
||||||
|
[Required]
|
||||||
|
public string CustomCode { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 描述
|
||||||
|
/// </summary>
|
||||||
|
public string Description { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 单价
|
||||||
|
/// </summary>
|
||||||
|
[Range(0, 10000)]
|
||||||
|
public decimal Price { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 图片
|
||||||
|
/// </summary>
|
||||||
|
public string ImageUrl { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 单位
|
||||||
|
/// </summary>
|
||||||
|
[MinLength(1)]
|
||||||
|
public List<string> Units { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 是否启用
|
||||||
|
/// </summary>
|
||||||
|
public bool Enable { get; set; }
|
||||||
|
}
|
||||||
@@ -0,0 +1,9 @@
|
|||||||
|
namespace Dlhis.Basic.Dishes.Request
|
||||||
|
{
|
||||||
|
public class GetDishesMenusBookingRequest
|
||||||
|
{
|
||||||
|
public Guid PlaceCode { get; set; }
|
||||||
|
|
||||||
|
public string Factory { get; set; }
|
||||||
|
}
|
||||||
|
}
|
||||||
24
Src/Dlhis.Basic/Dishes/Request/MenuDishesSaveRequest.cs
Normal file
24
Src/Dlhis.Basic/Dishes/Request/MenuDishesSaveRequest.cs
Normal file
@@ -0,0 +1,24 @@
|
|||||||
|
using System.ComponentModel.DataAnnotations;
|
||||||
|
|
||||||
|
namespace Dlhis.Basic.Dishes.Request;
|
||||||
|
|
||||||
|
public class MenuDishesSaveRequest
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// 菜品编码
|
||||||
|
/// </summary>
|
||||||
|
[Required]
|
||||||
|
public string DishesCode { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 菜单价
|
||||||
|
/// </summary>
|
||||||
|
[Range(0, double.MaxValue)]
|
||||||
|
public decimal? Price { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 售额
|
||||||
|
/// </summary>
|
||||||
|
[Range(0, int.MaxValue)]
|
||||||
|
public int Number { get; set; }
|
||||||
|
}
|
||||||
@@ -0,0 +1,11 @@
|
|||||||
|
using Dlhis.Entity.Canteen.Enums;
|
||||||
|
using Kurisu.AspNetCore.Utils.Extensions;
|
||||||
|
|
||||||
|
namespace Dlhis.Basic.Dishes.Response
|
||||||
|
{
|
||||||
|
public class BalanceRecordSourceEnumDto
|
||||||
|
{
|
||||||
|
public BalanceRecordSourceEnumType Type { get; set; }
|
||||||
|
public string TypeCN => Type.GetDescription();
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,29 @@
|
|||||||
|
using Dlhis.Entity.Canteen.Enums;
|
||||||
|
using Kurisu.AspNetCore.Utils.Extensions;
|
||||||
|
|
||||||
|
namespace Dlhis.Basic.Dishes.Response
|
||||||
|
{
|
||||||
|
public class BusinessShiftMealRelationshipResponse
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// 餐别Code
|
||||||
|
/// </summary>
|
||||||
|
public Guid ShiftCode { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 餐别手工号
|
||||||
|
/// </summary>
|
||||||
|
public string ShiftCustomCode { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 餐次
|
||||||
|
/// </summary>
|
||||||
|
public ShiftEnumType ShiftType { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 餐次CN
|
||||||
|
/// </summary>
|
||||||
|
public string ShiftTypeCN => ShiftType.GetDescription();
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
15
Src/Dlhis.Basic/Dishes/Response/DishesCategoryResponse.cs
Normal file
15
Src/Dlhis.Basic/Dishes/Response/DishesCategoryResponse.cs
Normal file
@@ -0,0 +1,15 @@
|
|||||||
|
namespace Dlhis.Basic.Dishes.Response;
|
||||||
|
|
||||||
|
public class DishesCategoryTreeResponse
|
||||||
|
{
|
||||||
|
public Guid? PCode { get; set; }
|
||||||
|
|
||||||
|
public Guid Code { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 分类名称
|
||||||
|
/// </summary>
|
||||||
|
public string Name { get; set; }
|
||||||
|
|
||||||
|
public List<DishesCategoryTreeResponse> Next { get; set; }
|
||||||
|
}
|
||||||
51
Src/Dlhis.Basic/Dishes/Response/DishesDetailResponse.cs
Normal file
51
Src/Dlhis.Basic/Dishes/Response/DishesDetailResponse.cs
Normal file
@@ -0,0 +1,51 @@
|
|||||||
|
namespace Dlhis.Basic.Dishes.Response;
|
||||||
|
|
||||||
|
public class DishesDetailResponse
|
||||||
|
{
|
||||||
|
public long Id { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 分类
|
||||||
|
/// </summary>
|
||||||
|
public Guid CategoryCode { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 营业点
|
||||||
|
/// </summary>
|
||||||
|
public Guid BusinessPlaceCode { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 菜品编码
|
||||||
|
/// </summary>
|
||||||
|
public string CustomCode { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 菜品名称
|
||||||
|
/// </summary>
|
||||||
|
public string Name { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 描述
|
||||||
|
/// </summary>
|
||||||
|
public string Description { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 单价
|
||||||
|
/// </summary>
|
||||||
|
public decimal Price { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 单位
|
||||||
|
/// </summary>
|
||||||
|
public List<string> Units { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 图片
|
||||||
|
/// </summary>
|
||||||
|
public string ImageUrl { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 是否启用
|
||||||
|
/// </summary>
|
||||||
|
public bool Enable { get; set; }
|
||||||
|
}
|
||||||
51
Src/Dlhis.Basic/Dishes/Response/DishesMenuPageResponse.cs
Normal file
51
Src/Dlhis.Basic/Dishes/Response/DishesMenuPageResponse.cs
Normal file
@@ -0,0 +1,51 @@
|
|||||||
|
using Dlhis.Entity.Canteen.Enums;
|
||||||
|
|
||||||
|
namespace Dlhis.Basic.Dishes.Response;
|
||||||
|
|
||||||
|
public class DishesMenuPageResponse
|
||||||
|
{
|
||||||
|
public long? Id { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 菜单编码
|
||||||
|
/// </summary>
|
||||||
|
public string CustomCode { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 所属营业点
|
||||||
|
/// </summary>
|
||||||
|
public Guid BusinessPlaceCode { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 营业日期
|
||||||
|
/// </summary>
|
||||||
|
public DateTime Date { get; set; }
|
||||||
|
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 餐次
|
||||||
|
/// </summary>
|
||||||
|
public ShiftEnumType ShiftType { get; set; }
|
||||||
|
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 菜品编码
|
||||||
|
/// </summary>
|
||||||
|
public string DishesCode { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 剩余数量
|
||||||
|
/// </summary>
|
||||||
|
public int Number { get; set; }
|
||||||
|
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 单价
|
||||||
|
/// </summary>
|
||||||
|
public decimal? Price { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 是否启用
|
||||||
|
/// </summary>
|
||||||
|
public bool Enable { get; set; }
|
||||||
|
}
|
||||||
60
Src/Dlhis.Basic/Dishes/Response/DishesResponse.cs
Normal file
60
Src/Dlhis.Basic/Dishes/Response/DishesResponse.cs
Normal file
@@ -0,0 +1,60 @@
|
|||||||
|
using Kurisu.AspNetCore.Utils.Extensions;
|
||||||
|
using Newtonsoft.Json;
|
||||||
|
|
||||||
|
namespace Dlhis.Basic.Dishes.Response;
|
||||||
|
|
||||||
|
public class DishesResponse
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// 分类
|
||||||
|
/// </summary>
|
||||||
|
public Guid CategoryCode { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 分类
|
||||||
|
/// </summary>
|
||||||
|
public string CategoryName { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 营业点
|
||||||
|
/// </summary>
|
||||||
|
public Guid BusinessPlaceCode { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 菜品编码
|
||||||
|
/// </summary>
|
||||||
|
public string CustomCode { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 菜品名称
|
||||||
|
/// </summary>
|
||||||
|
public string Name { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 描述
|
||||||
|
/// </summary>
|
||||||
|
public string Description { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 单价
|
||||||
|
/// </summary>
|
||||||
|
public decimal Price { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 单位
|
||||||
|
/// </summary>
|
||||||
|
public List<string> Units => CurrnetUnits.ToObject<List<string>>();
|
||||||
|
|
||||||
|
[JsonIgnore]
|
||||||
|
public string CurrnetUnits { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 图片
|
||||||
|
/// </summary>
|
||||||
|
public string ImageUrl { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 是否启用
|
||||||
|
/// </summary>
|
||||||
|
public bool Enable { get; set; }
|
||||||
|
}
|
||||||
@@ -0,0 +1,15 @@
|
|||||||
|
using Dlhis.Entity.Canteen.Enums;
|
||||||
|
using SqlSugar.DbConvert;
|
||||||
|
using SqlSugar;
|
||||||
|
|
||||||
|
namespace Dlhis.Basic.Dishes.Response
|
||||||
|
{
|
||||||
|
public class GetDishesMenusBookingResponse
|
||||||
|
{
|
||||||
|
public List<BusinessShiftMealRelationshipResponse> BusinessShiftMealRelationships { get; set; }
|
||||||
|
|
||||||
|
public DateTime ServiceTime { get; set; }
|
||||||
|
|
||||||
|
public List<BalanceRecordSourceEnumDto> PayTypes { get; set; }
|
||||||
|
}
|
||||||
|
}
|
||||||
11
Src/Dlhis.Basic/Dishes/Services/IDishesCategoryService.cs
Normal file
11
Src/Dlhis.Basic/Dishes/Services/IDishesCategoryService.cs
Normal file
@@ -0,0 +1,11 @@
|
|||||||
|
using Dlhis.Basic.Dishes.Request;
|
||||||
|
using Dlhis.Basic.Dishes.Response;
|
||||||
|
|
||||||
|
namespace Dlhis.Basic.Dishes.Services;
|
||||||
|
|
||||||
|
public interface IDishesCategoryService : IScopeDependency
|
||||||
|
{
|
||||||
|
Task<List<DishesCategoryTreeResponse>> TreeAsync();
|
||||||
|
|
||||||
|
Task SaveAsync(DishesCategorySaveRequest request);
|
||||||
|
}
|
||||||
16
Src/Dlhis.Basic/Dishes/Services/IDishesMenuService.cs
Normal file
16
Src/Dlhis.Basic/Dishes/Services/IDishesMenuService.cs
Normal file
@@ -0,0 +1,16 @@
|
|||||||
|
using Dlhis.Entity.Canteen.Enums;
|
||||||
|
using Kurisu.Core.DataAccess.Dto;
|
||||||
|
using Dlhis.Basic.Dishes.Request;
|
||||||
|
using Dlhis.Basic.Dishes.Dto;
|
||||||
|
using Dlhis.Basic.Dishes.Response;
|
||||||
|
|
||||||
|
namespace Dlhis.Basic.Dishes.Services;
|
||||||
|
|
||||||
|
public interface IDishesMenuService : IScopeDependency
|
||||||
|
{
|
||||||
|
Task<Pagination<DishesMenuPageResponse>> GetDishesMenuPageAsync(DisheMenuPageRequest request);
|
||||||
|
|
||||||
|
Task SaveDishesMenuAsync(DishesMenuSaveRequest request);
|
||||||
|
|
||||||
|
Task<DishesMenuDetailDto> GetBookingDishesDetailAsync(DateTime date, Guid businessPlaceCode, ShiftEnumType shiftType, string dishesCode);
|
||||||
|
}
|
||||||
17
Src/Dlhis.Basic/Dishes/Services/IDishesService.cs
Normal file
17
Src/Dlhis.Basic/Dishes/Services/IDishesService.cs
Normal file
@@ -0,0 +1,17 @@
|
|||||||
|
using Dlhis.Basic.Dishes.Request;
|
||||||
|
using Dlhis.Basic.Dishes.Response;
|
||||||
|
using Kurisu.Core.DataAccess.Dto;
|
||||||
|
|
||||||
|
namespace Dlhis.Basic.Dishes.Services;
|
||||||
|
|
||||||
|
public interface IDishesService : IScopeDependency
|
||||||
|
{
|
||||||
|
Task<Pagination<DishesResponse>> GetDishesPageAsync(DishesPageRequest request);
|
||||||
|
|
||||||
|
Task SaveDishesAsync(DishesSaveRequest request);
|
||||||
|
|
||||||
|
Task<DishesDetailResponse> GetDishesDetailByIdAsync(long id);
|
||||||
|
|
||||||
|
Task<GetDishesMenusBookingResponse> GetDishesMenusBookingSetting(GetDishesMenusBookingRequest request);
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,65 @@
|
|||||||
|
using Dlhis.Basic.Dishes.Request;
|
||||||
|
using Dlhis.Basic.Dishes.Response;
|
||||||
|
using Dlhis.Entity.Canteen.Entities;
|
||||||
|
using Kurisu.AspNetCore.Utils.Extensions;
|
||||||
|
using Kurisu.SqlSugar.Services;
|
||||||
|
using Mapster;
|
||||||
|
|
||||||
|
namespace Dlhis.Basic.Dishes.Services.Implements;
|
||||||
|
|
||||||
|
public class DishesCategoryService : IDishesCategoryService
|
||||||
|
{
|
||||||
|
private readonly IDbContext _dbContext;
|
||||||
|
|
||||||
|
public DishesCategoryService(IDbContext dbContext)
|
||||||
|
{
|
||||||
|
_dbContext = dbContext;
|
||||||
|
}
|
||||||
|
|
||||||
|
public async Task<List<DishesCategoryTreeResponse>> TreeAsync()
|
||||||
|
{
|
||||||
|
var categories = await _dbContext.Queryable<DishesCategoryEntity>().Select<DishesCategoryTreeResponse>().ToListAsync();
|
||||||
|
var tops = categories.Where(x => !x.PCode.HasValue).ToList();
|
||||||
|
|
||||||
|
tops.ForEach(x =>
|
||||||
|
{
|
||||||
|
RecursionGetNext(x, categories);
|
||||||
|
});
|
||||||
|
|
||||||
|
return tops;
|
||||||
|
}
|
||||||
|
|
||||||
|
public async Task SaveAsync(DishesCategorySaveRequest request)
|
||||||
|
{
|
||||||
|
if (!request.Id.HasValue)
|
||||||
|
{
|
||||||
|
var entity = request.Adapt<DishesCategoryEntity>();
|
||||||
|
entity.Code = Guid.NewGuid();
|
||||||
|
await _dbContext.InsertAsync(entity);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
var entity = await _dbContext.Queryable<DishesCategoryEntity>().Where(x => x.Id == request.Id).FirstAsync();
|
||||||
|
entity.ThrowIfNull("分类不存在,无法更新");
|
||||||
|
request.Adapt(entity);
|
||||||
|
|
||||||
|
await _dbContext.UpdateAsync(entity);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
//************************************************************************************************************************
|
||||||
|
|
||||||
|
private static void RecursionGetNext(DishesCategoryTreeResponse current, List<DishesCategoryTreeResponse> data)
|
||||||
|
{
|
||||||
|
var next = data.Where(x => x.PCode == current.Code).ToList();
|
||||||
|
if (next.Any())
|
||||||
|
{
|
||||||
|
current.Next = next;
|
||||||
|
foreach (var item in next)
|
||||||
|
{
|
||||||
|
RecursionGetNext(item, data);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
134
Src/Dlhis.Basic/Dishes/Services/Implements/DishesMenuService.cs
Normal file
134
Src/Dlhis.Basic/Dishes/Services/Implements/DishesMenuService.cs
Normal file
@@ -0,0 +1,134 @@
|
|||||||
|
using Dlhis.Entity.Canteen.Entities;
|
||||||
|
using Dlhis.Entity.Canteen.Enums;
|
||||||
|
using Kurisu.AspNetCore.Utils.Extensions;
|
||||||
|
using Kurisu.Core.DataAccess.Dto;
|
||||||
|
using Kurisu.SqlSugar.Extensions;
|
||||||
|
using Kurisu.SqlSugar.Services;
|
||||||
|
using SqlSugar;
|
||||||
|
using Dlhis.Basic.Dishes.Request;
|
||||||
|
using Dlhis.Basic.Dishes.Response;
|
||||||
|
using Dlhis.Basic.BusinessPlace.Services;
|
||||||
|
using Dlhis.Basic.Dishes.Dto;
|
||||||
|
|
||||||
|
namespace Dlhis.Basic.Dishes.Services.Implements;
|
||||||
|
|
||||||
|
public class DishesMenuService : IDishesMenuService
|
||||||
|
{
|
||||||
|
private readonly IDbContext _dbContext;
|
||||||
|
private readonly IBusinessPlacePermissionsService _businessPlacePermissionsService;
|
||||||
|
|
||||||
|
public DishesMenuService(IDbContext dbContext, IBusinessPlacePermissionsService businessPlacePermissionsService)
|
||||||
|
{
|
||||||
|
_dbContext = dbContext;
|
||||||
|
_businessPlacePermissionsService = businessPlacePermissionsService;
|
||||||
|
}
|
||||||
|
|
||||||
|
public async Task<Pagination<DishesMenuPageResponse>> GetDishesMenuPageAsync(DisheMenuPageRequest request)
|
||||||
|
{
|
||||||
|
return await _dbContext.Queryable<DishesMenuEntity>()
|
||||||
|
.Select<DishesMenuPageResponse>()
|
||||||
|
.ToPageListAsync(request);
|
||||||
|
}
|
||||||
|
|
||||||
|
public async Task SaveDishesMenuAsync(DishesMenuSaveRequest request)
|
||||||
|
{
|
||||||
|
//检验数据
|
||||||
|
CheckDuplicateData(request);
|
||||||
|
|
||||||
|
//检验权限
|
||||||
|
var res = await _businessPlacePermissionsService.GetMyAsync();
|
||||||
|
var myBps = res.dtos.Select(x => x.Code).ToList();
|
||||||
|
|
||||||
|
myBps.Contains(request.BusinessPlaceCode).ThrowIfFalse("非经营营业点,无法保存菜单");
|
||||||
|
|
||||||
|
var entities = request.Items.SelectMany(item =>
|
||||||
|
{
|
||||||
|
var customCode = item.CustomCode;
|
||||||
|
var date = item.Date;
|
||||||
|
|
||||||
|
return item.ShiftTypes.SelectMany(shiftTypeItem =>
|
||||||
|
{
|
||||||
|
var shiftType = shiftTypeItem.ShiftType;
|
||||||
|
|
||||||
|
return shiftTypeItem.Dishes.Select(dishesItem =>
|
||||||
|
{
|
||||||
|
var dishesCode = dishesItem.DishesCode;
|
||||||
|
var number = dishesItem.Number;
|
||||||
|
var price = dishesItem.Price;
|
||||||
|
|
||||||
|
return new DishesMenuEntity
|
||||||
|
{
|
||||||
|
BusinessPlaceCode = request.BusinessPlaceCode,
|
||||||
|
CustomCode = customCode,
|
||||||
|
Date = date,
|
||||||
|
ShiftType = shiftType,
|
||||||
|
DishesCode = dishesCode,
|
||||||
|
Number = number,
|
||||||
|
Price = price,
|
||||||
|
|
||||||
|
Type = CanteenApplicaitonTypeEnumType.Booking,
|
||||||
|
Version = 0,
|
||||||
|
Enable = true,
|
||||||
|
};
|
||||||
|
});
|
||||||
|
});
|
||||||
|
}).ToList();
|
||||||
|
|
||||||
|
var keys = entities.DistinctBy(x => new { x.Date, x.ShiftType }).Select(x => new { x.Date, x.ShiftType }).ToList();
|
||||||
|
var where = LinqExpressionExtension.False<DishesMenuEntity>();
|
||||||
|
keys.ForEach(x =>
|
||||||
|
{
|
||||||
|
where = where.Or(item => item.Date == x.Date && item.ShiftType == x.ShiftType);
|
||||||
|
});
|
||||||
|
|
||||||
|
await _dbContext.Client.Deleteable<DishesMenuEntity>().Where(where).ExecuteCommandAsync();
|
||||||
|
await _dbContext.InsertAsync(entities);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
public async Task<DishesMenuDetailDto> GetBookingDishesDetailAsync(DateTime date, Guid businessPlaceCode, ShiftEnumType shiftType, string dishesCode)
|
||||||
|
{
|
||||||
|
var detail = await _dbContext.Queryable<DishesMenuEntity>()
|
||||||
|
.LeftJoin<DishesEntity>((x, d) => x.DishesCode == d.CustomCode)
|
||||||
|
.Where(x => x.Date == date)
|
||||||
|
.Where(x => x.BusinessPlaceCode == businessPlaceCode)
|
||||||
|
.Where(x => x.ShiftType == shiftType)
|
||||||
|
.Where(x => x.DishesCode == dishesCode)
|
||||||
|
.Where((x, d) => d.Enable)
|
||||||
|
.Select((x, d) => new DishesMenuDetailDto
|
||||||
|
{
|
||||||
|
Date = x.Date,
|
||||||
|
MenuId = x.Id,
|
||||||
|
DishesId = d.Id,
|
||||||
|
DishesCode = d.CustomCode,
|
||||||
|
DishesName = d.Name,
|
||||||
|
Price = x.Price == null || x.Price == 0 ? d.Price : x.Price.Value,
|
||||||
|
Number = x.Number,
|
||||||
|
Version = x.Version,
|
||||||
|
})
|
||||||
|
.SingleAsync();
|
||||||
|
|
||||||
|
return detail;
|
||||||
|
}
|
||||||
|
|
||||||
|
//*********************************************************help methods**********************************************************************
|
||||||
|
|
||||||
|
private static void CheckDuplicateData(DishesMenuSaveRequest request)
|
||||||
|
{
|
||||||
|
(request.Items.DistinctBy(x => new { x.CustomCode, x.Date }).Count() != request.Items.Count).ThrowIfTrue("菜单不可重复");
|
||||||
|
|
||||||
|
foreach (var item in request.Items)
|
||||||
|
{
|
||||||
|
var u = item.Date.ToString("yyyy-MM-dd") + "-" + item.CustomCode;
|
||||||
|
|
||||||
|
(item.ShiftTypes.DistinctBy(x => x.ShiftType).Count() != item.ShiftTypes.Count).ThrowIfTrue($"{u}的餐次不可重复添加");
|
||||||
|
|
||||||
|
foreach (var shiftTypeItem in item.ShiftTypes)
|
||||||
|
{
|
||||||
|
(shiftTypeItem.Dishes.DistinctBy(x => x.DishesCode).Count() != shiftTypeItem.Dishes.Count)
|
||||||
|
.ThrowIfTrue($"{u}的{shiftTypeItem.ShiftType.GetDescription()}下菜品不可重复");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
121
Src/Dlhis.Basic/Dishes/Services/Implements/DishesService.cs
Normal file
121
Src/Dlhis.Basic/Dishes/Services/Implements/DishesService.cs
Normal file
@@ -0,0 +1,121 @@
|
|||||||
|
using Dlhis.Basic.Dishes.Request;
|
||||||
|
using Dlhis.Basic.Dishes.Response;
|
||||||
|
using Dlhis.Entity.Basic.Entity;
|
||||||
|
using Dlhis.Entity.Canteen.Entities;
|
||||||
|
using Dlhis.Entity.Canteen.Enums;
|
||||||
|
using Kurisu.AspNetCore.Utils.Extensions;
|
||||||
|
using Kurisu.Core.DataAccess.Dto;
|
||||||
|
using Kurisu.SqlSugar.Extensions;
|
||||||
|
using Kurisu.SqlSugar.Services;
|
||||||
|
using Mapster;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Globalization;
|
||||||
|
|
||||||
|
namespace Dlhis.Basic.Dishes.Services.Implements;
|
||||||
|
|
||||||
|
public class DishesService : IDishesService
|
||||||
|
{
|
||||||
|
private readonly IDbContext _dbContext;
|
||||||
|
private readonly IConfiguration _configuration;
|
||||||
|
|
||||||
|
public DishesService(IDbContext dbContext, IConfiguration configuration)
|
||||||
|
{
|
||||||
|
_dbContext = dbContext;
|
||||||
|
_configuration = configuration;
|
||||||
|
}
|
||||||
|
|
||||||
|
public async Task<Pagination<DishesResponse>> GetDishesPageAsync(DishesPageRequest request)
|
||||||
|
{
|
||||||
|
//todo 营业点权限
|
||||||
|
|
||||||
|
return await _dbContext.Queryable<DishesEntity>()
|
||||||
|
.LeftJoin<DishesCategoryEntity>((x, category) => x.CategoryCode == category.Code)
|
||||||
|
.WhereIF(request.Search.IsPresent(), x => x.CustomCode == request.Search || x.Name.Contains(request.Search))
|
||||||
|
.WhereIF(request.BusinessPlaceCodes.IsPresent(), x => request.BusinessPlaceCodes.Contains(x.BusinessPlaceCode))
|
||||||
|
.OrderBy(x => x.CreateTime, SqlSugar.OrderByType.Desc)
|
||||||
|
.Select((x, category) => new DishesResponse
|
||||||
|
{
|
||||||
|
CurrnetUnits = x.Units.ToString(),
|
||||||
|
CategoryName = category.Name,
|
||||||
|
|
||||||
|
}, true)
|
||||||
|
.ToPageListAsync(request);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public async Task SaveDishesAsync(DishesSaveRequest request)
|
||||||
|
{
|
||||||
|
if (!request.Id.HasValue)
|
||||||
|
{
|
||||||
|
var dishers = request.Adapt<DishesEntity>();
|
||||||
|
dishers.CustomCode = request.CustomCode;
|
||||||
|
await _dbContext.InsertAsync(dishers);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
var entity = await _dbContext.Queryable<DishesEntity>().Where(x => x.Id == request.Id).FirstAsync();
|
||||||
|
entity.ThrowIfNull("菜品不存在,无法更新");
|
||||||
|
|
||||||
|
request.Adapt(entity);
|
||||||
|
await _dbContext.UpdateAsync(entity);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public async Task<GetDishesMenusBookingResponse> GetDishesMenusBookingSetting(GetDishesMenusBookingRequest request)
|
||||||
|
{
|
||||||
|
// 读取最晚订餐的时间
|
||||||
|
var strDatetime = await _dbContext.Queryable<CanteenSettingEntity>()
|
||||||
|
.Where(x => x.UniqueType == CanteenSettingUnqiueEnumType.Tenant && x.Item == CanteenSettingItemEnumType.BookingDeadline && x.Enable)
|
||||||
|
.Select(x => x.Value)
|
||||||
|
.FirstAsync();
|
||||||
|
|
||||||
|
DateTime dateTime;
|
||||||
|
DateTime.TryParseExact(strDatetime, "HH:mm:ss", null, System.Globalization.DateTimeStyles.None, out dateTime);
|
||||||
|
|
||||||
|
var res = new GetDishesMenusBookingResponse
|
||||||
|
{
|
||||||
|
ServiceTime = dateTime,
|
||||||
|
};
|
||||||
|
|
||||||
|
var shift = await _dbContext.Queryable<BusinessPlaceShiftRelationshipEntity>()
|
||||||
|
.Where(x => x.PlaceCode == request.PlaceCode)
|
||||||
|
.FirstAsync();
|
||||||
|
|
||||||
|
var payTypes = new List<BalanceRecordSourceEnumDto>();
|
||||||
|
var dto1 = new BalanceRecordSourceEnumDto
|
||||||
|
{
|
||||||
|
Type = BalanceRecordSourceEnumType.Cash
|
||||||
|
};
|
||||||
|
payTypes.Add(dto1);
|
||||||
|
|
||||||
|
if (shift != null)
|
||||||
|
{
|
||||||
|
var businessShiftMealRelationships = await _dbContext.Queryable<BusinessShiftMealRelationshipEntity>()
|
||||||
|
.Where(x => x.ShiftCode == shift.ShiftCode)
|
||||||
|
.Select<BusinessShiftMealRelationshipResponse>()
|
||||||
|
.ToListAsync();
|
||||||
|
res.BusinessShiftMealRelationships = businessShiftMealRelationships;
|
||||||
|
|
||||||
|
if (shift.TenantId == request.Factory)
|
||||||
|
{
|
||||||
|
var dto2 = new BalanceRecordSourceEnumDto
|
||||||
|
{
|
||||||
|
Type = BalanceRecordSourceEnumType.LocalTenantSubsidies
|
||||||
|
};
|
||||||
|
payTypes.Add(dto2);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
res.PayTypes = payTypes;
|
||||||
|
return res;
|
||||||
|
}
|
||||||
|
|
||||||
|
public async Task<DishesDetailResponse> GetDishesDetailByIdAsync(long id)
|
||||||
|
{
|
||||||
|
return await _dbContext.Queryable<DishesEntity>()
|
||||||
|
.Where(x => x.Id == id)
|
||||||
|
.Select<DishesDetailResponse>()
|
||||||
|
.SingleAsync();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
@@ -1,4 +1,5 @@
|
|||||||
using Newtonsoft.Json;
|
using Kurisu.AspNetCore.Utils.Extensions;
|
||||||
|
using Newtonsoft.Json;
|
||||||
|
|
||||||
namespace Dlhis.Basic.Organization.Response;
|
namespace Dlhis.Basic.Organization.Response;
|
||||||
|
|
||||||
@@ -26,7 +27,7 @@ public class DepartmentTreeResponse
|
|||||||
/// 下级部门
|
/// 下级部门
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[JsonIgnore]
|
[JsonIgnore]
|
||||||
public List<DepartmentTreeResponse> _Next { get; set; } = new List<DepartmentTreeResponse>();
|
public List<DepartmentTreeResponse> CurrentNext { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 下级部门
|
/// 下级部门
|
||||||
@@ -35,8 +36,12 @@ public class DepartmentTreeResponse
|
|||||||
{
|
{
|
||||||
get
|
get
|
||||||
{
|
{
|
||||||
_Next.ForEach(x => x.Tenant = Tenant);
|
if (CurrentNext.IsPresent())
|
||||||
return _Next;
|
{
|
||||||
|
CurrentNext.ForEach(x => x.Tenant = Tenant);
|
||||||
|
}
|
||||||
|
|
||||||
|
return CurrentNext;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -37,7 +37,7 @@ public class DepartmentService : IDepartmentService
|
|||||||
No = x.Code,
|
No = x.Code,
|
||||||
PNo = null,
|
PNo = null,
|
||||||
Tenant = x.Code,
|
Tenant = x.Code,
|
||||||
_Next = tops.Select(item =>
|
CurrentNext = tops.Select(item =>
|
||||||
{
|
{
|
||||||
var i = item.Adapt<DepartmentTreeResponse>();
|
var i = item.Adapt<DepartmentTreeResponse>();
|
||||||
i.PNo = x.Code;
|
i.PNo = x.Code;
|
||||||
@@ -48,13 +48,18 @@ public class DepartmentService : IDepartmentService
|
|||||||
.ToList();
|
.ToList();
|
||||||
}
|
}
|
||||||
|
|
||||||
private void RecursionGetNext(DepartmentTreeResponse current, List<DepartmentTreeResponse> data)
|
//***************************************************** help methods ****************************************************************
|
||||||
|
|
||||||
|
private static void RecursionGetNext(DepartmentTreeResponse current, List<DepartmentTreeResponse> data)
|
||||||
{
|
{
|
||||||
var next = data.Where(x => x.PNo == current.No).ToList();
|
var next = data.Where(x => x.PNo == current.No).ToList();
|
||||||
current._Next = next;
|
if (next.Any())
|
||||||
foreach (var item in next)
|
|
||||||
{
|
{
|
||||||
RecursionGetNext(item, data);
|
current.CurrentNext = next;
|
||||||
|
foreach (var item in next)
|
||||||
|
{
|
||||||
|
RecursionGetNext(item, data);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -119,19 +119,19 @@ public class GainfoPermissions : IGainfoPermissions
|
|||||||
var deviceUniqueNos = page.Select(x => x.UniqueNo).ToList();
|
var deviceUniqueNos = page.Select(x => x.UniqueNo).ToList();
|
||||||
|
|
||||||
var balanceInfos = await _dbContext.Queryable<BalanceRecordEntity>().Where(x => x.Type == BalanceRecordTypeEnumType.Out)
|
var balanceInfos = await _dbContext.Queryable<BalanceRecordEntity>().Where(x => x.Type == BalanceRecordTypeEnumType.Out)
|
||||||
.Where(x => deviceUniqueNos.Contains(x.DeviceInfo))
|
.Where(x => deviceUniqueNos.Contains(x.DeviceUniqueNo))
|
||||||
.Select(x => new
|
.Select(x => new
|
||||||
{
|
{
|
||||||
x.DeviceInfo,
|
x.DeviceUniqueNo,
|
||||||
Amount = SqlFunc.AggregateSum(x.Amount),
|
Amount = SqlFunc.AggregateSum(x.Amount),
|
||||||
UserCount = SqlFunc.AggregateDistinctCount(x.UserCode)
|
UserCount = SqlFunc.AggregateDistinctCount(x.UserCode)
|
||||||
})
|
})
|
||||||
.GroupBy(x => x.DeviceInfo)
|
.GroupBy(x => x.DeviceUniqueNo)
|
||||||
.ToListAsync();
|
.ToListAsync();
|
||||||
|
|
||||||
page.ForEach(device =>
|
page.ForEach(device =>
|
||||||
{
|
{
|
||||||
var info = balanceInfos.FirstOrDefault(x => x.DeviceInfo == device.UniqueNo);
|
var info = balanceInfos.FirstOrDefault(x => x.DeviceUniqueNo == device.UniqueNo);
|
||||||
if (info != null)
|
if (info != null)
|
||||||
{
|
{
|
||||||
device.Amount = info.Amount;
|
device.Amount = info.Amount;
|
||||||
@@ -172,19 +172,19 @@ public class GainfoPermissions : IGainfoPermissions
|
|||||||
var deviceUniqueNos = page.Data.Select(x => x.UniqueNo).ToList();
|
var deviceUniqueNos = page.Data.Select(x => x.UniqueNo).ToList();
|
||||||
|
|
||||||
var balanceInfos = await _dbContext.Queryable<BalanceRecordEntity>().Where(x => x.Type == BalanceRecordTypeEnumType.Out)
|
var balanceInfos = await _dbContext.Queryable<BalanceRecordEntity>().Where(x => x.Type == BalanceRecordTypeEnumType.Out)
|
||||||
.Where(x => deviceUniqueNos.Contains(x.DeviceInfo))
|
.Where(x => deviceUniqueNos.Contains(x.DeviceUniqueNo))
|
||||||
.Select(x => new
|
.Select(x => new
|
||||||
{
|
{
|
||||||
x.DeviceInfo,
|
x.DeviceUniqueNo,
|
||||||
Amount = SqlFunc.AggregateSum(x.Amount),
|
Amount = SqlFunc.AggregateSum(x.Amount),
|
||||||
UserCount = SqlFunc.AggregateDistinctCount(x.UserCode)
|
UserCount = SqlFunc.AggregateDistinctCount(x.UserCode)
|
||||||
})
|
})
|
||||||
.GroupBy(x => x.DeviceInfo)
|
.GroupBy(x => x.DeviceUniqueNo)
|
||||||
.ToListAsync();
|
.ToListAsync();
|
||||||
|
|
||||||
page.Data.ForEach(device =>
|
page.Data.ForEach(device =>
|
||||||
{
|
{
|
||||||
var info = balanceInfos.FirstOrDefault(x => x.DeviceInfo == device.UniqueNo);
|
var info = balanceInfos.FirstOrDefault(x => x.DeviceUniqueNo == device.UniqueNo);
|
||||||
if (info != null)
|
if (info != null)
|
||||||
{
|
{
|
||||||
device.Amount = info.Amount;
|
device.Amount = info.Amount;
|
||||||
|
|||||||
@@ -5,6 +5,7 @@
|
|||||||
"Microsoft.AspNetCore": "Warning"
|
"Microsoft.AspNetCore": "Warning"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"EightThirtyPM": "20:30:00",
|
||||||
"InternalRequest": {
|
"InternalRequest": {
|
||||||
"CommonRequestUrl": "http://localhost:5001",
|
"CommonRequestUrl": "http://localhost:5001",
|
||||||
"SysRequestUrl": "http://localhost:5003"
|
"SysRequestUrl": "http://localhost:5003"
|
||||||
|
|||||||
@@ -1,4 +1,5 @@
|
|||||||
using Dlhis.Canteen.Order.Request;
|
using Dlhis.Canteen.Dishes.Request;
|
||||||
|
using Dlhis.Canteen.Order.Request;
|
||||||
using Dlhis.Canteen.Order.Response;
|
using Dlhis.Canteen.Order.Response;
|
||||||
using Dlhis.Canteen.Order.Services;
|
using Dlhis.Canteen.Order.Services;
|
||||||
using Kurisu.AspNetCore.DataAccess.SqlSugar.Aop;
|
using Kurisu.AspNetCore.DataAccess.SqlSugar.Aop;
|
||||||
@@ -6,7 +7,7 @@ using Kurisu.Core.DataAccess.Dto;
|
|||||||
using Microsoft.AspNetCore.Authorization;
|
using Microsoft.AspNetCore.Authorization;
|
||||||
using Microsoft.AspNetCore.Mvc;
|
using Microsoft.AspNetCore.Mvc;
|
||||||
|
|
||||||
namespace Dlhis.Canteen.Order.Controllers;
|
namespace Dlhis.Canteen.Dishes.Controllers;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 充值/消费
|
/// 充值/消费
|
||||||
|
|||||||
@@ -1,81 +0,0 @@
|
|||||||
using Dlhis.Canteen.Order.Request;
|
|
||||||
using Dlhis.Canteen.Order.Response;
|
|
||||||
using Dlhis.Canteen.Order.Services;
|
|
||||||
using Kurisu.Core.DataAccess.Dto;
|
|
||||||
using Microsoft.AspNetCore.Authorization;
|
|
||||||
using Microsoft.AspNetCore.Http;
|
|
||||||
using Microsoft.AspNetCore.Mvc;
|
|
||||||
|
|
||||||
namespace Dlhis.Canteen.Order.Controllers;
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 菜单菜品控制器
|
|
||||||
/// </summary>
|
|
||||||
[Authorize]
|
|
||||||
[Route("api/[controller]")]
|
|
||||||
[ApiController]
|
|
||||||
public class MenuDishesController : ControllerBase
|
|
||||||
{
|
|
||||||
private readonly IMenuDishesService _menuDishesService;
|
|
||||||
|
|
||||||
public MenuDishesController(IMenuDishesService menuDishesService)
|
|
||||||
{
|
|
||||||
_menuDishesService = menuDishesService;
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 菜单分页
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="request"></param>
|
|
||||||
/// <returns></returns>
|
|
||||||
[HttpGet("pageMenu")]
|
|
||||||
public async Task<Pagination<GetMenuResponse>> GetMenuAsync([FromQuery]GetMenuRequest request)
|
|
||||||
{
|
|
||||||
return await _menuDishesService.GetMenuAsync(request);
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 菜单保存/更改
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="request"></param>
|
|
||||||
/// <returns></returns>
|
|
||||||
[HttpPost("saveMenu")]
|
|
||||||
public async Task SaveMenuAsync(SaveMenuRequest request)
|
|
||||||
{
|
|
||||||
await _menuDishesService.SaveMenuAsync(request);
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 菜品分页
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="request"></param>
|
|
||||||
/// <returns></returns>
|
|
||||||
[HttpGet("pageDishes")]
|
|
||||||
public async Task<Pagination<GetDishesResponse>> GetDishesAsync([FromQuery] GetDishesRequest request)
|
|
||||||
{
|
|
||||||
return await _menuDishesService.GetDishesAsync(request);
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 菜品保存/更改
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="request"></param>
|
|
||||||
/// <returns></returns>
|
|
||||||
[HttpPost("saveDishes")]
|
|
||||||
public async Task SaveDishesAsync(SaveDishesRequest request)
|
|
||||||
{
|
|
||||||
await _menuDishesService.SaveDishesAsync(request);
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 配置每日菜单菜品及限售
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="request"></param>
|
|
||||||
/// <returns></returns>
|
|
||||||
[HttpPost("disposition")]
|
|
||||||
public async Task DispositionDishesAsync(DispositionDishesRequest request)
|
|
||||||
{
|
|
||||||
await _menuDishesService.DispositionDishesAsync(request);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@@ -1,69 +0,0 @@
|
|||||||
using Dlhis.Canteen.Order.Request;
|
|
||||||
using Dlhis.Canteen.Order.Response;
|
|
||||||
using Dlhis.Canteen.Order.Services;
|
|
||||||
using Kurisu.Core.DataAccess.Dto;
|
|
||||||
using Microsoft.AspNetCore.Authorization;
|
|
||||||
using Microsoft.AspNetCore.Http;
|
|
||||||
using Microsoft.AspNetCore.Mvc;
|
|
||||||
|
|
||||||
namespace Dlhis.Canteen.Order.Controllers;
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
///订单/明细控制器
|
|
||||||
/// </summary>
|
|
||||||
[Authorize]
|
|
||||||
[Route("api/[controller]")]
|
|
||||||
[ApiController]
|
|
||||||
public class MiniProgramOrderDetailController : ControllerBase
|
|
||||||
{
|
|
||||||
private readonly IMiniProgramOrderDetailService _miniProgramOrderDetailService;
|
|
||||||
|
|
||||||
public MiniProgramOrderDetailController(IMiniProgramOrderDetailService miniProgramOrderDetailService)
|
|
||||||
{
|
|
||||||
_miniProgramOrderDetailService = miniProgramOrderDetailService;
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 订单分页
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="request"></param>
|
|
||||||
/// <returns></returns>
|
|
||||||
[HttpGet("pageOrder")]
|
|
||||||
public async Task<Pagination<GetMiniProgramOrderResponse>> GetMiniProgramOrderAsync([FromQuery]GetMiniProgramOrderRequest request)
|
|
||||||
{
|
|
||||||
return await _miniProgramOrderDetailService.GetMiniProgramOrderAsync(request);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 明细保存
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="request"></param>
|
|
||||||
/// <returns></returns>
|
|
||||||
[HttpPost("saveDetail")]
|
|
||||||
public async Task SaveDetailAsync(SaveDetailRequest request)
|
|
||||||
{
|
|
||||||
await _miniProgramOrderDetailService.SaveDetailAsync(request);
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 明细分页
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="request"></param>
|
|
||||||
/// <returns></returns>
|
|
||||||
[HttpGet("pageDetail")]
|
|
||||||
public async Task<Pagination<GetDetailResponse>> GetDetailAsync([FromQuery] GetDetailRequest request)
|
|
||||||
{
|
|
||||||
return await _miniProgramOrderDetailService.GetDetailAsync(request);
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 下单
|
|
||||||
/// </summary>
|
|
||||||
/// <returns></returns>
|
|
||||||
[HttpPost("order")]
|
|
||||||
public async Task OrderAsync(OrderRequest request)
|
|
||||||
{
|
|
||||||
await _miniProgramOrderDetailService.OrderAsync(request);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,11 +1,13 @@
|
|||||||
using Dlhis.Canteen.Order.Request;
|
using Dlhis.Canteen.Dishes.Request;
|
||||||
|
using Dlhis.Canteen.Order.Request;
|
||||||
using Dlhis.Canteen.Order.Response;
|
using Dlhis.Canteen.Order.Response;
|
||||||
using Dlhis.Canteen.Order.Services;
|
using Dlhis.Canteen.Order.Services;
|
||||||
|
using Kurisu.AspNetCore.DataAccess.SqlSugar.Aop;
|
||||||
using Kurisu.Core.DataAccess.Dto;
|
using Kurisu.Core.DataAccess.Dto;
|
||||||
using Microsoft.AspNetCore.Authorization;
|
using Microsoft.AspNetCore.Authorization;
|
||||||
using Microsoft.AspNetCore.Mvc;
|
using Microsoft.AspNetCore.Mvc;
|
||||||
|
|
||||||
namespace Dlhis.Canteen.Order.Controllers;
|
namespace Dlhis.Canteen.Dishes.Controllers;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 订单
|
/// 订单
|
||||||
@@ -44,4 +46,38 @@ public class OrdersController : ControllerBase
|
|||||||
{
|
{
|
||||||
return await _orderService.AddAsync(request);
|
return await _orderService.AddAsync(request);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 设备发起订单
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="request"></param>
|
||||||
|
/// <returns></returns>
|
||||||
|
[HttpPost("device")]
|
||||||
|
[IgnoreTenant]
|
||||||
|
public async Task<OrderResultResponse> DeviceConsume(OrderAddRequest request)
|
||||||
|
{
|
||||||
|
return await _orderService.AddAsync(request);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 订餐
|
||||||
|
/// </summary>
|
||||||
|
/// <returns></returns>
|
||||||
|
[IgnoreTenant]
|
||||||
|
[HttpPost("booking")]
|
||||||
|
public async Task Booking(BookingMealRequest request)
|
||||||
|
{
|
||||||
|
await _orderService.Booking(request);
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 充值
|
||||||
|
/// </summary>
|
||||||
|
/// <returns></returns>
|
||||||
|
[HttpPost("recharge")]
|
||||||
|
public async Task ReCharge()
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,14 +0,0 @@
|
|||||||
//using Microsoft.AspNetCore.Mvc.Filters;
|
|
||||||
|
|
||||||
//namespace Dlhis.Canteen.Order.Filters;
|
|
||||||
|
|
||||||
///// <summary>
|
|
||||||
///// 检查用户设备消费
|
|
||||||
///// </summary>
|
|
||||||
//public class CheckUserDeviceConsumeAttribute : IAsyncActionFilter
|
|
||||||
//{
|
|
||||||
// public Task OnActionExecutionAsync(ActionExecutingContext context, ActionExecutionDelegate next)
|
|
||||||
// {
|
|
||||||
|
|
||||||
// }
|
|
||||||
//}
|
|
||||||
@@ -1,5 +1,4 @@
|
|||||||
using Kurisu.Core.DataAccess.Dto;
|
using Kurisu.Core.DataAccess.Dto;
|
||||||
using SqlSugar;
|
|
||||||
|
|
||||||
namespace Dlhis.Canteen.Order.Request
|
namespace Dlhis.Canteen.Order.Request
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
using System.ComponentModel.DataAnnotations;
|
using System.ComponentModel.DataAnnotations;
|
||||||
|
|
||||||
namespace Dlhis.Canteen.Order.Request;
|
namespace Dlhis.Canteen.Dishes.Request;
|
||||||
|
|
||||||
public class BalanceRecordObsoluteRequest
|
public class BalanceRecordObsoluteRequest
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
using Kurisu.Core.DataAccess.Dto;
|
using Kurisu.Core.DataAccess.Dto;
|
||||||
using System.ComponentModel.DataAnnotations;
|
using System.ComponentModel.DataAnnotations;
|
||||||
|
|
||||||
namespace Dlhis.Canteen.Order.Request
|
namespace Dlhis.Canteen.Dishes.Request
|
||||||
{
|
{
|
||||||
public class BalanceRecordPageByCostIdRequest :PageDto
|
public class BalanceRecordPageByCostIdRequest :PageDto
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
using System.ComponentModel.DataAnnotations;
|
using System.ComponentModel.DataAnnotations;
|
||||||
using Kurisu.Core.DataAccess.Dto;
|
using Kurisu.Core.DataAccess.Dto;
|
||||||
|
|
||||||
namespace Dlhis.Canteen.Order.Request;
|
namespace Dlhis.Canteen.Dishes.Request;
|
||||||
|
|
||||||
public class BalanceRecordPageByDeviceUniqueNoRequest : PageDto
|
public class BalanceRecordPageByDeviceUniqueNoRequest : PageDto
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -4,7 +4,7 @@ using SqlSugar;
|
|||||||
using SqlSugar.DbConvert;
|
using SqlSugar.DbConvert;
|
||||||
using System.ComponentModel.DataAnnotations;
|
using System.ComponentModel.DataAnnotations;
|
||||||
|
|
||||||
namespace Dlhis.Canteen.Order.Request
|
namespace Dlhis.Canteen.Dishes.Request
|
||||||
{
|
{
|
||||||
public class BalanceRecordPageDetailsRequest : PageDto
|
public class BalanceRecordPageDetailsRequest : PageDto
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -2,10 +2,8 @@
|
|||||||
using System.ComponentModel.DataAnnotations;
|
using System.ComponentModel.DataAnnotations;
|
||||||
using Kurisu.Core.DataAccess.Dto;
|
using Kurisu.Core.DataAccess.Dto;
|
||||||
using Kurisu.Core.CustomClass;
|
using Kurisu.Core.CustomClass;
|
||||||
using SqlSugar.DbConvert;
|
|
||||||
using SqlSugar;
|
|
||||||
|
|
||||||
namespace Dlhis.Canteen.Order.Request;
|
namespace Dlhis.Canteen.Dishes.Request;
|
||||||
|
|
||||||
public class BalanceRecordPageRequest : PageDto, IValidatableObject
|
public class BalanceRecordPageRequest : PageDto, IValidatableObject
|
||||||
{
|
{
|
||||||
@@ -17,7 +15,7 @@ public class BalanceRecordPageRequest : PageDto, IValidatableObject
|
|||||||
/// <summary>
|
/// <summary>
|
||||||
/// 餐次
|
/// 餐次
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public List<string> ShiftTypes { get; set; }
|
public List<ShiftEnumType?> ShiftTypes { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 充值/消费
|
/// 充值/消费
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
using Kurisu.Core.DataAccess.Dto;
|
using Kurisu.Core.DataAccess.Dto;
|
||||||
using System.ComponentModel.DataAnnotations;
|
using System.ComponentModel.DataAnnotations;
|
||||||
|
|
||||||
namespace Dlhis.Canteen.Order.Request
|
namespace Dlhis.Canteen.Dishes.Request
|
||||||
{
|
{
|
||||||
public class BalanceRecordSummaryRequest : PageDto
|
public class BalanceRecordSummaryRequest : PageDto
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -3,7 +3,7 @@ using Kurisu.Core.CustomClass;
|
|||||||
using System.ComponentModel.DataAnnotations;
|
using System.ComponentModel.DataAnnotations;
|
||||||
using Kurisu.Core.DataAccess.Dto;
|
using Kurisu.Core.DataAccess.Dto;
|
||||||
|
|
||||||
namespace Dlhis.Canteen.Order.Request
|
namespace Dlhis.Canteen.Dishes.Request
|
||||||
{
|
{
|
||||||
public class BalanceRecordUserPageRequest : PageDto, IValidatableObject
|
public class BalanceRecordUserPageRequest : PageDto, IValidatableObject
|
||||||
{
|
{
|
||||||
|
|||||||
51
Src/Dlhis.Canteen/Order/Request/BookingMealRequest.cs
Normal file
51
Src/Dlhis.Canteen/Order/Request/BookingMealRequest.cs
Normal file
@@ -0,0 +1,51 @@
|
|||||||
|
using System.ComponentModel.DataAnnotations;
|
||||||
|
using Dlhis.Entity.Canteen.Enums;
|
||||||
|
|
||||||
|
namespace Dlhis.Canteen.Dishes.Request;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 订餐请求
|
||||||
|
/// </summary>
|
||||||
|
public class BookingMealRequest : IValidatableObject
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// 订餐的日期
|
||||||
|
/// </summary>
|
||||||
|
public DateTime BookingDate { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 营业点/消费地点
|
||||||
|
/// </summary>
|
||||||
|
public Guid BusinessPlaceCode { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 餐次
|
||||||
|
/// </summary>
|
||||||
|
[EnumDataType(typeof(ShiftEnumType))]
|
||||||
|
public ShiftEnumType ShiftType { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 菜品编码
|
||||||
|
/// </summary>
|
||||||
|
[Required(ErrorMessage = "选菜不能为空")]
|
||||||
|
public string DishesCode { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 消费来源
|
||||||
|
/// </summary>
|
||||||
|
[EnumDataType(typeof(BalanceRecordSourceEnumType))]
|
||||||
|
public BalanceRecordSourceEnumType Source { get; set; }
|
||||||
|
|
||||||
|
|
||||||
|
public IEnumerable<ValidationResult> Validate(ValidationContext validationContext)
|
||||||
|
{
|
||||||
|
BookingDate = BookingDate.Date;
|
||||||
|
|
||||||
|
if (DateTime.Now.Date >= BookingDate)
|
||||||
|
{
|
||||||
|
yield return new ValidationResult("订餐日期小于当天", new[] { nameof(BookingDate) });
|
||||||
|
}
|
||||||
|
|
||||||
|
yield break;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -1,6 +1,6 @@
|
|||||||
using Dlhis.Entity.Canteen.Enums;
|
using Dlhis.Entity.Canteen.Enums;
|
||||||
|
|
||||||
namespace Dlhis.Canteen.Order.Request;
|
namespace Dlhis.Canteen.Dishes.Request;
|
||||||
|
|
||||||
public class ConsumeRequest
|
public class ConsumeRequest
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
using Dlhis.Entity.Canteen.Enums;
|
using Dlhis.Entity.Canteen.Enums;
|
||||||
using System.ComponentModel.DataAnnotations;
|
using System.ComponentModel.DataAnnotations;
|
||||||
|
|
||||||
namespace Dlhis.Canteen.Order.Request
|
namespace Dlhis.Canteen.Dishes.Request
|
||||||
{
|
{
|
||||||
public class ConsumptionTrendRequest
|
public class ConsumptionTrendRequest
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -1,9 +0,0 @@
|
|||||||
namespace Dlhis.Canteen.Order.Request
|
|
||||||
{
|
|
||||||
public class DispositionDeviceRequest
|
|
||||||
{
|
|
||||||
public string PlaceCode { get; set; }
|
|
||||||
|
|
||||||
public List<string> UniqueNos { get; set; }
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,10 +0,0 @@
|
|||||||
namespace Dlhis.Canteen.Order.Request
|
|
||||||
{
|
|
||||||
public class DispositionDishesDto
|
|
||||||
{
|
|
||||||
public Guid DisherCode { get; set; }
|
|
||||||
|
|
||||||
public int RestrictedNum { get; set; }
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,10 +0,0 @@
|
|||||||
namespace Dlhis.Canteen.Order.Request
|
|
||||||
{
|
|
||||||
public class DispositionDishesRequest
|
|
||||||
{
|
|
||||||
public Guid MenudCode { get; set; }
|
|
||||||
|
|
||||||
public List<DispositionDishesDto> DishersDtos { get; set; }
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,9 +1,8 @@
|
|||||||
using Kurisu.Core.DataAccess.Dto;
|
using Kurisu.Core.DataAccess.Dto;
|
||||||
|
|
||||||
namespace Dlhis.Canteen.Order.Request
|
namespace Dlhis.Canteen.Dishes.Request;
|
||||||
|
|
||||||
|
public class GetConsumeDeviceRequest : PageDto
|
||||||
{
|
{
|
||||||
public class GetConsumeDeviceRequest : PageDto
|
public bool IsOff { get; set; }
|
||||||
{
|
|
||||||
public bool IsOff { get; set; }
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,8 +0,0 @@
|
|||||||
using Kurisu.Core.DataAccess.Dto;
|
|
||||||
|
|
||||||
namespace Dlhis.Canteen.Order.Request
|
|
||||||
{
|
|
||||||
public class GetDetailRequest : PageDto
|
|
||||||
{
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,9 +0,0 @@
|
|||||||
using Kurisu.Core.DataAccess.Dto;
|
|
||||||
|
|
||||||
namespace Dlhis.Canteen.Order.Request
|
|
||||||
{
|
|
||||||
public class GetDishesRequest : PageDto
|
|
||||||
{
|
|
||||||
public Guid? MenuCode { get; set; }
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,11 +0,0 @@
|
|||||||
using Kurisu.Core.DataAccess.Dto;
|
|
||||||
|
|
||||||
namespace Dlhis.Canteen.Order.Request
|
|
||||||
{
|
|
||||||
public class GetMenuRequest : PageDto
|
|
||||||
{
|
|
||||||
public Guid? PlaceCode { get; set; }
|
|
||||||
|
|
||||||
public string Factory { get; set; }
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,12 +0,0 @@
|
|||||||
using Kurisu.Core.DataAccess.Dto;
|
|
||||||
|
|
||||||
namespace Dlhis.Canteen.Order.Request
|
|
||||||
{
|
|
||||||
public class GetMiniProgramOrderRequest : PageDto
|
|
||||||
{
|
|
||||||
/// <summary>
|
|
||||||
/// 用餐日期
|
|
||||||
/// </summary>
|
|
||||||
public DateOnly? SysDate { get; set; }
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,6 +1,6 @@
|
|||||||
using Kurisu.Core.DataAccess.Dto;
|
using Kurisu.Core.DataAccess.Dto;
|
||||||
|
|
||||||
namespace Dlhis.Canteen.Order.Request
|
namespace Dlhis.Canteen.Dishes.Request
|
||||||
{
|
{
|
||||||
public class OaEMealVoucherDetailRequest : PageDto
|
public class OaEMealVoucherDetailRequest : PageDto
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
using Kurisu.Core.DataAccess.Dto;
|
using Kurisu.Core.DataAccess.Dto;
|
||||||
using System.ComponentModel.DataAnnotations;
|
using System.ComponentModel.DataAnnotations;
|
||||||
|
|
||||||
namespace Dlhis.Canteen.Order.Request
|
namespace Dlhis.Canteen.Dishes.Request
|
||||||
{
|
{
|
||||||
public class OaEMealVoucherRequest : PageDto
|
public class OaEMealVoucherRequest : PageDto
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -1,50 +0,0 @@
|
|||||||
using Dlhis.Entity.Canteen.Enums;
|
|
||||||
using SqlSugar.DbConvert;
|
|
||||||
using SqlSugar;
|
|
||||||
|
|
||||||
namespace Dlhis.Canteen.Order.Request
|
|
||||||
{
|
|
||||||
public class OrderRequest
|
|
||||||
{
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 订餐人
|
|
||||||
/// </summary>
|
|
||||||
public string UserCode { get; set; }
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 食堂
|
|
||||||
/// </summary>
|
|
||||||
public Guid PlaceCode { get; set; }
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 餐次
|
|
||||||
/// </summary>
|
|
||||||
public ShiftEnumType ShiftType { get; set; }
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 配送地址
|
|
||||||
/// </summary>
|
|
||||||
public string Address { get; set; }
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 菜单
|
|
||||||
/// </summary>
|
|
||||||
public Guid MenuCode { get; set; }
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 菜品
|
|
||||||
/// </summary>
|
|
||||||
public Guid DishesCode { get; set; }
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 数量
|
|
||||||
/// </summary>
|
|
||||||
public int DishesNum { get; set; } = 1;
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 支付方式
|
|
||||||
/// </summary>
|
|
||||||
public CanteenPayEnumType PayType { get; set; }
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,7 +1,7 @@
|
|||||||
using Dlhis.Entity.Canteen.Enums;
|
using Dlhis.Entity.Canteen.Enums;
|
||||||
using System.ComponentModel.DataAnnotations;
|
using System.ComponentModel.DataAnnotations;
|
||||||
|
|
||||||
namespace Dlhis.Canteen.Order.Request;
|
namespace Dlhis.Canteen.Dishes.Request;
|
||||||
|
|
||||||
public class RechargeRequest
|
public class RechargeRequest
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -1,59 +0,0 @@
|
|||||||
using Dlhis.Entity.Canteen.Enums;
|
|
||||||
using SqlSugar.DbConvert;
|
|
||||||
using SqlSugar;
|
|
||||||
using System.ComponentModel.DataAnnotations;
|
|
||||||
|
|
||||||
namespace Dlhis.Canteen.Order.Request
|
|
||||||
{
|
|
||||||
public class SaveDishesRequest
|
|
||||||
{
|
|
||||||
|
|
||||||
public long? Id { get; set; }
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 大类
|
|
||||||
/// </summary>
|
|
||||||
public string Categories { get; set; }
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 小类
|
|
||||||
/// </summary>
|
|
||||||
public string SubCategories { get; set; }
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 菜品名称
|
|
||||||
/// </summary>
|
|
||||||
public string Name { get; set; }
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 类型
|
|
||||||
/// </summary>
|
|
||||||
[EnumDataType(typeof(CanteenDishesEnumType))]
|
|
||||||
public CanteenDishesEnumType Type { get; set; }
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 描述
|
|
||||||
/// </summary>
|
|
||||||
public string Description { get; set; }
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 单价
|
|
||||||
/// </summary>
|
|
||||||
public decimal Amount { get; set; }
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 单位
|
|
||||||
/// </summary>
|
|
||||||
public string Unit { get; set; }
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 图片
|
|
||||||
/// </summary>
|
|
||||||
public string Image { get; set; }
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 是否启用
|
|
||||||
/// </summary>
|
|
||||||
public bool Enable { get; set; }
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,44 +0,0 @@
|
|||||||
using Dlhis.Entity.Canteen.Enums;
|
|
||||||
using Dlhis.Entity.Device.Enums;
|
|
||||||
using SqlSugar;
|
|
||||||
using System.ComponentModel.DataAnnotations;
|
|
||||||
|
|
||||||
namespace Dlhis.Canteen.Order.Request
|
|
||||||
{
|
|
||||||
public class SaveMenuRequest
|
|
||||||
{
|
|
||||||
public long? Id { get; set; }
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 菜单名称
|
|
||||||
/// </summary>
|
|
||||||
public string Name { get; set; }
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 所属营业点
|
|
||||||
/// </summary>
|
|
||||||
[Required]
|
|
||||||
public Guid PlaceCode { get; set; }
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 厂区
|
|
||||||
/// </summary>
|
|
||||||
public string Factory { get; set; }
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 营业日期
|
|
||||||
/// </summary>
|
|
||||||
public DateOnly StartDate { get; set; }
|
|
||||||
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 餐次段
|
|
||||||
/// </summary>
|
|
||||||
public List<ShiftEnumType> ShiftTypes { get; set; }
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 是否启用
|
|
||||||
/// </summary>
|
|
||||||
public bool Enable { get; set; }
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -2,7 +2,7 @@
|
|||||||
|
|
||||||
namespace Dlhis.Canteen.Order.Request
|
namespace Dlhis.Canteen.Order.Request
|
||||||
{
|
{
|
||||||
public class SpendingDetailRequest:PageDto
|
public class SpendingDetailRequest : PageDto
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,25 +1,24 @@
|
|||||||
namespace Dlhis.Canteen.Order.Response
|
namespace Dlhis.Canteen.Order.Response;
|
||||||
|
|
||||||
|
public class AverageDailyResponse
|
||||||
{
|
{
|
||||||
public class AverageDailyResponse
|
/// <summary>
|
||||||
{
|
/// 档案号/QRCode
|
||||||
/// <summary>
|
/// </summary>
|
||||||
/// 档案号/QRCode
|
public string UserNo { get; set; }
|
||||||
/// </summary>
|
|
||||||
public string UserNo { get; set; }
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 姓名
|
/// 姓名
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public string Name { get; set; }
|
public string Name { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 学工号
|
/// 学工号
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public string UserCode { get; set; }
|
public string UserCode { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 日消费均额
|
/// 日消费均额
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public int AverageAmount { get; set; }
|
public int AverageAmount { get; set; }
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,6 +1,4 @@
|
|||||||
using SqlSugar;
|
namespace Dlhis.Canteen.Order.Response
|
||||||
|
|
||||||
namespace Dlhis.Canteen.Order.Response
|
|
||||||
{
|
{
|
||||||
public class BalanceRecordAnalysisRespones
|
public class BalanceRecordAnalysisRespones
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -1,71 +1,67 @@
|
|||||||
using Dlhis.Entity.Canteen.Enums;
|
using Dlhis.Entity.Canteen.Enums;
|
||||||
using SqlSugar.DbConvert;
|
|
||||||
using SqlSugar;
|
|
||||||
using Kurisu.AspNetCore.Utils.Extensions;
|
using Kurisu.AspNetCore.Utils.Extensions;
|
||||||
|
|
||||||
namespace Dlhis.Canteen.Order.Response
|
namespace Dlhis.Canteen.Order.Response;
|
||||||
|
|
||||||
|
public class GetDetailResponse
|
||||||
{
|
{
|
||||||
public class GetDetailResponse
|
/// <summary>
|
||||||
{
|
/// 订单号
|
||||||
/// <summary>
|
/// </summary>
|
||||||
/// 订单号
|
public string ThirdNo { get; set; }
|
||||||
/// </summary>
|
|
||||||
public string ThirdNo { get; set; }
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 营业日
|
/// 营业日
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public DateOnly BusinessDate { get; set; }
|
public DateOnly SysDate { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 餐次
|
/// 餐次
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public ShiftEnumType ShiftType { get; set; }
|
public ShiftEnumType ShiftType { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 餐次CN
|
/// 餐次CN
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public string ShiftTypeCN => ShiftType.GetDescription();
|
public string ShiftTypeCN => ShiftType.GetDescription();
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 菜品编码
|
/// 菜品编码
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public Guid DishesCode { get; set; }
|
public Guid DishesCode { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 菜品名称
|
/// 菜品名称
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public string DishesName { get; set; }
|
public string DishesName { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 单价
|
/// 单价
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public decimal Price { get; set; }
|
public decimal Price { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 单位
|
/// 单位
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public string Unit { get; set; }
|
public string Unit { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 数量
|
/// 数量
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public int Num { get; set; }
|
public int Num { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 金额
|
/// 金额
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public decimal Amount { get; set; }
|
public decimal Amount { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 订单明细状态
|
/// 订单明细状态
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public OrderDetailsStatusEnumType OrderStatus { get; set; }
|
public OrderDetailsStatusEnumType OrderStatus { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 订单明细状态CN
|
|
||||||
/// </summary>
|
|
||||||
public string OrderStatusCN => OrderStatus.GetDescription();
|
|
||||||
}
|
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 订单明细状态CN
|
||||||
|
/// </summary>
|
||||||
|
public string OrderStatusCN => OrderStatus.GetDescription();
|
||||||
}
|
}
|
||||||
@@ -1,67 +0,0 @@
|
|||||||
using Dlhis.Entity.Canteen.Enums;
|
|
||||||
using SqlSugar.DbConvert;
|
|
||||||
using SqlSugar;
|
|
||||||
using Kurisu.AspNetCore.Utils.Extensions;
|
|
||||||
|
|
||||||
namespace Dlhis.Canteen.Order.Response
|
|
||||||
{
|
|
||||||
public class GetDishesResponse
|
|
||||||
{
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 大类
|
|
||||||
/// </summary>
|
|
||||||
public string Categories { get; set; }
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 小类
|
|
||||||
/// </summary>
|
|
||||||
public string SubCategories { get; set; }
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 菜品编码
|
|
||||||
/// </summary>
|
|
||||||
public Guid Code { get; set; }
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 菜品名称
|
|
||||||
/// </summary>
|
|
||||||
public string Name { get; set; }
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 菜品类型
|
|
||||||
/// </summary>
|
|
||||||
public CanteenDishesEnumType Type { get; set; }
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 菜品类型描述
|
|
||||||
/// </summary>
|
|
||||||
public string TypeDescription => Type.GetDescription();
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 描述
|
|
||||||
/// </summary>
|
|
||||||
public string Description { get; set; }
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 单价
|
|
||||||
/// </summary>
|
|
||||||
public decimal Amount { get; set; }
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 单位
|
|
||||||
/// </summary>
|
|
||||||
public string Unit { get; set; }
|
|
||||||
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 图片
|
|
||||||
/// </summary>
|
|
||||||
public string Image { get; set; }
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 是否启用
|
|
||||||
/// </summary>
|
|
||||||
public bool Enable { get; set; }
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,60 +0,0 @@
|
|||||||
using Dlhis.Entity.Canteen.Enums;
|
|
||||||
using Kurisu.AspNetCore.Utils.Extensions;
|
|
||||||
|
|
||||||
namespace Dlhis.Canteen.Order.Response
|
|
||||||
{
|
|
||||||
public class GetMenuResponse
|
|
||||||
{
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 菜单编码
|
|
||||||
/// </summary>
|
|
||||||
public Guid Code { get; set; }
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 菜单名称
|
|
||||||
/// </summary>
|
|
||||||
public string Name { get; set; }
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 所属营业点
|
|
||||||
/// </summary>
|
|
||||||
public Guid PlaceCode { get; set; }
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 所属营业点名称
|
|
||||||
/// </summary>
|
|
||||||
public string PlaceName { get; set; }
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 厂区
|
|
||||||
/// </summary>
|
|
||||||
public string Factory { get; set; }
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 营业日期
|
|
||||||
/// </summary>
|
|
||||||
public DateOnly StartDate { get; set; }
|
|
||||||
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 餐次段
|
|
||||||
/// </summary>
|
|
||||||
public List<ShiftEnumType> ShiftTypes
|
|
||||||
{
|
|
||||||
get
|
|
||||||
{
|
|
||||||
if (ShiftTypesSrt.IsEmpty()) ShiftTypesSrt = "[]";
|
|
||||||
|
|
||||||
return ShiftTypesSrt.ToObject<List<ShiftEnumType>>();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public string ShiftTypesSrt { get; set; }
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 是否启用
|
|
||||||
/// </summary>
|
|
||||||
public bool Enable { get; set; }
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,136 +0,0 @@
|
|||||||
using Dlhis.Entity.Canteen.Enums;
|
|
||||||
using SqlSugar.DbConvert;
|
|
||||||
using SqlSugar;
|
|
||||||
using Kurisu.AspNetCore.Utils.Extensions;
|
|
||||||
|
|
||||||
namespace Dlhis.Canteen.Order.Response
|
|
||||||
{
|
|
||||||
public class GetMiniProgramOrderResponse
|
|
||||||
{
|
|
||||||
/// <summary>
|
|
||||||
/// 订单号
|
|
||||||
/// </summary>
|
|
||||||
public string No { get; set; }
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 姓名
|
|
||||||
/// </summary>
|
|
||||||
public string Name { get; set; }
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 工号
|
|
||||||
/// </summary>
|
|
||||||
public string Code { get; set; }
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 人事范围
|
|
||||||
/// </summary>
|
|
||||||
public string Werks { get; set; }
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 部门编码
|
|
||||||
/// </summary>
|
|
||||||
public string DepartmentNo { get; set; }
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 部门名称
|
|
||||||
/// </summary>
|
|
||||||
public string DepartmentName { get; set; }
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 成本中心
|
|
||||||
/// </summary>
|
|
||||||
public string CostId { get; set; }
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 工作地
|
|
||||||
/// </summary>
|
|
||||||
public string Workplace { get; set; }
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 厂区
|
|
||||||
/// </summary>
|
|
||||||
public string Factory { get; set; }
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 营业点
|
|
||||||
/// </summary>
|
|
||||||
public Guid PlaceCode { get; set; }
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 营业名称
|
|
||||||
/// </summary>
|
|
||||||
public string PlaceName { get; set; }
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 餐次
|
|
||||||
/// </summary>
|
|
||||||
public ShiftEnumType ShiftType { get; set; }
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 餐次CN
|
|
||||||
/// </summary>
|
|
||||||
public string ShiftTypeCN => ShiftType.GetDescription();
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 菜品
|
|
||||||
/// </summary>
|
|
||||||
public Guid DishesCode { get; set; }
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 菜品名称
|
|
||||||
/// </summary>
|
|
||||||
public string DishesName { get; set; }
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 手机号码
|
|
||||||
/// </summary>
|
|
||||||
public string Phone { get; set; }
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 用餐日期
|
|
||||||
/// </summary>
|
|
||||||
public DateOnly SysDate { get; set; }
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 下单时间
|
|
||||||
/// </summary>
|
|
||||||
public DateTime CostDate { get; set; }
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 支付方式
|
|
||||||
/// </summary>
|
|
||||||
public CanteenPayEnumType PayType { get; set; }
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 支付方式CN
|
|
||||||
/// </summary>
|
|
||||||
public string PayTypeCN => PayType.GetDescription();
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 订单状态
|
|
||||||
/// </summary>
|
|
||||||
public MiniProgramOrderStatusEnumType OrderStatus { get; set; }
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 订单状态CN
|
|
||||||
/// </summary>
|
|
||||||
public string OrderStatusCN => OrderStatus.GetDescription();
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 订单类型
|
|
||||||
/// </summary>
|
|
||||||
public CanteenDishesEnumType OrderType { get; set; }
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 订单类型CN
|
|
||||||
/// </summary>
|
|
||||||
public string OrderTypeCN => OrderType.GetDescription();
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 总金额
|
|
||||||
/// </summary>
|
|
||||||
public decimal TotalAmount { get; set; }
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,100 +1,97 @@
|
|||||||
using SqlSugar;
|
namespace Dlhis.Canteen.Order.Response;
|
||||||
|
|
||||||
namespace Dlhis.Canteen.Order.Response
|
public class OaEMealVoucherResponse
|
||||||
{
|
{
|
||||||
public class OaEMealVoucherResponse
|
public long Id { get; set; }
|
||||||
{
|
|
||||||
public long Id { get; set; }
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 标题
|
/// 标题
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public string Title { get; set; }
|
public string Title { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 申请人工号
|
/// 申请人工号
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public string UserCode { get; set; }
|
public string UserCode { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 申请人名称
|
/// 申请人名称
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public string Name { get; set; }
|
public string Name { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 基地代码
|
/// 基地代码
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public string TenantId { get; set; }
|
public string TenantId { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 基地名称
|
/// 基地名称
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public string TenantName { get; set; }
|
public string TenantName { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 成本中心
|
/// 成本中心
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public string CostId { get; set; }
|
public string CostId { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 成本中心名称
|
/// 成本中心名称
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public string CostName { get; set; }
|
public string CostName { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 来宾公司
|
/// 来宾公司
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public string Company { get; set; }
|
public string Company { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 联系人
|
/// 联系人
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public string Phone { get; set; }
|
public string Phone { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 来宾人数
|
/// 来宾人数
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public int Num { get; set; }
|
public int Num { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 就餐食堂
|
/// 就餐食堂
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public string Canteen { get; set; }
|
public string Canteen { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 就餐事由
|
/// 就餐事由
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public string Reason { get; set; }
|
public string Reason { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 就餐次
|
/// 就餐次
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public string CanteenShift { get; set; }
|
public string CanteenShift { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// oa流程id
|
/// oa流程id
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public string OaId { get; set; }
|
public string OaId { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 部门号
|
/// 部门号
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public string DepartmentNo { get; set; }
|
public string DepartmentNo { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 部门名称
|
/// 部门名称
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public string DepartmentName { get; set; }
|
public string DepartmentName { get; set; }
|
||||||
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 申请日期
|
/// 申请日期
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public DateTime LogDate { get; set; }
|
public DateTime LogDate { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 数据创建时间
|
/// 数据创建时间
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public DateTime CreateTime { get; set; }
|
public DateTime CreateTime { get; set; }
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,38 +1,35 @@
|
|||||||
using SqlSugar;
|
namespace Dlhis.Canteen.Order.Response;
|
||||||
|
|
||||||
namespace Dlhis.Canteen.Order.Response
|
public class SpendingDetailResponse
|
||||||
{
|
{
|
||||||
public class SpendingDetailResponse
|
/// <summary>
|
||||||
{
|
/// 档案号/QRCode
|
||||||
/// <summary>
|
/// </summary>
|
||||||
/// 档案号/QRCode
|
public string UserNo { get; set; }
|
||||||
/// </summary>
|
|
||||||
public string UserNo { get; set; }
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 姓名
|
/// 姓名
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public string Name { get; set; }
|
public string Name { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 学工号
|
/// 学工号
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public string UserCode { get; set; }
|
public string UserCode { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 部门号
|
/// 部门号
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public string DepartmentNo { get; set; }
|
public string DepartmentNo { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 成本中心
|
/// 成本中心
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public string CostId { get; set; }
|
public string CostId { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 消费者所在基地
|
/// 消费者所在基地
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public string OriginTenantId { get; set; }
|
public string OriginTenantId { get; set; }
|
||||||
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,4 +1,5 @@
|
|||||||
using Dlhis.Canteen.Order.Request;
|
using Dlhis.Canteen.Dishes.Request;
|
||||||
|
using Dlhis.Canteen.Order.Request;
|
||||||
using Dlhis.Canteen.Order.Response;
|
using Dlhis.Canteen.Order.Response;
|
||||||
using Kurisu.Core.DataAccess.Dto;
|
using Kurisu.Core.DataAccess.Dto;
|
||||||
using Microsoft.AspNetCore.Mvc;
|
using Microsoft.AspNetCore.Mvc;
|
||||||
|
|||||||
@@ -1,20 +0,0 @@
|
|||||||
using Dlhis.Canteen.Order.Request;
|
|
||||||
using Dlhis.Canteen.Order.Response;
|
|
||||||
using Kurisu.Core.DataAccess.Dto;
|
|
||||||
using Microsoft.AspNetCore.Mvc;
|
|
||||||
|
|
||||||
namespace Dlhis.Canteen.Order.Services
|
|
||||||
{
|
|
||||||
public interface IMenuDishesService :IScopeDependency
|
|
||||||
{
|
|
||||||
Task<Pagination<GetMenuResponse>> GetMenuAsync(GetMenuRequest request);
|
|
||||||
|
|
||||||
Task SaveMenuAsync(SaveMenuRequest request);
|
|
||||||
|
|
||||||
Task<Pagination<GetDishesResponse>> GetDishesAsync(GetDishesRequest request);
|
|
||||||
|
|
||||||
Task SaveDishesAsync(SaveDishesRequest request);
|
|
||||||
|
|
||||||
Task DispositionDishesAsync(DispositionDishesRequest request);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,18 +0,0 @@
|
|||||||
using Dlhis.Canteen.Order.Request;
|
|
||||||
using Dlhis.Canteen.Order.Response;
|
|
||||||
using Kurisu.Core.DataAccess.Dto;
|
|
||||||
using Microsoft.AspNetCore.Mvc;
|
|
||||||
|
|
||||||
namespace Dlhis.Canteen.Order.Services
|
|
||||||
{
|
|
||||||
public interface IMiniProgramOrderDetailService : IScopeDependency
|
|
||||||
{
|
|
||||||
Task<Pagination<GetMiniProgramOrderResponse>> GetMiniProgramOrderAsync(GetMiniProgramOrderRequest request);
|
|
||||||
|
|
||||||
Task SaveDetailAsync(SaveDetailRequest request);
|
|
||||||
|
|
||||||
Task<Pagination<GetDetailResponse>> GetDetailAsync( GetDetailRequest request);
|
|
||||||
|
|
||||||
Task OrderAsync(OrderRequest request);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,4 +1,5 @@
|
|||||||
using Dlhis.Canteen.Order.Request;
|
using Dlhis.Canteen.Dishes.Request;
|
||||||
|
using Dlhis.Canteen.Order.Request;
|
||||||
using Dlhis.Canteen.Order.Response;
|
using Dlhis.Canteen.Order.Response;
|
||||||
using Kurisu.Core.DataAccess.Dto;
|
using Kurisu.Core.DataAccess.Dto;
|
||||||
|
|
||||||
@@ -10,4 +11,17 @@ public interface IOrderService : IScopeDependency
|
|||||||
|
|
||||||
Task<OrderResultResponse> AddAsync(OrderAddRequest request);
|
Task<OrderResultResponse> AddAsync(OrderAddRequest request);
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 设备消费
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="request"></param>
|
||||||
|
/// <returns></returns>
|
||||||
|
Task<OrderResultResponse> DeviceConsume(OrderAddRequest request);
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 订餐
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="request"></param>
|
||||||
|
/// <returns></returns>
|
||||||
|
Task Booking(BookingMealRequest request);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,4 +1,5 @@
|
|||||||
using Dlhis.Canteen.Order.Request;
|
using Dlhis.Canteen.Dishes.Request;
|
||||||
|
using Dlhis.Canteen.Order.Request;
|
||||||
using Dlhis.Canteen.Order.Response;
|
using Dlhis.Canteen.Order.Response;
|
||||||
using Dlhis.Entity.Basic.Entity;
|
using Dlhis.Entity.Basic.Entity;
|
||||||
using Dlhis.Entity.Canteen.Entities;
|
using Dlhis.Entity.Canteen.Entities;
|
||||||
@@ -9,12 +10,10 @@ using Dlhis.Sys.Api;
|
|||||||
using Kurisu.AspNetCore.UnifyResultAndValidation;
|
using Kurisu.AspNetCore.UnifyResultAndValidation;
|
||||||
using Kurisu.AspNetCore.Utils.Extensions;
|
using Kurisu.AspNetCore.Utils.Extensions;
|
||||||
using Kurisu.Core.DataAccess.Dto;
|
using Kurisu.Core.DataAccess.Dto;
|
||||||
using Kurisu.Core.DataAccess.Entity;
|
|
||||||
using Kurisu.Core.User.Abstractions;
|
using Kurisu.Core.User.Abstractions;
|
||||||
using Kurisu.SqlSugar.Extensions;
|
using Kurisu.SqlSugar.Extensions;
|
||||||
using Kurisu.SqlSugar.Services;
|
using Kurisu.SqlSugar.Services;
|
||||||
using Mapster;
|
using Mapster;
|
||||||
using Microsoft.AspNetCore.Mvc;
|
|
||||||
using SqlSugar;
|
using SqlSugar;
|
||||||
|
|
||||||
namespace Dlhis.Canteen.Order.Services.Implements;
|
namespace Dlhis.Canteen.Order.Services.Implements;
|
||||||
@@ -26,7 +25,7 @@ public class BalanceService : IBalanceService
|
|||||||
private readonly ILogger<BalanceService> _logger;
|
private readonly ILogger<BalanceService> _logger;
|
||||||
private readonly ITenantApi _tenantApi;
|
private readonly ITenantApi _tenantApi;
|
||||||
|
|
||||||
public BalanceService(IDbContext dbContext, ICurrentUser currentUser, ILogger<BalanceService> logger ,ITenantApi tenantApi)
|
public BalanceService(IDbContext dbContext, ICurrentUser currentUser, ILogger<BalanceService> logger, ITenantApi tenantApi)
|
||||||
{
|
{
|
||||||
_dbContext = dbContext;
|
_dbContext = dbContext;
|
||||||
_currentUser = currentUser;
|
_currentUser = currentUser;
|
||||||
@@ -41,18 +40,17 @@ public class BalanceService : IBalanceService
|
|||||||
.LeftJoin<DepartmentEntity>((record, ga, department) => ga.DepartmentNo == department.No)
|
.LeftJoin<DepartmentEntity>((record, ga, department) => ga.DepartmentNo == department.No)
|
||||||
.LeftJoin<BusinessPlaceEntity>((record, ga, department, bplace) => record.BusinessPlaceCode == bplace.Code)
|
.LeftJoin<BusinessPlaceEntity>((record, ga, department, bplace) => record.BusinessPlaceCode == bplace.Code)
|
||||||
.LeftJoin<BusinessShiftEntity>((record, ga, department, bplace, bshift) => record.BusinessShiftCode == bshift.Code)
|
.LeftJoin<BusinessShiftEntity>((record, ga, department, bplace, bshift) => record.BusinessShiftCode == bshift.Code)
|
||||||
.LeftJoin<BasicTypeEntity>((record, ga, department, bplace, bshift, type) => record.ShiftType == type.Code && type.Type == "mealshift")
|
|
||||||
.WhereIF(request.SearchDateTimePeriod?.Start.HasValue == true, record => record.CostDate >= request.SearchDateTimePeriod.Start)
|
.WhereIF(request.SearchDateTimePeriod?.Start.HasValue == true, record => record.CostDate >= request.SearchDateTimePeriod.Start)
|
||||||
.WhereIF(request.SearchDateTimePeriod?.End.HasValue == true, record => record.CostDate <= request.SearchDateTimePeriod.End)
|
.WhereIF(request.SearchDateTimePeriod?.End.HasValue == true, record => record.CostDate <= request.SearchDateTimePeriod.End)
|
||||||
.WhereIF(request.BusinessplaceCodes.IsPresent(), record => request.BusinessplaceCodes.Contains(record.BusinessPlaceCode))
|
.WhereIF(request.BusinessplaceCodes.IsPresent(), record => request.BusinessplaceCodes.Contains(record.BusinessPlaceCode))
|
||||||
.WhereIF(request.ShiftTypes.IsPresent(), record => request.ShiftTypes.Contains(record.ShiftType))
|
.WhereIF(request.ShiftTypes.IsPresent(), record => request.ShiftTypes.Contains(record.ShiftType))
|
||||||
.WhereIF(request.Type.HasValue,record => record.Type == request.Type)
|
.WhereIF(request.Type.HasValue, record => record.Type == request.Type)
|
||||||
.WhereIF(request.Search.IsPresent(), (record, ga) =>
|
.WhereIF(request.Search.IsPresent(), (record, ga) =>
|
||||||
ga.Name.Contains(request.Search)
|
ga.Name.Contains(request.Search)
|
||||||
|| ga.Code.Contains(request.Search)
|
|| ga.Code.Contains(request.Search)
|
||||||
)
|
)
|
||||||
.OrderBy(record => record.CreateTime, OrderByType.Desc)
|
.OrderBy(record => record.CreateTime, OrderByType.Desc)
|
||||||
.Select((record, ga, department, bplace, bshift, type) => new BalanceRecordResponse
|
.Select((record, ga, department, bplace, bshift) => new BalanceRecordResponse
|
||||||
{
|
{
|
||||||
Id = record.Id,
|
Id = record.Id,
|
||||||
Amount = record.Amount,
|
Amount = record.Amount,
|
||||||
@@ -61,7 +59,7 @@ public class BalanceService : IBalanceService
|
|||||||
CostDate = record.CostDate,
|
CostDate = record.CostDate,
|
||||||
CostId = record.CostId,
|
CostId = record.CostId,
|
||||||
DepartmentNo = record.DepartmentNo,
|
DepartmentNo = record.DepartmentNo,
|
||||||
DeviceInfo = record.DeviceInfo,
|
DeviceInfo = record.DeviceUniqueNo,
|
||||||
IP = record.IP,
|
IP = record.IP,
|
||||||
UserNo = record.UserNo,
|
UserNo = record.UserNo,
|
||||||
UserCode = record.UserCode,
|
UserCode = record.UserCode,
|
||||||
@@ -75,7 +73,7 @@ public class BalanceService : IBalanceService
|
|||||||
Name = record.Name,
|
Name = record.Name,
|
||||||
DepartmentName = department.Name,
|
DepartmentName = department.Name,
|
||||||
BusinessPlaceName = bplace.Name,
|
BusinessPlaceName = bplace.Name,
|
||||||
BusinessShiftName = type.Display,
|
BusinessShiftName = bshift.Name,
|
||||||
CostDateTime = record.CostDateTime,
|
CostDateTime = record.CostDateTime,
|
||||||
TenantId = record.TenantId,
|
TenantId = record.TenantId,
|
||||||
})
|
})
|
||||||
@@ -109,8 +107,6 @@ public class BalanceService : IBalanceService
|
|||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
public async Task<Pagination<BalanceRecordCostIdResponse>> RecordByCostIdAsync(BalanceRecordPageByCostIdRequest request)
|
public async Task<Pagination<BalanceRecordCostIdResponse>> RecordByCostIdAsync(BalanceRecordPageByCostIdRequest request)
|
||||||
{
|
{
|
||||||
var shiftCodeDict = await GetShiftCode();
|
|
||||||
|
|
||||||
var paeginfos = await _dbContext.Queryable<BalanceRecordEntity>()
|
var paeginfos = await _dbContext.Queryable<BalanceRecordEntity>()
|
||||||
.WhereIF(!request.UserCode.IsEmpty(), record => record.UserCode == request.UserCode)
|
.WhereIF(!request.UserCode.IsEmpty(), record => record.UserCode == request.UserCode)
|
||||||
.WhereIF(!request.DepartmentNo.IsEmpty(), record => record.DepartmentNo == request.DepartmentNo)
|
.WhereIF(!request.DepartmentNo.IsEmpty(), record => record.DepartmentNo == request.DepartmentNo)
|
||||||
@@ -132,24 +128,24 @@ public class BalanceService : IBalanceService
|
|||||||
};
|
};
|
||||||
|
|
||||||
// 所有人次
|
// 所有人次
|
||||||
var BreakfastNumberOfPeople = costIdGroup.Count(x => x.ShiftType == shiftCodeDict["Breakfast"]);
|
var BreakfastNumberOfPeople = costIdGroup.Count(x => x.ShiftType == ShiftEnumType.Breakfast);
|
||||||
|
|
||||||
var LunchNumberOfPeople = costIdGroup.Count(x => x.ShiftType == shiftCodeDict["Lunch"]);
|
var LunchNumberOfPeople = costIdGroup.Count(x => x.ShiftType == ShiftEnumType.Lunch);
|
||||||
|
|
||||||
var DinnerNumberOfPeople = costIdGroup.Count(x => x.ShiftType == shiftCodeDict["Dinner"]);
|
var DinnerNumberOfPeople = costIdGroup.Count(x => x.ShiftType == ShiftEnumType.Dinner);
|
||||||
|
|
||||||
var LateNightNumberOfPeople = costIdGroup.Count(x => x.ShiftType == shiftCodeDict["LateNight"]);
|
var LateNightNumberOfPeople = costIdGroup.Count(x => x.ShiftType == ShiftEnumType.Nightsnack);
|
||||||
// 每个餐次人数
|
// 每个餐次人数
|
||||||
obj.BreakfastNumberOfPeople = costIdGroup.Where(x => x.ShiftType == shiftCodeDict["Breakfast"]).Select(x => x.UserNo).Distinct().Count();
|
obj.BreakfastNumberOfPeople = costIdGroup.Where(x => x.ShiftType == ShiftEnumType.Breakfast).Select(x => x.UserNo).Distinct().Count();
|
||||||
obj.LunchNumberOfPeople = costIdGroup.Where(x => x.ShiftType == shiftCodeDict["Lunch"]).Select(x => x.UserNo).Distinct().Count();
|
obj.LunchNumberOfPeople = costIdGroup.Where(x => x.ShiftType == ShiftEnumType.Lunch).Select(x => x.UserNo).Distinct().Count();
|
||||||
obj.DinnerNumberOfPeople = costIdGroup.Where(x => x.ShiftType == shiftCodeDict["Dinner"]).Select(x => x.UserNo).Distinct().Count();
|
obj.DinnerNumberOfPeople = costIdGroup.Where(x => x.ShiftType == ShiftEnumType.Dinner).Select(x => x.UserNo).Distinct().Count();
|
||||||
obj.LateNightNumberOfPeople = costIdGroup.Where(x => x.ShiftType == shiftCodeDict["LateNight"]).Select(x => x.UserNo).Distinct().Count();
|
obj.LateNightNumberOfPeople = costIdGroup.Where(x => x.ShiftType == ShiftEnumType.Nightsnack).Select(x => x.UserNo).Distinct().Count();
|
||||||
|
|
||||||
//餐次金额
|
//餐次金额
|
||||||
obj.BreakfastAmount = Math.Abs(costIdGroup.Where(x => x.ShiftType == shiftCodeDict["Breakfast"]).Sum(x => x.Amount));
|
obj.BreakfastAmount = Math.Abs(costIdGroup.Where(x => x.ShiftType == ShiftEnumType.Breakfast).Sum(x => x.Amount));
|
||||||
obj.LunchAmount = Math.Abs(costIdGroup.Where(x => x.ShiftType == shiftCodeDict["Lunch"]).Sum(x => x.Amount));
|
obj.LunchAmount = Math.Abs(costIdGroup.Where(x => x.ShiftType == ShiftEnumType.Lunch).Sum(x => x.Amount));
|
||||||
obj.DinnerAmount = Math.Abs(costIdGroup.Where(x => x.ShiftType == shiftCodeDict["Dinner"]).Sum(x => x.Amount));
|
obj.DinnerAmount = Math.Abs(costIdGroup.Where(x => x.ShiftType == ShiftEnumType.Dinner).Sum(x => x.Amount));
|
||||||
obj.LateNightAmount = Math.Abs(costIdGroup.Where(x => x.ShiftType == shiftCodeDict["LateNight"]).Sum(x => x.Amount));
|
obj.LateNightAmount = Math.Abs(costIdGroup.Where(x => x.ShiftType == ShiftEnumType.Nightsnack).Sum(x => x.Amount));
|
||||||
|
|
||||||
|
|
||||||
// 每个餐次单价
|
// 每个餐次单价
|
||||||
@@ -210,7 +206,7 @@ public class BalanceService : IBalanceService
|
|||||||
CostDate = record.CostDate,
|
CostDate = record.CostDate,
|
||||||
CostId = record.CostId,
|
CostId = record.CostId,
|
||||||
DepartmentNo = record.DepartmentNo,
|
DepartmentNo = record.DepartmentNo,
|
||||||
DeviceInfo = record.DeviceInfo,
|
DeviceInfo = record.DeviceUniqueNo,
|
||||||
IP = record.IP,
|
IP = record.IP,
|
||||||
UserNo = record.UserNo,
|
UserNo = record.UserNo,
|
||||||
UserCode = record.UserCode,
|
UserCode = record.UserCode,
|
||||||
@@ -242,8 +238,6 @@ public class BalanceService : IBalanceService
|
|||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
public async Task<Pagination<BalanceRecordSummaryRespones>> BalanceRecordSummaryByNoAsync(BalanceRecordSummaryRequest request)
|
public async Task<Pagination<BalanceRecordSummaryRespones>> BalanceRecordSummaryByNoAsync(BalanceRecordSummaryRequest request)
|
||||||
{
|
{
|
||||||
var shiftCodeDict = await GetShiftCode();
|
|
||||||
|
|
||||||
var paeginfos = await _dbContext.Queryable<BalanceRecordEntity>()
|
var paeginfos = await _dbContext.Queryable<BalanceRecordEntity>()
|
||||||
.WhereIF(!request.DepartmentNo.IsEmpty(), record => record.DepartmentNo == request.DepartmentNo)
|
.WhereIF(!request.DepartmentNo.IsEmpty(), record => record.DepartmentNo == request.DepartmentNo)
|
||||||
.WhereIF(!request.UserCode.IsEmpty(), record => record.UserCode == request.UserCode)
|
.WhereIF(!request.UserCode.IsEmpty(), record => record.UserCode == request.UserCode)
|
||||||
@@ -267,24 +261,24 @@ public class BalanceService : IBalanceService
|
|||||||
OriginTenantId = ""
|
OriginTenantId = ""
|
||||||
};
|
};
|
||||||
// 所有人次
|
// 所有人次
|
||||||
var BreakfastNumberOfPeople = departmentGroup.Count(x => x.ShiftType == shiftCodeDict["Breakfast"]);
|
var BreakfastNumberOfPeople = departmentGroup.Count(x => x.ShiftType == ShiftEnumType.Breakfast);
|
||||||
|
|
||||||
var LunchNumberOfPeople = departmentGroup.Count(x => x.ShiftType == shiftCodeDict["Lunch"]);
|
var LunchNumberOfPeople = departmentGroup.Count(x => x.ShiftType == ShiftEnumType.Lunch);
|
||||||
|
|
||||||
var DinnerNumberOfPeople = departmentGroup.Count(x => x.ShiftType == shiftCodeDict["Dinner"]);
|
var DinnerNumberOfPeople = departmentGroup.Count(x => x.ShiftType == ShiftEnumType.Dinner);
|
||||||
|
|
||||||
var LateNightNumberOfPeople = departmentGroup.Count(x => x.ShiftType == shiftCodeDict["LateNight"]);
|
var LateNightNumberOfPeople = departmentGroup.Count(x => x.ShiftType == ShiftEnumType.Nightsnack);
|
||||||
//每个餐次人数
|
//每个餐次人数
|
||||||
obj.BreakfastNumberOfPeople = departmentGroup.Where(x => x.ShiftType == shiftCodeDict["Breakfast"]).Select(x => x.UserNo).Distinct().Count();
|
obj.BreakfastNumberOfPeople = departmentGroup.Where(x => x.ShiftType == ShiftEnumType.Breakfast).Select(x => x.UserNo).Distinct().Count();
|
||||||
obj.LunchNumberOfPeople = departmentGroup.Where(x => x.ShiftType == shiftCodeDict["Lunch"]).Select(x => x.UserNo).Distinct().Count();
|
obj.LunchNumberOfPeople = departmentGroup.Where(x => x.ShiftType == ShiftEnumType.Lunch).Select(x => x.UserNo).Distinct().Count();
|
||||||
obj.DinnerNumberOfPeople = departmentGroup.Where(x => x.ShiftType == shiftCodeDict["Dinner"]).Select(x => x.UserNo).Distinct().Count();
|
obj.DinnerNumberOfPeople = departmentGroup.Where(x => x.ShiftType == ShiftEnumType.Dinner).Select(x => x.UserNo).Distinct().Count();
|
||||||
obj.LateNightNumberOfPeople = departmentGroup.Where(x => x.ShiftType == shiftCodeDict["LateNight"]).Select(x => x.UserNo).Distinct().Count();
|
obj.LateNightNumberOfPeople = departmentGroup.Where(x => x.ShiftType == ShiftEnumType.Nightsnack).Select(x => x.UserNo).Distinct().Count();
|
||||||
|
|
||||||
//餐次金额
|
//餐次金额
|
||||||
obj.BreakfastAmount = Math.Abs(departmentGroup.Where(x => x.ShiftType == shiftCodeDict["Breakfast"]).Sum(x => x.Amount));
|
obj.BreakfastAmount = Math.Abs(departmentGroup.Where(x => x.ShiftType == ShiftEnumType.Breakfast).Sum(x => x.Amount));
|
||||||
obj.LunchAmount = Math.Abs(departmentGroup.Where(x => x.ShiftType == shiftCodeDict["Lunch"]).Sum(x => x.Amount));
|
obj.LunchAmount = Math.Abs(departmentGroup.Where(x => x.ShiftType == ShiftEnumType.Lunch).Sum(x => x.Amount));
|
||||||
obj.DinnerAmount = Math.Abs(departmentGroup.Where(x => x.ShiftType == shiftCodeDict["Dinner"]).Sum(x => x.Amount));
|
obj.DinnerAmount = Math.Abs(departmentGroup.Where(x => x.ShiftType == ShiftEnumType.Dinner).Sum(x => x.Amount));
|
||||||
obj.LateNightAmount = Math.Abs(departmentGroup.Where(x => x.ShiftType == shiftCodeDict["LateNight"]).Sum(x => x.Amount));
|
obj.LateNightAmount = Math.Abs(departmentGroup.Where(x => x.ShiftType == ShiftEnumType.Nightsnack).Sum(x => x.Amount));
|
||||||
|
|
||||||
// 每个餐次单价
|
// 每个餐次单价
|
||||||
obj.BreakfastPrice = BreakfastNumberOfPeople == 0 ? 0 : Math.Round(obj.BreakfastAmount / BreakfastNumberOfPeople, 2);
|
obj.BreakfastPrice = BreakfastNumberOfPeople == 0 ? 0 : Math.Round(obj.BreakfastAmount / BreakfastNumberOfPeople, 2);
|
||||||
@@ -326,8 +320,6 @@ public class BalanceService : IBalanceService
|
|||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
public async Task<Pagination<BalanceRecordSummaryRespones>> BalanceRecordSummaryByTidAsync(BalanceRecordSummaryRequest request)
|
public async Task<Pagination<BalanceRecordSummaryRespones>> BalanceRecordSummaryByTidAsync(BalanceRecordSummaryRequest request)
|
||||||
{
|
{
|
||||||
var shiftCodeDict = await GetShiftCode();
|
|
||||||
|
|
||||||
var paeginfos = await _dbContext.Queryable<BalanceRecordEntity>()
|
var paeginfos = await _dbContext.Queryable<BalanceRecordEntity>()
|
||||||
.WhereIF(!request.DepartmentNo.IsEmpty(), record => record.DepartmentNo == request.DepartmentNo)
|
.WhereIF(!request.DepartmentNo.IsEmpty(), record => record.DepartmentNo == request.DepartmentNo)
|
||||||
.WhereIF(!request.UserCode.IsEmpty(), record => record.UserCode == request.UserCode)
|
.WhereIF(!request.UserCode.IsEmpty(), record => record.UserCode == request.UserCode)
|
||||||
@@ -352,24 +344,21 @@ public class BalanceService : IBalanceService
|
|||||||
};
|
};
|
||||||
|
|
||||||
// 所有人次
|
// 所有人次
|
||||||
var BreakfastNumberOfPeople = originTenantIdGroup.Count(x => x.ShiftType == shiftCodeDict["Breakfast"]);
|
var BreakfastNumberOfPeople = originTenantIdGroup.Count(x => x.ShiftType == ShiftEnumType.Breakfast);
|
||||||
|
var LunchNumberOfPeople = originTenantIdGroup.Count(x => x.ShiftType == ShiftEnumType.Lunch);
|
||||||
var LunchNumberOfPeople = originTenantIdGroup.Count(x => x.ShiftType == shiftCodeDict["Lunch"]);
|
var DinnerNumberOfPeople = originTenantIdGroup.Count(x => x.ShiftType == ShiftEnumType.Dinner);
|
||||||
|
var LateNightNumberOfPeople = originTenantIdGroup.Count(x => x.ShiftType == ShiftEnumType.Nightsnack);
|
||||||
var DinnerNumberOfPeople = originTenantIdGroup.Count(x => x.ShiftType == shiftCodeDict["Dinner"]);
|
|
||||||
|
|
||||||
var LateNightNumberOfPeople = originTenantIdGroup.Count(x => x.ShiftType == shiftCodeDict["LateNight"]);
|
|
||||||
//每个餐次人数
|
//每个餐次人数
|
||||||
obj.BreakfastNumberOfPeople = originTenantIdGroup.Where(x => x.ShiftType == shiftCodeDict["Breakfast"]).Select(x => x.UserNo).Distinct().Count();
|
obj.BreakfastNumberOfPeople = originTenantIdGroup.Where(x => x.ShiftType == ShiftEnumType.Breakfast).Select(x => x.UserNo).Distinct().Count();
|
||||||
obj.LunchNumberOfPeople = originTenantIdGroup.Where(x => x.ShiftType == shiftCodeDict["Lunch"]).Select(x => x.UserNo).Distinct().Count();
|
obj.LunchNumberOfPeople = originTenantIdGroup.Where(x => x.ShiftType == ShiftEnumType.Lunch).Select(x => x.UserNo).Distinct().Count();
|
||||||
obj.DinnerNumberOfPeople = originTenantIdGroup.Where(x => x.ShiftType == shiftCodeDict["Dinner"]).Select(x => x.UserNo).Distinct().Count();
|
obj.DinnerNumberOfPeople = originTenantIdGroup.Where(x => x.ShiftType == ShiftEnumType.Dinner).Select(x => x.UserNo).Distinct().Count();
|
||||||
obj.LateNightNumberOfPeople = originTenantIdGroup.Where(x => x.ShiftType == shiftCodeDict["LateNight"]).Select(x => x.UserNo).Distinct().Count();
|
obj.LateNightNumberOfPeople = originTenantIdGroup.Where(x => x.ShiftType == ShiftEnumType.Nightsnack).Select(x => x.UserNo).Distinct().Count();
|
||||||
|
|
||||||
//餐次金额
|
//餐次金额
|
||||||
obj.BreakfastAmount = Math.Abs(originTenantIdGroup.Where(x => x.ShiftType == shiftCodeDict["Breakfast"]).Sum(x => x.Amount));
|
obj.BreakfastAmount = Math.Abs(originTenantIdGroup.Where(x => x.ShiftType == ShiftEnumType.Breakfast).Sum(x => x.Amount));
|
||||||
obj.LunchAmount = Math.Abs(originTenantIdGroup.Where(x => x.ShiftType == shiftCodeDict["Lunch"]).Sum(x => x.Amount));
|
obj.LunchAmount = Math.Abs(originTenantIdGroup.Where(x => x.ShiftType == ShiftEnumType.Lunch).Sum(x => x.Amount));
|
||||||
obj.DinnerAmount = Math.Abs(originTenantIdGroup.Where(x => x.ShiftType == shiftCodeDict["Dinner"]).Sum(x => x.Amount));
|
obj.DinnerAmount = Math.Abs(originTenantIdGroup.Where(x => x.ShiftType == ShiftEnumType.Dinner).Sum(x => x.Amount));
|
||||||
obj.LateNightAmount = Math.Abs(originTenantIdGroup.Where(x => x.ShiftType == shiftCodeDict["LateNight"]).Sum(x => x.Amount));
|
obj.LateNightAmount = Math.Abs(originTenantIdGroup.Where(x => x.ShiftType == ShiftEnumType.Nightsnack).Sum(x => x.Amount));
|
||||||
|
|
||||||
|
|
||||||
// 每个餐次单价
|
// 每个餐次单价
|
||||||
@@ -405,9 +394,6 @@ public class BalanceService : IBalanceService
|
|||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
public async Task<Pagination<BalanceRecordAnalysisRespones>> BalanceRecordAnalysisAsync(BalanceRecordAnalysisRequest request)
|
public async Task<Pagination<BalanceRecordAnalysisRespones>> BalanceRecordAnalysisAsync(BalanceRecordAnalysisRequest request)
|
||||||
{
|
{
|
||||||
var shiftCodeDict = await GetShiftCode();
|
|
||||||
|
|
||||||
|
|
||||||
var pageinfo = await _dbContext.Queryable<BalanceRecordEntity>()
|
var pageinfo = await _dbContext.Queryable<BalanceRecordEntity>()
|
||||||
.WhereIF(request.StartDatetime.HasValue, record => record.CostDateTime >= request.StartDatetime)
|
.WhereIF(request.StartDatetime.HasValue, record => record.CostDateTime >= request.StartDatetime)
|
||||||
.WhereIF(request.EndDatetime.HasValue, record => record.CostDateTime <= request.EndDatetime)
|
.WhereIF(request.EndDatetime.HasValue, record => record.CostDateTime <= request.EndDatetime)
|
||||||
@@ -424,10 +410,10 @@ public class BalanceService : IBalanceService
|
|||||||
};
|
};
|
||||||
|
|
||||||
//每个餐次人数
|
//每个餐次人数
|
||||||
obj.BreakfastNumberOfPeople = first.Where(x => x.ShiftType == shiftCodeDict["Breakfast"]).Select(x => x.UserNo).Distinct().Count();
|
obj.BreakfastNumberOfPeople = first.Where(x => x.ShiftType == ShiftEnumType.Breakfast).Select(x => x.UserNo).Distinct().Count();
|
||||||
obj.LunchNumberOfPeople = first.Where(x => x.ShiftType == shiftCodeDict["Lunch"]).Select(x => x.UserNo).Distinct().Count();
|
obj.LunchNumberOfPeople = first.Where(x => x.ShiftType == ShiftEnumType.Lunch).Select(x => x.UserNo).Distinct().Count();
|
||||||
obj.DinnerNumberOfPeople = first.Where(x => x.ShiftType == shiftCodeDict["Dinner"]).Select(x => x.UserNo).Distinct().Count();
|
obj.DinnerNumberOfPeople = first.Where(x => x.ShiftType == ShiftEnumType.Lunch).Select(x => x.UserNo).Distinct().Count();
|
||||||
obj.LateNightNumberOfPeople = first.Where(x => x.ShiftType == shiftCodeDict["LateNight"]).Select(x => x.UserNo).Distinct().Count();
|
obj.LateNightNumberOfPeople = first.Where(x => x.ShiftType == ShiftEnumType.Nightsnack).Select(x => x.UserNo).Distinct().Count();
|
||||||
|
|
||||||
obj.TotalNumberOfPeople = first.Where(x => x.CostDate.ToString("yyyy-MM-dd") == first.Key).Select(x => x.UserNo).Distinct().Count();
|
obj.TotalNumberOfPeople = first.Where(x => x.CostDate.ToString("yyyy-MM-dd") == first.Key).Select(x => x.UserNo).Distinct().Count();
|
||||||
|
|
||||||
@@ -483,7 +469,7 @@ public class BalanceService : IBalanceService
|
|||||||
.LeftJoin<BasicTypeEntity>((record, ga, department, bplace, bshift, type) => record.BusinessShiftCode.ToString() == type.Code)
|
.LeftJoin<BasicTypeEntity>((record, ga, department, bplace, bshift, type) => record.BusinessShiftCode.ToString() == type.Code)
|
||||||
.WhereIF(request.SearchDate.HasValue, record => record.CostDate >= start)
|
.WhereIF(request.SearchDate.HasValue, record => record.CostDate >= start)
|
||||||
.WhereIF(request.SearchDate.HasValue, record => record.CostDate <= end)
|
.WhereIF(request.SearchDate.HasValue, record => record.CostDate <= end)
|
||||||
.Where(record => record.TenantId == device.TenantId && (record.DeviceInfo == device.Code.ToString() || record.DeviceInfo == device.UniqueNo))
|
.Where(record => record.TenantId == device.TenantId && (record.DeviceUniqueNo == device.Code.ToString() || record.DeviceUniqueNo == device.UniqueNo))
|
||||||
.Where(record => record.Type == BalanceRecordTypeEnumType.Out && record.Status == BalanceRecordStatusEnumType.Valid)
|
.Where(record => record.Type == BalanceRecordTypeEnumType.Out && record.Status == BalanceRecordStatusEnumType.Valid)
|
||||||
.OrderBy(record => record.CreateTime, OrderByType.Desc)
|
.OrderBy(record => record.CreateTime, OrderByType.Desc)
|
||||||
.Select((record, ga, department, bplace, bshift, type) => new BalanceRecordResponse
|
.Select((record, ga, department, bplace, bshift, type) => new BalanceRecordResponse
|
||||||
@@ -495,7 +481,7 @@ public class BalanceService : IBalanceService
|
|||||||
CostDate = record.CostDate,
|
CostDate = record.CostDate,
|
||||||
CostId = record.CostId,
|
CostId = record.CostId,
|
||||||
DepartmentNo = record.DepartmentNo,
|
DepartmentNo = record.DepartmentNo,
|
||||||
DeviceInfo = record.DeviceInfo,
|
DeviceInfo = record.DeviceUniqueNo,
|
||||||
IP = record.IP,
|
IP = record.IP,
|
||||||
UserNo = record.UserNo,
|
UserNo = record.UserNo,
|
||||||
UserCode = record.UserCode,
|
UserCode = record.UserCode,
|
||||||
@@ -517,7 +503,7 @@ public class BalanceService : IBalanceService
|
|||||||
var sum = await _dbContext.Queryable<BalanceRecordEntity>()
|
var sum = await _dbContext.Queryable<BalanceRecordEntity>()
|
||||||
.WhereIF(request.SearchDate.HasValue, record => record.CostDate >= start)
|
.WhereIF(request.SearchDate.HasValue, record => record.CostDate >= start)
|
||||||
.WhereIF(request.SearchDate.HasValue, record => record.CostDate <= end)
|
.WhereIF(request.SearchDate.HasValue, record => record.CostDate <= end)
|
||||||
.Where(record => record.TenantId == device.TenantId || (record.DeviceInfo == device.Code.ToString() || record.DeviceInfo == device.UniqueNo))
|
.Where(record => record.TenantId == device.TenantId || record.DeviceUniqueNo == device.Code.ToString() || record.DeviceUniqueNo == device.UniqueNo)
|
||||||
.Where(record => record.Type == BalanceRecordTypeEnumType.Out && record.Status == BalanceRecordStatusEnumType.Valid)
|
.Where(record => record.Type == BalanceRecordTypeEnumType.Out && record.Status == BalanceRecordStatusEnumType.Valid)
|
||||||
.SumAsync(record => SqlFunc.Abs(SqlFunc.IsNull(record.Amount, 0)));
|
.SumAsync(record => SqlFunc.Abs(SqlFunc.IsNull(record.Amount, 0)));
|
||||||
|
|
||||||
@@ -610,7 +596,7 @@ public class BalanceService : IBalanceService
|
|||||||
//可消费人数
|
//可消费人数
|
||||||
var consumerable = bs.Select(x => x.UserCode).Distinct().Count();
|
var consumerable = bs.Select(x => x.UserCode).Distinct().Count();
|
||||||
|
|
||||||
var dailyNumber = SameDay(bs,"");
|
var dailyNumber = SameDay(bs, "");
|
||||||
|
|
||||||
|
|
||||||
//消费走势
|
//消费走势
|
||||||
@@ -636,14 +622,14 @@ public class BalanceService : IBalanceService
|
|||||||
/// <param name="bs"></param>
|
/// <param name="bs"></param>
|
||||||
/// <param name="userCode"></param>
|
/// <param name="userCode"></param>
|
||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
private int SameDay(List<BalanceRecordEntity> bs,string userCode)
|
private int SameDay(List<BalanceRecordEntity> bs, string userCode)
|
||||||
{
|
{
|
||||||
var time = DateTime.Now.ToString("yyyy-MM-dd");
|
var time = DateTime.Now.ToString("yyyy-MM-dd");
|
||||||
var b = userCode.IsEmpty();
|
var b = userCode.IsEmpty();
|
||||||
//当日消费数据
|
//当日消费数据
|
||||||
var monthbs = bs
|
var monthbs = bs
|
||||||
.Where(x => x.CostDateTime.ToString("yyyy-MM-dd") == time)
|
.Where(x => x.CostDateTime.ToString("yyyy-MM-dd") == time)
|
||||||
.WhereIF(!userCode.IsEmpty(),x => x.UserCode == userCode);
|
.WhereIF(!userCode.IsEmpty(), x => x.UserCode == userCode);
|
||||||
//当日消费额
|
//当日消费额
|
||||||
var monthlySpending = monthbs.Sum(x => x.Amount);
|
var monthlySpending = monthbs.Sum(x => x.Amount);
|
||||||
//当日消费人数
|
//当日消费人数
|
||||||
@@ -694,9 +680,9 @@ public class BalanceService : IBalanceService
|
|||||||
var lst = new List<AverageDailyResponse>();
|
var lst = new List<AverageDailyResponse>();
|
||||||
foreach (var code in codes)
|
foreach (var code in codes)
|
||||||
{
|
{
|
||||||
var br = brs.Where(x => x.UserCode == code).FirstOrDefault();
|
var br = brs.Where(x => x.UserCode == code).FirstOrDefault();
|
||||||
var res = br.Adapt<AverageDailyResponse>();
|
var res = br.Adapt<AverageDailyResponse>();
|
||||||
var dailyNumber = SameDay(brs,code);
|
var dailyNumber = SameDay(brs, code);
|
||||||
res.AverageAmount = dailyNumber;
|
res.AverageAmount = dailyNumber;
|
||||||
lst.Add(res);
|
lst.Add(res);
|
||||||
}
|
}
|
||||||
@@ -773,7 +759,7 @@ public class BalanceService : IBalanceService
|
|||||||
.Where(x => deviceUniqueNos.Contains(x.DeviceUniqueNo))
|
.Where(x => deviceUniqueNos.Contains(x.DeviceUniqueNo))
|
||||||
.Select((x, d) => new
|
.Select((x, d) => new
|
||||||
{
|
{
|
||||||
UniqueNo = d.UniqueNo,
|
d.UniqueNo,
|
||||||
d.HeartbeatInterval,
|
d.HeartbeatInterval,
|
||||||
x.LastHeartbeatTime
|
x.LastHeartbeatTime
|
||||||
})
|
})
|
||||||
@@ -792,7 +778,7 @@ public class BalanceService : IBalanceService
|
|||||||
})
|
})
|
||||||
.Select(x => new
|
.Select(x => new
|
||||||
{
|
{
|
||||||
UniqueNo = x.UniqueNo,
|
x.UniqueNo,
|
||||||
})
|
})
|
||||||
.ToList();
|
.ToList();
|
||||||
var onlineUniqueNos = new List<string>();
|
var onlineUniqueNos = new List<string>();
|
||||||
@@ -940,41 +926,4 @@ public class BalanceService : IBalanceService
|
|||||||
|
|
||||||
throw new UserFriendlyException("操作失败,请重试");
|
throw new UserFriendlyException("操作失败,请重试");
|
||||||
}
|
}
|
||||||
|
|
||||||
public async Task<Dictionary<string, string>> GetShiftCode()
|
|
||||||
{
|
|
||||||
_dbContext.Client.QueryFilter.ClearAndBackup<ITenantId>();
|
|
||||||
try
|
|
||||||
{
|
|
||||||
var shiftCodeDict = new Dictionary<string, string>();
|
|
||||||
|
|
||||||
var typs = await _dbContext.Queryable<BasicTypeEntity>()
|
|
||||||
.Where(x => x.Type == "mealshift")
|
|
||||||
.ToListAsync();
|
|
||||||
|
|
||||||
var codeBreakfast = typs.Where(x => x.Display == "早餐").Select(x => x.Code).First();
|
|
||||||
var codeLunch = typs.Where(x => x.Display == "午餐").Select(x => x.Code).First();
|
|
||||||
var codeDinner = typs.Where(x => x.Display == "晚餐").Select(x => x.Code).First();
|
|
||||||
var codeNightsnack = typs.Where(x => x.Display == "宵夜").Select(x => x.Code).First();
|
|
||||||
var codeMidnightsnack = typs.Where(x => x.Display == "凌晨餐").Select(x => x.Code).First();
|
|
||||||
|
|
||||||
shiftCodeDict.Add("Breakfast", codeBreakfast);
|
|
||||||
shiftCodeDict.Add("Lunch", codeLunch);
|
|
||||||
shiftCodeDict.Add("Dinner", codeDinner);
|
|
||||||
shiftCodeDict.Add("LateNight", codeNightsnack);
|
|
||||||
shiftCodeDict.Add("Midnightsnack", codeMidnightsnack);
|
|
||||||
|
|
||||||
return shiftCodeDict;
|
|
||||||
}
|
|
||||||
catch (Exception ex)
|
|
||||||
{
|
|
||||||
_logger.LogError(ex, $"生成{DeviceTaskEnumType.UploadRecord.GetDescription()}任务失败:" + ex.Message);
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
finally
|
|
||||||
{
|
|
||||||
_dbContext.Client.QueryFilter.Restore();
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user