二楼暂存仓逻辑完善,新增外协入库与盘点接收接口
This commit is contained in:
@@ -1,9 +1,11 @@
|
||||
using System.Diagnostics;
|
||||
using System.Dynamic;
|
||||
using System.Linq.Expressions;
|
||||
using System.Net;
|
||||
using System.Security.Policy;
|
||||
using System.Threading.Tasks;
|
||||
using Aop.Api.Domain;
|
||||
using Aspose.Cells;
|
||||
using JNPF;
|
||||
using JNPF.Common.Contracts;
|
||||
using JNPF.Common.Core.Manager;
|
||||
@@ -36,6 +38,7 @@ using Tnb.WarehouseMgr.Entities.Configs;
|
||||
using Tnb.WarehouseMgr.Entities.Consts;
|
||||
using Tnb.WarehouseMgr.Entities.Dto;
|
||||
using Tnb.WarehouseMgr.Entities.Dto.Inputs;
|
||||
using Tnb.WarehouseMgr.Entities.Dto.Outputs;
|
||||
using Tnb.WarehouseMgr.Entities.Dto.Queries;
|
||||
using Tnb.WarehouseMgr.Entities.Entity;
|
||||
using Tnb.WarehouseMgr.Entities.Enums;
|
||||
@@ -476,16 +479,16 @@ namespace Tnb.WarehouseMgr
|
||||
else // 去暂存仓放货
|
||||
{
|
||||
// 回写料架料箱绑定表的库位
|
||||
ISugarQueryable<WmsCarrybindH> wmsCarryHs = db.Queryable<WmsCarrybindH>().Where(r => r.carry_code == disTask.carry_code);
|
||||
var wmsCarryHList = wmsCarryHs.ToList();
|
||||
wmsCarryHList.ForEach(r =>
|
||||
ISugarQueryable<WmsCarryCode> WmsCarryCodes = db.Queryable<WmsCarryCode>()
|
||||
.InnerJoin<WmsCarryD>((a, b) => b.membercarry_id == a.carry_id)
|
||||
.Where((a, b) => b.carry_id == disTask.carry_id);
|
||||
var WmsCarryCodeList = WmsCarryCodes.ToList();
|
||||
WmsCarryCodeList.ForEach(r =>
|
||||
{
|
||||
r.location_id = disTask.endlocation_id;
|
||||
r.location_code = disTask.endlocation_code;
|
||||
r.source_id = disTask.id;
|
||||
r.source_code = disTask.bill_code;
|
||||
});
|
||||
await db.Updateable(wmsCarryHList).ExecuteCommandAsync();
|
||||
await db.Updateable(WmsCarryCodeList).ExecuteCommandAsync();
|
||||
}
|
||||
}
|
||||
else
|
||||
@@ -506,6 +509,25 @@ namespace Tnb.WarehouseMgr
|
||||
}
|
||||
WmsMechanicalArmH target = WmsMechanicalArmHs.First();
|
||||
|
||||
if (target.note == "上升降机")
|
||||
{
|
||||
bool result = await Floor2UpDownMachinecode_SetTag($"上升降机满托{target.stackingposition}移走", "true");
|
||||
Logger.LogInformation($@"【上升降机】设定升上升降机满托{target.stackingposition}移走 结果为 {result}");
|
||||
if (!result)
|
||||
{
|
||||
throw new Exception($@"【上升降机】设定升上升降机满托{target.stackingposition}移走 结果为 {result}");
|
||||
}
|
||||
}
|
||||
else if (target.note == "下升降机")
|
||||
{
|
||||
bool result = await Floor2UpDownMachinecode_SetTag($"下升降机空托{target.stackingposition}移走", "true");
|
||||
Logger.LogInformation($@"【上升降机】设定升下升降机空托{target.stackingposition}移走 结果为 {result}");
|
||||
if (!result)
|
||||
{
|
||||
throw new Exception($@"【上升降机】设定升下升降机空托{target.stackingposition}移走 结果为 {result}");
|
||||
}
|
||||
}
|
||||
|
||||
//回写出库单状态
|
||||
await db.Updateable<WmsEmptyOutstockH>().SetColumns(r => new WmsEmptyOutstockH
|
||||
{
|
||||
@@ -532,6 +554,28 @@ namespace Tnb.WarehouseMgr
|
||||
return true;
|
||||
}
|
||||
|
||||
private async Task<bool> Floor2UpDownMachinecode_SetTag(string tag, string value)
|
||||
{
|
||||
string DevName = "东面提升机输送线";
|
||||
Dictionary<string, string> dicCommand = new(StringComparer.OrdinalIgnoreCase)
|
||||
{
|
||||
["DevName"] = DevName,
|
||||
["token"] = _eleCtlCfg.token,
|
||||
["TagName"] = tag,
|
||||
["Value"] = value,
|
||||
};
|
||||
string result = await HttpClientHelper.GetRequestAsync(_eleCtlCfg.WriteTagUrl, dicCommand);
|
||||
// TODO 测试
|
||||
|
||||
//JObject valueJson = new JObject();
|
||||
//valueJson["Value"] = value;
|
||||
|
||||
//bool res = await _redisData.HSet(DevName, tag, valueJson.ToString());
|
||||
//return true;
|
||||
|
||||
return result.Contains("Ok");
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 生成任务执行
|
||||
/// </summary>
|
||||
@@ -1363,6 +1407,12 @@ namespace Tnb.WarehouseMgr
|
||||
// 一楼中储仓
|
||||
kiva.Add("ZSSSXCTU02");
|
||||
kiva.Add("ZSSSXCTU01");
|
||||
List<string> floor2 = new List<string>();
|
||||
// 二楼暂存仓
|
||||
floor2.Add("AS01");
|
||||
floor2.Add("AS02");
|
||||
floor2.Add("AX01");
|
||||
floor2.Add("AX02");
|
||||
//调用AGV创建任务链接口
|
||||
try
|
||||
{
|
||||
@@ -1378,6 +1428,7 @@ namespace Tnb.WarehouseMgr
|
||||
sourceName = it.startpoint_code,
|
||||
targetName = it.endpoint_code,
|
||||
containerCode = it.carry_code,
|
||||
shelfNumber = floor2.Contains(it.startlocation_code) || floor2.Contains(it.endlocation_code) ? it.carry_code : "" // 二楼暂存仓传料架
|
||||
}));
|
||||
|
||||
Logger.Information($"【AgvDispatch】 Agv任务执行的taskChainCodeDic:{JsonConvert.SerializeObject(taskChainCodeDic)}");
|
||||
@@ -1386,7 +1437,7 @@ namespace Tnb.WarehouseMgr
|
||||
{
|
||||
var typeflag = false;
|
||||
var dis = disTasks.Where(p => p.groups == k).First();
|
||||
if (kiva.Contains(dis.startlocation_code) || kiva.Contains(dis.endlocation_code))
|
||||
if (kiva.Contains(dis.startlocation_code) || kiva.Contains(dis.endlocation_code) || floor2.Contains(dis.startlocation_code) || floor2.Contains(dis.endlocation_code))
|
||||
{
|
||||
typeflag = true;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user