From 018cc8c7f67926ad9f36cb72c5b494b949e886cd Mon Sep 17 00:00:00 2001
From: yusijie <ysj@hz-kingdee.com>
Date: 星期四, 14 十一月 2024 22:29:33 +0800
Subject: [PATCH] 齐套分析库存取值方式调整;森楷同步生产入库申请单调整

---
 WebAPI/Controllers/SCGL/日计划管理/JIT_DayPlanPlatFormBillController.cs |    5 +++--
 WebAPI/Controllers/条码管理/WEBSController.cs                          |   48 +++++++++++++++++++++++++++---------------------
 2 files changed, 30 insertions(+), 23 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 a258212..33442ff 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"
@@ -833,9 +833,10 @@
                 sw.Start();//寮�濮嬭鏃�
 
                 //鑾峰彇褰撳墠鍗虫椂搴撳瓨 搴撳瓨鏁伴噺+搴撳瓨缁勭粐+鐗╂枡+璐т富+浠撳簱   
+                //鍘熸煡璇㈠嵆鏃跺簱瀛樻柟寮忥細select * from h_v_jit_InventoryList
                 ds = oCN.RunProcReturn(@" 
-select * from h_v_jit_InventoryList
-", "h_v_jit_InventoryList");
+exec h_p_jit_Inventory_UsableList
+", "h_p_jit_Inventory_UsableList");
                 ListInventory = ds.ToModelList<PRD_Inventory>();
                 //杞﹂棿 浠撳簱瀵圭収鍒楄〃 
                 ds = oCN.RunProcReturn(@" 
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 7ffc703..2d8bc14 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"
@@ -4295,7 +4295,7 @@
                     sJXCode = POStockInBillController.JX_Json(sBarCode, HInterID, HBillType, HStockOrgID, HBillNo, HMaker);
                     SourceFlag = true;
                 }
-                else if(oSystemParameter.omodel.WMS_CampanyName == "娣诲悍" && HSourceBillType == "1241")
+                else if(oSystemParameter.omodel.WMS_CampanyName == "妫シ" && HSourceBillType == "1241")
                 {
                     DataSet ds;
                     string sql = "select HBarCode,HSourceInterID,HSourceEntryID,HSourceBillNo from Gy_BarCodeBill with(nolock) where HBarCode = '" + sBarCode + "'";
@@ -4319,7 +4319,7 @@
                         HSourceBillNo_TB = DBUtility.ClsPub.isStrNull(ds.Tables[0].Rows[0]["HSourceBillNo"]);
                         HSourceInterID = DBUtility.ClsPub.isInt(ds.Tables[0].Rows[0]["HSourceInterID"]);
                         //鏍规嵁鍏ュ簱鐢宠鍗曞崟鍙峰垽鏂崟鎹俊鎭槸鍚﹀凡缁忓悓姝ュ埌閲戣澏
-                        sql = string.Format(@"select * from FROM {0}..TFKO_t_Cust100009 with(nolock) where FBILLNO = '" + HSourceBillNo_TB + "'", HDataBaseName);
+                        sql = string.Format(@"select * from {0}..TFKO_t_Cust100009 with(nolock) where FBILLNO = '" + HSourceBillNo_TB + "'", HDataBaseName);
 
                         LogService.Write("鍏朵粬鍏ュ簱鏌ヨ鍏ュ簱鐢宠鍗曟槸鍚﹀瓨鍦細" + sql);
 
@@ -4328,6 +4328,9 @@
                         if (ds == null || ds.Tables[0].Rows.Count < 1)
                         {
                             sql = "exec h_p_Kf_StockInRequestBillToErp '" + HSourceInterID + "','" + HSourceBillNo_TB + "'";
+
+                            LogService.Write("鍏朵粬鍏ュ簱鑾峰彇婧愬崟淇℃伅锛�" + sql);
+
                             ds = oCn.RunProcReturn(sql, "h_p_Kf_StockInRequestBillToErp");
 
                             if (ds == null || ds.Tables[0].Rows.Count == 0)
@@ -4344,23 +4347,23 @@
                                 JObject model = new JObject();
                                 //model.Add("FBillType", new JObject() { ["FNumber"] = Pub_Class.ClsPub.isStrNull(ds.Tables[0].Rows[0]["FBillType"]) }); //鍗曟嵁绫诲瀷
                                 model.Add("FDate", Pub_Class.ClsPub.isStrNull(ds.Tables[0].Rows[0]["鏃ユ湡"])); //鍗曟嵁鏃ユ湡                   
-                                model.Add("FStockOrgId", new JObject() { ["FNumber"] = Pub_Class.ClsPub.isStrNull(ds.Tables[0].Rows[0]["搴撳瓨缁勭粐浠g爜"]) }); //搴撳瓨缁勭粐浠g爜
+                                model.Add("FStockOrgId", new JObject() { ["FNumber"] = Pub_Class.ClsPub.isStrNull(ds.Tables[0].Rows[0]["搴撳瓨缁勭粐浠g爜"]) }); //搴撳瓨缁勭粐浠g爜 ???
                                 model.Add("FBillNo", Pub_Class.ClsPub.isStrNull(ds.Tables[0].Rows[0]["鍗曟嵁鍙�"])); //鍗曟嵁鍙�
                                 model.Add("FStockDirect", Pub_Class.ClsPub.isStrNull(ds.Tables[0].Rows[0]["搴撳瓨鏂瑰悜"])); //搴撳瓨鏂瑰悜                   
                                 model.Add("FDEPTID", new JObject() { ["FNumber"] = Pub_Class.ClsPub.isStrNull(ds.Tables[0].Rows[0]["閮ㄩ棬浠g爜"]) }); //鐢熶骇杞﹂棿
                                 model.Add("F_paez_Text", Pub_Class.ClsPub.isStrNull(ds.Tables[0].Rows[0]["鍏ュ簱鐮佸崟"])); //鍏ュ簱鐮佸崟              
                                 model.Add("F_paez_Integer2", Pub_Class.ClsPub.isStrNull(ds.Tables[0].Rows[0]["绛掑瓙鏁�"])); //绛掑瓙鏁�              
                                 model.Add("F_paez_Integer1", Pub_Class.ClsPub.isStrNull(ds.Tables[0].Rows[0]["绛掔鍙暟"])); //绛掔鍙暟            
-                                model.Add("F_paez_Integer3", Pub_Class.ClsPub.isStrNull(ds.Tables[0].Rows[0]["瀹氶暱"])); //瀹氶暱              
-                                //model.Add("F_paez_BaseProperty4", Pub_Class.ClsPub.isStrNull(ds.Tables[0].Rows[0]["绛掗噸"])); //绛掗噸              
-                                model.Add("F_paez_Base", Pub_Class.ClsPub.isStrNull(ds.Tables[0].Rows[0]["宸ュ彿"])); //宸ュ彿              
-                                model.Add("F_paez_Combo", Pub_Class.ClsPub.isStrNull(ds.Tables[0].Rows[0]["鐝浠g爜"])); //鐝              
+                                model.Add("F_paez_Integer3", Pub_Class.ClsPub.isStrNull(ds.Tables[0].Rows[0]["瀹氶暱"])); //瀹氶暱      ???        
+                                //model.Add("F_paez_BaseProperty4", Pub_Class.ClsPub.isStrNull(ds.Tables[0].Rows[0]["绛掗噸"])); //绛掗噸                                
+                                model.Add("F_paez_Base", new JObject() { ["FSTAFFNUMBER"] = Pub_Class.ClsPub.isStrNull(ds.Tables[0].Rows[0]["宸ュ彿"]) }); //宸ュ彿        ???蹇呭~ FSTAFFNUMBER       
+                                model.Add("F_paez_Combo", Pub_Class.ClsPub.isStrNull(ds.Tables[0].Rows[0]["鐝浠g爜"])); //鐝    ???蹇呭~          
                                 //model.Add("F_paez_BaseProperty1", Pub_Class.ClsPub.isStrNull(ds.Tables[0].Rows[0]["鎵瑰彿"])); //鎵瑰彿              
-                                model.Add("F_paez_Integer", Pub_Class.ClsPub.isStrNull(ds.Tables[0].Rows[0]["绠辨暟"])); //绠辨暟              
+                                model.Add("F_paez_Integer", Pub_Class.ClsPub.isStrNull(ds.Tables[0].Rows[0]["绠辨暟"])); //绠辨暟    ???          
                                 model.Add("F_paez_Decimal2", Pub_Class.ClsPub.isStrNull(ds.Tables[0].Rows[0]["鎬婚噸"])); //鎬婚噸              
                                 //model.Add("F_paez_BaseProperty2", Pub_Class.ClsPub.isStrNull(ds.Tables[0].Rows[0]["鎴愬搧缂栫爜"])); //鎴愬搧缂栫爜              
                                 //model.Add("F_paez_BaseProperty5", Pub_Class.ClsPub.isStrNull(ds.Tables[0].Rows[0]["鍝佸悕"])); //鍝佸悕              
-                                model.Add("F_paez_Base1", Pub_Class.ClsPub.isStrNull(ds.Tables[0].Rows[0]["绾垮彿"])); //绾垮彿              
+                                model.Add("F_paez_Base1", new JObject() { ["FNumber"] = Pub_Class.ClsPub.isStrNull(ds.Tables[0].Rows[0]["绾垮彿"]) }); //绾垮彿        ???蹇呭~      
 
                                 //model.Add("F_paez_BaseProperty", Pub_Class.ClsPub.isStrNull(ds.Tables[0].Rows[0]["鏈哄彴"])); //鏈哄彴              
                                 model.Add("F_paez_Decimal", Pub_Class.ClsPub.isStrNull(ds.Tables[0].Rows[0]["绠遍噸"])); //绠遍噸              
@@ -4368,7 +4371,7 @@
                                 model.Add("FDEPTID1", new JObject() { ["FNumber"] = Pub_Class.ClsPub.isStrNull(ds.Tables[0].Rows[0]["閮ㄩ棬浠g爜"]) });//閮ㄩ棬       
                                 //model.Add("F_paez_BaseProperty6", Pub_Class.ClsPub.isStrNull(ds.Tables[0].Rows[0]["鎹诲悜"])); //鎹诲悜              
                                 //model.Add("F_paez_BaseProperty7", Pub_Class.ClsPub.isStrNull(ds.Tables[0].Rows[0]["绠¤壊"])); //绠¤壊              
-                                model.Add("F_paez_Assistant", Pub_Class.ClsPub.isStrNull(ds.Tables[0].Rows[0]["绛夌骇"])); //绛夌骇              
+                                model.Add("F_paez_Assistant", new JObject() { ["FNumber"] = Pub_Class.ClsPub.isStrNull(ds.Tables[0].Rows[0]["绛夌骇"]) });//绛夌骇         ???蹇呭~
                                 model.Add("F_paez_Text11", Pub_Class.ClsPub.isStrNull(ds.Tables[0].Rows[0]["鏈�灏忕鍙�"])); //鏈�灏忕鍙�              
                                 //model.Add("F_paez_Text3", Pub_Class.ClsPub.isStrNull(ds.Tables[0].Rows[0]["鏂囨湰"])); //鏂囨湰              
                                 model.Add("F_paez_Text4", Pub_Class.ClsPub.isStrNull(ds.Tables[0].Rows[0]["鏈�澶х鍙�"])); //鏈�澶х鍙�              
@@ -4381,32 +4384,31 @@
                                 //model.Add("F_paez_BaseProperty11", Pub_Class.ClsPub.isStrNull(ds.Tables[0].Rows[0]["瑙勬牸鍨嬪彿"])); //瑙勬牸鍨嬪彿              
                                 //model.Add("F_paez_BaseProperty12", Pub_Class.ClsPub.isStrNull(ds.Tables[0].Rows[0]["缃戝埆"])); //缃戝埆              
                                 //model.Add("F_TFKO_Text4", Pub_Class.ClsPub.isStrNull(ds.Tables[0].Rows[0]["绠卞彿鍓嶇紑"])); //绠卞彿鍓嶇紑              
-                                model.Add("F_paez_WB", Pub_Class.ClsPub.isStrNull(ds.Tables[0].Rows[0]["缃戝埆"])); //缃戝埆1              
-
+                                model.Add("F_paez_WB", new JObject() { ["FNumber"] = Pub_Class.ClsPub.isStrNull(ds.Tables[0].Rows[0]["缃戝埆"]) }); //缃戝埆1       ???
 
                                 JArray Fentity = new JArray();
                                 foreach (DataRow item in ds.Tables[0].Rows)
                                 {
                                     JObject FentityModel = new JObject();
                                     FentityModel.Add("FMATERIALID", new JObject() { ["FNumber"] = item["鐗╂枡浠g爜"].ToString() }); // 鐗╂枡浠g爜
-                                    FentityModel.Add("FUnitID", new JObject() { ["FNumber"] = item["璁¢噺鍗曚綅浠g爜"].ToString() });  // 鍗曚綅浠g爜
+                                    FentityModel.Add("FUnitID", new JObject() { ["FNumber"] = item["璁¢噺鍗曚綅浠g爜"].ToString() });  // 鍗曚綅浠g爜 ???
                                     FentityModel.Add("FQty", item["鍑�閲�"].ToString()); //鍑�閲�
                                     FentityModel.Add("FBASEUNITID", new JObject() { ["FNumber"] = item["鍩烘湰璁¢噺鍗曚綅浠g爜"].ToString() });  // 鍩烘湰鍗曚綅浠g爜
                                     FentityModel.Add("FBASEQTY", item["瀹炴敹鏁伴噺"].ToString()); //瀹炴敹鏁伴噺
                                     FentityModel.Add("FSecUNITID", new JObject() { ["FNumber"] = item["搴撳瓨杈呰閲忓崟浣嶄唬鐮�"].ToString() });  // 搴撳瓨杈呰閲忓崟浣嶄唬鐮�
                                     FentityModel.Add("FSecQTY", item["搴撳瓨杈呭崟浣嶅疄鏀舵暟閲�"].ToString()); //瀹炴敹鏁伴噺锛堝簱瀛樿緟鍗曚綅锛�
-                                    FentityModel.Add("FOWNERTYPEID", item["璐т富绫诲瀷"].ToString()); //璐т富绫诲瀷
+                                    FentityModel.Add("FOWNERTYPEID", item["璐т富绫诲瀷"].ToString()); //璐т富绫诲瀷  ???鏁板��
                                     FentityModel.Add("FOWNERID", new JObject() { ["FNumber"] = item["璐т富浠g爜"].ToString() });  // 璐т富浠g爜
-                                    FentityModel.Add("FKEEPERTYPEID", item["淇濈鑰呯被鍨�"].ToString()); //淇濈鑰呯被鍨�
+                                    FentityModel.Add("FKEEPERTYPEID", item["淇濈鑰呯被鍨�"].ToString()); //淇濈鑰呯被鍨�  ???鏁板��
                                     FentityModel.Add("FKEEPERID", new JObject() { ["FNumber"] = item["淇濈鑰呬唬鐮�"].ToString() });  // 淇濈鑰呬唬鐮�
                                     FentityModel.Add("FAuxPropId", new JObject() { ["FAUXPROPID__FF100003"] = new JObject() { ["FNumber"] = item["杈呭姪灞炴�т唬鐮�"].ToString() } });  // 杈呭姪灞炴��
                                     FentityModel.Add("FExtAuxUnitId", new JObject() { ["FNumber"] = item["杈呰閲忓崟浣嶄唬鐮�"].ToString() });  // 杈呰閲忓崟浣嶄唬鐮�
                                     FentityModel.Add("FExtAuxUnitQty", item["绠辨暟"].ToString()); //绠辨暟
-                                    FentityModel.Add("F_TFKO_Assistant", new JObject() { ["FNumber"] = item["缃戝埆浠g爜"].ToString() });  // 缃戝埆
+                                    FentityModel.Add("F_TFKO_Assistant", new JObject() { ["FNumber"] = item["缃戝埆浠g爜"].ToString() });  // 缃戝埆 ???蹇呭~
                                     FentityModel.Add("F_TFKO_Assistant1", new JObject() { ["FNumber"] = item["瀛斿瀷浠g爜"].ToString() });  // 瀛斿瀷
-                                    FentityModel.Add("F_TFKO_Assistant2", new JObject() { ["FNumber"] = item["鑹叉辰浠g爜"].ToString() });  // 鑹叉辰
+                                    FentityModel.Add("F_TFKO_Assistant2", new JObject() { ["FNumber"] = item["鑹叉辰浠g爜"].ToString() });  // 鑹叉辰 ???蹇呭~
                                     FentityModel.Add("F_TFKO_Assistant3", new JObject() { ["FNumber"] = item["绾ゅ害浠g爜"].ToString() });  // 绾ゅ害
-                                    FentityModel.Add("F_paez_Qty", item["姣涢噸"].ToString()); //姣涢噸
+                                    FentityModel.Add("F_paez_Qty", item["姣涢噸"].ToString()); //姣涢噸  ???涓嶈兘灏忎簬绛変簬0
                                     FentityModel.Add("F_TFKO_Text1", item["绠¤壊"].ToString()); //绠¤壊
                                     FentityModel.Add("F_TFKO_Text2", item["鎹诲悜"].ToString()); //鎹诲悜
                                     FentityModel.Add("FBoxcode", item["绠卞彿"].ToString()); //绠卞彿
@@ -4414,7 +4416,7 @@
                                     FentityModel.Add("F_paez_Integer4", item["绛掑瓙鏁�"].ToString()); //绛掑瓙鏁�
                                     FentityModel.Add("F_paez_BaseQty", item["瀹炲彂鏁伴噺"].ToString()); //瀹炲彂鏁伴噺
                                     FentityModel.Add("F_paez_Qty1", item["瀹炴敹鏁伴噺"].ToString()); //瀹炴敹鏁伴噺
-                                    FentityModel.Add("F_paez_Text2", item["绠卞彿"].ToString()); //绠卞彿
+                                    FentityModel.Add("F_paez_Text2", item["绠卞彿"].ToString()); //绠卞彿 ???涓嶈兘涓烘暟瀛�
 
 
                                     //JArray Fentity2 = new JArray();
@@ -4462,11 +4464,15 @@
                                     objJsonResult.data = null;
                                     return objJsonResult;
                                 }
-
+                                LogService.Write("鍏朵粬鍏ュ簱,鍗冲皢鐧诲綍閲戣澏");
                                 var loginRet = InvokeHelper.Login();
+                                LogService.Write("鍏朵粬鍏ュ簱,鐧诲綍閲戣澏缁撴灉1锛�" + loginRet);
+                                LogService.Write("鍏朵粬鍏ュ簱,鐧诲綍閲戣澏缁撴灉2锛�" + JObject.Parse(loginRet)["LoginResultType"].Value<int>());
+
                                 var isSuccess = JObject.Parse(loginRet)["LoginResultType"].Value<int>();
                                 if (isSuccess == 0)
                                 {
+                                    LogService.Write("鍏朵粬鍏ュ簱,鐧诲綍閲戣澏澶辫触锛�");
                                     oCn.RollBack();
                                     objJsonResult.code = "0";
                                     objJsonResult.count = 0;
@@ -4480,7 +4486,7 @@
 
                                     if (JObject.Parse(result)["Result"]["ResponseStatus"]["IsSuccess"].ToString().ToUpper() != "TRUE")
                                     {
-                                        LogService.Write(JsonConvert.SerializeObject(jsonRoot));
+                                        LogService.Write("鍏ュ簱鐢宠鍗曞悓姝ラ噾铦朵簯澶辫触锛�" + JsonConvert.SerializeObject(jsonRoot));
                                         oCn.RollBack();
                                         objJsonResult.code = "0";
                                         objJsonResult.count = 0;

--
Gitblit v1.9.1