wms基础数据基类改为基础配置基类,同时增加不同业务的启用、禁用功能

This commit is contained in:
yang.lee
2023-11-17 10:06:17 +08:00
parent 4689be2ed1
commit ba9b905a06
9 changed files with 80 additions and 13 deletions

View 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();
}
}
}