From 565fa22e45d269baad735c87e5b63b91d6773d35 Mon Sep 17 00:00:00 2001 From: zhou keda <1315948824@qq.com> Date: Tue, 21 May 2024 10:54:30 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B3=A8=E5=A1=91=E5=AE=9A=E7=82=B9=E9=85=8D?= =?UTF-8?q?=E9=80=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Tnb.ProductionMgr/TimeWorkService.cs | 34 +++++++++++-------- 1 file changed, 20 insertions(+), 14 deletions(-) diff --git a/ProductionMgr/Tnb.ProductionMgr/TimeWorkService.cs b/ProductionMgr/Tnb.ProductionMgr/TimeWorkService.cs index 7441dc26..de236d63 100644 --- a/ProductionMgr/Tnb.ProductionMgr/TimeWorkService.cs +++ b/ProductionMgr/Tnb.ProductionMgr/TimeWorkService.cs @@ -25,6 +25,7 @@ using Tnb.WarehouseMgr.Entities.Consts; using Tnb.WarehouseMgr.Entities.Dto.Outputs; using Result = Tnb.WarehouseMgr.Entities.Dto.Outputs.Result; using Tnb.BasicData; +using Tnb.EquipMgr.Entities; using Tnb.WarehouseMgr; namespace Tnb.ProductionMgr @@ -168,23 +169,28 @@ namespace Tnb.ProductionMgr var db = _repository.AsSugarClient(); BasLocation startLocation = await db.Queryable().Where(x=>x.location_code==startLocationCode).FirstAsync(); + EqpEquipment equipment = await db.Queryable().Where(x=>x.code=="TYZS001").FirstAsync(); + if (equipment == null) + { + Log.Error($"未找到设备编号为TYZS001的设备"); + return Task.CompletedTask; + + } CommonCreatePretaskInput postData = new CommonCreatePretaskInput(); postData.startlocation_id = startLocation.id; - // postData.endlocation_id = - + postData.endlocation_id = equipment.as_location_id; + postData.biz_type = WmsWareHouseConst.BIZTYPE_WMSDELIVERY_ID; + postData.task_type = WmsWareHouseConst.WMS_PRETASK_OUTSTOCK_TYPE_ID; + Log.Information($"【FixedPointDelivery】注塑定点配送,参数:{JsonConvert.SerializeObject(postData)}"); BasFactoryConfig config = await db.Queryable().FirstAsync(x => x.enabled == 1 && x.key == FactoryConfigConst.DOMAIN); - // string sendResult = HttpUtils.RequestPost($"{config.value}/api/wms/ware-house/common-create-pretask", JsonConvert.SerializeObject(postData), header); - // - // AuthResponse authResponse = JsonConvert.DeserializeObject(sendResult); - // if(authResponse.code == 200 && authResponse.data.ObjToBool()) - // { - // Log.Information("【FixedPointDelivery】注塑定点配送成功"); - // //_redisData.Set("DB100.132.0_flag", true, TimeSpan.FromMinutes(20)); - // } - // else - // { - // Log.Information(sendResult); - // } + string sendResult = HttpUtils.RequestPost($"{config.value}/api/wms/ware-house/common-create-pretask", JsonConvert.SerializeObject(postData), null); + + AuthResponse authResponse = JsonConvert.DeserializeObject(sendResult); + if(authResponse.code == 200 && authResponse.data.ObjToBool()) + { + Log.Information("【FixedPointDelivery】注塑定点配送成功"); + //_redisData.Set("hxjA_DB100.132.0_flag", true, TimeSpan.FromMinutes(20)); + } }