From 5505d694e0e7e33f0a312a0e077d49fa25ab00e3 Mon Sep 17 00:00:00 2001
From: yusijie <ysj@hz-kingdee.com>
Date: 星期三, 09 七月 2025 10:05:43 +0800
Subject: [PATCH] 车间定位库存查询;车间下架扫源单查库存位置;添康三周排产

---
 WebAPI/Controllers/MateOutController.cs                               |   49 ++++++++++++
 WebAPI/Controllers/SCGL/日计划管理/JIT_DayPlanPlatFormBillController.cs    |    4 
 WebAPI/Controllers/条码管理/WEBSController.cs                             |  145 +++++++++++++++++++++++++++++++++++
 WebAPI/Controllers/SCGL/日计划管理/JIT_DayPlanPlatFormBill_TKController.cs |   15 +++
 WebAPI/WebAPI.csproj                                                  |    1 
 5 files changed, 209 insertions(+), 5 deletions(-)

diff --git a/WebAPI/Controllers/MateOutController.cs b/WebAPI/Controllers/MateOutController.cs
index b21e366..cdc1b81 100644
--- a/WebAPI/Controllers/MateOutController.cs
+++ b/WebAPI/Controllers/MateOutController.cs
@@ -1116,6 +1116,55 @@
             }
         }
 
+        //鍒锋柊琛ㄤ綋 杞﹂棿瀹氫綅  杩斿洖杞﹂棿鍗虫椂搴撳瓨搴撳瓨淇℃伅缃戦〉PDA鐗�
+        [Route("KF_ICInventory_WorkShopByMaterID/GetWorkShopICInventory")]
+        [HttpGet]
+        public object GetWorkShopICInventory(string HBarCode, long sHWHID, long sHSPID, long HOWNERID, string sWhere)
+        {
+            try
+            {
+
+                SQLHelper.ClsCN oCN = new SQLHelper.ClsCN();
+                List<object> columnNameList = new List<object>();
+                DataSet ds = oCN.RunProcReturn("exec h_p_KF_ICInventory_WorkShopByMaterIDList '" + HBarCode + "'," + sHWHID + "," + sHSPID + "," + HOWNERID + ",'" + sWhere + "'", "h_p_KF_ICInventory_WorkShopByMaterIDList");
+                //娣诲姞鍒楀悕
+                foreach (DataColumn col in ds.Tables[0].Columns)
+                {
+                    Type dataType = col.DataType;
+                    string ColmString = "{\"ColmCols\":\"" + col.ColumnName + "\",\"ColmType\":\"" + dataType.Name + "\"}";
+                    columnNameList.Add(JsonConvert.DeserializeObject(ColmString));//鑾峰彇鍒癉ataColumn鍒楀璞$殑鍒楀悕
+                }
+
+                if (ds == null || ds.Tables[0].Rows.Count <= 0)
+                {
+                    objJsonResult.code = "0";
+                    objJsonResult.count = 0;
+                    objJsonResult.Message = "娌℃湁杩斿洖浠讳綍璁板綍锛�";
+                    objJsonResult.data = null;
+                    return objJsonResult;
+                    //DBUtility.ClsPub.MessageBeep((int)DBUtility.ClsPub.BeepType.Warning);
+                }
+                else
+                {
+                    objJsonResult.code = "1";
+                    objJsonResult.count = 1;
+                    objJsonResult.Message = "鑾峰彇淇℃伅鎴愬姛锛�";
+                    objJsonResult.data = ds.Tables[0];
+                    objJsonResult.list = columnNameList;
+                    return objJsonResult;
+                }
+            }
+            catch (Exception e)
+            {
+
+                objJsonResult.code = "0";
+                objJsonResult.count = 0;
+                objJsonResult.Message = "娌℃湁杩斿洖浠讳綍璁板綍锛�" + e.ToString();
+                objJsonResult.data = null;
+                return objJsonResult;
+            }
+        }
+
         [Route("MateOutBill/Delete_Json")]
         [HttpGet]
         public object Delete_Json(long HInterID, long HMaterID, long HAuxPropID, string HMTONo, long HSourceInterID, long HSourceEntryID, string sHBillType)
