From 79edcd87697f5cce97e461443fac1e4e655f6dae Mon Sep 17 00:00:00 2001
From: zs <zhousong@weben-smart.com>
Date: 周一, 19 5月 2025 16:53:16 +0800
Subject: [PATCH] Merge branch 'master' of http://222.71.245.114:9086/r/HIA24016N_PipeLineDemo

---
 PipeLineLems/server/src/CMS.Plugin.PipeLineLems.Application/Implements/SharedService.cs |  104 +++++++++++++++++++++++++---------------------------
 1 files changed, 50 insertions(+), 54 deletions(-)

diff --git a/PipeLineLems/server/src/CMS.Plugin.PipeLineLems.Application/Implements/SharedService.cs b/PipeLineLems/server/src/CMS.Plugin.PipeLineLems.Application/Implements/SharedService.cs
index ff26b90..7f09104 100644
--- a/PipeLineLems/server/src/CMS.Plugin.PipeLineLems.Application/Implements/SharedService.cs
+++ b/PipeLineLems/server/src/CMS.Plugin.PipeLineLems.Application/Implements/SharedService.cs
@@ -1,37 +1,29 @@
+using CMS.Extensions.Variable;
 using CMS.Plugin.FormulaManagement.Abstractions;
+using CMS.Plugin.HIAWms.Application.Contracts.Dtos.CommonDto;
+using CMS.Plugin.HIAWms.Application.Contracts.Dtos.WmsMaterialStocks;
+using CMS.Plugin.MaterialManagement.Abstractions;
 using CMS.Plugin.OrderManagement.Abstractions;
 using CMS.Plugin.OrderManagement.Abstractions.Enums;
 using CMS.Plugin.OrderManagement.Abstractions.Models;
-using CMS.Plugin.PipeLineLems.Application.Contracts.Dtos.WorkPlan;
-using CMS.Plugin.ProductManagement.Abstractions;
-using Microsoft.Extensions.DependencyInjection;
-using Volo.Abp;
-using Microsoft.Extensions.DependencyInjection;
-using NPOI.Util;
-using CMS.Plugin.PipeLineLems.Domain.CallMaterialOrder;
-using CMS.Plugin.PipeLineLems.Application.Contracts.Services;
 using CMS.Plugin.PipeLineLems.Application.Contracts.Dtos.CallMaterialOrder;
-using Volo.Abp.Uow;
-using System.Text;
-using CMS.Plugin.PipeLineLems.Domain.WorkPlan;
+using CMS.Plugin.PipeLineLems.Application.Contracts.Dtos.WorkPlan;
+using CMS.Plugin.PipeLineLems.Application.Contracts.Services;
+using CMS.Plugin.PipeLineLems.Domain.CallMaterialOrder;
 using CMS.Plugin.PipeLineLems.Domain.CallMaterialOrderRecord;
-using Volo.Abp.Users;
-using CmsQueryExtensions.Entitys;
-using CMS.Unit.RuntimeValue.Abstractions;
-using CMS.Extensions.Variable;
-using CMS.Plugin.TraceManagement.Abstractions.Models.Traces;
+using CMS.Plugin.PipeLineLems.Domain.WorkPlan;
 using CMS.Plugin.ProcessManagement.Abstractions;
-using KissUtil.Extensions;
+using CMS.Plugin.ProductManagement.Abstractions;
 using CMS.Plugin.TraceManagement.Abstractions;
-using CMS.Plugin.ProductManagement.Abstractions.Models;
-using CMS.Plugin.MaterialManagement.Abstractions;
-using CMS.Plugin.HIAWms.Application.Contracts.Services;
-using CMS.Plugin.HIAWms.Application.Contracts.Dtos.CommonDto;
-using System.Collections.Generic;
-using CMS.Plugin.HIAWms.Abstractions;
-using Newtonsoft.Json;
+using CMS.Plugin.TraceManagement.Abstractions.Models.Traces;
 using CmsQueryExtensions;
-using CMS.Plugin.HIAWms.Application.Contracts.Dtos.WmsMaterialStocks;
+using CmsQueryExtensions.Entitys;
+using CmsQueryExtensions.Extension;
+using KissUtil.Extensions;
+using Microsoft.Extensions.DependencyInjection;
+using Newtonsoft.Json;
+using Volo.Abp;
+using Volo.Abp.Uow;
 
 namespace CMS.Plugin.PipeLineLems.Application.Implements;
 
@@ -126,7 +118,9 @@
                 StockNumber = 1,
                 MaterialBatch = callMaterialOrder.MaterialBatch,
 
