wms基础数据基类改为基础配置基类,同时增加不同业务的启用、禁用功能
This commit is contained in:
40
WarehouseMgr/Tnb.WarehouseMgr/WmsBasicConfBase`1.cs
Normal file
40
WarehouseMgr/Tnb.WarehouseMgr/WmsBasicConfBase`1.cs
Normal file
@@ -0,0 +1,40 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using Aop.Api.Domain;
|
||||
using JNPF.Common.Contracts;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
using SqlSugar;
|
||||
using Tnb.WarehouseMgr.Entities.Dto;
|
||||
using Tnb.WarehouseMgr.Entities.Entity.Constraints;
|
||||
using Tnb.WarehouseMgr.Interfaces;
|
||||
|
||||
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();
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user