From c258d3f29d6849270460f50de01af36aca8c2225 Mon Sep 17 00:00:00 2001
From: cjs <2216046164@qq.com>
Date: 星期五, 04 七月 2025 17:26:29 +0800
Subject: [PATCH] 11

---
 HH.WCS.Mobox3.NongFuLinZhi/models/Container.cs    |   31 +++++++++++++++++++++++--------
 HH.WCS.Mobox3.NongFuLinZhi/process/TaskProcess.cs |   18 +++++++++++++++++-
 HH.WCS.Mobox3.NongFuLinZhi/api/ApiHelper.cs       |    1 +
 3 files changed, 41 insertions(+), 9 deletions(-)

diff --git a/HH.WCS.Mobox3.NongFuLinZhi/api/ApiHelper.cs b/HH.WCS.Mobox3.NongFuLinZhi/api/ApiHelper.cs
index 5e3f3fa..cf68c37 100644
--- a/HH.WCS.Mobox3.NongFuLinZhi/api/ApiHelper.cs
+++ b/HH.WCS.Mobox3.NongFuLinZhi/api/ApiHelper.cs
@@ -707,6 +707,7 @@
                         string cntrCode = cntrList[i].S_CNTR_CODE;
                         db.Deleteable<CntrItemRel>().Where(a => a.S_CNTR_CODE == cntrCode).ExecuteCommand();
                         db.Deleteable<LocCntrRel>().Where(a => a.S_CNTR_CODE == cntrCode).ExecuteCommand();
+                        db.Deleteable<Container>().Where(a => a.S_CODE == cntrCode).ExecuteCommand();
                     }
                 }
                 locInfo.N_CURRENT_NUM = locInfo.N_CURRENT_NUM - 1;
diff --git a/HH.WCS.Mobox3.NongFuLinZhi/models/Container.cs b/HH.WCS.Mobox3.NongFuLinZhi/models/Container.cs
index ec1865d..a81e602 100644
--- a/HH.WCS.Mobox3.NongFuLinZhi/models/Container.cs
+++ b/HH.WCS.Mobox3.NongFuLinZhi/models/Container.cs
@@ -16,6 +16,10 @@
         /// </summary>
         public string S_TYPE { get; set; }
         /// <summary>
+        /// 类型值
+        /// </summary>
+        public int N_TYPE { get; set; }
+        /// <summary>
         /// 规格
         /// </summary>
         public string S_SPEC { get; set; }
@@ -23,20 +27,16 @@
         /// 自重
         /// </summary>
         public float F_WEIGHT { get; set; }
-        public float F_LOAD_WEIGHT { get; set; }
+        /// <summary>
+        /// 最大容量
+        /// </summary>
+        public float F_MAX_CAP {  get; set; }
         /// <summary>
         /// 最大重量
         /// </summary>
         public float F_MAX_WEIGHT { get; set; }
-        public int N_LENGTH { get; set; }
-        public int N_WIDTH { get; set; }
-        public int N_HEIGHT { get; set; }
         public string C_IS_VIRTUAL { get; set; } = "N";
-        public int N_TYPE { get; set; }
         public string C_ENABLE { get; set; } = "Y";
-        public string S_STATE_PRE { get; set; }
-        public int N_REVIEW_RESULT { get; set; }
-
         /// <summary>
         /// 明细条数
         /// </summary>
@@ -45,6 +45,21 @@
         public string S_LOCK_OP_CODE { get; set; }
         public string S_LOCK_STATE { get; set; }
         public int N_LOCK_STATE { get; set; }
+        public float F_GOOD_WEIGHT { get; set; }
+        public float F_MAX_VOLUME {  get; set; }
+        public float F_GOOD_VOLUME {  get; set; }
+        public string C_FULL { get; set; }
+        public int N_EMPTY_FULL { get; set; }
+        public int N_MAX_CELL_NUM { get; set; }
+        public int N_EMPTY_CELL_NUM { get; set; }
+        public float F_LENGTH { get; set; }
+        public float F_WIDTH { get; set; }
+        public float F_HEIGHT { get; set; }
+        public string S_POSITION { get; set; }
+        public int N_GOOD_NUM { get; set; }
+        public int N_ALLOC_CELL_NUM { get; set; }
+        public string S_SOURCE { get; set; }
+        public float F_ACT_WEIGHT { get; set; }
         /// <summary>
         /// 码盘时候标记
         /// </summary>
diff --git a/HH.WCS.Mobox3.NongFuLinZhi/process/TaskProcess.cs b/HH.WCS.Mobox3.NongFuLinZhi/process/TaskProcess.cs
index 8bf9e63..97110a5 100644
--- a/HH.WCS.Mobox3.NongFuLinZhi/process/TaskProcess.cs
+++ b/HH.WCS.Mobox3.NongFuLinZhi/process/TaskProcess.cs
@@ -1865,7 +1865,23 @@
                     {
                         var cir = new LocCntrRel { S_LOC_CODE = loc, S_CNTR_CODE = cntrCode, S_SRC = deviceName };
                         if (db.Insertable<LocCntrRel>(cir).ExecuteCommand() > 0) LogHelper.Info($"璐т綅瀹瑰櫒琛ㄧ粦瀹氭垚鍔燂紝璐т綅鍙凤細{loc}锛屾墭鐩樺彿锛歿cntrCode}");
-                        BindCntrItem(cntrCode, itemCode, batchNo, itemlayer);
+                        var Con = db.Queryable<Container>().Where(a => a.S_CODE == cntrCode).First();
+                        if(Con == null)
+                        {
+                            if(db.Insertable<Container>(new Container
+                            {
+                                S_CODE = cntrCode,
+                                N_TYPE = 1,
+                                N_DETAIL_COUNT = 1
+                            }).ExecuteCommand() > 0)
+                            {
+                                LogHelper.Info($"瀹瑰櫒琛ㄧ粦瀹氭垚鍔燂紝鎵樼洏鍙凤細{cntrCode}");
+                            }
+                        }
+                        if (!string.IsNullOrEmpty(itemCode))
+                        {
+                            BindCntrItem(cntrCode, itemCode, batchNo, itemlayer);
+                        }
                     }
                 }
             });

--
Gitblit v1.9.1