From 75a4453d1c141c6ac434d1bd13927dc71cc9fa37 Mon Sep 17 00:00:00 2001
From: chenhaozhe <cgz@hz-kingdee.com>
Date: 星期三, 22 十月 2025 10:16:16 +0800
Subject: [PATCH] Merge branch 'master' of http://101.37.171.70:10101/r/MES-WEB-API

---
 WebAPI/Controllers/仓存管理/领料发货/Kf_StepFoldOutBillController.cs |   57 ++++++++++++++++++++++++++++++++++++++++++++++++++-------
 1 files changed, 50 insertions(+), 7 deletions(-)

diff --git "a/WebAPI/Controllers/\344\273\223\345\255\230\347\256\241\347\220\206/\351\242\206\346\226\231\345\217\221\350\264\247/Kf_StepFoldOutBillController.cs" "b/WebAPI/Controllers/\344\273\223\345\255\230\347\256\241\347\220\206/\351\242\206\346\226\231\345\217\221\350\264\247/Kf_StepFoldOutBillController.cs"
index 974a991..82c3dad 100644
--- "a/WebAPI/Controllers/\344\273\223\345\255\230\347\256\241\347\220\206/\351\242\206\346\226\231\345\217\221\350\264\247/Kf_StepFoldOutBillController.cs"
+++ "b/WebAPI/Controllers/\344\273\223\345\255\230\347\256\241\347\220\206/\351\242\206\346\226\231\345\217\221\350\264\247/Kf_StepFoldOutBillController.cs"
@@ -8,6 +8,7 @@
 using Newtonsoft.Json.Linq;
 using Model;
 using DBUtility;
