bug、提示信息完善

This commit is contained in:
2024-06-18 09:01:28 +08:00
parent a945d5db15
commit a30bcf213d
6 changed files with 77 additions and 21 deletions

View File

@@ -376,7 +376,7 @@ where carry_code = '{coderesult}' and status = '{WmsWareHouseConst.TASK_BILL_STA
{ {
if (db_Scantimer.Queryable<WmsDistaskH>().Where(p => p.carry_id == carry.id && p.status != WmsWareHouseConst.TASK_BILL_STATUS_COMPLE_ID).Any()) if (db_Scantimer.Queryable<WmsDistaskH>().Where(p => p.carry_id == carry.id && p.status != WmsWareHouseConst.TASK_BILL_STATUS_COMPLE_ID).Any())
{ {
Logger.LogInformation($"【ScanInStock】 八工位 {key} 托盘 {carry.id} 对应的执行任务状态(status)不是26126860808229(已完成),此时不能执行入库"); Logger.LogInformation($"【ScanInStock】 八工位 {key} 托盘 {carry.carry_code} 对应的执行任务状态(status)不是26126860808229(已完成),此时不能执行入库");
continue; continue;
} }
@@ -402,6 +402,10 @@ where carry_code = '{coderesult}' and status = '{WmsWareHouseConst.TASK_BILL_STA
input.data.Add("id", null); input.data.Add("id", null);
_wmsPDAScanInStock.ScanInStockByRedis(input).Wait(); _wmsPDAScanInStock.ScanInStockByRedis(input).Wait();
} }
else
{
Logger.LogInformation($"【ScanInStock】 八工位 {key} 托盘 {carry.carry_code} 未绑定物料条码!");
}
} }
} }
} }

View File

@@ -9,6 +9,7 @@ namespace Tnb.WarehouseMgr.Entities.Dto.Inputs
public class CarryMaterialBindInput public class CarryMaterialBindInput
{ {
public string? carrycode { get; set; } public string? carrycode { get; set; }
public string? create_id { get; set; }
public List<CarryMaterialDetail> details { get; set; } public List<CarryMaterialDetail> details { get; set; }
} }
public class CarryMaterialDetail public class CarryMaterialDetail

View File

@@ -0,0 +1,13 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Tnb.WarehouseMgr.Entities.Dto.Inputs
{
public class WmsElevatorUnlockInput
{
public string? elevator_id { get; set; }
}
}

View File

