fix 表增加ITenantid
This commit is contained in:
@@ -4,9 +4,5 @@ namespace Dlhis.Canteen.Order.Request
|
||||
{
|
||||
public class GetMiniProgramOrderRequest : PageDto
|
||||
{
|
||||
/// <summary>
|
||||
/// 用餐日期
|
||||
/// </summary>
|
||||
public DateOnly? SysDate { get; set; }
|
||||
}
|
||||
}
|
||||
|
||||
@@ -15,7 +15,7 @@ namespace Dlhis.Canteen.Order.Response
|
||||
/// <summary>
|
||||
/// 营业日
|
||||
/// </summary>
|
||||
public DateOnly BusinessDate { get; set; }
|
||||
public DateOnly SysDate { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 餐次
|
||||
|
||||
@@ -1,13 +1,10 @@
|
||||
using Dlhis.Entity.Canteen.Enums;
|
||||
using SqlSugar.DbConvert;
|
||||
using SqlSugar;
|
||||
using Kurisu.AspNetCore.Utils.Extensions;
|
||||
|
||||
namespace Dlhis.Canteen.Order.Response
|
||||
{
|
||||
public class GetDishesResponse
|
||||
{
|
||||
|
||||
/// <summary>
|
||||
/// 大类
|
||||
/// </summary>
|
||||
@@ -53,7 +50,6 @@ namespace Dlhis.Canteen.Order.Response
|
||||
/// </summary>
|
||||
public string Unit { get; set; }
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 图片
|
||||
/// </summary>
|
||||
@@ -63,5 +59,10 @@ namespace Dlhis.Canteen.Order.Response
|
||||
/// 是否启用
|
||||
/// </summary>
|
||||
public bool Enable { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 限售份数
|
||||
/// </summary>
|
||||
public int? RestrictedNum { get; set; } = null;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -32,7 +32,6 @@ namespace Dlhis.Canteen.Order.Services.Implements
|
||||
.Select((x,place) => new GetMenuResponse
|
||||
{
|
||||
ShiftTypesSrt = x.ShiftTypes.ToString(),
|
||||
//ShiftTypesSrt = string.Join(", ", x.ShiftTypes.Select(enumValue => enumValue.GetDescription())),
|
||||
PlaceName = place.Name,
|
||||
},true)
|
||||
.ToPageListAsync(request);
|
||||
@@ -70,14 +69,24 @@ namespace Dlhis.Canteen.Order.Services.Implements
|
||||
}
|
||||
else
|
||||
{
|
||||
var disCodes = await _dbContext.Queryable<CanteenMenuDishersRelationshipEntity>()
|
||||
var relas = await _dbContext.Queryable<CanteenMenuDishersRelationshipEntity>()
|
||||
.Where(x => x.MenuCode == request.MenuCode)
|
||||
.Select(x => x.DishersCode)
|
||||
.ToListAsync();
|
||||
return await _dbContext.Queryable<CanteenDishesEntity>()
|
||||
.Where(x => disCodes.Contains(x.Code))
|
||||
|
||||
var disCodes = relas.Select(x => x.DishersCode).ToList();
|
||||
|
||||
var page = await _dbContext.Queryable<CanteenDishesEntity>()
|
||||
.Where(discher => disCodes.Contains(discher.Code))
|
||||
.Select<GetDishesResponse>()
|
||||
.ToPageListAsync(request);
|
||||
|
||||
foreach (var res in page.Data)
|
||||
{
|
||||
res.RestrictedNum = relas.Where(x => x.DishersCode == res.Code)
|
||||
.Select(x => x.RestrictedNum)
|
||||
.FirstOrDefault();
|
||||
}
|
||||
return page;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -31,7 +31,6 @@ public class MiniProgramOrderDetailService : IMiniProgramOrderDetailService
|
||||
.LeftJoin<CanteenDishesEntity>((order, place,dishers) => order.DishesCode == dishers.Code)
|
||||
.LeftJoin<DepartmentEntity>((order, place, dishers,depart) => order.DepartmentNo == depart.No)
|
||||
.WhereIF(!request.Search.IsEmpty(), order => order.Name == request.Search || order.Code == request.Search)
|
||||
.WhereIF(request.SysDate.HasValue,order=>order.SysDate == request.SysDate)
|
||||
.OrderBy(order => order.CostDate,SqlSugar.OrderByType.Desc)
|
||||
.Select((order, place, dishers, depart) => new GetMiniProgramOrderResponse
|
||||
{
|
||||
@@ -113,7 +112,7 @@ public class MiniProgramOrderDetailService : IMiniProgramOrderDetailService
|
||||
flag.ThrowIfTrue($"工号:{request.UserCode} 姓名:{gainfo.Name} 已经定过{tomorrow}的{request.ShiftType.GetDescription()}!");
|
||||
|
||||
//支付方式
|
||||
/* var result = await _tenantApi.GetTenantTreeAsync();
|
||||
var result = await _tenantApi.GetTenantTreeAsync();
|
||||
var tree = result.Data;
|
||||
var shanxi = tree.Where(x => x.Name == "山西基地").FirstOrDefault();
|
||||
var codes = shanxi.Next.Select(x => x.Code).ToList();
|
||||
@@ -123,7 +122,7 @@ public class MiniProgramOrderDetailService : IMiniProgramOrderDetailService
|
||||
{
|
||||
true.ThrowIfTrue($"非山西,支付方式不能为{request.PayType.GetDescription()}");
|
||||
}
|
||||
}*/
|
||||
}
|
||||
|
||||
//生成订单
|
||||
var order = new MiniProgramOrderEntity
|
||||
|
||||
@@ -7,7 +7,8 @@
|
||||
},
|
||||
"InternalRequest": {
|
||||
"CommonRequestUrl": "http://localhost:5001",
|
||||
"BasicRequestUrl": "http://localhost:5002"
|
||||
"BasicRequestUrl": "http://localhost:5002",
|
||||
"SysRequestUrl": "http://localhost:5003"
|
||||
},
|
||||
"SwaggerOptions": {
|
||||
"Enable": true,
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
using Dlhis.Entity.Canteen.Enums;
|
||||
using Kurisu.Core.DataAccess.Entity;
|
||||
using Kurisu.SqlSugar;
|
||||
using SqlSugar;
|
||||
using SqlSugar.DbConvert;
|
||||
@@ -14,7 +15,7 @@ namespace Dlhis.Entity.Canteen.Entities
|
||||
/// 菜品表
|
||||
/// </summary>
|
||||
[SugarTable(TableName = "CanteenDishes", TableDescription = "菜品表")]
|
||||
public class CanteenDishesEntity : SugarBaseEntity
|
||||
public class CanteenDishesEntity : SugarBaseEntity, ITenantId
|
||||
{
|
||||
|
||||
/// <summary>
|
||||
@@ -76,5 +77,7 @@ namespace Dlhis.Entity.Canteen.Entities
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnDataType = "bit", ColumnDescription = "是否启用")]
|
||||
public bool Enable { get; set; }
|
||||
|
||||
public string TenantId { get; set; }
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
using Dlhis.Entity.Canteen.Enums;
|
||||
using Kurisu.Core.DataAccess.Entity;
|
||||
using Kurisu.SqlSugar;
|
||||
using SqlSugar;
|
||||
|
||||
@@ -8,7 +9,7 @@ namespace Dlhis.Entity.Canteen.Entities;
|
||||
/// 菜单表
|
||||
/// </summary>
|
||||
[SugarTable(TableName = "CanteenMenu", TableDescription = "菜单表")]
|
||||
public class CanteenMenuEntity : SugarBaseEntity
|
||||
public class CanteenMenuEntity : SugarBaseEntity, ITenantId
|
||||
{
|
||||
|
||||
/// <summary>
|
||||
@@ -53,6 +54,7 @@ public class CanteenMenuEntity : SugarBaseEntity
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnDataType = "bit", ColumnDescription = "是否启用")]
|
||||
public bool Enable { get; set; }
|
||||
public string TenantId { get; set; }
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
using Dlhis.Entity.Canteen.Enums;
|
||||
using Kurisu.Core.DataAccess.Entity;
|
||||
using Kurisu.SqlSugar;
|
||||
using SqlSugar;
|
||||
using SqlSugar.DbConvert;
|
||||
@@ -9,7 +10,7 @@ namespace Dlhis.Entity.Canteen.Entities
|
||||
/// 小程序订单表
|
||||
/// </summary>
|
||||
[SugarTable(TableName = "MiniProgramOrder", TableDescription = "小程序订单表")]
|
||||
public class MiniProgramOrderEntity : SugarBaseEntity
|
||||
public class MiniProgramOrderEntity : SugarBaseEntity, ITenantId
|
||||
{
|
||||
/// <summary>
|
||||
/// 订单号
|
||||
@@ -118,5 +119,7 @@ namespace Dlhis.Entity.Canteen.Entities
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnDescription = "总金额")]
|
||||
public decimal TotalAmount { get; set; }
|
||||
|
||||
public string TenantId { get; set; }
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
using Dlhis.Entity.Canteen.Enums;
|
||||
using Kurisu.Core.DataAccess.Entity;
|
||||
using Kurisu.SqlSugar;
|
||||
using SqlSugar;
|
||||
using SqlSugar.DbConvert;
|
||||
@@ -9,7 +10,7 @@ namespace Dlhis.Entity.Canteen.Entities
|
||||
/// 订餐明细表
|
||||
/// </summary>
|
||||
[SugarTable(TableName = "OrderDetails", TableDescription = "订餐明细表")]
|
||||
public class OrderDetailsEntity : SugarBaseEntity
|
||||
public class OrderDetailsEntity : SugarBaseEntity, ITenantId
|
||||
{
|
||||
/// <summary>
|
||||
/// 订单号
|
||||
@@ -70,5 +71,7 @@ namespace Dlhis.Entity.Canteen.Entities
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnDataType = "varchar(50)", SqlParameterDbType = typeof(EnumToStringConvert), ColumnDescription = "订单明细状态")]
|
||||
public OrderDetailsStatusEnumType OrderStatus { get; set; }
|
||||
|
||||
public string TenantId { get; set; }
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user