From d0efffbf456b068abdac497b9bf86d295e6d21be Mon Sep 17 00:00:00 2001
From: yxj <yxj@hz-kingdee.com>
Date: 星期四, 05 十二月 2024 13:14:38 +0800
Subject: [PATCH] 新增PDA扫码模块获取入库类型、出库类型调用方法,传票验证调用方法等

---
 WebAPI/Controllers/仓存管理/领料发货/Kf_MateOutBackBillController.cs |   80 ++++++++++++++++++++++++++++------------
 1 files changed, 56 insertions(+), 24 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_MateOutBackBillController.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_MateOutBackBillController.cs"
index 8addddf..454d969 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_MateOutBackBillController.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_MateOutBackBillController.cs"
@@ -1,4 +1,5 @@
 锘縰sing DBUtility;
+using Newtonsoft.Json;
 using Newtonsoft.Json.Linq;
 using System;
 using System.Collections.Generic;
@@ -28,6 +29,7 @@
         {
             try
             {
+                List<object> columnNameList = new List<object>();  //瀹氫箟澹版槑鍙橀噺 锛屾妸閫氳繃 new List<object>()鍒涘缓鐨� 瀹炰緥锛岃祴鍊肩粰鍙橀噺
                 //鍒ゆ柇鏄惁鏈夋煡璇㈡潈闄�
                 if (!DBUtility.ClsPub.Security_Log("Kf_MateOutBackBill_Query", 1, false, user))
                 {
@@ -40,29 +42,37 @@
 
                 if (sWhere == null || sWhere.Equals(""))
                 {
-                    ds = oCn.RunProcReturn("select * from h_v_IF_MateOutBackBillList order by 鏃ユ湡 desc", "h_v_IF_MateOutBackBillList");
+                    ds = oCn.RunProcReturn("select * from h_v_IF_MateOutBackBillList order by hmainid desc", "h_v_IF_MateOutBackBillList");
                 }
                 else
                 {
-                    string sql = "select * from h_v_IF_MateOutBackBillList " + sWhere+ " order by 鏃ユ湡 desc";
+                    string sql = "select * from h_v_IF_MateOutBackBillList " + sWhere+ " order by hmainid desc";
                     ds = oCn.RunProcReturn(sql, "h_v_IF_MateOutBackBillList");
                 }
-                if (ds == null || ds.Tables[0].Rows.Count == 0)
+                foreach (DataColumn col in ds.Tables[0].Columns)//閬嶅巻ds涓涓�涓〃锛圱ables[0]锛夌殑鎵�鏈夊垪锛圕olumns锛夋瘡娆″惊鐜腑锛宑ol鍙橀噺浼氭寔鏈夊綋鍓嶅垪鐨勫紩鐢�
                 {
-                    objJsonResult.code = "0";
-                    objJsonResult.count = 0;
-                    objJsonResult.Message = "false锛�";
-                    objJsonResult.data = null;
-                    return objJsonResult;
+                    Type dataType = col.DataType; //鑾峰彇褰撳墠鏁版嵁绫诲瀷浼犲叆 鑷畾涔夊彉閲廳atadataType
+                    string ColmString = "{\"ColmCols\":\"" + col.ColumnName + "\",\"ColmType\":\"" + dataType.Name + "\"}"; //瀛楃涓叉嫾鎺�         // 灏嗗垪鍚嶅拰鏁版嵁绫诲瀷淇℃伅鎷兼帴鎴愪竴涓狫SON鏍煎紡鐨勫瓧绗︿覆
+                    columnNameList.Add(JsonConvert.DeserializeObject(ColmString));//鑾峰彇鍒癉ataColumn鍒楀璞$殑鍒楀悕
                 }
-                else
-                {
-                    objJsonResult.code = "1";
-                    objJsonResult.count = 1;
-                    objJsonResult.Message = "Sucess锛�";
-                    objJsonResult.data = ds.Tables[0];
-                    return objJsonResult;
-                }
+
+                //if (ds.Tables[0].Rows.Count != 0 || ds != null)
+                //{
+                objJsonResult.code = "1";
+                objJsonResult.count = 1;
+                objJsonResult.Message = "Sucess锛�";
+                objJsonResult.data = ds.Tables[0];
+                objJsonResult.list = columnNameList;
+                return objJsonResult;
+                //}
+                //else
+                //{
+                //objJsonResult.code = "0";
+                //objJsonResult.count = 0;
+                //objJsonResult.Message = "鏃犳暟鎹�";
+                //objJsonResult.data = null;
+                //return objJsonResult;
+                //}
             }
             catch (Exception ex)
             {
@@ -86,7 +96,7 @@
         public object set_DeleteBill(string HInterID,string user)
         {
             //缂栬緫鏉冮檺
-            if (!DBUtility.ClsPub.Security_Log_second("Kf_MateOutBackBill_Drop", 1, false, user))
+            if (!DBUtility.ClsPub.Security_Log_second("Kf_MateOutBackBill_Delete", 1, false, user))
             {
                 objJsonResult.code = "0";
                 objJsonResult.count = 0;
@@ -133,6 +143,17 @@
                     objJsonResult.data = null;
                     return objJsonResult;
                 }
+
+                //杩涜 浼氳鏈熼棿 缁撹处 鐨勫垽鏂拰鎺у埗
+                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;
+                }
+
                 bool IsDete = oBill.DeleteBill(lngBillKey, ref DBUtility.ClsPub.sExeReturnInfo);
                 if (IsDete)
                 {
@@ -207,7 +228,7 @@
                     return objJsonResult;
                 }
                 Int64 lngBillKey = 0;
-                lngBillKey = DBUtility.ClsPub.isLong(HInterID);
+                lngBillKey = DBUtility.ClsPub.isLong(HInterID);                
                 //鏌ョ湅鏄惁宸插鏍�,鍏抽棴,浣滃簾
                 if (oBill.ShowBill(lngBillKey, ref DBUtility.ClsPub.sExeReturnInfo))
                 {
@@ -258,7 +279,7 @@
                     objJsonResult.code = "1";
                     objJsonResult.count = 1;
                     objJsonResult.Message = "瀹℃牳澶辫触!鍘熷洜:" + DBUtility.ClsPub.sExeReturnInfo;
-                    objJsonResult.data = null;
+                    objJsonResult.data = null;                   
                     return objJsonResult;
                 }
             }
@@ -350,7 +371,8 @@
                     objJsonResult.Message = "鍗曟嵁涓嶅瓨鍦�!鍘熷洜:" + DBUtility.ClsPub.sExeReturnInfo;
                     objJsonResult.data = null;
                     return objJsonResult;
-                }
+                }                
+
                 //鍙嶅鏍告彁浜bandonCheck
                 if (oBill.AbandonCheck(lngBillKey, ref DBUtility.ClsPub.sExeReturnInfo) == true)
                 {
@@ -588,10 +610,10 @@
                     oItemSub.HEntryCloseDate = DBUtility.ClsPub.isDate(DateTime.Now);
                     oItemSub.HCloseType = false;   //鍏抽棴绫诲瀷
                     //oItemSub.HRemark = "";         //澶囨敞
-                    oItemSub.HSourceInterID = 0;     // 婧愬崟涓诲唴鐮�
-                    oItemSub.HSourceEntryID = 0;   //婧愬崟瀛愬唴鐮�
-                    //oItemSub.HSourceBillNo = "";  //婧愬崟鍗曞彿
-                    //oItemSub.HSourceBillType = ""; //婧愬崟绫诲瀷
+                    oItemSub.HSourceInterID = lsmain[0].HSourceInterID;     // 婧愬崟涓诲唴鐮�
+                    oItemSub.HSourceEntryID = lsmain[0].HSourceEntryID;   //婧愬崟瀛愬唴鐮�
+                    oItemSub.HSourceBillNo = lsmain[0].HSourceBillNo;  //婧愬崟鍗曞彿
+                    oItemSub.HSourceBillType = lsmain[0].HSourceBillType; //婧愬崟绫诲瀷
                     //oItemSub.HRelationQty = 0;     //鍏宠仈鏁伴噺
                     //oItemSub.HRelationMoney = 0;   //鍏宠仈閲戦 
                     //oItemSub.HRepairID = 0;       //缁翠慨椤圭洰
@@ -600,6 +622,16 @@
                     oBill.DetailColl.Add(oItemSub);
 
                 }
+                //杩涜 浼氳鏈熼棿 缁撹处 鐨勫垽鏂拰鎺у埗
+                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;
+                }
+
                 //淇濆瓨
                 //淇濆瓨瀹屾瘯鍚庡鐞�
                 bool bResult;

--
Gitblit v1.9.1