init 项目代码初始化
This commit is contained in:
@@ -0,0 +1,72 @@
|
||||
using Dlhis.Basic.BusinessPlace.Request;
|
||||
using Dlhis.Basic.BusinessPlace.Response;
|
||||
using Dlhis.Basic.BusinessPlace.Services;
|
||||
using Dlhis.Basic.BusinessShift.Response;
|
||||
using Dlhis.Basic.BusinessShift.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 BusinessPlacesController : ControllerBase
|
||||
{
|
||||
private readonly IBusinessPlaceService _businessPlaceService;
|
||||
private readonly IBusinessPlaceShiftService _businessPlaceShiftService;
|
||||
|
||||
public BusinessPlacesController(IBusinessPlaceService businessPlaceService,
|
||||
IBusinessPlaceShiftService businessPlaceShiftService)
|
||||
{
|
||||
_businessPlaceService = businessPlaceService;
|
||||
_businessPlaceShiftService = businessPlaceShiftService;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 营业点分页
|
||||
/// </summary>
|
||||
/// <param name="request"></param>
|
||||
/// <returns></returns>
|
||||
[HttpGet("page")]
|
||||
public async Task<Pagination<BusinessPlaceResponse>> GetPageAsync([FromQuery] BusinessPlacePageRequest request)
|
||||
{
|
||||
return await _businessPlaceService.GetPageAsync(request);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 获取启用的营业点
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
[HttpGet("list")]
|
||||
public async Task<List<BusinessPlaceResponse>> GetOpenedListAsync()
|
||||
{
|
||||
return await _businessPlaceService.GetOpenedListAsync();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 营业点保存
|
||||
/// </summary>
|
||||
/// <param name="request"></param>
|
||||
/// <returns></returns>
|
||||
[HttpPost("save")]
|
||||
public async Task SaveAsync(BusinessPlaceSaveRequest request)
|
||||
{
|
||||
await _businessPlaceService.SaveAsync(request);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 根据手工号获取餐别
|
||||
/// </summary>
|
||||
/// <param name="placeCustomCode"></param>
|
||||
/// <returns></returns>
|
||||
[HttpGet("shifts")]
|
||||
public async Task<List<BusinessPlaceShiftResponse>> GetShiftsByPlaceCustomCodeAsync(string placeCustomCode)
|
||||
{
|
||||
return await _businessPlaceShiftService.GetShiftsByPlaceCustomCodeAsync(placeCustomCode);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,26 @@
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using Dlhis.Entity.Canteen.Enums;
|
||||
using Kurisu.Core.DataAccess.Dto;
|
||||
|
||||
namespace Dlhis.Basic.BusinessPlace.Request;
|
||||
|
||||
public class BusinessPlacePageRequest : PageDto
|
||||
{
|
||||
/// <summary>
|
||||
/// 状态 CanteenBusinessPlaceStatusEnumType
|
||||
/// </summary>
|
||||
[EnumDataType(typeof(CanteenBusinessPlaceStatusEnumType))]
|
||||
public CanteenBusinessPlaceStatusEnumType? Status { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 来源 CanteenBusinessPlaceSourceEnumType
|
||||
/// </summary>
|
||||
[EnumDataType(typeof(CanteenBusinessPlaceSourceEnumType))]
|
||||
public CanteenBusinessPlaceSourceEnumType? Source { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 分类 CanteenBusinessPlaceCatalogEnumType
|
||||
/// </summary>
|
||||
[EnumDataType(typeof(CanteenBusinessPlaceCatalogEnumType))]
|
||||
public CanteenBusinessPlaceCatalogEnumType? Catalog { get; set; }
|
||||
}
|
||||
@@ -0,0 +1,47 @@
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using Dlhis.Entity.Canteen.Enums;
|
||||
|
||||
namespace Dlhis.Basic.BusinessPlace.Request;
|
||||
|
||||
/// <summary>
|
||||
/// 营业点保存参数
|
||||
/// </summary>
|
||||
public class BusinessPlaceSaveRequest
|
||||
{
|
||||
/// <summary>
|
||||
/// 为null则更新
|
||||
/// </summary>
|
||||
public long? Id { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 自定义代号
|
||||
/// </summary>
|
||||
[Required(ErrorMessage = "手工号不能为空")]
|
||||
public string CustomCode { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 营业点名称
|
||||
/// </summary>
|
||||
[Required(ErrorMessage = "营业点名称不能为空")]
|
||||
public string Name { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 状态 CanteenBusinessPlaceStatusEnumType
|
||||
/// </summary>
|
||||
[EnumDataType(typeof(CanteenBusinessPlaceStatusEnumType))]
|
||||
public CanteenBusinessPlaceStatusEnumType Status { get; set; }
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 来源 CanteenBusinessPlaceSourceEnumType
|
||||
/// </summary>
|
||||
[EnumDataType(typeof(CanteenBusinessPlaceSourceEnumType))]
|
||||
public CanteenBusinessPlaceSourceEnumType Source { get; set; }
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 分类 CanteenBusinessPlaceCatalogEnumType
|
||||
/// </summary>
|
||||
[EnumDataType(typeof(CanteenBusinessPlaceCatalogEnumType))]
|
||||
public CanteenBusinessPlaceCatalogEnumType Catalog { get; set; }
|
||||
}
|
||||
@@ -0,0 +1,43 @@
|
||||
using Dlhis.Entity.Canteen.Enums;
|
||||
using Kurisu.AspNetCore.Utils.Extensions;
|
||||
|
||||
namespace Dlhis.Basic.BusinessPlace.Response;
|
||||
|
||||
public class BusinessPlaceResponse
|
||||
{
|
||||
public long Id { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 代号
|
||||
/// </summary>
|
||||
public Guid Code { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 自定义代号
|
||||
/// </summary>
|
||||
public string CustomCode { get; set; }
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 营业点名称
|
||||
/// </summary>
|
||||
public string Name { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 状态,停用/启用
|
||||
/// </summary>
|
||||
public CanteenBusinessPlaceStatusEnumType Status { get; set; }
|
||||
public string StatusDesc => Status.GetDescription();
|
||||
|
||||
/// <summary>
|
||||
/// 来源,自营/合作/外包
|
||||
/// </summary>
|
||||
public CanteenBusinessPlaceSourceEnumType Source { get; set; }
|
||||
public string SourceDesc => Source.GetDescription();
|
||||
|
||||
/// <summary>
|
||||
/// 分类,超市/餐厅/食堂
|
||||
/// </summary>
|
||||
public CanteenBusinessPlaceCatalogEnumType Catalog { get; set; }
|
||||
public string CatalogDesc => Catalog.GetDescription();
|
||||
}
|
||||
@@ -0,0 +1,20 @@
|
||||
using Dlhis.Basic.BusinessPlace.Request;
|
||||
using Dlhis.Basic.BusinessPlace.Response;
|
||||
using Kurisu.Core.DataAccess.Dto;
|
||||
using Kurisu.SqlSugar.Attributes;
|
||||
|
||||
namespace Dlhis.Basic.BusinessPlace.Services;
|
||||
|
||||
public interface IBusinessPlaceService : IScopeDependency
|
||||
{
|
||||
Task<Pagination<BusinessPlaceResponse>> GetPageAsync(BusinessPlacePageRequest request);
|
||||
|
||||
/// <summary>
|
||||
/// 获取可用的营业点
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
Task<List<BusinessPlaceResponse>> GetOpenedListAsync();
|
||||
|
||||
|
||||
Task SaveAsync(BusinessPlaceSaveRequest request);
|
||||
}
|
||||
@@ -0,0 +1,81 @@
|
||||
using Dlhis.Basic.BusinessPlace.Request;
|
||||
using Dlhis.Basic.BusinessPlace.Response;
|
||||
using Dlhis.Entity.Canteen.Entities;
|
||||
using Dlhis.Entity.Canteen.Enums;
|
||||
using Kurisu.AspNetCore.Utils.Extensions;
|
||||
using Kurisu.Core.DataAccess.Dto;
|
||||
using Kurisu.SqlSugar.Attributes;
|
||||
using Kurisu.SqlSugar.Extensions;
|
||||
using Kurisu.SqlSugar.Services;
|
||||
using Mapster;
|
||||
|
||||
namespace Dlhis.Basic.BusinessPlace.Services.Implements;
|
||||
|
||||
public class BusinessPlaceService : IBusinessPlaceService
|
||||
{
|
||||
private readonly IDbContext _dbContext;
|
||||
|
||||
public BusinessPlaceService(IDbContext dbContext)
|
||||
{
|
||||
_dbContext = dbContext;
|
||||
}
|
||||
|
||||
[IgnoreTenant]
|
||||
public async Task<Pagination<BusinessPlaceResponse>> GetPageAsync(BusinessPlacePageRequest request)
|
||||
{
|
||||
var page = await _dbContext.Queryable<CanteenBusinessPlaceEntity>()
|
||||
.WhereIF(request.Search.IsPresent(), x => x.CustomCode.Contains(request.Search))
|
||||
.WhereIF(request.Catalog.HasValue, x => x.Catalog == request.Catalog)
|
||||
.WhereIF(request.Status.HasValue, x => x.Status == request.Status)
|
||||
.WhereIF(request.Source.HasValue, x => x.Source == request.Source)
|
||||
.Select<BusinessPlaceResponse>()
|
||||
.ToPageListAsync(request);
|
||||
|
||||
return page;
|
||||
}
|
||||
|
||||
|
||||
public async Task<List<BusinessPlaceResponse>> GetOpenedListAsync()
|
||||
{
|
||||
return await _dbContext.Queryable<CanteenBusinessPlaceEntity>()
|
||||
.Where(x => x.Status == CanteenBusinessPlaceStatusEnumType.Opened)
|
||||
.Select<BusinessPlaceResponse>()
|
||||
.ToListAsync();
|
||||
}
|
||||
|
||||
public async Task SaveAsync(BusinessPlaceSaveRequest request)
|
||||
{
|
||||
await CheckExistsCustomCodeAsync(request);
|
||||
|
||||
if (!request.Id.HasValue)
|
||||
{
|
||||
var entity = request.Adapt<CanteenBusinessPlaceEntity>();
|
||||
entity.Code = Guid.NewGuid();
|
||||
await _dbContext.InsertAsync(entity);
|
||||
}
|
||||
else
|
||||
{
|
||||
var entity = await _dbContext.Queryable<CanteenBusinessPlaceEntity>().FirstAsync(x => x.Id == request.Id);
|
||||
request.Adapt(entity);
|
||||
|
||||
await _dbContext.UpdateAsync(entity);
|
||||
}
|
||||
}
|
||||
|
||||
//*********************************************** help methods ***************************************************//
|
||||
|
||||
/// <summary>
|
||||
/// 检查重复手工号
|
||||
/// </summary>
|
||||
/// <param name="request"></param>
|
||||
/// <returns></returns>
|
||||
private async Task CheckExistsCustomCodeAsync(BusinessPlaceSaveRequest request)
|
||||
{
|
||||
var existsSameCustomCode = await _dbContext.Queryable<CanteenBusinessPlaceEntity>()
|
||||
.Where(x => x.CustomCode == request.CustomCode)
|
||||
.WhereIF(request.Id.HasValue, x => x.Id != request.Id)
|
||||
.AnyAsync();
|
||||
|
||||
existsSameCustomCode.ThrowIfTrue($"自定义手工号[{request.CustomCode}]存在重复,请检查.");
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,46 @@
|
||||
using Dlhis.Basic.BusinessShift.Request;
|
||||
using Dlhis.Basic.BusinessShift.Response;
|
||||
using Dlhis.Basic.BusinessShift.Services;
|
||||
using Kurisu.Core.DataAccess.Dto;
|
||||
using Microsoft.AspNetCore.Authorization;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
|
||||
namespace Dlhis.Basic.BusinessShift.Controllers;
|
||||
|
||||
/// <summary>
|
||||
/// 餐次
|
||||
/// </summary>
|
||||
[Authorize]
|
||||
[Route("api/[controller]")]
|
||||
[ApiController]
|
||||
public class BusinessShiftsController : ControllerBase
|
||||
{
|
||||
private readonly IBusinessPlaceShiftService _businessPlaceShiftService;
|
||||
|
||||
public BusinessShiftsController(IBusinessPlaceShiftService businessPlaceShiftService)
|
||||
{
|
||||
_businessPlaceShiftService = businessPlaceShiftService;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 餐次分页
|
||||
/// </summary>
|
||||
/// <param name="request"></param>
|
||||
/// <returns></returns>
|
||||
[HttpGet("page")]
|
||||
public async Task<Pagination<BusinessPlaceShiftResponse>> GetPageAsync([FromQuery] BusinessPlaceShiftPageRequest request)
|
||||
{
|
||||
return await _businessPlaceShiftService.GetPageAsync(request);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 餐次保存
|
||||
/// </summary>
|
||||
/// <param name="request"></param>
|
||||
/// <returns></returns>
|
||||
[HttpPost("save")]
|
||||
public async Task SaveAsync(BusinessPlaceShiftSaveRequest request)
|
||||
{
|
||||
await _businessPlaceShiftService.SaveAsync(request);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,7 @@
|
||||
using Kurisu.Core.DataAccess.Dto;
|
||||
|
||||
namespace Dlhis.Basic.BusinessShift.Request;
|
||||
|
||||
public class BusinessPlaceShiftPageRequest : PageDto
|
||||
{
|
||||
}
|
||||
@@ -0,0 +1,39 @@
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using Kurisu.Core.CustomClass;
|
||||
|
||||
namespace Dlhis.Basic.BusinessShift.Request;
|
||||
|
||||
public class BusinessPlaceShiftSaveRequest : IValidatableObject
|
||||
{
|
||||
public long? Id { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 营业点代号
|
||||
/// </summary>
|
||||
[Required(ErrorMessage = "营业点不能为空")]
|
||||
public Guid BusinessPlaceCode { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 自定义代号
|
||||
/// </summary>
|
||||
public string CustomCode { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 餐次名称
|
||||
/// </summary>
|
||||
[Required(ErrorMessage = "餐次名称不能为空")]
|
||||
public string Name { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 时间段
|
||||
/// </summary>
|
||||
public TimePeriod TimePeriod { get; set; }
|
||||
|
||||
public IEnumerable<ValidationResult> Validate(ValidationContext validationContext)
|
||||
{
|
||||
if (TimePeriod.Start == TimePeriod.End)
|
||||
{
|
||||
yield return new ValidationResult("时间段设置区间有误,开始时段不能等于结束时段.", new[] { nameof(TimePeriod) });
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,41 @@
|
||||
namespace Dlhis.Basic.BusinessShift.Response;
|
||||
|
||||
public class BusinessPlaceShiftResponse
|
||||
{
|
||||
public long Id { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 营业点代号
|
||||
/// </summary>
|
||||
public Guid BusinessPlaceCode { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 营业点手工号
|
||||
/// </summary>
|
||||
public string BusinessPlaceCustomCode { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 代号
|
||||
/// </summary>
|
||||
public Guid Code { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 自定义代号
|
||||
/// </summary>
|
||||
public string CustomCode { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 餐次名称
|
||||
/// </summary>
|
||||
public string Name { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 经营开始时间
|
||||
/// </summary>
|
||||
public TimeOnly Start { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 经营结束时间
|
||||
/// </summary>
|
||||
public TimeOnly End { get; set; }
|
||||
}
|
||||
@@ -0,0 +1,14 @@
|
||||
using Dlhis.Basic.BusinessShift.Request;
|
||||
using Dlhis.Basic.BusinessShift.Response;
|
||||
using Kurisu.Core.DataAccess.Dto;
|
||||
|
||||
namespace Dlhis.Basic.BusinessShift.Services;
|
||||
|
||||
public interface IBusinessPlaceShiftService : IScopeDependency
|
||||
{
|
||||
Task<Pagination<BusinessPlaceShiftResponse>> GetPageAsync(BusinessPlaceShiftPageRequest request);
|
||||
|
||||
Task SaveAsync(BusinessPlaceShiftSaveRequest request);
|
||||
|
||||
Task<List<BusinessPlaceShiftResponse>> GetShiftsByPlaceCustomCodeAsync(string placeCustomCode);
|
||||
}
|
||||
@@ -0,0 +1,136 @@
|
||||
using Dlhis.Basic.BusinessShift.Request;
|
||||
using Dlhis.Basic.BusinessShift.Response;
|
||||
using Dlhis.Entity.Canteen.Entities;
|
||||
using Kurisu.AspNetCore.Utils.Extensions;
|
||||
using Kurisu.Core.CustomClass;
|
||||
using Kurisu.Core.DataAccess.Dto;
|
||||
using Kurisu.SqlSugar.Extensions;
|
||||
using Kurisu.SqlSugar.Services;
|
||||
using Mapster;
|
||||
|
||||
namespace Dlhis.Basic.BusinessShift.Services.Implements;
|
||||
|
||||
public class BusinessPlaceShiftService : IBusinessPlaceShiftService
|
||||
{
|
||||
private readonly IDbContext _dbContext;
|
||||
|
||||
public BusinessPlaceShiftService(IDbContext dbContext)
|
||||
{
|
||||
_dbContext = dbContext;
|
||||
}
|
||||
|
||||
public async Task<Pagination<BusinessPlaceShiftResponse>> GetPageAsync(BusinessPlaceShiftPageRequest request)
|
||||
{
|
||||
var page = await _dbContext.Queryable<CanteenBusinessShiftEntity>()
|
||||
.LeftJoin<CanteenBusinessPlaceEntity>((shift, place) => shift.BusinessPlaceCode == place.Code)
|
||||
.WhereIF(request.Search.IsPresent(), (shift, place) => shift.CustomCode.Contains(request.Search) || shift.Name.Contains(request.Search))
|
||||
.Select((shift, place) => new BusinessPlaceShiftResponse
|
||||
{
|
||||
Id = shift.Id,
|
||||
BusinessPlaceCode = place.Code,
|
||||
BusinessPlaceCustomCode = place.CustomCode,
|
||||
Code = shift.Code,
|
||||
CustomCode = shift.CustomCode,
|
||||
Name = shift.Name,
|
||||
Start = shift.Start,
|
||||
End = shift.End
|
||||
})
|
||||
.ToPageListAsync(request);
|
||||
|
||||
return page;
|
||||
}
|
||||
|
||||
public async Task SaveAsync(BusinessPlaceShiftSaveRequest request)
|
||||
{
|
||||
await CheckExistsCustomCodeAsync(request);
|
||||
await DuplicateTimePeriodAsync(request);
|
||||
await CheckPlaceExistsAsync(request.BusinessPlaceCode);
|
||||
|
||||
if (!request.Id.HasValue)
|
||||
{
|
||||
var entity = request.Adapt<CanteenBusinessShiftEntity>();
|
||||
|
||||
entity.Code = Guid.NewGuid();
|
||||
entity.Start = request.TimePeriod.Start.Value;
|
||||
entity.End = request.TimePeriod.End.Value;
|
||||
|
||||
await _dbContext.InsertAsync(entity);
|
||||
}
|
||||
else
|
||||
{
|
||||
var entity = await _dbContext.Queryable<CanteenBusinessShiftEntity>().FirstAsync(x => x.Id == request.Id);
|
||||
entity.Adapt(request);
|
||||
|
||||
await _dbContext.UpdateAsync(entity);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public async Task<List<BusinessPlaceShiftResponse>> GetShiftsByPlaceCustomCodeAsync(string placeCustomCode)
|
||||
{
|
||||
return await _dbContext.Queryable<CanteenBusinessShiftEntity>()
|
||||
.LeftJoin<CanteenBusinessPlaceEntity>((shift, place) => shift.BusinessPlaceCode == place.Code)
|
||||
.Where((shift, place) => place.CustomCode == placeCustomCode)
|
||||
.OrderBy((shift, place) => shift.Start)
|
||||
.Select((shift, place) => new BusinessPlaceShiftResponse
|
||||
{
|
||||
Id = shift.Id,
|
||||
BusinessPlaceCode = place.Code,
|
||||
BusinessPlaceCustomCode = place.CustomCode,
|
||||
Code = shift.Code,
|
||||
CustomCode = shift.CustomCode,
|
||||
Name = shift.Name,
|
||||
Start = shift.Start,
|
||||
End = shift.End
|
||||
})
|
||||
.ToListAsync();
|
||||
}
|
||||
|
||||
//*********************************************** help methods ***************************************************//
|
||||
|
||||
|
||||
private async Task CheckPlaceExistsAsync(Guid code)
|
||||
{
|
||||
var existsPlace = await _dbContext.Queryable<CanteenBusinessPlaceEntity>().AnyAsync(x => x.Code == code);
|
||||
existsPlace.ThrowIfFalse("营业点不存在,请检查.");
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 时间段重合检查
|
||||
/// </summary>
|
||||
/// <param name="request"></param>
|
||||
/// <returns></returns>
|
||||
private async Task DuplicateTimePeriodAsync(BusinessPlaceShiftSaveRequest request)
|
||||
{
|
||||
var periods = await _dbContext.Queryable<CanteenBusinessShiftEntity>()
|
||||
.Where(x => x.BusinessPlaceCode == request.BusinessPlaceCode)
|
||||
.WhereIF(request.Id.HasValue, x => x.Id != request.Id)
|
||||
.Select(x => new TimePeriod
|
||||
{
|
||||
Start = x.Start,
|
||||
End = x.End,
|
||||
})
|
||||
.ToListAsync();
|
||||
|
||||
foreach (var period in periods)
|
||||
{
|
||||
period.IsDuplicate(request.TimePeriod).ThrowIfTrue($"存在时间段重合[{period.Start}-{period.End}]");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 检查重复手工号
|
||||
/// </summary>
|
||||
/// <param name="request"></param>
|
||||
/// <returns></returns>
|
||||
private async Task CheckExistsCustomCodeAsync(BusinessPlaceShiftSaveRequest request)
|
||||
{
|
||||
var existsSameCustomCode = await _dbContext.Queryable<CanteenBusinessShiftEntity>()
|
||||
.Where(x => x.CustomCode == request.CustomCode)
|
||||
.WhereIF(request.Id.HasValue, x => x.Id != request.Id)
|
||||
.AnyAsync();
|
||||
|
||||
existsSameCustomCode.ThrowIfTrue($"自定义手工号[{request.CustomCode}]存在重复,请检查.");
|
||||
}
|
||||
}
|
||||
59
Src/Dlhis.Basic/Device/Controllers/DevicesController.cs
Normal file
59
Src/Dlhis.Basic/Device/Controllers/DevicesController.cs
Normal file
@@ -0,0 +1,59 @@
|
||||
using Dlhis.Basic.Device.Request;
|
||||
using Dlhis.Basic.Device.Response;
|
||||
using Dlhis.Basic.Device.Services;
|
||||
using Kurisu.Core.DataAccess.Dto;
|
||||
using Microsoft.AspNetCore.Authorization;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
|
||||
namespace Dlhis.Basic.Device.Controllers;
|
||||
|
||||
/// <summary>
|
||||
/// 设备控制器
|
||||
/// </summary>
|
||||
[Authorize]
|
||||
[Route("api/[controller]")]
|
||||
[ApiController]
|
||||
public class DevicesController : ControllerBase
|
||||
{
|
||||
private readonly IDeviceService _deviceService;
|
||||
private readonly IDeviceTemplateService _deviceTemplateService;
|
||||
|
||||
public DevicesController(IDeviceService deviceService, IDeviceTemplateService deviceTemplateService)
|
||||
{
|
||||
_deviceService = deviceService;
|
||||
_deviceTemplateService = deviceTemplateService;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 获取设备模板
|
||||
/// </summary>
|
||||
/// <param name="request"></param>
|
||||
/// <returns></returns>
|
||||
[HttpGet("template/page")]
|
||||
public async Task<Pagination<DeviceTemplateResponse>> GetTemplatePageAsync([FromQuery] DeviceTemplatePageRequest request)
|
||||
{
|
||||
return await _deviceTemplateService.GetPageAsync(request);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 设备模板保存
|
||||
/// </summary>
|
||||
/// <param name="request"></param>
|
||||
/// <returns></returns>
|
||||
[HttpPost("template")]
|
||||
public async Task SaveTemplateAsync(DeviceTemplateSaveRequest request)
|
||||
{
|
||||
await _deviceTemplateService.SaveTemplateAsync(request);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 获取设备分页
|
||||
/// </summary>
|
||||
/// <param name="request"></param>
|
||||
/// <returns></returns>
|
||||
[HttpGet("page")]
|
||||
public async Task<Pagination<DeviceResponse>> GetPageAsync([FromQuery] DevicePageRequest request)
|
||||
{
|
||||
return await _deviceService.GetPageAsync(request);
|
||||
}
|
||||
}
|
||||
13
Src/Dlhis.Basic/Device/Request/DevicePageRequest.cs
Normal file
13
Src/Dlhis.Basic/Device/Request/DevicePageRequest.cs
Normal file
@@ -0,0 +1,13 @@
|
||||
using Kurisu.Core.DataAccess.Dto;
|
||||
|
||||
namespace Dlhis.Basic.Device.Request;
|
||||
|
||||
public class DevicePageRequest : PageDto
|
||||
{
|
||||
/// <summary>
|
||||
/// 平台
|
||||
/// </summary>
|
||||
public string Brand { get; set; }
|
||||
|
||||
public string MyProperty { get; set; }
|
||||
}
|
||||
61
Src/Dlhis.Basic/Device/Request/DeviceSaveRequest.cs
Normal file
61
Src/Dlhis.Basic/Device/Request/DeviceSaveRequest.cs
Normal file
@@ -0,0 +1,61 @@
|
||||
using Dlhis.Entity.Device.Enums;
|
||||
|
||||
namespace Dlhis.Basic.Device.Request;
|
||||
|
||||
public class DeviceSaveRequest
|
||||
{
|
||||
public long? Id { get; set; }
|
||||
|
||||
|
||||
public string Sno { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// mac地址
|
||||
/// </summary>
|
||||
public string Mac { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 模板code
|
||||
/// </summary>
|
||||
public string TemplateCode { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 品牌
|
||||
/// </summary>
|
||||
public string Brand { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 供应商信息
|
||||
/// </summary>
|
||||
public string Supplier { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 设备功能
|
||||
/// </summary>
|
||||
public List<DeviceFuncEnumType> Funcs { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 部署点
|
||||
/// </summary>
|
||||
public string DeployPlace { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 部署坐标
|
||||
/// </summary>
|
||||
public string DeployPosition { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 部署方向
|
||||
/// </summary>
|
||||
public string DeployDirection { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 连接信息
|
||||
/// </summary>
|
||||
public string ConnectionInfo { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 是否启用
|
||||
/// </summary>
|
||||
public bool Enable { get; set; }
|
||||
}
|
||||
@@ -0,0 +1,8 @@
|
||||
using Kurisu.Core.DataAccess.Dto;
|
||||
|
||||
namespace Dlhis.Basic.Device.Request;
|
||||
|
||||
public class DeviceTemplatePageRequest : PageDto
|
||||
{
|
||||
|
||||
}
|
||||
21
Src/Dlhis.Basic/Device/Request/DeviceTemplateSaveRequest.cs
Normal file
21
Src/Dlhis.Basic/Device/Request/DeviceTemplateSaveRequest.cs
Normal file
@@ -0,0 +1,21 @@
|
||||
namespace Dlhis.Basic.Device.Request;
|
||||
|
||||
public class DeviceTemplateSaveRequest
|
||||
{
|
||||
public long? Id { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 品牌
|
||||
/// </summary>
|
||||
public string Brand { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 模板名称
|
||||
/// </summary>
|
||||
public string Name { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 模板json
|
||||
/// </summary>
|
||||
public string Template { get; set; }
|
||||
}
|
||||
5
Src/Dlhis.Basic/Device/Response/DeviceResponse.cs
Normal file
5
Src/Dlhis.Basic/Device/Response/DeviceResponse.cs
Normal file
@@ -0,0 +1,5 @@
|
||||
namespace Dlhis.Basic.Device.Response;
|
||||
|
||||
public class DeviceResponse
|
||||
{
|
||||
}
|
||||
@@ -0,0 +1,6 @@
|
||||
namespace Dlhis.Basic.Device.Response;
|
||||
|
||||
public class DeviceTemplateResponse
|
||||
{
|
||||
|
||||
}
|
||||
12
Src/Dlhis.Basic/Device/Services/IDeviceService.cs
Normal file
12
Src/Dlhis.Basic/Device/Services/IDeviceService.cs
Normal file
@@ -0,0 +1,12 @@
|
||||
using Dlhis.Basic.Device.Request;
|
||||
using Dlhis.Basic.Device.Response;
|
||||
using Kurisu.Core.DataAccess.Dto;
|
||||
|
||||
namespace Dlhis.Basic.Device.Services;
|
||||
|
||||
public interface IDeviceService
|
||||
{
|
||||
Task<Pagination<DeviceResponse>> GetPageAsync(DevicePageRequest request);
|
||||
|
||||
Task SaveAsync(DeviceSaveRequest request);
|
||||
}
|
||||
11
Src/Dlhis.Basic/Device/Services/IDeviceTemplateService.cs
Normal file
11
Src/Dlhis.Basic/Device/Services/IDeviceTemplateService.cs
Normal file
@@ -0,0 +1,11 @@
|
||||
using Dlhis.Basic.Device.Request;
|
||||
using Dlhis.Basic.Device.Response;
|
||||
using Kurisu.Core.DataAccess.Dto;
|
||||
|
||||
namespace Dlhis.Basic.Device.Services;
|
||||
|
||||
public interface IDeviceTemplateService : IScopeDependency
|
||||
{
|
||||
Task SaveTemplateAsync(DeviceTemplateSaveRequest request);
|
||||
Task<Pagination<DeviceTemplateResponse>> GetPageAsync(DeviceTemplatePageRequest request);
|
||||
}
|
||||
49
Src/Dlhis.Basic/Device/Services/Implements/DeviceService.cs
Normal file
49
Src/Dlhis.Basic/Device/Services/Implements/DeviceService.cs
Normal file
@@ -0,0 +1,49 @@
|
||||
using Dlhis.Basic.Device.Request;
|
||||
using Dlhis.Basic.Device.Response;
|
||||
using Dlhis.Entity.Device.Entities;
|
||||
using Kurisu.AspNetCore.Utils.Extensions;
|
||||
using Kurisu.Core.DataAccess.Dto;
|
||||
using Kurisu.SqlSugar.Extensions;
|
||||
using Kurisu.SqlSugar.Services;
|
||||
using Mapster;
|
||||
|
||||
namespace Dlhis.Basic.Device.Services.Implements;
|
||||
|
||||
public class DeviceService : IDeviceService
|
||||
{
|
||||
private readonly IDbContext _dbContext;
|
||||
|
||||
public DeviceService(IDbContext dbContext)
|
||||
{
|
||||
_dbContext = dbContext;
|
||||
}
|
||||
|
||||
public async Task<Pagination<DeviceResponse>> GetPageAsync(DevicePageRequest request)
|
||||
{
|
||||
var page = await _dbContext.Queryable<DeviceEntity>()
|
||||
.Select<DeviceResponse>()
|
||||
.ToPageListAsync(request);
|
||||
|
||||
return page;
|
||||
}
|
||||
|
||||
|
||||
public async Task SaveAsync(DeviceSaveRequest request)
|
||||
{
|
||||
if (!request.Id.HasValue)
|
||||
{
|
||||
var entity = request.Adapt<DeviceEntity>();
|
||||
entity.Code = Guid.NewGuid();
|
||||
await _dbContext.InsertAsync(entity);
|
||||
}
|
||||
else
|
||||
{
|
||||
var device = await _dbContext.Queryable<DeviceEntity>().Where(x => x.Id == request.Id).FirstAsync();
|
||||
device.ThrowIfNull("设备不存在,无法更新");
|
||||
|
||||
request.Adapt(device);
|
||||
|
||||
await _dbContext.UpdateAsync(device);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,61 @@
|
||||
using Dlhis.Basic.Device.Request;
|
||||
using Dlhis.Basic.Device.Response;
|
||||
using Dlhis.Entity.Device.Entities;
|
||||
using Kurisu.AspNetCore.Utils.Extensions;
|
||||
using Kurisu.Core.DataAccess.Dto;
|
||||
using Kurisu.SqlSugar.Extensions;
|
||||
using Kurisu.SqlSugar.Services;
|
||||
using Mapster;
|
||||
|
||||
namespace Dlhis.Basic.Device.Services.Implements;
|
||||
|
||||
public class DeviceTemplateService : IDeviceTemplateService
|
||||
{
|
||||
private readonly IDbContext _dbContext;
|
||||
|
||||
public DeviceTemplateService(IDbContext dbContext)
|
||||
{
|
||||
_dbContext = dbContext;
|
||||
}
|
||||
|
||||
|
||||
public async Task<Pagination<DeviceTemplateResponse>> GetPageAsync(DeviceTemplatePageRequest request)
|
||||
{
|
||||
var page = await _dbContext.Queryable<DeviceTemplateEntity>()
|
||||
.Select<DeviceTemplateResponse>()
|
||||
.ToPageListAsync(request);
|
||||
|
||||
return page;
|
||||
}
|
||||
|
||||
public async Task SaveTemplateAsync(DeviceTemplateSaveRequest request)
|
||||
{
|
||||
if (!request.Id.HasValue)
|
||||
{
|
||||
var entity = request.Adapt<DeviceTemplateEntity>();
|
||||
entity.Code = Guid.NewGuid();
|
||||
await _dbContext.InsertAsync(entity);
|
||||
}
|
||||
else
|
||||
{
|
||||
var entity = await _dbContext.Queryable<DeviceTemplateEntity>().Where(x => x.Id == request.Id).FirstAsync();
|
||||
await ExistsDeviceUsingTemplateAsync(entity.Code);
|
||||
await _dbContext.UpdateAsync(entity);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
//**********************************************************************************************************/
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 模板被引用,不能修改
|
||||
/// </summary>
|
||||
/// <param name="templateCode"></param>
|
||||
/// <returns></returns>
|
||||
private async Task ExistsDeviceUsingTemplateAsync(Guid templateCode)
|
||||
{
|
||||
var existsUsing = await _dbContext.Queryable<DeviceEntity>().Where(x => x.TemplateCode == templateCode).AnyAsync();
|
||||
existsUsing.ThrowIfTrue("存在使用中的设备信息,无法修改");
|
||||
}
|
||||
}
|
||||
26
Src/Dlhis.Basic/Dlhis.Basic.csproj
Normal file
26
Src/Dlhis.Basic/Dlhis.Basic.csproj
Normal file
@@ -0,0 +1,26 @@
|
||||
<Project Sdk="Microsoft.NET.Sdk.Web">
|
||||
|
||||
<PropertyGroup>
|
||||
<TargetFramework>net6.0</TargetFramework>
|
||||
<Nullable>disable</Nullable>
|
||||
<ImplicitUsings>enable</ImplicitUsings>
|
||||
<DockerDefaultTargetOS>Linux</DockerDefaultTargetOS>
|
||||
<GenerateDocumentationFile>True</GenerateDocumentationFile>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<Compile Remove="log\**" />
|
||||
<Content Remove="log\**" />
|
||||
<EmbeddedResource Remove="log\**" />
|
||||
<None Remove="log\**" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="Kurisu.AspNetCore" Version="0.4.3" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\Dlhis.Entity\Dlhis.Entity.csproj" />
|
||||
</ItemGroup>
|
||||
|
||||
</Project>
|
||||
22
Src/Dlhis.Basic/Dockerfile
Normal file
22
Src/Dlhis.Basic/Dockerfile
Normal file
@@ -0,0 +1,22 @@
|
||||
#See https://aka.ms/customizecontainer to learn how to customize your debug container and how Visual Studio uses this Dockerfile to build your images for faster debugging.
|
||||
|
||||
FROM mcr.microsoft.com/dotnet/aspnet:6.0 AS base
|
||||
WORKDIR /app
|
||||
EXPOSE 80
|
||||
|
||||
FROM mcr.microsoft.com/dotnet/sdk:6.0 AS build
|
||||
WORKDIR /src
|
||||
COPY ["Dlhis.Basic/Dlhis.Basic.csproj", "Dlhis.Basic/"]
|
||||
COPY ["Src/Dlhis.Entity/Dlhis.Entity.csproj", "Src/Dlhis.Entity/"]
|
||||
RUN dotnet restore "Dlhis.Basic/Dlhis.Basic.csproj"
|
||||
COPY . .
|
||||
WORKDIR "/src/Dlhis.Basic"
|
||||
RUN dotnet build "Dlhis.Basic.csproj" -c Release -o /app/build
|
||||
|
||||
FROM build AS publish
|
||||
RUN dotnet publish "Dlhis.Basic.csproj" -c Release -o /app/publish /p:UseAppHost=false
|
||||
|
||||
FROM base AS final
|
||||
WORKDIR /app
|
||||
COPY --from=publish /app/publish .
|
||||
ENTRYPOINT ["dotnet", "Dlhis.Basic.dll"]
|
||||
46
Src/Dlhis.Basic/MealUser/Controllers/MealUsersController.cs
Normal file
46
Src/Dlhis.Basic/MealUser/Controllers/MealUsersController.cs
Normal file
@@ -0,0 +1,46 @@
|
||||
using Dlhis.Basic.MealUser.Request;
|
||||
using Dlhis.Basic.MealUser.Response;
|
||||
using Dlhis.Basic.MealUser.Services;
|
||||
using Kurisu.Core.DataAccess.Dto;
|
||||
using Microsoft.AspNetCore.Authorization;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
|
||||
namespace Dlhis.Basic.MealUser.Controllers;
|
||||
|
||||
/// <summary>
|
||||
/// 就餐人员
|
||||
/// </summary>
|
||||
[Authorize]
|
||||
[Route("api/[controller]")]
|
||||
[ApiController]
|
||||
public class MealUsersController : ControllerBase
|
||||
{
|
||||
private readonly IMealUserService _mealUserService;
|
||||
|
||||
public MealUsersController(IMealUserService mealUserService)
|
||||
{
|
||||
_mealUserService = mealUserService;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 就餐人员分页
|
||||
/// </summary>
|
||||
/// <param name="request"></param>
|
||||
/// <returns></returns>
|
||||
[HttpGet("page")]
|
||||
public async Task<Pagination<MealUserResponse>> GetPageAsync([FromQuery] MealUserPageRequest request)
|
||||
{
|
||||
return await _mealUserService.GetPageAsync(request);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 就餐人员保存
|
||||
/// </summary>
|
||||
/// <param name="request"></param>
|
||||
/// <returns></returns>
|
||||
[HttpPost]
|
||||
public async Task AddAsync(MealUserAddRequest request)
|
||||
{
|
||||
await _mealUserService.AddAsync(request);
|
||||
}
|
||||
}
|
||||
20
Src/Dlhis.Basic/MealUser/Request/MealUserAddRequest.cs
Normal file
20
Src/Dlhis.Basic/MealUser/Request/MealUserAddRequest.cs
Normal file
@@ -0,0 +1,20 @@
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using Dlhis.Entity.Canteen.Enums;
|
||||
|
||||
namespace Dlhis.Basic.MealUser.Request;
|
||||
|
||||
public class MealUserAddRequest
|
||||
{
|
||||
/// <summary>
|
||||
/// 档案号
|
||||
/// </summary>
|
||||
[Required(ErrorMessage = "档案号不能为空")]
|
||||
public string UserId { get; set; }
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 用户类型
|
||||
/// </summary>
|
||||
[EnumDataType(typeof(CanteenUserEnumType))]
|
||||
public CanteenUserEnumType UserType { get; set; }
|
||||
}
|
||||
7
Src/Dlhis.Basic/MealUser/Request/MealUserPageRequest.cs
Normal file
7
Src/Dlhis.Basic/MealUser/Request/MealUserPageRequest.cs
Normal file
@@ -0,0 +1,7 @@
|
||||
using Kurisu.Core.DataAccess.Dto;
|
||||
|
||||
namespace Dlhis.Basic.MealUser.Request;
|
||||
|
||||
public class MealUserPageRequest : PageDto
|
||||
{
|
||||
}
|
||||
6
Src/Dlhis.Basic/MealUser/Response/MealUserResponse.cs
Normal file
6
Src/Dlhis.Basic/MealUser/Response/MealUserResponse.cs
Normal file
@@ -0,0 +1,6 @@
|
||||
namespace Dlhis.Basic.MealUser.Response
|
||||
{
|
||||
public class MealUserResponse
|
||||
{
|
||||
}
|
||||
}
|
||||
14
Src/Dlhis.Basic/MealUser/Services/IMealUserService.cs
Normal file
14
Src/Dlhis.Basic/MealUser/Services/IMealUserService.cs
Normal file
@@ -0,0 +1,14 @@
|
||||
using Dlhis.Basic.MealUser.Request;
|
||||
using Dlhis.Basic.MealUser.Response;
|
||||
using Kurisu.Core.DataAccess.Dto;
|
||||
|
||||
namespace Dlhis.Basic.MealUser.Services;
|
||||
|
||||
public interface IMealUserService : IScopeDependency
|
||||
{
|
||||
Task<Pagination<MealUserResponse>> GetPageAsync(MealUserPageRequest request);
|
||||
|
||||
Task AddAsync(MealUserAddRequest request);
|
||||
|
||||
Task<MealUserResponse> GetMealUserAsync(string uniqueId);
|
||||
}
|
||||
@@ -0,0 +1,53 @@
|
||||
using Dlhis.Basic.MealUser.Request;
|
||||
using Dlhis.Basic.MealUser.Response;
|
||||
using Dlhis.Entity.Canteen.Entities;
|
||||
using Kurisu.Core.DataAccess.Dto;
|
||||
using Kurisu.SqlSugar.Extensions;
|
||||
using Kurisu.SqlSugar.Services;
|
||||
|
||||
namespace Dlhis.Basic.MealUser.Services.Implements;
|
||||
|
||||
public class MealUserService : IMealUserService
|
||||
{
|
||||
private readonly IDbContext _dbContext;
|
||||
|
||||
public MealUserService(IDbContext dbContext)
|
||||
{
|
||||
_dbContext = dbContext;
|
||||
}
|
||||
|
||||
public async Task<Pagination<MealUserResponse>> GetPageAsync(MealUserPageRequest request)
|
||||
{
|
||||
var page = await _dbContext.Queryable<CanteenUserEntity>()
|
||||
.Select<MealUserResponse>()
|
||||
.ToPageListAsync(request);
|
||||
|
||||
return page;
|
||||
}
|
||||
|
||||
public async Task AddAsync(MealUserAddRequest request)
|
||||
{
|
||||
//todo 获取档案信息
|
||||
|
||||
var entity = new CanteenUserEntity
|
||||
{
|
||||
UserId = request.UserId,
|
||||
UserType = request.UserType,
|
||||
UserCode = "",
|
||||
CarNo = "",
|
||||
Balance = 0,
|
||||
BalanceOfRecharge = 0,
|
||||
BalanceOfSubsidies = 0,
|
||||
Version = 0,
|
||||
};
|
||||
await _dbContext.InsertAsync(entity);
|
||||
}
|
||||
|
||||
public async Task<MealUserResponse> GetMealUserAsync(string userId)
|
||||
{
|
||||
return await _dbContext.Queryable<CanteenUserEntity>()
|
||||
.Where(x => x.UserId == userId)
|
||||
.Select<MealUserResponse>()
|
||||
.FirstAsync();
|
||||
}
|
||||
}
|
||||
17
Src/Dlhis.Basic/Program.cs
Normal file
17
Src/Dlhis.Basic/Program.cs
Normal file
@@ -0,0 +1,17 @@
|
||||
using Kurisu.AspNetCore.Startup;
|
||||
using Kurisu.Startup;
|
||||
|
||||
class Program
|
||||
{
|
||||
static void Main(string[] args)
|
||||
{
|
||||
KurisuHost.Run<Startup>(true, args);
|
||||
}
|
||||
}
|
||||
|
||||
public class Startup : DefaultStartup
|
||||
{
|
||||
public Startup(IConfiguration configuration) : base(configuration)
|
||||
{
|
||||
}
|
||||
}
|
||||
15
Src/Dlhis.Basic/Properties/launchSettings.json
Normal file
15
Src/Dlhis.Basic/Properties/launchSettings.json
Normal file
@@ -0,0 +1,15 @@
|
||||
{
|
||||
"profiles": {
|
||||
"Dlhis.Basic": {
|
||||
"commandName": "Project",
|
||||
"launchBrowser": false,
|
||||
"launchUrl": "swagger/index.html",
|
||||
"environmentVariables": {
|
||||
"ASPNETCORE_ENVIRONMENT": "Development"
|
||||
},
|
||||
"dotnetRunMessages": true,
|
||||
"applicationUrl": "http://localhost:5002"
|
||||
}
|
||||
},
|
||||
"$schema": "https://json.schemastore.org/launchsettings.json"
|
||||
}
|
||||
25
Src/Dlhis.Basic/SqlSugarPack.cs
Normal file
25
Src/Dlhis.Basic/SqlSugarPack.cs
Normal file
@@ -0,0 +1,25 @@
|
||||
using Kurisu.AspNetCore;
|
||||
using Kurisu.AspNetCore.Startup;
|
||||
using Kurisu.SqlSugar.Extensions;
|
||||
using SqlSugar;
|
||||
|
||||
namespace Dlhis.Canteen;
|
||||
|
||||
public class SqlSugarPack : BaseAppPack
|
||||
{
|
||||
public override bool IsBeforeUseRouting { get; }
|
||||
|
||||
public override void ConfigureServices(IServiceCollection services)
|
||||
{
|
||||
services.AddSqlSugar();
|
||||
}
|
||||
|
||||
public override void Configure(IApplicationBuilder app, IWebHostEnvironment env)
|
||||
{
|
||||
//using var scope = app.ApplicationServices.CreateScope();
|
||||
//var db = scope.ServiceProvider.GetService<ISqlSugarClient>();
|
||||
//var tables = App.ActiveTyps.Where(x => x.IsDefined(typeof(SugarTable), false)).ToArray();
|
||||
//db.DbMaintenance.CreateDatabase();
|
||||
//db.CodeFirst.InitTables(tables);
|
||||
}
|
||||
}
|
||||
8
Src/Dlhis.Basic/appsettings.Development.json
Normal file
8
Src/Dlhis.Basic/appsettings.Development.json
Normal file
@@ -0,0 +1,8 @@
|
||||
{
|
||||
"Logging": {
|
||||
"LogLevel": {
|
||||
"Default": "Information",
|
||||
"Microsoft.AspNetCore": "Warning"
|
||||
}
|
||||
}
|
||||
}
|
||||
74
Src/Dlhis.Basic/appsettings.json
Normal file
74
Src/Dlhis.Basic/appsettings.json
Normal file
@@ -0,0 +1,74 @@
|
||||
{
|
||||
"Logging": {
|
||||
"LogLevel": {
|
||||
"Default": "Information",
|
||||
"Microsoft.AspNetCore": "Warning"
|
||||
}
|
||||
},
|
||||
"AllowedHosts": "*",
|
||||
"InternalRequest": {
|
||||
"CommonRequestUrl": "http://common"
|
||||
},
|
||||
"SqlSugarOptions": {
|
||||
"DefaultConnectionString": "server=192.168.199.124;port=3306;userid=root;password=dlhis123;database=yikatong;charset=utf8mb4;",
|
||||
"SlaveConnectionString": [],
|
||||
"Timeout": 30,
|
||||
"SlowSqlTime": 1,
|
||||
"EnableSqlLog": true
|
||||
},
|
||||
"SwaggerOptions": {
|
||||
"Enable": true,
|
||||
"Authority": "https://yikatong.isawesome.cn/oauth2",
|
||||
"ClientId": "4fb184324eac4180",
|
||||
"ClientSecret": "8ac8f235152f1524",
|
||||
"Scopes": {
|
||||
"openid": "openid",
|
||||
"profile": "profile",
|
||||
"yikatong": "yikatong"
|
||||
}
|
||||
},
|
||||
"IdentityServerOptions": {
|
||||
"Authority": "https://yikatong.isawesome.cn/oauth2",
|
||||
"RequireHttpsMetadata": true,
|
||||
"Issuer": "identity.isawesome.cn",
|
||||
"Audience": "",
|
||||
"Pat": {
|
||||
"Enable": false,
|
||||
"Scheme": "token",
|
||||
"ClientId": "reference",
|
||||
"ClientSecret": "123456"
|
||||
}
|
||||
},
|
||||
"Serilog": {
|
||||
"MinimumLevel": {
|
||||
"Default": "Information",
|
||||
"Override": {
|
||||
"System": "Warning",
|
||||
"Microsoft": "Warning",
|
||||
"Microsoft.Hosting.Lifetime": "Information"
|
||||
}
|
||||
},
|
||||
"WriteTo": [
|
||||
{
|
||||
"Name": "Async",
|
||||
"Args": {
|
||||
"configure": [
|
||||
{
|
||||
"Name": "Console",
|
||||
"Args": {
|
||||
"outputTemplate": "[{Timestamp:HH:mm:ss} {Level:u3}] [{SourceContext}] {Message:lj}{NewLine}{Exception}"
|
||||
}
|
||||
},
|
||||
{
|
||||
"Name": "File",
|
||||
"Args": {
|
||||
"path": "log/log.txt",
|
||||
"rollingInterval": "Hour"
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
45
Src/Dlhis.Canteen/Dlhis.Canteen.csproj
Normal file
45
Src/Dlhis.Canteen/Dlhis.Canteen.csproj
Normal file
@@ -0,0 +1,45 @@
|
||||
<Project Sdk="Microsoft.NET.Sdk.Web">
|
||||
|
||||
<PropertyGroup>
|
||||
<TargetFramework>net6.0</TargetFramework>
|
||||
<Nullable>disable</Nullable>
|
||||
<ImplicitUsings>enable</ImplicitUsings>
|
||||
<GenerateDocumentationFile>True</GenerateDocumentationFile>
|
||||
<DockerDefaultTargetOS>Linux</DockerDefaultTargetOS>
|
||||
<DockerfileContext>..\..</DockerfileContext>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<Compile Remove="log\**" />
|
||||
<Content Remove="log\**" />
|
||||
<EmbeddedResource Remove="log\**" />
|
||||
<None Remove="log\**" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\Dlhis.Common.Api\Dlhis.Common.Api.csproj" />
|
||||
<ProjectReference Include="..\Dlhis.Entity\Dlhis.Entity.csproj" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<Content Update="appsettings.Development.json">
|
||||
<DependentUpon>appsettings.json</DependentUpon>
|
||||
</Content>
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<Folder Include="BalanceRecord\Controllers\" />
|
||||
<Folder Include="BalanceRecord\Request\" />
|
||||
<Folder Include="BalanceRecord\Response\" />
|
||||
<Folder Include="BalanceRecord\Services\Implements\" />
|
||||
<Folder Include="OaEMealVoucher\Controllers\" />
|
||||
<Folder Include="OaEMealVoucher\Request\" />
|
||||
<Folder Include="OaEMealVoucher\Response\" />
|
||||
<Folder Include="OaEMealVoucher\Services\Implements\" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="Kurisu.AspNetCore" Version="0.4.3" />
|
||||
</ItemGroup>
|
||||
|
||||
</Project>
|
||||
23
Src/Dlhis.Canteen/Dockerfile
Normal file
23
Src/Dlhis.Canteen/Dockerfile
Normal file
@@ -0,0 +1,23 @@
|
||||
#See https://aka.ms/customizecontainer to learn how to customize your debug container and how Visual Studio uses this Dockerfile to build your images for faster debugging.
|
||||
|
||||
FROM mcr.microsoft.com/dotnet/aspnet:6.0 AS base
|
||||
WORKDIR /app
|
||||
EXPOSE 80
|
||||
|
||||
FROM mcr.microsoft.com/dotnet/sdk:6.0 AS build
|
||||
WORKDIR /src
|
||||
COPY ["Src/Dlhis.Canteen/Dlhis.Canteen.csproj", "Src/Dlhis.Canteen/"]
|
||||
COPY ["Src/Dlhis.Common.Api/Dlhis.Common.Api.csproj", "Src/Dlhis.Common.Api/"]
|
||||
COPY ["Src/Dlhis.Entity/Dlhis.Entity.csproj", "Src/Dlhis.Entity/"]
|
||||
RUN dotnet restore "Src/Dlhis.Canteen/Dlhis.Canteen.csproj"
|
||||
COPY . .
|
||||
WORKDIR "/src/Src/Dlhis.Canteen"
|
||||
RUN dotnet build "Dlhis.Canteen.csproj" -c Release -o /app/build
|
||||
|
||||
FROM build AS publish
|
||||
RUN dotnet publish "Dlhis.Canteen.csproj" -c Release -o /app/publish /p:UseAppHost=false
|
||||
|
||||
FROM base AS final
|
||||
WORKDIR /app
|
||||
COPY --from=publish /app/publish .
|
||||
ENTRYPOINT ["dotnet", "Dlhis.Canteen.dll"]
|
||||
36
Src/Dlhis.Canteen/Order/Controllers/OrdersController.cs
Normal file
36
Src/Dlhis.Canteen/Order/Controllers/OrdersController.cs
Normal file
@@ -0,0 +1,36 @@
|
||||
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.Mvc;
|
||||
|
||||
namespace Dlhis.Canteen.Order.Controllers
|
||||
{
|
||||
/// <summary>
|
||||
/// 订单
|
||||
/// </summary>
|
||||
[Authorize]
|
||||
[Route("api/[controller]")]
|
||||
[ApiController]
|
||||
public class OrdersController : ControllerBase
|
||||
{
|
||||
private readonly IOrderService _orderService;
|
||||
|
||||
public OrdersController(IOrderService orderService)
|
||||
{
|
||||
_orderService = orderService;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 订单分页
|
||||
/// </summary>
|
||||
/// <param name="request"></param>
|
||||
/// <returns></returns>
|
||||
[HttpGet("page")]
|
||||
public async Task<Pagination<OrderResponse>> GetPageAsync([FromQuery] OrderPageRequest request)
|
||||
{
|
||||
return await _orderService.GetPageAsync(request);
|
||||
}
|
||||
}
|
||||
}
|
||||
7
Src/Dlhis.Canteen/Order/Request/OrderPageRequest.cs
Normal file
7
Src/Dlhis.Canteen/Order/Request/OrderPageRequest.cs
Normal file
@@ -0,0 +1,7 @@
|
||||
using Kurisu.Core.DataAccess.Dto;
|
||||
|
||||
namespace Dlhis.Canteen.Order.Request;
|
||||
|
||||
public class OrderPageRequest : PageDto
|
||||
{
|
||||
}
|
||||
5
Src/Dlhis.Canteen/Order/Response/OrderResponse.cs
Normal file
5
Src/Dlhis.Canteen/Order/Response/OrderResponse.cs
Normal file
@@ -0,0 +1,5 @@
|
||||
namespace Dlhis.Canteen.Order.Response;
|
||||
|
||||
public class OrderResponse
|
||||
{
|
||||
}
|
||||
11
Src/Dlhis.Canteen/Order/Services/IOrderService.cs
Normal file
11
Src/Dlhis.Canteen/Order/Services/IOrderService.cs
Normal file
@@ -0,0 +1,11 @@
|
||||
using Dlhis.Canteen.Order.Request;
|
||||
using Dlhis.Canteen.Order.Response;
|
||||
using Kurisu.Core.DataAccess.Dto;
|
||||
|
||||
namespace Dlhis.Canteen.Order.Services
|
||||
{
|
||||
public interface IOrderService
|
||||
{
|
||||
Task<Pagination<OrderResponse>> GetPageAsync(OrderPageRequest request);
|
||||
}
|
||||
}
|
||||
27
Src/Dlhis.Canteen/Order/Services/Implements/OrderService.cs
Normal file
27
Src/Dlhis.Canteen/Order/Services/Implements/OrderService.cs
Normal file
@@ -0,0 +1,27 @@
|
||||
using Dlhis.Canteen.Order.Request;
|
||||
using Dlhis.Canteen.Order.Response;
|
||||
using Dlhis.Entity.Canteen.Entities;
|
||||
using Kurisu.Core.DataAccess.Dto;
|
||||
using Kurisu.SqlSugar.Extensions;
|
||||
using Kurisu.SqlSugar.Services;
|
||||
|
||||
namespace Dlhis.Canteen.Order.Services.Implements;
|
||||
|
||||
public class OrderService : IOrderService
|
||||
{
|
||||
private readonly IDbContext _dbContext;
|
||||
|
||||
public OrderService(IDbContext dbContext)
|
||||
{
|
||||
_dbContext = dbContext;
|
||||
}
|
||||
|
||||
public async Task<Pagination<OrderResponse>> GetPageAsync(OrderPageRequest request)
|
||||
{
|
||||
var page = await _dbContext.Queryable<CanteenOrderEntity>()
|
||||
.Select<OrderResponse>()
|
||||
.ToPageListAsync(request);
|
||||
|
||||
return page;
|
||||
}
|
||||
}
|
||||
17
Src/Dlhis.Canteen/Program.cs
Normal file
17
Src/Dlhis.Canteen/Program.cs
Normal file
@@ -0,0 +1,17 @@
|
||||
using Kurisu.AspNetCore.Startup;
|
||||
using Kurisu.Startup;
|
||||
|
||||
class Program
|
||||
{
|
||||
static void Main(string[] args)
|
||||
{
|
||||
KurisuHost.Run<Startup>(true, args);
|
||||
}
|
||||
}
|
||||
|
||||
public class Startup : DefaultStartup
|
||||
{
|
||||
public Startup(IConfiguration configuration) : base(configuration)
|
||||
{
|
||||
}
|
||||
}
|
||||
21
Src/Dlhis.Canteen/Properties/launchSettings.json
Normal file
21
Src/Dlhis.Canteen/Properties/launchSettings.json
Normal file
@@ -0,0 +1,21 @@
|
||||
{
|
||||
"profiles": {
|
||||
"Dlhis.Canteen": {
|
||||
"commandName": "Project",
|
||||
"environmentVariables": {
|
||||
"ASPNETCORE_ENVIRONMENT": "Development"
|
||||
},
|
||||
"dotnetRunMessages": true,
|
||||
"applicationUrl": "http://localhost:5002"
|
||||
},
|
||||
"Docker": {
|
||||
"commandName": "Docker",
|
||||
"launchUrl": "{Scheme}://{ServiceHost}:{ServicePort}",
|
||||
"environmentVariables": {
|
||||
"ASPNETCORE_URLS": "http://+:80"
|
||||
},
|
||||
"publishAllPorts": true
|
||||
}
|
||||
},
|
||||
"$schema": "https://json.schemastore.org/launchsettings.json"
|
||||
}
|
||||
69
Src/Dlhis.Canteen/Setting/Controllers/SettingController.cs
Normal file
69
Src/Dlhis.Canteen/Setting/Controllers/SettingController.cs
Normal file
@@ -0,0 +1,69 @@
|
||||
using Dlhis.Canteen.Setting.Request;
|
||||
using Dlhis.Canteen.Setting.Response;
|
||||
using Dlhis.Canteen.Setting.Services;
|
||||
using Dlhis.Entity.Canteen.Enums;
|
||||
using Kurisu.Core.DataAccess.Dto;
|
||||
using Microsoft.AspNetCore.Authorization;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
|
||||
namespace Dlhis.Canteen.Setting.Controllers;
|
||||
|
||||
/// <summary>
|
||||
/// 就餐配置
|
||||
/// </summary>
|
||||
[Authorize]
|
||||
[Route("api/[controller]")]
|
||||
[ApiController]
|
||||
public class SettingController : ControllerBase
|
||||
{
|
||||
private readonly ICanteenSettingService _settingService;
|
||||
|
||||
public SettingController(ICanteenSettingService settingService)
|
||||
{
|
||||
_settingService = settingService;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 配置分页
|
||||
/// </summary>
|
||||
/// <param name="request"></param>
|
||||
/// <returns></returns>
|
||||
[HttpGet("page")]
|
||||
public async Task<Pagination<CanteenSettingResponse>> GetPageAsync([FromQuery] CanteenSettingPageRequest request)
|
||||
{
|
||||
return await _settingService.GetPageAsync(request);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 配置保存
|
||||
/// </summary>
|
||||
/// <param name="request"></param>
|
||||
/// <returns></returns>
|
||||
[HttpPost("save")]
|
||||
public async Task SaveSettingAsync(CanteenSettingSaveRequest request)
|
||||
{
|
||||
await _settingService.SaveSettingAsync(request);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 配置启用状态
|
||||
/// </summary>
|
||||
/// <param name="request"></param>
|
||||
/// <returns></returns>
|
||||
[HttpPut("enable")]
|
||||
public async Task SetEnableAsync(CanteenSettingSetEnableRequest request)
|
||||
{
|
||||
await _settingService.SetEnableAsync(request);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 获取用户配置
|
||||
/// </summary>
|
||||
/// <param name="userId"></param>
|
||||
/// <returns></returns>
|
||||
[HttpGet("user")]
|
||||
public async Task<Dictionary<CanteenSettingItemEnumType, string>> GetUserSettingAsync(string userId)
|
||||
{
|
||||
return await _settingService.GetUserSettingAsync(userId);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,20 @@
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using Dlhis.Entity.Canteen.Enums;
|
||||
using Kurisu.Core.DataAccess.Dto;
|
||||
|
||||
namespace Dlhis.Canteen.Setting.Request;
|
||||
|
||||
public class CanteenSettingPageRequest : PageDto
|
||||
{
|
||||
/// <summary>
|
||||
/// 配置唯一类型 CanteenSettingUnqiueEnumType
|
||||
/// </summary>
|
||||
[EnumDataType(typeof(CanteenSettingUnqiueEnumType))]
|
||||
public CanteenSettingUnqiueEnumType? UniqueType { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 配置项
|
||||
/// </summary>
|
||||
[EnumDataType(typeof(CanteenSettingItemEnumType))]
|
||||
public CanteenSettingItemEnumType? Item { get; set; }
|
||||
}
|
||||
@@ -0,0 +1,38 @@
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using Dlhis.Entity.Canteen.Enums;
|
||||
|
||||
namespace Dlhis.Canteen.Setting.Request;
|
||||
|
||||
public class CanteenSettingSaveRequest
|
||||
{
|
||||
public long? Id { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 配置生效范围
|
||||
/// </summary>
|
||||
[EnumDataType(typeof(CanteenSettingUnqiueEnumType))]
|
||||
public CanteenSettingUnqiueEnumType UniqueType { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 唯一值 eg:UniqueType = 1时,传入非空字符串
|
||||
/// </summary>
|
||||
[Required(ErrorMessage = "值不能为空")]
|
||||
public string UniqueValue { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 自定义分类分类
|
||||
/// </summary>
|
||||
[Required(ErrorMessage = "分类不能为空")]
|
||||
public string Catalog { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 参数 CanteenSettingItemEnumType
|
||||
/// </summary>
|
||||
[EnumDataType(typeof(CanteenSettingItemEnumType))]
|
||||
public CanteenSettingItemEnumType Item { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 值
|
||||
/// </summary>
|
||||
public string Value { get; set; }
|
||||
}
|
||||
@@ -0,0 +1,9 @@
|
||||
namespace Dlhis.Canteen.Setting.Request
|
||||
{
|
||||
public class CanteenSettingSetEnableRequest
|
||||
{
|
||||
public int Id { get; set; }
|
||||
|
||||
public bool Enable { get; set; }
|
||||
}
|
||||
}
|
||||
41
Src/Dlhis.Canteen/Setting/Response/CanteenSettingResponse.cs
Normal file
41
Src/Dlhis.Canteen/Setting/Response/CanteenSettingResponse.cs
Normal file
@@ -0,0 +1,41 @@
|
||||
using Dlhis.Entity.Canteen.Enums;
|
||||
using Kurisu.AspNetCore.Utils.Extensions;
|
||||
|
||||
namespace Dlhis.Canteen.Setting.Response;
|
||||
|
||||
public class CanteenSettingResponse
|
||||
{
|
||||
public CanteenSettingUnqiueEnumType UniqueType { get; set; }
|
||||
public string UniqueTypeDesc => UniqueType.GetDescription();
|
||||
|
||||
/// <summary>
|
||||
/// 唯一值
|
||||
/// </summary>
|
||||
public string UniqueValue { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 唯一值说明
|
||||
/// </summary>
|
||||
public string UniqueValueDesc { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 分类
|
||||
/// </summary>
|
||||
public string Catalog { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 参数
|
||||
/// </summary>
|
||||
public CanteenSettingItemEnumType Item { get; set; }
|
||||
public string ItemDesc => Item.GetDescription();
|
||||
|
||||
/// <summary>
|
||||
/// 值
|
||||
/// </summary>
|
||||
public string Value { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 是否启用
|
||||
/// </summary>
|
||||
public bool Enable { get; set; }
|
||||
}
|
||||
23
Src/Dlhis.Canteen/Setting/Services/ICanteenSettingService.cs
Normal file
23
Src/Dlhis.Canteen/Setting/Services/ICanteenSettingService.cs
Normal file
@@ -0,0 +1,23 @@
|
||||
using Dlhis.Canteen.Setting.Request;
|
||||
using Dlhis.Canteen.Setting.Response;
|
||||
using Dlhis.Entity.Canteen.Enums;
|
||||
using Kurisu.Core.DataAccess.Dto;
|
||||
|
||||
namespace Dlhis.Canteen.Setting.Services;
|
||||
|
||||
public interface ICanteenSettingService : IScopeDependency
|
||||
{
|
||||
Task<Pagination<CanteenSettingResponse>> GetPageAsync(CanteenSettingPageRequest request);
|
||||
|
||||
Task SaveSettingAsync(CanteenSettingSaveRequest request);
|
||||
|
||||
Task SetEnableAsync(CanteenSettingSetEnableRequest request);
|
||||
|
||||
/// <summary>
|
||||
/// 获取人员的就餐配置信息
|
||||
/// </summary>
|
||||
/// <param name="userId">就餐人员档案号</param>
|
||||
/// <returns></returns>
|
||||
Task<Dictionary<CanteenSettingItemEnumType, string>> GetUserSettingAsync(string userId);
|
||||
}
|
||||
|
||||
@@ -0,0 +1,116 @@
|
||||
using Dlhis.Canteen.Setting.Request;
|
||||
using Dlhis.Canteen.Setting.Response;
|
||||
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;
|
||||
|
||||
namespace Dlhis.Canteen.Setting.Services.Implements;
|
||||
|
||||
/// <summary>
|
||||
/// 餐饮配置
|
||||
/// </summary>
|
||||
public class CanteenSettingService : ICanteenSettingService
|
||||
{
|
||||
private readonly IDbContext _context;
|
||||
|
||||
public CanteenSettingService(IDbContext context)
|
||||
{
|
||||
_context = context;
|
||||
}
|
||||
|
||||
public async Task<Pagination<CanteenSettingResponse>> GetPageAsync(CanteenSettingPageRequest request)
|
||||
{
|
||||
var page = await _context.Queryable<CanteenSettingEntity>()
|
||||
.LeftJoin<CanteenUserEntity>((setting, user) => setting.UniqueValue == user.UserId)
|
||||
.WhereIF(request.UniqueType.HasValue, setting => setting.UniqueType == request.UniqueType)
|
||||
.WhereIF(request.Item.HasValue, setting => setting.Item == request.Item)
|
||||
.WhereIF(request.Search.IsPresent(), setting => setting.UniqueValue.Contains(request.Search))
|
||||
.Select((setting, user) => new CanteenSettingResponse
|
||||
{
|
||||
UniqueType = setting.UniqueType,
|
||||
UniqueValue = setting.UniqueValue,
|
||||
//UniqueValueDesc = user.UserName,
|
||||
Catalog = setting.Catalog,
|
||||
Enable = setting.Enable,
|
||||
Item = setting.Item,
|
||||
Value = setting.Value
|
||||
})
|
||||
.ToPageListAsync(request);
|
||||
|
||||
return page;
|
||||
}
|
||||
|
||||
public async Task SaveSettingAsync(CanteenSettingSaveRequest request)
|
||||
{
|
||||
await CheckDuplicateSettingAsync(request);
|
||||
|
||||
if (!request.Id.HasValue)
|
||||
{
|
||||
var entity = request.Adapt<CanteenSettingEntity>();
|
||||
await _context.InsertAsync(entity);
|
||||
}
|
||||
else
|
||||
{
|
||||
var entity = await _context.Queryable<CanteenSettingEntity>().FirstAsync(x => x.Id == request.Id);
|
||||
request.Adapt(entity);
|
||||
|
||||
await _context.UpdateAsync(entity);
|
||||
}
|
||||
}
|
||||
|
||||
public async Task SetEnableAsync(CanteenSettingSetEnableRequest request)
|
||||
{
|
||||
var entity = await _context.Queryable<CanteenSettingEntity>().FirstAsync(x => x.Id == request.Id);
|
||||
entity.ThrowIfNull("配置不存在,无法修改状态");
|
||||
|
||||
entity.Enable = request.Enable;
|
||||
await _context.UpdateAsync(entity);
|
||||
}
|
||||
|
||||
|
||||
public async Task<Dictionary<CanteenSettingItemEnumType, string>> GetUserSettingAsync(string userId)
|
||||
{
|
||||
var setting = await _context.Queryable<CanteenSettingEntity>()
|
||||
.Where(x => x.UniqueType == CanteenSettingUnqiueEnumType.Person && (x.UniqueValue == userId) || x.UniqueType == CanteenSettingUnqiueEnumType.Tenant)
|
||||
.ToListAsync();
|
||||
|
||||
//从基地 -> 个人,确保下面循环做到覆盖,并且以个人配置为主
|
||||
setting = setting.OrderBy(x => x.UniqueType).ToList();
|
||||
|
||||
var result = new Dictionary<CanteenSettingItemEnumType, string>();
|
||||
setting.ForEach(x =>
|
||||
{
|
||||
if (result.ContainsKey(x.Item))
|
||||
{
|
||||
result[x.Item] = x.Value;
|
||||
}
|
||||
else
|
||||
{
|
||||
result.Add(x.Item, x.Value);
|
||||
}
|
||||
});
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
//*********************************************** help methods ***************************************************//
|
||||
|
||||
private async Task CheckDuplicateSettingAsync(CanteenSettingSaveRequest request)
|
||||
{
|
||||
//Tenant只有一条数据, Person对应UniqueValue唯一 , Catalog不作为唯一判断
|
||||
|
||||
var exists = await _context.Queryable<CanteenSettingEntity>()
|
||||
.Where(x => x.UniqueType == request.UniqueType)
|
||||
.Where(x => x.Catalog == request.Catalog)
|
||||
.Where(x => x.Item == request.Item)
|
||||
.WhereIF(request.UniqueType != CanteenSettingUnqiueEnumType.Tenant, x => x.UniqueValue == request.UniqueValue)
|
||||
.WhereIF(request.Id.HasValue, x => x.Id != request.Id)
|
||||
.AnyAsync();
|
||||
|
||||
exists.ThrowIfTrue("配置项重复,请检查.");
|
||||
}
|
||||
}
|
||||
25
Src/Dlhis.Canteen/SqlSugarPack.cs
Normal file
25
Src/Dlhis.Canteen/SqlSugarPack.cs
Normal file
@@ -0,0 +1,25 @@
|
||||
using Kurisu.AspNetCore;
|
||||
using Kurisu.AspNetCore.Startup;
|
||||
using Kurisu.SqlSugar.Extensions;
|
||||
using SqlSugar;
|
||||
|
||||
namespace Dlhis.Canteen;
|
||||
|
||||
public class SqlSugarPack : BaseAppPack
|
||||
{
|
||||
public override bool IsBeforeUseRouting { get; }
|
||||
|
||||
public override void ConfigureServices(IServiceCollection services)
|
||||
{
|
||||
services.AddSqlSugar();
|
||||
}
|
||||
|
||||
public override void Configure(IApplicationBuilder app, IWebHostEnvironment env)
|
||||
{
|
||||
//using var scope = app.ApplicationServices.CreateScope();
|
||||
//var db = scope.ServiceProvider.GetService<ISqlSugarClient>();
|
||||
//var tables = App.ActiveTyps.Where(x => x.IsDefined(typeof(SugarTable), false)).ToArray();
|
||||
//db.DbMaintenance.CreateDatabase();
|
||||
//db.CodeFirst.InitTables(tables);
|
||||
}
|
||||
}
|
||||
11
Src/Dlhis.Canteen/appsettings.Development.json
Normal file
11
Src/Dlhis.Canteen/appsettings.Development.json
Normal file
@@ -0,0 +1,11 @@
|
||||
{
|
||||
"Logging": {
|
||||
"LogLevel": {
|
||||
"Default": "Information",
|
||||
"Microsoft.AspNetCore": "Warning"
|
||||
}
|
||||
},
|
||||
"InternalRequest": {
|
||||
"CommonRequestUrl": "http://localhost:5001"
|
||||
}
|
||||
}
|
||||
71
Src/Dlhis.Canteen/appsettings.json
Normal file
71
Src/Dlhis.Canteen/appsettings.json
Normal file
@@ -0,0 +1,71 @@
|
||||
{
|
||||
"Logging": {
|
||||
"LogLevel": {
|
||||
"Default": "Information",
|
||||
"Microsoft.AspNetCore": "Warning"
|
||||
}
|
||||
},
|
||||
"AllowedHosts": "*",
|
||||
"InternalRequest": {
|
||||
"CommonRequestUrl": "http://common"
|
||||
},
|
||||
"SqlSugarOptions": {
|
||||
"DefaultConnectionString": "server=192.168.199.124;port=3306;userid=root;password=dlhis123;database=yikatong;charset=utf8mb4;",
|
||||
"SlaveConnectionString": [],
|
||||
"Timeout": 30,
|
||||
"SlowSqlTime": 1
|
||||
},
|
||||
"SwaggerOptions": {
|
||||
"Enable": true,
|
||||
"Authority": "https://yikatong.isawesome.cn/oauth2",
|
||||
"ClientId": "4fb184324eac4180",
|
||||
"ClientSecret": "8ac8f235152f1524",
|
||||
"Scopes": {
|
||||
"openid": "openid"
|
||||
}
|
||||
},
|
||||
"IdentityServerOptions": {
|
||||
"Authority": "https://yikatong.isawesome.cn/oauth2",
|
||||
"RequireHttpsMetadata": true,
|
||||
"Issuer": "identity.isawesome.cn",
|
||||
"Audience": "",
|
||||
"Pat": {
|
||||
"Enable": false,
|
||||
"Scheme": "token",
|
||||
"ClientId": "reference",
|
||||
"ClientSecret": "123456"
|
||||
}
|
||||
},
|
||||
"Serilog": {
|
||||
"MinimumLevel": {
|
||||
"Default": "Information",
|
||||
"Override": {
|
||||
"System": "Warning",
|
||||
"Microsoft": "Warning",
|
||||
"Microsoft.Hosting.Lifetime": "Information"
|
||||
}
|
||||
},
|
||||
"WriteTo": [
|
||||
{
|
||||
"Name": "Async",
|
||||
"Args": {
|
||||
"configure": [
|
||||
{
|
||||
"Name": "Console",
|
||||
"Args": {
|
||||
"outputTemplate": "[{Timestamp:HH:mm:ss} {Level:u3}] [{SourceContext}] {Message:lj}{NewLine}{Exception}"
|
||||
}
|
||||
},
|
||||
{
|
||||
"Name": "File",
|
||||
"Args": {
|
||||
"path": "log/log.txt",
|
||||
"rollingInterval": "Hour"
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
14
Src/Dlhis.Common.Api/Dlhis.Common.Api.csproj
Normal file
14
Src/Dlhis.Common.Api/Dlhis.Common.Api.csproj
Normal file
@@ -0,0 +1,14 @@
|
||||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
|
||||
<PropertyGroup>
|
||||
<TargetFramework>net6.0</TargetFramework>
|
||||
<ImplicitUsings>enable</ImplicitUsings>
|
||||
<Nullable>disable</Nullable>
|
||||
<GenerateDocumentationFile>True</GenerateDocumentationFile>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="Kurisu.RemoteCall" Version="0.0.2" />
|
||||
</ItemGroup>
|
||||
|
||||
</Project>
|
||||
12
Src/Dlhis.Common.Api/IEnumSettingApi.cs
Normal file
12
Src/Dlhis.Common.Api/IEnumSettingApi.cs
Normal file
@@ -0,0 +1,12 @@
|
||||
using Kurisu.Core.Result;
|
||||
using Kurisu.RemoteCall.Attributes;
|
||||
|
||||
namespace Dlhis.Common.Api;
|
||||
|
||||
[EnableRemoteClient(Name = "common-service", BaseUrl = "${InternalRequest:CommonRequestUrl}")]
|
||||
public interface IEnumSettingApi
|
||||
{
|
||||
[Auth]
|
||||
[Get("/api/enums")]
|
||||
Task<DefaultApiResult<object>> GetEnums(string code = null);
|
||||
}
|
||||
31
Src/Dlhis.Common/Dlhis.Common.csproj
Normal file
31
Src/Dlhis.Common/Dlhis.Common.csproj
Normal file
@@ -0,0 +1,31 @@
|
||||
<Project Sdk="Microsoft.NET.Sdk.Web">
|
||||
|
||||
<PropertyGroup>
|
||||
<TargetFramework>net6.0</TargetFramework>
|
||||
<Nullable>disable</Nullable>
|
||||
<ImplicitUsings>enable</ImplicitUsings>
|
||||
<GenerateDocumentationFile>True</GenerateDocumentationFile>
|
||||
<DockerDefaultTargetOS>Linux</DockerDefaultTargetOS>
|
||||
<DockerfileContext>..\..</DockerfileContext>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<Compile Remove="log\**" />
|
||||
<Content Remove="log\**" />
|
||||
<EmbeddedResource Remove="log\**" />
|
||||
<None Remove="log\**" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\Dlhis.Entity\Dlhis.Entity.csproj" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<Folder Include="FileOperation\" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="Kurisu.AspNetCore" Version="0.4.3" />
|
||||
</ItemGroup>
|
||||
|
||||
</Project>
|
||||
22
Src/Dlhis.Common/Dockerfile
Normal file
22
Src/Dlhis.Common/Dockerfile
Normal file
@@ -0,0 +1,22 @@
|
||||
#See https://aka.ms/customizecontainer to learn how to customize your debug container and how Visual Studio uses this Dockerfile to build your images for faster debugging.
|
||||
|
||||
FROM mcr.microsoft.com/dotnet/aspnet:6.0 AS base
|
||||
WORKDIR /app
|
||||
EXPOSE 80
|
||||
|
||||
FROM mcr.microsoft.com/dotnet/sdk:6.0 AS build
|
||||
WORKDIR /src
|
||||
COPY ["Src/Dlhis.Common/Dlhis.Common.csproj", "Src/Dlhis.Common/"]
|
||||
COPY ["Src/Dlhis.Entity/Dlhis.Entity.csproj", "Src/Dlhis.Entity/"]
|
||||
RUN dotnet restore "Src/Dlhis.Common/Dlhis.Common.csproj"
|
||||
COPY . .
|
||||
WORKDIR "/src/Src/Dlhis.Common"
|
||||
RUN dotnet build "Dlhis.Common.csproj" -c Release -o /app/build
|
||||
|
||||
FROM build AS publish
|
||||
RUN dotnet publish "Dlhis.Common.csproj" -c Release -o /app/publish /p:UseAppHost=false
|
||||
|
||||
FROM base AS final
|
||||
WORKDIR /app
|
||||
COPY --from=publish /app/publish .
|
||||
ENTRYPOINT ["dotnet", "Dlhis.Common.dll"]
|
||||
49
Src/Dlhis.Common/EnumSetting/EnumsController.cs
Normal file
49
Src/Dlhis.Common/EnumSetting/EnumsController.cs
Normal file
@@ -0,0 +1,49 @@
|
||||
using System.Reflection;
|
||||
using Kurisu.AspNetCore.Utils.Extensions;
|
||||
using Microsoft.AspNetCore.Authorization;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
|
||||
namespace Dlhis.Common.EnumSetting;
|
||||
|
||||
/// <summary>
|
||||
/// 枚举
|
||||
/// </summary>
|
||||
[Authorize]
|
||||
[Route("api/[controller]")]
|
||||
[ApiController]
|
||||
public class EnumsController : ControllerBase
|
||||
{
|
||||
/// <summary>
|
||||
/// 获取所有枚举
|
||||
/// </summary>
|
||||
/// <param name="code">枚举code</param>
|
||||
/// <returns></returns>
|
||||
[HttpGet]
|
||||
public object GetEnums(string code)
|
||||
{
|
||||
var types = Assembly.Load("Dlhis.Entity")
|
||||
.GetTypes()
|
||||
.Where(x => x.IsEnum)
|
||||
.WhereIf(code.IsPresent(), x => x.Name == code);
|
||||
|
||||
return types.Select(x =>
|
||||
{
|
||||
var d = x.GetDescription();
|
||||
return new
|
||||
{
|
||||
Code = x.Name,
|
||||
Name = d,
|
||||
Data = x.GetFields(BindingFlags.Public | BindingFlags.Static).Select(item =>
|
||||
{
|
||||
var e = (Enum)Enum.Parse(item.FieldType, item.GetValue(null).ToString());
|
||||
var fd = e.GetDescription();
|
||||
return new
|
||||
{
|
||||
Key = fd,
|
||||
Value = (int)item.GetValue(null)
|
||||
};
|
||||
})
|
||||
};
|
||||
});
|
||||
}
|
||||
}
|
||||
18
Src/Dlhis.Common/Program.cs
Normal file
18
Src/Dlhis.Common/Program.cs
Normal file
@@ -0,0 +1,18 @@
|
||||
using Kurisu.AspNetCore.Startup;
|
||||
using Kurisu.Startup;
|
||||
|
||||
class Program
|
||||
{
|
||||
static void Main(string[] args)
|
||||
{
|
||||
KurisuHost.Run<Startup>(true, args);
|
||||
}
|
||||
}
|
||||
|
||||
public class Startup : DefaultStartup
|
||||
{
|
||||
public Startup(IConfiguration configuration) : base(configuration)
|
||||
{
|
||||
|
||||
}
|
||||
}
|
||||
21
Src/Dlhis.Common/Properties/launchSettings.json
Normal file
21
Src/Dlhis.Common/Properties/launchSettings.json
Normal file
@@ -0,0 +1,21 @@
|
||||
{
|
||||
"profiles": {
|
||||
"Dlhis.Common": {
|
||||
"commandName": "Project",
|
||||
"environmentVariables": {
|
||||
"ASPNETCORE_ENVIRONMENT": "Development"
|
||||
},
|
||||
"dotnetRunMessages": true,
|
||||
"applicationUrl": "http://localhost:5001"
|
||||
},
|
||||
"Docker": {
|
||||
"commandName": "Docker",
|
||||
"launchUrl": "{Scheme}://{ServiceHost}:{ServicePort}",
|
||||
"environmentVariables": {
|
||||
"ASPNETCORE_URLS": "http://+:80"
|
||||
},
|
||||
"publishAllPorts": true
|
||||
}
|
||||
},
|
||||
"$schema": "https://json.schemastore.org/launchsettings.json"
|
||||
}
|
||||
8
Src/Dlhis.Common/appsettings.Development.json
Normal file
8
Src/Dlhis.Common/appsettings.Development.json
Normal file
@@ -0,0 +1,8 @@
|
||||
{
|
||||
"Logging": {
|
||||
"LogLevel": {
|
||||
"Default": "Information",
|
||||
"Microsoft.AspNetCore": "Warning"
|
||||
}
|
||||
}
|
||||
}
|
||||
62
Src/Dlhis.Common/appsettings.json
Normal file
62
Src/Dlhis.Common/appsettings.json
Normal file
@@ -0,0 +1,62 @@
|
||||
{
|
||||
"Logging": {
|
||||
"LogLevel": {
|
||||
"Default": "Information",
|
||||
"Microsoft.AspNetCore": "Warning"
|
||||
}
|
||||
},
|
||||
"AllowedHosts": "*",
|
||||
"SwaggerOptions": {
|
||||
"Enable": true,
|
||||
"Authority": "https://yikatong.isawesome.cn/oauth2",
|
||||
"ClientId": "4fb184324eac4180",
|
||||
"ClientSecret": "8ac8f235152f1524",
|
||||
"Scopes": {
|
||||
"openid": "openid"
|
||||
}
|
||||
},
|
||||
"IdentityServerOptions": {
|
||||
"Authority": "https://yikatong.isawesome.cn/oauth2",
|
||||
"RequireHttpsMetadata": true,
|
||||
"Issuer": "identity.isawesome.cn",
|
||||
"Audience": "",
|
||||
"Pat": {
|
||||
"Enable": false,
|
||||
"Scheme": "token",
|
||||
"ClientId": "reference",
|
||||
"ClientSecret": "123456"
|
||||
}
|
||||
},
|
||||
"Serilog": {
|
||||
"MinimumLevel": {
|
||||
"Default": "Information",
|
||||
"Override": {
|
||||
"System": "Warning",
|
||||
"Microsoft": "Warning",
|
||||
"Microsoft.Hosting.Lifetime": "Information"
|
||||
}
|
||||
},
|
||||
"WriteTo": [
|
||||
{
|
||||
"Name": "Async",
|
||||
"Args": {
|
||||
"configure": [
|
||||
{
|
||||
"Name": "Console",
|
||||
"Args": {
|
||||
"outputTemplate": "[{Timestamp:HH:mm:ss} {Level:u3}] [{SourceContext}] {Message:lj}{NewLine}{Exception}"
|
||||
}
|
||||
},
|
||||
{
|
||||
"Name": "File",
|
||||
"Args": {
|
||||
"path": "log/log.txt",
|
||||
"rollingInterval": "Hour"
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
136
Src/Dlhis.Entity/Canteen/Entities/BalanceRecordEntity.cs
Normal file
136
Src/Dlhis.Entity/Canteen/Entities/BalanceRecordEntity.cs
Normal file
@@ -0,0 +1,136 @@
|
||||
using Dlhis.Entity.Canteen.Enums;
|
||||
using Kurisu.Core.DataAccess.Entity;
|
||||
using SqlSugar;
|
||||
using SqlSugar.DbConvert;
|
||||
|
||||
namespace Dlhis.Entity.Canteen.Entities;
|
||||
|
||||
/// <summary>
|
||||
/// 充值/消费记录
|
||||
/// </summary>
|
||||
[SugarTable(TableName = "BalanceRecord", TableDescription = "充值/消费记录")]
|
||||
public class BalanceRecordEntity : SugarBaseEntity, ITenantId
|
||||
{
|
||||
/// <summary>
|
||||
/// 流水号
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnDescription = "流水号")]
|
||||
public string No { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 档案号/QRCode
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnDescription = "档案号/QRCode")]
|
||||
public string UserId { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 姓名
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnDescription = "姓名")]
|
||||
public string Name { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 学工号
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnDescription = "学工号")]
|
||||
public string UserCode { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 部门号
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnDescription = "部门号")]
|
||||
public string DepartmentNo { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 来源
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnDataType = "varchar(50)", SqlParameterDbType = typeof(EnumToStringConvert), ColumnDescription = "来源")]
|
||||
public BalanceRecordSourceEnumType Source { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 来源备注
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnDescription = "来源备注")]
|
||||
public string SourceRemark { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 收入/支出
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnDataType = "varchar(50)", SqlParameterDbType = typeof(EnumToStringConvert), ColumnDescription = "收入/支出")]
|
||||
public BalanceRecordTypeEnumType Type { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 金额 + - 表示
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnDescription = "金额+-表示")]
|
||||
public decimal Amount { get; set; }
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 营业点
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnDescription = "营业点")]
|
||||
public string BusinessPlaceCode { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 餐次
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnDescription = "餐次")]
|
||||
public string BusinessShiftCode { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 所属成本日期
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnDescription = "所属成本日期")]
|
||||
public DateTime CostDate { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 操作人
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnDescription = "操作人")]
|
||||
public string OperateUser { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 消费机器唯一信息
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnDescription = "消费机器唯一信息")]
|
||||
public string DeviceInfo { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 餐补月份
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnDescription = "餐补月份")]
|
||||
public string SubsidiesFromMonth { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Ip
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnDescription = "IP")]
|
||||
public string IP { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 成本中心
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnDescription = "成本中心")]
|
||||
public string CostId { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 消费者所在基地
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnDescription = "消费者所在基地")]
|
||||
public string OriginTenantId { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 成本计算是否允许跨基地范围
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnDataType = "bit", ColumnDescription = "成本计算是否允许跨基地范围")]
|
||||
public bool IsCostCrossTenant { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 数据状态
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnDataType = "varchar(50)", SqlParameterDbType = typeof(EnumToStringConvert), ColumnDescription = "数据状态")]
|
||||
public BalanceRecordStatusEnumType Status { get; set; }
|
||||
|
||||
public string TenantId { get; set; }
|
||||
}
|
||||
@@ -0,0 +1,55 @@
|
||||
using Dlhis.Entity.Canteen.Enums;
|
||||
using Kurisu.Core.DataAccess.Entity;
|
||||
using SqlSugar;
|
||||
using SqlSugar.DbConvert;
|
||||
|
||||
namespace Dlhis.Entity.Canteen.Entities;
|
||||
|
||||
/// <summary>
|
||||
/// 营业点
|
||||
/// </summary>
|
||||
[SugarTable(TableName = "CanteenBusinessPlace", TableDescription = "营业点")]
|
||||
public class CanteenBusinessPlaceEntity : SugarBaseEntity, ITenantId
|
||||
{
|
||||
/// <summary>
|
||||
/// 代号
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnDescription = "code")]
|
||||
public Guid Code { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 自定义代号
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnDescription = "自定义手工号")]
|
||||
public string CustomCode { get; set; }
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 营业点名称
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnDescription = "营业点名称")]
|
||||
public string Name { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 状态,停用/启用
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnDataType = "varchar(50)", SqlParameterDbType = typeof(EnumToStringConvert), ColumnDescription = "状态")]
|
||||
public CanteenBusinessPlaceStatusEnumType Status { get; set; }
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 来源,自营/合作/外包
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnDataType = "varchar(50)", SqlParameterDbType = typeof(EnumToStringConvert), ColumnDescription = "来源,自营/合作/外包")]
|
||||
public CanteenBusinessPlaceSourceEnumType Source { get; set; }
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 分类,超市/餐厅/食堂
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnDataType = "varchar(50)", SqlParameterDbType = typeof(EnumToStringConvert), ColumnDescription = "分类,超市/餐厅/食堂")]
|
||||
public CanteenBusinessPlaceCatalogEnumType Catalog { get; set; }
|
||||
|
||||
|
||||
public string TenantId { get; set; }
|
||||
}
|
||||
@@ -0,0 +1,49 @@
|
||||
using Kurisu.Core.DataAccess.Entity;
|
||||
using SqlSugar;
|
||||
|
||||
namespace Dlhis.Entity.Canteen.Entities;
|
||||
|
||||
/// <summary>
|
||||
/// 营业点餐次
|
||||
/// </summary>
|
||||
[SugarTable(TableName = "CanteenBusinessShift", TableDescription = "营业点餐次")]
|
||||
public class CanteenBusinessShiftEntity : SugarBaseEntity, ITenantId
|
||||
{
|
||||
/// <summary>
|
||||
/// 营业点代号
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnDescription = "营业点code")]
|
||||
public Guid BusinessPlaceCode { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 代号
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnDescription = "code")]
|
||||
public Guid Code { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 自定义代号
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnDescription = "自定义手工号")]
|
||||
public string CustomCode { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 餐次名称
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnDescription = "餐次名称")]
|
||||
public string Name { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 经营开始时间
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnDescription = "经营开始时间")]
|
||||
public TimeOnly Start { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 经营结束时间
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnDescription = "经营结束时间")]
|
||||
public TimeOnly End { get; set; }
|
||||
|
||||
public string TenantId { get; set; }
|
||||
}
|
||||
43
Src/Dlhis.Entity/Canteen/Entities/CanteenOrderEntity.cs
Normal file
43
Src/Dlhis.Entity/Canteen/Entities/CanteenOrderEntity.cs
Normal file
@@ -0,0 +1,43 @@
|
||||
using Dlhis.Entity.Canteen.Enums;
|
||||
using Kurisu.Core.DataAccess.Entity;
|
||||
using SqlSugar;
|
||||
using SqlSugar.DbConvert;
|
||||
|
||||
namespace Dlhis.Entity.Canteen.Entities;
|
||||
|
||||
/// <summary>
|
||||
/// 就餐订单
|
||||
/// </summary>
|
||||
[SugarTable(TableName = "CanteenOrder", TableDescription = "就餐订单")]
|
||||
public class CanteenOrderEntity : BalanceRecordEntity, ITenantId
|
||||
{
|
||||
/// <summary>
|
||||
/// 请求json
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnDescription = "请求json")]
|
||||
public string RequestJson { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 第三方订单号
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnDescription = "第三方订单号")]
|
||||
public string ThirdNo { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 订单状态
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnDataType = "varchar(50)", SqlParameterDbType = typeof(EnumToStringConvert), ColumnDescription = "订单状态")]
|
||||
public CanteenOrderStatusEnumType OrderStatus { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 是否离线数据
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnDataType = "bit", ColumnDescription = "请求json")]
|
||||
public bool IsOffline { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 处理结果
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnDescription = "处理结果")]
|
||||
public string Result { get; set; }
|
||||
}
|
||||
51
Src/Dlhis.Entity/Canteen/Entities/CanteenSettingEntity.cs
Normal file
51
Src/Dlhis.Entity/Canteen/Entities/CanteenSettingEntity.cs
Normal file
@@ -0,0 +1,51 @@
|
||||
using Dlhis.Entity.Canteen.Enums;
|
||||
using Kurisu.Core.DataAccess.Entity;
|
||||
using SqlSugar;
|
||||
using SqlSugar.DbConvert;
|
||||
|
||||
namespace Dlhis.Entity.Canteen.Entities;
|
||||
|
||||
/// <summary>
|
||||
/// 就餐配置
|
||||
/// </summary>
|
||||
[SugarTable(TableName = "CanteenSetting", TableDescription = "就餐配置")]
|
||||
public class CanteenSettingEntity : SugarBaseEntity, ITenantId
|
||||
{
|
||||
/// <summary>
|
||||
/// 唯一类型
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnDataType = "varchar(50)", SqlParameterDbType = typeof(EnumToStringConvert), ColumnDescription = "唯一类型")]
|
||||
public CanteenSettingUnqiueEnumType UniqueType { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 唯一值
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnDescription = "唯一值")]
|
||||
public string UniqueValue { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 分类
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnDescription = "分类")]
|
||||
public string Catalog { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 参数
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnDataType = "varchar(50)", ColumnDescription = "参数", SqlParameterDbType = typeof(EnumToStringConvert))]
|
||||
public CanteenSettingItemEnumType Item { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 值
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnDescription = "值")]
|
||||
public string Value { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 是否启用
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnDataType = "bit", ColumnDescription = "是否启用")]
|
||||
public bool Enable { get; set; }
|
||||
|
||||
public string TenantId { get; set; }
|
||||
}
|
||||
70
Src/Dlhis.Entity/Canteen/Entities/CanteenUserEntity.cs
Normal file
70
Src/Dlhis.Entity/Canteen/Entities/CanteenUserEntity.cs
Normal file
@@ -0,0 +1,70 @@
|
||||
using Dlhis.Entity.Canteen.Enums;
|
||||
using Kurisu.Core.DataAccess.Entity;
|
||||
using SqlSugar;
|
||||
using SqlSugar.DbConvert;
|
||||
|
||||
namespace Dlhis.Entity.Canteen.Entities;
|
||||
|
||||
/// <summary>
|
||||
/// 就餐人员
|
||||
/// </summary>
|
||||
[SugarTable(TableName = "CanteenUser", TableDescription = "就餐人员")]
|
||||
public class CanteenUserEntity : SugarBaseEntity, IVersion, ITenantId
|
||||
{
|
||||
/// <summary>
|
||||
/// 档案号
|
||||
/// </summary>
|
||||
[SugarColumn(IsNullable = false, ColumnDescription = "档案号")]
|
||||
public string UserId { get; set; }
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 学工号
|
||||
/// </summary>
|
||||
[SugarColumn(IsNullable = false, ColumnDescription = "学工号")]
|
||||
public string UserCode { get; set; }
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 消费人员类型
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnDataType = "varchar(50)", SqlParameterDbType = typeof(EnumToStringConvert), ColumnDescription = "消费人员类型")]
|
||||
public CanteenUserEnumType UserType { get; set; }
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 卡号
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnDescription = "卡号")]
|
||||
public string CarNo { get; set; }
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 余额
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnDescription = "余额")]
|
||||
public decimal Balance { get; set; }
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 余额(充值)
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnDescription = "余额(充值)")]
|
||||
public decimal BalanceOfRecharge { get; set; }
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 余额(餐补)
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnDescription = "余额(餐补)")]
|
||||
public decimal BalanceOfSubsidies { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 版本号
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnDescription = "版本号")]
|
||||
public int Version { get; set; }
|
||||
|
||||
|
||||
public string TenantId { get; set; }
|
||||
}
|
||||
@@ -0,0 +1,84 @@
|
||||
using SqlSugar;
|
||||
|
||||
namespace Dlhis.Entity.Canteen.Entities;
|
||||
|
||||
/// <summary>
|
||||
/// OA餐券明细
|
||||
/// </summary>
|
||||
[SugarTable(TableName = "OaEMealVoucherDetail", TableDescription = "OA餐券明细")]
|
||||
public class OaEMealVoucherDetailEntity
|
||||
{
|
||||
public long Id { get; set; }
|
||||
|
||||
|
||||
[SugarColumn(ColumnDescription = "餐券id")]
|
||||
public long VoucherId { get; set; }
|
||||
|
||||
|
||||
[SugarColumn(ColumnDescription = "序号")]
|
||||
public int Sequence { get; set; }
|
||||
|
||||
|
||||
[SugarColumn(ColumnDescription = "用餐人情况(新员工/外来人员)")]
|
||||
public string DinnerType { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 身份证
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnDescription = "序号")]
|
||||
public string IdNo { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 用餐人
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnDescription = "用餐人")]
|
||||
public string Name { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 手机号
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnDescription = "手机号")]
|
||||
public string Phone { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 就餐开始
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnDescription = "就餐开始")]
|
||||
public DateTime Start { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 就餐结束
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnDescription = "就餐结束")]
|
||||
public DateTime End { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 就餐天数
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnDescription = "就餐天数")]
|
||||
public int Days { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 金额
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnDescription = "金额")]
|
||||
public decimal Amount { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 二维码
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnDescription = "二维码")]
|
||||
public string QrCode { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 状态
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnDescription = "状态,默认为R")]
|
||||
public string Status { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 信息
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnDescription = "信息/错误信息")]
|
||||
public string Message { get; set; }
|
||||
}
|
||||
122
Src/Dlhis.Entity/Canteen/Entities/OaEMealVoucherEntity.cs
Normal file
122
Src/Dlhis.Entity/Canteen/Entities/OaEMealVoucherEntity.cs
Normal file
@@ -0,0 +1,122 @@
|
||||
using SqlSugar;
|
||||
|
||||
namespace Dlhis.Entity.Canteen.Entities;
|
||||
|
||||
/// <summary>
|
||||
/// OA餐券
|
||||
/// </summary>
|
||||
[SugarTable(TableName = "OaEMealVoucher", TableDescription = "OA餐券")]
|
||||
public class OaEMealVoucherEntity
|
||||
{
|
||||
[SugarColumn(IsIdentity = true, IsPrimaryKey = true)]
|
||||
public long Id { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 标题
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnDescription = "标题")]
|
||||
public string Title { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 申请人工号
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnDescription = "申请人工号")]
|
||||
public string UserCode { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 申请人名称
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnDescription = "申请人名称")]
|
||||
public string Name { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 基地代码
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnDescription = "基地代码")]
|
||||
public string TenantId { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 基地名称
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnDescription = "基地名称")]
|
||||
public string TenantName { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 成本中心
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnDescription = "成本中心")]
|
||||
public string CostId { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 成本中心名称
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnDescription = "成本中心名称")]
|
||||
public string CostName { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 来宾公司
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnDescription = "来宾公司")]
|
||||
public string Company { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 联系人
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnDescription = "联系人")]
|
||||
public string Phone { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 来宾人数
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnDescription = "来宾人数")]
|
||||
public int Num { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 就餐食堂
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnDescription = "就餐食堂")]
|
||||
public string Canteen { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 就餐事由
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnDescription = "就餐事由")]
|
||||
public string Reason { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 就餐次
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnDescription = "就餐次")]
|
||||
public string CanteenShift { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// oa流程id
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnDescription = "oa流程id")]
|
||||
public string OaId { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 部门号
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnDescription = "部门号")]
|
||||
public string DepartmentNo { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 部门名称
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnDescription = "部门名称")]
|
||||
public string DepartmentName { get; set; }
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 申请日期
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnDescription = "申请日期")]
|
||||
public DateTime LogDate { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 数据创建时间
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnDescription = "数据创建时间")]
|
||||
public DateTime CreateTime { get; set; }
|
||||
}
|
||||
@@ -0,0 +1,60 @@
|
||||
using System.ComponentModel;
|
||||
|
||||
namespace Dlhis.Entity.Canteen.Enums;
|
||||
|
||||
/// <summary>
|
||||
/// 充值/消费来源
|
||||
/// </summary>
|
||||
[Description("充值/消费来源")]
|
||||
public enum BalanceRecordSourceEnumType
|
||||
{
|
||||
/// <summary>
|
||||
/// 来自微信
|
||||
/// </summary>
|
||||
[Description("来自微信")]
|
||||
Wechat,
|
||||
|
||||
/// <summary>
|
||||
/// 来自支付宝
|
||||
/// </summary>
|
||||
[Description("来自支付宝")]
|
||||
Alipay,
|
||||
|
||||
/// <summary>
|
||||
/// 来自支付宝
|
||||
/// </summary>
|
||||
[Description("银联")]
|
||||
UnionPay,
|
||||
|
||||
/// <summary>
|
||||
/// 来自本基地补贴
|
||||
/// </summary>
|
||||
[Description("来自本基地补贴")]
|
||||
LocalTenantSubsidies,
|
||||
|
||||
/// <summary>
|
||||
/// 来自其他基地补贴
|
||||
/// </summary>
|
||||
[Description("来自其他基地补贴")]
|
||||
OtherTenantSubsidies,
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 餐厅
|
||||
/// </summary>
|
||||
[Description("餐厅")]
|
||||
Cateen,
|
||||
|
||||
/// <summary>
|
||||
/// 食堂
|
||||
/// </summary>
|
||||
[Description("食堂")]
|
||||
Cafeteria,
|
||||
|
||||
/// <summary>
|
||||
/// 超市
|
||||
/// </summary>
|
||||
[Description("超市")]
|
||||
Supermarket,
|
||||
|
||||
}
|
||||
@@ -0,0 +1,23 @@
|
||||
using System.ComponentModel;
|
||||
|
||||
namespace Dlhis.Entity.Canteen.Enums;
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 充值/消费状态
|
||||
/// </summary>
|
||||
[Description("充值/消费状态")]
|
||||
public enum BalanceRecordStatusEnumType
|
||||
{
|
||||
/// <summary>
|
||||
/// 有效
|
||||
/// </summary>
|
||||
[Description("有效")]
|
||||
Valid = 1,
|
||||
|
||||
/// <summary>
|
||||
/// 作废
|
||||
/// </summary>
|
||||
[Description("作废")]
|
||||
Absolute
|
||||
}
|
||||
22
Src/Dlhis.Entity/Canteen/Enums/BalanceRecordTypeEnumType.cs
Normal file
22
Src/Dlhis.Entity/Canteen/Enums/BalanceRecordTypeEnumType.cs
Normal file
@@ -0,0 +1,22 @@
|
||||
using System.ComponentModel;
|
||||
|
||||
namespace Dlhis.Entity.Canteen.Enums;
|
||||
|
||||
/// <summary>
|
||||
/// 充值/消费
|
||||
/// </summary>
|
||||
[Description("充值/消费")]
|
||||
public enum BalanceRecordTypeEnumType
|
||||
{
|
||||
/// <summary>
|
||||
/// 支出
|
||||
/// </summary>
|
||||
[Description("支出")]
|
||||
Out = 0,
|
||||
|
||||
/// <summary>
|
||||
/// 充值
|
||||
/// </summary>
|
||||
[Description("充值")]
|
||||
In = 1,
|
||||
}
|
||||
@@ -0,0 +1,29 @@
|
||||
using System.ComponentModel;
|
||||
|
||||
namespace Dlhis.Entity.Canteen.Enums;
|
||||
|
||||
/// <summary>
|
||||
/// 营业点类型
|
||||
/// </summary>
|
||||
[Description("营业点类型")]
|
||||
public enum CanteenBusinessPlaceCatalogEnumType
|
||||
{
|
||||
/// <summary>
|
||||
/// 餐厅
|
||||
/// </summary>
|
||||
[Description("餐厅")]
|
||||
Cateen = 1,
|
||||
|
||||
/// <summary>
|
||||
/// 食堂
|
||||
/// </summary>
|
||||
[Description("食堂")]
|
||||
Cafeteria = 2,
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 超市
|
||||
/// </summary>
|
||||
[Description("超市")]
|
||||
Supermarket = 3,
|
||||
}
|
||||
@@ -0,0 +1,29 @@
|
||||
using System.ComponentModel;
|
||||
|
||||
namespace Dlhis.Entity.Canteen.Enums;
|
||||
|
||||
/// <summary>
|
||||
/// 营业点来源
|
||||
/// </summary>
|
||||
[Description("营业点来源")]
|
||||
public enum CanteenBusinessPlaceSourceEnumType
|
||||
{
|
||||
/// <summary>
|
||||
/// 自营
|
||||
/// </summary>
|
||||
[Description("自营")]
|
||||
Self = 1,
|
||||
|
||||
/// <summary>
|
||||
/// 合作
|
||||
/// </summary>
|
||||
[Description("合作")]
|
||||
Cooperation = 2,
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 外包
|
||||
/// </summary>
|
||||
[Description("外包")]
|
||||
Outsource,
|
||||
}
|
||||
@@ -0,0 +1,22 @@
|
||||
using System.ComponentModel;
|
||||
|
||||
namespace Dlhis.Entity.Canteen.Enums;
|
||||
|
||||
/// <summary>
|
||||
/// 营业点状态
|
||||
/// </summary>
|
||||
[Description("营业点状态")]
|
||||
public enum CanteenBusinessPlaceStatusEnumType
|
||||
{
|
||||
/// <summary>
|
||||
/// 启用
|
||||
/// </summary>
|
||||
[Description("启用")]
|
||||
Opened = 1,
|
||||
|
||||
/// <summary>
|
||||
/// 暂停
|
||||
/// </summary>
|
||||
[Description("暂停")]
|
||||
Stoped = 2
|
||||
}
|
||||
22
Src/Dlhis.Entity/Canteen/Enums/CanteenOrderStatusEnumType.cs
Normal file
22
Src/Dlhis.Entity/Canteen/Enums/CanteenOrderStatusEnumType.cs
Normal file
@@ -0,0 +1,22 @@
|
||||
using System.ComponentModel;
|
||||
|
||||
namespace Dlhis.Entity.Canteen.Enums;
|
||||
|
||||
/// <summary>
|
||||
/// 就餐订单状态
|
||||
/// </summary>
|
||||
[Description("就餐订单状态")]
|
||||
public enum CanteenOrderStatusEnumType
|
||||
{
|
||||
/// <summary>
|
||||
/// 失败
|
||||
/// </summary>
|
||||
[Description("失败")]
|
||||
Failure = 0,
|
||||
|
||||
/// <summary>
|
||||
/// 成功
|
||||
/// </summary>
|
||||
[Description("成功")]
|
||||
Successful,
|
||||
}
|
||||
82
Src/Dlhis.Entity/Canteen/Enums/CanteenSettingItemEnumType.cs
Normal file
82
Src/Dlhis.Entity/Canteen/Enums/CanteenSettingItemEnumType.cs
Normal file
@@ -0,0 +1,82 @@
|
||||
using System.ComponentModel;
|
||||
|
||||
namespace Dlhis.Entity.Canteen.Enums;
|
||||
|
||||
/// <summary>
|
||||
/// 就餐配置项
|
||||
/// </summary>
|
||||
[Description("就餐配置项")]
|
||||
public enum CanteenSettingItemEnumType
|
||||
{
|
||||
//# BusinessSwitchTime varchar(255) not null comment '营业点切换时间 HH:00:00',
|
||||
//# DayCostMax decimal(16, 2) not null comment '每日允许消费最高金额(存在普通模式)',
|
||||
//# DayMarketCostMax decimal(16, 2) not null comment '每日超市允许消费最高金额',
|
||||
//# AllowSendAtMeal bit not null comment '允许就餐下发',
|
||||
//# DayEVoucherUseCountMax int not null comment '电子券每天使用最多次数',
|
||||
//# Subsidies decimal(16, 2) not null comment '补贴',
|
||||
//# AllowRepeatInOneShift bit not null comment '允许一餐次多次消费',
|
||||
//# OnceCostMax decimal(16, 2) not null comment '一次最高消费金额',
|
||||
//# AllowCrossTenant bit not null comment '允许跨基地消费',
|
||||
//# InitBalance decimal(16, 2) not null comment '初始金额',
|
||||
|
||||
/// <summary>
|
||||
/// 营业点切换时间
|
||||
/// </summary>
|
||||
[Description("营业点切换时间(HH:00:00)")]
|
||||
BusinessSwitchTime = 1,
|
||||
|
||||
/// <summary>
|
||||
/// 每日允许消费最高金额
|
||||
/// </summary>
|
||||
[Description("每日允许消费最高金额(decimal)")]
|
||||
DayCostMax,
|
||||
|
||||
/// <summary>
|
||||
/// 每日超市允许消费最高金额
|
||||
/// </summary>
|
||||
[Description("每日超市允许消费最高金额(decimal)")]
|
||||
DayMarketCostMax,
|
||||
|
||||
/// <summary>
|
||||
/// 允许就餐下发
|
||||
/// </summary>
|
||||
[Description("允许就餐下发(T/F)")]
|
||||
AllowSendAtMeal,
|
||||
|
||||
/// <summary>
|
||||
/// 电子券每天使用最多次数
|
||||
/// </summary>
|
||||
[Description("电子券每天使用最多次数(int)")]
|
||||
DayEVoucherUseCountMax,
|
||||
|
||||
/// <summary>
|
||||
/// 补贴
|
||||
/// </summary>
|
||||
[Description("补贴(decimal)")]
|
||||
Subsidies,
|
||||
|
||||
/// <summary>
|
||||
/// 允许一餐次多次消费
|
||||
/// </summary>
|
||||
[Description("允许一餐次多次消费(T/F)")]
|
||||
AllowRepeatInOneShift,
|
||||
|
||||
/// <summary>
|
||||
/// 一次最高消费金额
|
||||
/// </summary>
|
||||
[Description("一次最高消费金额(decimal)")]
|
||||
OnceCostMax,
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 允许跨基地消费
|
||||
/// </summary>
|
||||
[Description("允许跨基地消费(T/F)")]
|
||||
AllowCrossTenant,
|
||||
|
||||
/// <summary>
|
||||
/// 初始金额
|
||||
/// </summary>
|
||||
[Description("初始金额(decimal)")]
|
||||
InitBalance,
|
||||
}
|
||||
@@ -0,0 +1,22 @@
|
||||
using System.ComponentModel;
|
||||
|
||||
namespace Dlhis.Entity.Canteen.Enums;
|
||||
|
||||
/// <summary>
|
||||
/// 就餐配置类型
|
||||
/// </summary>
|
||||
[Description("就餐配置类型")]
|
||||
public enum CanteenSettingUnqiueEnumType
|
||||
{
|
||||
/// <summary>
|
||||
/// 基地/租户
|
||||
/// </summary>
|
||||
[Description("基地/租户")]
|
||||
Tenant = 1,
|
||||
|
||||
/// <summary>
|
||||
/// 就餐人员
|
||||
/// </summary>
|
||||
[Description("就餐人员")]
|
||||
Person = 10,
|
||||
}
|
||||
30
Src/Dlhis.Entity/Canteen/Enums/CanteenUserEnumType.cs
Normal file
30
Src/Dlhis.Entity/Canteen/Enums/CanteenUserEnumType.cs
Normal file
@@ -0,0 +1,30 @@
|
||||
|
||||
|
||||
using System.ComponentModel;
|
||||
|
||||
namespace Dlhis.Entity.Canteen.Enums;
|
||||
|
||||
/// <summary>
|
||||
/// 就餐人员类型
|
||||
/// </summary>
|
||||
[Description("就餐人员类型")]
|
||||
public enum CanteenUserEnumType
|
||||
{
|
||||
/// <summary>
|
||||
/// 本基地
|
||||
/// </summary>
|
||||
[Description("本基地人员")]
|
||||
LocalTenant = 1,
|
||||
|
||||
/// <summary>
|
||||
/// 其他基地
|
||||
/// </summary>
|
||||
[Description("其他基地人员")]
|
||||
OtherTenant,
|
||||
|
||||
/// <summary>
|
||||
/// 外部人员
|
||||
/// </summary>
|
||||
[Description("外部人员")]
|
||||
External
|
||||
}
|
||||
106
Src/Dlhis.Entity/Device/Entities/DeviceEntity.cs
Normal file
106
Src/Dlhis.Entity/Device/Entities/DeviceEntity.cs
Normal file
@@ -0,0 +1,106 @@
|
||||
using Dlhis.Entity.Device.Enums;
|
||||
using Kurisu.Core.DataAccess.Entity;
|
||||
using SqlSugar;
|
||||
|
||||
namespace Dlhis.Entity.Device.Entities;
|
||||
|
||||
/// <summary>
|
||||
/// 设备
|
||||
/// </summary>
|
||||
[SugarTable(TableName = "Device", TableDescription = "设备表")]
|
||||
public class DeviceEntity : SugarBaseEntity, ITenantId
|
||||
{
|
||||
/// <summary>
|
||||
/// 设备code
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnDescription = "设备code")]
|
||||
public Guid Code { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 设备唯一码,IP/MAC/SNO
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnDescription = "设备唯一码")]
|
||||
public string UniqueNo { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 心跳间隔
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnDescription = "心跳检查")]
|
||||
public int HeartbeatInterval { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 品牌
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnDescription = "品牌")]
|
||||
public string Brand { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 供应商
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnDescription = "供应商")]
|
||||
public string Supplier { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 设备功能
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnDataType = "varchar(150)", IsJson = true, ColumnDescription = "设备功能")]
|
||||
public List<DeviceFuncEnumType> Funcs { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 部署点
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnDescription = "部署点")]
|
||||
public string DeployPlace { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 部署坐标
|
||||
/// </summary>
|
||||
[SugarColumn(IsJson = true, ColumnDescription = "部署坐标")]
|
||||
public string DeployPosition { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 部署方向
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnDescription = "部署方向")]
|
||||
public string DeployDirection { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 模板code
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnDescription = "模板code")]
|
||||
public Guid TemplateCode { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 连接信息
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnDescription = "连接信息")]
|
||||
public string ConnectionInfo { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 最后使用人
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnDescription = "最后使用人")]
|
||||
public DateTime LastLogId { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 最后使用日期
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnDescription = "最后使用日期")]
|
||||
public DateTime LastLogDateTime { get; set; }
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 是否启用
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnDataType = "bit", ColumnDescription = "是否启用")]
|
||||
public bool Enable { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 设别状态
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnDescription = "设别状态")]
|
||||
public string Status { get; set; }
|
||||
|
||||
|
||||
public string TenantId { get; set; }
|
||||
}
|
||||
26
Src/Dlhis.Entity/Device/Entities/DeviceGroupEntity.cs
Normal file
26
Src/Dlhis.Entity/Device/Entities/DeviceGroupEntity.cs
Normal file
@@ -0,0 +1,26 @@
|
||||
using Kurisu.Core.DataAccess.Entity;
|
||||
using SqlSugar;
|
||||
|
||||
namespace Dlhis.Entity.Device.Entities;
|
||||
|
||||
/// <summary>
|
||||
/// 设备组
|
||||
/// </summary>
|
||||
[SugarTable(TableName = "DeviceGroup", TableDescription = "设备组")]
|
||||
public class DeviceGroupEntity : SugarBaseEntity, ITenantId
|
||||
{
|
||||
/// <summary>
|
||||
/// 设备组code
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnDescription = "设备组code")]
|
||||
public string Code { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 设备组名称
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnDescription = "设备组名称")]
|
||||
public string Name { get; set; }
|
||||
|
||||
|
||||
public string TenantId { get; set; }
|
||||
}
|
||||
@@ -0,0 +1,26 @@
|
||||
using Kurisu.Core.DataAccess.Entity;
|
||||
using SqlSugar;
|
||||
|
||||
namespace Dlhis.Entity.Device.Entities;
|
||||
|
||||
/// <summary>
|
||||
/// 设备组/设备关系
|
||||
/// </summary>
|
||||
[SugarTable(TableName = "DeviceGroupRelationship", TableDescription = "设备组/设备关系")]
|
||||
public class DeviceGroupRelationshipEntity : SugarBaseEntity, ITenantId
|
||||
{
|
||||
/// <summary>
|
||||
/// 设备组code
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnDescription = "设备组code")]
|
||||
public string GroupCode { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 设备code
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnDescription = "设备code")]
|
||||
public string DeviceCode { get; set; }
|
||||
|
||||
|
||||
public string TenantId { get; set; }
|
||||
}
|
||||
43
Src/Dlhis.Entity/Device/Entities/DeviceRegistryEntity.cs
Normal file
43
Src/Dlhis.Entity/Device/Entities/DeviceRegistryEntity.cs
Normal file
@@ -0,0 +1,43 @@
|
||||
using Kurisu.Core.DataAccess.Entity;
|
||||
using SqlSugar;
|
||||
|
||||
namespace Dlhis.Entity.Device.Entities;
|
||||
|
||||
/// <summary>
|
||||
/// 设备注册表
|
||||
/// </summary>
|
||||
[SugarTable(TableName = "DeviceRegistry", TableDescription = "设备注册表")]
|
||||
public class DeviceRegistryEntity : SugarBaseEntity, ITenantId
|
||||
{
|
||||
/// <summary>
|
||||
/// 设备唯一号
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnDescription = "设备唯一号")]
|
||||
public string DeviceUniqueNo { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 注册时间
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnDescription = "注册时间")]
|
||||
public DateTime RegisterTime { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 最后一次心跳时间
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnDescription = "最后一次心跳时间")]
|
||||
public DateTime LastHeartbeatTime { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 营业点code(可为空)
|
||||
/// </summary>
|
||||
[SugarColumn(IsNullable = true, ColumnDescription = "注册时间")]
|
||||
public string BusinessPlaceCode { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 营业点手工号(可为空)
|
||||
/// </summary>
|
||||
[SugarColumn(IsNullable = true, ColumnDescription = "注册时间")]
|
||||
public string BusinessPlaceCustomCode { get; set; }
|
||||
|
||||
public string TenantId { get; set; }
|
||||
}
|
||||
38
Src/Dlhis.Entity/Device/Entities/DeviceTemplateEntity.cs
Normal file
38
Src/Dlhis.Entity/Device/Entities/DeviceTemplateEntity.cs
Normal file
@@ -0,0 +1,38 @@
|
||||
using Kurisu.Core.DataAccess.Entity;
|
||||
using SqlSugar;
|
||||
|
||||
namespace Dlhis.Entity.Device.Entities;
|
||||
|
||||
/// <summary>
|
||||
/// 设备配置模板
|
||||
/// </summary>
|
||||
[SugarTable(TableName = "DeviceTemplate", TableDescription = "设备配置模板")]
|
||||
public class DeviceTemplateEntity : SugarBaseEntity, ITenantId
|
||||
{
|
||||
/// <summary>
|
||||
/// 模板code
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnDescription = "模板code")]
|
||||
public Guid Code { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 品牌
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnDescription = "品牌")]
|
||||
public string Brand { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 模板名称
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnDescription = "模板名称")]
|
||||
public string Name { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 模板json
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnDescription = "模板json")]
|
||||
public string Template { get; set; }
|
||||
|
||||
|
||||
public string TenantId { get; set; }
|
||||
}
|
||||
42
Src/Dlhis.Entity/Device/Enums/DeviceFuncEnumType.cs
Normal file
42
Src/Dlhis.Entity/Device/Enums/DeviceFuncEnumType.cs
Normal file
@@ -0,0 +1,42 @@
|
||||
using System.ComponentModel;
|
||||
|
||||
namespace Dlhis.Entity.Device.Enums;
|
||||
|
||||
/// <summary>
|
||||
/// 机器设备功能
|
||||
/// </summary>
|
||||
[Description("机器设备功能")]
|
||||
public enum DeviceFuncEnumType
|
||||
{
|
||||
/// <summary>
|
||||
/// 门禁
|
||||
/// </summary>
|
||||
[Description("门禁")]
|
||||
Door = 1,
|
||||
|
||||
/// <summary>
|
||||
/// 就餐
|
||||
/// </summary>
|
||||
[Description("就餐")]
|
||||
Meal,
|
||||
|
||||
/// <summary>
|
||||
/// 人脸
|
||||
/// </summary>
|
||||
[Description("人脸")]
|
||||
Face,
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 刷卡
|
||||
/// </summary>
|
||||
[Description("刷卡")]
|
||||
Card,
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 二维码
|
||||
/// </summary>
|
||||
[Description("二维码")]
|
||||
QrCode,
|
||||
}
|
||||
17
Src/Dlhis.Entity/Dlhis.Entity.csproj
Normal file
17
Src/Dlhis.Entity/Dlhis.Entity.csproj
Normal file
@@ -0,0 +1,17 @@
|
||||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
|
||||
<PropertyGroup>
|
||||
<TargetFramework>net6.0</TargetFramework>
|
||||
<ImplicitUsings>enable</ImplicitUsings>
|
||||
<Nullable>disable</Nullable>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<None Include="..\..\.editorconfig" Link=".editorconfig" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="Kurisu.SqlSugar" Version="0.0.3" />
|
||||
</ItemGroup>
|
||||
|
||||
</Project>
|
||||
@@ -0,0 +1,32 @@
|
||||
using Dlhis.Entity.Permission.Enums;
|
||||
using Kurisu.Core.DataAccess.Entity;
|
||||
using SqlSugar;
|
||||
|
||||
namespace Dlhis.Entity.Permission.Entities;
|
||||
|
||||
/// <summary>
|
||||
/// 设备权限
|
||||
/// </summary>
|
||||
[SugarTable(TableName = "DevicePermission", TableDescription = "设备权限")]
|
||||
public class DevicePermissionEntity : ITenantId
|
||||
{
|
||||
/// <summary>
|
||||
/// 设备权限类型
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnDataType = "varchar(50)", ColumnDescription = "设备权限类型", SqlParameterDbType = typeof(DevicePermissionTypeEnumType))]
|
||||
public DevicePermissionTypeEnumType UniqueType { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 类型值
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnDataType = "varchar(50)", ColumnDescription = "类型值")]
|
||||
public string UniqueValue { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 设备code
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnDataType = "varchar(50)", ColumnDescription = "设备code")]
|
||||
public string Code { get; set; }
|
||||
|
||||
public string TenantId { get; set; }
|
||||
}
|
||||
88
Src/Dlhis.Entity/Permission/Entities/MenuEntity.cs
Normal file
88
Src/Dlhis.Entity/Permission/Entities/MenuEntity.cs
Normal file
@@ -0,0 +1,88 @@
|
||||
using Dlhis.Entity.Permission.Enums;
|
||||
using SqlSugar;
|
||||
using SqlSugar.DbConvert;
|
||||
|
||||
namespace Dlhis.Entity.Permission.Entities;
|
||||
|
||||
/// <summary>
|
||||
/// 菜单
|
||||
/// </summary>
|
||||
[SugarTable(TableName = "Menu", TableDescription = "菜单")]
|
||||
public class MenuEntity : SugarBaseEntity
|
||||
{
|
||||
/// <summary>
|
||||
/// code
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnDescription = "code")]
|
||||
public string Code { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 上级
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnDescription = "上级")]
|
||||
public string PCode { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 标题
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnDescription = "标题")]
|
||||
public string Title { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 名称
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnDescription = "名称")]
|
||||
public string Name { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 图标
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnDescription = "图标")]
|
||||
public string Icon { get; set; }
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 路由地址
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnDescription = "路由地址")]
|
||||
public string Route { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 权限标识
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnDescription = "权限标识")]
|
||||
public string Permission { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 是否为外链
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnDescription = "是否为外链")]
|
||||
public bool IsLink { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 序号
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnDescription = "序号")]
|
||||
public int Sequence { get; set; }
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 是否可见
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnDescription = "是否可见")]
|
||||
public bool Visible { get; set; }
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 菜单类型
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnDataType = "varchar(50)", SqlParameterDbType = typeof(EnumToStringConvert), ColumnDescription = "菜单类型")]
|
||||
public MenuEnumType MenuType { get; set; }
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 平台类型
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnDataType = "varchar(50)", SqlParameterDbType = typeof(EnumToStringConvert), ColumnDescription = "平台类型")]
|
||||
public PlatformEnumType Platform { get; set; }
|
||||
}
|
||||
33
Src/Dlhis.Entity/Permission/Entities/MenuPermissionEntity.cs
Normal file
33
Src/Dlhis.Entity/Permission/Entities/MenuPermissionEntity.cs
Normal file
@@ -0,0 +1,33 @@
|
||||
using Dlhis.Entity.Permission.Enums;
|
||||
using Kurisu.Core.DataAccess.Entity;
|
||||
using SqlSugar;
|
||||
|
||||
namespace Dlhis.Entity.Permission.Entities;
|
||||
|
||||
/// <summary>
|
||||
/// 菜单权限
|
||||
/// </summary>
|
||||
[SugarTable(TableName = "MenuPermission", TableDescription = "菜单权限")]
|
||||
public class MenuPermissionEntity : SugarBaseEntity, ITenantId
|
||||
{
|
||||
/// <summary>
|
||||
/// 权限类型
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnDataType = "varchar(50)", ColumnDescription = "权限类型")]
|
||||
public MenuPermissionTypeEnumType UniqueType { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 类型值
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnDescription = "类型值")]
|
||||
public string UniqueValue { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 菜单code
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnDescription = "菜单code")]
|
||||
public string Code { get; set; }
|
||||
|
||||
|
||||
public string TenantId { get; set; }
|
||||
}
|
||||
@@ -0,0 +1,22 @@
|
||||
using System.ComponentModel;
|
||||
|
||||
namespace Dlhis.Entity.Permission.Enums;
|
||||
|
||||
/// <summary>
|
||||
/// 设备权限类型
|
||||
/// </summary>
|
||||
[Description("设备权限类型")]
|
||||
public enum DevicePermissionTypeEnumType
|
||||
{
|
||||
/// <summary>
|
||||
/// 设备组
|
||||
/// </summary>
|
||||
[Description("设备组")]
|
||||
Group = 1,
|
||||
|
||||
/// <summary>
|
||||
/// 人员
|
||||
/// </summary>
|
||||
[Description("人员")]
|
||||
Person = 2
|
||||
}
|
||||
28
Src/Dlhis.Entity/Permission/Enums/MenuEnumType.cs
Normal file
28
Src/Dlhis.Entity/Permission/Enums/MenuEnumType.cs
Normal file
@@ -0,0 +1,28 @@
|
||||
using System.ComponentModel;
|
||||
|
||||
namespace Dlhis.Entity.Permission.Enums;
|
||||
|
||||
/// <summary>
|
||||
/// 菜单类型
|
||||
/// </summary>
|
||||
[Description("菜单类型")]
|
||||
public enum MenuEnumType
|
||||
{
|
||||
/// <summary>
|
||||
/// 目录
|
||||
/// </summary>
|
||||
[Description("目录")]
|
||||
Folder = 1,
|
||||
|
||||
/// <summary>
|
||||
/// 菜单
|
||||
/// </summary>
|
||||
[Description("菜单")]
|
||||
Menu = 2,
|
||||
|
||||
/// <summary>
|
||||
/// 按钮
|
||||
/// </summary>
|
||||
[Description("按钮")]
|
||||
Button = 3
|
||||
}
|
||||
@@ -0,0 +1,34 @@
|
||||
using System.ComponentModel;
|
||||
|
||||
namespace Dlhis.Entity.Permission.Enums;
|
||||
|
||||
/// <summary>
|
||||
/// 权限类型
|
||||
/// </summary>
|
||||
[Description("权限类型")]
|
||||
public enum MenuPermissionTypeEnumType
|
||||
{
|
||||
/// <summary>
|
||||
/// 用户
|
||||
/// </summary>
|
||||
[Description("用户")]
|
||||
User = 1,
|
||||
|
||||
/// <summary>
|
||||
/// 角色
|
||||
/// </summary>
|
||||
[Description("角色")]
|
||||
Role = 2,
|
||||
|
||||
/// <summary>
|
||||
/// 组别
|
||||
/// </summary>
|
||||
[Description("组别")]
|
||||
Group = 3,
|
||||
|
||||
/// <summary>
|
||||
/// 部门
|
||||
/// </summary>
|
||||
[Description("部门")]
|
||||
Department = 4
|
||||
}
|
||||
22
Src/Dlhis.Entity/Permission/Enums/PlatformEnumType.cs
Normal file
22
Src/Dlhis.Entity/Permission/Enums/PlatformEnumType.cs
Normal file
@@ -0,0 +1,22 @@
|
||||
using System.ComponentModel;
|
||||
|
||||
namespace Dlhis.Entity.Permission.Enums;
|
||||
|
||||
/// <summary>
|
||||
/// 平台类型
|
||||
/// </summary>
|
||||
[Description("平台配型")]
|
||||
public enum PlatformEnumType
|
||||
{
|
||||
/// <summary>
|
||||
/// Admin
|
||||
/// </summary>
|
||||
[Description("PC后台")]
|
||||
PCAdmin = 1,
|
||||
|
||||
/// <summary>
|
||||
/// 用户手机端
|
||||
/// </summary>
|
||||
[Description("用户手机端")]
|
||||
UserMobile = 2,
|
||||
}
|
||||
32
Src/Dlhis.Permission/Dlhis.Permission.csproj
Normal file
32
Src/Dlhis.Permission/Dlhis.Permission.csproj
Normal file
@@ -0,0 +1,32 @@
|
||||
<Project Sdk="Microsoft.NET.Sdk.Web">
|
||||
|
||||
<PropertyGroup>
|
||||
<TargetFramework>net6.0</TargetFramework>
|
||||
<Nullable>enable</Nullable>
|
||||
<ImplicitUsings>enable</ImplicitUsings>
|
||||
<DockerDefaultTargetOS>Linux</DockerDefaultTargetOS>
|
||||
<DockerfileContext>..\..</DockerfileContext>
|
||||
<GenerateDocumentationFile>True</GenerateDocumentationFile>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<Compile Remove="log\**" />
|
||||
<Content Remove="log\**" />
|
||||
<EmbeddedResource Remove="log\**" />
|
||||
<None Remove="log\**" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="Kurisu.AspNetCore" Version="0.4.3" />
|
||||
<PackageReference Include="Microsoft.VisualStudio.Azure.Containers.Tools.Targets" Version="1.19.4" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\Dlhis.Entity\Dlhis.Entity.csproj" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<Folder Include="Menu\" />
|
||||
</ItemGroup>
|
||||
|
||||
</Project>
|
||||
21
Src/Dlhis.Permission/Dockerfile
Normal file
21
Src/Dlhis.Permission/Dockerfile
Normal file
@@ -0,0 +1,21 @@
|
||||
#See https://aka.ms/customizecontainer to learn how to customize your debug container and how Visual Studio uses this Dockerfile to build your images for faster debugging.
|
||||
|
||||
FROM mcr.microsoft.com/dotnet/aspnet:6.0 AS base
|
||||
WORKDIR /app
|
||||
EXPOSE 80
|
||||
|
||||
FROM mcr.microsoft.com/dotnet/sdk:6.0 AS build
|
||||
WORKDIR /src
|
||||
COPY ["Src/Dlhis.Permission/Dlhis.Permission.csproj", "Src/Dlhis.Permission/"]
|
||||
RUN dotnet restore "Src/Dlhis.Permission/Dlhis.Permission.csproj"
|
||||
COPY . .
|
||||
WORKDIR "/src/Src/Dlhis.Permission"
|
||||
RUN dotnet build "Dlhis.Permission.csproj" -c Release -o /app/build
|
||||
|
||||
FROM build AS publish
|
||||
RUN dotnet publish "Dlhis.Permission.csproj" -c Release -o /app/publish /p:UseAppHost=false
|
||||
|
||||
FROM base AS final
|
||||
WORKDIR /app
|
||||
COPY --from=publish /app/publish .
|
||||
ENTRYPOINT ["dotnet", "Dlhis.Permission.dll"]
|
||||
18
Src/Dlhis.Permission/Program.cs
Normal file
18
Src/Dlhis.Permission/Program.cs
Normal file
@@ -0,0 +1,18 @@
|
||||
using Kurisu.AspNetCore.Startup;
|
||||
using Kurisu.Startup;
|
||||
|
||||
class Program
|
||||
{
|
||||
static void Main(string[] args)
|
||||
{
|
||||
KurisuHost.Run<Startup>(true, args);
|
||||
}
|
||||
}
|
||||
|
||||
public class Startup : DefaultStartup
|
||||
{
|
||||
public Startup(IConfiguration configuration) : base(configuration)
|
||||
{
|
||||
|
||||
}
|
||||
}
|
||||
20
Src/Dlhis.Permission/Properties/launchSettings.json
Normal file
20
Src/Dlhis.Permission/Properties/launchSettings.json
Normal file
@@ -0,0 +1,20 @@
|
||||
{
|
||||
"profiles": {
|
||||
"Dlhis.Permission": {
|
||||
"commandName": "Project",
|
||||
"environmentVariables": {
|
||||
"ASPNETCORE_ENVIRONMENT": "Development"
|
||||
},
|
||||
"dotnetRunMessages": true,
|
||||
"applicationUrl": "http://localhost:5003"
|
||||
},
|
||||
"Docker": {
|
||||
"commandName": "Docker",
|
||||
"launchUrl": "{Scheme}://{ServiceHost}:{ServicePort}",
|
||||
"environmentVariables": {
|
||||
"ASPNETCORE_URLS": "http://+:80"
|
||||
},
|
||||
"publishAllPorts": true
|
||||
}
|
||||
}
|
||||
}
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user