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