From afbd33474dfd3f9f19b0829cf9d544a5afae1249 Mon Sep 17 00:00:00 2001
From: hudong <Administrator@PC-20250329JZUF>
Date: 星期三, 04 六月 2025 17:02:48 +0800
Subject: [PATCH] 1.增加出库任务大屏接口 实体类 测试流程 2.空托出入库 半托 先进先出逻辑优化

---
 models/TN_DPRECORD.cs                 |   19 +++++++++
 models/TN_Distribution_CNTR.cs        |    5 ++
 models/TN_Distribution_CNTR_Detail.cs |    8 ++--
 models/DAPING.cs                      |   13 ++++++
 models/SapRoot.cs                     |    7 +++
 core/WMSCore.cs                       |   21 ++++++++++
 api/WmsSapController.cs               |   33 +++++++++++++++-
 HH.WCS.Mobox3.pinggao.csproj          |    1 
 8 files changed, 98 insertions(+), 9 deletions(-)

diff --git a/HH.WCS.Mobox3.pinggao.csproj b/HH.WCS.Mobox3.pinggao.csproj
index 81102a3..207420b 100644
--- a/HH.WCS.Mobox3.pinggao.csproj
+++ b/HH.WCS.Mobox3.pinggao.csproj
@@ -194,6 +194,7 @@
     <Compile Include="models\OutboundRecord.cs" />
     <Compile Include="models\SapReturn.cs" />
     <Compile Include="models\SapRoot.cs" />
+    <Compile Include="models\TN_DPRECORD.cs" />
     <Compile Include="models\TN_GENERATE_ORDER.cs" />
     <Compile Include="models\TN_Location_Ext.cs" />
     <Compile Include="models\TN_Ll_detail.cs" />
diff --git a/api/WmsSapController.cs b/api/WmsSapController.cs
index ea23188..36d464b 100644
--- a/api/WmsSapController.cs
+++ b/api/WmsSapController.cs
@@ -25,12 +25,39 @@
 {
     public class WmsSapController : System.Web.Http.ApiController
     {
-
-        #region 澶у睆鏁版嵁鎺ュ彛
         /// <summary>
-        /// 澶у睆鏁版嵁
+        /// 鍑哄韩浠诲嫏鍒楄〃
         /// </summary>
         /// <returns></returns>
+        public DPList DpRecord(DpDto dpDto)
+        {
+            var response = new DPList
+            {
+                DpList = new List<DP> { }
+            };
+            if (string.IsNullOrEmpty(dpDto.Code))
+            {
+                LogHelper.Info("璐т綅淇℃伅涓嶈兘涓虹┖" );
+                return response;
+            }
+            var db = new SqlHelper<object>().GetInstance();
+            var list =db.Queryable<TN_DPRECORD>().Where(s=>s.S_LOCATION== dpDto.Code).OrderByDescending(s=>s.T_CREATE).ToList();
+            var tasksList = list.Select(t => new DP
+            {
+                S_NO = t.S_NO,
+                S_WLBM = t.S_WLBM,
+                N_COUNT = t.N_COUNT,
+                S_LOCATION = t.S_LOCATION
+            }).ToList();
+            response.DpList = tasksList;
+            return response;
+
+        }
+        #region 澶у睆鏁版嵁鎺ュ彛
+            /// <summary>
+            /// 澶у睆鏁版嵁
+            /// </summary>
+            /// <returns></returns>
         public BarChartResponse InOut(){
 
             var response = new BarChartResponse
diff --git a/core/WMSCore.cs b/core/WMSCore.cs
index 81845a2..ecb6685 100644
--- a/core/WMSCore.cs
+++ b/core/WMSCore.cs
@@ -1,4 +1,5 @@
-锘縰sing HH.WCS.Mobox3.pinggao.util;
+锘縰sing HH.WCS.Mobox3.pinggao.models;
+using HH.WCS.Mobox3.pinggao.util;
 using HH.WCS.Mobox3.pinggao.wms;
 using System;
 using System.Collections.Generic;
@@ -82,6 +83,8 @@
                                     item.S_B_STATE = "浣滀笟鍚姩";
                                     item.S_SORT_TYPE = "寰呭垎鎷�;
                                     db.Updateable(item).UpdateColumns(it => new { it.S_B_STATE, it.N_B_STATE,it.S_SORT_TYPE }).ExecuteCommand();
+
+                             
                                 }
                             }
                             else
@@ -507,6 +510,22 @@
                                     a.S_B_STATE = "鎵ц";
                                     WMSHelper.UpdateTaskState(a);
                                 }
