ctu存放
This commit is contained in:
@@ -13,6 +13,7 @@ using JNPF.Common.Security;
|
||||
using JNPF.FriendlyException;
|
||||
using JNPF.Systems.Interfaces.System;
|
||||
using Mapster;
|
||||
using Microsoft.AspNetCore.Authorization;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
using Microsoft.AspNetCore.Mvc.Rendering;
|
||||
using Microsoft.CodeAnalysis;
|
||||
@@ -241,37 +242,31 @@ namespace Tnb.WarehouseMgr
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
[HttpPost]
|
||||
[AllowAnonymous]
|
||||
public async Task CheckPut(CheckPutInput input)
|
||||
{
|
||||
Dictionary<string, string[]> putdic = new Dictionary<string, string[]>();
|
||||
putdic.Add("SSX-021-005", new string[] { "CS05", "ConveyorAllowPutEmptyBox" });
|
||||
putdic.Add("SSX-021-006", new string[] { "CS06", "ConveyorAllowPutEmptyBox" });
|
||||
Dictionary<string, string[]> getdic = new Dictionary<string, string[]>();
|
||||
getdic.Add("SSX-021-005", new string[] { "CS05", "FullBoxAllowGet" });
|
||||
getdic.Add("SSX-021-006", new string[] { "CS06", "FullBoxAllowGet" });
|
||||
// Dictionary<string, string[]> getdic = new Dictionary<string, string[]>();
|
||||
// getdic.Add("SSX-021-005", new string[] { "CS05", "FullBoxAllowGet" });
|
||||
// getdic.Add("SSX-021-006", new string[] { "CS06", "FullBoxAllowGet" });
|
||||
var strs = new string[] { };
|
||||
if (input.type == (int)exectype.放)
|
||||
{
|
||||
if (!putdic.ContainsKey(input.point_code))
|
||||
throw new AppFriendlyException("点位" + input.point_code + "不存在", 500);
|
||||
strs = putdic.Where(p => p.Key == input.point_code).First().Value;
|
||||
}
|
||||
else if (input.type == (int)exectype.取)
|
||||
{
|
||||
if (!getdic.ContainsKey(input.point_code))
|
||||
throw new AppFriendlyException("点位" + input.point_code + "不存在", 500);
|
||||
strs = getdic.Where(p => p.Key == input.point_code).First().Value;
|
||||
}
|
||||
|
||||
if (!putdic.ContainsKey(input.targetName))
|
||||
throw new AppFriendlyException("点位" + input.targetName + "不存在", 500);
|
||||
strs = putdic.Where(p => p.Key == input.targetName).First().Value;
|
||||
|
||||
bool flag = await _redisData.HashExist(strs[0], strs[1]);
|
||||
if (!flag)
|
||||
{
|
||||
throw new AppFriendlyException("点位" + input.point_code + "不存在", 500);
|
||||
throw new AppFriendlyException("点位" + input.targetName + "不存在", 500);
|
||||
}
|
||||
string data = await _redisData.GetHash(strs[0], strs[1]);
|
||||
JObject? res = JsonConvert.DeserializeObject<JObject>(data);
|
||||
bool result = res != null && res["Value"] != null ? res.Value<bool>("Value") : false;
|
||||
if (!result)
|
||||
throw new AppFriendlyException("点位" + input.point_code + "不可放", 500);
|
||||
throw new AppFriendlyException("点位" + input.targetName + "不可放", 500);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
||||
Reference in New Issue
Block a user