From 8ec9fab52eea2b110ad4e1a0b2300fead0018cd1 Mon Sep 17 00:00:00 2001
From: tjx <t2856754968@163.com>
Date: 星期日, 21 十二月 2025 15:20:36 +0800
Subject: [PATCH] 1111

---
 StandardPda/MESApplication/Controllers/Warehouse/womdaaController.cs |  537 +++++++++++++++++++++++++++++++----------------------------
 1 files changed, 283 insertions(+), 254 deletions(-)

diff --git a/StandardPda/MESApplication/Controllers/Warehouse/womdaaController.cs b/StandardPda/MESApplication/Controllers/Warehouse/womdaaController.cs
index db579fe..5387eb8 100644
--- a/StandardPda/MESApplication/Controllers/Warehouse/womdaaController.cs
+++ b/StandardPda/MESApplication/Controllers/Warehouse/womdaaController.cs
@@ -1,282 +1,311 @@
-锘縰sing AngleSharp.Text;
+锘縰sing System.Dynamic;
+using AngleSharp.Text;
 using MES.Service.Dto.service;
+using MES.Service.Dto.webApi;
 using MES.Service.Modes;
 using MES.Service.service;
 using MES.Service.service.Warehouse;
 using MES.Service.util;
-using Microsoft.AspNetCore.Http;
 using Microsoft.AspNetCore.Mvc;
-using Microsoft.EntityFrameworkCore.Metadata.Internal;
-using System.Dynamic;
+using Newtonsoft.Json;
 