+
+                                var detail = db.Queryable<TN_Distribution_CNTR_Detail>().Where(s => s.S_DC_NO == a.S_BS_NO).ToList();
+                                List<TN_DPRECORD> listdp=new List<TN_DPRECORD>(); 
+                                foreach (var item in detail)
+                                {
+                                    TN_DPRECORD tN_DPRECORD = new TN_DPRECORD();
+                                    tN_DPRECORD.S_WLBM=item.S_ITEM_CODE;
+                                    tN_DPRECORD.S_NO= wcsTask.S_CODE;
+                                    tN_DPRECORD.N_COUNT= item.F_QTY;
+                                    tN_DPRECORD.S_LOCATION= end.S_CODE;
+                                    listdp.Add(tN_DPRECORD);
+                                }
+                                if (listdp.Count()>0)
+                                {
+                                    db.Insertable<TN_DPRECORD>(listdp).ExecuteCommand();
+                                }
                             }
                             else
                             {
diff --git a/models/DAPING.cs b/models/DAPING.cs
index 3d90652..9b8e5f6 100644
--- a/models/DAPING.cs
+++ b/models/DAPING.cs
@@ -8,6 +8,19 @@
 {
     public class DAPING
     {
+        public class DPList {
+
+            public List<DP> DpList { get; set; }
+
+
+        }
+        public class DP {
+
+            public string S_NO { get; set; }
+            public string S_WLBM { get; set; }
+            public double N_COUNT { get; set; }
+            public string S_LOCATION { get; set; }
+        }
         public class BarChartResponse
         {
             public List<BarChartData> OutboundData { get; set; }  // 鍑哄簱鏁版嵁锛�-12鏈堬級
diff --git a/models/SapRoot.cs b/models/SapRoot.cs
index bf590a3..d0b26f1 100644
--- a/models/SapRoot.cs
+++ b/models/SapRoot.cs
@@ -11,6 +11,13 @@
     [XmlType("SapRootDtoROOT")]
     public class SapRoot
     {
+        public class DpDto
+        {
+            /// <summary>
+            /// 
+            /// </summary>
+            public string  Code { get; set; }
+        }
 
 
         #region 澶栭噰鏀惰揣鍏ュ弬
diff --git a/models/TN_DPRECORD.cs b/models/TN_DPRECORD.cs
new file mode 100644
index 0000000..6b6f466
--- /dev/null
+++ b/models/TN_DPRECORD.cs
@@ -0,0 +1,19 @@
+锘縰sing SqlSugar;
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace HH.WCS.Mobox3.pinggao.models
+{
+    [SugarTable("TN_DPRECORD")]
+    public class TN_DPRECORD : BaseModel
+   
+    {
+        public string S_NO { get; set; }
+        public string S_WLBM { get; set; }
+        public double N_COUNT { get; set; }
+        public string S_LOCATION { get; set; }
+    }
+}
diff --git a/models/TN_Distribution_CNTR.cs b/models/TN_Distribution_CNTR.cs
index 0a1823f..656f55e 100644
--- a/models/TN_Distribution_CNTR.cs
+++ b/models/TN_Distribution_CNTR.cs
@@ -1,6 +1,7 @@
 using HH.WCS.Mobox3.pinggao.models;
 using SqlSugar;
 using System;
+using System.Collections.Generic;
 
 
 namespace HH.WCS.Mobox3.pinggao
@@ -89,7 +90,9 @@
         /// 终点货位
         /// </summary>
         public string S_END_LOC { get; set; }
-        
+        [SugarColumn(IsIgnore = true)]
+        [Navigate(NavigateType.OneToMany, nameof(TN_Distribution_CNTR.S_DC_NO), nameof(S_DC_NO))]
+        public List<TN_Distribution_CNTR_Detail> Details { get; set; }
         #region 新增字段
         /// <summary>
         /// 是否反拣
diff --git a/models/TN_Distribution_CNTR_Detail.cs b/models/TN_Distribution_CNTR_Detail.cs
index e168348..66798d5 100644
--- a/models/TN_Distribution_CNTR_Detail.cs
+++ b/models/TN_Distribution_CNTR_Detail.cs
@@ -95,10 +95,10 @@
         /// 累计配货数量
         /// </summary>
         public double F_ACC_P_QTY { get; set; }
-        /// <summary>
-        /// 剩余配货数量
-        /// </summary>
-        public double F_PUT_QTY { get; set; }
+        ///// <summary>
+        ///// 剩余配货数量
+        ///// </summary>
+        //public double F_PUT_QTY { get; set; }
         ///// <summary>
         ///// ERP仓库
         ///// </summary>

--
Gitblit v1.9.1