From 2de09bec5cc05bf875543fa8956167ca7db73021 Mon Sep 17 00:00:00 2001
From: 刘磊 <1161824510@qq.com>
Date: 星期三, 25 六月 2025 11:36:44 +0800
Subject: [PATCH] 合并

---
 项目代码/WMS/WIDESEA_WMSServer/WIDESEA_StorageBasicServices/Boxing/Dt_CZInfo_mesService.cs |   98 +++++++++++++++++++++++++++++++++++++++++++++++++
 1 files changed, 98 insertions(+), 0 deletions(-)

diff --git "a/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_StorageBasicServices/Boxing/Dt_CZInfo_mesService.cs" "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_StorageBasicServices/Boxing/Dt_CZInfo_mesService.cs"
index d2caa3e..ef2c54d 100644
--- "a/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_StorageBasicServices/Boxing/Dt_CZInfo_mesService.cs"
+++ "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_StorageBasicServices/Boxing/Dt_CZInfo_mesService.cs"
@@ -3,6 +3,8 @@
 using Microsoft.EntityFrameworkCore.Metadata.Internal;
 using System.ComponentModel.DataAnnotations;
 using WIDESEA_Core;
+using WIDESEA_DTO;
+using WIDESEA_IStoragIntegrationServices;
 using WIDESEA_StorageBasicRepository;
 
 namespace WIDESEA_StorageBasicService;
@@ -199,4 +201,100 @@
         // 杩斿洖楠岃瘉缁撴灉鍒楄〃
         return validationResults;
     }
+
+
+    public WebResponseContent RequestAxleloading(RequestTaskDto input)
+    {
+        WebResponseContent content = new WebResponseContent();
+        try
+        {
+            Dt_CZInfo_mes CZInfot = BaseDal.QueryFirst(x => x.CurrentStatue == "1" || x.CurrentStatue == "11");
+            
+            if (CZInfot != null)
+            {
+                CZInfot.CurrentStatue = CZInfot.CurrentStatue=="1"?"2":"12";
+                BaseDal.UpdateData(CZInfot);
+                return content.OK(data: CZInfot.CZTM);
+            }
+            else
+            {
+                return content.Error("鏈壘鍒伴渶瑕佷笂鏋剁殑杞﹁酱鏉$爜");
+            }
+        }
+        catch (Exception ex)
+        {
+            return content.Error(ex.Message);
+        }
+    }
+
+    public WebResponseContent UpdateAxleCurrentStatue(RequestTaskDto input)
+    {
+
+        WebResponseContent content = new WebResponseContent();
+        try
+        {
+            Dt_CZInfo_mes CZInfot = BaseDal.QueryFirst(x => x.CZTM == input.PalletCode);
+
+            if (CZInfot != null)
+            {
+                if (CZInfot.CurrentStatue == "2")
+                {
+                    CZInfot.CurrentStatue = "3";
+                }
+                else if (CZInfot.CurrentStatue == "12")
+                {
+                    CZInfot.CurrentStatue = "13";
+
+                }
+                else
+                {
+                    return content.Error($"鏈壘鍒扮敵璇疯溅杞存潯鐮佷俊鎭紝鐘舵�佷笉涓鸿緭閫佺嚎杩愯涓紝鐢宠鏉$爜锛歿input.PalletCode}");
+                }
+
+                BaseDal.UpdateData(CZInfot);    //鍏堜慨鏀逛簡鐘舵��
+                return content.OK();
+            }
+            else
+            {
+                return content.Error($"鏈壘鍒扮敵璇疯溅杞存潯鐮佷俊鎭紝鐢宠鏉$爜锛歿input.PalletCode}");
+            }
+        }
+        catch (Exception ex)
+        {
+            return content.Error($"鏇存柊杞﹁酱淇℃伅鐘舵�佸嚭閿欙紝鐢宠鏉$爜锛歿input.PalletCode},閿欒淇℃伅锛歿ex.Message}");
+        }
+    }
+
+    public override WebResponseContent UpdateData(SaveModel saveModel)
+    {
+        WebResponseContent webResponse = new WebResponseContent();
+        try
+        {
+            int id = int.Parse(saveModel.MainData["id"]?.ToString());
+            string cztm = saveModel.MainData["cztm"]?.ToString();
+            if (string.IsNullOrEmpty(cztm))
+                throw new Exception($"杞﹁酱鍙蜂负绌�");
+            string currentStatue = saveModel.MainData["currentStatue"]?.ToString();
+            if (string.IsNullOrEmpty(currentStatue))
+                throw new Exception($"杞﹁酱鐘舵�佷负绌�");
+            Dt_CZInfo_mes CZInfot = BaseDal.QueryFirst(x => x.ID == id);
+            if (CZInfot != null)
+            {
+                CZInfot.CZTM = cztm;
+                CZInfot.CurrentStatue = currentStatue;
+                BaseDal.UpdateData(CZInfot);    //鍏堜慨鏀逛簡鐘舵��
+                return webResponse.OK($"淇敼鎴愬姛");
+            }
+            else
+            {
+                return webResponse.Error($"淇敼澶辫触锛屾湭鎵惧埌杞﹁酱淇℃伅");
+            }
+        }
+        catch (Exception ex)
+        {
+            return webResponse.Error($"淇敼澶辫触锛岄敊璇俊鎭細{ex.Message}");
+            throw;
+        }
+    }
+
 }
\ No newline at end of file

--
Gitblit v1.9.3