34 lines
1.2 KiB
C#
34 lines
1.2 KiB
C#
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();
|
||
}
|
||
}
|
||
}
|