盘点任务,业务代码调整
This commit is contained in:
@@ -5,7 +5,7 @@ namespace Tnb.WarehouseMgr.Entities.Dto
|
||||
/// <summary>
|
||||
/// 进出库策略状态修改输入参数s
|
||||
/// </summary>
|
||||
public class ModifyPoliciesStatusInput
|
||||
public class ModifyEnabledInput
|
||||
{
|
||||
/// <summary>
|
||||
/// 1、入库 2我、出库
|
||||
@@ -4,6 +4,7 @@ using System.DirectoryServices.Protocols;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using Newtonsoft.Json;
|
||||
using Tnb.WarehouseMgr.Entities.Enums;
|
||||
|
||||
namespace Tnb.WarehouseMgr.Entities.Dto.Queries
|
||||
|
||||
@@ -849,9 +849,9 @@ namespace Tnb.WarehouseMgr
|
||||
/// <param name="input"></param>
|
||||
/// <returns></returns>
|
||||
[HttpPost]
|
||||
public async Task ModifyPoliciesStatus(ModifyPoliciesStatusInput input)
|
||||
public async Task ModifyPoliciesStatus(ModifyEnabledInput input)
|
||||
{
|
||||
async Task _updateStatus<T>(ModifyPoliciesStatusInput input) where T : BaseEntity<string>, IUpdatePoliciesStatus, new()
|
||||
async Task _updateStatus<T>(ModifyEnabledInput input) where T : BaseEntity<string>, IUpdatePoliciesStatus, new()
|
||||
{
|
||||
T obj = new() { status = input.status };
|
||||
_ = await _db.Updateable(obj).UpdateColumns(it => it.status).Where(it => input.ids.Contains(it.id)).ExecuteCommandAsync();
|
||||
|
||||
@@ -7,6 +7,7 @@ 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;
|
||||
|
||||
@@ -19,10 +20,11 @@ namespace Tnb.WarehouseMgr
|
||||
public class WmsBasicDataBase<TEntity> : BaseWareHouseService where TEntity : BaseEntity<string>, IUpdateEnabledEntity, new()
|
||||
{
|
||||
protected ISqlSugarClient DbContext { get; set; }
|
||||
|
||||
[HttpPost]
|
||||
public async Task<bool> IsEnabledMark(IEnumerable<string> ids, int status)
|
||||
public async Task<bool> IsEnabledMark(ModifyEnabledInput input)
|
||||
{
|
||||
return await DbContext.Updateable<TEntity>().SetColumns(it => it.enabled == status).ExecuteCommandHasChangeAsync();
|
||||
return await DbContext.Updateable<TEntity>().SetColumns(it => it.enabled == input.status).Where(it => input.ids.Contains(it.id)).ExecuteCommandHasChangeAsync();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -332,8 +332,8 @@ namespace Tnb.WarehouseMgr
|
||||
/// <br/>}
|
||||
/// </param>
|
||||
/// <returns></returns>
|
||||
[HttpGet]
|
||||
public async Task<dynamic> GetTaskDetailByCheckType([FromQuery] CheckDetailQuery input)
|
||||
[HttpPost]
|
||||
public async Task<dynamic> GetTaskDetailByCheckType(CheckDetailQuery input)
|
||||
{
|
||||
if (_carryMap.Count == 0)
|
||||
{
|
||||
@@ -342,24 +342,25 @@ namespace Tnb.WarehouseMgr
|
||||
|
||||
Expression<Func<BasLocation, WmsCarryCode, WmsCarryH, bool>> filterExp = (a, b, c) => false;
|
||||
|
||||
Expression<Func<BasLocation, WmsCarryCode, WmsCarryH, bool>> defaultFilterExp = (a, b, c) => a.wh_id == input.warehouse_id
|
||||
&& a.is_type == ((int)EnumLocationType.存储库位).ToString()
|
||||
&& c.is_lock == 0;
|
||||
|
||||
var filerExpable = Expressionable.Create<BasLocation, WmsCarryCode, WmsCarryH>()
|
||||
.And((a, b, c) => a.wh_id == input.warehouse_id)
|
||||
.And((a, b, c) => a.is_type == ((int)EnumLocationType.存储库位).ToString())
|
||||
.And((a, b, c) => c.is_lock == 0);
|
||||
|
||||
|
||||
switch (input.CheckType)
|
||||
{
|
||||
case EnumCheckType.全库盘点:
|
||||
{
|
||||
filterExp = (a, b, c) => a.wh_id == input.warehouse_id
|
||||
&& a.is_type == ((int)EnumLocationType.存储库位).ToString()
|
||||
&& c.is_lock == 0;
|
||||
filterExp = filerExpable.ToExpression();
|
||||
}
|
||||
break;
|
||||
case EnumCheckType.物料盘点:
|
||||
{
|
||||
if (!input.material_id.IsNullOrWhiteSpace())
|
||||
{
|
||||
filterExp = defaultFilterExp.And((a, b, c) => b.material_id == input.material_id);
|
||||
filterExp = filerExpable.And((a, b, c) => b.material_id == input.material_id).ToExpression();
|
||||
}
|
||||
}
|
||||
break;
|
||||
@@ -367,7 +368,7 @@ namespace Tnb.WarehouseMgr
|
||||
{
|
||||
if (input.regionIds?.Count > 0)
|
||||
{
|
||||
filterExp = defaultFilterExp.And((a, b, c) => input.regionIds.Contains(a.region_id));
|
||||
filterExp = filerExpable.And((a, b, c) => input.regionIds.Contains(a.region_id)).ToExpression();
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
||||
Reference in New Issue
Block a user