From e6e805f9c46f41b50f4a556732f618ffdb7b4e69 Mon Sep 17 00:00:00 2001 From: duhe <226547893@qq.com> Date: 星期二, 18 三月 2025 15:35:31 +0800 Subject: [PATCH] 生产领料单 --- WebAPI/Controllers/OtherInStockController.cs | 432 ++++++++++++++++++++++++++++++++++++++++++++++++++++- 1 files changed, 422 insertions(+), 10 deletions(-) diff --git a/WebAPI/Controllers/OtherInStockController.cs b/WebAPI/Controllers/OtherInStockController.cs index 1e2d1f0..3a2e60f 100644 --- a/WebAPI/Controllers/OtherInStockController.cs +++ b/WebAPI/Controllers/OtherInStockController.cs @@ -1,5 +1,6 @@ 锘縰sing DBUtility; using Model; +using Newtonsoft.Json; using Newtonsoft.Json.Linq; using SQLHelper; using System; @@ -14,6 +15,7 @@ using WebAPI; using WebAPI.Code; using WebAPI.Models; +using WebAPI.Utility; namespace WebAPI.Controllers { @@ -42,11 +44,16 @@ public DataSet ds = new DataSet(); public ClsGy_BarCodeBill_WMS_Model_View oView = new ClsGy_BarCodeBill_WMS_Model_View(); public ClsKF_PonderationBillMain_Temp model = new ClsKF_PonderationBillMain_Temp(); + public WebS.ClsKf_ICStockBill_WMS WebSoBar = new WebS.ClsKf_ICStockBill_WMS(); + public WebS.WebService1 oWebs = new WebS.WebService1(); //public double sRelQty = 0; // private DataBaseServices objDataBaseServices = new DataBaseServices(); private JsonResult objJsonResult = new JsonResult(); public ClsKf_ICStockBill_WMS oBar = new Model.ClsKf_ICStockBill_WMS(); // private string msgModel = "{{\"count\":{0},\"code\":{0},\"message\":\"{1}\",\"result\":{2}}}"; + Pub_Class.ClsXt_SystemParameter oSystemParameter = new Pub_Class.ClsXt_SystemParameter(); + SQLHelper.ClsCN oCn = new SQLHelper.ClsCN(); + public static string GetSession(string sMsg) { try @@ -68,8 +75,255 @@ [HttpGet] public Object get_CheckTypeByBarCode_Json(string sCode, Int64 sInterID, string sBillNo, string sMaker, Int64 WhID, Int64 SPID, Double sQty, bool sRedBlue, bool SourceFlag, string sSourceBillNo, string sSourceType, Int64 HOWNERID) { - oBar = webserver.get_CheckTypeByBarCode(sCode, sInterID, HBillType, sBillNo, sMaker, WhID, SPID, sQty, sRedBlue, SourceFlag, sSourceBillNo, sSourceType, HOWNERID, ref DBUtility.ClsPub.sErrInfo); - if (oBar == null) + + string sErrMsg = ""; + bool bResult; + ////鑾峰彇绯荤粺鍙傛暟 + //if (oSystemParameter.ShowBill(ref sErrMsg) == true) + //{ + // if (oSystemParameter.omodel.WMS_CampanyName == "妫シ" && sSourceType == "1241") //瀹㈡埛涓烘.妤凤紝骞朵笖涓哄叾浠栧叆搴撳崟妯″潡鏃惰繘鍏ュ垽鏂� + // { + // DataSet ds; + // string sql = "select HBarCode,HSourceInterID,HSourceEntryID,HSourceBillNo from Gy_BarCodeBill with(nolock) where HBarCode = '" + sCode + "'"; + // string HDataBaseName = Util.GetConfigKey(AppDomain.CurrentDomain.BaseDirectory + "/Config/kdapi.config", "DataBaseName");//鑾峰彇閲戣澏鏁版嵁搴撳悕绉� + // string HSourceBillNo = ""; + // Int64 HSourceInterID = 0; + + // ds = oCn.RunProcReturn(sql, "Gy_BarCodeBill"); + // //鍒ゆ柇鏉$爜淇℃伅鏄惁鍦ㄦ潯鐮佹。妗堜腑 + // if (ds == null || ds.Tables[0].Rows.Count < 1) + // { + // objJsonResult.code = "0"; + // objJsonResult.count = 0; + // objJsonResult.Message = "鏉$爜妗f涓笉瀛樺湪姝ゆ潯鐮佺紪鍙凤細" + sCode; + // objJsonResult.data = null; + // return objJsonResult; + // } + // else + // { + // //鑾峰彇鍏ュ簱鐢宠鍗曞崟鍙�/涓籌D + // HSourceBillNo = 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 + "'", HDataBaseName); + // ds = oCn.RunProcReturn(sql, "TFKO_t_Cust100009"); + // //鍏ュ簱鐢宠鍗曟病鏈夊悓姝ュ埌閲戣澏鍒欒繘琛屽悓姝� + // if (ds == null || ds.Tables[0].Rows.Count < 1) + // { + // sql = "exec h_p_Kf_StockInRequestBillToErp " + HSourceInterID + "," + HSourceBillNo; + // ds = oCn.RunProcReturn(sql, "h_p_Kf_StockInRequestBillToErp"); + + // if (ds == null || ds.Tables[0].Rows.Count == 0) + // { + // oCn.RollBack(); + // objJsonResult.code = "0"; + // objJsonResult.count = 0; + // objJsonResult.Message = "webapi鍏ュ簱鐢宠鍗曞悓姝ワ紝鑾峰彇淇℃伅澶辫触"; + // objJsonResult.data = null; + // return objJsonResult; + // } + // else + // { + // 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("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_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_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_BaseProperty", Pub_Class.ClsPub.isStrNull(ds.Tables[0].Rows[0]["鏈哄彴"])); //鏈哄彴 + // model.Add("F_paez_Decimal", Pub_Class.ClsPub.isStrNull(ds.Tables[0].Rows[0]["绠遍噸"])); //绠遍噸 + // //model.Add("F_WJUK_Text", Pub_Class.ClsPub.isStrNull(ds.Tables[0].Rows[0]["鏉ユ簮"])); //鏉ユ簮 + // 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_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]["鏈�澶х鍙�"])); //鏈�澶х鍙� + // //model.Add("F_paez_PrintTimes", Pub_Class.ClsPub.isStrNull(ds.Tables[0].Rows[0]["鎵撳嵃娆℃暟"])); //鎵撳嵃娆℃暟 + // //model.Add("F_paez_Text5", Pub_Class.ClsPub.isStrNull(ds.Tables[0].Rows[0]["绾垮彿"])); //鏉$爜鎵撳嵃 + // //model.Add("F_paez_BaseProperty10", new JObject() { ["FNumber"] = Pub_Class.ClsPub.isStrNull(ds.Tables[0].Rows[0]["閮ㄩ棬浠g爜"]) }); //鐢熶骇閮ㄩ棬 + // model.Add("F_paez_Combo1", Pub_Class.ClsPub.isStrNull(ds.Tables[0].Rows[0]["鏄惁鍐呭璐�"])); //鏄惁鍐呭璐� + // model.Add("F_paez_Combo2", Pub_Class.ClsPub.isStrNull(ds.Tables[0].Rows[0]["浜у搧绫诲瀷"])); //浜у搧绫诲瀷 + // model.Add("F_paez_Combo3", Pub_Class.ClsPub.isStrNull(ds.Tables[0].Rows[0]["婊$増鐘舵��"])); //婊$増鐘舵�� + // //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 + + + // JArray Fentity = new JArray(); + // foreach (DataRow item in ds.Tables[1].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("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("FOWNERID", new JObject() { ["FNumber"] = item["璐т富浠g爜"].ToString() }); // 璐т富浠g爜 + // 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_Assistant1", 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_TFKO_Text1", item["绠¤壊"].ToString()); //绠¤壊 + // FentityModel.Add("F_TFKO_Text2", item["鎹诲悜"].ToString()); //鎹诲悜 + // FentityModel.Add("FBoxcode", item["绠卞彿"].ToString()); //绠卞彿 + // FentityModel.Add("F_PAEZ_SQSL", item["鐢宠鍗曟暟閲�"].ToString()); //鐢宠鍗曟暟閲� + // 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()); //绠卞彿 + + + // //JArray Fentity2 = new JArray(); + // //JObject FentityModel2 = new JObject(); + // //FentityModel2.Add("FEntity_Link_FFlowId", item["FEntity_Link_FFlowId"].ToString()); + // //FentityModel2.Add("FEntity_Link_FFlowLineId", item["FEntity_Link_FFlowLineId"].ToString()); + // //FentityModel2.Add("FEntity_Link_FRuleId", item["FEntity_Link_FRuleId"].ToString()); + // //FentityModel2.Add("FEntity_Link_FSTableName", item["FEntity_Link_FSTableName"].ToString()); + // //FentityModel2.Add("FEntity_Link_FSBillId", item["FEntity_Link_FSBillId"].ToString()); + // //FentityModel2.Add("FEntity_Link_FSId", item["FEntity_Link_FSId"].ToString()); + // //Fentity2.Add(FentityModel2); + // //FentityModel.Add("FEntity_Link", Fentity2); + // //FentityModel.Add("FBFLowId", new JObject() { ["FID"] = item["FBFLOWID"].ToString() }); + // Fentity.Add(FentityModel); + // } + // model.Add("FEntity", Fentity); //鏄庣粏淇℃伅 + // JObject jsonRoot = new JObject() + // { + // ["Creator"] = "", + // ["NeedUpDateFields"] = new JArray(), + // ["NeedReturnFields"] = new JArray(), + // //["IsDeleteEntry"] = "true", + // //["SubSystemId"] = "", + // //["IsVerifyBaseDataField"] = "false", + // ["IsDeleteEntry"] = "true", + // ["SubSystemId"] = "", + // ["IsVerifyBaseDataField"] = "true", + // ["IsEntryBatchFill"] = "false", + // ["ValidateFlag"] = "true", + // ["NumberSearch"] = "true", + // ["IsAutoAdjustField"] = "false", + // ["InterationFlags"] = "", + // ["IgnoreInterationFlag"] = "", + // //["IsAutoSubmitAndAudit"] = true,//鑷姩璋冪敤鎻愪氦鍜屽鏍稿姛鑳� + // ["Model"] = model + // }; + + // //浠庨厤缃枃浠惰幏鍙� CLOUD缃戝潃銆佽处濂椾俊鎭�佺櫥褰曠敤鎴枫�佺櫥褰曞瘑鐮� + // if (!Pub_Class.ClsPub.GetCLOUDLoginInfo(ref Pub_Class.ClsPub.sExeReturnInfo)) + // { + // oCn.RollBack(); + // objJsonResult.code = "0"; + // objJsonResult.count = 0; + // objJsonResult.Message = "鍏ュ簱鐢宠鍗曞悓姝ヨ幏鍙栫櫥褰曡处鍙峰瘑鐮佸け璐ワ紒"; + // objJsonResult.data = null; + // return objJsonResult; + // } + + // var loginRet = InvokeHelper.Login(); + // var isSuccess = JObject.Parse(loginRet)["LoginResultType"].Value<int>(); + // if (isSuccess == 0) + // { + // oCn.RollBack(); + // objJsonResult.code = "0"; + // objJsonResult.count = 0; + // objJsonResult.Message = "鐧诲綍閲戣澏澶辫触锛�"; + // objJsonResult.data = null; + // return objJsonResult; + // } + // else + // { + // string result = InvokeHelper.Save("k18d2ab4f14034c569576ec8e0835a80c", JsonConvert.SerializeObject(jsonRoot));//淇濆瓨 + + // if (JObject.Parse(result)["Result"]["ResponseStatus"]["IsSuccess"].ToString().ToUpper() != "TRUE") + // { + // LogService.Write(JsonConvert.SerializeObject(jsonRoot)); + // oCn.RollBack(); + // objJsonResult.code = "0"; + // objJsonResult.count = 0; + // objJsonResult.Message = "鍏ュ簱鐢宠鍗曞悓姝ラ噾铦朵簯澶辫触锛佸崟鍙�:" + HSourceBillNo + result + jsonRoot; + // objJsonResult.data = null; + // return objJsonResult; + // } + + // //鎻愪氦瀹℃牳 + // string result1 = string.Empty; + // string result2 = string.Empty; + // var fID = JObject.Parse(result)["Result"]["Id"].ToString(); + // var fBillNo = JObject.Parse(result)["Result"]["Number"].ToString(); + // var json = new + // { + // Ids = fID, + // }; + // if (oSystemParameter.omodel.Kf_StockInRequestBill_AutoCheck == "Y") //绯荤粺鍙傛暟 鑷姩瀹℃牳 + // { + // result1 = InvokeHelper.Submit("k18d2ab4f14034c569576ec8e0835a80c", JsonConvert.SerializeObject(json));//鎻愪氦 + // result2 = InvokeHelper.Audit("k18d2ab4f14034c569576ec8e0835a80c", JsonConvert.SerializeObject(json));//瀹℃牳 + + // if (JObject.Parse(result1)["Result"]["ResponseStatus"]["IsSuccess"].ToString().ToUpper() != "TRUE") + // { + // oCn.RollBack(); + // objJsonResult.code = "0"; + // objJsonResult.count = 0; + // objJsonResult.Message = "鍏ュ簱鐢宠鍗曞崟鍙�:" + ",鎻愪氦澶辫触" + result1; + // objJsonResult.data = null; + // return objJsonResult; + // } + + // if (JObject.Parse(result2)["Result"]["ResponseStatus"]["IsSuccess"].ToString().ToUpper() != "TRUE") + // { + // oCn.RollBack(); + // objJsonResult.code = "0"; + // objJsonResult.count = 0; + // objJsonResult.Message = "鍏ュ簱鐢宠鍗曞崟鍙�:" + ",瀹℃牳澶辫触" + result2; + // objJsonResult.data = null; + // return objJsonResult; + // } + // } + // } + // } + // } + // } + // } + //} + //else + //{ + // objJsonResult.code = "0"; + // objJsonResult.count = 0; + // objJsonResult.Message = "鑾峰彇绯荤粺鍙傛暟澶辫触锛� " + sErrMsg; + // objJsonResult.data = null; + // return objJsonResult; + //} + + string sExpressNumber = ""; + WebSoBar = oWebs.get_CheckTypeByBarCode_All(sCode, sInterID, HBillType, sBillNo, sMaker, WhID, SPID, sQty, sRedBlue, SourceFlag, sSourceBillNo, sSourceType, HOWNERID, sExpressNumber, ref DBUtility.ClsPub.sErrInfo); + if (WebSoBar == null) { objJsonResult.code = "0"; objJsonResult.count = 0; @@ -79,7 +333,7 @@ } else { - objJsonResult.code = "0"; + objJsonResult.code = "1"; objJsonResult.count = 1; objJsonResult.Message = DBUtility.ClsPub.sErrInfo; objJsonResult.data = oBar; @@ -164,6 +418,7 @@ { try { + string sErrMsg = ""; bool sBool = false; oView = webserver.get_InfoByBarCode_Source(sBarCode, sInterID, ref sBool, ref sErrMsg); @@ -189,8 +444,8 @@ model.HSourceBillType = oView.HSourceBillType; model.HRedBlueFlag = false; model.HPieceQty = 1; - model.HSTOCKORGID = 0; - model.HOWNERID = 0; + model.HSTOCKORGID = ClsPub.HORGANIZATIONSID; + model.HOWNERID = ClsPub.HORGANIZATIONSID; if (webserver.set_SavePonderationBillMain_Temp_Qty(model, sQty, ref DBUtility.ClsPub.sErrInfo)) { objJsonResult.code = "0"; @@ -230,6 +485,8 @@ string msg1 = _value.ToString(); try { + + List<Model.ClsKf_ICStockBillMain> lsmain = new List<Model.ClsKf_ICStockBillMain>(); ListModels oListModels = new ListModels(); lsmain = oListModels.getICStockBillMainByJson(msg1); @@ -267,25 +524,99 @@ /// 鐢熸垚鍏朵粬鍏ュ簱鍗� /// </summary> /// <returns></returns> + //[Route("OtherInStockBill/set_SaveOtherInStockBill_Json")] + //[HttpPost] + //public object set_SaveOtherInStockBill_Json([FromBody]JObject oMain) + //{ + // var _value = oMain["oMain"].ToString(); + // string msg1 = _value.ToString(); + + // try + // { + // List<Model.ClsKf_OtherInBillMain> lsmain = new List<Model.ClsKf_OtherInBillMain>(); + // ListModels oListModels = new ListModels(); + // lsmain = oListModels.getOtherInBillMainByJson(msg1); + // lsmain[0].HYear = DBUtility.ClsPub.isLong(DateTime.Now.Year); + // lsmain[0].HDate = DBUtility.ClsPub.isDate(DateTime.Now.ToString("yyyy-MM-dd")); + // string sSourceBillType = lsmain[0].HBillType; + + // WebAPI.WebS.ClsKf_OtherInBillMain websLsmain = new WebS.ClsKf_OtherInBillMain(); + // websLsmain.HInterID = lsmain[0].HInterID; + // websLsmain.HDate = lsmain[0].HDate; + // websLsmain.HBillNo = lsmain[0].HBillNo; + // websLsmain.HDeptID = lsmain[0].HDeptID; + // websLsmain.HEmpID = lsmain[0].HEmpID; + // websLsmain.HRemark = lsmain[0].HRemark; + // websLsmain.HMaker = lsmain[0].HMaker; + // websLsmain.HSTOCKORGID = lsmain[0].HSTOCKORGID; + // websLsmain.HOWNERID = lsmain[0].HSTOCKORGID; + + // WebS.ClsXt_SystemParameterMain oSystemParameterMain = new WebS.ClsXt_SystemParameterMain(); + // if (webserver.set_SaveOtherInBill_New(websLsmain, sSourceBillType, oSystemParameterMain, ref DBUtility.ClsPub.sErrInfo)) + // { + // objJsonResult.code = "0"; + // objJsonResult.count = 1; + // objJsonResult.Message = "鐢熸垚鍏朵粬鍏ュ簱鍗曟垚鍔燂紒鍗曟嵁鍙蜂负锛�"; + // objJsonResult.data = null; + // return objJsonResult; + // } + // else + // { + // objJsonResult.code = "0"; + // objJsonResult.count = 0; + // objJsonResult.Message = "涓婁紶澶辫触锛�" + DBUtility.ClsPub.sErrInfo; + // objJsonResult.data = null; + // return objJsonResult; + // } + // } + // catch (Exception e) + // { + // objJsonResult.code = "0"; + // objJsonResult.count = 0; + // objJsonResult.Message = "涓婁紶澶辫触锛�" + e.ToString(); + // objJsonResult.data = null; + // return objJsonResult; + // } + //} [Route("OtherInStockBill/set_SaveOtherInStockBill_Json")] [HttpPost] public object set_SaveOtherInStockBill_Json([FromBody]JObject oMain) { var _value = oMain["oMain"].ToString(); string msg1 = _value.ToString(); + try { List<Model.ClsKf_OtherInBillMain> lsmain = new List<Model.ClsKf_OtherInBillMain>(); ListModels oListModels = new ListModels(); lsmain = oListModels.getOtherInBillMainByJson(msg1); - lsmain[0].HYear = DBUtility.ClsPub.isLong(DateTime.Now.Year); - lsmain[0].HDate = DBUtility.ClsPub.isDate(DateTime.Now.ToString("yyyy-MM-dd")); + //lsmain[0].HYear = DBUtility.ClsPub.isLong(DateTime.Now.Year); + //lsmain[0].HDate = DBUtility.ClsPub.isDate(DateTime.Now.ToString("yyyy-MM-dd")); string sSourceBillType = lsmain[0].HBillType; - if (webserver.set_SaveOtherInBill_New(lsmain[0], sSourceBillType, ref DBUtility.ClsPub.sErrInfo)) + + WebAPI.WebS.ClsKf_OtherInBillMain websLsmain = new WebS.ClsKf_OtherInBillMain(); + websLsmain.HInterID = lsmain[0].HInterID; + websLsmain.HDate = lsmain[0].HDate; + websLsmain.HBillNo = lsmain[0].HBillNo; + websLsmain.HDeptID = lsmain[0].HDeptID; + websLsmain.HEmpID = lsmain[0].HEmpID; + websLsmain.HRemark = lsmain[0].HRemark; + websLsmain.HMaker = lsmain[0].HMaker; + websLsmain.HSTOCKORGID = lsmain[0].HSTOCKORGID; + websLsmain.HOWNERID = lsmain[0].HSTOCKORGID; + websLsmain.HKeeperID = lsmain[0].HKeeperID; + websLsmain.HSecManagerID = lsmain[0].HSecManagerID; + websLsmain.HBillerID = lsmain[0].HBillerID; + websLsmain.HBillType = "1203";//鍥哄畾鍊� + websLsmain.HBillSubType = lsmain[0].HBillSubType; + + WebS.WebService1 oWebs = new WebS.WebService1(); + WebS.ClsXt_SystemParameterMain oSystemParameterMain = new WebS.ClsXt_SystemParameterMain(); + if (oWebs.set_SaveOtherInBill_New(websLsmain, sSourceBillType, ref DBUtility.ClsPub.sErrInfo)) { objJsonResult.code = "0"; objJsonResult.count = 1; - objJsonResult.Message = "鐢熸垚鍏朵粬鍏ュ簱鍗曟垚鍔燂紒鍗曟嵁鍙蜂负锛�"; + objJsonResult.Message = DBUtility.ClsPub.sErrInfo; //鎴愬姛锛� objJsonResult.data = null; return objJsonResult; } @@ -293,7 +624,8 @@ { objJsonResult.code = "0"; objJsonResult.count = 0; - objJsonResult.Message = "涓婁紶澶辫触锛�" + DBUtility.ClsPub.sErrInfo; + objJsonResult.Message = DBUtility.ClsPub.sErrInfo; //澶辫触锛� + //objJsonResult.Message = "涓婁紶澶辫触锛�" + DBUtility.ClsPub.sErrInfo; objJsonResult.data = null; return objJsonResult; } @@ -344,6 +676,48 @@ // } //} + + //鍒锋柊琛ㄤ綋 杩斿洖鍑哄叆搴撴潯鐮佷复鏃惰〃锛堥鏂欏嚭搴撶畝娲佺増锛� + [Route("OtherInStockBill/DisBillEntryList_Webs_New_Json1")] + [HttpGet] + public object DisBillEntryList_Webs_New_Json1(long HBillID, string HBillNo, string HBillType, string sMouldManagerCtl, string sFIFOCtl) + { + try + { + WebS.WebService1 oWebs = new WebS.WebService1(); + ds = oWebs.GetBillEntry_TmpList(HBillID, HBillNo, HBillType, ref sMouldManagerCtl, ref sFIFOCtl, ref DBUtility.ClsPub.sErrInfo); + if (ds == null || ds.Tables[0].Rows.Count <= 0) + { + objJsonResult.code = "0"; + objJsonResult.count = 0; + objJsonResult.Message = "娌℃湁杩斿洖浠讳綍璁板綍锛�"; + objJsonResult.data = null; + return objJsonResult; + //DBUtility.ClsPub.MessageBeep((int)DBUtility.ClsPub.BeepType.Warning); + } + else + { + objJsonResult.code = "0"; + objJsonResult.count = 1; + objJsonResult.Message = "鑾峰彇淇℃伅鎴愬姛锛�"; + objJsonResult.data = new + { + list = ds.Tables[0], + list2 = ds.Tables[4] + }; + return objJsonResult; + } + } + catch (Exception e) + { + objJsonResult.code = "0"; + objJsonResult.count = 0; + objJsonResult.Message = "娌℃湁杩斿洖浠讳綍璁板綍锛�" + e.ToString(); + objJsonResult.data = null; + return objJsonResult; + } + } + [Route("OtherInBill/Delete_Json")] [HttpGet] public object Delete_Json(long HInterID, long HMaterID, long HAuxPropID, string HMTONo, long HSourceInterID, long HSourceEntryID, string sHBillType) @@ -380,6 +754,44 @@ } + + [Route("MateBill/Delete_Json1")] + [HttpGet] + public object Delete_Json1(long HInterID, long HMaterID, long HAuxPropID, string HMTONo, long HSourceInterID, long HSourceEntryID, string sHBillType) + { + string sErrMsg = string.Empty; + WebS.WebService1 oWebs = new WebS.WebService1(); + try + { + if (oWebs.set_DelPonderationBillMain_Temp_InterIDAndSource(HInterID, HMaterID, HAuxPropID, HMTONo, HSourceInterID, HSourceEntryID, sHBillType, ref sErrMsg)) + { + objJsonResult.code = "0"; + objJsonResult.count = 1; + objJsonResult.Message = "鍒犻櫎鎴愬姛锛�"; + objJsonResult.data = null; + return objJsonResult; + } + else + { + objJsonResult.code = "0"; + objJsonResult.count = 0; + objJsonResult.Message = "鍒犻櫎澶辫触锛�"; + objJsonResult.data = null; + return objJsonResult; + } + } + catch (Exception) + { + + objJsonResult.code = "0"; + objJsonResult.count = 0; + objJsonResult.Message = "鍒犻櫎澶辫触锛�"; + objJsonResult.data = null; + return objJsonResult; + } + + } + [Route("OtherInBill/DisBillEntryList_Mate_Webs_Json")] [HttpGet] public object DisBillEntryList_Mate_Webs_Json(string HBillType, string sWhere) -- Gitblit v1.9.1