-namespace MESApplication.Controllers.Warehouse
+namespace MESApplication.Controllers.Warehouse;
+
+[Route("api/[controller]")]
+[ApiController]
+public class womdaaController : ControllerBase
 {
-    [Route("api/[controller]")]
-    [ApiController]
-    public class womdaaController : ControllerBase
+    private readonly MessageCenterManager _manager = new();
+
+    private readonly WomdaaManager m = new();
+
+    private readonly string METHOD = "POST";
+
+    private readonly string TableName = "womdaa";
+
+    private readonly string URL = "http://localhost:10054/api/womdaa/";
+
+    /// <summary>
+    ///     鏍规嵁浜ф祴鐧诲綍鍙疯幏鍙栦骇绾跨浉鍏冲伐鍗曚俊鎭�
+    /// </summary>
+    /// <returns></returns>
+    [HttpPost("GetTickeInfo")]
+    public ResponseResult GetTickeInfo(CCLoginDto ccLoginDto)
     {
-
-        private readonly WomdaaManager m = new();
-
-        private readonly MessageCenterManager _manager = new();
-        
-        private readonly string METHOD = "POST";
-
-        private readonly string TableName = "womdaa";
-
-        private readonly string URL = "http://localhost:10054/api/womdaa/";
-        /// <summary>
-        ///鏍规嵁浜ф祴鐧诲綍鍙疯幏鍙栦骇绾跨浉鍏冲伐鍗曚俊鎭�
-        /// </summary>
-        /// <returns></returns>
-        [HttpPost("GetTickeInfo")]
-        public ResponseResult GetTickeInfo(CCLoginDto ccLoginDto)
+        var entity = new MessageCenter();
+        entity.TableName = TableName;
+        entity.Url = URL + "GetTickeInfo";
+        entity.Method = METHOD;
+        entity.Data = JsonConvert.SerializeObject(ccLoginDto);
+        entity.Status = 1;
+        entity.CreateBy = "PL017";
+        try
         {
-            var entity = new MessageCenter();
-            entity.TableName = TableName;
-            entity.Url = URL + "GetTickeInfo";
-            entity.Method = METHOD;
-            entity.Data = Newtonsoft.Json.JsonConvert.SerializeObject(ccLoginDto);
-            entity.Status = 1;
-            entity.CreateBy = "PL017";
-            try
+            dynamic resultInfos = new ExpandoObject();
+            //var result = m.GetTickeInfo(ccLoginDto.LoginId);
+            //浼犵嚎浣撶紪鐮侊紝鏍规嵁绾夸綋缂栫爜鑾峰彇宸ュ崟淇℃伅
+            var result = m.GetTickeInfo(ccLoginDto.LineId, ccLoginDto.LoginId);
+            resultInfos.tbBillList = result;
+
+            entity.Result = 0;
+            if (true) entity.Result = 1;
+            entity.DealWith = 1;
+            _manager.save(entity);
+
+            return new ResponseResult
             {
-                dynamic resultInfos = new ExpandoObject();
-                //var result = m.GetTickeInfo(ccLoginDto.LoginId);
-                //浼犵嚎浣撶紪鐮侊紝鏍规嵁绾夸綋缂栫爜鑾峰彇宸ュ崟淇℃伅
-                var result = m.GetTickeInfo(ccLoginDto.LineId, ccLoginDto.LoginId);
-                resultInfos.tbBillList = result;
-
-                entity.Result = 0;
-                if (true) entity.Result = 1;
-                entity.DealWith = 1;
-                _manager.save(entity);
-
-                return new ResponseResult
-                {
-                    status = 0,
-                    message = "OK",
-                    data = resultInfos.tbBillList
-                };
-            }
-            catch (Exception ex)
-            {
-                entity.Result = 0;
-                entity.DealWith = 0;
-                entity.ResultData = ex.Message;
-                _manager.save(entity);
-
-                return ResponseResult.ResponseError(ex);
-            }
+                status = 0,
+                message = "OK",
+                data = resultInfos.tbBillList
+            };
         }
-
-
-        /// <summary>
-        ///瀛樺偍浜ф祴杩囩珯淇℃伅
-        /// </summary>
-        /// <returns></returns>
-        [HttpPost("AddAsnInfo")]
-        public ResponseResult AddAsnInfo(AsnInfo asnInfo)
+        catch (Exception ex)
         {
-            var entity = new MessageCenter();
-            entity.TableName = TableName;
-            entity.Url = URL + "AddAsnInfo";
-            entity.Method = METHOD;
-            entity.Data = Newtonsoft.Json.JsonConvert.SerializeObject(asnInfo);
-            entity.Status = 1;
-            entity.CreateBy = "PL017";
-            try
+            entity.Result = 0;
+            entity.DealWith = 0;
+            entity.ResultData = ex.Message;
+            _manager.save(entity);
+
+            return ResponseResult.ResponseError(ex);
+        }
+    }
+
+
+    /// <summary>
+    ///     瀛樺偍浜ф祴杩囩珯淇℃伅
+    /// </summary>
+    /// <returns></returns>
+    [HttpPost("AddAsnInfo")]
+    public ResponseResult AddAsnInfo(AsnInfo asnInfo)
+    {
+        var entity = new MessageCenter();
+        entity.TableName = TableName;
+        entity.Url = URL + "AddAsnInfo";
+        entity.Method = METHOD;
+        entity.Data = JsonConvert.SerializeObject(asnInfo);
+        entity.Status = 1;
+        entity.CreateBy = "PL017";
+        try
+        {
+            dynamic resultInfos = new ExpandoObject();
+            var result = m.AddAsnInfo(asnInfo);
+            resultInfos.tbBillList = result;
+
+            entity.Result = 0;
+            if (result) entity.Result = 1;
+            entity.DealWith = 1;
+            _manager.save(entity);
+
+            return new ResponseResult
             {
-                dynamic resultInfos = new ExpandoObject();
-                var result = m.AddAsnInfo(asnInfo);
-                resultInfos.tbBillList = result;
+                status = 0,
+                message = "OK",
+                data = resultInfos
+            };
+        }
+        catch (Exception ex)
+        {
+            entity.Result = 0;
+            entity.DealWith = 0;
+            entity.ResultData = ex.Message;
+            _manager.save(entity);
 
-                entity.Result = 0;
-                if (result) entity.Result = 1;
-                entity.DealWith = 1;
-                _manager.save(entity);
+            return ResponseResult.ResponseError(ex);
+        }
+    }
 
+    /// <summary>
+    ///     璁剧疆涓鐮�
+    /// </summary>
+    /// <returns></returns>
+    [HttpPost("SetMediumBoxCode")]
+    public ResponseResult SetMediumBoxCode(MesMiddleBox MesMiddleBox)
+    {
+        var entity = new MessageCenter();
+        entity.TableName = TableName;
+        entity.Url = URL + "SetMediumBoxCode";
+        entity.Method = METHOD;
+        entity.Data = JsonConvert.SerializeObject(MesMiddleBox);
+        entity.Status = 1;
+        entity.CreateBy = "PL017";
+        try
+        {
+            dynamic resultInfos = new ExpandoObject();
+            var result = m.SetMediumBoxCode(MesMiddleBox);
+            resultInfos.tbBillList = result;
+
+            entity.Result = 0;
+            if (result[0].ToBoolean()) entity.Result = 1;
+            entity.DealWith = 1;
+            _manager.save(entity);
+
+            if (result[0].ToBoolean())
                 return new ResponseResult
                 {
                     status = 0,
                     message = "OK",
                     data = resultInfos
                 };
-            }
-            catch (Exception ex)
-            {
-                entity.Result = 0;
-                entity.DealWith = 0;
-                entity.ResultData = ex.Message;
-                _manager.save(entity);
 
-                return ResponseResult.ResponseError(ex);
-            }
+            return new ResponseResult
+            {
+                status = 1,
+                message = result[1],
+                data = resultInfos
+            };
         }
