From 5bc3864159dcd60f368c1cac81eab56298701fff Mon Sep 17 00:00:00 2001
From: llj <132905093+newwwwwwtree@users.noreply.github.com>
Date: 星期二, 29 七月 2025 13:57:52 +0800
Subject: [PATCH] 1

---
 WebAPI/Controllers/SCGL/日计划管理/JIT_DayPlanPlatFormBillController.cs |  132 +++++++++++++++++++++++++++++++++++++++++--
 1 files changed, 125 insertions(+), 7 deletions(-)

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 a791c99..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"
@@ -62,6 +62,54 @@
             }
         }
 
+        [Route("JIT_DayPlanPlatFormBill/JIT_DayPlanPlatFormBillListExtendMakeDate")]
+        [HttpGet]
+        public object JIT_DayPlanPlatFormBillListExtendMakeDate(string sWhere, string user)
+        {
+            try
+            {
+                //鏌ョ湅鏉冮檺
+                if (!DBUtility.ClsPub.Security_Log("Sc_WorkBillSortBill_Query", 1, false, user))
+                {
+                    objJsonResult.code = "0";
+                    objJsonResult.count = 0;
+                    objJsonResult.Message = "鏃犳煡鐪嬫潈闄愶紒";
+                    objJsonResult.data = null;
+                    return objJsonResult;
+                }
+
+                List<object> columnNameList = new List<object>();  //瀹氫箟澹版槑鍙橀噺 锛屾妸閫氳繃 new List<object>()鍒涘缓鐨� 瀹炰緥锛岃祴鍊肩粰鍙橀噺
+                omdelMian = JsonConvert.DeserializeObject<Sc_WorkBillSortBillMain>(sWhere);
+
+                ds = oCN.RunProcReturn($"exec h_p_JIT_Sc_WorkBillSortBill_Query_ExtendMakeDate '{omdelMian.HPlanBeginDate}',{(omdelMian.HProdORGID == null ? 0 : omdelMian.HProdORGID)},'{omdelMian.HSeOrderBillNo}'" +
+                    $",'{omdelMian.HPlanEndDate.AddDays(1)}',{omdelMian.HMaterID},'{omdelMian.HICMOBillNo}',{omdelMian.HWorkShopID}" +
+                    $",'{omdelMian.HMastersDate}','{ omdelMian.HMakeDate }','{omdelMian.sWheres}'", "h_p_JIT_Sc_WorkBillSortBill_QueryExtendMakeDate");
+
+
+                foreach (DataColumn col in ds.Tables[0].Columns)//閬嶅巻ds涓涓�涓〃锛圱ables[0]锛夌殑鎵�鏈夊垪锛圕olumns锛夋瘡娆″惊鐜腑锛宑ol鍙橀噺浼氭寔鏈夊綋鍓嶅垪鐨勫紩鐢�
+                {
+                    Type dataType = col.DataType; //鑾峰彇褰撳墠鏁版嵁绫诲瀷浼犲叆 鑷畾涔夊彉閲廳atadataType
+                    string ColmString = "{\"ColmCols\":\"" + col.ColumnName + "\",\"ColmType\":\"" + dataType.Name + "\"}"; //瀛楃涓叉嫾鎺�         // 灏嗗垪鍚嶅拰鏁版嵁绫诲瀷淇℃伅鎷兼帴鎴愪竴涓狫SON鏍煎紡鐨勫瓧绗︿覆
+                    columnNameList.Add(JsonConvert.DeserializeObject(ColmString));//鑾峰彇鍒癉ataColumn鍒楀璞$殑鍒楀悕
+                }
+
+                objJsonResult.code = "1";
+                objJsonResult.count = 1;
+                objJsonResult.Message = "Sucess锛�";
+                objJsonResult.data = ds.Tables[0];
+                objJsonResult.list = columnNameList;
+                return objJsonResult;
+            }
+            catch (Exception e)
+            {
+                objJsonResult.code = "0";
+                objJsonResult.count = 0;
+                objJsonResult.Message = "Exception锛�" + e.ToString();
+                objJsonResult.data = null;
+                return objJsonResult;
+            }
+        }
+
         /// <summary>
         /// 鏍规嵁ID鏌ヨ 榻愬鐘舵�� 鍜� 閿佸畾鐘舵��
         /// </summary>
@@ -238,7 +286,8 @@
                         var HEmpID = list[i]["HEmpID"].ToString();
                         var HWorkQty = list[i]["灏忔椂浜ц兘"].ToString();
                         var HSourceName = list[i]["鐢熶骇璧勬簮"].ToString();
-                        var HWorkQty_ProdLine = list[i]["浜х嚎鎬讳骇鑳�"].ToString();
+                        var HMouldID = list[i]["HMouldID"].ToString();
+                        //var HWorkQty_ProdLine = list[i]["浜х嚎鎬讳骇鑳�"].ToString();
 
                         LogService.CustomWriteLog("2.05:" + i, DateTime.Now.ToString("yyyy-MM-dd"));
 
