集中供料操作权限

This commit is contained in:
2024-09-30 10:51:07 +08:00
parent 884c23b753
commit c7db2d9afc
4 changed files with 18 additions and 3 deletions

View File

@@ -305,7 +305,7 @@ namespace Tnb.WarehouseMgr
/// <param name="input"></param>
/// <returns></returns>
/// <exception cref="AppFriendlyException"></exception>
[HttpPost, NonUnify, AllowAnonymous]
[HttpPost]
public async Task<Entities.Dto.Outputs.Result> Distribute(MaterialTransferDistributeInput input)
{
try
@@ -365,6 +365,14 @@ namespace Tnb.WarehouseMgr
// 集中供料区三工位
if (wmsMaterialTransfer.warehouse_instock == WmsWareHouseConst.WAREHOUSE_JZGL_ID|| wmsMaterialTransfer.warehouse_instock == WmsWareHouseConst.WAREHOUSE_WBZHHC_ID)
{
// 控制权限 原材料出库到集中供料权限 1.注塑加料工权限 2.注塑领班权限
string[] YCLCKPowerRole = new string[2] { "37184163262485", "37183913754133" };
var power = _db.Queryable<UserEntity>()
.Where(r => r.Id == _userManager.UserId && YCLCKPowerRole.Contains(r.RoleId));
if (power.Count() == 0)
{
throw new AppFriendlyException($@"当前用户:{_userManager.User.RealName} 用户ID:{_userManager.User.Id},没有操作到集中供料仓的转库权限", HttpStatusCode.InternalServerError);
}
// 根据三工位任务数平均分配任务 暂定
endLocations = _db.Queryable<BasLocation>().Where(r => _wareHouseService.GetFloor1GLSGWOutstockLocation().Contains(r.id) && r.is_lock == 0 && r.is_use == "0")
.OrderBy("is_lock, task_nums, location_code").ToList();