@@ -85,22 +85,34 @@ namespace Tnb.WarehouseMgr
{ {
Logger.Information($"【LoadConfirm】接收到WCS取货确认信号.................. {JsonConvert.SerializeObject(input)}"); Logger.Information($"【LoadConfirm】接收到WCS取货确认信号.................. {JsonConvert.SerializeObject(input)}");
var dis = _db.Queryable<WmsDistaskH>().Where(P => P.bill_code == input.taskCode).First(); try
if (dis.area_code == "ZSCJ001")
{ {
var flag = await _wareHouseService.Check(dis.startlocation_code, "LOAD"); var dis = _db.Queryable<WmsDistaskH>().Where(P => P.bill_code == input.taskCode).First();
if (flag) if (dis.area_code == "ZSCJ001")
{ {
await _wareHouseService.SsxControl(dis, "LOAD"); var flag = await _wareHouseService.Check(dis.startlocation_code, "LOAD");
Logger.Information("【LoadConfirm】 " + dis.startlocation_code + "取货确认..................成功"); if (flag)
return await ToApiResult(HttpStatusCode.OK, "成功"); {
} await _wareHouseService.SsxControl(dis, "LOAD");
else Logger.Information("【LoadConfirm】 " + dis.startlocation_code + "取货确认..................成功");
{ return await ToApiResult(HttpStatusCode.OK, "成功");
Logger.Information("【LoadConfirm】 " + dis.startlocation_code + "取货确认..................失败"); }
return await ToApiResult(HttpStatusCode.InternalServerError, "失败"); else
{
Logger.Information("【LoadConfirm】 " + dis.startlocation_code + "取货确认..................失败");
return await ToApiResult(HttpStatusCode.InternalServerError, "失败");
}
} }
} }
catch (Exception ex)
{
Logger.LogError(ex.Message);
Logger.LogError(ex.StackTrace);
return await ToApiResult(HttpStatusCode.InternalServerError, $"取货确认..................失败 原因是{ex.Message}");
throw;
}
/*var whereExp = Expressionable.Create<WmsElevatorH, WmsElevatorD, WmsDistaskH>() /*var whereExp = Expressionable.Create<WmsElevatorH, WmsElevatorD, WmsDistaskH>()
.And((a, b, c) => c.bill_code == input.taskCode) .And((a, b, c) => c.bill_code == input.taskCode)
.And((a, b, c) => a.enabled == 1) .And((a, b, c) => a.enabled == 1)
@@ -533,6 +545,24 @@ namespace Tnb.WarehouseMgr
} }
[HttpPost]
public async Task<Tnb.WarehouseMgr.Entities.Dto.Outputs.Result> WmsElevatorUnlock(WmsElevatorUnlockInput input)
{
try
{
Logger.Information($"【WmsElevatorUnlock】操作电梯{input.elevator_id}手动解锁");
await _db.Updateable<WmsElevatorH>().SetColumns(r => r.is_use == (int)EnumElevatorUseStatus.)
.Where(it => it.elevator_id == input.elevator_id).ExecuteCommandAsync();
s_eleUseStatusDic[input.elevator_id] = (int)EnumElevatorUseStatus.;
}
catch (Exception ex)
{
Logger.Error("【ElevatorConfirm】 申请进出电梯信号错误", ex);
return await ToApiResult(HttpStatusCode.InternalServerError, "请重试!");
throw;
}
return await ToApiResult(HttpStatusCode.OK, "解锁成功");
}
/// <summary> /// <summary>
/// 申请进出电梯 /// 申请进出电梯

View File

@@ -403,8 +403,9 @@ namespace Tnb.WarehouseMgr
.OrderBy(policy.policy) .OrderBy(policy.policy)
.Select<WmsCarryH>() .Select<WmsCarryH>()
.Distinct()
.ToListAsync(); .ToListAsync();
items = items.Distinct().ToList();
return input.Size > 0 ? items.Take(input.Size).ToList() : items; return input.Size > 0 ? items.Take(input.Size).ToList() : items;
} }
@@ -555,17 +556,19 @@ namespace Tnb.WarehouseMgr
strs = getdic.Where(p => p.Key == code).First().Value; strs = getdic.Where(p => p.Key == code).First().Value;
bool flag = await _redisData.HashExists(strs[0], strs[1]); bool flag = await _redisData.HashExists(strs[0], strs[1]);
Logger.Information($"【Check】 判断CTU是否可以取货1 {code} {action} flag:{flag} "); Logger.Information($"【Check】{action} 判断CTU是否可以取货1 获取{code}的标签{strs[1]}是否存在 结果为:{flag} ");
if (!flag) if (!flag)
{ {
return false; throw new Exception($"【Check】{action} 判断CTU是否可以取货1 获取{code}的标签{strs[1]}是否存在 结果为:{flag} ");
} }
string data = _redisData.GetHash(strs[0], strs[1]).Result; string data = _redisData.GetHash(strs[0], strs[1]).Result;
JObject? res = JsonConvert.DeserializeObject<JObject>(data); JObject? res = JsonConvert.DeserializeObject<JObject>(data);
bool result = res != null && res["Value"] != null ? res.Value<bool>("Value") : false; bool result = res != null && res["Value"] != null ? res.Value<bool>("Value") : false;
Logger.Information($"【Check】 判断CTU是否可以取货2 {code} {action} result:{result} "); Logger.Information($"【Check】{action} 判断CTU是否可以取货2 获取{code}的标签{strs[1]}信号值 结果为:{result} ");
if (!result) if (!result)
return false; {
throw new Exception($"【Check】{action} 判断CTU是否可以取货2 获取{code}的标签{strs[1]}信号值 结果为:{result} ");
}
return true; return true;
} }
else if (action == "UNLOAD")//放货 else if (action == "UNLOAD")//放货
@@ -578,14 +581,16 @@ namespace Tnb.WarehouseMgr
Logger.Information($"【Check】 判断CTU是否可以取货1 {code} {action} flag:{flag} "); Logger.Information($"【Check】 判断CTU是否可以取货1 {code} {action} flag:{flag} ");
if (!flag) if (!flag)
{ {
return false; throw new Exception($"【Check】 判断CTU是否可以取货1 {code} {action} flag:{flag} ");
} }
string data = _redisData.GetHash(strs[0], strs[1]).Result; string data = _redisData.GetHash(strs[0], strs[1]).Result;
JObject? res = JsonConvert.DeserializeObject<JObject>(data); JObject? res = JsonConvert.DeserializeObject<JObject>(data);
bool result = res != null && res["Value"] != null ? res.Value<bool>("Value") : false; bool result = res != null && res["Value"] != null ? res.Value<bool>("Value") : false;
Logger.Information($"【Check】 判断CTU是否可以取货2 {code} {action} result:{result} "); Logger.Information($"【Check】 判断CTU是否可以取货2 {code} {action} result:{result} ");
if (!result) if (!result)
return false; {
throw new Exception($"【Check】 判断CTU是否可以取货2 {code} {action} result:{result} ");
}
return true; return true;
} }
return false; return false;
@@ -997,6 +1002,7 @@ namespace Tnb.WarehouseMgr
for (int i = 0, cnt = items.Count; i < cnt; i++) for (int i = 0, cnt = items.Count; i < cnt; i++)
{ {
items[i].id = SnowflakeIdHelper.NextId(); items[i].id = SnowflakeIdHelper.NextId();
items[i].create_time = DateTime.Now;
items[i].status = WmsWareHouseConst.TASK_BILL_STATUS_DZX_ID; items[i].status = WmsWareHouseConst.TASK_BILL_STATUS_DZX_ID;
} }
int moveNum = itGroup.First().move_num; int moveNum = itGroup.First().move_num;

View File

@@ -164,6 +164,8 @@ namespace Tnb.WarehouseMgr
WmsCarryCode.id = SnowflakeIdHelper.NextId(); WmsCarryCode.id = SnowflakeIdHelper.NextId();
WmsCarryCode.carry_id = carry.id; WmsCarryCode.carry_id = carry.id;
WmsCarryCode.is_out = 0; WmsCarryCode.is_out = 0;
WmsCarryCode.id = input.create_id;
WmsCarryCode.create_time = DateTime.Now;
WmsCarryCodes.Add(WmsCarryCode); WmsCarryCodes.Add(WmsCarryCode);
} }
int rows = 0; int rows = 0;
@@ -171,7 +173,7 @@ namespace Tnb.WarehouseMgr
rows = await _db.Insertable(WmsCarryCodes).ExecuteCommandAsync(); rows = await _db.Insertable(WmsCarryCodes).ExecuteCommandAsync();
if (rows == 0) if (rows == 0)
{ {
throw new Exception($"接收到{input.details.Count}个条码 但是成功绑定的条码数量为0个"); throw new Exception($"物料列表为空,不能提交绑定,可能的原因;1.需要检查扫码设置(新PDA) 2.未扫到有效的二维码 详细信息:接收到{input.details.Count}个条码 但是成功绑定的条码数量为0个");
} }
} }
catch (PostgresException ex) catch (PostgresException ex)