@@ -276,7 +325,7 @@
                             " HOrderNeedQty, HSplitQty, HDayPlanSumQty,HPlanBeginDate," +
                             "HSeOrderBillNo,HICMOBillType,HSourceStockInQty,HLeftPlanQty,HOrderLev,HPreparatDate," +
                             "HMainSourceInterID,HMainSourceEntryID,HICMOInterID_Sec,HICMOEntryID_Sec,HPlanQty" +
-                            ",HICMOInterID,HICMOEntryID,HPlanEndDate,HEmpID,HWorkQty,HSourceName,HWorkQty_ProdLine)values" +
+                            ",HICMOInterID,HICMOEntryID,HPlanEndDate,HEmpID,HWorkQty,HSourceName,HMouldID)values" +
                             $"({HInterID},'{HBillNo}',{DateTime.Now.Year},{DateTime.Now.Month},'{BillType}'," +
                             $"'{BillType}',GETDATE(),1,'{user}',getdate(),'{HICMOBillNo}','{HOrderType}'," +
                             $"{(HICMOEntrySEQ == "" ? 0.ToString() : HICMOEntrySEQ)},{(HWorkShopID == "" ? 0.ToString() : HWorkShopID)},{(HSourceID == "" ? 0.ToString() : HSourceID)}, {(HYX == "" ? 0.ToString() : HYX)}, {(HProdORGID == "" ? 0.ToString() : HProdORGID)}," +
@@ -284,7 +333,7 @@
                             $" 0, {(HSplitQty == "" ? 0.ToString() : HSplitQty)}, {(HDayPlanSumQty == "" ? 0.ToString() : HDayPlanSumQty)},'{HPlanBeginDate}'," +
                             $"'{HSeOrderBillNo}','{HICMOBillType}',{(HSourceStockInQty == "" ? 0.ToString() : HSourceStockInQty)},{(HLeftPlanQty == "" ? 0.ToString() : HLeftPlanQty)},'{HOrderLev}',getdate()," +
                             $"{HMainSourceInterID},{HMainSourceEntryID},{HMainSourceInterID},{HMainSourceEntryID},{HPlanQty}," +
-                            $"{HMainSourceInterID},{HMainSourceEntryID},'{HPlanEndDate}','{HEmpID}','{HWorkQty}','{HSourceName}','{HWorkQty_ProdLine}')";
+                            $"{HMainSourceInterID},{HMainSourceEntryID},'{HPlanEndDate}','{HEmpID}','{HWorkQty}','{HSourceName}','{HMouldID}')";
 
                         //LogService.Write("sql:" + sql);
                         //涓昏〃
@@ -330,6 +379,7 @@
                         var HOrderLev = list[i]["璁㈠崟绛夌骇"].ToString();
                         var HPlanQty = list[i]["璁″垝鏁伴噺"].ToString();
                         var HEmpID = list[i]["HEmpID"].ToString();
+                         var HMouldID = list[i]["HMouldID"].ToString();
 
                         LogService.CustomWriteLog("2.1:"+i, DateTime.Now.ToString("yyyy-MM-dd"));
                         
@@ -487,7 +537,7 @@
 
                             oCN.RunProc($"update Sc_WorkBillSortBillMain set HSourceID={(HSourceID == "" ? 0.ToString() : HSourceID)},HYX={HYX}" +
                                 $",HWorkQty={HWorkQty},HProdTimes={HProdTimes},HReadyTimes={HReadyTimes},HLastBeginDate='{HLastBeginDate}'" +
-                                $",HLastEndDate='{HLastEndDate}',HOrderNeedQty={HOrderNeedQty},HOrderCommitDate='{HOrderCommitDate}',HPlanEndDate='{HPlanEndDate}',HSplitQty={HSplitQty},HSourceName='{HSourceName}',HWorkQty_ProdLine={HWorkQty_ProdLine}" +
+                                $",HLastEndDate='{HLastEndDate}',HOrderNeedQty={HOrderNeedQty},HOrderCommitDate='{HOrderCommitDate}',HPlanEndDate='{HPlanEndDate}',HSplitQty={HSplitQty},HSourceName='{HSourceName}',HWorkQty_ProdLine={HWorkQty_ProdLine},HMouldID={HMouldID}" +
                                 $" where HInterID={list[i]["hmainid"].ToString()} and HBillNo='{list[i]["鍗曟嵁鍙�"].ToString()}'");
                         }                       
                     }
@@ -518,7 +568,7 @@
                     for (int j = 0; j < SumDay; j++)
                     {
                         //涓昏〃瀛愯〃閮芥湁鏁版嵁
-                        if (list[i][DateTime.Now.AddDays(j).ToString("yyyy-MM-dd")].ToString() != "")
+                        if (list[i][DateTime.Now.AddDays(j).ToString("yyyy-MM-dd")].ToString() != ""&& Math.Round(double.Parse(list[i][DateTime.Now.AddDays(j).ToString("yyyy-MM-dd")].ToString()),1)>0)
                         {
                             SumCount += 1;
                             ////淇濆瓨瀛愯〃
@@ -1931,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);
                         }
