Files
tnb.server/WarehouseMgr/Tnb.WarehouseMgr/WmsBasicConfBase`1.cs
2023-11-20 11:51:13 +08:00

34 lines
1.2 KiB
C#
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
using JNPF.Common.Contracts;
using Microsoft.AspNetCore.Mvc;
using SqlSugar;
using Tnb.WarehouseMgr.Entities.Dto;
using Tnb.WarehouseMgr.Entities.Entity.Constraints;
namespace Tnb.WarehouseMgr
{
/// <summary>
/// Wms基础数据基类
/// </summary>
/// <typeparam name="TEntity"></typeparam>
public class WmsBasicConfBase<TEntity> : BaseWareHouseService where TEntity : BaseEntity<string>, IUpdateEnabledEntity, new()
{
protected ISqlSugarClient DbContext { get; set; }
/// <summary>
/// 是否启用
/// </summary>
/// <param name="input">
/// <br/>{
/// <br/> strategyType入库策略 1、入库 2我、出库(出入库策略参数,其它接口可忽略)
/// <br/> ids:选中的主键pkId列表
/// <br/> status:状态 0:禁用 1启用
/// <br/>}
/// </param>
/// <returns></returns>
[HttpPost]
public async Task<bool> IsEnabledMark(ModifyEnabledInput input)
{
return await DbContext.Updateable<TEntity>().SetColumns(it => it.enabled == input.status).Where(it => input.ids.Contains(it.id)).ExecuteCommandHasChangeAsync();
}
}
}