Merge branch 'development' of https://git.dlhis.com/liguoyang/jinko.yikatong into development
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
using Dlhis.Basic.BusinessPlace.Request;
|
||||
using Dlhis.Basic.Places.Request;
|
||||
using Dlhis.Basic.BusinessPlace.Response;
|
||||
using Dlhis.Basic.BusinessShift.Request;
|
||||
using Dlhis.Basic.BusinessShift.Response;
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
using Dlhis.Basic.BusinessPlace.Request;
|
||||
using Dlhis.Basic.Places.Request;
|
||||
using Dlhis.Basic.BusinessPlace.Response;
|
||||
using Dlhis.Basic.BusinessShift.Request;
|
||||
using Dlhis.Basic.BusinessShift.Response;
|
||||
|
||||
@@ -1,47 +0,0 @@
|
||||
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 BookingAddresController : ControllerBase
|
||||
{
|
||||
private readonly IBookingAddresService _bookingAddresService;
|
||||
|
||||
public BookingAddresController(IBookingAddresService bookingAddresService)
|
||||
{
|
||||
_bookingAddresService = bookingAddresService;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 地址分页
|
||||
/// </summary>
|
||||
/// <param name="request"></param>
|
||||
/// <returns></returns>
|
||||
[HttpGet("pageAddres")]
|
||||
public async Task<Pagination<GetAddresPageResponse>> GetAddresPageAsync([FromQuery] GetAddresPageRequest request)
|
||||
{
|
||||
return await _bookingAddresService.GetAddresPageRequest(request);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 地址保存
|
||||
/// </summary>
|
||||
/// <param name="request"></param>
|
||||
/// <returns></returns>
|
||||
[HttpPost("saveAddres")]
|
||||
public async Task SaveAddresAsync(SaveAddresRequest request)
|
||||
{
|
||||
await _bookingAddresService.SaveAddresAsync(request);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,8 +0,0 @@
|
||||
using Kurisu.Core.DataAccess.Dto;
|
||||
|
||||
namespace Dlhis.Basic.MealUser.Request
|
||||
{
|
||||
public class GetAddresPageRequest : PageDto
|
||||
{
|
||||
}
|
||||
}
|
||||
@@ -1,16 +0,0 @@
|
||||
using SqlSugar;
|
||||
|
||||
namespace Dlhis.Basic.MealUser.Request
|
||||
{
|
||||
public class SaveAddresRequest
|
||||
{
|
||||
|
||||
public long? Id { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 订餐地址
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnDescription = "订餐地址")]
|
||||
public string Addres { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -1,15 +0,0 @@
|
||||
using SqlSugar;
|
||||
|
||||
namespace Dlhis.Basic.MealUser.Response
|
||||
{
|
||||
public class GetAddresPageResponse
|
||||
{
|
||||
public long Id { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 订餐地址
|
||||
/// </summary>
|
||||
public string Addres { get; set; }
|
||||
|
||||
}
|
||||
}
|
||||
@@ -1,12 +0,0 @@
|
||||
using Dlhis.Basic.MealUser.Request;
|
||||
using Dlhis.Basic.MealUser.Response;
|
||||
using Kurisu.Core.DataAccess.Dto;
|
||||
|
||||
namespace Dlhis.Basic.MealUser.Services
|
||||
{
|
||||
public interface IBookingAddresService : IScopeDependency
|
||||
{
|
||||
Task<Pagination<GetAddresPageResponse>> GetAddresPageRequest(GetAddresPageRequest request);
|
||||
Task SaveAddresAsync(SaveAddresRequest request);
|
||||
}
|
||||
}
|
||||
@@ -1,47 +0,0 @@
|
||||
using Dlhis.Basic.MealUser.Request;
|
||||
using Dlhis.Basic.MealUser.Response;
|
||||
using Dlhis.Entity.Basic.Entity;
|
||||
using Kurisu.AspNetCore.Utils.Extensions;
|
||||
using Kurisu.Core.DataAccess.Dto;
|
||||
using Kurisu.SqlSugar.Extensions;
|
||||
using Kurisu.SqlSugar.Services;
|
||||
using Mapster;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
|
||||
namespace Dlhis.Basic.MealUser.Services.Implements
|
||||
{
|
||||
public class BookingAddresService : IBookingAddresService
|
||||
{
|
||||
private readonly IDbContext _dbContext;
|
||||
|
||||
public BookingAddresService(IDbContext dbContext)
|
||||
{
|
||||
_dbContext = dbContext;
|
||||
}
|
||||
|
||||
public async Task<Pagination<GetAddresPageResponse>> GetAddresPageRequest(GetAddresPageRequest request)
|
||||
{
|
||||
return await _dbContext.Queryable<BookingAddresEntity>()
|
||||
.WhereIF(request.Search.IsPresent(),x=>x.Addres.Contains(request.Search))
|
||||
.Select<GetAddresPageResponse>()
|
||||
.ToPageListAsync(request);
|
||||
}
|
||||
|
||||
public async Task SaveAddresAsync(SaveAddresRequest request)
|
||||
{
|
||||
if (!request.Id.HasValue)
|
||||
{
|
||||
var entity = request.Adapt<BookingAddresEntity>();
|
||||
await _dbContext.InsertAsync(entity);
|
||||
}
|
||||
else
|
||||
{
|
||||
var entity = await _dbContext.Queryable<BookingAddresEntity>()
|
||||
.Where(x => x.Id == request.Id)
|
||||
.FirstAsync();
|
||||
request.Adapt(entity);
|
||||
await _dbContext.UpdateAsync(entity);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,46 @@
|
||||
using Dlhis.Basic.Places.Request;
|
||||
using Dlhis.Basic.Places.Response;
|
||||
using Dlhis.Basic.Places.Services;
|
||||
using Kurisu.Core.DataAccess.Dto;
|
||||
using Microsoft.AspNetCore.Authorization;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
|
||||
namespace Dlhis.Basic.Places.Controllers;
|
||||
|
||||
/// <summary>
|
||||
/// 订餐地址
|
||||
/// </summary>
|
||||
[Authorize]
|
||||
[Route("api/[controller]")]
|
||||
[ApiController]
|
||||
public class BookingAddressController : ControllerBase
|
||||
{
|
||||
private readonly IBookingAddressService _bookingAddresService;
|
||||
|
||||
public BookingAddressController(IBookingAddressService bookingAddresService)
|
||||
{
|
||||
_bookingAddresService = bookingAddresService;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 地址分页
|
||||
/// </summary>
|
||||
/// <param name="request"></param>
|
||||
/// <returns></returns>
|
||||
[HttpGet("page")]
|
||||
public async Task<Pagination<BookingAddressPageResponse>> GetAddresPageAsync([FromQuery] BookingAddressPageRequest request)
|
||||
{
|
||||
return await _bookingAddresService.GetAddressPageAsync(request);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 地址保存
|
||||
/// </summary>
|
||||
/// <param name="request"></param>
|
||||
/// <returns></returns>
|
||||
[HttpPost("save")]
|
||||
public async Task SaveAddresAsync(BookingAddressSaveRequest request)
|
||||
{
|
||||
await _bookingAddresService.SaveAddressAsync(request);
|
||||
}
|
||||
}
|
||||
@@ -1,4 +1,4 @@
|
||||
using Dlhis.Basic.BusinessPlace.Request;
|
||||
using Dlhis.Basic.Places.Request;
|
||||
using Dlhis.Basic.BusinessPlace.Response;
|
||||
using Dlhis.Basic.BusinessPlace.Services;
|
||||
using Kurisu.Core.DataAccess.Dto;
|
||||
@@ -52,7 +52,7 @@ public class BusinessPlacePermissionsController
|
||||
/// <returns></returns>
|
||||
[Authorize(Roles = "admin,tenant-admin")]
|
||||
[HttpPost("save")]
|
||||
public async Task SaveBusinessPlacePermissionAsync(SaveBusinessPlacePermissionRequest request)
|
||||
public async Task SaveBusinessPlacePermissionAsync(BusinessPlacePermissionSaveRequest request)
|
||||
{
|
||||
await _businessPlacePermissionsService.SaveBusinessPlacePermissionAsync(request);
|
||||
}
|
||||
@@ -1,4 +1,4 @@
|
||||
using Dlhis.Basic.BusinessPlace.Request;
|
||||
using Dlhis.Basic.Places.Request;
|
||||
using Dlhis.Basic.BusinessPlace.Response;
|
||||
using Dlhis.Basic.BusinessPlace.Services;
|
||||
using Dlhis.Basic.BusinessShift.Services;
|
||||
@@ -0,0 +1,9 @@
|
||||
|
||||
|
||||
using Kurisu.Core.DataAccess.Dto;
|
||||
|
||||
namespace Dlhis.Basic.Places.Request;
|
||||
|
||||
public class BookingAddressPageRequest : PageDto
|
||||
{
|
||||
}
|
||||
11
Src/Dlhis.Basic/Places/Request/BookingAddressSaveRequest.cs
Normal file
11
Src/Dlhis.Basic/Places/Request/BookingAddressSaveRequest.cs
Normal file
@@ -0,0 +1,11 @@
|
||||
namespace Dlhis.Basic.Places.Request;
|
||||
|
||||
public class BookingAddressSaveRequest
|
||||
{
|
||||
public long? Id { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 订餐地址
|
||||
/// </summary>
|
||||
public string Address { get; set; }
|
||||
}
|
||||
@@ -1,7 +1,7 @@
|
||||
using Kurisu.Core.DataAccess.Dto;
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
|
||||
namespace Dlhis.Basic.BusinessPlace.Request
|
||||
namespace Dlhis.Basic.Places.Request
|
||||
{
|
||||
public class BusinessPlaceGetByCodeRequest : PageDto
|
||||
{
|
||||
@@ -1,6 +1,6 @@
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
|
||||
namespace Dlhis.Basic.BusinessPlace.Request;
|
||||
namespace Dlhis.Basic.Places.Request;
|
||||
|
||||
public class BusinessPlaceGetShiftsRequest
|
||||
{
|
||||
@@ -2,7 +2,7 @@
|
||||
using Dlhis.Entity.Canteen.Enums;
|
||||
using Kurisu.Core.DataAccess.Dto;
|
||||
|
||||
namespace Dlhis.Basic.BusinessPlace.Request;
|
||||
namespace Dlhis.Basic.Places.Request;
|
||||
|
||||
public class BusinessPlacePageRequest : PageDto
|
||||
{
|
||||
@@ -1,6 +1,6 @@
|
||||
using Kurisu.Core.DataAccess.Dto;
|
||||
|
||||
namespace Dlhis.Basic.BusinessPlace.Request;
|
||||
namespace Dlhis.Basic.Places.Request;
|
||||
|
||||
public class BusinessPlacePermissionPageRequest : PageDto
|
||||
{
|
||||
@@ -1,8 +1,6 @@
|
||||
using SqlSugar;
|
||||
namespace Dlhis.Basic.Places.Request;
|
||||
|
||||
namespace Dlhis.Basic.BusinessPlace.Request;
|
||||
|
||||
public class SaveBusinessPlacePermissionRequest
|
||||
public class BusinessPlacePermissionSaveRequest
|
||||
{
|
||||
public long? Id { get; set; }
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using Dlhis.Entity.Canteen.Enums;
|
||||
|
||||
namespace Dlhis.Basic.BusinessPlace.Request;
|
||||
namespace Dlhis.Basic.Places.Request;
|
||||
|
||||
/// <summary>
|
||||
/// 营业点保存参数
|
||||
@@ -1,4 +1,4 @@
|
||||
namespace Dlhis.Basic.BusinessPlace.Request;
|
||||
namespace Dlhis.Basic.Places.Request;
|
||||
|
||||
public class BusinessPlaceSaveShiftRequest
|
||||
{
|
||||
@@ -1,4 +1,4 @@
|
||||
namespace Dlhis.Basic.BusinessPlace.Request
|
||||
namespace Dlhis.Basic.Places.Request
|
||||
{
|
||||
public class DispositionDeviceRequest
|
||||
{
|
||||
@@ -0,0 +1,11 @@
|
||||
namespace Dlhis.Basic.Places.Response;
|
||||
|
||||
public class BookingAddressPageResponse
|
||||
{
|
||||
public long Id { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 订餐地址
|
||||
/// </summary>
|
||||
public string Address { get; set; }
|
||||
}
|
||||
12
Src/Dlhis.Basic/Places/Services/IBookingAddressService.cs
Normal file
12
Src/Dlhis.Basic/Places/Services/IBookingAddressService.cs
Normal file
@@ -0,0 +1,12 @@
|
||||
using Dlhis.Basic.Places.Request;
|
||||
using Dlhis.Basic.Places.Response;
|
||||
using Kurisu.Core.DataAccess.Dto;
|
||||
|
||||
namespace Dlhis.Basic.Places.Services;
|
||||
|
||||
public interface IBookingAddressService : IScopeDependency
|
||||
{
|
||||
Task<Pagination<BookingAddressPageResponse>> GetAddressPageAsync(BookingAddressPageRequest request);
|
||||
|
||||
Task SaveAddressAsync(BookingAddressSaveRequest request);
|
||||
}
|
||||
@@ -1,4 +1,4 @@
|
||||
using Dlhis.Basic.BusinessPlace.Request;
|
||||
using Dlhis.Basic.Places.Request;
|
||||
using Dlhis.Basic.BusinessPlace.Response;
|
||||
using Kurisu.Core.DataAccess.Dto;
|
||||
|
||||
@@ -8,7 +8,7 @@ public interface IBusinessPlacePermissionsService : IScopeDependency
|
||||
{
|
||||
Task<Pagination<BusinessPlacePermissionPageResponse>> GetPageAsync(BusinessPlacePermissionPageRequest request);
|
||||
|
||||
Task SaveBusinessPlacePermissionAsync(SaveBusinessPlacePermissionRequest request);
|
||||
Task SaveBusinessPlacePermissionAsync(BusinessPlacePermissionSaveRequest request);
|
||||
|
||||
Task<GetMyResponse> GetMyAsync();
|
||||
}
|
||||
@@ -1,4 +1,4 @@
|
||||
using Dlhis.Basic.BusinessPlace.Request;
|
||||
using Dlhis.Basic.Places.Request;
|
||||
using Dlhis.Basic.BusinessPlace.Response;
|
||||
using Kurisu.Core.DataAccess.Dto;
|
||||
|
||||
@@ -0,0 +1,45 @@
|
||||
using Dlhis.Basic.Places.Request;
|
||||
using Dlhis.Basic.Places.Response;
|
||||
using Dlhis.Entity.Basic.Entity;
|
||||
using Kurisu.AspNetCore.Utils.Extensions;
|
||||
using Kurisu.Core.DataAccess.Dto;
|
||||
using Kurisu.SqlSugar.Extensions;
|
||||
using Kurisu.SqlSugar.Services;
|
||||
using Mapster;
|
||||
|
||||
namespace Dlhis.Basic.Places.Services.Implements;
|
||||
|
||||
public class BookingAddressService : IBookingAddressService
|
||||
{
|
||||
private readonly IDbContext _dbContext;
|
||||
|
||||
public BookingAddressService(IDbContext dbContext)
|
||||
{
|
||||
_dbContext = dbContext;
|
||||
}
|
||||
|
||||
public async Task<Pagination<BookingAddressPageResponse>> GetAddressPageAsync(BookingAddressPageRequest request)
|
||||
{
|
||||
return await _dbContext.Queryable<BookingAddressEntity>()
|
||||
.WhereIF(request.Search.IsPresent(), x => x.Address.Contains(request.Search))
|
||||
.Select<BookingAddressPageResponse>()
|
||||
.ToPageListAsync(request);
|
||||
}
|
||||
|
||||
public async Task SaveAddressAsync(BookingAddressSaveRequest request)
|
||||
{
|
||||
if (!request.Id.HasValue)
|
||||
{
|
||||
var entity = request.Adapt<BookingAddressEntity>();
|
||||
await _dbContext.InsertAsync(entity);
|
||||
}
|
||||
else
|
||||
{
|
||||
var entity = await _dbContext.Queryable<BookingAddressEntity>()
|
||||
.Where(x => x.Id == request.Id)
|
||||
.FirstAsync();
|
||||
request.Adapt(entity);
|
||||
await _dbContext.UpdateAsync(entity);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,4 +1,4 @@
|
||||
using Dlhis.Basic.BusinessPlace.Request;
|
||||
using Dlhis.Basic.Places.Request;
|
||||
using Dlhis.Basic.BusinessPlace.Response;
|
||||
using Dlhis.Entity.Basic.Entity;
|
||||
using Kurisu.Core.DataAccess.Dto;
|
||||
@@ -45,7 +45,7 @@ public class BusinessPlacePermissionsService : IBusinessPlacePermissionsService
|
||||
return myResponse;
|
||||
}
|
||||
|
||||
public async Task SaveBusinessPlacePermissionAsync(SaveBusinessPlacePermissionRequest request)
|
||||
public async Task SaveBusinessPlacePermissionAsync(BusinessPlacePermissionSaveRequest request)
|
||||
{
|
||||
var userId = _currentUser.GetIntSubjectId();
|
||||
if (request.Id.HasValue)
|
||||
@@ -1,4 +1,4 @@
|
||||
using Dlhis.Basic.BusinessPlace.Request;
|
||||
using Dlhis.Basic.Places.Request;
|
||||
using Dlhis.Basic.BusinessPlace.Response;
|
||||
using Dlhis.Entity.Basic.Entity;
|
||||
using Dlhis.Entity.Canteen.Enums;
|
||||
@@ -36,6 +36,11 @@ public class BookingMealRequest : IValidatableObject
|
||||
[EnumDataType(typeof(BalanceRecordSourceEnumType))]
|
||||
public BalanceRecordSourceEnumType Source { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 配送地址
|
||||
/// </summary>
|
||||
[Required]
|
||||
public string DeliveryAddress { get; set; }
|
||||
|
||||
public IEnumerable<ValidationResult> Validate(ValidationContext validationContext)
|
||||
{
|
||||
|
||||
@@ -102,6 +102,7 @@ public class OrderService : IOrderService
|
||||
CostId = gainfo.CostId,
|
||||
DepartmentNo = gainfo.DepartmentNo,
|
||||
DeviceUniqueNo = string.Empty,
|
||||
DeliveryAddress = request.DeliveryAddress,
|
||||
|
||||
No = SnowFlakeHelper.Instance.NextId().ToString(),
|
||||
SubsidiesFromMonth = now.ToString("yyyyMM"),
|
||||
|
||||
@@ -1,28 +0,0 @@
|
||||
using Kurisu.Core.DataAccess.Entity;
|
||||
using Kurisu.SqlSugar;
|
||||
using SqlSugar;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace Dlhis.Entity.Basic.Entity
|
||||
{
|
||||
/// <summary>
|
||||
/// 就餐地址
|
||||
/// </summary>
|
||||
[SugarTable(TableName = "BookingAddres", TableDescription = "就餐地址")]
|
||||
public class BookingAddresEntity : SugarBaseEntity, ITenantId
|
||||
{
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 订餐地址
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnDescription = "订餐地址")]
|
||||
public string Addres { get; set; }
|
||||
|
||||
public string TenantId { get; set; }
|
||||
}
|
||||
}
|
||||
20
Src/Dlhis.Entity/Basic/Entity/BookingAddressEntity.cs
Normal file
20
Src/Dlhis.Entity/Basic/Entity/BookingAddressEntity.cs
Normal file
@@ -0,0 +1,20 @@
|
||||
using Kurisu.Core.DataAccess.Entity;
|
||||
using Kurisu.SqlSugar;
|
||||
using SqlSugar;
|
||||
|
||||
namespace Dlhis.Entity.Basic.Entity;
|
||||
|
||||
/// <summary>
|
||||
/// 就餐地址
|
||||
/// </summary>
|
||||
[SugarTable(TableName = "BookingAddress", TableDescription = "就餐地址")]
|
||||
public class BookingAddressEntity : SugarBaseEntity, ITenantId
|
||||
{
|
||||
/// <summary>
|
||||
/// 订餐地址
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnDescription = "订餐地址")]
|
||||
public string Address { get; set; }
|
||||
|
||||
public string TenantId { get; set; }
|
||||
}
|
||||
@@ -34,6 +34,12 @@ public class CanteenOrderEntity : BalanceRecordEntity
|
||||
[SugarColumn(ColumnDataType = "bit", ColumnDescription = "请求json")]
|
||||
public bool IsOffline { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 配送地址
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnDescription = "配送地址")]
|
||||
public string DeliveryAddress { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 处理结果
|
||||
/// </summary>
|
||||
|
||||
Reference in New Issue
Block a user