diff --git "a/WebAPI/Controllers/SCGL/\346\227\245\350\256\241\345\210\222\347\256\241\347\220\206/JIT_DayPlanPlatFormBillController.cs" "b/WebAPI/Controllers/SCGL/\346\227\245\350\256\241\345\210\222\347\256\241\347\220\206/JIT_DayPlanPlatFormBillController.cs"
index cca468b..219e637 100644
--- "a/WebAPI/Controllers/SCGL/\346\227\245\350\256\241\345\210\222\347\256\241\347\220\206/JIT_DayPlanPlatFormBillController.cs"
+++ "b/WebAPI/Controllers/SCGL/\346\227\245\350\256\241\345\210\222\347\256\241\347\220\206/JIT_DayPlanPlatFormBillController.cs"
@@ -1981,13 +1981,13 @@
                         sqlName = "AIS20210811135644";
                     }
 
-                    if (WMS_CampanyName == "瀹濆伐")
+                    if (WMS_CampanyName == "瀹濆伐" || WMS_CampanyName == "娣诲悍绉戞妧")
                     {
                         objJsonResult = (json)JIT_MOMaterLack(fProWorkShopId, fPrdOrgId, user);
                     }
                     else if (HTLType == "缂烘枡")
                     {
-                        if (WMS_CampanyName == "甯呭▉" || WMS_CampanyName == "鍑礉濂堢壒" || WMS_CampanyName == "娣诲悍绉戞妧")
+                        if (WMS_CampanyName == "甯呭▉" || WMS_CampanyName == "鍑礉濂堢壒" /*|| WMS_CampanyName == "娣诲悍绉戞妧"*/)
                         {
                             objJsonResult = (json)JIT_QL(fProWorkShopId, fPrdOrgId, user, sqlName);
                         }
diff --git "a/WebAPI/Controllers/SCGL/\346\227\245\350\256\241\345\210\222\347\256\241\347\220\206/JIT_DayPlanPlatFormBill_TKController.cs" "b/WebAPI/Controllers/SCGL/\346\227\245\350\256\241\345\210\222\347\256\241\347\220\206/JIT_DayPlanPlatFormBill_TKController.cs"
index 92cbdfb..0418cb5 100644
--- "a/WebAPI/Controllers/SCGL/\346\227\245\350\256\241\345\210\222\347\256\241\347\220\206/JIT_DayPlanPlatFormBill_TKController.cs"
+++ "b/WebAPI/Controllers/SCGL/\346\227\245\350\256\241\345\210\222\347\256\241\347\220\206/JIT_DayPlanPlatFormBill_TKController.cs"
@@ -243,7 +243,20 @@
 
                     LogService.Write($"========================1.鎺掍骇涓昏〃澶勭悊鐢ㄦ椂锛�" + sw.Elapsed);
 
-                    int SumDay = 180; //鍔ㄦ�佸叚鏈堜箣宸� DateTime.Now.AddMonths(1).AddDays(-1).Subtract(DateTime.Now).Days;
+                    int SumDay = 0; //鍔ㄦ�佸叚鏈堜箣宸� DateTime.Now.AddMonths(1).AddDays(-1).Subtract(DateTime.Now).Days;
+
+                    // 缁熻鎬诲ぉ鏁�
+                    HashSet<DateTime> uniqueDates = new HashSet<DateTime>();
+
+                    foreach (var key in list[i].Keys)
+                    {
+                        if (DateTime.TryParseExact(key, "yyyy-M-d", CultureInfo.InvariantCulture, DateTimeStyles.None, out DateTime date))
+                        {
+                            uniqueDates.Add(date);
+                        }
+                    }
+
+                    SumDay = uniqueDates.Count;
 
                     LogService.CustomWriteLog("2.3:" + i, DateTime.Now.ToString("yyyy-MM-dd"));
                     for (int j = 0; j < SumDay; j++)
diff --git "a/WebAPI/Controllers/\346\235\241\347\240\201\347\256\241\347\220\206/WEBSController.cs" "b/WebAPI/Controllers/\346\235\241\347\240\201\347\256\241\347\220\206/WEBSController.cs"
index 92184d2..c789152 100644
--- "a/WebAPI/Controllers/\346\235\241\347\240\201\347\256\241\347\220\206/WEBSController.cs"
+++ "b/WebAPI/Controllers/\346\235\241\347\240\201\347\256\241\347\220\206/WEBSController.cs"
@@ -4409,7 +4409,7 @@
         /// 灏忚溅閿佸畾鍗曟柊澧炰笂浼�
         /// </summary>
         /// <returns></returns>
-        [Route("WEBSController/set_SaveTrolleyPositionBill_Json2")]
+        [Route("WEBSController/set_SaveTrolleyPositionBill_Json")]
         [HttpPost]
         public object set_SaveTrolleyPositionBill_Json([FromBody] JObject msg)
         {
@@ -8570,7 +8570,7 @@
         #endregion
 
 
-        #region 涓婃灦銆佷笅鏋跺崟妯″潡璋冪敤鏂规硶     20250520
+        #region 涓婃灦銆佷笅鏋跺崟銆佸皬杞﹂攣瀹氭ā鍧楄皟鐢ㄦ柟娉�     20250520
 
         #region 涓嬫灦鍗曟壂鐮佹ā鍧�  鎵弿婧愬崟鏉$爜璋冪敤鏂规硶
         /// <summary>
@@ -8767,6 +8767,147 @@
         }
         #endregion
 
+        #region 涓嬫灦鍗曟ā鍧楋紝鎵簮鍗曟潯鐮佹煡璇㈢墿鏂欏簱瀛樹俊鎭�
+
+        /// <summary>
+        /// 鑾峰彇鍗曟嵁鍒楄〃淇℃伅
+        /// </summary>
+        /// <returns></returns>
+        [Route("WEBSController/MaterialLowerBill_MaterInv")]
+        [HttpGet]
+        public object MaterialLowerBill_MaterInv(long HInterID, string HBillNo, string HBillType, Int64 HStockOrgID)
+        {
+            try
+            {               
+                ds = oCn.RunProcReturn("exec h_p_Kf_MaterialInventory " + HInterID + "," + HBillType + "," + HStockOrgID, "h_p_Kf_MaterialInventory");
+                if (ds == null || ds.Tables[0].Rows.Count == 0)
+                {
+                    objJsonResult.code = "0";
+                    objJsonResult.count = 0;
+                    objJsonResult.Message = "娌℃湁杩斿洖浠讳綍璁板綍锛�";
+                    objJsonResult.data = null;
+                    return objJsonResult;
+                }
+                else
+                {
+                    List<object> columnNameList = new List<object>();
+                    //娣诲姞鍒楀悕
+                    foreach (DataColumn col in ds.Tables[0].Columns)
+                    {
+                        Type dataType = col.DataType;
+                        string ColmString = "{\"ColmCols\":\"" + col.ColumnName + "\",\"ColmType\":\"" + dataType.Name + "\"}";
+                        columnNameList.Add(JsonConvert.DeserializeObject(ColmString));  //鑾峰彇鍒癉ataColumn鍒楀璞$殑鍒楀悕
+                    }
+                    objJsonResult.code = "0";
+                    objJsonResult.count = 1;
+                    objJsonResult.Message = "鑾峰彇淇℃伅鎴愬姛锛�";
+                    objJsonResult.data = ds.Tables[0];
+                    objJsonResult.list = columnNameList;
+                    return objJsonResult;
+                }
+            }
+            catch (Exception e)
+            {
+                objJsonResult.code = "0";
+                objJsonResult.count = 0;
+                objJsonResult.Message = "鑾峰彇鍒楄〃淇℃伅澶辫触锛�" + e.ToString();
+                objJsonResult.data = null;
+                return objJsonResult;
+            }
+        }
+
+        #endregion
+
+        #region 灏忚溅鎵爜缁戝畾鏃讹紝鍒ゆ柇鍏舵槸鍚﹀凡缁戝畾搴撲綅淇℃伅
+        [Route("WEBSController/CarIsused")]
+        [HttpGet]
+        public object CarIsused(string HCarBarCode)
+        {
+            try
+            {
+                ds = oCn.RunProcReturn("select * from h_v_Gy_MouldIsUsed where 灏忚溅鏉$爜='" + HCarBarCode + "'" , "h_v_Gy_MouldIsUsed");
+                if (ds == null || ds.Tables[0].Rows.Count == 0)
+                {
+                    objJsonResult.code = "0";
+                    objJsonResult.count = 0;
+                    objJsonResult.Message = "灏忚溅鏉$爜锛�" + HCarBarCode + "锛屼笉鍦ㄧ郴缁熶腑锛岃鏍稿锛�";
+                    objJsonResult.data = null;
+                    return objJsonResult;
+                }
+                else
+                {
+                    List<object> columnNameList = new List<object>();
+                    //娣诲姞鍒楀悕
+                    foreach (DataColumn col in ds.Tables[0].Columns)
+                    {
+                        Type dataType = col.DataType;
+                        string ColmString = "{\"ColmCols\":\"" + col.ColumnName + "\",\"ColmType\":\"" + dataType.Name + "\"}";
+                        columnNameList.Add(JsonConvert.DeserializeObject(ColmString));  //鑾峰彇鍒癉ataColumn鍒楀璞$殑鍒楀悕
+                    }
+                    objJsonResult.code = "1";
+                    objJsonResult.count = 1;
+                    objJsonResult.Message = "鎴愬姛锛�";
+                    objJsonResult.data = ds.Tables[0];
+                    objJsonResult.list = columnNameList;
+                    return objJsonResult;
+                }
+            }
+            catch (Exception e)
+            {
+                objJsonResult.code = "0";
+                objJsonResult.count = 0;
+                objJsonResult.Message = "鏌ヨ灏忚溅鍦ㄥ簱鐘舵�佸け璐rr锛�" + e.ToString();
+                objJsonResult.data = null;
+                return objJsonResult;
+            }
+        }
+        #endregion
+
+        #region 灏忚溅缁戝畾鏈哄彴鏃讹紝鍒ゆ柇鎵�鎵満鍙帮紙璁惧锛夋潯鐮佹槸鍚﹀瓨鍦ㄤ簬璁惧妗f
+        [Route("WEBSController/IsExistEquip")]
+        [HttpGet]
+        public object IsExistEquip(string HEquipBarCode)
+        {
+            try
+            {
+                ds = oCn.RunProcReturn("select * from h_v_Gy_EquipIsExist where 鏈哄彴鏉$爜='" + HEquipBarCode + "'", "h_v_Gy_EquipIsExist");
+                if (ds == null || ds.Tables[0].Rows.Count == 0)
+                {
+                    objJsonResult.code = "0";
+                    objJsonResult.count = 0;
+                    objJsonResult.Message = "鏈哄彴鏉$爜锛�" + HEquipBarCode + "锛屼笉鍦ㄧ郴缁熶腑锛岃鏍稿锛�";
+                    objJsonResult.data = null;
+                    return objJsonResult;
+                }
+                else
+                {
+                    List<object> columnNameList = new List<object>();
+                    //娣诲姞鍒楀悕
+                    foreach (DataColumn col in ds.Tables[0].Columns)
+                    {
+                        Type dataType = col.DataType;
+                        string ColmString = "{\"ColmCols\":\"" + col.ColumnName + "\",\"ColmType\":\"" + dataType.Name + "\"}";
+                        columnNameList.Add(JsonConvert.DeserializeObject(ColmString));  //鑾峰彇鍒癉ataColumn鍒楀璞$殑鍒楀悕
+                    }
+                    objJsonResult.code = "1";
+                    objJsonResult.count = 1;
+                    objJsonResult.Message = "鎴愬姛锛�";
+                    objJsonResult.data = ds.Tables[0];
+                    objJsonResult.list = columnNameList;
+                    return objJsonResult;
+                }
+            }
+            catch (Exception e)
+            {
+                objJsonResult.code = "0";
+                objJsonResult.count = 0;
+                objJsonResult.Message = "鏌ヨ鏈哄彴淇℃伅澶辫触err锛�" + e.ToString();
+                objJsonResult.data = null;
+                return objJsonResult;
+            }
+        }
+        #endregion
+
         #endregion
 
 
diff --git a/WebAPI/WebAPI.csproj b/WebAPI/WebAPI.csproj
index b2f76b0..48200db 100644
--- a/WebAPI/WebAPI.csproj
+++ b/WebAPI/WebAPI.csproj
@@ -449,6 +449,7 @@
     <Compile Include="Controllers\SBGL\Sb_EquipPatrolCheckRuleBillController.cs" />
     <Compile Include="Controllers\SBGL\Sb_EquipPatrolCheckPlanBillController.cs" />
     <Compile Include="Controllers\SBGL\Sb_EquipPatrolCheckBillController.cs" />
+    <Compile Include="Controllers\SCGL\鏃ヨ鍒掔鐞哱JIT_DayPlanPlatFormBill_TKController.cs" />
     <Compile Include="Controllers\XSGL\Crm_ComplainVisitBillController.cs" />
     <Compile Include="Controllers\XSGL\Xs_SellOutBillList_SecController.cs" />
     <Compile Include="Controllers\XSGL\Xs_SeQuotationBillController.cs" />

--
Gitblit v1.9.1