-                RedundantField1 = firstWorkPlan.ProcessRouteNumber //鎵╁睍瀛楁鏄剧ず 宸ヨ壓娴佸悜缂栧彿
+                RedundantField1 = firstWorkPlan.ProcessRouteNumber, //鎵╁睍瀛楁鏄剧ず 宸ヨ壓娴佸悜缂栧彿
+                RedundantField2 = firstWorkPlan.PipeSpecCode, //鎵╁睍瀛楁鏄剧ず 绠℃缂栫爜
+                RedundantField3 = firstWorkPlan.PipeSectionName, //鎵╁睍瀛楁鏄剧ず 绠℃鍚嶇О
 
             };
             string baseUrl = @"http://127.0.0.1:18000/api/v1/HIAWms/";
@@ -565,6 +559,7 @@
             string url = baseUrl + "lMesOperate/LMesCallMaterial";
             string json = JsonConvert.SerializeObject(param);
             var result = HttpApiRequest.HttpPost(url, json);
+
             var res = JsonConvert.DeserializeObject<CmsApiResponse<List<MyCallMaterialOutput>>>(result);
             if (res.Code == 200)
             {
@@ -577,6 +572,7 @@
             {
                 throw new UserFriendlyException(res.Message);
             }
+            //*/
         }
         catch (Exception)
         {
@@ -1085,33 +1081,34 @@
 
         WorkPlanDto workPlanDto = await _workPlanAppService.FindSingleByFilterAsync(input);
 
-        //TODO:杩欓噷璋冪敤wms鐨勫彨鏂欐帴鍙�
+        //TODO:杩欓噷璋冪敤wms鐨勫簱瀛樻煡璇㈡帴鍙�
         try
         {
-            List<LMesCallMaterialInput> param = new List<LMesCallMaterialInput>() {
-             new LMesCallMaterialInput(){
+            GetWmsMaterialStockInput param = new GetWmsMaterialStockInput()
+            {
+                RedundantField1 = workPlanDto.ProcessRouteNumber,
+                RedundantField1_FilterMode = SearchFilterModeEnum.绮惧噯鏌ヨ
+            };
 
-             }
-        };
-            /*
             string baseUrl = @"http://127.0.0.1:18000/api/v1/HIAWms/";
-            string url = baseUrl + "lMesOperate/LMesCallMaterial";
+            string url = baseUrl + "LMesOperate/FindListByFilter";
             string json = JsonConvert.SerializeObject(param);
             var result = HttpApiRequest.HttpPost(url, json);
-            var res = JsonConvert.DeserializeObject<CmsApiResponse<List<MyCallMaterialOutput>>>(result);
+            var res = JsonConvert.DeserializeObject<CmsApiResponse<List<WmsMaterialStockDto>>>(result);
             if (res.Code == 200)
             {
-                var retData = res.Data;
-                //callMaterialOrder.MaterialBatch = retData[0].MaterialBatch;
-                //callMaterialOrder.WmsTaskNo = retData[0].TaskNo;
-                //callMaterialOrder.WmsRetResult = res.Message;
-
+                var retData = res.Data as List<WmsMaterialStockDto>;
                 var data = new PickOutput()
                 {
                     WorkPlan = workPlanDto,
                     PlaceNo = "",//寰呰祴鍊�
                     ContinerNo = ""//寰呰祴鍊�
                 };
+                if (retData?.Count > 0)
+                {
+                    data.PlaceNo = retData.First().PlaceNo;
+                    data.ContinerNo = retData.First().ContainerNo;
+                }
 
                 var response = new CmsApiResponse<PickOutput>
                 {
@@ -1125,23 +1122,22 @@
             else
             {
                 throw new UserFriendlyException(res.Message);
-            }
+            };
             //*/
             //妯℃嫙
-            var data = new PickOutput()
-            {
-                WorkPlan = workPlanDto,
-                PlaceNo = "",//寰呰祴鍊�
-                ContinerNo = ""//寰呰祴鍊�
-            };
-
-            var response = new CmsApiResponse<PickOutput>
-            {
-                Code = 200,
-                Data = data,
-                Message = "澶勭悊鎴愬姛",
-            };
-            return response;
+            //var data = new PickOutput()
+            //{
+            //    WorkPlan = workPlanDto,
+            //    PlaceNo = "",//寰呰祴鍊�
+            //    ContinerNo = ""//寰呰祴鍊�
+            //};
+            //var response = new CmsApiResponse<PickOutput>
+            //{
+            //    Code = 200,
+            //    Data = data,
+            //    Message = "澶勭悊鎴愬姛",
+            //};
+            //return response;
 
         }
         catch (Exception)

--
Gitblit v1.9.3