From dc34e9d0690456225cabf79a40192de1abdf8dde Mon Sep 17 00:00:00 2001 From: chenhaozhe <cgz@hz-kingdee.com> Date: 星期五, 08 八月 2025 11:31:10 +0800 Subject: [PATCH] 1 --- WebAPI/Controllers/条码管理/WEBSController.cs | 1250 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++--- 1 files changed, 1,177 insertions(+), 73 deletions(-) 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 6bfacd5..63d771f 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" @@ -32,6 +32,7 @@ public WebS.WebService1 oWebs = new WebS.WebService1(); public WebS.ClsKf_ICStockBill_WMS WebSoBar = new WebS.ClsKf_ICStockBill_WMS(); Pub_Class.ClsXt_SystemParameter oSystemParameter = new Pub_Class.ClsXt_SystemParameter(); + DBUtility.ClsXt_BaseBill oBaseBill = new DBUtility.ClsXt_BaseBill(); string ComputerName = SystemInformation.ComputerName; //璁惧鍚嶇О @@ -951,11 +952,18 @@ /// <returns></returns> [Route("WEBSController/GetEquipList_Json")] [HttpGet] - public object GetEquipList_Json(string Equip) + public object GetEquipList_Json(string Equip,int HCenterID) { try { - ds = oCn.RunProcReturn("select HInterID,HEquipFileNumber,HName,HSourceID,HSourceName from h_v_Gy_EquipFileBill where HEquipFileNumber like '%" + Equip + "%' or HName like '%" + Equip + "%'", "h_v_Gy_EquipFileBill"); + if (HCenterID !=0) + { + ds = oCn.RunProcReturn("select HInterID,HEquipFileNumber,HName,HSourceID,HSourceName,HCenterID from h_v_Gy_EquipFileBill where HCenterID='"+HCenterID+"' and ( HEquipFileNumber like '%" + Equip + "%' or HName like '%" + Equip + "%')", "h_v_Gy_EquipFileBill"); + } + else + { + ds = oCn.RunProcReturn("select HInterID,HEquipFileNumber,HName,HSourceID,HSourceName from h_v_Gy_EquipFileBill where HEquipFileNumber like '%" + Equip + "%' or HName like '%" + Equip + "%'", "h_v_Gy_EquipFileBill"); + } if (ds == null || ds.Tables[0].Rows.Count == 0) { objJsonResult.code = "0"; @@ -1445,28 +1453,107 @@ { try { - if (oWebs.set_DelPonderationBillMain_Temp_FIFO(HInterID, HBillType, ref DBUtility.ClsPub.sErrInfo)) - { - objJsonResult.code = "0"; - objJsonResult.count = 1; - objJsonResult.Message = DBUtility.ClsPub.sErrInfo; //鎴愬姛锛� - objJsonResult.data = null; - return objJsonResult; - } - else - { - objJsonResult.code = "0"; - objJsonResult.count = 0; - objJsonResult.Message = DBUtility.ClsPub.sErrInfo; //澶辫触锛� - objJsonResult.data = null; - return objJsonResult; - } + //鏇存柊鍏堣繘鍏堝嚭涓存椂琛ㄧ姸鎬� + oCn.RunProc("EXEC h_p_WMS_UPDateICInventory_FIFO_Tmp " + HInterID.ToString() + ",'" + HBillType + "'"); + objJsonResult.code = "0"; + objJsonResult.count = 1; + objJsonResult.Message = DBUtility.ClsPub.sErrInfo; //鎴愬姛锛� + objJsonResult.data = null; + return objJsonResult; } catch (Exception e) { objJsonResult.code = "0"; objJsonResult.count = 0; objJsonResult.Message = "鏇存柊鍏堣繘鍏堝嚭涓存椂琛℉lineStatus鍊煎け璐ワ紒" + e.ToString(); + objJsonResult.data = null; + return objJsonResult; + } + } + + /// <summary> + /// 鍑哄簱鎵爜妯″潡锛岄��鍑烘椂鏇存柊鍏堣繘鍏堝嚭涓存椂琛ㄧ姸鎬� HlineStatus 20250722 + /// </summary> + /// <returns></returns> + [Route("WEBSController/set_DelPonderationBillMain_Temp_FIFO_New_Json")] + [HttpGet] + public object set_DelPonderationBillMain_Temp_FIFO_New_Json(long HInterID, string HBillType, Int64 HStockOrgID) + { + //鑾峰彇绯荤粺鍙傛暟 + string sErrMsg = ""; + if (oSystemParameter.ShowBillByOrgID(HStockOrgID, ref sErrMsg) == true) + { + string sERPMode = oSystemParameter.omodel.WMS_WMSStockCtl_ERPMode; //搴撳瓨鎺у埗-WMS搴撳瓨鎺у埗ERP妯″紡 (WISE銆丆LOUD銆丮ES) + string sFIFOCtl = "N"; //鍏堣繘鍏堝嚭鎺у埗锛�'Y'涓烘帶鍒讹級 + + //鐢熶骇棰嗘枡鍗�-鍏堣繘鍏堝嚭鎺у埗 + if (HBillType == "1204" && (oSystemParameter.omodel.Kf_MateOutBill_FIFOCtl.ToUpper() == "Y" || oSystemParameter.omodel.Kf_MateOutBill_FIFOList.ToUpper() == "Y")) + { + sFIFOCtl = "Y"; + } + //閿�鍞嚭搴撳崟-鍏堣繘鍏堝嚭鎺у埗 + else if (HBillType == "1205" && (oSystemParameter.omodel.Kf_SellOutBill_FIFOCtl.ToUpper() == "Y" || oSystemParameter.omodel.Kf_SellOutBill_FIFOList.ToUpper() == "Y")) + { + sFIFOCtl = "Y"; + } + //鍏朵粬鍑哄簱鍗�-鍏堣繘鍏堝嚭鎺у埗 + else if (HBillType == "1206" && (oSystemParameter.omodel.Kf_OtherOutBill_FIFOCtl.ToUpper() == "Y" || oSystemParameter.omodel.Kf_OtherOutBill_FIFOList.ToUpper() == "Y")) + { + sFIFOCtl = "Y"; + } + //濮斿鍑哄簱鍗�-鍏堣繘鍏堝嚭鎺у埗 + else if (HBillType == "1211" && (oSystemParameter.omodel.Kf_EntrustOutBill_FIFOCtl.ToUpper() == "Y" || oSystemParameter.omodel.Kf_EntrustOutBill_FIFOList.ToUpper() == "Y")) + { + sFIFOCtl = "Y"; + } + //鐩存帴璋冩嫧鍗�-鍏堣繘鍏堝嚭鎺у埗 + else if (HBillType == "1207" && (oSystemParameter.omodel.Kf_MoveStockBill_FIFOCtl.ToUpper() == "Y" || oSystemParameter.omodel.Kf_MoveStockBill_FIFOList.ToUpper() == "Y")) + { + sFIFOCtl = "Y"; + } + //鍒嗘寮忚皟鍑哄崟-鍏堣繘鍏堝嚭鎺у埗 + else if (HBillType == "1250" && (oSystemParameter.omodel.Kf_MoveStockStepOutBill_FIFOCtl.ToUpper() == "Y" || oSystemParameter.omodel.Kf_MoveStockStepOutBill_FIFOList.ToUpper() == "Y")) + { + sFIFOCtl = "Y"; + } + //鐢熶骇琛ユ枡鍗�-鍏堣繘鍏堝嚭鎺у埗 + else if (HBillType == "1254" && (oSystemParameter.omodel.Kf_MateReplenishOutBill_FIFOCtl.ToUpper() == "Y" || oSystemParameter.omodel.Kf_MateReplenishOutBill_FIFOList.ToUpper() == "Y")) + { + sFIFOCtl = "Y"; + } + //濮斿琛ユ枡鍗�-鍏堣繘鍏堝嚭鎺у埗 + else if (HBillType == "1255" && (oSystemParameter.omodel.Kf_EntrustReplenishOutBill_FIFOCtl.ToUpper() == "Y" || oSystemParameter.omodel.Kf_EntrustReplenishOutBill_FIFOList.ToUpper() == "Y")) + { + sFIFOCtl = "Y"; + } + + try + { + if(sFIFOCtl == "Y") + { + //鏇存柊鍏堣繘鍏堝嚭涓存椂琛ㄧ姸鎬� + oCn.RunProc("EXEC h_p_WMS_UPDateICInventory_FIFO_Tmp " + HInterID.ToString() + ",'" + HBillType + "'"); + } + objJsonResult.code = "0"; + objJsonResult.count = 1; + objJsonResult.Message = DBUtility.ClsPub.sErrInfo; //鎴愬姛锛� + objJsonResult.data = null; + return objJsonResult; + } + catch (Exception e) + { + objJsonResult.code = "0"; + objJsonResult.count = 0; + objJsonResult.Message = "鏇存柊鍏堣繘鍏堝嚭涓存椂琛℉lineStatus鍊煎け璐ワ紒" + e.ToString(); + objJsonResult.data = null; + return objJsonResult; + } + } + else + { + objJsonResult.code = "0"; + objJsonResult.count = 0; + objJsonResult.Message = "鑾峰彇绯荤粺鍙傛暟澶辫触锛� " + sErrMsg; objJsonResult.data = null; return objJsonResult; } @@ -1948,27 +2035,114 @@ } /// <summary> - /// 鍒犻櫎缂撳瓨鍒楄〃鍗曟嵁 + /// 鍒犻櫎缂撳瓨鍒楄〃鍗曟嵁锛屽垹闄ゆ椂鍒ゆ柇鍗曟嵁鏄惁寮傚父锛屽啓鍏ユ棩蹇� 20250722 /// </summary> /// <returns></returns> [Route("WEBSController/set_DelPonderationBillMain_Temp_Json")] [HttpGet] - public object set_DelPonderationBillMain_Temp_Json(long HInterID, string HBillType) + public object set_DelPonderationBillMain_Temp_Json(long HInterID, string HBillNo, string HBillType, string HMaker, Int64 HStockOrgID, string MvarReportTitle) { - try + //鑾峰彇绯荤粺鍙傛暟 + string sErrMsg = ""; + if (oSystemParameter.ShowBillByOrgID(HStockOrgID, ref sErrMsg) == true) { - oCn.RunProc("Delete from KF_PonderationBillMain_Temp where HInterID=" + HInterID.ToString() + " and HBillType='" + HBillType + "'", ref DBUtility.ClsPub.sExeReturnInfo); - objJsonResult.code = "0"; - objJsonResult.count = 1; - objJsonResult.Message = "鍒犻櫎鎴愬姛"; - objJsonResult.data = null; - return objJsonResult; + string sERPMode = oSystemParameter.omodel.WMS_WMSStockCtl_ERPMode; //搴撳瓨鎺у埗-WMS搴撳瓨鎺у埗ERP妯″紡 (WISE銆丆LOUD銆丮ES) + string sFIFOCtl = "N"; //鍏堣繘鍏堝嚭鎺у埗锛�'Y'涓烘帶鍒讹級 + + //鐢熶骇棰嗘枡鍗�-鍏堣繘鍏堝嚭鎺у埗 + if (HBillType == "1204" && (oSystemParameter.omodel.Kf_MateOutBill_FIFOCtl.ToUpper() == "Y" || oSystemParameter.omodel.Kf_MateOutBill_FIFOList.ToUpper() == "Y")) + { + sFIFOCtl = "Y"; + } + //閿�鍞嚭搴撳崟-鍏堣繘鍏堝嚭鎺у埗 + else if (HBillType == "1205" && (oSystemParameter.omodel.Kf_SellOutBill_FIFOCtl.ToUpper() == "Y" || oSystemParameter.omodel.Kf_SellOutBill_FIFOList.ToUpper() == "Y")) + { + sFIFOCtl = "Y"; + } + //鍏朵粬鍑哄簱鍗�-鍏堣繘鍏堝嚭鎺у埗 + else if (HBillType == "1206" && (oSystemParameter.omodel.Kf_OtherOutBill_FIFOCtl.ToUpper() == "Y" || oSystemParameter.omodel.Kf_OtherOutBill_FIFOList.ToUpper() == "Y")) + { + sFIFOCtl = "Y"; + } + //濮斿鍑哄簱鍗�-鍏堣繘鍏堝嚭鎺у埗 + else if (HBillType == "1211" && (oSystemParameter.omodel.Kf_EntrustOutBill_FIFOCtl.ToUpper() == "Y" || oSystemParameter.omodel.Kf_EntrustOutBill_FIFOList.ToUpper() == "Y")) + { + sFIFOCtl = "Y"; + } + //鐩存帴璋冩嫧鍗�-鍏堣繘鍏堝嚭鎺у埗 + else if (HBillType == "1207" && (oSystemParameter.omodel.Kf_MoveStockBill_FIFOCtl.ToUpper() == "Y" || oSystemParameter.omodel.Kf_MoveStockBill_FIFOList.ToUpper() == "Y")) + { + sFIFOCtl = "Y"; + } + //鍒嗘寮忚皟鍑哄崟-鍏堣繘鍏堝嚭鎺у埗 + else if (HBillType == "1250" && (oSystemParameter.omodel.Kf_MoveStockStepOutBill_FIFOCtl.ToUpper() == "Y" || oSystemParameter.omodel.Kf_MoveStockStepOutBill_FIFOList.ToUpper() == "Y")) + { + sFIFOCtl = "Y"; + } + //鐢熶骇琛ユ枡鍗�-鍏堣繘鍏堝嚭鎺у埗 + else if (HBillType == "1254" && (oSystemParameter.omodel.Kf_MateReplenishOutBill_FIFOCtl.ToUpper() == "Y" || oSystemParameter.omodel.Kf_MateReplenishOutBill_FIFOList.ToUpper() == "Y")) + { + sFIFOCtl = "Y"; + } + //濮斿琛ユ枡鍗�-鍏堣繘鍏堝嚭鎺у埗 + else if (HBillType == "1255" && (oSystemParameter.omodel.Kf_EntrustReplenishOutBill_FIFOCtl.ToUpper() == "Y" || oSystemParameter.omodel.Kf_EntrustReplenishOutBill_FIFOList.ToUpper() == "Y")) + { + sFIFOCtl = "Y"; + } + + try + { + string WorkList = "鍒犻櫎缂撳瓨鍗曟嵁锛屽崟鎹彿锛�" + HBillNo; + string SystemName = "WMS-" + MvarReportTitle + "妯″潡"; + oCn.BeginTran(); + ds = oCn.RunProcReturn("exec h_p_WMS_PonderationBillMain_Temp_Delete " + HInterID + ",'" + HBillNo + "','" + HBillType + "','" + sFIFOCtl + "','" + sERPMode + "'", "h_p_WMS_PonderationBillMain_Temp_Delete"); + if (ds == null || ds.Tables[0].Rows.Count == 0) + { + oCn.RollBack(); + objJsonResult.code = "0"; + objJsonResult.count = 0; + objJsonResult.Message = "鍒犻櫎缂撳瓨鍗曟嵁澶辫触锛屽垹闄ょ紦瀛樺崟鎹垽鏂敊璇紒"; + objJsonResult.data = null; + return objJsonResult; + } + else if (DBUtility.ClsPub.isLong(ds.Tables[0].Rows[0]["HBack"]) == 1) + { + oCn.RollBack(); + objJsonResult.code = "0"; + objJsonResult.count = 0; //澶辫触锛� + objJsonResult.Message = DBUtility.ClsPub.isStrNull(ds.Tables[0].Rows[0]["HRemark"]); + objJsonResult.data = null; + return objJsonResult; + } + else + { + //鍐欏叆鏃ュ織 + oCn.RunProc("Insert into System_Log(GeginDate,userid,WorkstationName,WorkList,SystemName,NetUserName,State) values " + + "(getdate(),'" + HMaker + "','" + ComputerName + "','" + WorkList + "','" + SystemName + "','','鍒犻櫎')" + ); + oCn.Commit(); + objJsonResult.code = "0"; + objJsonResult.count = 1; + objJsonResult.Message = "鍗曟嵁鍙凤細" + HBillNo + " 鍒犻櫎鎴愬姛"; + objJsonResult.data = null; + return objJsonResult; + } + } + catch (Exception e) + { + oCn.RollBack(); + objJsonResult.code = "0"; + objJsonResult.count = 0; + objJsonResult.Message = "鍒犻櫎鏉$爜鍑哄叆搴撶紦瀛樺垪琛ㄥ崟鎹け璐ワ紒" + e.ToString(); + objJsonResult.data = null; + return objJsonResult; + } } - catch (Exception e) + else { objJsonResult.code = "0"; objJsonResult.count = 0; - objJsonResult.Message = "鍒犻櫎鏉$爜鍑哄叆搴撶紦瀛樺垪琛ㄥ崟鎹け璐ワ紒" + e.ToString(); + objJsonResult.Message = "鑾峰彇绯荤粺鍙傛暟澶辫触锛� " + sErrMsg; objJsonResult.data = null; return objJsonResult; } @@ -2948,6 +3122,8 @@ websLsmain.HBillerID = lsmain[0].HBillerID; websLsmain.HSTOCKORGID = lsmain[0].HSTOCKORGID; websLsmain.HOWNERID = lsmain[0].HSTOCKORGID; + + if (oWebs.set_SaveEntrustOutBill_New(websLsmain, sSourceType, ref DBUtility.ClsPub.sErrInfo)) { @@ -4020,7 +4196,7 @@ { objJsonResult.code = "0"; objJsonResult.count = 1; - objJsonResult.Message = DBUtility.ClsPub.sErrInfo; //鎴愬姛锛� + objJsonResult.Message = "鍗曟嵁鍙凤細" + HBillNo + " 淇濆瓨鎴愬姛锛�"; objJsonResult.data = null; return objJsonResult; } @@ -4037,7 +4213,7 @@ { objJsonResult.code = "0"; objJsonResult.count = 0; - objJsonResult.Message = "鐢熸垚鐢熶骇缁勬墭鍗曞け璐ワ紒" + e.ToString(); + objJsonResult.Message = "鐢熸垚鍗曟嵁澶辫触锛�" + e.ToString(); objJsonResult.data = null; return objJsonResult; } @@ -4186,6 +4362,316 @@ objJsonResult.code = "0"; objJsonResult.count = 0; objJsonResult.Message = "涓婃枡闃查敊鍗曚笂浼犲け璐ワ紒" + e.Message; + objJsonResult.data = null; + return objJsonResult; + } + } + + #endregion + + #region 杞﹂棿涓婃灦鍗� 涓婁紶鐢熷崟 + + /// <summary> + /// 杞﹂棿涓婃灦鍗曟柊澧炰笂浼� + /// </summary> + /// <returns></returns> + [Route("WEBSController/set_SaveMaterialUpperBill_Json")] + [HttpPost] + public object set_SaveMaterialUpperBill_Json([FromBody] JObject oMain) + { + BillStatus = DBUtility.ClsPub.Enum_BillStatus.BillStatus_AddNew; + var _value = oMain["oMain"].ToString(); + string msg1 = _value.ToString(); + try + { + string sMainStr = "[" + msg1.ToString() + "]"; + List<Model.ClsKf_WorkShopICStockBillMain> mainList = Newtonsoft.Json.JsonConvert.DeserializeObject<List<Model.ClsKf_WorkShopICStockBillMain>>(sMainStr); + + //鍗曟嵁鍙锋槸鍚﹂噸澶� + if (oBaseBill.IsExistBillNo(ref ClsPub.sExeReturnInfo, mainList[0].HBillNo, BillStatus, mainList[0].HInterID)) + { + objJsonResult.code = "0"; + objJsonResult.count = 0; + objJsonResult.Message = "鍗曟嵁鍙烽噸澶嶏紒涓嶅厑璁镐繚瀛橈紒"; + objJsonResult.data = null; + return objJsonResult; + } + //鍒ゆ柇浼氳鏈熸槸鍚﹀悎鐞� + string s = ""; + int sYear = 0; + int sPeriod = 0; + if (DBUtility.Xt_BaseBillFun.Fun_AllowYearPeriod(mainList[0].HDate, ref sYear, ref sPeriod, ref s) == false) + { + objJsonResult.code = "0"; + objJsonResult.count = 0; + objJsonResult.Message = s; + objJsonResult.data = null; + return objJsonResult; + } + oCn.BeginTran(); + //鐢熸垚鍗曟嵁 + //鎻掑叆涓昏〃 + oCn.RunProc("Insert Into Kf_WorkShopICStockBillMain " + + "(HInterID,HBillNo,HBillType,HBillSubType,HDate,HRemark" + + ",HYear,HPeriod,HMaker,HMakeDate,HStockOrgID" + + ",HMainSourceBillType,HMainSourceInterID,HMainSourceEntryID,HMainSourceBillNo" + + ",HMangerID,HSecManagerID,HKeeperID,HDeptID" + + ") " + + " values(" + mainList[0].HInterID.ToString() + ",'" + mainList[0].HBillNo + "','" + mainList[0].HBillType + "','" + mainList[0].HBillSubType + "','" + mainList[0].HDate.ToShortDateString() + "','" + mainList[0].HRemark + "'" + + ", " + sYear.ToString() + "," + sPeriod.ToString() + ",'" + mainList[0].HMaker + "',getdate()," + mainList[0].HSTOCKORGID.ToString() + + ",'" + mainList[0].HMainSourceBillType + "'," + mainList[0].HMainSourceInterID.ToString() + "," + mainList[0].HMainSourceEntryID.ToString() + ",'" + mainList[0].HMainSourceBillNo + "'" + + ", " + mainList[0].HMangerID.ToString() + "," + mainList[0].HSecManagerID.ToString() + "," + mainList[0].HKeeperID.ToString() + "," + mainList[0].HDeptID.ToString() + + ") "); + //鎻掑叆瀛愯〃 + ds = oCn.RunProcReturn("exec h_p_Kf_MaterialUpperBillSub_Insert " + mainList[0].HInterID.ToString() + ",'" + mainList[0].HBillNo + "'", "h_p_Kf_MaterialUpperBillSub_Insert"); + + if (ds == null || ds.Tables[0].Rows.Count == 0) + { + oCn.RollBack(); + objJsonResult.code = "0"; + objJsonResult.count = 0; + objJsonResult.Message = "鍗曟嵁淇濆瓨澶辫触锛�"; + objJsonResult.data = null; + return objJsonResult; + } + else if (DBUtility.ClsPub.isStrNull(ds.Tables[0].Rows[0]["s"]) != "OK") + { + oCn.RollBack(); + objJsonResult.code = "0"; + objJsonResult.count = 0; + objJsonResult.Message = DBUtility.ClsPub.isStrNull(ds.Tables[0].Rows[0]["s"]); + objJsonResult.data = null; + return objJsonResult; + } + else + { + //鏇存柊杞﹂棿鐗╂枡搴撳瓨 + oCn.RunProc("EXEC h_p_WMS_UPDateICinventory_WorkShop " + mainList[0].HInterID.ToString() + ",'" + mainList[0].HBillType + "'"); + //鏇存柊杞﹂棿鏉$爜搴撳瓨 + oCn.RunProc("EXEC h_p_WMS_UPDateBarCodeICinventory_WorkShop " + mainList[0].HInterID.ToString() + ",'" + mainList[0].HBillType + "',1"); + oCn.Commit(); + objJsonResult.code = "0"; + objJsonResult.count = 1; + objJsonResult.Message = "鍗曟嵁鍙凤細" + mainList[0].HBillNo + " 鏂板鎴愬姛锛�"; + objJsonResult.data = null; + return objJsonResult; + } + } + catch (Exception e) + { + oCn.RollBack(); + objJsonResult.code = "0"; + objJsonResult.count = 0; + objJsonResult.Message = "杞﹂棿涓婃灦鍗曚笂浼犲け璐ワ紒" + e.ToString(); + objJsonResult.data = null; + return objJsonResult; + } + } + + #endregion + + #region 杞﹂棿涓嬫灦鍗� 涓婁紶鐢熷崟 + + /// <summary> + /// 杞﹂棿涓嬫灦鍗曟柊澧炰笂浼� + /// </summary> + /// <returns></returns> + [Route("WEBSController/set_SaveMaterialLowerBill_Json")] + [HttpPost] + public object set_SaveMaterialLowerBill_Json([FromBody] JObject oMain) + { + BillStatus = DBUtility.ClsPub.Enum_BillStatus.BillStatus_AddNew; + var _value = oMain["oMain"].ToString(); + string msg1 = _value.ToString(); + try + { + string sMainStr = "[" + msg1.ToString() + "]"; + List<Model.ClsKf_WorkShopICStockBillMain> mainList = Newtonsoft.Json.JsonConvert.DeserializeObject<List<Model.ClsKf_WorkShopICStockBillMain>>(sMainStr); + + //鍗曟嵁鍙锋槸鍚﹂噸澶� + if (oBaseBill.IsExistBillNo(ref ClsPub.sExeReturnInfo, mainList[0].HBillNo, BillStatus, mainList[0].HInterID)) + { + objJsonResult.code = "0"; + objJsonResult.count = 0; + objJsonResult.Message = "鍗曟嵁鍙烽噸澶嶏紒涓嶅厑璁镐繚瀛橈紒"; + objJsonResult.data = null; + return objJsonResult; + } + //鍒ゆ柇浼氳鏈熸槸鍚﹀悎鐞� + string s = ""; + int sYear = 0; + int sPeriod = 0; + if (DBUtility.Xt_BaseBillFun.Fun_AllowYearPeriod(mainList[0].HDate, ref sYear, ref sPeriod, ref s) == false) + { + objJsonResult.code = "0"; + objJsonResult.count = 0; + objJsonResult.Message = s; + objJsonResult.data = null; + return objJsonResult; + } + oCn.BeginTran(); + //鐢熸垚鍗曟嵁 + //鎻掑叆涓昏〃 + oCn.RunProc("Insert Into Kf_WorkShopICStockBillMain " + + "(HInterID,HBillNo,HBillType,HBillSubType,HDate,HRemark" + + ",HYear,HPeriod,HMaker,HMakeDate,HStockOrgID" + + ",HMainSourceBillType,HMainSourceInterID,HMainSourceEntryID,HMainSourceBillNo" + + ",HMangerID,HSecManagerID,HKeeperID,HDeptID" + + ") " + + " values(" + mainList[0].HInterID.ToString() + ",'" + mainList[0].HBillNo + "','" + mainList[0].HBillType + "','" + mainList[0].HBillSubType + "','" + mainList[0].HDate.ToShortDateString() + "','" + mainList[0].HRemark + "'" + + ", " + sYear.ToString() + "," + sPeriod.ToString() + ",'" + mainList[0].HMaker + "',getdate()," + mainList[0].HSTOCKORGID.ToString() + + ",'" + mainList[0].HMainSourceBillType + "'," + mainList[0].HMainSourceInterID.ToString() + "," + mainList[0].HMainSourceEntryID.ToString() + ",'" + mainList[0].HMainSourceBillNo + "'" + + ", " + mainList[0].HMangerID.ToString() + "," + mainList[0].HSecManagerID.ToString() + "," + mainList[0].HKeeperID.ToString() + "," + mainList[0].HDeptID.ToString() + + ") "); + //鎻掑叆瀛愯〃 + ds = oCn.RunProcReturn("exec h_p_Kf_MaterialLowerBillSub_Insert " + mainList[0].HInterID.ToString() + ",'" + mainList[0].HBillNo + "'", "h_p_Kf_MaterialLowerBillSub_Insert"); + + if (ds == null || ds.Tables[0].Rows.Count == 0) + { + oCn.RollBack(); + objJsonResult.code = "0"; + objJsonResult.count = 0; + objJsonResult.Message = "鍗曟嵁淇濆瓨澶辫触锛�"; + objJsonResult.data = null; + return objJsonResult; + } + else if (DBUtility.ClsPub.isStrNull(ds.Tables[0].Rows[0]["s"]) != "OK") + { + oCn.RollBack(); + objJsonResult.code = "0"; + objJsonResult.count = 0; + objJsonResult.Message = DBUtility.ClsPub.isStrNull(ds.Tables[0].Rows[0]["s"]); + objJsonResult.data = null; + return objJsonResult; + } + else + { + //鏇存柊杞﹂棿鐗╂枡搴撳瓨 + oCn.RunProc("EXEC h_p_WMS_UPDateICinventory_WorkShop " + mainList[0].HInterID.ToString() + ",'" + mainList[0].HBillType + "'"); + //鏇存柊杞﹂棿鏉$爜搴撳瓨 + oCn.RunProc("EXEC h_p_WMS_UPDateBarCodeICinventory_WorkShop " + mainList[0].HInterID.ToString() + ",'" + mainList[0].HBillType + "',-1"); + oCn.Commit(); + objJsonResult.code = "0"; + objJsonResult.count = 1; + objJsonResult.Message = "鍗曟嵁鍙凤細" + mainList[0].HBillNo + " 鏂板鎴愬姛锛�"; + objJsonResult.data = null; + return objJsonResult; + } + } + catch (Exception e) + { + oCn.RollBack(); + objJsonResult.code = "0"; + objJsonResult.count = 0; + objJsonResult.Message = "杞﹂棿涓嬫灦鍗曚笂浼犲け璐ワ紒" + e.ToString(); + objJsonResult.data = null; + return objJsonResult; + } + } + + #endregion + + #region 灏忚溅閿佸畾鍗� 涓婁紶鐢熷崟 + + /// <summary> + /// 灏忚溅閿佸畾鍗曟柊澧炰笂浼� + /// </summary> + /// <returns></returns> + [Route("WEBSController/set_SaveTrolleyPositionBill_Json")] + [HttpPost] + public object set_SaveTrolleyPositionBill_Json([FromBody] JObject msg) + { + var _value = msg["msg"].ToString(); + string msg1 = _value.ToString(); + string[] sArray = msg1.Split(new string[] { ";" }, StringSplitOptions.RemoveEmptyEntries); + string msg2 = sArray[0].ToString(); + string msg3 = sArray[1].ToString(); + string UserName = sArray[2].ToString(); + string OperationType = sArray[3].ToString(); + DBUtility.ClsPub.CurUserName = UserName; + ListModels oListModels = new ListModels(); + try + { + DAL.ClsKf_TrolleyPositionBill oBill = new DAL.ClsKf_TrolleyPositionBill(); + List<Model.ClsKf_TrolleyPositionBillMain> lsmain = new List<Model.ClsKf_TrolleyPositionBillMain>(); + msg2 = msg2.Replace("\\", ""); + msg2 = msg2.Replace("\n", ""); //\n + lsmain = oListModels.getObjectByJson_Kf_TrolleyPositionBillMain(msg2); + + foreach (Model.ClsKf_TrolleyPositionBillMain oItem in lsmain) + { + DBUtility.ClsPub.CurUserName = oItem.HMaker; + oItem.HBillType = "10004"; + oItem.HBillSubType = "10004"; + oItem.HBillStatus = 1; //鍗曟嵁鐘舵�侊紙1鏈锛�2瀹℃牳閫氳繃锛�3鍏抽棴锛�4浣滃簾锛�5瀹℃牳閫�鍥�,6瀹℃牳涓�,7宸查槄锛�8宸插洖澶嶏紝9缁撴锛�10楠岃瘉,11涓嬭揪锛�12寮�宸�,13鐢宠瀹℃壒,15鐢宠妫�楠岋紝16 鍒ゅ畾鍚堟牸锛�17鍒ゅ畾涓嶅悎鏍硷級 + oItem.HYear = DBUtility.ClsPub.isLong(DateTime.Now.Year); + oItem.HPeriod = DBUtility.ClsPub.isLong(DateTime.Now.Month); + oItem.HMakeDate = DBUtility.ClsPub.isStrNull(DateTime.Now.ToString("yyyy-MM-dd")); + if (DBUtility.ClsPub.isStrNull(oItem.HDate) == "") + { + objJsonResult.code = "0"; + objJsonResult.count = 0; + objJsonResult.Message = "淇濆瓨澶辫触锛佹病鏈夊崟鎹棩鏈燂紝鏃犳硶淇濆瓨锛�"; + objJsonResult.data = 1; + return objJsonResult; + } + oBill.omodel = oItem; + } + + // 琛ㄤ綋鏁版嵁 + //鎸� },{鏉ユ媶鍒嗘暟缁� //鍘绘帀銆愬拰銆� + msg3 = msg3.Substring(1, msg3.Length - 2); + msg3 = msg3.Replace("\\", ""); + msg3 = msg3.Replace("\n", ""); //\n + List<Model.ClsKf_TrolleyPositionBillSub> ls = new List<Model.ClsKf_TrolleyPositionBillSub>(); + ls = oListModels.getObjectByJson_Kf_TrolleyPositionBillSub(msg3); + int i = 0; + foreach (Model.ClsKf_TrolleyPositionBillSub oItemSub in ls) + { + i++; + oItemSub.HEntryID = i; + oItemSub.HEntryCloseDate = DBUtility.ClsPub.isDate(DateTime.Now); + oItemSub.HCloseType = false; //鍏抽棴绫诲瀷 + + oBill.DetailColl.Add(oItemSub); + } + + //淇濆瓨 + //淇濆瓨瀹屾瘯鍚庡鐞� + bool bResult; + if (OperationType == "1") + { + bResult = oBill.AddBill(ref DBUtility.ClsPub.sExeReturnInfo); + } + else + { + bResult = oBill.ModifyBill(oBill.omodel.HInterID, ref DBUtility.ClsPub.sExeReturnInfo); + objJsonResult.Verify = "N"; + } + + if (bResult) + { + objJsonResult.code = "1"; + objJsonResult.count = 1; + objJsonResult.Message = "淇濆瓨鎴愬姛锛�"; + objJsonResult.data = 1; + return objJsonResult; + } + else + { + objJsonResult.code = "0"; + objJsonResult.count = 0; + objJsonResult.Message = "淇濆瓨澶辫触锛�" + DBUtility.ClsPub.sExeReturnInfo; + objJsonResult.data = 1; + return objJsonResult; + } + } + catch (Exception e) + { + oCn.RollBack(); + objJsonResult.code = "0"; + objJsonResult.count = 0; + objJsonResult.Message = "灏忚溅閿佸畾鍗曚笂浼犲け璐ワ紒" + e.ToString(); objJsonResult.data = null; return objJsonResult; } @@ -5595,6 +6081,7 @@ string sJXCode = ""; if (oSystemParameter.ShowBillByOrgID(HStockOrgID, ref sErrMsg) == true) { + string sAutoBarCode = "N"; //鍏嶆壂鐗╂枡鏉$爜妯″紡锛�'Y'涓轰笉鎵墿鏂欐潯鐮侊級 string sSourceBarCodeCtl = "N"; //鏍¢獙-鏄惁杩涜婧愬崟瀵瑰簲鏉$爜鏍稿锛�'Y'涓烘牳瀵癸級 #region 绯荤粺鍙傛暟鑾峰彇 @@ -5602,90 +6089,140 @@ if (HBillType == "1201") { //鏍¢獙-鏄惁杩涜婧愬崟瀵瑰簲鏉$爜鏍稿锛�'Y'涓烘牳瀵癸級 - if (oSystemParameter.omodel.Kf_POStockInBillCheck_SourceBarCodeCtl == "Y") + if (oSystemParameter.omodel.Kf_POStockInBillCheck_SourceBarCodeCtl.ToUpper() == "Y") { sSourceBarCodeCtl = "Y"; + } + //鍏嶆壂鐗╂枡鏉$爜妯″紡锛�'Y'涓轰笉鎵墿鏂欐潯鐮侊級 + if (oSystemParameter.omodel.Kf_POStockInBillCheck_AutoBarCode.ToUpper() == "Y") + { + sAutoBarCode = "Y"; } } //鐢熶骇鍏ュ簱鍗� - if (HBillType == "1202") + else if (HBillType == "1202") { //鏍¢獙-鏄惁杩涜婧愬崟瀵瑰簲鏉$爜鏍稿锛�'Y'涓烘牳瀵癸級 - if (oSystemParameter.omodel.Kf_ProductInBillCheck_SourceBarCodeCtl == "Y") + if (oSystemParameter.omodel.Kf_ProductInBillCheck_SourceBarCodeCtl.ToUpper() == "Y") { sSourceBarCodeCtl = "Y"; } + //鍏嶆壂鐗╂枡鏉$爜妯″紡锛�'Y'涓轰笉鎵墿鏂欐潯鐮侊級 + if (oSystemParameter.omodel.Kf_ProductInBillCheck_AutoBarCode.ToUpper() == "Y") + { + sAutoBarCode = "Y"; + } } //鍏朵粬鍏ュ簱鍗� - if (HBillType == "1203") + else if (HBillType == "1203") { //鏍¢獙-鏄惁杩涜婧愬崟瀵瑰簲鏉$爜鏍稿锛�'Y'涓烘牳瀵癸級 - if (oSystemParameter.omodel.Kf_OtherInBillCheck_SourceBarCodeCtl == "Y") + if (oSystemParameter.omodel.Kf_OtherInBillCheck_SourceBarCodeCtl.ToUpper() == "Y") { sSourceBarCodeCtl = "Y"; + } + //鍏嶆壂鐗╂枡鏉$爜妯″紡锛�'Y'涓轰笉鎵墿鏂欐潯鐮侊級 + if (oSystemParameter.omodel.Kf_OtherInBillCheck_AutoBarCode.ToUpper() == "Y") + { + sAutoBarCode = "Y"; } } //棰嗘枡鍑哄簱鍗� else if (HBillType == "1204") { //鏍¢獙-鏄惁杩涜婧愬崟瀵瑰簲鏉$爜鏍稿锛�'Y'涓烘牳瀵癸級 - if (oSystemParameter.omodel.Kf_MateOutBillCheck_SourceBarCodeCtl == "Y") + if (oSystemParameter.omodel.Kf_MateOutBillCheck_SourceBarCodeCtl.ToUpper() == "Y") { sSourceBarCodeCtl = "Y"; + } + //鍏嶆壂鐗╂枡鏉$爜妯″紡锛�'Y'涓轰笉鎵墿鏂欐潯鐮侊級 + if (oSystemParameter.omodel.Kf_MateOutBillCheck_AutoBarCode.ToUpper() == "Y") + { + sAutoBarCode = "Y"; } } //閿�鍞嚭搴撳崟 else if (HBillType == "1205") { //鏍¢獙-鏄惁杩涜婧愬崟瀵瑰簲鏉$爜鏍稿锛�'Y'涓烘牳瀵癸級 - if (oSystemParameter.omodel.Kf_SellOutBillCheck_SourceBarCodeCtl == "Y") + if (oSystemParameter.omodel.Kf_SellOutBillCheck_SourceBarCodeCtl.ToUpper() == "Y") { sSourceBarCodeCtl = "Y"; + } + //鍏嶆壂鐗╂枡鏉$爜妯″紡锛�'Y'涓轰笉鎵墿鏂欐潯鐮侊級 + if (oSystemParameter.omodel.Kf_SellOutBillCheck_AutoBarCode.ToUpper() == "Y") + { + sAutoBarCode = "Y"; } } //鍏朵粬鍑哄簱鍗� else if (HBillType == "1206") { //鏍¢獙-鏄惁杩涜婧愬崟瀵瑰簲鏉$爜鏍稿锛�'Y'涓烘牳瀵癸級 - if (oSystemParameter.omodel.Kf_OtherOutBillCheck_SourceBarCodeCtl == "Y") + if (oSystemParameter.omodel.Kf_OtherOutBillCheck_SourceBarCodeCtl.ToUpper() == "Y") { sSourceBarCodeCtl = "Y"; + } + //鍏嶆壂鐗╂枡鏉$爜妯″紡锛�'Y'涓轰笉鎵墿鏂欐潯鐮侊級 + if (oSystemParameter.omodel.Kf_OtherOutBillCheck_AutoBarCode.ToUpper() == "Y") + { + sAutoBarCode = "Y"; } } //濮斿棰嗘枡鍗� else if (HBillType == "1211") { //鏍¢獙-鏄惁杩涜婧愬崟瀵瑰簲鏉$爜鏍稿锛�'Y'涓烘牳瀵癸級 - if (oSystemParameter.omodel.Kf_EntrustOutBillCheck_SourceBarCodeCtl == "Y") + if (oSystemParameter.omodel.Kf_EntrustOutBillCheck_SourceBarCodeCtl.ToUpper() == "Y") { sSourceBarCodeCtl = "Y"; + } + //鍏嶆壂鐗╂枡鏉$爜妯″紡锛�'Y'涓轰笉鎵墿鏂欐潯鐮侊級 + if (oSystemParameter.omodel.Kf_EntrustOutBillCheck_AutoBarCode.ToUpper() == "Y") + { + sAutoBarCode = "Y"; } } //鐢熶骇琛ユ枡鍗� else if (HBillType == "1254") { //鏍¢獙-鏄惁杩涜婧愬崟瀵瑰簲鏉$爜鏍稿锛�'Y'涓烘牳瀵癸級 - if (oSystemParameter.omodel.Kf_MateReplenishOutBillCheck_SourceBarCodeCtl == "Y") + if (oSystemParameter.omodel.Kf_MateReplenishOutBillCheck_SourceBarCodeCtl.ToUpper() == "Y") { sSourceBarCodeCtl = "Y"; + } + //鍏嶆壂鐗╂枡鏉$爜妯″紡锛�'Y'涓轰笉鎵墿鏂欐潯鐮侊級 + if (oSystemParameter.omodel.Kf_MateReplenishOutBillCheck_AutoBarCode.ToUpper() == "Y") + { + sAutoBarCode = "Y"; } } //濮斿琛ユ枡鍗� else if (HBillType == "1255") { //鏍¢獙-鏄惁杩涜婧愬崟瀵瑰簲鏉$爜鏍稿锛�'Y'涓烘牳瀵癸級 - if (oSystemParameter.omodel.Kf_EntrustReplenishOutBillCheck_SourceBarCodeCtl == "Y") + if (oSystemParameter.omodel.Kf_EntrustReplenishOutBillCheck_SourceBarCodeCtl.ToUpper() == "Y") { sSourceBarCodeCtl = "Y"; + } + //鍏嶆壂鐗╂枡鏉$爜妯″紡锛�'Y'涓轰笉鎵墿鏂欐潯鐮侊級 + if (oSystemParameter.omodel.Kf_EntrustReplenishOutBillCheck_AutoBarCode.ToUpper() == "Y") + { + sAutoBarCode = "Y"; } } //鐩存帴璋冩嫧鍗� else if (HBillType == "1207") { //鏍¢獙-鏄惁杩涜婧愬崟瀵瑰簲鏉$爜鏍稿锛�'Y'涓烘牳瀵癸級 - if (oSystemParameter.omodel.Kf_MoveStockBillCheck_SourceBarCodeCtl == "Y") + if (oSystemParameter.omodel.Kf_MoveStockBillCheck_SourceBarCodeCtl.ToUpper() == "Y") { sSourceBarCodeCtl = "Y"; + } + //鍏嶆壂鐗╂枡鏉$爜妯″紡锛�'Y'涓轰笉鎵墿鏂欐潯鐮侊級 + if (oSystemParameter.omodel.Kf_MoveStockBillCheck_AutoBarCode.ToUpper() == "Y") + { + sAutoBarCode = "Y"; } } #endregion @@ -5700,8 +6237,17 @@ } try { + //鍏嶆壂鐗╂枡鏉$爜妯″紡锛�'Y'涓轰笉鎵墿鏂欐潯鐮侊級 + if (sAutoBarCode == "Y") + { + objJsonResult.code = "0"; + objJsonResult.count = 0; + objJsonResult.Message = "鍏嶆壂鐗╂枡鏉$爜妯″紡锛屾棤闇�鎵弿鐗╂枡鏉$爜锛�"; + objJsonResult.data = null; + return objJsonResult; + } //鍘熷崟鎹负鎵爜鐢熸垚锛屾牎楠屾椂涓嶇敓鎴愭潯鐮佽褰曪紝鍙鍘熸壂鎻忕殑鏉$爜杩涜鏍稿 - if (sSourceBarCodeCtl == "Y") + else if (sSourceBarCodeCtl == "Y") { WebSoBar = oWebs.get_BillBarCode_Verify(HBillID, HBillNo, HBillType, sJXCode, HQty, HMaker, HStockOrgID, ref DBUtility.ClsPub.sErrInfo); if (WebSoBar == null) @@ -5939,7 +6485,7 @@ if (oSystemParameter.ShowBillByOrgID(HStockOrgID,ref sErrMsg) == true) { string sSourceBarCodeCtl = "N"; //鏍¢獙-鏄惁杩涜婧愬崟瀵瑰簲鏉$爜鏍稿锛�'Y'涓烘牳瀵癸級 - if (HBillType == "1205" && oSystemParameter.omodel.Kf_SellOutBillCheck_SourceBarCodeCtl == "Y") + if (HBillType == "1205" && oSystemParameter.omodel.Kf_SellOutBillCheck_SourceBarCodeCtl.ToUpper() == "Y") { //閿�鍞嚭搴撳崟 sSourceBarCodeCtl = "Y"; @@ -6062,25 +6608,25 @@ if (HBillType == "1201") { //鏍¢獙-鏄惁杩涜婧愬崟瀵瑰簲鏉$爜鏍稿锛�'Y'涓烘牳瀵癸級 - if (oSystemParameter.omodel.Kf_POStockInBillCheck_SourceBarCodeCtl == "Y") + if (oSystemParameter.omodel.Kf_POStockInBillCheck_SourceBarCodeCtl.ToUpper() == "Y") { sSourceBarCodeCtl = "Y"; } } //鐢熶骇鍏ュ簱鍗� - if (HBillType == "1202") + else if (HBillType == "1202") { //鏍¢獙-鏄惁杩涜婧愬崟瀵瑰簲鏉$爜鏍稿锛�'Y'涓烘牳瀵癸級 - if (oSystemParameter.omodel.Kf_ProductInBillCheck_SourceBarCodeCtl == "Y") + if (oSystemParameter.omodel.Kf_ProductInBillCheck_SourceBarCodeCtl.ToUpper() == "Y") { sSourceBarCodeCtl = "Y"; } } //鍏朵粬鍏ュ簱鍗� - if (HBillType == "1203") + else if (HBillType == "1203") { //鏍¢獙-鏄惁杩涜婧愬崟瀵瑰簲鏉$爜鏍稿锛�'Y'涓烘牳瀵癸級 - if (oSystemParameter.omodel.Kf_OtherInBillCheck_SourceBarCodeCtl == "Y") + if (oSystemParameter.omodel.Kf_OtherInBillCheck_SourceBarCodeCtl.ToUpper() == "Y") { sSourceBarCodeCtl = "Y"; } @@ -6089,7 +6635,7 @@ else if (HBillType == "1204") { //鏍¢獙-鏄惁杩涜婧愬崟瀵瑰簲鏉$爜鏍稿锛�'Y'涓烘牳瀵癸級 - if (oSystemParameter.omodel.Kf_MateOutBillCheck_SourceBarCodeCtl == "Y") + if (oSystemParameter.omodel.Kf_MateOutBillCheck_SourceBarCodeCtl.ToUpper() == "Y") { sSourceBarCodeCtl = "Y"; } @@ -6098,7 +6644,7 @@ else if (HBillType == "1205") { //鏍¢獙-鏄惁杩涜婧愬崟瀵瑰簲鏉$爜鏍稿锛�'Y'涓烘牳瀵癸級 - if (oSystemParameter.omodel.Kf_SellOutBillCheck_SourceBarCodeCtl == "Y") + if (oSystemParameter.omodel.Kf_SellOutBillCheck_SourceBarCodeCtl.ToUpper() == "Y") { sSourceBarCodeCtl = "Y"; } @@ -6107,7 +6653,7 @@ else if (HBillType == "1206") { //鏍¢獙-鏄惁杩涜婧愬崟瀵瑰簲鏉$爜鏍稿锛�'Y'涓烘牳瀵癸級 - if (oSystemParameter.omodel.Kf_OtherOutBillCheck_SourceBarCodeCtl == "Y") + if (oSystemParameter.omodel.Kf_OtherOutBillCheck_SourceBarCodeCtl.ToUpper() == "Y") { sSourceBarCodeCtl = "Y"; } @@ -6116,7 +6662,7 @@ else if (HBillType == "1211") { //鏍¢獙-鏄惁杩涜婧愬崟瀵瑰簲鏉$爜鏍稿锛�'Y'涓烘牳瀵癸級 - if (oSystemParameter.omodel.Kf_EntrustOutBillCheck_SourceBarCodeCtl == "Y") + if (oSystemParameter.omodel.Kf_EntrustOutBillCheck_SourceBarCodeCtl.ToUpper() == "Y") { sSourceBarCodeCtl = "Y"; } @@ -6125,7 +6671,7 @@ else if (HBillType == "1254") { //鏍¢獙-鏄惁杩涜婧愬崟瀵瑰簲鏉$爜鏍稿锛�'Y'涓烘牳瀵癸級 - if (oSystemParameter.omodel.Kf_MateReplenishOutBillCheck_SourceBarCodeCtl == "Y") + if (oSystemParameter.omodel.Kf_MateReplenishOutBillCheck_SourceBarCodeCtl.ToUpper() == "Y") { sSourceBarCodeCtl = "Y"; } @@ -6134,7 +6680,7 @@ else if (HBillType == "1255") { //鏍¢獙-鏄惁杩涜婧愬崟瀵瑰簲鏉$爜鏍稿锛�'Y'涓烘牳瀵癸級 - if (oSystemParameter.omodel.Kf_EntrustReplenishOutBillCheck_SourceBarCodeCtl == "Y") + if (oSystemParameter.omodel.Kf_EntrustReplenishOutBillCheck_SourceBarCodeCtl.ToUpper() == "Y") { sSourceBarCodeCtl = "Y"; } @@ -6143,7 +6689,7 @@ else if (HBillType == "1207") { //鏍¢獙-鏄惁杩涜婧愬崟瀵瑰簲鏉$爜鏍稿锛�'Y'涓烘牳瀵癸級 - if (oSystemParameter.omodel.Kf_MoveStockBillCheck_SourceBarCodeCtl == "Y") + if (oSystemParameter.omodel.Kf_MoveStockBillCheck_SourceBarCodeCtl.ToUpper() == "Y") { sSourceBarCodeCtl = "Y"; } @@ -6234,7 +6780,7 @@ if (oSystemParameter.ShowBillByOrgID(HStockOrgID, ref sErrMsg) == true) { string sSourceBarCodeCtl = "N"; //鏍¢獙-鏄惁杩涜婧愬崟瀵瑰簲鏉$爜鏍稿锛�'Y'涓烘牳瀵癸級 - if (HBillType == "1205" && oSystemParameter.omodel.Kf_SellOutBillCheck_SourceBarCodeCtl == "Y") + if (HBillType == "1205" && oSystemParameter.omodel.Kf_SellOutBillCheck_SourceBarCodeCtl.ToUpper() == "Y") { //閿�鍞嚭搴撳崟 sSourceBarCodeCtl = "Y"; @@ -6370,25 +6916,25 @@ if (HBillType == "1201") { //鏍¢獙-鏄惁杩涜婧愬崟瀵瑰簲鏉$爜鏍稿锛�'Y'涓烘牳瀵癸級 - if (oSystemParameter.omodel.Kf_POStockInBillCheck_SourceBarCodeCtl == "Y") + if (oSystemParameter.omodel.Kf_POStockInBillCheck_SourceBarCodeCtl.ToUpper() == "Y") { sSourceBarCodeCtl = "Y"; } } //鐢熶骇鍏ュ簱鍗� - if (HBillType == "1202") + else if (HBillType == "1202") { //鏍¢獙-鏄惁杩涜婧愬崟瀵瑰簲鏉$爜鏍稿锛�'Y'涓烘牳瀵癸級 - if (oSystemParameter.omodel.Kf_ProductInBillCheck_SourceBarCodeCtl == "Y") + if (oSystemParameter.omodel.Kf_ProductInBillCheck_SourceBarCodeCtl.ToUpper() == "Y") { sSourceBarCodeCtl = "Y"; } } //鍏朵粬鍏ュ簱鍗� - if (HBillType == "1203") + else if (HBillType == "1203") { //鏍¢獙-鏄惁杩涜婧愬崟瀵瑰簲鏉$爜鏍稿锛�'Y'涓烘牳瀵癸級 - if (oSystemParameter.omodel.Kf_OtherInBillCheck_SourceBarCodeCtl == "Y") + if (oSystemParameter.omodel.Kf_OtherInBillCheck_SourceBarCodeCtl.ToUpper() == "Y") { sSourceBarCodeCtl = "Y"; } @@ -6397,7 +6943,7 @@ else if (HBillType == "1204") { //鏍¢獙-鏄惁杩涜婧愬崟瀵瑰簲鏉$爜鏍稿锛�'Y'涓烘牳瀵癸級 - if (oSystemParameter.omodel.Kf_MateOutBillCheck_SourceBarCodeCtl == "Y") + if (oSystemParameter.omodel.Kf_MateOutBillCheck_SourceBarCodeCtl.ToUpper() == "Y") { sSourceBarCodeCtl = "Y"; } @@ -6406,7 +6952,7 @@ else if (HBillType == "1205") { //鏍¢獙-鏄惁杩涜婧愬崟瀵瑰簲鏉$爜鏍稿锛�'Y'涓烘牳瀵癸級 - if (oSystemParameter.omodel.Kf_SellOutBillCheck_SourceBarCodeCtl == "Y") + if (oSystemParameter.omodel.Kf_SellOutBillCheck_SourceBarCodeCtl.ToUpper() == "Y") { sSourceBarCodeCtl = "Y"; } @@ -6415,7 +6961,7 @@ else if (HBillType == "1206") { //鏍¢獙-鏄惁杩涜婧愬崟瀵瑰簲鏉$爜鏍稿锛�'Y'涓烘牳瀵癸級 - if (oSystemParameter.omodel.Kf_OtherOutBillCheck_SourceBarCodeCtl == "Y") + if (oSystemParameter.omodel.Kf_OtherOutBillCheck_SourceBarCodeCtl.ToUpper() == "Y") { sSourceBarCodeCtl = "Y"; } @@ -6424,7 +6970,7 @@ else if (HBillType == "1211") { //鏍¢獙-鏄惁杩涜婧愬崟瀵瑰簲鏉$爜鏍稿锛�'Y'涓烘牳瀵癸級 - if (oSystemParameter.omodel.Kf_EntrustOutBillCheck_SourceBarCodeCtl == "Y") + if (oSystemParameter.omodel.Kf_EntrustOutBillCheck_SourceBarCodeCtl.ToUpper() == "Y") { sSourceBarCodeCtl = "Y"; } @@ -6433,7 +6979,7 @@ else if (HBillType == "1254") { //鏍¢獙-鏄惁杩涜婧愬崟瀵瑰簲鏉$爜鏍稿锛�'Y'涓烘牳瀵癸級 - if (oSystemParameter.omodel.Kf_MateReplenishOutBillCheck_SourceBarCodeCtl == "Y") + if (oSystemParameter.omodel.Kf_MateReplenishOutBillCheck_SourceBarCodeCtl.ToUpper() == "Y") { sSourceBarCodeCtl = "Y"; } @@ -6442,7 +6988,7 @@ else if (HBillType == "1255") { //鏍¢獙-鏄惁杩涜婧愬崟瀵瑰簲鏉$爜鏍稿锛�'Y'涓烘牳瀵癸級 - if (oSystemParameter.omodel.Kf_EntrustReplenishOutBillCheck_SourceBarCodeCtl == "Y") + if (oSystemParameter.omodel.Kf_EntrustReplenishOutBillCheck_SourceBarCodeCtl.ToUpper() == "Y") { sSourceBarCodeCtl = "Y"; } @@ -6451,7 +6997,7 @@ else if (HBillType == "1207") { //鏍¢獙-鏄惁杩涜婧愬崟瀵瑰簲鏉$爜鏍稿锛�'Y'涓烘牳瀵癸級 - if (oSystemParameter.omodel.Kf_MoveStockBillCheck_SourceBarCodeCtl == "Y") + if (oSystemParameter.omodel.Kf_MoveStockBillCheck_SourceBarCodeCtl.ToUpper() == "Y") { sSourceBarCodeCtl = "Y"; } @@ -6531,7 +7077,7 @@ if (oSystemParameter.ShowBillByOrgID(HStockOrgID, ref sErrMsg) == true) { string sSourceBarCodeCtl = "N"; //鏍¢獙-鏄惁杩涜婧愬崟瀵瑰簲鏉$爜鏍稿锛�'Y'涓烘牳瀵癸級 - if (HBillType == "1205" && oSystemParameter.omodel.Kf_SellOutBillCheck_SourceBarCodeCtl == "Y") + if (HBillType == "1205" && oSystemParameter.omodel.Kf_SellOutBillCheck_SourceBarCodeCtl.ToUpper() == "Y") { //閿�鍞嚭搴撳崟 sSourceBarCodeCtl = "Y"; @@ -6638,6 +7184,56 @@ #endregion + #region 鐢熶骇缁勬墭鍗曟ā鍧� 鎵弿绠憋紙鎵橈級鏉$爜 20250630 + + /// <summary> + /// 鐢熶骇缁勬墭鍗曟ā鍧� 鎵弿绠憋紙鎵橈級鏉$爜 + /// </summary> + /// <returns></returns> + [Route("WEBSController/Get_PackBarCode_PackUnionBill_New_Json")] + [HttpGet] + public object get_PackBarCode_PackUnionBill_New_Json(Int64 HInterID, string HBillNo, string HBillType, string HBillSubType, string HBarCode_Pack) + { + try + { + ds = oCn.RunProcReturn("exec h_p_WMS_AddPackBarCode_PackUnionBill_New " + HInterID.ToString() + ",'" + HBillNo + "','" + HBillType + "','" + HBillSubType + "','" + HBarCode_Pack + "'", "h_p_WMS_AddPackBarCode_PackUnionBill_New"); + if (ds == null || ds.Tables[0].Rows.Count == 0) + { + objJsonResult.code = "0"; + objJsonResult.count = 0; + objJsonResult.Message = "鎵弿鎵樻潯鐮佸彂鐢熼敊璇紒"; + objJsonResult.data = null; + return objJsonResult; + } + else if (DBUtility.ClsPub.isLong(ds.Tables[0].Rows[0]["HBack"]) == 1) + { + objJsonResult.code = "0"; + objJsonResult.count = 0; + objJsonResult.Message = DBUtility.ClsPub.isStrNull(ds.Tables[0].Rows[0]["HRemark"]); + objJsonResult.data = null; + return objJsonResult; + } + else + { + objJsonResult.code = "0"; + objJsonResult.count = 1; + objJsonResult.Message = "鎴愬姛锛�"; + objJsonResult.data = ds.Tables[0]; + return objJsonResult; + } + } + catch (Exception e) + { + objJsonResult.code = "0"; + objJsonResult.count = 0; + objJsonResult.Message = "鎵弿鎵樻潯鐮佸け璐ワ紒" + e.ToString(); + objJsonResult.data = null; + return objJsonResult; + } + } + + #endregion + #region 鐢熶骇缁勬墭鍗曟ā鍧� 鎵弿鎵樻潯鐮佸搴斿崟涓潯鐮� /// <summary> @@ -6672,6 +7268,76 @@ objJsonResult.code = "0"; objJsonResult.count = 0; objJsonResult.Message = "鎵弿鏉$爜澶辫触锛�" + e.ToString(); + objJsonResult.data = null; + return objJsonResult; + } + } + + #endregion + + #region 鐢熶骇缁勬墭鍗曟ā鍧� 鎵弿鎵樻潯鐮佸搴旀潯鐮� 20250630 + + /// <summary> + /// 鐢熶骇缁勬墭鍗曟ā鍧� 鎵弿鎵樻潯鐮佸搴旀潯鐮� + /// </summary> + /// <returns></returns> + [Route("WEBSController/Get_BarCode_PackUnionBill_New_Json")] + [HttpGet] + public object get_BarCode_PackUnionBill_New_Json(string HBarCode, Int64 HInterID, string HBillNo, string HBillType, string HBillSubType, string HBarCode_Pack, string HMaterNumber_Pack, string HMaker, Int64 HStockOrgID) + { + //鑾峰彇绯荤粺鍙傛暟 + string sErrMsg = ""; + if (oSystemParameter.ShowBillByOrgID(HStockOrgID, ref sErrMsg) == true) + { + string sMaterialCtl = "Y"; //缁勬墭鏃舵墭鏉$爜瀵瑰簲鐗╂枡涓庨渶瑕佺粍鎵樼殑鏉$爜瀵瑰簲鐗╂枡瑕佷竴鑷达紙Y涓洪渶涓�鑷达級 + string sSourceBillTypeCtl = "Y"; //鏈叆搴撴潯鐮佽繘琛岀粍鎵樻椂锛岃繘琛屽悓婧愬崟绫诲瀷鎺у埗锛圷涓烘帶鍒讹級 + string sSourceBillNoCtl = "Y"; //鏈叆搴撴潯鐮佽繘琛岀粍鎵樻椂锛岃繘琛屽悓婧愬崟鎺у埗锛圷涓烘帶鍒讹級 + sMaterialCtl = oSystemParameter.omodel.Sc_PackUnionBill_MaterialCtl.ToUpper(); + sSourceBillTypeCtl = oSystemParameter.omodel.Sc_PackUnionBill_SourceBillTypeCtl.ToUpper(); + sSourceBillNoCtl = oSystemParameter.omodel.Sc_PackUnionBill_SourceBillNoCtl.ToUpper(); + + try + { + ds = oCn.RunProcReturn("exec h_p_WMS_AddBarCode_PackUnionBill_New '" + HBarCode + "'," + HInterID.ToString() + ",'" + HBillNo + "','" + HBillType + "','" + HBillSubType + "','" + HBarCode_Pack + "','" + HMaterNumber_Pack + "','" + sMaterialCtl + "','" + sSourceBillTypeCtl + "','" + sSourceBillNoCtl + "','" + HMaker + "'," + HStockOrgID.ToString(), "h_p_WMS_AddBarCode_PackUnionBill_New"); + if (ds == null || ds.Tables[0].Rows.Count == 0) + { + objJsonResult.code = "0"; + objJsonResult.count = 0; + objJsonResult.Message = "鎵弿鏉$爜鍙戠敓閿欒锛�"; + objJsonResult.data = null; + return objJsonResult; + } + else if (DBUtility.ClsPub.isLong(ds.Tables[0].Rows[0]["HBack"]) == 1) + { + objJsonResult.code = "0"; + objJsonResult.count = 0; + objJsonResult.Message = DBUtility.ClsPub.isStrNull(ds.Tables[0].Rows[0]["HRemark"]); + objJsonResult.data = null; + return objJsonResult; + } + else + { + objJsonResult.code = "0"; + objJsonResult.count = 1; + objJsonResult.Message = "鎴愬姛锛�"; + objJsonResult.data = null; + return objJsonResult; + } + } + catch (Exception e) + { + objJsonResult.code = "0"; + objJsonResult.count = 0; + objJsonResult.Message = "鎵弿鏉$爜澶辫触锛�" + e.ToString(); + objJsonResult.data = null; + return objJsonResult; + } + } + else + { + objJsonResult.code = "0"; + objJsonResult.count = 0; + objJsonResult.Message = "鑾峰彇绯荤粺鍙傛暟澶辫触锛� " + sErrMsg; objJsonResult.data = null; return objJsonResult; } @@ -6746,7 +7412,7 @@ { objJsonResult.code = "0"; objJsonResult.count = 1; - objJsonResult.Message = DBUtility.ClsPub.sErrInfo; //鎴愬姛锛� + objJsonResult.Message = "鍒犻櫎鎴愬姛"; objJsonResult.data = null; return objJsonResult; } @@ -7003,6 +7669,102 @@ // return objJsonResult; // } //} + + #endregion + + #region 鎷嗙锛堟媶鎵橈級妯″潡 鎵弿鎵樻潯鐮� 20250702 + + /// <summary> + ///鎷嗙锛堟媶鎵橈級妯″潡 鎵弿鎵樻潯鐮� + /// </summary> + /// <returns></returns> + [Route("WEBSController/Get_PackBarCode_UnPackUnionBill_Json")] + [HttpGet] + public object Get_PackBarCode_UnPackUnionBill_Json(string HBarCode_Pack, string HBillSubType) + { + try + { + ds = oCn.RunProcReturn("exec h_p_WMS_AddPackBarCode_UnPackUnionBill_New '" + HBarCode_Pack + "','" + HBillSubType + "'", "h_p_WMS_AddPackBarCode_UnPackUnionBill_New"); + if (ds == null || ds.Tables[0].Rows.Count == 0) + { + objJsonResult.code = "0"; + objJsonResult.count = 0; + objJsonResult.Message = "鎵弿鎵樻潯鐮佸垽鏂け璐ワ紒"; + objJsonResult.data = null; + return objJsonResult; + } + else + { + if (DBUtility.ClsPub.isLong(ds.Tables[0].Rows[0][0]) == 0) + { + List<object> columnNameList = new List<object>(); + //娣诲姞鍒楀悕 + foreach (DataColumn col in ds.Tables[0].Columns) + { + Type dataType = col.DataType; + string ColmString = "{\"ColmCols\":\"" + col.ColumnName + "\",\"ColmType\":\"" + dataType.Name + "\"}"; + columnNameList.Add(JsonConvert.DeserializeObject(ColmString)); //鑾峰彇鍒癉ataColumn鍒楀璞$殑鍒楀悕 + } + objJsonResult.code = "0"; + objJsonResult.count = 1; + objJsonResult.Message = "鎴愬姛锛�"; + objJsonResult.data = ds.Tables[0]; + objJsonResult.list = columnNameList; + return objJsonResult; + } + else + { + objJsonResult.code = "0"; + objJsonResult.count = 0; + objJsonResult.Message = "鎵弿鏉$爜澶辫触锛�" + DBUtility.ClsPub.isStrNull(ds.Tables[0].Rows[0]["HRemark"]); + objJsonResult.data = null; + return objJsonResult; + } + } + } + catch (Exception e) + { + objJsonResult.code = "0"; + objJsonResult.count = 0; + objJsonResult.Message = "鎷嗙锛堟媶鎵橈級妯″潡锛岃幏鍙栫锛堟墭锛夋潯鐮佷俊鎭け璐ワ紒" + e.ToString(); + objJsonResult.data = null; + return objJsonResult; + } + } + + #endregion + + #region 鎷嗙锛堟媶鎵橈級妯″潡 涓婁紶 鍒犻櫎缁勬墭鍗曚俊鎭� 20250702 + + /// <summary> + /// 涓婁紶 鍒犻櫎缁勬墭鍗曚俊鎭� + /// </summary> + /// <returns></returns> + [Route("WEBSController/set_SaveUnPackUnionBill_Json")] + [HttpGet] + public object set_SaveUnPackUnionBill_Json(long HInterID, string HBillNo, string HBarCode_Pack, string HMaker) + { + try + { + string HIPAddress = ""; //IP + string HModCaption = "WMS-鎷嗙锛堟媶鎵橈級妯″潡"; //妯″潡鍚� + ds = oCn.RunProcReturn("exec h_p_Sc_PackUnionBill_Delete_New " + HInterID.ToString() + ",'" + HBillNo + "','" + HBarCode_Pack + "','" + HMaker + "','" + ComputerName + "','" + HIPAddress + "','" + HModCaption + "'", "h_p_Sc_PackUnionBill_Delete_New"); + + objJsonResult.code = "0"; + objJsonResult.count = 1; + objJsonResult.Message = "鎴愬姛"; + objJsonResult.data = null; + return objJsonResult; + } + catch (Exception e) + { + objJsonResult.code = "0"; + objJsonResult.count = 0; + objJsonResult.Message = "鎷嗙锛堟媶鎵橈級澶辫触锛�" + e.ToString(); + objJsonResult.data = null; + return objJsonResult; + } + } #endregion @@ -8250,6 +9012,348 @@ #endregion #endregion + + + #region 涓婃灦銆佷笅鏋跺崟銆佸皬杞﹂攣瀹氭ā鍧楄皟鐢ㄦ柟娉� 20250520 + + #region 涓嬫灦鍗曟壂鐮佹ā鍧� 鎵弿婧愬崟鏉$爜璋冪敤鏂规硶 + /// <summary> + /// 鎵弿婧愬崟鏉$爜 + /// </summary> + /// <returns></returns> + [Route("WEBSController/Get_SourceBarCode_MaterialLower_Json")] + [HttpGet] + public object get_SourceBarCode_MaterialLower_Json(Int64 HInterID, string HBillNo, string HBillType, string HSourceBillNo, string HSourceBillType, string HMaker, Int64 HStockOrgID) + { + try + { + ds = oCn.RunProcReturn("exec h_p_WMS_AddSourceBarCode_MaterialLower " + HInterID.ToString() + ",'" + HBillNo + "','" + HBillType + "','" + HSourceBillNo + "','" + HSourceBillType + "','" + HMaker + "'," + HStockOrgID.ToString(), "h_p_WMS_AddSourceBarCode_MaterialLower"); + if (ds == null || ds.Tables[0].Rows.Count == 0) + { + objJsonResult.code = "0"; + objJsonResult.count = 0; + objJsonResult.Message = "鎵弿婧愬崟鏉$爜锛屽啓鍏ユ簮鍗曚复鏃惰〃澶辫触锛�"; + objJsonResult.data = null; + return objJsonResult; + } + else if (DBUtility.ClsPub.isLong(ds.Tables[0].Rows[0]["HBack"]) == 1) + { + objJsonResult.code = "0"; + objJsonResult.count = 0; + objJsonResult.Message = DBUtility.ClsPub.isStrNull(ds.Tables[0].Rows[0]["HRemark"]); + objJsonResult.data = null; + return objJsonResult; + } + else + { + List<object> columnNameList = new List<object>(); + //娣诲姞鍒楀悕 + foreach (DataColumn col in ds.Tables[0].Columns) + { + Type dataType = col.DataType; + string ColmString = "{\"ColmCols\":\"" + col.ColumnName + "\",\"ColmType\":\"" + dataType.Name + "\"}"; + columnNameList.Add(JsonConvert.DeserializeObject(ColmString)); //鑾峰彇鍒癉ataColumn鍒楀璞$殑鍒楀悕 + } + objJsonResult.code = "0"; + objJsonResult.count = 1; + objJsonResult.Message = "鎴愬姛锛�"; + objJsonResult.data = ds.Tables[0]; + objJsonResult.list = columnNameList; + return objJsonResult; + } + } + catch (Exception e) + { + objJsonResult.code = "0"; + objJsonResult.count = 0; + objJsonResult.Message = "鎵弿婧愬崟鏉$爜澶辫触锛�" + e.ToString(); + objJsonResult.data = null; + return objJsonResult; + } + } + + #endregion + + #region 涓婃灦銆佷笅鏋跺崟鎵爜妯″潡 鎵弿鐗╂枡鏉$爜璋冪敤鏂规硶 + /// <summary> + /// 鎵弿鐗╂枡鏉$爜 + /// </summary> + /// <returns></returns> + [Route("WEBSController/Get_BarCode_WorkShop_Json")] + [HttpGet] + public object Get_BarCode_WorkShop_Json(string HBarCode, Int64 HInterID, string HBillType, string HBillNo, string HMaker, Int64 HWhID, Int64 HSPID, Double HQty, bool SourceFlag, string HSourceBillType, string HCarBarCode, Int64 HStockOrgID) + { + //鑾峰彇绯荤粺鍙傛暟 + string sErrMsg = ""; + if (oSystemParameter.ShowBillByOrgID(HStockOrgID, ref sErrMsg) == true) + { + string sBatchNoCtl = "N"; //鏄惁杩涜鎵瑰彿鏍稿锛�'Y'涓烘牳瀵规壒鍙凤級 + string sMustQtyCtl = "灏忎簬绛変簬搴旀敹"; //搴旀敹鏁伴噺鎺у埗锛堝皬浜庣瓑浜庡簲鏀躲�佸畬鍏ㄧ瓑浜庡簲鏀躲�佷笉鎺у埗锛� + + //涓嬫灦鍗� + if (HBillType == "1252") + { + //鏄惁杩涜鎵瑰彿鏍稿锛�'Y'涓烘牳瀵规壒鍙凤級 + if (oSystemParameter.omodel.Kf_MaterialLowerBill_BatchNoCtl.ToUpper() == "Y") + { + sBatchNoCtl = "Y"; + } + //鎵爜鏁伴噺鑳藉惁鍙秴鍗曟嵁鏁伴噺鎺у埗锛堝皬浜庣瓑浜庡簲鏀躲�佸畬鍏ㄧ瓑浜庡簲鏀躲�佷笉鎺у埗锛� + if (oSystemParameter.omodel.Kf_MaterialLowerBill_MustQtyCtl == "灏忎簬绛変簬搴旀敹") + { + sMustQtyCtl = "灏忎簬绛変簬搴旀敹"; + } + else if (oSystemParameter.omodel.Kf_MaterialLowerBill_MustQtyCtl == "瀹屽叏绛変簬搴旀敹") + { + sMustQtyCtl = "瀹屽叏绛変簬搴旀敹"; + } + else + { + sMustQtyCtl = "涓嶆帶鍒�"; + } + } + + try + { + ds = oCn.RunProcReturn("exec h_p_WMS_AddBarCode_WorkShop " + HInterID.ToString() + ",'" + HBillNo + "','" + HBillType + "','" + HBarCode + "'," + HQty.ToString() + ",'" + HSourceBillType + "'," + HWhID.ToString() + "," + HSPID.ToString() + ",'" + HCarBarCode + "'," + HStockOrgID.ToString() + ",'" + HMaker + "'," + DBUtility.ClsPub.BoolToString(SourceFlag) + ",'" + sBatchNoCtl + "','" + sMustQtyCtl + "'", "h_p_WMS_AddBarCode_WorkShop"); + if (ds == null || ds.Tables[0].Rows.Count == 0) + { + objJsonResult.code = "0"; + objJsonResult.count = 0; + objJsonResult.Message = "鎵弿鐗╂枡鏉$爜锛屽啓鍏ヤ复鏃惰〃澶辫触锛�"; + objJsonResult.data = null; + return objJsonResult; + } + else if (DBUtility.ClsPub.isLong(ds.Tables[0].Rows[0]["HBack"]) == 1) + { + objJsonResult.code = "0"; + objJsonResult.count = 0; + objJsonResult.Message = DBUtility.ClsPub.isStrNull(ds.Tables[0].Rows[0]["HRemark"]); + objJsonResult.data = null; + return objJsonResult; + } + else + { + objJsonResult.code = "0"; + objJsonResult.count = 1; + objJsonResult.Message = "鎴愬姛锛�"; + objJsonResult.data = ds.Tables[0]; + return objJsonResult; + } + } + catch (Exception e) + { + objJsonResult.code = "0"; + objJsonResult.count = 0; + objJsonResult.Message = "鎵弿鐗╂枡鏉$爜澶辫触锛�" + e.ToString(); + objJsonResult.data = null; + return objJsonResult; + } + } + else + { + objJsonResult.code = "0"; + objJsonResult.count = 0; + objJsonResult.Message = "鑾峰彇绯荤粺鍙傛暟澶辫触锛� " + sErrMsg; + objJsonResult.data = null; + return objJsonResult; + } + } + + #endregion + + #region 杞﹂棿鐗╂枡搴撳瓨鏌ヨ璋冪敤鏂规硶 + /// <summary> + /// 鑾峰彇杞﹂棿鐗╂枡鎵�鍦ㄤ綅缃� + /// </summary> + /// <returns></returns> + [Route("WEBSController/GetICInventory_WorkShop_Json")] + [HttpGet] + public object GetICInventory_WorkShop_Json(string HBillType, Int64 HMaterID, Int64 HAuxPropID, string HBatchNo, Int64 HProcessExchangeInterID) + { + try + { + ds = oCn.RunProcReturn("exec h_p_KF_ICInventory_WorkShop '" + HBillType + "'," + HMaterID.ToString() + "," + HAuxPropID.ToString() + ",'" + HBatchNo + "'," + HProcessExchangeInterID.ToString(), "h_p_KF_ICInventory_WorkShop"); + if (ds == null || ds.Tables[0].Rows.Count == 0) + { + objJsonResult.code = "0"; + objJsonResult.count = 0; + objJsonResult.Message = "娌℃湁杩斿洖浠讳綍缁撴灉锛�"; + objJsonResult.data = null; + return objJsonResult; + } + else + { + List<object> columnNameList = new List<object>(); + //娣诲姞鍒楀悕 + foreach (DataColumn col in ds.Tables[0].Columns) + { + Type dataType = col.DataType; + string ColmString = "{\"ColmCols\":\"" + col.ColumnName + "\",\"ColmType\":\"" + dataType.Name + "\"}"; + columnNameList.Add(JsonConvert.DeserializeObject(ColmString)); //鑾峰彇鍒癉ataColumn鍒楀璞$殑鍒楀悕 + } + objJsonResult.code = "0"; + objJsonResult.count = 1; + objJsonResult.Message = "鎴愬姛锛�"; + objJsonResult.data = ds.Tables[0]; + objJsonResult.list = columnNameList; + return objJsonResult; + } + } + catch (Exception e) + { + objJsonResult.code = "0"; + objJsonResult.count = 0; + objJsonResult.Message = "鏌ヨ杞﹂棿鐗╂枡搴撳瓨澶辫触锛�" + e.ToString(); + objJsonResult.data = null; + return objJsonResult; + } + } + #endregion + + #region 涓嬫灦鍗曟ā鍧楋紝鎵簮鍗曟潯鐮佹煡璇㈢墿鏂欏簱瀛樹俊鎭� + + /// <summary> + /// 鑾峰彇鍗曟嵁鍒楄〃淇℃伅 + /// </summary> + /// <returns></returns> + [Route("WEBSController/MaterialLowerBill_MaterInv")] + [HttpGet] + public object MaterialLowerBill_MaterInv(long HInterID, string HBillNo, string HBillType, Int64 HStockOrgID) + { + try + { + ds = oCn.RunProcReturn("exec h_p_Kf_MaterialInventory " + HInterID + "," + HBillType + "," + HStockOrgID, "h_p_Kf_MaterialInventory"); + if (ds == null || ds.Tables[0].Rows.Count == 0) + { + objJsonResult.code = "0"; + objJsonResult.count = 0; + objJsonResult.Message = "娌℃湁杩斿洖浠讳綍璁板綍锛�"; + objJsonResult.data = null; + return objJsonResult; + } + else + { + List<object> columnNameList = new List<object>(); + //娣诲姞鍒楀悕 + foreach (DataColumn col in ds.Tables[0].Columns) + { + Type dataType = col.DataType; + string ColmString = "{\"ColmCols\":\"" + col.ColumnName + "\",\"ColmType\":\"" + dataType.Name + "\"}"; + columnNameList.Add(JsonConvert.DeserializeObject(ColmString)); //鑾峰彇鍒癉ataColumn鍒楀璞$殑鍒楀悕 + } + objJsonResult.code = "0"; + objJsonResult.count = 1; + objJsonResult.Message = "鑾峰彇淇℃伅鎴愬姛锛�"; + objJsonResult.data = ds.Tables[0]; + objJsonResult.list = columnNameList; + return objJsonResult; + } + } + catch (Exception e) + { + objJsonResult.code = "0"; + objJsonResult.count = 0; + objJsonResult.Message = "鑾峰彇鍒楄〃淇℃伅澶辫触锛�" + e.ToString(); + objJsonResult.data = null; + return objJsonResult; + } + } + + #endregion + + #region 灏忚溅鎵爜缁戝畾鏃讹紝鍒ゆ柇鍏舵槸鍚﹀凡缁戝畾搴撲綅淇℃伅 + [Route("WEBSController/CarIsused")] + [HttpGet] + public object CarIsused(string HCarBarCode) + { + try + { + ds = oCn.RunProcReturn("select * from h_v_Gy_MouldIsUsed where 灏忚溅鏉$爜='" + HCarBarCode + "'" , "h_v_Gy_MouldIsUsed"); + if (ds == null || ds.Tables[0].Rows.Count == 0) + { + objJsonResult.code = "0"; + objJsonResult.count = 0; + objJsonResult.Message = "灏忚溅鏉$爜锛�" + HCarBarCode + "锛屼笉鍦ㄧ郴缁熶腑锛岃鏍稿锛�"; + objJsonResult.data = null; + return objJsonResult; + } + else + { + List<object> columnNameList = new List<object>(); + //娣诲姞鍒楀悕 + foreach (DataColumn col in ds.Tables[0].Columns) + { + Type dataType = col.DataType; + string ColmString = "{\"ColmCols\":\"" + col.ColumnName + "\",\"ColmType\":\"" + dataType.Name + "\"}"; + columnNameList.Add(JsonConvert.DeserializeObject(ColmString)); //鑾峰彇鍒癉ataColumn鍒楀璞$殑鍒楀悕 + } + objJsonResult.code = "1"; + objJsonResult.count = 1; + objJsonResult.Message = "鎴愬姛锛�"; + objJsonResult.data = ds.Tables[0]; + objJsonResult.list = columnNameList; + return objJsonResult; + } + } + catch (Exception e) + { + objJsonResult.code = "0"; + objJsonResult.count = 0; + objJsonResult.Message = "鏌ヨ灏忚溅鍦ㄥ簱鐘舵�佸け璐rr锛�" + e.ToString(); + objJsonResult.data = null; + return objJsonResult; + } + } + #endregion + + #region 灏忚溅缁戝畾鏈哄彴鏃讹紝鍒ゆ柇鎵�鎵満鍙帮紙璁惧锛夋潯鐮佹槸鍚﹀瓨鍦ㄤ簬璁惧妗f + [Route("WEBSController/IsExistEquip")] + [HttpGet] + public object IsExistEquip(string HEquipBarCode) + { + try + { + ds = oCn.RunProcReturn("select * from h_v_Gy_EquipIsExist where 鏈哄彴鏉$爜='" + HEquipBarCode + "'", "h_v_Gy_EquipIsExist"); + if (ds == null || ds.Tables[0].Rows.Count == 0) + { + objJsonResult.code = "0"; + objJsonResult.count = 0; + objJsonResult.Message = "鏈哄彴鏉$爜锛�" + HEquipBarCode + "锛屼笉鍦ㄧ郴缁熶腑锛岃鏍稿锛�"; + objJsonResult.data = null; + return objJsonResult; + } + else + { + List<object> columnNameList = new List<object>(); + //娣诲姞鍒楀悕 + foreach (DataColumn col in ds.Tables[0].Columns) + { + Type dataType = col.DataType; + string ColmString = "{\"ColmCols\":\"" + col.ColumnName + "\",\"ColmType\":\"" + dataType.Name + "\"}"; + columnNameList.Add(JsonConvert.DeserializeObject(ColmString)); //鑾峰彇鍒癉ataColumn鍒楀璞$殑鍒楀悕 + } + objJsonResult.code = "1"; + objJsonResult.count = 1; + objJsonResult.Message = "鎴愬姛锛�"; + objJsonResult.data = ds.Tables[0]; + objJsonResult.list = columnNameList; + return objJsonResult; + } + } + catch (Exception e) + { + objJsonResult.code = "0"; + objJsonResult.count = 0; + objJsonResult.Message = "鏌ヨ鏈哄彴淇℃伅澶辫触err锛�" + e.ToString(); + objJsonResult.data = null; + return objJsonResult; + } + } + #endregion + + #endregion + #region 鐗╂枡鏉$爜鏌ヨ璋冪敤鏂规硶 @@ -10789,7 +11893,7 @@ string sJXCode = ""; if (oSystemParameter.ShowBill(ref sErrMsg) == true) { - if (oSystemParameter.omodel.Kf_StockInRequestBill_AutoCheck == "Y") //绯荤粺鍙傛暟 鑷姩瀹℃牳 + if (oSystemParameter.omodel.Kf_StockInRequestBill_AutoCheck.ToUpper() == "Y") //绯荤粺鍙傛暟 鑷姩瀹℃牳 { result1 = InvokeHelper.Submit("k18d2ab4f14034c569576ec8e0835a80c", JsonConvert.SerializeObject(json));//鎻愪氦 result2 = InvokeHelper.Audit("k18d2ab4f14034c569576ec8e0835a80c", JsonConvert.SerializeObject(json));//瀹℃牳 -- Gitblit v1.9.1