-
-        /// <summary>
-        ///璁剧疆涓鐮�
-        /// </summary>
-        /// <returns></returns>
-        [HttpPost("SetMediumBoxCode")]
-        public ResponseResult SetMediumBoxCode(MesMiddleBox MesMiddleBox)
+        catch (Exception ex)
         {
-            var entity = new MessageCenter();
-            entity.TableName = TableName;
-            entity.Url = URL + "SetMediumBoxCode";
-            entity.Method = METHOD;
-            entity.Data = Newtonsoft.Json.JsonConvert.SerializeObject(MesMiddleBox);
-            entity.Status = 1;
-            entity.CreateBy = "PL017";
-            try
-            {
-                dynamic resultInfos = new ExpandoObject();
-                var result = m.SetMediumBoxCode(MesMiddleBox);
-                resultInfos.tbBillList = result;
+            entity.Result = 0;
+            entity.DealWith = 0;
+            entity.ResultData = ex.Message;
+            _manager.save(entity);
 
-                entity.Result = 0;
-                if (result[0].ToBoolean()) entity.Result = 1;
-                entity.DealWith = 1;
-                _manager.save(entity);
-
-                if (result[0].ToBoolean())
-                {
-                    return new ResponseResult
-                    {
-                        status = 0,
-                        message = "OK",
-                        data = resultInfos
-                    };
-                }
-                else {
-                    return new ResponseResult
-                    {
-                        status = 1,
-                        message = result[1],
-                        data = resultInfos
-                    };
-                }
-               
-            }
-            catch (Exception ex)
-            {
-                entity.Result = 0;
-                entity.DealWith = 0;
-                entity.ResultData = ex.Message;
-                _manager.save(entity);
-
-                return ResponseResult.ResponseError(ex);
-            }
-        }
-
-        /// <summary>
-        ///璁剧疆鏍堟澘鐮�
-        /// </summary>
-        /// <returns></returns>
-        [HttpPost("SetStackCode")]
-        public ResponseResult SetStackCode(MesPalletBinding mesPalletBinding)
-        {
-            var entity = new MessageCenter();
-            entity.TableName = TableName;
-            entity.Url = URL + "SetStackCode";
-            entity.Method = METHOD;
-            entity.Data = Newtonsoft.Json.JsonConvert.SerializeObject(mesPalletBinding);
-            entity.Status = 1;
-            entity.CreateBy = "PL017";
-            try
-            {
-                dynamic resultInfos = new ExpandoObject();
-                var result = m.SetStackCode(mesPalletBinding);
-                resultInfos.tbBillList = result;
-
-                entity.Result = 0;
-                if (result[0].ToBoolean()) entity.Result = 1;
-                entity.DealWith = 1;
-                _manager.save(entity);
-
-                if (result[0].ToBoolean())
-                {
-                    return new ResponseResult
-                    {
-                        status = 0,
-                        message = "OK",
-                        data = resultInfos
-                    };
-                }
-                else
-                {
-                    return new ResponseResult
-                    {
-                        status = 1,
-                        message = result[1],
-                        data = resultInfos
-                    };
-                }
-            }
-            catch (Exception ex)
-            {
-                entity.Result = 0;
-                entity.DealWith = 0;
-                entity.ResultData = ex.Message;
-                _manager.save(entity);
-
-                return ResponseResult.ResponseError(ex);
-            }
-        }
-
-        /// <summary>
-        ///瑙g粦sn鐮�
-        /// </summary>
-        /// <returns></returns>
-        [HttpPost("UnbindAsnInfo")]
-        public ResponseResult UnbindAsnInfo(UnbindAsnInfoDto unbindAsnInfoDto)
-        {
-            var entity = new MessageCenter();
-            entity.TableName = TableName;
-            entity.Url = URL + "UnbindAsnInfo";
-            entity.Method = METHOD;
-            entity.Data = Newtonsoft.Json.JsonConvert.SerializeObject(unbindAsnInfoDto);
-            entity.Status = 1;
-            entity.CreateBy = "PL017";
-            try
-            {
-                dynamic resultInfos = new ExpandoObject();
-                bool result = m.ProcessSn(unbindAsnInfoDto);
-                resultInfos.tbBillList = result;
-
-                entity.Result = 0;
-                if (result) entity.Result = 1;
-                entity.DealWith = 1;
-                _manager.save(entity);
-
-                if (result)
-                {
-                    return new ResponseResult
-                    {
-                        status = 0,
-                        message = "OK",
-                        data = resultInfos
-                    };
-                }
-                else
-                {
-                    return new ResponseResult
-                    {
-                        status = 1,
-                        message = result.ToString(),
-                        data = resultInfos
-                    };
-                }
-            }
-            catch (Exception ex)
-            {
-                entity.Result = 0;
-                entity.DealWith = 0;
-                entity.ResultData = ex.Message;
-                _manager.save(entity);
-
-                return ResponseResult.ResponseError(ex);
-            }
+            return ResponseResult.ResponseError(ex);
         }
     }