+using Newtonsoft.Json;
 
 namespace WebAPI.Controllers.浠撳瓨绠$悊.棰嗘枡鍙戣揣
 {
@@ -78,6 +79,7 @@
         {
             try
             {
+                List<object> columnNameList = new List<object>();  //瀹氫箟澹版槑鍙橀噺 锛屾妸閫氳繃 new List<object>()鍒涘缓鐨� 瀹炰緥锛岃祴鍊肩粰鍙橀噺
                 if (sWhere == null || sWhere.Equals(""))
                 {
                     ds = oCn.RunProcReturn("select * from h_v_IF_StepFoldOutBillList order by hmainid desc", "h_v_IF_StepFoldOutBillList");
@@ -88,13 +90,19 @@
                     string sql = sql1 + sWhere + " order by hmainid desc";
                     ds = oCn.RunProcReturn(sql, "h_v_IF_StepFoldOutBillList");
                 }
-
+                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鍒楀璞$殑鍒楀悕
+                }
                 //if (ds.Tables[0].Rows.Count != 0 || ds != null)
                 //{
                 objJsonResult.code = "1";
                 objJsonResult.count = 1;
                 objJsonResult.Message = "Sucess锛�";
-                objJsonResult.data = ds.Tables[0];
+                objJsonResult.data = ds.Tables[0];//浠g爜灏嗙涓�涓狣ataTable锛堢储寮曚负0锛夎祴鍊肩粰objJsonResult鐨刣ata灞炴��
+                objJsonResult.list = columnNameList;//灏哻olumnNameList璧嬪�肩粰objJsonResult鐨刲ist灞炴��
                 return objJsonResult;
                 //}
                 //else
@@ -238,6 +246,17 @@
                 string HCloseMan = mainList[0].HCloseMan;
                 string HCloseDate = mainList[0].HCloseDate;
                 long HCurID = mainList[0].HCurID;
+                long HProjectID = mainList[0].HProjectID;        //-椤圭洰
+
+        //杩涜 浼氳鏈熼棿 缁撹处 鐨勫垽鏂拰鎺у埗
+        string s = "";
+                int sYear = 0;
+                int sPeriod = 0;
+                if (DBUtility.Xt_BaseBillFun.Fun_AllowYearPeriod(HDate, ref sYear, ref sPeriod, ref s) == false)
+                {
+                    objJsonResult.Message = s;
+                    return objJsonResult;
+                }
 
                 ds = oCn.RunProcReturn("select * from h_v_IF_StepFoldOutBillList where hmainid=" + HInterID + " and 鍗曟嵁鍙�='" + HBillNo + "'", "h_v_IF_StepFoldOutBillList");
 
@@ -249,12 +268,12 @@
 	                    ,HSupID,HWHID,HSCWHID,HEmpID,HManagerID,HSecManagerID,HKeeperID,HDeptID
 	                    ,HMaker,HMakeDate,HChecker,HUpDater
 	                    ,HDeleteMan,HCloseMan
-	                    ,HRemark,HExplanation,HInnerBillNo,HCurID)
+	                    ,HRemark,HExplanation,HInnerBillNo,HCurID,HProjectID)
                         values(" + HInterID + ",'" + HBillNo + "','" + HDate + "','" + 1250 + "','" +
                     1250 + "'," + HBillStatus + "," + DateTime.Now.Year + "," + DateTime.Now.Month + "," + HSupID +
                     "," + HWHID + "," + HSCWHID + "," + HEmpID + "," + HManagerID + "," + HSecManagerID +
                     "," + HKeeperID + "," + HDeptID + ",'" + HMaker + "','" + HMakeDate + "','" + HChecker + "','" + HUpDater + "','" + HDeleteMan + "','" + HCloseMan + "','"
-                    + HRemark + "','" + HExplanation + "','" + HInnerBillNo + "'," + HCurID + "" + ")");
+                    + HRemark + "','" + HExplanation + "','" + HInnerBillNo + "'," + HCurID + "," + HProjectID + "" + ")");
                 }
                 else if (OperationType == 3 || ds.Tables[0].Rows.Count != 0)
                 { //淇敼
@@ -282,7 +301,7 @@
                     String sql="update Kf_ICStockBillMain   set " +
                                     "HRemark='" + HRemark + "', HUpDater='" + HMaker + "', HUpDateDate=getdate()" +
                                  ",HSupID=" + HSupID + ",HWHID=" + HWHID + ",HSCWHID=" + HSCWHID + ", HEmpID=" + HEmpID + ",HManagerID=" + HManagerID + ",HSecManagerID = " + HSecManagerID
-                                 + ",HKeeperID=" + HKeeperID + ",HDeptID=" + HDeptID + "  where HInterID=" + HInterID;
+                                 + ",HKeeperID=" + HKeeperID + ",HDeptID=" + HDeptID + ",HProjectID=" + HProjectID + "  where HInterID=" + HInterID;
 
                     oCn.RunProc(sql);
                     //鍒犻櫎瀛愯〃
@@ -392,6 +411,18 @@
         {
             try
             {
+
+                //杩涜 浼氳鏈熼棿 缁撹处 鐨勫垽鏂拰鎺у埗
+                string s = "";
+                int sYear = 0;
+                int sPeriod = 0;
+                DateTime HDate = DateTime.Now;
+                if (DBUtility.Xt_BaseBillFun.Fun_AllowYearPeriod(HDate, ref sYear, ref sPeriod, ref s) == false)
+                {
+                    objJsonResult.Message = s;
+                    return objJsonResult;
+                }
+
                 oCn.BeginTran();
                 oCn.RunProc("Delete From Kf_ICStockBillMain where HInterID = " + HInterID);
                 oCn.RunProc("Delete From Kf_ICStockBillSub where HInterID = " + HInterID);
@@ -456,6 +487,20 @@
 
                 ds = oCn.RunProcReturn("select * from Kf_ICStockBillMain where HInterID = " + int.Parse(HInterID), "Kf_ICStockBillMain");
                 string HBillNo = "";
+
+
+                //杩涜 浼氳鏈熼棿 缁撹处 鐨勫垽鏂拰鎺у埗
+                string s = "";
+                int sYear = 0;
+                int sPeriod = 0;
+                DateTime HDate = DateTime.Now;
+                if (DBUtility.Xt_BaseBillFun.Fun_AllowYearPeriod(HDate, ref sYear, ref sPeriod, ref s) == false)
+                {
+                    objJsonResult.Message = s;
+                    return objJsonResult;
+                }
+
+
                 oCn.BeginTran();//寮�濮嬩簨鍔�
 
                 if (ds == null || ds.Tables[0].Rows.Count == 0)
@@ -470,8 +515,6 @@
                 {
                     HBillNo = ds.Tables[0].Rows[0]["HBillNo"].ToString();
                 }
-
-
 
 
                 //Type 1 瀹℃牳  2  鍙嶅鏍�

--
Gitblit v1.9.1