diff --git a/ProductionMgr/Tnb.ProductionMgr/PrdMoTaskService.cs b/ProductionMgr/Tnb.ProductionMgr/PrdMoTaskService.cs index 0b4a0a1d..e2b89806 100644 --- a/ProductionMgr/Tnb.ProductionMgr/PrdMoTaskService.cs +++ b/ProductionMgr/Tnb.ProductionMgr/PrdMoTaskService.cs @@ -44,6 +44,8 @@ using JNPF.Extras.CollectiveOAuth.Utils; using Tnb.WarehouseMgr.Entities; using Tnb.WarehouseMgr.Entities.Dto; using Tnb.WarehouseMgr.Entities.Dto.Inputs; +using Tnb.WarehouseMgr.Interfaces; +using Tnb.WarehouseMgr; // using Tnb.PerMgr.Entities; @@ -68,7 +70,9 @@ namespace Tnb.ProductionMgr private readonly ISqlSugarClient _db; private readonly IBillRullService _billRuleService; private readonly IPrdInstockService _prdInstockService; + private readonly WmsPrdInstockHService _wmsPrdInstockHService; private readonly IQcCheckPlanService _qcCheckPlanService; + private readonly IWmsCarryService _wmsCarryService; private readonly ElevatorControlConfiguration _eleCtlCfg = App.Configuration.Build(); private readonly RedisData _redisData; @@ -78,8 +82,10 @@ namespace Tnb.ProductionMgr IUserManager userManager, IDictionaryDataService dictionaryDataService, IRunService runService, + IWmsCarryService wmsCarryService, IBillRullService billRullService, IPrdInstockService prdInstockService, + WmsPrdInstockHService wmsPrdInstockHService, IVisualDevService visualDevService, IQcCheckPlanService qcCheckPlanService ) @@ -95,6 +101,8 @@ namespace Tnb.ProductionMgr _billRuleService = billRullService; _prdInstockService = prdInstockService; _qcCheckPlanService = qcCheckPlanService; + _wmsCarryService = wmsCarryService; + _wmsPrdInstockHService = wmsPrdInstockHService; } #region Get @@ -1898,13 +1906,11 @@ namespace Tnb.ProductionMgr bindCarryCodeInput.location_id = location.id; bindCarryCodeInput.location_code = location.location_code; bindCarryCodeInput.code_batch = prdMoTask.batch; - - string response1 = HttpUtils.RequestPost($"{config.value}/api/wms/wms-carry/bind-carry-material",JsonConvert.SerializeObject(bindCarryCodeInput), header); - AuthResponse authResponse1 = JsonConvert.DeserializeObject(response1); - AuthResponse authResponse11 = JsonConvert.DeserializeObject(authResponse1.data.ToString()); - if (authResponse11.code != 200) + + Tnb.WarehouseMgr.Entities.Dto.Outputs.Result result1 = await _wmsCarryService.BindCarryMaterial(bindCarryCodeInput); + if (result1.code != HttpStatusCode.OK) { - throw Oops.Bah(authResponse11.msg); + throw Oops.Bah(result1.msg); } WmsPrdInstockInput wmsPrdInstockInput = new WmsPrdInstockInput(); @@ -1937,12 +1943,10 @@ namespace Tnb.ProductionMgr carry_id = wmsCarryH.id, }); - string response2 = HttpUtils.RequestPost($"{config.value}/api/wms/wms-prd-instock-h/prd-instock",JsonConvert.SerializeObject(wmsPrdInstockInput), header); - AuthResponse authResponse2 = JsonConvert.DeserializeObject(response2); - AuthResponse authResponse22 = JsonConvert.DeserializeObject(authResponse2.data.ToString()); - if (authResponse22.code != 200) + Tnb.WarehouseMgr.Entities.Dto.Outputs.Result result2 = await _wmsPrdInstockHService.PrdInstock(wmsPrdInstockInput); + if (result2.code != HttpStatusCode.OK) { - throw Oops.Bah(authResponse22.msg); + throw Oops.Bah(result2.msg); } if (prdMoTask.schedule_type == 2) diff --git a/ProductionMgr/Tnb.ProductionMgr/Tnb.ProductionMgr.csproj b/ProductionMgr/Tnb.ProductionMgr/Tnb.ProductionMgr.csproj index fd26adc3..a20cea68 100644 --- a/ProductionMgr/Tnb.ProductionMgr/Tnb.ProductionMgr.csproj +++ b/ProductionMgr/Tnb.ProductionMgr/Tnb.ProductionMgr.csproj @@ -17,6 +17,7 @@ +