-}
+
+    /// <summary>
+    ///     璁剧疆鏍堟澘鐮�
+    /// </summary>
+    /// <returns></returns>
+    [HttpPost("SetStackCode")]
+    public ResponseResult SetStackCode(MesPalletBinding mesPalletBinding)
+    {
+        var entity = new MessageCenter();
+        entity.TableName = TableName;
+        entity.Url = URL + "SetStackCode";
+        entity.Method = METHOD;
+        entity.Data = JsonConvert.SerializeObject(mesPalletBinding);
+        entity.Status = 1;
+        entity.CreateBy = "PL017";
+        try
+        {
+            dynamic resultInfos = new ExpandoObject();
+            var result = m.SetStackCode(mesPalletBinding);
+            resultInfos.tbBillList = result;
+
+            entity.Result = 0;
+            if (result[0].ToBoolean()) entity.Result = 1;
+            entity.DealWith = 1;
+            _manager.save(entity);
+
+            if (result[0].ToBoolean())
+                return new ResponseResult
+                {
+                    status = 0,
+                    message = "OK",
+                    data = resultInfos
+                };
+
+            return new ResponseResult
+            {
+                status = 1,
+                message = result[1],
+                data = resultInfos
+            };
+        }
+        catch (Exception ex)
+        {
+            entity.Result = 0;
+            entity.DealWith = 0;
+            entity.ResultData = ex.Message;
+            _manager.save(entity);
+
+            return ResponseResult.ResponseError(ex);
+        }
+    }
+
+    /// <summary>
+    ///     瑙g粦sn鐮�
+    /// </summary>
+    /// <returns></returns>
+    [HttpPost("UnbindAsnInfo")]
+    public ResponseResult UnbindAsnInfo(UnbindAsnInfoDto unbindAsnInfoDto)
+    {
+        var entity = new MessageCenter();
+        entity.TableName = TableName;
+        entity.Url = URL + "UnbindAsnInfo";
+        entity.Method = METHOD;
+        entity.Data = JsonConvert.SerializeObject(unbindAsnInfoDto);
+        entity.Status = 1;
+        entity.CreateBy = "PL017";
+        try
+        {
+            dynamic resultInfos = new ExpandoObject();
+            var result = m.ProcessSn(unbindAsnInfoDto);
+            resultInfos.tbBillList = result;
+
+            entity.Result = 0;
+            if (result) entity.Result = 1;
+            entity.DealWith = 1;
+            _manager.save(entity);
+
+            if (result)
+                return new ResponseResult
+                {
+                    status = 0,
+                    message = "OK",
+                    data = resultInfos
+                };
+
+            return new ResponseResult
+            {
+                status = 1,
+                message = result.ToString(),
+                data = resultInfos
+            };
+        }
+        catch (Exception ex)
+        {
+            entity.Result = 0;
+            entity.DealWith = 0;
+            entity.ResultData = ex.Message;
+            _manager.save(entity);
+
+            return ResponseResult.ResponseError(ex);
+        }
+    }
+
+    /// <summary>
+    ///     鏌ヨ鏍堟澘鐮佺姸鎬�
+    /// </summary>
+    /// <returns></returns>
+    [HttpPost("GetStackCodeState")]
+    public ResponseResult GetStackCodeState(StackCodeStateDto request)
+    {
+        var entity = new MessageCenter();
+        entity.TableName = TableName;
+        entity.Url = URL + "GetStackCodeState";
+        entity.Method = METHOD;
+        entity.Data = JsonConvert.SerializeObject(request);
+        entity.Status = 1;
+        entity.CreateBy = "PL017";
+        try
+        {
+            dynamic resultInfos = new ExpandoObject();
+            var state = m.GetStackCodeState(request.StackCode);
+            resultInfos.state = state;
+
+            entity.Result = 1;
+            entity.DealWith = 1;
+            _manager.save(entity);
+
+            return new ResponseResult
+            {
+                status = state,
+                message = state == 1 ? "璇ユ爤鏉跨爜宸插叆搴擄紝涓嶅厑璁歌В缁�" : "鍏佽瑙g粦",
+                data = resultInfos
+            };
+        }
+        catch (Exception ex)
+        {
+            entity.Result = 0;
+            entity.DealWith = 0;
+            entity.ResultData = ex.Message;
+            _manager.save(entity);
+
+            return ResponseResult.ResponseError(ex);
+        }
+    }
+}
\ No newline at end of file

--
Gitblit v1.9.3