From 1664e7f3b3ef38ecf01afb098512c733315c4d10 Mon Sep 17 00:00:00 2001 From: black-goat-me <226547893@qq.com> Date: 星期二, 23 五月 2023 17:01:27 +0800 Subject: [PATCH] 1 --- /dev/null | 1 WebAPI/Controllers/BaseSet/Xt_grdAlignment_WMESController.cs | 56 ++++ WebAPI/DLL/ClsGy_Source_Ctl.cs | 5 Model/基础资料/基础资料/ClsGy_Source_Model.cs | 1 WebAPI/Controllers/JHGL/Gy_RoutingBillController.cs | 8 WebAPI/Controllers/BaseSet/Gy_MaterialController.cs | 4 WebAPI/Controllers/CJGL/Cj_StationOutBillController.cs | 16 + WebAPI/Controllers/Sc_ProcessMangementController.cs | 536 ++++++++++++++++++++-------------------- WebAPI/Controllers/CJGL/Sc_ProcessExchangeBillController.cs | 35 ++ WebAPI/Controllers/LMESController.cs | 9 WebAPI/Controllers/CJGL/Cj_StationInBillController.cs | 16 + WebAPI/Controllers/生产管理/生产任务单/Sc_ICMOBillController.cs | 52 +++ 12 files changed, 460 insertions(+), 279 deletions(-) diff --git "a/Model/\345\237\272\347\241\200\350\265\204\346\226\231/\345\237\272\347\241\200\350\265\204\346\226\231/ClsGy_Source_Model.cs" "b/Model/\345\237\272\347\241\200\350\265\204\346\226\231/\345\237\272\347\241\200\350\265\204\346\226\231/ClsGy_Source_Model.cs" index 9040ca1..2dbf461 100644 --- "a/Model/\345\237\272\347\241\200\350\265\204\346\226\231/\345\237\272\347\241\200\350\265\204\346\226\231/ClsGy_Source_Model.cs" +++ "b/Model/\345\237\272\347\241\200\350\265\204\346\226\231/\345\237\272\347\241\200\350\265\204\346\226\231/ClsGy_Source_Model.cs" @@ -23,6 +23,7 @@ public double HMinAdd;// money //最小进阶 --addnew public Int64 HClassCount;// int //每日班次 --addnew public int HUSEORGID; + public int HEmpID; //负责人 public string HMacAddr; //mac地址 } } diff --git a/WebAPI/Controllers/BaseSet/Gy_MaterialController.cs b/WebAPI/Controllers/BaseSet/Gy_MaterialController.cs index 45d8bee..f41f42d 100644 --- a/WebAPI/Controllers/BaseSet/Gy_MaterialController.cs +++ b/WebAPI/Controllers/BaseSet/Gy_MaterialController.cs @@ -386,6 +386,7 @@ try { SQLHelper.ClsCN oCN = new SQLHelper.ClsCN(); + if (user == "10000")//api鍚屾鏂瑰紡 { oCN.RunProc("delete from Gy_Material where HERPItemID=" + HItemID); @@ -395,6 +396,7 @@ objJsonResult.data = null; return objJsonResult; ; } + //鍒犻櫎鏉冮檺 if (!DBUtility.ClsPub.Security_Log("Gy_Material_Delete", 1, false, user)) { @@ -416,6 +418,7 @@ ds = oCN.RunProcReturn("select * from Gy_Material where HItemID=" + HItemID, "Gy_Material"); if (ds == null || ds.Tables[0].Rows.Count == 0) { + oCN.RollBack();//鍥炴粴浜嬪姟 objJsonResult.code = "0"; objJsonResult.count = 0; objJsonResult.Message = "娌℃湁鏁版嵁锛屾棤娉曞垹闄わ紒"; @@ -444,6 +447,7 @@ } catch (Exception e) { + oCN.RollBack();//鍥炴粴浜嬪姟 objJsonResult.code = "0"; objJsonResult.count = 0; objJsonResult.Message = "鍒犻櫎澶辫触锛�" + e.ToString(); diff --git a/WebAPI/Controllers/BaseSet/Xt_grdAlignment_WMESController.cs b/WebAPI/Controllers/BaseSet/Xt_grdAlignment_WMESController.cs index 9d779c3..940142c 100644 --- a/WebAPI/Controllers/BaseSet/Xt_grdAlignment_WMESController.cs +++ b/WebAPI/Controllers/BaseSet/Xt_grdAlignment_WMESController.cs @@ -27,7 +27,21 @@ { try { + ds = oCN.RunProcReturn("select * from Xt_grdAlignment_WMES where HModName='" + HModName + "' and HUserName='" + user + "'", "Xt_grdAlignment_WMES"); + + if (ds.Tables[0].Rows.Count == 0) + { + ds = oCN.RunProcReturn("select * from Xt_grdAlignment_WMES where HModName='" + HModName + "' and (HUserName='admin' or HUserName='Admin')", "Xt_grdAlignment_WMES"); + + if (ds.Tables[0].Rows.Count == 0) { + objJsonResult.code = "1"; + objJsonResult.count = 1; + objJsonResult.Message = "Sucess锛�"; + objJsonResult.data = null; + return objJsonResult; + } + } objJsonResult.code = "1"; objJsonResult.count = 1; @@ -144,6 +158,48 @@ #endregion + #region 闅愯棌鍒楄缃� 鍒犻櫎 + [Route("Xt_grdAlignment_WMES/DelgrdAlignmentWMES")] + [HttpGet] + public object DelgrdAlignmentWMES(string HModName, string user) + { + try + { + ds = oCN.RunProcReturn("select * from Xt_grdAlignment_WMES where HModName='" + HModName + "' and HUserName='" + user + "'", "Xt_grdAlignment_WMES"); + + if (ds.Tables[0].Rows.Count == 0) + { + objJsonResult.code = "0"; + objJsonResult.count = 0; + objJsonResult.Message = "姝や汉鏃犳ā鍧楁暟鎹�!"; + objJsonResult.data = null; + return objJsonResult; + } + + + oCN.BeginTran(); + + oCN.RunProc("delete from Xt_grdAlignment_WMES where HModName='" + HModName + "' and HUserName='" + user + "'"); + + oCN.Commit(); + + objJsonResult.code = "1"; + 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 + #region 鎸夐挳璁剧疆 鍒楄〃 [Route("Xt_ModuleButtonSet_WMES/moduleButtonSetWMESList")] diff --git a/WebAPI/Controllers/CJGL/Cj_StationInBillController.cs b/WebAPI/Controllers/CJGL/Cj_StationInBillController.cs index 83b1ba4..0daf31a 100644 --- a/WebAPI/Controllers/CJGL/Cj_StationInBillController.cs +++ b/WebAPI/Controllers/CJGL/Cj_StationInBillController.cs @@ -7,6 +7,7 @@ using System.Data; using System.Data.SqlClient; using System.Web.Http; +using System.Windows.Forms; using WebAPI.Models; namespace WebAPI.Controllers @@ -37,6 +38,7 @@ //濮斿宸ュ簭鍙戝嚭鍙嶅簭鍒楀寲 string msg2 = "[" + sArray[0].ToString() + "]"; string user = sArray[1].ToString(); + string HComputerName = SystemInformation.ComputerName; //璁惧鍚嶇О //鍒ゆ柇鏄惁鏈夌紪杈戞潈闄� if (!DBUtility.ClsPub.Security_Log("Cj_StationInBill_Edit", 1, false, user)) @@ -202,6 +204,9 @@ "," + HSupID + "," + HQty + "," + HPrice + "," + HMoney + "," + HPieceQty + ",'" + HSourceName + "'," + HCenterID + ",'" + HProcNo + "','" + HOrderProcNO + "','" + HMainInterID + "'," + HPRDOrgID + ","+ HmaterOutqty + ") "); + + LogService.Write("鐢ㄦ埛:" + user + ",鏃ユ湡:" + DateTime.Now + ",鏂板宸ュ簭杩涚珯鍗曟嵁:" + HBillNo); + oCN.RunProc("Insert into System_log (GeginDate, userid, WorkstationName, WorkList, SystemName, NetuserName, State) select GETDATE(),'" + user + "','" + HComputerName + "','" + "鏂板宸ュ簭杩涚珯鍗曟嵁锛�" + HBillNo + "','LMES-宸ュ簭杩涚珯妯″潡','" + DBUtility.ClsPub.IPAddress + "','鏂板鍗曟嵁'", ref DBUtility.ClsPub.sExeReturnInfo); } else if ("Modify".Equals(eventType)) { @@ -244,6 +249,9 @@ ",HProcNo='" + HProcNo + "'" + ",HOrderProcNO='" + HOrderProcNO + "'" + " where HInterID=" + HInterID); + + LogService.Write("鐢ㄦ埛:" + user + ",鏃ユ湡:" + DateTime.Now + ",淇敼宸ュ簭杩涚珯鍗曟嵁:" + HBillNo); + oCN.RunProc("Insert into System_log (GeginDate, userid, WorkstationName, WorkList, SystemName, NetuserName, State) select GETDATE(),'" + user + "','" + HComputerName + "','" + "淇敼宸ュ簭杩涚珯鍗曟嵁锛�" + HBillNo + "','LMES-宸ュ簭杩涚珯妯″潡','" + DBUtility.ClsPub.IPAddress + "','淇敼鍗曟嵁'", ref DBUtility.ClsPub.sExeReturnInfo); } else { @@ -965,6 +973,7 @@ { try { + string HComputerName = SystemInformation.ComputerName; //璁惧鍚嶇О //缂栬緫鏉冮檺 if (!DBUtility.ClsPub.Security_Log("Cj_StationInBill_Drop", 1, false, HDeleteMan)) { @@ -1034,8 +1043,7 @@ return objJsonResult; } - //鍐欏叆鍒犻櫎鏃ュ織 - string WorkList = "鍒犻櫎杩涚珯鍗曪細" + oBill.omodel.HBillNo; + if (!oBill.DeleteBill(oBill.omodel.HInterID, oBill.omodel.HProcExchInterID, oBill.omodel.HProcExchEntryID, ref DBUtility.ClsPub.sExeReturnInfo)) { objJsonResult.code = "0"; @@ -1046,6 +1054,10 @@ } else { + //鍐欏叆鍒犻櫎鏃ュ織 + LogService.Write("鐢ㄦ埛:" + HDeleteMan + ",鏃ユ湡:" + DateTime.Now + ",鍒犻櫎宸ュ簭杩涚珯鍗曟嵁:" + oBill.omodel.HBillNo); + oCN.RunProc("Insert into System_log (GeginDate, userid, WorkstationName, WorkList, SystemName, NetuserName, State) select GETDATE(),'" + HDeleteMan + "','" + HComputerName + "','" + "鍒犻櫎宸ュ簭杩涚珯鍗曟嵁锛�" + oBill.omodel.HBillNo + "','LMES-宸ュ簭杩涚珯妯″潡','" + DBUtility.ClsPub.IPAddress + "','鍒犻櫎鍗曟嵁'", ref DBUtility.ClsPub.sExeReturnInfo); + objJsonResult.code = "1"; objJsonResult.count = 1; objJsonResult.Message = "鍒犻櫎鎴愬姛锛�"; diff --git a/WebAPI/Controllers/CJGL/Cj_StationOutBillController.cs b/WebAPI/Controllers/CJGL/Cj_StationOutBillController.cs index 0b69b2c..9f00be0 100644 --- a/WebAPI/Controllers/CJGL/Cj_StationOutBillController.cs +++ b/WebAPI/Controllers/CJGL/Cj_StationOutBillController.cs @@ -10,6 +10,7 @@ using System.IO; using System.Web; using System.Web.Http; +using System.Windows.Forms; using WebAPI.Models; namespace WebAPI.Controllers @@ -39,6 +40,7 @@ //鍙嶅簭鍒楀寲 string msg2 = "[" + sArray[0].ToString() + "]"; string user = sArray[1].ToString();//鐢ㄦ埛鍚� + string HComputerName = SystemInformation.ComputerName; //璁惧鍚嶇О //鍒ゆ柇鏄惁鏈夌紪杈戞潈闄� if (!DBUtility.ClsPub.Security_Log("Cj_StationOutBill_Edit", 1, false, user)) @@ -314,6 +316,9 @@ "," + HMainSourceInterID + ",'" + HMainSourceBillNo + "','" + HMainSourceBillType + "'," + Convert.ToString(HLastSubProc ? 1 : 0) + "," + HEmpID2 + "," + HEmpID3 + "," + HEmpID4 + "," + HEmpID5 + "," + HDSQty + "," + HChongQty + "," + HPriceRate + "," + HWorkTimes + "," + HQCCheckID + "," + HMainInterID + "," + HPRDOrgID + ","+ HmaterOutqty + ") "); + + LogService.Write("鐢ㄦ埛:" + user + ",鏃ユ湡:" + DateTime.Now + ",鏂板宸ュ簭鍑虹珯鍗曟嵁:" + HBillNo); + oCN.RunProc("Insert into System_log (GeginDate, userid, WorkstationName, WorkList, SystemName, NetuserName, State) select GETDATE(),'" + user + "','" + HComputerName + "','" + "鏂板宸ュ簭鍑虹珯鍗曟嵁锛�" + HBillNo + "','LMES-宸ュ簭鍑虹珯妯″潡','" + DBUtility.ClsPub.IPAddress + "','鏂板鍗曟嵁'", ref DBUtility.ClsPub.sExeReturnInfo); } else if ("Modify".Equals(eventType)) { @@ -346,6 +351,9 @@ ",HWasterQty=" + HWasterQty + ",HLastSubProc=" + Convert.ToString(HLastSubProc ? 1 : 0) + " where HInterID=" + HInterID); + + LogService.Write("鐢ㄦ埛:" + user + ",鏃ユ湡:" + DateTime.Now + ",淇敼宸ュ簭鍑虹珯鍗曟嵁:" + HBillNo); + oCN.RunProc("Insert into System_log (GeginDate, userid, WorkstationName, WorkList, SystemName, NetuserName, State) select GETDATE(),'" + user + "','" + HComputerName + "','" + "淇敼宸ュ簭鍑虹珯鍗曟嵁锛�" + HBillNo + "','LMES-宸ュ簭鍑虹珯妯″潡','" + DBUtility.ClsPub.IPAddress + "','淇敼鍗曟嵁'", ref DBUtility.ClsPub.sExeReturnInfo); } else { @@ -1612,7 +1620,7 @@ { try { - + string HComputerName = SystemInformation.ComputerName; //璁惧鍚嶇О //缂栬緫鏉冮檺 if (!DBUtility.ClsPub.Security_Log("Cj_StationOutBill_Drop", 1, false, HDeleteMan)) { @@ -1682,8 +1690,6 @@ return objJsonResult; } - //鍐欏叆鍒犻櫎鏃ュ織 - string WorkList = "鍒犻櫎鍑虹珯鍗曪細" + oBill.omodel.HBillNo; if (!oBill.DeleteBill(oBill.omodel.HInterID, oBill.omodel.HProcExchInterID, oBill.omodel.HProcExchEntryID, ref DBUtility.ClsPub.sExeReturnInfo)) { objJsonResult.code = "0"; @@ -1694,6 +1700,10 @@ } else { + //鍐欏叆鍒犻櫎鏃ュ織 + LogService.Write("鐢ㄦ埛:" + HDeleteMan + ",鏃ユ湡:" + DateTime.Now + ",鍒犻櫎宸ュ簭鍑虹珯鍗曟嵁:" + oBill.omodel.HBillNo); + oCN.RunProc("Insert into System_log (GeginDate, userid, WorkstationName, WorkList, SystemName, NetuserName, State) select GETDATE(),'" + HDeleteMan + "','" + HComputerName + "','" + "鍒犻櫎宸ュ簭鍑虹珯鍗曟嵁锛�" + oBill.omodel.HBillNo + "','LMES-宸ュ簭鍑虹珯妯″潡','" + DBUtility.ClsPub.IPAddress + "','鍒犻櫎鍗曟嵁'", ref DBUtility.ClsPub.sExeReturnInfo); + objJsonResult.code = "1"; objJsonResult.count = 1; objJsonResult.Message = "鍒犻櫎鎴愬姛锛�"; diff --git a/WebAPI/Controllers/CJGL/Sc_ProcessExchangeBillController.cs b/WebAPI/Controllers/CJGL/Sc_ProcessExchangeBillController.cs index fde887b..f5eb6fe 100644 --- a/WebAPI/Controllers/CJGL/Sc_ProcessExchangeBillController.cs +++ b/WebAPI/Controllers/CJGL/Sc_ProcessExchangeBillController.cs @@ -7,6 +7,7 @@ using System.Data; using System.Data.SqlClient; using System.Web.Http; +using System.Windows.Forms; using WebAPI.Models; namespace WebAPI.Controllers @@ -19,6 +20,7 @@ SQLHelper.ClsCN oCN = new SQLHelper.ClsCN(); DataSet ds; Pub_Class.ClsXt_SystemParameter oSystemParameter = new Pub_Class.ClsXt_SystemParameter(); + #region[鏂板鍗曟嵁-淇濆瓨鎸夐挳] /// <summary> @@ -37,6 +39,7 @@ string msg3 = sArray[1].ToString(); string msg4 = sArray[2].ToString(); string msg5 = sArray[3].ToString(); + string HComputerName = SystemInformation.ComputerName; //璁惧鍚嶇О string UserName = ""; ListModels oListModels = new ListModels(); @@ -98,12 +101,18 @@ bool bResult; if (msg5 == "xz") { + LogService.Write("鐢ㄦ埛:" + msg4 + ",鏃ユ湡:" + DateTime.Now + ",鏂板宸ュ簭娴佽浆鍗″崟鎹�:" + oBill.omodel.HBillNo); // bResult = oBill.AddBill(ref DBUtility.ClsPub.sExeReturnInfo); bResult = oBill.AddBill(ref DBUtility.ClsPub.sExeReturnInfo); + + oCN.RunProc("Insert into System_log (GeginDate, userid, WorkstationName, WorkList, SystemName, NetuserName, State) select GETDATE(),'" + msg4 + "','" + HComputerName + "','" + "鏂板宸ュ簭娴佽浆鍗″崟鎹細" + oBill.omodel.HBillNo + "','LMES-宸ュ簭娴佽浆鍗℃ā鍧�','" + DBUtility.ClsPub.IPAddress + "','鏂板鍗曟嵁'", ref DBUtility.ClsPub.sExeReturnInfo); } else { + LogService.Write("鐢ㄦ埛:" + msg4 + ",鏃ユ湡:" + DateTime.Now + ",淇敼宸ュ簭娴佽浆鍗″崟鎹�:" + oBill.omodel.HBillNo); bResult = oBill.ModifyBill(oBill.omodel.HInterID, ref DBUtility.ClsPub.sExeReturnInfo); + + oCN.RunProc("Insert into System_log (GeginDate, userid, WorkstationName, WorkList, SystemName, NetuserName, State) select GETDATE(),'" + msg4 + "','" + HComputerName + "','" + "淇敼宸ュ簭娴佽浆鍗″崟鎹細" + oBill.omodel.HBillNo + "','LMES-宸ュ簭娴佽浆鍗℃ā鍧�','" + DBUtility.ClsPub.IPAddress + "','淇敼鍗曟嵁'", ref DBUtility.ClsPub.sExeReturnInfo); } if (bResult) { @@ -391,6 +400,7 @@ string msg3 = sArray[1].ToString(); string msg4 = sArray[2].ToString(); string msg5 = sArray[3].ToString(); + string HComputerName = SystemInformation.ComputerName; //璁惧鍚嶇О string UserName = ""; ListModels oListModels = new ListModels(); @@ -449,8 +459,17 @@ oBill.omodel.HQty = HPlanQty; } + for (int j = 0; j < oBill.DetailColl.Count; j++) + { + oBill.DetailColl[j].HRelationQty_In = 0; + oBill.DetailColl[j].HRelationQty_Out = 0; + oBill.DetailColl[j].HRelationQty_Bad = 0; + } + //淇濆瓨瀹屾瘯鍚庡鐞� bool bResult; + LogService.Write("鐢ㄦ埛:" + msg4 + ",鏃ユ湡:" + DateTime.Now + ",鏂板宸ュ簭娴佽浆鍗″崟鎹�:" + oBill.omodel.HBillNo); + oCN.RunProc("Insert into System_log (GeginDate, userid, WorkstationName, WorkList, SystemName, NetuserName, State) select GETDATE(),'" + msg4 + "','" + HComputerName + "','" + "鏂板宸ュ簭娴佽浆鍗″崟鎹細" + oBill.omodel.HBillNo + "','LMES-宸ュ簭娴佽浆鍗℃ā鍧�','" + DBUtility.ClsPub.IPAddress + "','鏂板鍗曟嵁'", ref DBUtility.ClsPub.sExeReturnInfo); bResult = oBill.AddBill(ref sReturn); if (bResult) @@ -498,6 +517,7 @@ string msg4 = sArray[2].ToString();//宸ヨ壓璺嚎 string msg5 = sArray[3].ToString();//绫诲瀷 string msg6 = sArray[4].ToString();//鐢ㄦ埛 + string HComputerName = SystemInformation.ComputerName; //璁惧鍚嶇О ListModels oListModels = new ListModels(); @@ -571,6 +591,9 @@ bool bResult=false; if (msg5 == "2") { + LogService.Write("鐢ㄦ埛:" + msg6 + ",鏃ユ湡:" + DateTime.Now + ",鏂板宸ュ簭娴佽浆鍗″崟鎹�:" + oBill.omodel.HBillNo); + oCN.RunProc("Insert into System_log (GeginDate, userid, WorkstationName, WorkList, SystemName, NetuserName, State) select GETDATE(),'" + msg6 + "','" + HComputerName + "','" + "鏂板宸ュ簭娴佽浆鍗″崟鎹細" + oBill.omodel.HBillNo + "','LMES-宸ュ簭娴佽浆鍗℃ā鍧�','" + DBUtility.ClsPub.IPAddress + "','鏂板鍗曟嵁'", ref DBUtility.ClsPub.sExeReturnInfo); + bResult = oBill.AddBill(ref DBUtility.ClsPub.sExeReturnInfo); } oBill.DetailColl.Clear(); @@ -817,9 +840,13 @@ return objJsonResult; } + string HComputerName = SystemInformation.ComputerName; //璁惧鍚嶇О + DAL.ClsSc_ProcessExchangeBill oBill = new DAL.ClsSc_ProcessExchangeBill(); string[] HBillNo = HInterID.Split(','); + + string HBillNo_S = ""; foreach (var item in HBillNo) { @@ -879,6 +906,7 @@ objJsonResult.data = null; return objJsonResult; } + if (oBill.omodel.HChecker != "") { objJsonResult.code = "0"; @@ -887,6 +915,7 @@ objJsonResult.data = null; return objJsonResult; } + HBillNo_S += oBill.omodel.HBillNo + ","; } else { @@ -897,6 +926,12 @@ return objJsonResult; } } + + HBillNo_S = HBillNo_S.Substring(0, HBillNo_S.Length - 1); + LogService.Write("鐢ㄦ埛:" + user + ",鏃ユ湡:" + DateTime.Now + ",鍒犻櫎宸ュ簭娴佽浆鍗″崟鎹�:" + HBillNo_S); + + oCN.RunProc("Insert into System_log (GeginDate, userid, WorkstationName, WorkList, SystemName, NetuserName, State) select GETDATE(),'" + user + "','" + HComputerName + "','" + "鍒犻櫎宸ュ簭娴佽浆鍗″崟鎹細" + HBillNo_S + "','LMES-宸ュ簭娴佽浆鍗℃ā鍧�','" + DBUtility.ClsPub.IPAddress + "','鍒犻櫎鍗曟嵁'", ref DBUtility.ClsPub.sExeReturnInfo); + foreach (var item in HBillNo) { bool IsDete = oBill.DeleteBill(long.Parse(item), ref DBUtility.ClsPub.sExeReturnInfo); diff --git a/WebAPI/Controllers/JHGL/Gy_RoutingBillController.cs b/WebAPI/Controllers/JHGL/Gy_RoutingBillController.cs index 045da5d..2afdfbc 100644 --- a/WebAPI/Controllers/JHGL/Gy_RoutingBillController.cs +++ b/WebAPI/Controllers/JHGL/Gy_RoutingBillController.cs @@ -10,6 +10,7 @@ using System.IO; using System.Web; using System.Web.Http; +using System.Windows.Forms; using WebAPI.Controllers.SCGL.鏃ヨ鍒掔鐞�; using WebAPI.Models; @@ -124,6 +125,7 @@ //int hentryid = int.Parse(sArray[2].ToString());//瀛愯〃鐨勯『搴廼d int OperationType = int.Parse(sArray[2].ToString());//鏁版嵁绫诲瀷 1娣诲姞 3淇敼 2 澶嶅埗 string user = sArray[3].ToString();//鐢ㄦ埛鍚� + string HComputerName = SystemInformation.ComputerName; //璁惧鍚嶇О try { //鍒ゆ柇鏄惁鏈夌紪杈戞潈闄� @@ -203,6 +205,9 @@ "," + HMainGroupID + "," + HMainProcID + "," + HMainCenterID + ",'" + HMainTimeUnit + "'," + HMainUnitTime + "," + HMainWorkQty + "," + HMainPrice + "," + HStdSourceQty + "," + HAddSourceRate + "," + HPRDORGID + "," + HDelSourceRate + ",'" + HPicNumVer + "','" + HPicNumAssemble + "','" + HMaterTexture + "','" + HProductNum + "','" + HVerNum + "'," + HOrgID + ") "); + + LogService.Write("鐢ㄦ埛:" + user + ",鏃ユ湡:" + DateTime.Now + ",鏂板宸ヨ壓璺嚎鍗曟嵁:" + HBillNo); + oCN.RunProc("Insert into System_log (GeginDate, userid, WorkstationName, WorkList, SystemName, NetuserName, State) select GETDATE(),'" + user + "','" + HComputerName + "','" + "鏂板宸ヨ壓璺嚎鍗曟嵁锛�" + HBillNo + "','LMES-宸ヨ壓璺嚎妯″潡','" + DBUtility.ClsPub.IPAddress + "','鏂板鍗曟嵁'", ref DBUtility.ClsPub.sExeReturnInfo); } else if (OperationType == 3 || ds.Tables[0].Rows.Count != 0) { //淇敼 @@ -219,6 +224,9 @@ //鍒犻櫎瀛愯〃 oCN.RunProc("delete from Gy_RoutingBillSub where HInterID='" + HInterID + "'"); + + LogService.Write("鐢ㄦ埛:" + user + ",鏃ユ湡:" + DateTime.Now + ",淇敼宸ヨ壓璺嚎鍗曟嵁:" + HBillNo); + oCN.RunProc("Insert into System_log (GeginDate, userid, WorkstationName, WorkList, SystemName, NetuserName, State) select GETDATE(),'" + user + "','" + HComputerName + "','" + "淇敼宸ヨ壓璺嚎鍗曟嵁锛�" + HBillNo + "','LMES-宸ヨ壓璺嚎妯″潡','" + DBUtility.ClsPub.IPAddress + "','淇敼鍗曟嵁'", ref DBUtility.ClsPub.sExeReturnInfo); } //淇濆瓨瀛愯〃 objJsonResult = AddBillSub(msg3, HInterID, OperationType); diff --git a/WebAPI/Controllers/LMESController.cs b/WebAPI/Controllers/LMESController.cs index c3145a8..97dfadb 100644 --- a/WebAPI/Controllers/LMESController.cs +++ b/WebAPI/Controllers/LMESController.cs @@ -7,6 +7,7 @@ using System.Data; using System.Data.SqlClient; using System.Web.Http; +using System.Windows.Forms; using WebAPI.Models; namespace WebAPI.Controllers { @@ -73,6 +74,7 @@ SQLHelper.ClsCN oCN = new SQLHelper.ClsCN(); ds = oCN.RunProcReturn("select * from h_v_Sc_ProcessExchangeBillQuery where 1 = 1 " + sWhere + " order by hmainid desc ", "h_v_Sc_ProcessExchangeBillQuery"); + //娣诲姞鍒楀悕 foreach (DataColumn col in ds.Tables[0].Columns) @@ -410,6 +412,7 @@ string ModRightNameCheck = "Gy_RoutingBill_Drop"; try { + string HComputerName = SystemInformation.ComputerName; //璁惧鍚嶇О //鍒犻櫎鏉冮檺 if (!DBUtility.ClsPub.Security_Log(ModRightNameCheck, 1, false, user)) { @@ -430,7 +433,7 @@ return objJsonResult; } oCN.BeginTran();//寮�濮嬩簨鍔� - ds = oCN.RunProcReturn("select * from Gy_RoutingBillmain where HInterID=" + lngBillKey, "Gy_RoutingBillmain"); + ds = oCN.RunProcReturn("select * from Gy_RoutingBillMain where HInterID=" + lngBillKey, "Gy_RoutingBillmain"); if (ds == null || ds.Tables[0].Rows.Count == 0) { objJsonResult.code = "0"; @@ -459,6 +462,10 @@ //} oCN.RunProc("delete from Gy_RoutingBillmain where HInterID=" + lngBillKey); oCN.RunProc("delete from Gy_RoutingBillSub where HInterID=" + lngBillKey); + + LogService.Write("鐢ㄦ埛:" + user + ",鏃ユ湡:" + DateTime.Now + ",鍒犻櫎宸ヨ壓璺嚎鍗曟嵁:" + ds.Tables[0].Rows[0]["HBillNo"].ToString()); + oCN.RunProc("Insert into System_log (GeginDate, userid, WorkstationName, WorkList, SystemName, NetuserName, State) select GETDATE(),'" + user + "','" + HComputerName + "','" + "鍒犻櫎宸ヨ壓璺嚎鍗曟嵁锛�" + ds.Tables[0].Rows[0]["HBillNo"].ToString() + "','LMES-宸ヨ壓璺嚎妯″潡','" + DBUtility.ClsPub.IPAddress + "','鍒犻櫎鍗曟嵁'", ref DBUtility.ClsPub.sExeReturnInfo); + oCN.Commit();//鎻愪氦浜嬪姟 objJsonResult.code = "0"; objJsonResult.count = 1; diff --git a/WebAPI/Controllers/Sc_ProcessMangementController.cs b/WebAPI/Controllers/Sc_ProcessMangementController.cs index 77c76a3..2d82cff 100644 --- a/WebAPI/Controllers/Sc_ProcessMangementController.cs +++ b/WebAPI/Controllers/Sc_ProcessMangementController.cs @@ -190,6 +190,8 @@ } } + #endregion + #region 鏂帿灏� 鏈亾宸ュ簭姹囨姤鍒楄〃 姹囨姤 鍏ュ簱 /// <summary> /// 鐢熸垚 鐢熶骇姹囨姤鍗� @@ -410,7 +412,7 @@ string OrganizationNUM = oCN.RunProcReturn("select HNumber from Xt_ORGANIZATIONS where HItemID=" + OrganizationID, "Xt_ORGANIZATIONS").Tables[0].Rows[0]["HNumber"].ToString(); //鏍规嵁宸ュ簭姹囨姤鍗曚富ID鑾峰彇宸ュ簭姹囨姤鍏ュ簱鍗曠殑鏁版嵁 DataSet ds = oCN.RunProcReturn("select * from h_v_MES_StationOutBillList_LastProc where HInterID=" + InterID, "h_v_MES_StationOutBillList_LastProc"); - if(ds.Tables[0].Rows.Count <= 0) + if (ds.Tables[0].Rows.Count <= 0) { objJsonResult.code = "0"; objJsonResult.count = 0; @@ -419,10 +421,10 @@ return objJsonResult; } DataRow dr = ds.Tables[0].Rows[0]; - + //淇濆瓨 oCN.BeginTran(); - DataSet DsTable = oCN.RunProcReturn($"select * from Sc_ICMOReportBillMain where HBillNo='{HBillNo}'" , "Sc_ICMOReportBillMain"); + DataSet DsTable = oCN.RunProcReturn($"select * from Sc_ICMOReportBillMain where HBillNo='{HBillNo}'", "Sc_ICMOReportBillMain"); if (DsTable.Tables[0].Rows.Count > 0) { objJsonResult.code = "0"; @@ -431,18 +433,18 @@ objJsonResult.data = null; return objJsonResult; } - //鐢熶骇姹囨姤鍗曚富琛� - oCN.RunProc("Insert Into Sc_ICMOReportBillMain " + - "(HBillType,HBillSubType,HInterID,HBillNo,HDate,HMaker,HMakeDate,HBillStatus,HChecker,HCheckDate" + - ",HYear,HPeriod,HRemark,HEmpID,HEmpNumber" + - ",HGroupID,HDeptID,HDeptNumber" + - ",HMainSourceBillNo,HMainSourceInterID,HMainSourceEntryID,HMainSourceBillType" + - ") " + - " values('3711','3711'," + HInterID.ToString() + ",'" + BillNo + "',getdate(),'" + user + "',getdate(),2,'" + user + "',getdate()" + - ",DATENAME(YEAR,GETDATE()),0,'','" + dr["HEmpID"].ToString() + "','" + dr["鎿嶄綔鍛樹唬鐮�"].ToString() + - "','" + dr["HGroupID"].ToString() + "',0,''" + - ",'" + BillNo.ToString() + "'," + InterID.ToString() + ", 0,'3791'" + - ") "); + //鐢熶骇姹囨姤鍗曚富琛� + oCN.RunProc("Insert Into Sc_ICMOReportBillMain " + + "(HBillType,HBillSubType,HInterID,HBillNo,HDate,HMaker,HMakeDate,HBillStatus,HChecker,HCheckDate" + + ",HYear,HPeriod,HRemark,HEmpID,HEmpNumber" + + ",HGroupID,HDeptID,HDeptNumber" + + ",HMainSourceBillNo,HMainSourceInterID,HMainSourceEntryID,HMainSourceBillType" + + ") " + + " values('3711','3711'," + HInterID.ToString() + ",'" + BillNo + "',getdate(),'" + user + "',getdate(),2,'" + user + "',getdate()" + + ",DATENAME(YEAR,GETDATE()),0,'','" + dr["HEmpID"].ToString() + "','" + dr["鎿嶄綔鍛樹唬鐮�"].ToString() + + "','" + dr["HGroupID"].ToString() + "',0,''" + + ",'" + BillNo.ToString() + "'," + InterID.ToString() + ", 0,'3791'" + + ") "); //鐢熶骇姹囨姤鍗曞瓙琛� oCN.RunProc("Insert into Sc_ICMOReportBillSub " + " (HInterID,HEntryID,HMaterID,HMaterNumber" + @@ -483,7 +485,7 @@ model.Add("FDate", DateTime.Now.ToString("yyyy-MM-dd")); //鍗曟嵁鏃ユ湡1 model.Add("FHZYMESFLAG", "鏄�");// 鏄惁涓篗ES鍚屾 model.Add("FBillNo", BillNo); - + JArray Fentity = new JArray(); foreach (DataRow item in ds.Tables[0].Rows) @@ -550,7 +552,7 @@ //["IsAutoSubmitAndAudit"] = true,//鑷姩璋冪敤鎻愪氦鍜屽鏍稿姛鑳� ["Model"] = model }; - + string result = InvokeHelper.Save("PRD_MORPT", JsonConvert.SerializeObject(jsonRoot));//淇濆瓨 //鍒ゆ柇淇濆瓨鏄惁鎴愬姛 if (JObject.Parse(result)["Result"]["ResponseStatus"]["IsSuccess"].ToString().ToUpper() != "TRUE") @@ -584,7 +586,7 @@ return objJsonResult; } - oCN.RunProc("update Sc_StationOutBillMain set HRelationQty=1 where HBillNo='" + BillNo+"'"); + oCN.RunProc("update Sc_StationOutBillMain set HRelationQty=1 where HBillNo='" + BillNo + "'"); oCN.Commit(); objJsonResult.code = "0"; @@ -626,7 +628,7 @@ //DataRow dr = ds.Tables[0].Rows[0]; //鍒ゆ柇鍏ュ簱鐨勫悎鏍兼暟閲忔槸鍚︿负0 - var DTable = oCN.RunProcReturn("select * from Sc_StationOutBillMain where HBillNo='"+ BillNo + "' ", "Sc_StationOutBillMain").Tables[0]; + var DTable = oCN.RunProcReturn("select * from Sc_StationOutBillMain where HBillNo='" + BillNo + "' ", "Sc_StationOutBillMain").Tables[0]; if (double.Parse(DTable.Rows[0]["HQty"].ToString()) == 0) { @@ -708,7 +710,7 @@ } } - + if (double.Parse(ds.Tables[0].Rows[0][0].ToString()) < 0) { objJsonResult.code = "0"; @@ -788,18 +790,18 @@ FentityModel.Add("F_bsv_Base1", new JObject() { ["FNumber"] = item["HBZBS"].ToString() });// FentityModel.Add("F_BSV_TEXT", item["HLZKH"].ToString());// FentityModel.Add("F_BSV_TEXT1", item["HWYID"].ToString());// - //鎵瑰彿 - //FFLOWID FFLOWLINEID FRULEID FSTABLENAME - //f6e6eec3 - 5267 - 4f02 - 8593 - b633da508a72 3 PRD_MO2MORPT T_PRD_MOENTRY - //涓氬姟娴佺▼鍥撅細FEntity_Link_FFlowId - //鎺ㄨ繘璺嚎锛欶Entity_Link_FFlowLineId - //杞崲瑙勫垯锛欶Entity_Link_FRuleId - //婧愬崟琛ㄥ唴鐮侊細FEntity_Link_FSTableId - //婧愬崟琛細FEntity_Link_FSTableName - //婧愬崟鍐呯爜锛欶Entity_Link_FSBillId - //婧愬崟鍒嗗綍鍐呯爜锛欶Entity_Link_FSId - //鍘熷鎼哄甫閲忥細FEntity_Link_FBaseQuaQtyOld - //淇敼鎼哄甫閲忥細FEntity_Link_FBaseQuaQty + //鎵瑰彿 + //FFLOWID FFLOWLINEID FRULEID FSTABLENAME + //f6e6eec3 - 5267 - 4f02 - 8593 - b633da508a72 3 PRD_MO2MORPT T_PRD_MOENTRY + //涓氬姟娴佺▼鍥撅細FEntity_Link_FFlowId + //鎺ㄨ繘璺嚎锛欶Entity_Link_FFlowLineId + //杞崲瑙勫垯锛欶Entity_Link_FRuleId + //婧愬崟琛ㄥ唴鐮侊細FEntity_Link_FSTableId + //婧愬崟琛細FEntity_Link_FSTableName + //婧愬崟鍐呯爜锛欶Entity_Link_FSBillId + //婧愬崟鍒嗗綍鍐呯爜锛欶Entity_Link_FSId + //鍘熷鎼哄甫閲忥細FEntity_Link_FBaseQuaQtyOld + //淇敼鎼哄甫閲忥細FEntity_Link_FBaseQuaQty @@ -807,7 +809,7 @@ JObject FentityModel2 = new JObject(); FentityModel2.Add("FEntity_Link_FFlowId", "f6e6eec3-5267-4f02-8593-b633da508a72"); FentityModel2.Add("FEntity_Link_FFlowLineId", "5"); - FentityModel2.Add("FEntity_Link_FRuleId", "PRD_MORPT2INSTOCK"); + FentityModel2.Add("FEntity_Link_FRuleId", "PRD_MORPT2INSTOCK"); FentityModel2.Add("FEntity_Link_FSTableName", "T_PRD_MORPTENTRY"); FentityModel2.Add("FEntity_Link_FSTableId", "0"); FentityModel2.Add("FEntity_Link_FSBillId", item["HSourceInterID"].ToString()); @@ -925,7 +927,7 @@ //DataRow dr = ds.Tables[0].Rows[0]; //鍒ゆ柇鏈鎶ュ簾鎬绘暟閲忔槸鍚︿负0 - var DTable = oCN.RunProcReturn("select isnull(sum(HWasterQty),0) HWasterQty from Sc_StationOutBillMain where HProcExchBillNo='"+ BillNo + "' and HBFFlag=0 ", "Sc_StationOutBillMain").Tables[0]; + var DTable = oCN.RunProcReturn("select isnull(sum(HWasterQty),0) HWasterQty from Sc_StationOutBillMain where HProcExchBillNo='" + BillNo + "' and HBFFlag=0 ", "Sc_StationOutBillMain").Tables[0]; if (double.Parse(DTable.Rows[0]["HWasterQty"].ToString()) == 0) { @@ -1150,7 +1152,7 @@ return objJsonResult; } - //oCN.RunProc("update Sc_StationOutBillMain set HRelationQty=1 where HBillNo='" + BillNo + "'"); + //oCN.RunProc("update Sc_StationOutBillMain set HRelationQty=1 where HBillNo='" + BillNo + "'"); oCN.Commit(); oCN.RunProc("update sc_stationoutbillmain set HBFFlag =1 where HProcExchBillNo = '" + BillNo + "'"); @@ -1172,255 +1174,252 @@ } - ///// <summary> - ///// 鐢熸垚閲戣澏浜戞潵鏂欐楠屽崟 - ///// </summary> - ///// <param name="InterID">宸ュ簭姹囨姤鍗曚富ID</param> - ///// <returns></returns> - //[Route("QCStockInCheckBill/set_SaveQCStockInCheckBill_Json")] - //[HttpGet] - //public object set_SaveQCStockInCheckBill_Json(string HZJOrgNumber, string HMaterNumber, string HUnitNumber, - // double HCheckQty, double HRightQty, double HBadQty, - // string HCheckResult, string HSupNumber, - // string HUseResult, Int64 HSeQ, Int64 HSourceInterID, - // Int64 HSourceEntryID, string HSourceBillNo, string user, - // Int64 HWHID, Int64 HSPID, Int64 HSupID, Int64 HKeeperID, - // Int64 HMaterID, string HSourceBillType, Int64 HSLInterID, - // Int64 HSLEntryID, string HSLBillNo, Int64 HSLSeQ, string HBillNo, Int64 HInterID) - //{ - // try - // { - // //鑾峰彇鐢熶骇姹囨姤鍗曟渶澶nterID鍜屽崟鎹彿 - // //Int64 HInterID = DBUtility.ClsPub.CreateBillID("7503", ref DBUtility.ClsPub.sExeReturnInfo); - // //string HBillNo = DBUtility.ClsPub.CreateBillCode("7503", ref DBUtility.ClsPub.sExeReturnInfo, true); + /// <summary> + /// 鐢熸垚閲戣澏浜戞潵鏂欐楠屽崟 + /// </summary> + /// <param name="InterID">宸ュ簭姹囨姤鍗曚富ID</param> + /// <returns></returns> + [Route("QCStockInCheckBill/set_SaveQCStockInCheckBill_Json")] + [HttpGet] + public object set_SaveQCStockInCheckBill_Json(string HZJOrgNumber, string HMaterNumber, string HUnitNumber, + double HCheckQty, double HRightQty, double HBadQty, + string HCheckResult, string HSupNumber, + string HUseResult, Int64 HSeQ, Int64 HSourceInterID, + Int64 HSourceEntryID, string HSourceBillNo, string user, + Int64 HWHID, Int64 HSPID, Int64 HSupID, Int64 HKeeperID, + Int64 HMaterID, string HSourceBillType, Int64 HSLInterID, + Int64 HSLEntryID, string HSLBillNo, Int64 HSLSeQ, string HBillNo, Int64 HInterID) + { + try + { + //鑾峰彇鐢熶骇姹囨姤鍗曟渶澶nterID鍜屽崟鎹彿 + //Int64 HInterID = DBUtility.ClsPub.CreateBillID("7503", ref DBUtility.ClsPub.sExeReturnInfo); + //string HBillNo = DBUtility.ClsPub.CreateBillCode("7503", ref DBUtility.ClsPub.sExeReturnInfo, true); - // DataSet ds1 = oCN.RunProcReturn("select * from MES_AccessoriesList where HSourceBillNo = '" + HBillNo + "'", "MES_AccessoriesList"); - // string HFileName = DBUtility.ClsPub.isStrNull(ds1.Tables[0].Rows[0]["HFileName"]); - // string HFilePath = DBUtility.ClsPub.isStrNull(ds1.Tables[0].Rows[0]["HFilePath"]); + DataSet ds1 = oCN.RunProcReturn("select * from MES_AccessoriesList where HSourceBillNo = '" + HBillNo + "'", "MES_AccessoriesList"); + string HFileName = DBUtility.ClsPub.isStrNull(ds1.Tables[0].Rows[0]["HFileName"]); + string HFilePath = DBUtility.ClsPub.isStrNull(ds1.Tables[0].Rows[0]["HFilePath"]); + + string path = HFilePath; + FileInfo fi = new FileInfo(path); + long len = fi.Length; + byte[] buffer = new byte[len]; + FileStream fs = new FileStream(path, FileMode.Open); + fs.Read(buffer, 0, (int)len); + //鏂囦欢IO娴� + string a = Convert.ToBase64String(buffer); + + + //淇濆瓨 + oCN.BeginTran(); + //鐢熶骇姹囨姤鍗曚富琛� + oCN.RunProc("Insert Into QC_POStockInCheckBillMain " + + "(HBillType,HBillSubType,HInterID,HBillNo,HDate,HMaker,HMakeDate,HBillStatus,HChecker,HCheckDate" + + ",HYear,HPeriod,HRemark,HSupID,HMaterID" + + ",HInstockQty,HCheckQty,HRightQty,HBadQty,HFirstCheckEmp" + + ",HCheckerResult,HSteelStoveNo,HSteelCompReport,HAspect,HSize" + + ") " + + " values('7503','7503'," + HInterID.ToString() + ",'" + HBillNo + "',getdate(),'" + user + "',getdate(),2,'" + user + "',getdate()" + + ",DATENAME(YEAR,GETDATE()),0,''," + HSupID.ToString() + "," + HMaterID.ToString() + + ",'" + HCheckQty.ToString() + "','" + HCheckQty.ToString() + "','" + HRightQty.ToString() + "','" + HBadQty.ToString() + "','" + HKeeperID.ToString() + "'" + + ",'" + HCheckResult.ToString() + "','', '','',''" + + ") "); + //鐢熶骇姹囨姤鍗曞瓙琛� + oCN.RunProc("Insert into QC_POStockInCheckBillSub " + + " (HInterID,HEntryID,HCloseMan,HCloseType" + + ",HRemark,HSourceInterID,HSourceEntryID,HSourceBillNo,HSourceBillType" + + ",HRelationQty,HRelationMoney,HQCCheckClassID,HQCCheckItemID,HQCStd," + + "HResult,HQCRelValue,HProcCheckEmp,HProcCheckTime" + + ") values(" + + HInterID.ToString() + ",1,'',''" + + ",''," + HSourceInterID.ToString() + "," + HSourceEntryID.ToString() + ",'" + HSourceBillNo.ToString() + "','" + HSourceBillType.ToString() + "'" + + ",0,0,0,0,''" + + ",'" + HCheckResult.ToString() + "','" + HCheckResult.ToString() + "','" + HKeeperID.ToString() + "',getdate()" + + ") "); + //鍚屾閲戣澏 + //璁块棶閲戣澏 + var loginRet = InvokeHelper.Login(); + var isSuccess = JObject.Parse(loginRet)["LoginResultType"].Value<int>(); + if (isSuccess == 0) + { + objJsonResult.code = "0"; + objJsonResult.count = 0; + objJsonResult.Message = "鎿嶄綔澶辫触,閲戣澏璐﹀彿鐧诲綍寮傚父銆�" + loginRet; + objJsonResult.data = null; + return objJsonResult; + } + + + JObject model = new JObject(); + model.Add("FBillTypeID", new JObject() { ["Fnumber"] = "JYD001_SYS" }); //鍗曟嵁绫诲瀷 鏉ユ枡妫�楠屽崟JYD001_SYS + model.Add("FBusinessType", "1"); //涓氬姟绫诲瀷 + model.Add("FDate", DateTime.Now.ToString("yyyy-MM-dd")); //鍗曟嵁鏃ユ湡 + model.Add("FInspectOrgId", new JObject() { ["Fnumber"] = HZJOrgNumber.ToString() }); //璐ㄦ缁勭粐 + model.Add("FSourceOrgId", new JObject() { ["Fnumber"] = HZJOrgNumber.ToString() }); //鏉ユ簮缁勭粐 + model.Add("FISSYNCED", "false");// 鏄惁宸插悓姝� + model.Add("F_PGKJ_Date", DateTime.Now.ToString("yyyy-MM-dd"));// 鎶ユ鏃ユ湡 + model.Add("FBillNo", HBillNo); + + JArray Fentity = new JArray(); + JObject FentityModel = new JObject(); + FentityModel.Add("FMaterialId", new JObject() { ["Fnumber"] = HMaterNumber.ToString() });// 鐗╂枡鍐呯爜 + FentityModel.Add("FUnitID", new JObject() { ["Fnumber"] = HUnitNumber.ToString() });//璁¢噺鍗曚綅鍐呯爜 + FentityModel.Add("FInspectQty", HCheckQty.ToString());// 妫�楠屾暟閲� + FentityModel.Add("FQualifiedQty", HRightQty.ToString());// 鍚堟牸鏁伴噺 + FentityModel.Add("FUnqualifiedQty", HBadQty.ToString());// 涓嶅悎鏍兼暟閲� + FentityModel.Add("FInspectResult", HCheckResult.ToString());// 妫�楠岀粨鏋� + FentityModel.Add("FQCStatus", "1");// 璐ㄦ鐘舵�� + FentityModel.Add("FIsRelated", false);// 涓嶈壇鍝佸叧鑱旀爣蹇� + FentityModel.Add("FSrcBillType0", "PUR_ReceiveBill");// 婧愬崟绫诲瀷 + FentityModel.Add("FBaseUnitId", new JObject() { ["Fnumber"] = HUnitNumber.ToString() });//鍩烘湰鍗曚綅 + FentityModel.Add("FBaseInspectQty", HCheckQty.ToString());//鍩烘湰鍗曚綅妫�楠屾暟閲� + FentityModel.Add("FSupplierId", new JObject() { ["Fnumber"] = HSupNumber.ToString() }); // 渚涘簲鍟� + //FentityModel.Add("FStockId", new JObject() { ["Fnumber"] = HWHNumber.ToString() }); // 浠撳簱 + FentityModel.Add("FInspectTimes", "1"); // 妫�楠屾鏁� + FentityModel.Add("FTimeUnit", "24");//鏃堕棿鍗曚綅 + FentityModel.Add("FSAMPLEDAMAGEBEARER", "2");//鏍锋湰鐮村潖鎵挎媴鏂� + FentityModel.Add("FISFIRSTINSPECT", false);//棣栨 + FentityModel.Add("FBaseQualifiedQty", HRightQty.ToString());//鍩烘湰鍗曚綅鍚堟牸鏁� + FentityModel.Add("FBaseAcceptQty", HRightQty.ToString());//鍩烘湰鍗曚綅鎺ユ敹鏁� + FentityModel.Add("FCurrency", new JObject() { ["Fnumber"] = "PRE001" });//甯佸埆 + FentityModel.Add("FIsSplitRow ", false);// 鏄惁鎷嗗垎琛� + + JArray Fentity2 = new JArray(); + JObject FentityModel2 = new JObject(); + FentityModel2.Add("FPolicyMaterialId", new JObject() { ["Fnumber"] = HMaterNumber.ToString() });// 鐗╂枡鍐呯爜 + FentityModel2.Add("FPolicyStatus", "1"); //鐘舵�� + FentityModel2.Add("FPolicyQty", HRightQty.ToString()); //鏁伴噺 + FentityModel2.Add("FBasePolicyQty", HRightQty.ToString()); //鍩烘湰鍗曚綅鏁伴噺 + FentityModel2.Add("FUsePolicy", HUseResult.ToString()); //浣跨敤鍐崇瓥 + FentityModel2.Add("FIsCheck", false); //鏄惁鎶芥 + FentityModel2.Add("FIsDefectProcess", false); //涓嶈壇澶勭悊 + FentityModel2.Add("FCanSale", false); //鍙攢鍞� + FentityModel2.Add("FIsMRBReview", false); //MRP璇勫 + FentityModel2.Add("FIsReturn", true); //鍒ら�� + FentityModel2.Add("FIsRelatedDefect", false); //涓嶈壇鍝佸叧鑱旀爣蹇� + Fentity2.Add(FentityModel2); + FentityModel.Add("FPolicyDetail", Fentity2); - // string path = HFilePath; - // FileInfo fi = new FileInfo(path); - // long len = fi.Length; - // byte[] buffer = new byte[len]; - // FileStream fs = new FileStream(path, FileMode.Open); - // fs.Read(buffer, 0, (int)len); - // //鏂囦欢IO娴� - // string a = Convert.ToBase64String(buffer); + JArray Fentity3 = new JArray(); + JObject FentityModel3 = new JObject(); + FentityModel3.Add("FDetailID", "0");// + FentityModel3.Add("FSrcBillType", "PUR_ReceiveBill"); //婧愬崟绫诲瀷 + FentityModel3.Add("FSrcBillNo", HSLBillNo.ToString()); //鏀舵枡閫氱煡鍗曞崟鍙� + FentityModel3.Add("FSrcInterId", HSLInterID.ToString()); //鏀舵枡閫氱煡鍗曚富ID + FentityModel3.Add("FSrcEntryId", HSLEntryID.ToString()); //鏀舵枡閫氱煡鍗曞瓙ID + FentityModel3.Add("FSrcEntrySeq", HSLSeQ.ToString()); //婧愬崟琛屽彿 + FentityModel3.Add("FOrderType", new JObject() { ["FID"] = "PUR_PurchaseOrder" }); // 璁㈠崟绫诲瀷 + FentityModel3.Add("FOrderBillNo", HSourceBillNo.ToString()); //璁㈠崟鍗曞彿 + FentityModel3.Add("FOrderId", HSourceInterID.ToString()); //璁㈠崟涓籌D + FentityModel3.Add("FOrderEntryId", HSourceEntryID.ToString()); //璁㈠崟瀛怚D + FentityModel3.Add("FOrderEntrySeq", HSeQ.ToString()); //璁㈠崟琛屽彿 + Fentity3.Add(FentityModel3); + FentityModel.Add("FReferDetail", Fentity3); - // //淇濆瓨 - // oCN.BeginTran(); - // //鐢熶骇姹囨姤鍗曚富琛� - // oCN.RunProc("Insert Into QC_POStockInCheckBillMain " + - // "(HBillType,HBillSubType,HInterID,HBillNo,HDate,HMaker,HMakeDate,HBillStatus,HChecker,HCheckDate" + - // ",HYear,HPeriod,HRemark,HSupID,HMaterID" + - // ",HInstockQty,HCheckQty,HRightQty,HBadQty,HFirstCheckEmp" + - // ",HCheckerResult,HSteelStoveNo,HSteelCompReport,HAspect,HSize" + - // ") " + - // " values('7503','7503'," + HInterID.ToString() + ",'" + HBillNo + "',getdate(),'" + user + "',getdate(),2,'" + user + "',getdate()" + - // ",DATENAME(YEAR,GETDATE()),0,''," + HSupID.ToString() + "," + HMaterID.ToString() + - // ",'" + HCheckQty.ToString() + "','" + HCheckQty.ToString() + "','" + HRightQty.ToString() + "','" + HBadQty.ToString() + "','" + HKeeperID.ToString() + "'" + - // ",'" + HCheckResult.ToString() + "','', '','',''" + - // ") "); - // //鐢熶骇姹囨姤鍗曞瓙琛� - // oCN.RunProc("Insert into QC_POStockInCheckBillSub " + - // " (HInterID,HEntryID,HCloseMan,HCloseType" + - // ",HRemark,HSourceInterID,HSourceEntryID,HSourceBillNo,HSourceBillType" + - // ",HRelationQty,HRelationMoney,HQCCheckClassID,HQCCheckItemID,HQCStd," + - // "HResult,HQCRelValue,HProcCheckEmp,HProcCheckTime" + - // ") values(" - // + HInterID.ToString() + ",1,'',''" + - // ",''," + HSourceInterID.ToString() + "," + HSourceEntryID.ToString() + ",'" + HSourceBillNo.ToString() + "','" + HSourceBillType.ToString() + "'" + - // ",0,0,0,0,''" + - // ",'" + HCheckResult.ToString() + "','" + HCheckResult.ToString() + "','" + HKeeperID.ToString() + "',getdate()" + - // ") "); - // //鍚屾閲戣澏 - // //璁块棶閲戣澏 - // var loginRet = InvokeHelper.Login(); - // var isSuccess = JObject.Parse(loginRet)["LoginResultType"].Value<int>(); - // if (isSuccess == 0) - // { - // objJsonResult.code = "0"; - // objJsonResult.count = 0; - // objJsonResult.Message = "鎿嶄綔澶辫触,閲戣澏璐﹀彿鐧诲綍寮傚父銆�" + loginRet; - // objJsonResult.data = null; - // return objJsonResult; - // } - - - // JObject model = new JObject(); - // model.Add("FBillTypeID", new JObject() { ["Fnumber"] = "JYD001_SYS" }); //鍗曟嵁绫诲瀷 鏉ユ枡妫�楠屽崟JYD001_SYS - // model.Add("FBusinessType", "1"); //涓氬姟绫诲瀷 - // model.Add("FDate", DateTime.Now.ToString("yyyy-MM-dd")); //鍗曟嵁鏃ユ湡 - // model.Add("FInspectOrgId", new JObject() { ["Fnumber"] = HZJOrgNumber.ToString() }); //璐ㄦ缁勭粐 - // model.Add("FSourceOrgId", new JObject() { ["Fnumber"] = HZJOrgNumber.ToString() }); //鏉ユ簮缁勭粐 - // model.Add("FISSYNCED", "false");// 鏄惁宸插悓姝� - // model.Add("F_PGKJ_Date", DateTime.Now.ToString("yyyy-MM-dd"));// 鎶ユ鏃ユ湡 - // model.Add("FBillNo", HBillNo); - - // JArray Fentity = new JArray(); - // JObject FentityModel = new JObject(); - // FentityModel.Add("FMaterialId", new JObject() { ["Fnumber"] = HMaterNumber.ToString() });// 鐗╂枡鍐呯爜 - // FentityModel.Add("FUnitID", new JObject() { ["Fnumber"] = HUnitNumber.ToString() });//璁¢噺鍗曚綅鍐呯爜 - // FentityModel.Add("FInspectQty", HCheckQty.ToString());// 妫�楠屾暟閲� - // FentityModel.Add("FQualifiedQty", HRightQty.ToString());// 鍚堟牸鏁伴噺 - // FentityModel.Add("FUnqualifiedQty", HBadQty.ToString());// 涓嶅悎鏍兼暟閲� - // FentityModel.Add("FInspectResult", HCheckResult.ToString());// 妫�楠岀粨鏋� - // FentityModel.Add("FQCStatus", "1");// 璐ㄦ鐘舵�� - // FentityModel.Add("FIsRelated", false);// 涓嶈壇鍝佸叧鑱旀爣蹇� - // FentityModel.Add("FSrcBillType0", "PUR_ReceiveBill");// 婧愬崟绫诲瀷 - // FentityModel.Add("FBaseUnitId", new JObject() { ["Fnumber"] = HUnitNumber.ToString() });//鍩烘湰鍗曚綅 - // FentityModel.Add("FBaseInspectQty", HCheckQty.ToString());//鍩烘湰鍗曚綅妫�楠屾暟閲� - // FentityModel.Add("FSupplierId", new JObject() { ["Fnumber"] = HSupNumber.ToString() }); // 渚涘簲鍟� - // //FentityModel.Add("FStockId", new JObject() { ["Fnumber"] = HWHNumber.ToString() }); // 浠撳簱 - // FentityModel.Add("FInspectTimes","1"); // 妫�楠屾鏁� - // FentityModel.Add("FTimeUnit","24");//鏃堕棿鍗曚綅 - // FentityModel.Add("FSAMPLEDAMAGEBEARER","2");//鏍锋湰鐮村潖鎵挎媴鏂� - // FentityModel.Add("FISFIRSTINSPECT", false);//棣栨 - // FentityModel.Add("FBaseQualifiedQty", HRightQty.ToString());//鍩烘湰鍗曚綅鍚堟牸鏁� - // FentityModel.Add("FBaseAcceptQty", HRightQty.ToString());//鍩烘湰鍗曚綅鎺ユ敹鏁� - // FentityModel.Add("FCurrency", new JObject() { ["Fnumber"] = "PRE001" });//甯佸埆 - // FentityModel.Add("FIsSplitRow ", false);// 鏄惁鎷嗗垎琛� - - // JArray Fentity2 = new JArray(); - // JObject FentityModel2 = new JObject(); - // FentityModel2.Add("FPolicyMaterialId", new JObject() { ["Fnumber"] = HMaterNumber.ToString() });// 鐗╂枡鍐呯爜 - // FentityModel2.Add("FPolicyStatus", "1"); //鐘舵�� - // FentityModel2.Add("FPolicyQty", HRightQty.ToString()); //鏁伴噺 - // FentityModel2.Add("FBasePolicyQty", HRightQty.ToString()); //鍩烘湰鍗曚綅鏁伴噺 - // FentityModel2.Add("FUsePolicy", HUseResult.ToString()); //浣跨敤鍐崇瓥 - // FentityModel2.Add("FIsCheck", false); //鏄惁鎶芥 - // FentityModel2.Add("FIsDefectProcess", false); //涓嶈壇澶勭悊 - // FentityModel2.Add("FCanSale", false); //鍙攢鍞� - // FentityModel2.Add("FIsMRBReview", false); //MRP璇勫 - // FentityModel2.Add("FIsReturn", true); //鍒ら�� - // FentityModel2.Add("FIsRelatedDefect", false); //涓嶈壇鍝佸叧鑱旀爣蹇� - // Fentity2.Add(FentityModel2); - // FentityModel.Add("FPolicyDetail", Fentity2); + JArray Fentity4 = new JArray(); + JObject FentityModel4 = new JObject(); + FentityModel4.Add("FEntity_Link_FRuleId", "QM_PURReceive2Inspect"); //鍗曟嵁杞崲瑙勫垯 + FentityModel4.Add("FEntity_Link_FSTableName", "T_PUR_RECEIVEENTRY"); //鏀舵枡閫氱煡鍗曞瓙琛� + FentityModel4.Add("FEntity_Link_FSBillId", HSLInterID.ToString()); //鏀舵枡閫氱煡鍗曚富鍐呯爜 + FentityModel4.Add("FEntity_Link_FSId", HSLEntryID.ToString()); //鏀舵枡閫氱煡鍗曞瓙鍐呯爜 + FentityModel4.Add("FEntity_Link_FBaseAcceptQty", HRightQty.ToString()); // + FentityModel4.Add("FEntity_Link_FBaseAcceptQtyOld", HRightQty.ToString()); // + FentityModel4.Add("FEntity_Link_FBaseInspectQtyOld", HRightQty.ToString()); // + FentityModel4.Add("FEntity_Link_FInspectQtyOld", HRightQty.ToString()); // + Fentity4.Add(FentityModel4); + FentityModel.Add("FEntity_Link", Fentity4); - // JArray Fentity3 = new JArray(); - // JObject FentityModel3 = new JObject(); - // FentityModel3.Add("FDetailID", "0");// - // FentityModel3.Add("FSrcBillType", "PUR_ReceiveBill"); //婧愬崟绫诲瀷 - // FentityModel3.Add("FSrcBillNo", HSLBillNo.ToString()); //鏀舵枡閫氱煡鍗曞崟鍙� - // FentityModel3.Add("FSrcInterId", HSLInterID.ToString()); //鏀舵枡閫氱煡鍗曚富ID - // FentityModel3.Add("FSrcEntryId",HSLEntryID.ToString()); //鏀舵枡閫氱煡鍗曞瓙ID - // FentityModel3.Add("FSrcEntrySeq", HSLSeQ.ToString()); //婧愬崟琛屽彿 - // FentityModel3.Add("FOrderType", new JObject() { ["FID"] = "PUR_PurchaseOrder" }); // 璁㈠崟绫诲瀷 - // FentityModel3.Add("FOrderBillNo", HSourceBillNo.ToString()); //璁㈠崟鍗曞彿 - // FentityModel3.Add("FOrderId", HSourceInterID.ToString()); //璁㈠崟涓籌D - // FentityModel3.Add("FOrderEntryId", HSourceEntryID.ToString()); //璁㈠崟瀛怚D - // FentityModel3.Add("FOrderEntrySeq", HSeQ.ToString()); //璁㈠崟琛屽彿 - // Fentity3.Add(FentityModel3); - // FentityModel.Add("FReferDetail", Fentity3); + Fentity.Add(FentityModel); + model.Add("FEntity", Fentity); //鏄庣粏淇℃伅 + JObject jsonRoot = new JObject() + { + ["Creator"] = "", + ["NeedUpDateFields"] = new JArray(), + ["NeedReturnFields"] = new JArray(), + ["IsDeleteEntry"] = "false", + ["SubSystemId"] = "", + ["IsVerifyBaseDataField"] = "false", + //["IsAutoSubmitAndAudit"] = true,//鑷姩璋冪敤鎻愪氦鍜屽鏍稿姛鑳� + ["Model"] = model + }; + string result = InvokeHelper.Save("QM_InspectBill", JsonConvert.SerializeObject(jsonRoot));//淇濆瓨 + //鍒ゆ柇淇濆瓨鏄惁鎴愬姛 + if (JObject.Parse(result)["Result"]["ResponseStatus"]["IsSuccess"].ToString().ToUpper() != "TRUE") + { + LogService.Write("鏉ユ枡妫�楠屽崟淇濆瓨閿欒jsonRoot:" + jsonRoot); + oCN.RollBack(); + objJsonResult.code = "0"; + objJsonResult.count = 0; + objJsonResult.Message = $"鏉ユ枡妫�楠屽崟鍚屾閲戣澏浜戝け璐ワ紒鍗曞彿:{HBillNo.ToString()}" + 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, + }; - // JArray Fentity4 = new JArray(); - // JObject FentityModel4 = new JObject(); - // FentityModel4.Add("FEntity_Link_FRuleId", "QM_PURReceive2Inspect"); //鍗曟嵁杞崲瑙勫垯 - // FentityModel4.Add("FEntity_Link_FSTableName", "T_PUR_RECEIVEENTRY"); //鏀舵枡閫氱煡鍗曞瓙琛� - // FentityModel4.Add("FEntity_Link_FSBillId", HSLInterID.ToString()); //鏀舵枡閫氱煡鍗曚富鍐呯爜 - // FentityModel4.Add("FEntity_Link_FSId", HSLEntryID.ToString()); //鏀舵枡閫氱煡鍗曞瓙鍐呯爜 - // FentityModel4.Add("FEntity_Link_FBaseAcceptQty", HRightQty.ToString()); // - // FentityModel4.Add("FEntity_Link_FBaseAcceptQtyOld", HRightQty.ToString()); // - // FentityModel4.Add("FEntity_Link_FBaseInspectQtyOld", HRightQty.ToString()); // - // FentityModel4.Add("FEntity_Link_FInspectQtyOld", HRightQty.ToString()); // - // Fentity4.Add(FentityModel4); - // FentityModel.Add("FEntity_Link", Fentity4); + K3CloudApiClient client = new K3CloudApiClient("http://47.96.97.237/k3cloud"); + // K3CloudApiClient client = new K3CloudApiClient("http://192.168.80.90/k3cloud/"); - // Fentity.Add(FentityModel); - // model.Add("FEntity", Fentity); //鏄庣粏淇℃伅 - // JObject jsonRoot = new JObject() - // { - // ["Creator"] = "", - // ["NeedUpDateFields"] = new JArray(), - // ["NeedReturnFields"] = new JArray(), - // ["IsDeleteEntry"] = "false", - // ["SubSystemId"] = "", - // ["IsVerifyBaseDataField"] = "false", - // //["IsAutoSubmitAndAudit"] = true,//鑷姩璋冪敤鎻愪氦鍜屽鏍稿姛鑳� - // ["Model"] = model - // }; + result1 = InvokeHelper.Submit("QM_InspectBill", JsonConvert.SerializeObject(json));//鎻愪氦 + result2 = InvokeHelper.Audit("QM_InspectBill", JsonConvert.SerializeObject(json));//鎻愪氦 + if (JObject.Parse(result1)["Result"]["ResponseStatus"]["IsSuccess"].ToString().ToUpper() != "TRUE") + { + oCN.RollBack(); + objJsonResult.code = "0"; + objJsonResult.count = 0; + objJsonResult.Message = $"鏉ユ枡妫�楠屽崟鍙凤細{fBillNo}锛屾彁浜ゅけ璐�" + result; + objJsonResult.data = null; + return objJsonResult; + } + else + { + string jsonStr = "{" + + " \"FileName\":\"" + HFileName + "\"," + + " \"FormId\":\"QM_InspectBill\"," + + " \"IsLast\":\"true\"," + + " \"InterId\":\"" + HInterID + "\"," + + " \"BillNO\":\"" + HBillNo + "\"," + + " \"AliasFileName\":\"test\"," + + " \"SendByte\":\"" + a + "\"," + + "}"; - // string result = InvokeHelper.Save("QM_InspectBill", JsonConvert.SerializeObject(jsonRoot));//淇濆瓨 - // //鍒ゆ柇淇濆瓨鏄惁鎴愬姛 - // if (JObject.Parse(result)["Result"]["ResponseStatus"]["IsSuccess"].ToString().ToUpper() != "TRUE") - // { - // LogService.Write("鏉ユ枡妫�楠屽崟淇濆瓨閿欒jsonRoot:" + jsonRoot); - // oCN.RollBack(); - // objJsonResult.code = "0"; - // objJsonResult.count = 0; - // objJsonResult.Message = $"鏉ユ枡妫�楠屽崟鍚屾閲戣澏浜戝け璐ワ紒鍗曞彿:{HBillNo.ToString()}" + 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, - // }; + var ret = client.AttachmentUpload(jsonStr); + } - // K3CloudApiClient client = new K3CloudApiClient("http://192.168.80.90/k3cloud/"); + oCN.Commit(); + objJsonResult.code = "0"; + objJsonResult.count = 1; + objJsonResult.Message = "淇濆瓨鎴愬姛锛�"; + objJsonResult.data = 1; + return objJsonResult; + } + catch (Exception e) + { + oCN.RollBack(); + objJsonResult.code = "0"; + objJsonResult.count = 0; + objJsonResult.Message = "Exception锛�" + e.ToString(); + objJsonResult.data = null; + return objJsonResult; + } + } + - - - // result1 = InvokeHelper.Submit("QM_InspectBill", JsonConvert.SerializeObject(json));//鎻愪氦 - // result2 = InvokeHelper.Audit("QM_InspectBill", JsonConvert.SerializeObject(json));//鎻愪氦 - // if (JObject.Parse(result1)["Result"]["ResponseStatus"]["IsSuccess"].ToString().ToUpper() != "TRUE") - // { - - - - // oCN.RollBack(); - // objJsonResult.code = "0"; - // objJsonResult.count = 0; - // objJsonResult.Message = $"鏉ユ枡妫�楠屽崟鍙凤細{fBillNo}锛屾彁浜ゅけ璐�" + result; - // objJsonResult.data = null; - // return objJsonResult; - // } - // else - // { - // string jsonStr = "{" + - // " \"FileName\":\"" + HFileName + "\"," + - // " \"FormId\":\"QM_InspectBill\"," + - // " \"IsLast\":\"true\"," + - // " \"InterId\":\"" + HInterID + "\"," + - // " \"BillNO\":\"" + HBillNo + "\"," + - // " \"AliasFileName\":\"test\"," + - // " \"SendByte\":\"" + a + "\"," + - // "}"; - - // var ret = client.AttachmentUpload(jsonStr); - // } - - // oCN.Commit(); - // objJsonResult.code = "0"; - // objJsonResult.count = 1; - // objJsonResult.Message = "淇濆瓨鎴愬姛锛�"; - // objJsonResult.data = 1; - // return objJsonResult; - // } - // catch (Exception e) - // { - // oCN.RollBack(); - // objJsonResult.code = "0"; - // objJsonResult.count = 0; - // objJsonResult.Message = "Exception锛�" + e.ToString(); - // objJsonResult.data = null; - // return objJsonResult; - // } - //} - //#endregion @@ -1468,7 +1467,8 @@ // return objJsonResult; // } //} - #endregion + + diff --git "a/WebAPI/Controllers/\347\224\237\344\272\247\347\256\241\347\220\206/\347\224\237\344\272\247\344\273\273\345\212\241\345\215\225/Sc_ICMOBillController.cs" "b/WebAPI/Controllers/\347\224\237\344\272\247\347\256\241\347\220\206/\347\224\237\344\272\247\344\273\273\345\212\241\345\215\225/Sc_ICMOBillController.cs" index 8fdcc66..234962a 100644 --- "a/WebAPI/Controllers/\347\224\237\344\272\247\347\256\241\347\220\206/\347\224\237\344\272\247\344\273\273\345\212\241\345\215\225/Sc_ICMOBillController.cs" +++ "b/WebAPI/Controllers/\347\224\237\344\272\247\347\256\241\347\220\206/\347\224\237\344\272\247\344\273\273\345\212\241\345\215\225/Sc_ICMOBillController.cs" @@ -9,6 +9,7 @@ using System.Data; using System.Data.SqlClient; using System.Web.Http; +using System.Windows.Forms; using WebAPI.Models; namespace WebAPI.Controllers @@ -412,6 +413,7 @@ int OperationType = int.Parse(sArray[1].ToString()); // 鏁版嵁绫诲瀷 1娣诲姞 3淇敼 string user = sArray[2].ToString(); int HEntryID = int.Parse(sArray[3].ToString()); + string HComputerName = SystemInformation.ComputerName; //璁惧鍚嶇О try { @@ -461,6 +463,10 @@ ",'" + HSeOrderBillNo + "'," + HSeOrderInterID + "," + HSeOrderEntryID + "," + HEmpID + "," + HCusID + "," + HCenterID + ",0,0,0,0," + HBomID + ",'',''" + ",'"+ HIsStockQty + "','"+ HRemark3 + "') "); + + LogService.Write("鐢ㄦ埛:" + user + ",鏃ユ湡:" + DateTime.Now + ",鏂板鐢熶骇璁㈠崟鍗曟嵁:" + HBillNo); + oCN.RunProc("Insert into System_log (GeginDate, userid, WorkstationName, WorkList, SystemName, NetuserName, State) select GETDATE(),'" + user + "','" + HComputerName + "','" + "鏂板鐢熶骇璁㈠崟鍗曟嵁锛�" + HBillNo + "','LMES-鐢熶骇璁㈠崟妯″潡','" + DBUtility.ClsPub.IPAddress + "','鏂板鍗曟嵁'", ref DBUtility.ClsPub.sExeReturnInfo); + } else if (OperationType == 3 || ds.Tables[0].Rows.Count != 0) { @@ -481,6 +487,9 @@ //鍒犻櫎瀛愯〃 oCN.RunProc("delete from Sc_ICMOBillSub where HInterID='" + HInterID + "' and HEntryID='" + HEntryID + "'"); + + LogService.Write("鐢ㄦ埛:" + user + ",鏃ユ湡:" + DateTime.Now + ",淇敼鐢熶骇璁㈠崟鍗曟嵁:" + HBillNo); + oCN.RunProc("Insert into System_log (GeginDate, userid, WorkstationName, WorkList, SystemName, NetuserName, State) select GETDATE(),'" + user + "','" + HComputerName + "','" + "淇敼鐢熶骇璁㈠崟鍗曟嵁锛�" + HBillNo + "','LMES-鐢熶骇璁㈠崟妯″潡','" + DBUtility.ClsPub.IPAddress + "','淇敼鍗曟嵁'", ref DBUtility.ClsPub.sExeReturnInfo); } //淇濆瓨瀛愯〃 objJsonResult = AddBillSub_NoTable(msg3, HInterID, OperationType, HEntryID); @@ -820,6 +829,8 @@ { try { + string HComputerName = SystemInformation.ComputerName; //璁惧鍚嶇О + //鍒ゆ柇鏄惁鏈夊垹闄ゆ潈闄� if (!DBUtility.ClsPub.Security_Log("Sc_ICMOBill_Drop", 1, false, user)) { @@ -865,8 +876,6 @@ } } - - if (int.Parse(ds.Tables[0].Rows[0]["HBillStatus"].ToString()) > 1) { objJsonResult.code = "0"; @@ -876,8 +885,47 @@ return objJsonResult; ; } + var DataSet = oCN.RunProcReturn("select * from Sc_ProcessExchangeBillMain where HICMOBillNo='" + ds.Tables[0].Rows[0]["HBillNo"].ToString() +"'", "Sc_ProcessExchangeBillMain"); + + if (DataSet.Tables[0].Rows.Count > 0) + { + objJsonResult.code = "0"; + objJsonResult.count = 0; + objJsonResult.Message = "鍗曟嵁宸蹭笅鎺ㄥ伐搴忔祦杞崱,涓嶅厑璁稿垹闄わ紒"; + objJsonResult.data = null; + return objJsonResult; ; + } + + DataSet = oCN.RunProcReturn("select * from h_v_IF_ProductInBillList where 婧愬崟鍗曞彿='" + ds.Tables[0].Rows[0]["HBillNo"].ToString() + "'", "h_v_IF_ProductInBillList"); + + if (DataSet.Tables[0].Rows.Count > 0) + { + objJsonResult.code = "0"; + objJsonResult.count = 0; + objJsonResult.Message = "鍗曟嵁宸蹭笅鎺ㄧ敓浜у叆搴撳崟,涓嶅厑璁稿垹闄わ紒"; + objJsonResult.data = null; + return objJsonResult; ; + } + + DataSet = oCN.RunProcReturn("select * from h_v_IF_MateOutBillList where 婧愬崟鍗曞彿='" + ds.Tables[0].Rows[0]["HBillNo"].ToString() + "'", "h_v_IF_MateOutBillList"); + + if (DataSet.Tables[0].Rows.Count > 0) + { + objJsonResult.code = "0"; + objJsonResult.count = 0; + objJsonResult.Message = "鍗曟嵁宸蹭笅鎺ㄧ敓浜ч鏂欏崟,涓嶅厑璁稿垹闄わ紒"; + objJsonResult.data = null; + return objJsonResult; ; + } + + + oCN.RunProc("delete from Sc_ICMOBillMain where HInterID=" + HInterID); oCN.RunProc("delete from Sc_ICMOBillSub where HInterID=" + HInterID); + + LogService.Write("鐢ㄦ埛:" + user + ",鏃ユ湡:" + DateTime.Now + ",鍒犻櫎鐢熶骇璁㈠崟鍗曟嵁:" + ds.Tables[0].Rows[0]["HBillNo"].ToString()); + oCN.RunProc("Insert into System_log (GeginDate, userid, WorkstationName, WorkList, SystemName, NetuserName, State) select GETDATE(),'" + user + "','" + HComputerName + "','" + "鍒犻櫎鐢熶骇璁㈠崟鍗曟嵁锛�" + ds.Tables[0].Rows[0]["HBillNo"].ToString() + "','LMES-鐢熶骇璁㈠崟妯″潡','" + DBUtility.ClsPub.IPAddress + "','鍒犻櫎鍗曟嵁'", ref DBUtility.ClsPub.sExeReturnInfo); + oCN.Commit();//鎻愪氦浜嬪姟 objJsonResult.code = "0"; objJsonResult.count = 1; diff --git a/WebAPI/DLL/ClsGy_Source_Ctl.cs b/WebAPI/DLL/ClsGy_Source_Ctl.cs index 428ff35..333f6f6 100644 --- a/WebAPI/DLL/ClsGy_Source_Ctl.cs +++ b/WebAPI/DLL/ClsGy_Source_Ctl.cs @@ -22,12 +22,12 @@ " (HNumber,HName,HHelpCode,HShortNumber,HParentID" + ",HType,HRelationID,HCenterID,HEquipFileID_K3,HDeptID" + ",HLevel,HEndFlag,HStopflag,HRemark,HProcID,HOverTimes " + - ",HWorkTimes,HMaxWorkTimes,HMinAdd,HClassCount,HGroupID,HGroupK3ID,HUSEORGID,HMacAddr)" + + ",HWorkTimes,HMaxWorkTimes,HMinAdd,HClassCount,HGroupID,HGroupK3ID,HUSEORGID,HMacAddr,HEmpID)" + " Values('" + oModel.HNumber + "','" + oModel.HName + "','" + oModel.HHelpCode + "','" + oModel.HShortNumber + "'," + oModel.HParentID.ToString() + ",'" + oModel.HType + "'," + oModel.HRelationID.ToString() + "," + oModel.HCenterID.ToString() + "," + oModel.HEquipFileID_K3.ToString() + "," + oModel.HDeptID.ToString() + "," + oModel.HLevel.ToString() + "," + Convert.ToString(oModel.HEndFlag ? 1 : 0) + "," + Convert.ToString(oModel.HStopflag ? 1 : 0) + ",'" + oModel.HRemark + "'," + oModel.HProcID + "," + oModel.HOverTimes + "," + oModel.HWorkTimes + "," + oModel.HMaxWorkTimes + - "," + oModel.HMinAdd + "," + oModel.HClassCount + "," + oModel.HGroupID.ToString() + "," + oModel.HGroupK3ID.ToString() + "," + oModel.HUSEORGID + ",'" + oModel.HMacAddr + "')", ref DBUtility.ClsPub.sExeReturnInfo); + "," + oModel.HMinAdd + "," + oModel.HClassCount + "," + oModel.HGroupID.ToString() + "," + oModel.HGroupK3ID.ToString() + "," + oModel.HUSEORGID + ",'" + oModel.HMacAddr + "',"+oModel.HEmpID + ")", ref DBUtility.ClsPub.sExeReturnInfo); //淇敼涓婄骇涓洪潪鏈骇浠g爜 oCn.RunProc("Update " + MvarItemKey + " set HEndflag=0 where HItemID=" + oModel.HParentID, ref DBUtility.ClsPub.sExeReturnInfo); oCn.Commit(); @@ -58,6 +58,7 @@ ",HRelationID=" + oModel.HRelationID.ToString() + ",HCenterID=" + oModel.HCenterID.ToString() + ",HType='" + oModel.HType + "'" + + ",HEmpID='" + oModel.HEmpID + "'" + ",HOverTimes=" + oModel.HOverTimes + ",HWorkTimes=" + oModel.HWorkTimes + ",HMaxWorkTimes=" + oModel.HMaxWorkTimes + diff --git a/WebAPI/Vlog/webapi20220325.txt b/WebAPI/Vlog/webapi20220325.txt deleted file mode 100644 index 0436e2f..0000000 --- a/WebAPI/Vlog/webapi20220325.txt +++ /dev/null @@ -1,27 +0,0 @@ -2022/3/25 11:03:00 and CONVERT(varchar(100),鏃ユ湡, 23) >= '2022-02-23' and CONVERT(varchar(100),鏃ユ湡, 23) <= '2022-03-25';鎵嬫満浜嬩笟閮� - -2022/3/25 11:04:01 and CONVERT(varchar(100),鏃ユ湡, 23) >= '2021-10-01' and CONVERT(varchar(100),鏃ユ湡, 23) <= '2022-03-25' and 閮ㄩ棬鍚嶇О like '%1%' and CONVERT(varchar(100),鏃ユ湡, 23) >= '2021-10-01' and CONVERT(varchar(100),鏃ユ湡, 23) <= '2022-03-25';鎵嬫満浜嬩笟閮� - -2022/3/25 11:04:10 and CONVERT(varchar(100),鏃ユ湡, 23) >= '2021-10-01' and CONVERT(varchar(100),鏃ユ湡, 23) <= '2022-03-25' and CONVERT(varchar(100),鏃ユ湡, 23) >= '2021-10-01' and CONVERT(varchar(100),鏃ユ湡, 23) <= '2022-03-25';鎵嬫満浜嬩笟閮� - -2022/3/25 16:39:37 and CONVERT(varchar(100),鏃ユ湡, 23) >= '2022-02-23' and CONVERT(varchar(100),鏃ユ湡, 23) <= '2022-03-25';鎵嬫満浜嬩笟閮� - -2022/3/25 16:39:46 and CONVERT(varchar(100),鏃ユ湡, 23) >= '2022-02-23' and CONVERT(varchar(100),鏃ユ湡, 23) <= '2022-03-25';鎵嬫満浜嬩笟閮� - -2022/3/25 16:40:06 and CONVERT(varchar(100),鏃ユ湡, 23) >= '2022-02-23' and CONVERT(varchar(100),鏃ユ湡, 23) <= '2022-03-25';钃濇捣瀹炰笟闆嗗洟 - -2022/3/25 16:40:26 and CONVERT(varchar(100),鏃ユ湡, 23) >= '2022-02-23' and CONVERT(varchar(100),鏃ユ湡, 23) <= '2022-03-25' and 閮ㄩ棬 like '%1%' and CONVERT(varchar(100),鏃ユ湡, 23) >= '2022-02-23' and CONVERT(varchar(100),鏃ユ湡, 23) <= '2022-03-25';钃濇捣瀹炰笟闆嗗洟 - -2022/3/25 16:40:27 and CONVERT(varchar(100),鏃ユ湡, 23) >= '2022-02-23' and CONVERT(varchar(100),鏃ユ湡, 23) <= '2022-03-25';钃濇捣瀹炰笟闆嗗洟 - -2022/3/25 16:40:32 and CONVERT(varchar(100),鏃ユ湡, 23) >= '2022-02-23' and CONVERT(varchar(100),鏃ユ湡, 23) <= '2022-03-25' and 搴撳瓨缁勭粐 like '%1%' and CONVERT(varchar(100),鏃ユ湡, 23) >= '2022-02-23' and CONVERT(varchar(100),鏃ユ湡, 23) <= '2022-03-25';钃濇捣瀹炰笟闆嗗洟 - -2022/3/25 16:40:33 and CONVERT(varchar(100),鏃ユ湡, 23) >= '2022-02-23' and CONVERT(varchar(100),鏃ユ湡, 23) <= '2022-03-25';钃濇捣瀹炰笟闆嗗洟 - -2022/3/25 16:40:37 and CONVERT(varchar(100),鏃ユ湡, 23) >= '2022-02-23' and CONVERT(varchar(100),鏃ユ湡, 23) <= '2022-03-25' and 鐗╂枡浠g爜 like '%20204.0080%' and CONVERT(varchar(100),鏃ユ湡, 23) >= '2022-02-23' and CONVERT(varchar(100),鏃ユ湡, 23) <= '2022-03-25';钃濇捣瀹炰笟闆嗗洟 - -2022/3/25 16:40:39 and CONVERT(varchar(100),鏃ユ湡, 23) >= '2022-02-23' and CONVERT(varchar(100),鏃ユ湡, 23) <= '2022-03-25';钃濇捣瀹炰笟闆嗗洟 - -2022/3/25 16:40:48 and CONVERT(varchar(100),鏃ユ湡, 23) >= '2022-02-23' and CONVERT(varchar(100),鏃ユ湡, 23) <= '2022-03-25' and 妯″叿浠g爜 like '%PAK100.0420204.006900023%' and CONVERT(varchar(100),鏃ユ湡, 23) >= '2022-02-23' and CONVERT(varchar(100),鏃ユ湡, 23) <= '2022-03-25';钃濇捣瀹炰笟闆嗗洟 - -2022/3/25 16:40:49 and CONVERT(varchar(100),鏃ユ湡, 23) >= '2022-02-23' and CONVERT(varchar(100),鏃ユ湡, 23) <= '2022-03-25';钃濇捣瀹炰笟闆嗗洟 diff --git a/WebAPI/Vlog/webapi20220408.txt b/WebAPI/Vlog/webapi20220408.txt deleted file mode 100644 index 63a5f7f..0000000 --- a/WebAPI/Vlog/webapi20220408.txt +++ /dev/null @@ -1 +0,0 @@ -2022/4/8 15:19:03 and CONVERT(varchar(100),鏃ユ湡, 23) >= '2022-03-09' and CONVERT(varchar(100),鏃ユ湡, 23) <= '2022-04-08';鎵嬫満浜嬩笟閮� diff --git a/WebAPI/Vlog/webapi20220411.txt b/WebAPI/Vlog/webapi20220411.txt deleted file mode 100644 index b0eea4b..0000000 --- a/WebAPI/Vlog/webapi20220411.txt +++ /dev/null @@ -1,3 +0,0 @@ -2022/4/11 20:46:47 and CONVERT(varchar(100),鏃ユ湡, 23) >= '2022-03-12' and CONVERT(varchar(100),鏃ユ湡, 23) <= '2022-04-11';鎵嬫満浜嬩笟閮� - -2022/4/11 20:47:01 and CONVERT(varchar(100),鏃ユ湡, 23) >= '2021-03-05' and CONVERT(varchar(100),鏃ユ湡, 23) <= '2022-04-11' and CONVERT(varchar(100),鏃ユ湡, 23) >= '2021-03-05' and CONVERT(varchar(100),鏃ユ湡, 23) <= '2022-04-11';鎵嬫満浜嬩笟閮� diff --git a/WebAPI/Vlog/webapi20220413.txt b/WebAPI/Vlog/webapi20220413.txt deleted file mode 100644 index 615c0f8..0000000 --- a/WebAPI/Vlog/webapi20220413.txt +++ /dev/null @@ -1,11 +0,0 @@ -2022/4/13 12:13:57 鎵ц浜�0 - -2022/4/13 12:13:57 鎵ц浜� - -2022/4/13 12:13:57 鎵ц浜�1 - -2022/4/13 12:18:17 鎵ц浜�0 - -2022/4/13 12:18:17 鎵ц浜� - -2022/4/13 12:18:17 鎵ц浜�1 diff --git a/WebAPI/Vlog/webapi20220422.txt b/WebAPI/Vlog/webapi20220422.txt deleted file mode 100644 index 018032f..0000000 --- a/WebAPI/Vlog/webapi20220422.txt +++ /dev/null @@ -1,3 +0,0 @@ -2022/4/22 17:00:42 Json:{ Numbers = MO000037, Ids = 100042, PkEntryIds = 100062 } - -2022/4/22 17:00:42 鐢熶骇璁㈠崟 鎵ц锛宱pNumber锛� ToStart,content:{"Numbers":"MO000037","Ids":"100042","PkEntryIds":"100062"} diff --git a/WebAPI/Vlog/webapi20220512.txt b/WebAPI/Vlog/webapi20220512.txt deleted file mode 100644 index f431049..0000000 --- a/WebAPI/Vlog/webapi20220512.txt +++ /dev/null @@ -1 +0,0 @@ -2022/5/12 14:49:13 and CONVERT(varchar(100),鏃ユ湡, 23) >= '2022-04-12' and CONVERT(varchar(100),鏃ユ湡, 23) <= '2022-05-12';钃濇捣瀹炰笟闆嗗洟 diff --git a/WebAPI/Vlog/webapi20220513.txt b/WebAPI/Vlog/webapi20220513.txt deleted file mode 100644 index 7aac2ff..0000000 --- a/WebAPI/Vlog/webapi20220513.txt +++ /dev/null @@ -1,3 +0,0 @@ -2022/5/13 14:24:59 and CONVERT(varchar(100),鏃ユ湡, 23) >= '2022-04-13' and CONVERT(varchar(100),鏃ユ湡, 23) <= '2022-05-13';鎵嬫満浜嬩笟閮� - -2022/5/13 14:28:25 and CONVERT(varchar(100),鏃ユ湡, 23) >= '2022-04-13' and CONVERT(varchar(100),鏃ユ湡, 23) <= '2022-05-13';鎵嬫満浜嬩笟閮� diff --git a/WebAPI/Vlog/webapi20220517.txt b/WebAPI/Vlog/webapi20220517.txt deleted file mode 100644 index 80f3bce..0000000 --- a/WebAPI/Vlog/webapi20220517.txt +++ /dev/null @@ -1 +0,0 @@ -2022/5/17 16:32:45 鐢熶骇璁㈠崟 鎵ц锛宱pNumber锛� ToStart,content:{"Numbers":"MO000037","Ids":"100042","PkEntryIds":"100062"} diff --git a/WebAPI/Vlog/webapi20220623.txt b/WebAPI/Vlog/webapi20220623.txt deleted file mode 100644 index 2690fc8..0000000 --- a/WebAPI/Vlog/webapi20220623.txt +++ /dev/null @@ -1 +0,0 @@ -2022/6/23 16:10:28 and CONVERT(varchar(100),鏃ユ湡, 23) >= '2022-05-24' and CONVERT(varchar(100),鏃ユ湡, 23) <= '2022-06-23';钃濇捣瀹炰笟闆嗗洟 diff --git a/WebAPI/Vlog/webapi20220701.txt b/WebAPI/Vlog/webapi20220701.txt deleted file mode 100644 index 66ff91e..0000000 --- a/WebAPI/Vlog/webapi20220701.txt +++ /dev/null @@ -1 +0,0 @@ -2022/7/1 13:44:41 and CONVERT(varchar(100),鏃ユ湡, 23) >= '2022-06-01' and CONVERT(varchar(100),鏃ユ湡, 23) <= '2022-07-01';钃濇捣瀹炰笟闆嗗洟 diff --git a/WebAPI/Vlog/webapi20220708.txt b/WebAPI/Vlog/webapi20220708.txt deleted file mode 100644 index 138366d..0000000 --- a/WebAPI/Vlog/webapi20220708.txt +++ /dev/null @@ -1,3 +0,0 @@ -2022/7/8 18:58:22 and CONVERT(varchar(100),鏃ユ湡, 23) >= '2022-06-08' and CONVERT(varchar(100),鏃ユ湡, 23) <= '2022-07-08';钃濇捣瀹炰笟闆嗗洟 - -2022/7/8 19:37:32 and CONVERT(varchar(100),鏃ユ湡, 23) >= '2022-06-08' and CONVERT(varchar(100),鏃ユ湡, 23) <= '2022-07-08';鎵嬫満浜嬩笟閮� diff --git a/WebAPI/Vlog/webapi20220714.txt b/WebAPI/Vlog/webapi20220714.txt deleted file mode 100644 index 430a5d4..0000000 --- a/WebAPI/Vlog/webapi20220714.txt +++ /dev/null @@ -1,5 +0,0 @@ -2022/7/14 10:30:35 and CONVERT(varchar(100),鏃ユ湡, 23) >= '2022-06-14' and CONVERT(varchar(100),鏃ユ湡, 23) <= '2022-07-14';鎵嬫満浜嬩笟閮� - -2022/7/14 10:41:44 and CONVERT(varchar(100),鏃ユ湡, 23) >= '2022-06-14' and CONVERT(varchar(100),鏃ユ湡, 23) <= '2022-07-14';鎵嬫満浜嬩笟閮� - -2022/7/14 10:41:45 and CONVERT(varchar(100),鏃ユ湡, 23) >= '2022-06-14' and CONVERT(varchar(100),鏃ユ湡, 23) <= '2022-07-14';鎵嬫満浜嬩笟閮� diff --git a/WebAPI/Vlog/webapi20220805.txt b/WebAPI/Vlog/webapi20220805.txt deleted file mode 100644 index 9186f6f..0000000 --- a/WebAPI/Vlog/webapi20220805.txt +++ /dev/null @@ -1 +0,0 @@ -2022/8/5 17:52:29 and CONVERT(varchar(100),鏃ユ湡, 23) >= '2022-07-06' and CONVERT(varchar(100),鏃ユ湡, 23) <= '2022-08-05';鎵嬫満浜嬩笟閮� -- Gitblit v1.9.1