From 7141e956ca8488f6feb082828cd60653382b6c89 Mon Sep 17 00:00:00 2001
From: wtt <1985833171@qq.com>
Date: 星期一, 24 十一月 2025 16:37:24 +0800
Subject: [PATCH] 1

---
 WebAPI/Controllers/仓存管理/条码生成/KF_BarCodeStatusChangeBillController.cs |   38 +++++++++++++++++++++++++++++++++-----
 1 files changed, 33 insertions(+), 5 deletions(-)

diff --git "a/WebAPI/Controllers/\344\273\223\345\255\230\347\256\241\347\220\206/\346\235\241\347\240\201\347\224\237\346\210\220/KF_BarCodeStatusChangeBillController.cs" "b/WebAPI/Controllers/\344\273\223\345\255\230\347\256\241\347\220\206/\346\235\241\347\240\201\347\224\237\346\210\220/KF_BarCodeStatusChangeBillController.cs"
index c6343bc..6e75168 100644
--- "a/WebAPI/Controllers/\344\273\223\345\255\230\347\256\241\347\220\206/\346\235\241\347\240\201\347\224\237\346\210\220/KF_BarCodeStatusChangeBillController.cs"
+++ "b/WebAPI/Controllers/\344\273\223\345\255\230\347\256\241\347\220\206/\346\235\241\347\240\201\347\224\237\346\210\220/KF_BarCodeStatusChangeBillController.cs"
@@ -27,6 +27,7 @@
         {
             try
             {
+                List<object> columnNameList = new List<object>();  //瀹氫箟澹版槑鍙橀噺 锛屾妸閫氳繃 new List<object>()鍒涘缓鐨� 瀹炰緥锛岃祴鍊肩粰鍙橀噺
                 if (sWhere == null || sWhere.Equals(""))
                 {
                     ds = oCN.RunProcReturn("select * from h_v_KF_BarCodeStatusChangeBillList order by HMainID asc", "h_v_KF_BarCodeStatusChangeBillList");
@@ -37,11 +38,18 @@
                     string sql = sql1 + sWhere + " order by HMainID asc";
                     ds = oCN.RunProcReturn(sql, "h_v_KF_BarCodeStatusChangeBillList");
                 }
+                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.data = ds.Tables[0];//浠g爜灏嗙涓�涓狣ataTable锛堢储寮曚负0锛夎祴鍊肩粰objJsonResult鐨刣ata灞炴��
+                objJsonResult.list = columnNameList;//灏哻olumnNameList璧嬪�肩粰objJsonResult鐨刲ist灞炴��
                 return objJsonResult;
             }
             catch (Exception e)
@@ -157,7 +165,15 @@
 
                 DateTime dt = DateTime.Now;
 
-            
+                //杩涜 浼氳鏈熼棿 缁撹处 鐨勫垽鏂拰鎺у埗
+                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_POOrderBillList where hmainid=" + HInterID + " and 鍗曟嵁鍙�='" + HBillNo + "'", "h_v_IF_POOrderBillList");
 
@@ -186,12 +202,11 @@
                     oCN.RunProc("update KF_BarCodeStatusChangeBillMain  set " +
                                 "HRemark='" + HRemark + "', HChecker='" + HMaker + "', HCheckDate=getdate()" + ",HBillStatus=" + HBillStatus +
                                 ",HEmpID=" + HEmpID + ",HDeptID=" + HDeptID + " where HInterID=" + HInterID);
-
                     //鍒犻櫎瀛愯〃
                     oCN.RunProc("delete from KF_BarCodeStatusChangeBillSub where HInterID='" + HInterID + "'");
                 }
                 //淇濆瓨瀛愯〃
-                objJsonResult = AddBillSub(msg3, HInterID, OperationType);
+                objJsonResult = AddBillSub(msg3, HInterID, OperationType, HMaker);
 
                 if (objJsonResult.code == "0")
                 {
@@ -218,7 +233,7 @@
             }
         }
 
-        public json AddBillSub(string msg3, long HInterID, int OperationType)
+        public json AddBillSub(string msg3, long HInterID, int OperationType,string user)
         {
             List<ClsKF_BarCodeStatusChangeBillSub> DetailColl = Newtonsoft.Json.JsonConvert.DeserializeObject<List<ClsKF_BarCodeStatusChangeBillSub>>(msg3);
 
@@ -243,6 +258,8 @@
 	            ,HRelationMoney,HBarCode,HBarCodeStatus_Old,HBarCodeStatus_New,HAuxPropID_Old,HAuxPropID_New,HMTONo_Old,HMTONo_New) 
                  values({HInterID},{NewHEntryID},'{oSub.HBillNo_bak}','{oSub.HRemark}',{oSub.HSourceInterID}
                 ,{oSub.HSourceEntryID},'{oSub.HSourceBillNo}','{oSub.HSourceBillType}',{oSub.HRelationQty},{oSub.HRelationMoney},'{oSub.HBarCode}','{oSub.HBarCodeStatus_Old}','{oSub.HBarCodeStatus_New}','{oSub.HAuxPropID_Old}','{oSub.HAuxPropID_New}','{oSub.HMTONo_Old}','{oSub.HMTONo_New}')");
+                    oCN.RunProc("update Gy_BarCodeBill  set " +
+                               "HBarCodeStatus='" + oSub.HBarCodeStatus_New + "', HStatusMan='" + user + "'," + " HStatusDate=getdate()" + " where HBarCode='" + oSub.HBarCode+"'");
             }
 
             objJsonResult.code = "1";
@@ -260,6 +277,17 @@
         {
             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_BarCodeStatusChangeBillMain where HInterID = " + HInterID);
                 oCN.RunProc("Delete From KF_BarCodeStatusChangeBillSub where HInterID = " + HInterID);

--
Gitblit v1.9.1