73 lines
2.2 KiB
C#
73 lines
2.2 KiB
C#
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);
|
|
}
|
|
}
|