Merge branch 'development' of https://git.dlhis.com/liguoyang/jinko.yikatong into development
This commit is contained in:
@@ -16,6 +16,6 @@ public interface IDisheMenuApi
|
||||
/// <param name="dishesCode"></param>
|
||||
/// <returns></returns>
|
||||
[Auth]
|
||||
[Get("/api/dishesMenus/detail")]
|
||||
[Get("/api/dishesMenus/checkdetail")]
|
||||
Task<DefaultApiResult<DishesMenuDetailDto>> GetBookingDishesDetailAsync(DateTime date, Guid businessPlaceCode, int shiftType, string dishesCode);
|
||||
}
|
||||
@@ -9,7 +9,7 @@ using Microsoft.AspNetCore.Mvc;
|
||||
|
||||
namespace Dlhis.Basic.Device.Controllers;
|
||||
|
||||
[Authorize]
|
||||
[Authorize(Roles = "admin,tenant-admin")]
|
||||
[Route("api/[controller]")]
|
||||
[ApiController]
|
||||
public class DevicePermissionsController : ControllerBase
|
||||
|
||||
@@ -11,6 +11,7 @@ using Kurisu.Core.DataAccess.Dto;
|
||||
using Kurisu.Core.DataAccess.Entity;
|
||||
using Kurisu.Core.User.Abstractions;
|
||||
using Kurisu.SqlSugar.Services;
|
||||
using SqlSugar;
|
||||
|
||||
namespace Dlhis.Basic.Device.Services.Implements;
|
||||
|
||||
@@ -278,6 +279,7 @@ public class DevicePermissionService : IDevicePermissionService
|
||||
Status = DeviceTaskStatusEnumType.Wait,
|
||||
Type = taskType,
|
||||
UserNo = userNo,
|
||||
CancellationId = 0,
|
||||
Version = 0,
|
||||
}).ToList();
|
||||
|
||||
@@ -302,6 +304,9 @@ public class DevicePermissionService : IDevicePermissionService
|
||||
/// <returns></returns>
|
||||
public async Task<List<Guid>> GetAssignDeviceCodesAsync(string userNo)
|
||||
{
|
||||
var devices = await _dbContext.Queryable<DeviceEntity>().ToListAsync();
|
||||
var deviceRegistries = await _dbContext.Queryable<DeviceRegistryEntity>().Where(x => !SqlFunc.IsNullOrEmpty(x.BusinessPlaceCode)).ToListAsync();
|
||||
|
||||
var gainfo = await _dbContext.Queryable<GainfoEntity>().Where(x => x.No == userNo).SingleAsync();
|
||||
var gainfoGroups = await _dbContext.Queryable<GainfoGroupRelationshipEntity>().ToListAsync();
|
||||
|
||||
@@ -309,7 +314,7 @@ public class DevicePermissionService : IDevicePermissionService
|
||||
var deviceGroups = await _dbContext.Queryable<DeviceGroupEntity>().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();
|
||||
}
|
||||
|
||||
@@ -321,13 +326,22 @@ public class DevicePermissionService : IDevicePermissionService
|
||||
/// <returns></returns>
|
||||
public async Task<Pagination<AssigmentByCodeResponse>> GetAssigmentByCodeAsync(AssigmentByCodeRequest request)
|
||||
{
|
||||
var lst1 = new List<Guid>();
|
||||
//所有设备guid
|
||||
var gds = await GetAssignmentsAsync(DeviceAssignmentTypeEnumType.Device, AssignTypeEnumType.User, request.No);
|
||||
if (gds != null && gds.Count > 0)
|
||||
{
|
||||
lst1.AddRange(gds);
|
||||
}
|
||||
|
||||
//所有设备组guid
|
||||
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 regiss = await _dbContext.Queryable<DeviceRegistryEntity>().ToListAsync();
|
||||
|
||||
if (ggs != null && ggs.Count > 0)
|
||||
{
|
||||
@@ -337,11 +351,23 @@ public class DevicePermissionService : IDevicePermissionService
|
||||
.Where(x => x.GroupCode == gid)
|
||||
.Select(x => x.DeviceCode)
|
||||
.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))
|
||||
.Select(x => new AssigmentByCodeResponse
|
||||
{
|
||||
@@ -445,6 +471,9 @@ public class DevicePermissionService : IDevicePermissionService
|
||||
|
||||
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();
|
||||
if (!gainfos.Any())
|
||||
{
|
||||
@@ -460,7 +489,7 @@ public class DevicePermissionService : IDevicePermissionService
|
||||
|
||||
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);
|
||||
}
|
||||
|
||||
@@ -472,11 +501,15 @@ public class DevicePermissionService : IDevicePermissionService
|
||||
List<GainfoGroupRelationshipEntity> gainfoGroupRelationships,
|
||||
List<DevicePermissionEntity> devicePermissions,
|
||||
List<DeviceGroupEntity> deviceGroups,
|
||||
List<DeviceGroupRelationshipEntity> deviceGroupRelationships)
|
||||
List<DeviceGroupRelationshipEntity> deviceGroupRelationships,
|
||||
List<DeviceRegistryEntity> deviceRegistries,
|
||||
List<DeviceEntity> devices
|
||||
)
|
||||
{
|
||||
var userNo = gainfo.No;
|
||||
var deviceCodes = new List<UserTenantDeviceCodeDto>();
|
||||
var deviceGroupCodes = new List<UserTenantDeviceCodeDto>();
|
||||
var deviceDtos = new List<UserTenantDeviceCodeDto>();
|
||||
var deviceGroupDtos = new List<UserTenantDeviceCodeDto>();
|
||||
var businessPlaceDtos = new List<UserTenantDeviceCodeDto>();
|
||||
|
||||
//获取人员的分组,跨基地
|
||||
var gainfoGroups = gainfoGroupRelationships.Where(x => x.UserNo == userNo).Select(x => x.GroupCode).ToList();
|
||||
@@ -484,42 +517,67 @@ public class DevicePermissionService : IDevicePermissionService
|
||||
//按用户
|
||||
var du = GetAssignCodesInternal(devicePermissions, deviceGroups, DeviceAssignmentTypeEnumType.Device, AssignTypeEnumType.User, userNo);
|
||||
var gu = GetAssignCodesInternal(devicePermissions, deviceGroups, DeviceAssignmentTypeEnumType.Group, AssignTypeEnumType.User, userNo);
|
||||
deviceCodes.AddRange(du);
|
||||
deviceGroupCodes.AddRange(gu);
|
||||
var pu = GetAssignCodesInternal(devicePermissions, deviceGroups, DeviceAssignmentTypeEnumType.BusinessPlace, AssignTypeEnumType.User, userNo);
|
||||
|
||||
deviceDtos.AddRange(du);
|
||||
deviceGroupDtos.AddRange(gu);
|
||||
businessPlaceDtos.AddRange(pu);
|
||||
|
||||
//按用户组
|
||||
foreach (var groupCode in gainfoGroups)
|
||||
{
|
||||
var dg = GetAssignCodesInternal(devicePermissions, deviceGroups, DeviceAssignmentTypeEnumType.Device, AssignTypeEnumType.Group, groupCode.ToString());
|
||||
var gg = GetAssignCodesInternal(devicePermissions, deviceGroups, DeviceAssignmentTypeEnumType.Group, AssignTypeEnumType.Group, groupCode.ToString());
|
||||
deviceCodes.AddRange(dg);
|
||||
deviceGroupCodes.AddRange(gg);
|
||||
var pg = GetAssignCodesInternal(devicePermissions, deviceGroups, DeviceAssignmentTypeEnumType.BusinessPlace, AssignTypeEnumType.Group, groupCode.ToString());
|
||||
deviceDtos.AddRange(dg);
|
||||
deviceGroupDtos.AddRange(gg);
|
||||
businessPlaceDtos.AddRange(pg);
|
||||
}
|
||||
|
||||
//按部门
|
||||
var gainfoFactoryDevicePermissions = devicePermissions.Where(x => x.TenantId == gainfo.Factory).ToList();
|
||||
var dd = GetAssignCodesInternal(gainfoFactoryDevicePermissions, deviceGroups, DeviceAssignmentTypeEnumType.Device, AssignTypeEnumType.Department, gainfo.DepartmentNo);
|
||||
var gd = GetAssignCodesInternal(gainfoFactoryDevicePermissions, deviceGroups, DeviceAssignmentTypeEnumType.Group, AssignTypeEnumType.Department, gainfo.DepartmentNo);
|
||||
deviceCodes.AddRange(dd);
|
||||
deviceGroupCodes.AddRange(gd);
|
||||
var pd = GetAssignCodesInternal(gainfoFactoryDevicePermissions, deviceGroups, DeviceAssignmentTypeEnumType.BusinessPlace, AssignTypeEnumType.Department, gainfo.DepartmentNo);
|
||||
deviceDtos.AddRange(dd);
|
||||
deviceGroupDtos.AddRange(gd);
|
||||
businessPlaceDtos.AddRange(pd);
|
||||
|
||||
//按厂区
|
||||
var dt = GetAssignCodesInternal(devicePermissions, deviceGroups, DeviceAssignmentTypeEnumType.Device, AssignTypeEnumType.Tenant, gainfo.Factory);
|
||||
var gt = GetAssignCodesInternal(devicePermissions, deviceGroups, DeviceAssignmentTypeEnumType.Group, AssignTypeEnumType.Tenant, gainfo.Factory);
|
||||
deviceCodes.AddRange(dt);
|
||||
deviceGroupCodes.AddRange(gt);
|
||||
var pt = GetAssignCodesInternal(devicePermissions, deviceGroups, DeviceAssignmentTypeEnumType.BusinessPlace, AssignTypeEnumType.Tenant, gainfo.Factory);
|
||||
deviceDtos.AddRange(dt);
|
||||
deviceGroupDtos.AddRange(gt);
|
||||
businessPlaceDtos.AddRange(pt);
|
||||
|
||||
var groupCodes = deviceGroupCodes.SelectMany(x => x.Codes).Distinct().ToList();
|
||||
var deveiceCodesByGroup = deviceGroupRelationships.Where(x => groupCodes.Contains(x.GroupCode)).GroupBy(x => x.TenantId)
|
||||
var deviceGroupCodes = deviceGroupDtos.SelectMany(x => x.Codes).Distinct().ToList();
|
||||
var businessPlaceCodes = businessPlaceDtos.SelectMany(x => x.Codes).Distinct().ToList();
|
||||
|
||||
var deveiceCodesByGroup = deviceGroupRelationships.Where(x => deviceGroupCodes.Contains(x.GroupCode)).GroupBy(x => x.TenantId)
|
||||
.Select(x => new UserTenantDeviceCodeDto
|
||||
{
|
||||
Tenant = x.Key,
|
||||
Codes = x.Select(item => item.DeviceCode).Distinct().ToList()
|
||||
});
|
||||
|
||||
deviceCodes.AddRange(deveiceCodesByGroup);
|
||||
var placeGroup = deviceRegistries.Where(x => businessPlaceCodes.Contains(x.BusinessPlaceCode.Value)).GroupBy(x => x.TenantId)
|
||||
.Select(x =>
|
||||
{
|
||||
var currentDeviceUniqueNos = x.Select(item => item.DeviceUniqueNo).ToList();
|
||||
|
||||
return deviceCodes.GroupBy(x => x.Tenant).Select(x => new UserTenantDeviceCodeDto
|
||||
return new UserTenantDeviceCodeDto
|
||||
{
|
||||
Tenant = x.Key,
|
||||
Codes = devices.Where(d => currentDeviceUniqueNos.Contains(d.UniqueNo)).Select(d => d.Code).Distinct().ToList()
|
||||
};
|
||||
})
|
||||
.ToList();
|
||||
|
||||
deviceDtos.AddRange(deveiceCodesByGroup);
|
||||
deviceDtos.AddRange(placeGroup);
|
||||
|
||||
return deviceDtos.GroupBy(x => x.Tenant).Select(x => new UserTenantDeviceCodeDto
|
||||
{
|
||||
Tenant = x.Key,
|
||||
Codes = x.SelectMany(item => item.Codes).Distinct().ToList()
|
||||
|
||||
@@ -7,6 +7,7 @@ using Kurisu.AspNetCore.DataAccess.SqlSugar.Aop;
|
||||
using Kurisu.Core.DataAccess.Dto;
|
||||
using Microsoft.AspNetCore.Authorization;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
using Org.BouncyCastle.Asn1.Ocsp;
|
||||
|
||||
namespace Dlhis.Basic.Dishes.Controller;
|
||||
|
||||
@@ -38,6 +39,19 @@ public class DishesMenusController : ControllerBase
|
||||
return await _dishesMenuService.GetDishesMenuPageAsync(request);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 菜单详情
|
||||
/// </summary>
|
||||
/// <param name="businessPlaceCode"></param>
|
||||
/// <param name="customCode"></param>
|
||||
/// <param name="date"></param>
|
||||
/// <returns></returns>
|
||||
[HttpGet("detail")]
|
||||
public async Task<DishesMenuSaveRequest> GetDishesMenuDetailAsync(Guid businessPlaceCode, string customCode, DateTime date)
|
||||
{
|
||||
return await _dishesMenuService.GetDishesMenuDetailAsync(businessPlaceCode, customCode, date);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 菜单保存/更改
|
||||
/// </summary>
|
||||
@@ -51,14 +65,14 @@ public class DishesMenusController : ControllerBase
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 菜单明细
|
||||
/// 检查明细
|
||||
/// </summary>
|
||||
/// <param name="date"></param>
|
||||
/// <param name="businessPlaceCode"></param>
|
||||
/// <param name="shiftType"></param>
|
||||
/// <param name="dishesCode"></param>
|
||||
/// <returns></returns>
|
||||
[HttpGet("detail")]
|
||||
[HttpGet("checkdetail")]
|
||||
public async Task<DishesMenuDetailDto> GetBookingDishesDetailAsync(DateTime date, Guid businessPlaceCode, ShiftEnumType shiftType, string dishesCode)
|
||||
{
|
||||
return await _dishesMenuService.GetBookingDishesDetailAsync(date, businessPlaceCode, shiftType, dishesCode);
|
||||
@@ -103,7 +117,7 @@ public class DishesMenusController : ControllerBase
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
[HttpGet("setting")]
|
||||
public async Task<GetDishesMenusBookingResponse> GetDishesMenusBookingSetting([FromQuery] GetDishesMenusBookingRequest request)
|
||||
public async Task<DishesMenusBookingSettingResponse> GetDishesMenusBookingSetting([FromQuery] GetDishesMenusBookingRequest request)
|
||||
{
|
||||
return await _dishesService.GetDishesMenusBookingSetting(request);
|
||||
}
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
using Dlhis.Entity.Canteen.Enums;
|
||||
using Kurisu.Core.DataAccess.Dto;
|
||||
using Kurisu.Core.DataAccess.Dto;
|
||||
|
||||
namespace Dlhis.Basic.Dishes.Request;
|
||||
|
||||
@@ -9,14 +8,4 @@ public class DisheMenuPageRequest : PageDto
|
||||
/// 营业点code
|
||||
/// </summary>
|
||||
public Guid BusinessPlaceCode { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 餐次
|
||||
/// </summary>
|
||||
public List<ShiftEnumType> ShiftTypes { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 分类
|
||||
/// </summary>
|
||||
public Guid? CategoryCode { get; set; }
|
||||
}
|
||||
|
||||
@@ -6,6 +6,13 @@ public class DishesCategorySaveRequest
|
||||
{
|
||||
public long? Id { get; set; }
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 营业点
|
||||
/// </summary>
|
||||
[Required]
|
||||
public Guid BusinessPlaceCode { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// PCode
|
||||
/// </summary>
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
using Dlhis.Entity.Canteen.Enums;
|
||||
using Kurisu.AspNetCore.Utils.Extensions;
|
||||
|
||||
namespace Dlhis.Basic.Dishes.Response
|
||||
namespace Dlhis.Basic.Dishes.Response;
|
||||
|
||||
public class BalanceRecordSourceEnumDto
|
||||
{
|
||||
public class BalanceRecordSourceEnumDto
|
||||
{
|
||||
public BalanceRecordSourceEnumType Type { get; set; }
|
||||
public string TypeCN => Type.GetDescription();
|
||||
}
|
||||
public BalanceRecordSourceEnumType Type { get; set; }
|
||||
|
||||
public string TypeDesc => Type.GetDescription();
|
||||
}
|
||||
|
||||
@@ -1,29 +1,28 @@
|
||||
using Dlhis.Entity.Canteen.Enums;
|
||||
using Kurisu.AspNetCore.Utils.Extensions;
|
||||
|
||||
namespace Dlhis.Basic.Dishes.Response
|
||||
namespace Dlhis.Basic.Dishes.Response;
|
||||
|
||||
public class BusinessShiftMealRelationshipResponse
|
||||
{
|
||||
public class BusinessShiftMealRelationshipResponse
|
||||
{
|
||||
/// <summary>
|
||||
/// 餐别Code
|
||||
/// </summary>
|
||||
public Guid ShiftCode { get; set; }
|
||||
/// <summary>
|
||||
/// 餐别Code
|
||||
/// </summary>
|
||||
public Guid ShiftCode { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 餐别手工号
|
||||
/// </summary>
|
||||
public string ShiftCustomCode { get; set; }
|
||||
/// <summary>
|
||||
/// 餐别手工号
|
||||
/// </summary>
|
||||
public string ShiftCustomCode { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 餐次
|
||||
/// </summary>
|
||||
public ShiftEnumType ShiftType { get; set; }
|
||||
/// <summary>
|
||||
/// 餐次
|
||||
/// </summary>
|
||||
public ShiftEnumType ShiftType { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 餐次CN
|
||||
/// </summary>
|
||||
public string ShiftTypeCN => ShiftType.GetDescription();
|
||||
/// <summary>
|
||||
/// 餐次CN
|
||||
/// </summary>
|
||||
public string ShiftTypeDesc => ShiftType.GetDescription();
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,11 +1,7 @@
|
||||
using Dlhis.Entity.Canteen.Enums;
|
||||
|
||||
namespace Dlhis.Basic.Dishes.Response;
|
||||
namespace Dlhis.Basic.Dishes.Response;
|
||||
|
||||
public class DishesMenuPageResponse
|
||||
{
|
||||
public long? Id { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 菜单编码
|
||||
/// </summary>
|
||||
@@ -20,32 +16,4 @@ public class DishesMenuPageResponse
|
||||
/// 营业日期
|
||||
/// </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; }
|
||||
}
|
||||
|
||||
@@ -0,0 +1,19 @@
|
||||
namespace Dlhis.Basic.Dishes.Response;
|
||||
|
||||
public class DishesMenusBookingSettingResponse
|
||||
{
|
||||
/// <summary>
|
||||
/// 服务端时间
|
||||
/// </summary>
|
||||
public DateTime ServerTime { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 餐别-餐次信息
|
||||
/// </summary>
|
||||
public List<BusinessShiftMealRelationshipResponse> ShiftInfos { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 支付方式
|
||||
/// </summary>
|
||||
public List<BalanceRecordSourceEnumDto> PayTypes { get; set; }
|
||||
}
|
||||
@@ -5,6 +5,8 @@ namespace Dlhis.Basic.Dishes.Response;
|
||||
|
||||
public class DishesResponse
|
||||
{
|
||||
public long Id { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 分类
|
||||
/// </summary>
|
||||
|
||||
@@ -1,15 +0,0 @@
|
||||
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; }
|
||||
}
|
||||
}
|
||||
@@ -10,6 +10,8 @@ public interface IDishesMenuService : IScopeDependency
|
||||
{
|
||||
Task<Pagination<DishesMenuPageResponse>> GetDishesMenuPageAsync(DisheMenuPageRequest request);
|
||||
|
||||
Task<DishesMenuSaveRequest> GetDishesMenuDetailAsync(Guid businessPlaceCode, string customCode, DateTime date);
|
||||
|
||||
Task SaveDishesMenuAsync(DishesMenuSaveRequest request);
|
||||
|
||||
Task<DishesMenuDetailDto> GetBookingDishesDetailAsync(DateTime date, Guid businessPlaceCode, ShiftEnumType shiftType, string dishesCode);
|
||||
|
||||
@@ -12,6 +12,6 @@ public interface IDishesService : IScopeDependency
|
||||
|
||||
Task<DishesDetailResponse> GetDishesDetailByIdAsync(long id);
|
||||
|
||||
Task<GetDishesMenusBookingResponse> GetDishesMenusBookingSetting(GetDishesMenusBookingRequest request);
|
||||
Task<DishesMenusBookingSettingResponse> GetDishesMenusBookingSetting(GetDishesMenusBookingRequest request);
|
||||
|
||||
}
|
||||
|
||||
@@ -9,6 +9,7 @@ using Dlhis.Basic.Dishes.Request;
|
||||
using Dlhis.Basic.Dishes.Response;
|
||||
using Dlhis.Basic.BusinessPlace.Services;
|
||||
using Dlhis.Basic.Dishes.Dto;
|
||||
using Org.BouncyCastle.Asn1.Ocsp;
|
||||
|
||||
namespace Dlhis.Basic.Dishes.Services.Implements;
|
||||
|
||||
@@ -26,10 +27,53 @@ public class DishesMenuService : IDishesMenuService
|
||||
public async Task<Pagination<DishesMenuPageResponse>> GetDishesMenuPageAsync(DisheMenuPageRequest request)
|
||||
{
|
||||
return await _dbContext.Queryable<DishesMenuEntity>()
|
||||
.Select<DishesMenuPageResponse>()
|
||||
.Where(x => x.BusinessPlaceCode == request.BusinessPlaceCode)
|
||||
.GroupBy(x => new { x.BusinessPlaceCode, x.CustomCode, x.Date })
|
||||
.Select(x => new DishesMenuPageResponse
|
||||
{
|
||||
BusinessPlaceCode = x.BusinessPlaceCode,
|
||||
CustomCode = x.CustomCode,
|
||||
Date = x.Date,
|
||||
})
|
||||
.ToPageListAsync(request);
|
||||
}
|
||||
|
||||
public async Task<DishesMenuSaveRequest> GetDishesMenuDetailAsync(Guid businessPlaceCode, string customCode, DateTime date)
|
||||
{
|
||||
var data = await _dbContext.Queryable<DishesMenuEntity>()
|
||||
.Where(x => x.BusinessPlaceCode == businessPlaceCode)
|
||||
.ToListAsync();
|
||||
|
||||
return new DishesMenuSaveRequest
|
||||
{
|
||||
BusinessPlaceCode = businessPlaceCode,
|
||||
Items = new List<DishesMenuNameDateSaveRequest>
|
||||
{
|
||||
new()
|
||||
{
|
||||
CustomCode = customCode,
|
||||
Date = date,
|
||||
ShiftTypes = data.GroupBy(x => x.ShiftType).Select(item =>
|
||||
{
|
||||
var shiftType = item.Key;
|
||||
|
||||
return new DishesMenuShiftTypeSaveRequest
|
||||
{
|
||||
ShiftType = shiftType,
|
||||
Dishes = item.Select(x => new MenuDishesSaveRequest
|
||||
{
|
||||
DishesCode = x.DishesCode,
|
||||
Number = x.Number,
|
||||
Price = x.Price,
|
||||
}).ToList()
|
||||
};
|
||||
|
||||
}).ToList()
|
||||
}
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
public async Task SaveDishesMenuAsync(DishesMenuSaveRequest request)
|
||||
{
|
||||
//检验数据
|
||||
@@ -37,7 +81,7 @@ public class DishesMenuService : IDishesMenuService
|
||||
|
||||
//检验权限
|
||||
var res = await _businessPlacePermissionsService.GetMyAsync();
|
||||
var myBps = res.dtos.Select(x => x.Code).ToList();
|
||||
var myBps = res.dtos.Select(x => x.Code).ToList();
|
||||
|
||||
myBps.Contains(request.BusinessPlaceCode).ThrowIfFalse("非经营营业点,无法保存菜单");
|
||||
|
||||
@@ -68,7 +112,6 @@ public class DishesMenuService : IDishesMenuService
|
||||
|
||||
Type = CanteenApplicaitonTypeEnumType.Booking,
|
||||
Version = 0,
|
||||
Enable = false,
|
||||
};
|
||||
});
|
||||
});
|
||||
|
||||
@@ -8,19 +8,16 @@ using Kurisu.Core.DataAccess.Dto;
|
||||
using Kurisu.SqlSugar.Extensions;
|
||||
using Kurisu.SqlSugar.Services;
|
||||
using Mapster;
|
||||
using System;
|
||||
|
||||
namespace Dlhis.Basic.Dishes.Services.Implements;
|
||||
|
||||
public class DishesService : IDishesService
|
||||
{
|
||||
private readonly IDbContext _dbContext;
|
||||
private readonly IConfiguration _configuration;
|
||||
|
||||
public DishesService(IDbContext dbContext, IConfiguration configuration)
|
||||
public DishesService(IDbContext dbContext)
|
||||
{
|
||||
_dbContext = dbContext;
|
||||
_configuration = configuration;
|
||||
}
|
||||
|
||||
public async Task<Pagination<DishesResponse>> GetDishesPageAsync(DishesPageRequest request)
|
||||
@@ -34,6 +31,7 @@ public class DishesService : IDishesService
|
||||
.OrderBy(x => x.CreateTime, SqlSugar.OrderByType.Desc)
|
||||
.Select((x, category) => new DishesResponse
|
||||
{
|
||||
Id = x.Id,
|
||||
CurrnetUnits = x.Units.ToString(),
|
||||
CategoryName = category.Name,
|
||||
|
||||
@@ -60,7 +58,7 @@ public class DishesService : IDishesService
|
||||
}
|
||||
}
|
||||
|
||||
public async Task<GetDishesMenusBookingResponse> GetDishesMenusBookingSetting(GetDishesMenusBookingRequest request)
|
||||
public async Task<DishesMenusBookingSettingResponse> GetDishesMenusBookingSetting(GetDishesMenusBookingRequest request)
|
||||
{
|
||||
// 读取最晚订餐的时间
|
||||
var strDatetime = await _dbContext.Queryable<CanteenSettingEntity>()
|
||||
@@ -71,9 +69,9 @@ public class DishesService : IDishesService
|
||||
DateTime dateTime;
|
||||
DateTime.TryParseExact(strDatetime, "HH:mm:ss", null, System.Globalization.DateTimeStyles.None, out dateTime);
|
||||
|
||||
var res = new GetDishesMenusBookingResponse
|
||||
var res = new DishesMenusBookingSettingResponse
|
||||
{
|
||||
ServiceTime = dateTime,
|
||||
ServerTime = dateTime,
|
||||
};
|
||||
|
||||
var shift = await _dbContext.Queryable<BusinessPlaceShiftRelationshipEntity>()
|
||||
@@ -93,7 +91,7 @@ public class DishesService : IDishesService
|
||||
.Where(x => x.ShiftCode == shift.ShiftCode)
|
||||
.Select<BusinessShiftMealRelationshipResponse>()
|
||||
.ToListAsync();
|
||||
res.BusinessShiftMealRelationships = businessShiftMealRelationships;
|
||||
res.ShiftInfos = businessShiftMealRelationships;
|
||||
|
||||
if (shift.TenantId == request.Factory)
|
||||
{
|
||||
@@ -107,7 +105,7 @@ public class DishesService : IDishesService
|
||||
}
|
||||
res.PayTypes = payTypes;
|
||||
return res;
|
||||
}
|
||||
}
|
||||
|
||||
public async Task<DishesDetailResponse> GetDishesDetailByIdAsync(long id)
|
||||
{
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
using Dlhis.Basic.Organization.Request;
|
||||
using Dlhis.Basic.Organization.Response;
|
||||
using Dlhis.Basic.Organization.Services;
|
||||
using Kurisu.AspNetCore.DataAccess.SqlSugar.Aop;
|
||||
using Kurisu.Core.DataAccess.Dto;
|
||||
using Microsoft.AspNetCore.Authorization;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
@@ -45,39 +46,6 @@ public class GainfosController : ControllerBase
|
||||
return await _gainfoService.GetPageAsync(request);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 档案表修改
|
||||
/// </summary>
|
||||
/// <param name="request"></param>
|
||||
/// <returns></returns>
|
||||
[HttpPut("update")]
|
||||
public async Task UpdateAsync(GainfoSaveRequest request)
|
||||
{
|
||||
await _gainfoService.UpdateAsync(request);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 离职
|
||||
/// </summary>
|
||||
/// <param name="request"></param>
|
||||
/// <returns></returns>
|
||||
[HttpPost("dimission")]
|
||||
public async Task DimissionAsync(GainfoDimissionRequest request)
|
||||
{
|
||||
await _gainfoService.DimissionAsync(request);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 入职
|
||||
/// </summary>
|
||||
/// <param name="request"></param>
|
||||
/// <returns></returns>
|
||||
[HttpPost("onboarding")]
|
||||
public async Task OnboardingAsync(GainfoDimissionRequest request)
|
||||
{
|
||||
await _gainfoService.OnboardingAsync(request);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 当前人员信息,余额
|
||||
/// </summary>
|
||||
@@ -93,6 +61,7 @@ public class GainfosController : ControllerBase
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
[HttpPost("face")]
|
||||
[Transactional]
|
||||
public async Task UploadFaceAsync(GainfoUploadFaceRequest request)
|
||||
{
|
||||
await _gainfoService.UploadFaceAsync(request);
|
||||
|
||||
@@ -1,7 +1,5 @@
|
||||
using Dlhis.Entity.Basic.Enums;
|
||||
using Kurisu.AspNetCore.Utils.Extensions;
|
||||
using SqlSugar;
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
|
||||
namespace Dlhis.Basic.Organization.Response;
|
||||
|
||||
@@ -122,17 +120,11 @@ public class GainfoDetailResponse
|
||||
/// </summary>
|
||||
public string NationName { get; set; }
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 人脸base64
|
||||
/// </summary>
|
||||
public string Face { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 在职状态
|
||||
/// </summary>
|
||||
public string Status { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 厂区
|
||||
/// </summary>
|
||||
|
||||
@@ -13,7 +13,6 @@ using Kurisu.SqlSugar.Services;
|
||||
using Mapster;
|
||||
using Microsoft.AspNetCore.DataProtection;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
using System.IdentityModel.Tokens.Jwt;
|
||||
using System.Linq.Expressions;
|
||||
|
||||
namespace Dlhis.Basic.Organization.Services.Implements;
|
||||
@@ -28,7 +27,6 @@ public class GainfoService : IGainfoService
|
||||
private readonly IServiceProvider _serviceProvider;
|
||||
private readonly IConfiguration _configuration;
|
||||
private readonly ILogger<GainfoService> _logger;
|
||||
private readonly IDepartmentService _departmentService;
|
||||
|
||||
public GainfoService(IGainfoStore gainfoStore,
|
||||
IDbContext dbContext,
|
||||
@@ -48,7 +46,6 @@ public class GainfoService : IGainfoService
|
||||
_serviceProvider = serviceProvider;
|
||||
_configuration = configuration;
|
||||
_logger = logger;
|
||||
_departmentService = departmentService;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -427,13 +424,6 @@ public class GainfoService : IGainfoService
|
||||
OnboardingDate = ga.CreateTime,
|
||||
})
|
||||
.FirstAsync();
|
||||
info.Status = request.Status.GetDescription();
|
||||
var trees = await _departmentService.GetTreeAsync();
|
||||
var res = trees.First(x => x.No == info.Factory);
|
||||
if (res != null)
|
||||
{
|
||||
info.FactoryName = res.Name;
|
||||
}
|
||||
|
||||
if (info != null)
|
||||
{
|
||||
@@ -446,201 +436,6 @@ public class GainfoService : IGainfoService
|
||||
return info;
|
||||
}
|
||||
|
||||
public async Task<Dictionary<string, Pagination<GainfoDetailResponse>>> GetWeekNumberAsync(WeekNumberRequest request, string token)
|
||||
{
|
||||
var werks = GetClaimValueFromToken(token, "tenant");
|
||||
|
||||
//获取近7天并转化为"yyyy-MM-dd"集合
|
||||
DateTime currentDate = DateTime.Now;
|
||||
List<string> times = new List<string>();
|
||||
for (int i = 0; i < 7; i++)
|
||||
{
|
||||
DateTime date = currentDate.AddDays(-i);
|
||||
string dateString = date.ToString("yyyy-MM-dd");
|
||||
times.Add(dateString);
|
||||
}
|
||||
|
||||
var dic = new Dictionary<string, Pagination<GainfoDetailResponse>>();
|
||||
|
||||
foreach (var time in times)
|
||||
{
|
||||
var infos = await _gainfoStore.Queryable(GainfoStatusEnumType.Working)
|
||||
.LeftJoin<DepartmentEntity>((ga, de) => ga.DepartmentNo == de.No)
|
||||
.LeftJoin<BasicTypeEntity>((ga, de, type) => ga.Native == type.Code && type.Type == "native")
|
||||
.LeftJoin<PositionEntity>((ga, de, type, posi) => ga.Position == posi.Name)
|
||||
.LeftJoin<BasicTypeEntity>((ga, de, type, posi, type2) => ga.CountryNo == type2.Code && type2.Type == "country")
|
||||
.LeftJoin<BasicTypeEntity>((ga, de, type, posi, type2, type3) => ga.Nation == type3.Code && type3.Type == "nation")
|
||||
.Where(ga => ga.CreateTime.ToString("yyyy-MM-dd") == time && ga.Werks == werks)
|
||||
.Select((ga, de, type, posi, type2, type3) => new GainfoDetailResponse
|
||||
{
|
||||
No = ga.No,
|
||||
SapNo = ga.SapNo,
|
||||
Name = ga.Name,
|
||||
Code = ga.Code,
|
||||
DepartmentName = de.Name,
|
||||
IdClass = ga.IdClass,
|
||||
IdNo = ga.IdNo,
|
||||
Gender = ga.Gender,
|
||||
NativeName = type.Display,
|
||||
Address = ga.Address,
|
||||
Birthday = ga.Birthday,
|
||||
Phone = ga.Phone,
|
||||
Position = ga.Position,
|
||||
Grade = posi.Grade,
|
||||
Degree = ga.Degree,
|
||||
Werks = ga.Werks,
|
||||
CostId = ga.CostId,
|
||||
Marital = ga.Marital,
|
||||
CountryName = type2.Display,
|
||||
NationName = type3.Display,
|
||||
}).ToPageListAsync(request);
|
||||
|
||||
dic[time] = infos;
|
||||
}
|
||||
return dic;
|
||||
}
|
||||
|
||||
public async Task<Dictionary<string, Pagination<GainfoDetailResponse>>> GetDimissionWeekNumberAsync(WeekNumberRequest request, string token)
|
||||
{
|
||||
var werks = GetClaimValueFromToken(token, "tenant");
|
||||
|
||||
//获取近7天并转化为"yyyy-MM-dd"集合
|
||||
DateTime currentDate = DateTime.Now;
|
||||
List<string> times = new List<string>();
|
||||
for (int i = 0; i < 7; i++)
|
||||
{
|
||||
DateTime date = currentDate.AddDays(-i);
|
||||
string dateString = date.ToString("yyyy-MM-dd");
|
||||
times.Add(dateString);
|
||||
}
|
||||
|
||||
var dic = new Dictionary<string, Pagination<GainfoDetailResponse>>();
|
||||
foreach (var time in times)
|
||||
{
|
||||
var infos = await _gainfoStore.Queryable(GainfoStatusEnumType.Leave)
|
||||
.LeftJoin<DepartmentEntity>((ga, de) => ga.DepartmentNo == de.No)
|
||||
.LeftJoin<BasicTypeEntity>((ga, de, type) => ga.Native == type.Code && type.Type == "native")
|
||||
.LeftJoin<PositionEntity>((ga, de, type, posi) => ga.Position == posi.Name)
|
||||
.LeftJoin<BasicTypeEntity>((ga, de, type, posi, type2) => ga.CountryNo == type2.Code && type2.Type == "country")
|
||||
.LeftJoin<BasicTypeEntity>((ga, de, type, posi, type2, type3) => ga.Nation == type3.Code && type3.Type == "nation")
|
||||
.Where(ga => ga.CreateTime.ToString("yyyy-MM-dd") == time && ga.Werks == werks)
|
||||
.Select((ga, de, type, posi, type2, type3) => new GainfoDetailResponse
|
||||
{
|
||||
No = ga.No,
|
||||
SapNo = ga.SapNo,
|
||||
Name = ga.Name,
|
||||
Code = ga.Code,
|
||||
DepartmentName = de.Name,
|
||||
IdClass = ga.IdClass,
|
||||
IdNo = ga.IdNo,
|
||||
Gender = ga.Gender,
|
||||
NativeName = type.Display,
|
||||
Address = ga.Address,
|
||||
Birthday = ga.Birthday,
|
||||
Phone = ga.Phone,
|
||||
Position = ga.Position,
|
||||
Grade = posi.Grade,
|
||||
Degree = ga.Degree,
|
||||
Werks = ga.Werks,
|
||||
CostId = ga.CostId,
|
||||
Marital = ga.Marital,
|
||||
CountryName = type2.Display,
|
||||
NationName = type3.Display,
|
||||
}).ToPageListAsync(request);
|
||||
dic[time] = infos;
|
||||
}
|
||||
return dic;
|
||||
}
|
||||
|
||||
public async Task<GainfoGainfoNumbersResponse> GetGainfoNumbersAsync(string token)
|
||||
{
|
||||
var werks = GetClaimValueFromToken(token, "tenant");
|
||||
|
||||
//在职人数
|
||||
var onlineNumber = await _gainfoStore.Queryable(GainfoStatusEnumType.Working)
|
||||
.Where(ga => ga.Werks == werks)
|
||||
.CountAsync();
|
||||
|
||||
//离职人数
|
||||
var offlineNumber = await _gainfoStore.Queryable(GainfoStatusEnumType.Leave)
|
||||
.Where(ga => ga.Werks == werks)
|
||||
.CountAsync();
|
||||
|
||||
//考勤总人数
|
||||
var attendanceNumber = onlineNumber + offlineNumber;
|
||||
|
||||
var res = new GainfoGainfoNumbersResponse
|
||||
{
|
||||
OnlineNumber = onlineNumber,
|
||||
OfflineNumber = offlineNumber,
|
||||
AttendanceNumber = attendanceNumber
|
||||
};
|
||||
return res;
|
||||
}
|
||||
|
||||
//-------------------------------------------help methods ------------------------------------------------
|
||||
|
||||
/// <summary>
|
||||
/// 递归获取部门No
|
||||
/// </summary>
|
||||
/// <param name="departmentNos"></param>
|
||||
/// <returns></returns>
|
||||
private async Task<List<string>> GetRecursionDepartmentNosAsync(List<string> departmentNos)
|
||||
{
|
||||
if (departmentNos.IsEmpty())
|
||||
{
|
||||
return new List<string>();
|
||||
}
|
||||
|
||||
var departments = await _dbContext.Queryable<DepartmentEntity>().ToListAsync();
|
||||
var currentNos = departments.Where(x => departmentNos.Contains(x.No)).ToList();
|
||||
|
||||
foreach (var item in currentNos)
|
||||
{
|
||||
RecursionGetNext(item.No, departments, departmentNos);
|
||||
}
|
||||
|
||||
return departmentNos.Distinct().ToList();
|
||||
|
||||
void RecursionGetNext(string currentCode, List<DepartmentEntity> departments, List<string> result)
|
||||
{
|
||||
var next = departments.Where(x => x.PNo == currentCode).ToList();
|
||||
|
||||
foreach (var item in next)
|
||||
{
|
||||
result.Add(item.No);
|
||||
RecursionGetNext(item.No, departments, result);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 解析token
|
||||
/// </summary>
|
||||
/// <param name="token"></param>
|
||||
/// <param name="claimType"></param>
|
||||
/// <returns></returns>
|
||||
/// <exception cref="Exception"></exception>
|
||||
private string GetClaimValueFromToken(string token, string claimType)
|
||||
{
|
||||
try
|
||||
{
|
||||
var handler = new JwtSecurityTokenHandler();
|
||||
var jsonToken = handler.ReadToken(token) as JwtSecurityToken;
|
||||
|
||||
if (jsonToken == null)
|
||||
throw new Exception("Invalid JWT Token");
|
||||
|
||||
var claimValue = jsonToken.Claims.FirstOrDefault(c => c.Type == claimType)?.Value;
|
||||
|
||||
return claimValue;
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
public async Task MigrationAsync(MigrationRequest request)
|
||||
{
|
||||
//档案数据
|
||||
@@ -677,4 +472,41 @@ public class GainfoService : IGainfoService
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//-------------------------------------------help methods ------------------------------------------------
|
||||
|
||||
/// <summary>
|
||||
/// 递归获取部门No
|
||||
/// </summary>
|
||||
/// <param name="departmentNos"></param>
|
||||
/// <returns></returns>
|
||||
private async Task<List<string>> GetRecursionDepartmentNosAsync(List<string> departmentNos)
|
||||
{
|
||||
if (departmentNos.IsEmpty())
|
||||
{
|
||||
return new List<string>();
|
||||
}
|
||||
|
||||
var departments = await _dbContext.Queryable<DepartmentEntity>().ToListAsync();
|
||||
var currentNos = departments.Where(x => departmentNos.Contains(x.No)).ToList();
|
||||
|
||||
foreach (var item in currentNos)
|
||||
{
|
||||
RecursionGetNext(item.No, departments, departmentNos);
|
||||
}
|
||||
|
||||
return departmentNos.Distinct().ToList();
|
||||
|
||||
void RecursionGetNext(string currentCode, List<DepartmentEntity> departments, List<string> result)
|
||||
{
|
||||
var next = departments.Where(x => x.PNo == currentCode).ToList();
|
||||
|
||||
foreach (var item in next)
|
||||
{
|
||||
result.Add(item.No);
|
||||
RecursionGetNext(item.No, departments, result);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -7,6 +7,12 @@ namespace Dlhis.Entity.Canteen.Entities;
|
||||
[SugarTable(TableName = "DishesCategory", TableDescription = "菜品分类")]
|
||||
public class DishesCategoryEntity : SugarBaseEntity, ITenantId
|
||||
{
|
||||
/// <summary>
|
||||
/// 营业点
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnDescription = "营业点", IsNullable = false)]
|
||||
public Guid BusinessPlaceCode { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// PCode
|
||||
/// </summary>
|
||||
@@ -21,13 +27,13 @@ public class DishesCategoryEntity : SugarBaseEntity, ITenantId
|
||||
/// <summary>
|
||||
/// 分类名称
|
||||
/// </summary>
|
||||
[SugarColumn(IsNullable = false, ColumnDescription = "名称")]
|
||||
[SugarColumn(ColumnDescription = "名称", IsNullable = false)]
|
||||
public string Name { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 序号
|
||||
/// </summary>
|
||||
[SugarColumn(IsNullable = false, ColumnDescription = "序号", DefaultValue = "100")]
|
||||
[SugarColumn(ColumnDescription = "序号", IsNullable = false, DefaultValue = "100")]
|
||||
public int Sequence { get; set; } = 100;
|
||||
|
||||
|
||||
|
||||
@@ -54,25 +54,18 @@ public class DishesMenuEntity : SugarBaseEntity, ITenantId, IVersion
|
||||
/// </summary>
|
||||
public int Number { get; set; }
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 单价
|
||||
/// </summary>
|
||||
public decimal? Price { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 是否启用
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnDataType = "bit", ColumnDescription = "是否启用")]
|
||||
public bool Enable { get; set; }
|
||||
|
||||
|
||||
public string TenantId { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 并发控制
|
||||
/// </summary>
|
||||
public int Version { get; set; }
|
||||
|
||||
|
||||
public string TenantId { get; set; }
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -50,7 +50,8 @@ public class DeviceTaskEntity : SugarBaseEntity, ITenantId, IVersion
|
||||
/// <summary>
|
||||
/// 取消id
|
||||
/// </summary>
|
||||
public long CancellationId { get; set; }
|
||||
[SugarColumn(DefaultValue = "0")]
|
||||
public long CancellationId { get; set; } = 0;
|
||||
|
||||
|
||||
public string TenantId { get; set; }
|
||||
|
||||
@@ -18,5 +18,11 @@ public enum DeviceAssignmentTypeEnumType
|
||||
/// 设备组
|
||||
/// </summary>
|
||||
[Description("设备组")]
|
||||
Group = 2
|
||||
Group = 2,
|
||||
|
||||
/// <summary>
|
||||
/// 营业点
|
||||
/// </summary>
|
||||
[Description("营业点")]
|
||||
BusinessPlace = 3,
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user