@@ -3274,6 +3324,74 @@
         }
         #endregion
 
+        #region 鐢熶骇鏃ヨ鍒掑钩鍙� 鏁版嵁鍑嗗 璁剧疆浠诲姟鍗曠浉鍏充俊鎭�(涓夊崌)
+        [Route("JIT_DayPlanPlatFormBill/ReadyData_SS")]
+        [HttpGet]
+        public object ReadyData_SS(string SWhere)
+        {
+            try
+            {
+                var list = SWhere.Split(',');
+                DataTable dt = new DataTable("date");
+                dt.Columns.Add("HICMOInterID", typeof(string));
+                dt.Columns.Add("HICMOEntryID", typeof(string));
+                dt.Columns.Add("灏忔椂浜ц兘", typeof(string));
+                dt.Columns.Add("鐢熶骇鍛ㄦ湡", typeof(decimal));
+                dt.Columns.Add("寮�宸ヤ綑閲�", typeof(decimal));
+                dt.Columns.Add("鏈�杩熷紑宸ユ棩鏈�", typeof(DateTime));
+                dt.Columns.Add("鏈�杩熷畬宸ユ棩鏈�", typeof(DateTime));
+                dt.Columns.Add("璁㈠崟闇�姹傛暟閲�", typeof(decimal));
+                dt.Columns.Add("璁㈠崟浜よ揣鏈�", typeof(DateTime));
+                dt.Columns.Add("HSourceID", typeof(decimal));
+                dt.Columns.Add("鐢熶骇璧勬簮", typeof(string));
+
+                for (int i = 0; i < list.Length; i++)
+                {
+                    string HICMOInterID = list[i].Split(';')[0].ToString();
+                    string HICMOEntryID = list[i].Split(';')[1].ToString();
+                    string HSourceID = list[i].Split(';')[2].ToString();
+
+                    Thread.Sleep(100);
+                    ds = oCN.RunProcReturn("exec h_p_Sc_GetInfoByICMOBillNo " + HICMOInterID + "," + HICMOEntryID + "," + HSourceID, "h_p_Sc_GetInfoByICMOBillNo");
+                    if (ds == null || ds.Tables[0].Rows.Count == 0)
+                    {
+
+                    }
+                    else
+                    {
+                        DataRow dr = dt.NewRow();
+                        dr["HSourceID"] = DBUtility.ClsPub.isSingle(ds.Tables[0].Rows[0]["HSourceID"]);
+                        dr["鐢熶骇璧勬簮"] = ds.Tables[0].Rows[0]["鐢熶骇璧勬簮"].ToString();
+                        dr["灏忔椂浜ц兘"] = DBUtility.ClsPub.isSingle(ds.Tables[0].Rows[0]["浜ц兘"]);
+                        dr["鐢熶骇鍛ㄦ湡"] = DBUtility.ClsPub.isSingle(ds.Tables[0].Rows[0]["鐢熶骇鍛ㄦ湡"]);
+                        dr["寮�宸ヤ綑閲�"] = DBUtility.ClsPub.isSingle(ds.Tables[0].Rows[0]["寮�宸ヤ綑閲�"]);
+                        dr["鏈�杩熷紑宸ユ棩鏈�"] = DBUtility.ClsPub.isDate(ds.Tables[0].Rows[0]["鏈�杩熷紑宸ユ棩鏈�"]);
+                        dr["鏈�杩熷畬宸ユ棩鏈�"] = DBUtility.ClsPub.isDate(ds.Tables[0].Rows[0]["鏈�杩熷畬宸ユ棩鏈�"]);
+                        dr["璁㈠崟闇�姹傛暟閲�"] = DBUtility.ClsPub.isSingle(ds.Tables[0].Rows[0]["璁㈠崟闇�姹傛暟"]);
+                        dr["璁㈠崟浜よ揣鏈�"] = DBUtility.ClsPub.isDate(ds.Tables[0].Rows[0]["璁㈠崟浜よ揣鏈�"]);
+                        dr["HICMOInterID"] = DBUtility.ClsPub.isSingle(ds.Tables[0].Rows[0]["HICMOInterID"]);
+                        dr["HICMOEntryID"] = DBUtility.ClsPub.isSingle(ds.Tables[0].Rows[0]["HICMOEntryID"]);
+                        dt.Rows.Add(dr);
+                    }
+                }
+
+                objJsonResult.code = "1";
+                objJsonResult.count = 1;
+                objJsonResult.Message = "Sucess锛�";
+                objJsonResult.data = dt;
+                return objJsonResult;
+            }
+            catch (Exception e)
+            {
+                objJsonResult.code = "0";
+                objJsonResult.count = 0;
+                objJsonResult.Message = "Exception锛�" + e.ToString();
+                objJsonResult.data = null;
+                return objJsonResult;
+            }
+        }
+        #endregion
+
         #region  缂烘枡鍒嗘瀽鎶ヨ〃
         public class MaterialShorAnalysis
         {

--
Gitblit v1.9.1