From 66350933608690dd01c29c2268c16a2b99835d97 Mon Sep 17 00:00:00 2001 From: zgq <519541279@qq.com> Date: 星期五, 02 七月 2021 14:28:12 +0800 Subject: [PATCH] Merge branch 'master' of http://101.37.171.70:10101/r/MESWMS-API --- WebAPI/Controllers/BLL/Xt_AccountPeriodController.cs | 155 ++ WebAPI/Models/BillType.cs | 42 WebAPI/Models/QC_OutCompCheckBillSub.cs | 29 WebAPI/Controllers/BaseSet/Gy_MaterialController.cs | 317 +++++ WebAPI/Controllers/BLL/Xt_BillTypeController.cs | 189 +++ WebAPI/Controllers/BaseSet/Gy_SupplierController.cs | 290 +++++ WebAPI/Models/EquipMent.cs | 36 WebAPI/Models/Supplier.cs | 77 + WebAPI/Models/QC_OutCompCheckBillMain.cs | 47 WebAPI/Models/QC_LastPieceCheckBillSub.cs | 32 WebAPI/Models/xtgnb.cs | 38 WebAPI/Models/Customer.cs | 103 + WebAPI/Models/QC_LastPieceCheckBillMain.cs | 65 + WebAPI/Controllers/Sc_MouldOtherInBillController.cs | 372 ++++++ WebAPI/Models/Xt_AccountPeriod.cs | 19 WebAPI/ListModels.cs | 26 WebAPI/Controllers/BLL/Xt_XtgnbController.cs | 173 ++ WebAPI/Controllers/BaseSet/Gy_CustomerController.cs | 436 +++++++ WebAPI/Models/Gy_Mould.cs | 67 + WebAPI/Controllers/SCGL/QC_LastPieceCheckBillController.cs | 173 ++ WebAPI/Models/Sc_MouldStockBillMain.cs | 51 WebAPI/Controllers/BLL/Xt_SystemParameterController.cs | 60 + WebAPI/Models/Gy_MouldSub.cs | 26 WebAPI/Models/Sc_MouldStockBillSub.cs | 71 + WebAPI/Models/SystemParameter.cs | 26 WebAPI/Controllers/BaseSet/Gy_EquipMentController.cs | 516 ++++++++ WebAPI/WebAPI.csproj | 17 27 files changed, 3,453 insertions(+), 0 deletions(-) diff --git a/WebAPI/Controllers/BLL/Xt_AccountPeriodController.cs b/WebAPI/Controllers/BLL/Xt_AccountPeriodController.cs index b0b9678..ce0b655 100644 --- a/WebAPI/Controllers/BLL/Xt_AccountPeriodController.cs +++ b/WebAPI/Controllers/BLL/Xt_AccountPeriodController.cs @@ -66,7 +66,162 @@ } } + /// <summary> + /// 淇敼鍗曟嵁-淇濆瓨鎸夐挳 + ///鍙傛暟锛歴tring sql銆� + ///杩斿洖鍊硷細object銆� + /// </summary> + [Route("Xt_AccountPeriod/AddBill1")] + [HttpPost] + public object AddBill1([FromBody] JObject oMain) + { + try + { + var _value = oMain["oMain"].ToString(); + string msg1 = _value.ToString(); + string[] sArray = msg1.Split(new string[] { ";" }, StringSplitOptions.RemoveEmptyEntries); + string msg2 = sArray[0].ToString(); + string msg3 = sArray[1].ToString(); + string msg4 = sArray[2].ToString(); + string msg5 = sArray[3].ToString(); + //鍙嶅簭鍒楀寲 + msg2 = "[" + msg2.ToString() + "]"; + List<Xt_AccountPeriod> list = Newtonsoft.Json.JsonConvert.DeserializeObject<List<Xt_AccountPeriod>>(msg2); + + long HItemID = list[0].id; + long HYear = list[0].HYear; + long HPeriod = list[0].HPeriod; + DateTime HBeginDate = list[0].HBeginDate; + DateTime HEndDate = list[0].HEndDate; + string HEndFlag = list[0].HEndFlag; + + + + //鑻AINDI閲嶅鍒欓噸鏂拌幏鍙� + oCN.BeginTran(); + //涓昏〃 + oCN.RunProc("Update Xt_AccountPeriod set " + + " HYear=" + HYear + + ",HPeriod=" + HPeriod + + ",HBeginDate='" + HBeginDate + "'" + + ",HEndDate='" + HEndDate + "'" + + ",HEndFlag= '" + HEndFlag + "' HYear=" + HYear + " and HPeriod=" + HPeriod, ref DBUtility.ClsPub.sExeReturnInfo); + //淇敼瀛愰」鐩唬鐮� + //oCN.RunProc("exec h_p_Gy_UpdateNumber Gy_Department,'" + HNumber + ".','" + this.HOldNumber + ".'", ref DBUtility.ClsPub.sExeReturnInfo); + //灏嗕笂绾� 涓洪潪鏈骇 + // + oCN.Commit(); + objJsonResult.code = "1"; + objJsonResult.count = 1; + objJsonResult.Message = "淇敼鍗曟嵁鎴愬姛锛�"; + //objJsonResult.data = null; + return objJsonResult; + } + catch (Exception e) + { + oCN.RollBack(); + objJsonResult.code = "0"; + objJsonResult.count = 0; + objJsonResult.Message = "Exception锛�" + e.Message; + objJsonResult.data = null; + return objJsonResult; + } + } + + + /// <summary> + /// 鏂板鍗曟嵁-淇濆瓨鎸夐挳 + ///鍙傛暟锛歴tring sql銆� + ///杩斿洖鍊硷細object銆� + /// </summary> + [Route("Xt_AccountPeriod/AddBill")] + [HttpPost] + public object AddBill([FromBody] JObject oMain) + { + try + { + var _value = oMain["oMain"].ToString(); + string msg1 = _value.ToString(); + //鍙嶅簭鍒楀寲 + msg1 = "[" + msg1.ToString() + "]"; + + + + List<Xt_AccountPeriod> list = Newtonsoft.Json.JsonConvert.DeserializeObject<List<Xt_AccountPeriod>>(msg1); + + long HYear = list[0].HYear; + long HPeriod = list[0].HPeriod; + DateTime HBeginDate = list[0].HBeginDate; + DateTime HEndDate = list[0].HEndDate; + string HEndFlag = list[0].HEndFlag; + + + + + + + + //鑻AINDI閲嶅鍒欓噸鏂拌幏鍙� + oCN.BeginTran(); + //涓昏〃 + oCN.RunProc("Insert Into Xt_AccountPeriod " + + "(HYear,HPeriod,HBeginDate,HEndDate" + + ",HEndFlag" + + ") " + + " values(" + HYear + "," + HPeriod + "," + HBeginDate + "," + HEndDate + + ",'" + HEndFlag + "'" + + ") "); + //淇敼涓婄骇涓洪潪鏈骇浠g爜 + oCN.Commit(); + objJsonResult.code = "1"; + objJsonResult.count = 1; + objJsonResult.Message = "鏂板鍗曟嵁鎴愬姛锛�"; + //objJsonResult.data = null; + return objJsonResult; + } + catch (Exception e) + { + oCN.RollBack(); + objJsonResult.code = "0"; + objJsonResult.count = 0; + objJsonResult.Message = "Exception锛�" + e.Message; + objJsonResult.data = null; + return objJsonResult; + } + } + + /// <summary> + /// 浼氳鏈熼棿鍒楄〃鍒犻櫎鎸夐挳 + ///鍙傛暟锛歴tring sql銆� + ///杩斿洖鍊硷細object銆� + /// </summary> + [Route("Xt_AccountPeriod/Delete_Json")] + [HttpGet] + public object Delete_Json(long HYaer,long HPeriod) + { + try + { + //鑻AINDI閲嶅鍒欓噸鏂拌幏鍙� + oCN.BeginTran(); + //涓昏〃 + oCN.RunProc("delete from Xt_AccountPeriod Where HYaer =" + HYaer + " and HPeriod=" + HPeriod, ref DBUtility.ClsPub.sExeReturnInfo); + 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 = "Exception锛�" + e.ToString(); + objJsonResult.data = null; + return objJsonResult; + } + } // } diff --git a/WebAPI/Controllers/BLL/Xt_BillTypeController.cs b/WebAPI/Controllers/BLL/Xt_BillTypeController.cs index da26d8d..e65305a 100644 --- a/WebAPI/Controllers/BLL/Xt_BillTypeController.cs +++ b/WebAPI/Controllers/BLL/Xt_BillTypeController.cs @@ -67,6 +67,195 @@ } + /// <summary> + /// 鍗曟嵁绫诲瀷鍒楄〃淇敼鏂规硶 + ///鍙傛暟锛歴tring sql銆� + ///杩斿洖鍊硷細object銆� + /// </summary> + [Route("Xt_BillType/xg")] + [HttpGet] + public object xg(long HInterID) + { + try + { + ds = oCN.RunProcReturn("select * from Xt_BillType where HItemID=" + HInterID, "Xt_BillType"); + + objJsonResult.code = "1"; + objJsonResult.count = 1; + objJsonResult.Message = ""; + objJsonResult.data = ds.Tables[0]; + return objJsonResult; + } + catch (Exception e) + { + objJsonResult.code = "0"; + objJsonResult.count = 0; + objJsonResult.Message = "Exception锛�" + e.ToString(); + objJsonResult.data = null; + return objJsonResult; + } + } + + /// <summary> + /// 鑾峰彇鏈�澶у熀纭�璧勬枡ID + ///鍙傛暟锛歴tring sql銆� + ///杩斿洖鍊硷細object銆� + /// </summary> + [Route("Xt_BillType/GetMAXBillID")] + [HttpGet] + public object GetMAXBillID() + { + try + { + ds = oCN.RunProcReturn("select max(hitemid)+1 hitemid from Xt_BillType", "Xt_BillType"); + + objJsonResult.code = "1"; + objJsonResult.count = 1; + objJsonResult.Message = ""; + objJsonResult.data = ds.Tables[0]; + return objJsonResult; + } + catch (Exception e) + { + objJsonResult.code = "0"; + objJsonResult.count = 0; + objJsonResult.Message = "Exception锛�" + e.ToString(); + objJsonResult.data = null; + return objJsonResult; + } + } + + /// <summary> + /// 淇敼鍗曟嵁-淇濆瓨鎸夐挳 + ///鍙傛暟锛歴tring sql銆� + ///杩斿洖鍊硷細object銆� + /// </summary> + [Route("Xt_BillType/AddBill1")] + [HttpPost] + public object AddBill1([FromBody] JObject oMain) + { + + try + { + var _value = oMain["oMain"].ToString(); + string msg1 = _value.ToString(); + string[] sArray = msg1.Split(new string[] { ";" }, StringSplitOptions.RemoveEmptyEntries); + string msg2 = sArray[0].ToString(); + string msg3 = sArray[1].ToString(); + string msg4 = sArray[2].ToString(); + string msg5 = sArray[3].ToString(); + //鍙嶅簭鍒楀寲 + msg2 = "[" + msg2.ToString() + "]"; + List<BillType> list = Newtonsoft.Json.JsonConvert.DeserializeObject<List<BillType>>(msg2); + + long HItemID = int.Parse(msg3); + string HNumber = list[0].HNumber; + string HName = list[0].HName; + string HTemplate = list[0].HTemplate; + string HHeadTable = list[0].HHeadTable; + string HEntryTable = list[0].HEntryTable; + string HViewName = list[0].HViewName; + string HRightName = list[0].HRightName; + + + + //鑻AINDI閲嶅鍒欓噸鏂拌幏鍙� + oCN.BeginTran(); + //涓昏〃 + oCN.RunProc("Update Xt_BillType set " + + " HNumber='" + HNumber + "'" + + ",HName='" + HName + "'" + + ",HTemplate='" + HTemplate + "'" + + ",HHeadTable='" + HHeadTable + "'" + + ",HEntryTable='" + HEntryTable + "'" + + ",HViewName='" + HViewName + "'" + + ",HRightName= '" + HRightName + "' Where HItemID=" + HItemID, ref DBUtility.ClsPub.sExeReturnInfo); + //淇敼瀛愰」鐩唬鐮� + //oCN.RunProc("exec h_p_Gy_UpdateNumber Gy_Department,'" + HNumber + ".','" + this.HOldNumber + ".'", ref DBUtility.ClsPub.sExeReturnInfo); + //灏嗕笂绾� 涓洪潪鏈骇 + // + oCN.Commit(); + objJsonResult.code = "1"; + objJsonResult.count = 1; + objJsonResult.Message = "淇敼鍗曟嵁鎴愬姛锛�"; + //objJsonResult.data = null; + return objJsonResult; + } + catch (Exception e) + { + oCN.RollBack(); + objJsonResult.code = "0"; + objJsonResult.count = 0; + objJsonResult.Message = "Exception锛�" + e.Message; + objJsonResult.data = null; + return objJsonResult; + } + } + + + /// <summary> + /// 鏂板鍗曟嵁-淇濆瓨鎸夐挳 + ///鍙傛暟锛歴tring sql銆� + ///杩斿洖鍊硷細object銆� + /// </summary> + [Route("Xt_BillType/AddBill")] + [HttpPost] + public object AddBill([FromBody] JObject oMain) + { + try + { + var _value = oMain["oMain"].ToString(); + string msg1 = _value.ToString(); + //鍙嶅簭鍒楀寲 + msg1 = "[" + msg1.ToString() + "]"; + + + + List<BillType> list = Newtonsoft.Json.JsonConvert.DeserializeObject<List<BillType>>(msg1); + + long HItemID = list[0].HItemID; + string HNumber = list[0].HNumber; + string HName = list[0].HName; + string HTemplate = list[0].HTemplate; + string HHeadTable = list[0].HHeadTable; + string HEntryTable = list[0].HEntryTable; + string HViewName = list[0].HViewName; + string HRightName = list[0].HRightName; + + + + + + + //鑻AINDI閲嶅鍒欓噸鏂拌幏鍙� + oCN.BeginTran(); + //涓昏〃 + oCN.RunProc("Insert Into Xt_BillType " + + "(HNumber,HName,HTemplate,HHeadTable" + + ",HEntryTable,HViewName,HRightName" + + ") " + + " values('" + HNumber + "','" + HName + "','" + HTemplate + "','" + HHeadTable + "'" + + ",'" + HEntryTable + "','" + HViewName + "','" + HRightName + "'" + + ") "); + //淇敼涓婄骇涓洪潪鏈骇浠g爜 + oCN.Commit(); + objJsonResult.code = "1"; + objJsonResult.count = 1; + objJsonResult.Message = "鏂板鍗曟嵁鎴愬姛锛�"; + //objJsonResult.data = null; + return objJsonResult; + } + catch (Exception e) + { + oCN.RollBack(); + objJsonResult.code = "0"; + objJsonResult.count = 0; + objJsonResult.Message = "Exception锛�" + e.Message; + objJsonResult.data = null; + return objJsonResult; + } + } + // } diff --git a/WebAPI/Controllers/BLL/Xt_SystemParameterController.cs b/WebAPI/Controllers/BLL/Xt_SystemParameterController.cs index 43756c7..58a7415 100644 --- a/WebAPI/Controllers/BLL/Xt_SystemParameterController.cs +++ b/WebAPI/Controllers/BLL/Xt_SystemParameterController.cs @@ -67,6 +67,66 @@ } + /// <summary> + /// 淇敼鍗曟嵁-淇濆瓨鎸夐挳 + ///鍙傛暟锛歴tring sql銆� + ///杩斿洖鍊硷細object銆� + /// </summary> + [Route("Xt_SystemParameter/AddBill1")] + [HttpPost] + public object AddBill1([FromBody] JObject oMain) + { + + try + { + var _value = oMain["oMain"].ToString(); + string msg1 = _value.ToString(); + string[] sArray = msg1.Split(new string[] { ";" }, StringSplitOptions.RemoveEmptyEntries); + string msg2 = sArray[0].ToString(); + string msg3 = sArray[1].ToString(); + string msg4 = sArray[2].ToString(); + string msg5 = sArray[3].ToString(); + //鍙嶅簭鍒楀寲 + msg2 = "[" + msg2.ToString() + "]"; + List<SystemParameter> list = Newtonsoft.Json.JsonConvert.DeserializeObject<List<SystemParameter>>(msg2); + + long HItemID = int.Parse(msg3); + string HModClass = list[0].HModClass; + string Hkey = list[0].HKey; + string HCaption = list[0].HCaption; + string HValue = list[0].Hvalue; + string HReadonly = list[0].HReadonly; + string HExplanation = list[0].HExplanation; + string HFarmat = list[0].HFarmat; + + + + //鑻AINDI閲嶅鍒欓噸鏂拌幏鍙� + oCN.BeginTran(); + //涓昏〃 + oCN.RunProc("Update Xt_BillType set " + + ",HValue= '" + HValue + "' Where HItemID=" + HItemID, ref DBUtility.ClsPub.sExeReturnInfo); + //淇敼瀛愰」鐩唬鐮� + //oCN.RunProc("exec h_p_Gy_UpdateNumber Gy_Department,'" + HNumber + ".','" + this.HOldNumber + ".'", ref DBUtility.ClsPub.sExeReturnInfo); + //灏嗕笂绾� 涓洪潪鏈骇 + // + oCN.Commit(); + objJsonResult.code = "1"; + objJsonResult.count = 1; + objJsonResult.Message = "淇敼鍗曟嵁鎴愬姛锛�"; + //objJsonResult.data = null; + return objJsonResult; + } + catch (Exception e) + { + oCN.RollBack(); + objJsonResult.code = "0"; + objJsonResult.count = 0; + objJsonResult.Message = "Exception锛�" + e.Message; + objJsonResult.data = null; + return objJsonResult; + } + } // } diff --git a/WebAPI/Controllers/BLL/Xt_XtgnbController.cs b/WebAPI/Controllers/BLL/Xt_XtgnbController.cs index c1eabaa..e789ccc 100644 --- a/WebAPI/Controllers/BLL/Xt_XtgnbController.cs +++ b/WebAPI/Controllers/BLL/Xt_XtgnbController.cs @@ -66,7 +66,180 @@ } } + /// <summary> + /// 淇敼鍗曟嵁-淇濆瓨鎸夐挳 + ///鍙傛暟锛歴tring sql銆� + ///杩斿洖鍊硷細object銆� + /// </summary> + [Route("Xt_Xtgnb/AddBill1")] + [HttpPost] + public object AddBill1([FromBody] JObject oMain) + { + try + { + var _value = oMain["oMain"].ToString(); + string msg1 = _value.ToString(); + string[] sArray = msg1.Split(new string[] { ";" }, StringSplitOptions.RemoveEmptyEntries); + string msg2 = sArray[0].ToString(); + string msg3 = sArray[1].ToString(); + string msg4 = sArray[2].ToString(); + string msg5 = sArray[3].ToString(); + //鍙嶅簭鍒楀寲 + msg2 = "[" + msg2.ToString() + "]"; + List<xtgnb> list = Newtonsoft.Json.JsonConvert.DeserializeObject<List<xtgnb>>(msg2); + + long HItemID = list[0].id; + string gnbm = list[0].gnbm; + string gnsy = list[0].gnsy; + string gnmc = list[0].gnmc; + string gnms = list[0].gnms; + string sjgnbm = list[0].sjgnbm; + string mjbz = list[0].mjbz; + string MenuList = list[0].MenuList; + string RightFlag = list[0].RightFlag; + string useflag = list[0].useflag; + string netmenulist = list[0].netmenulist; + string buyFlag = list[0].buyflag; + + + + //鑻AINDI閲嶅鍒欓噸鏂拌幏鍙� + oCN.BeginTran(); + //涓昏〃 + oCN.RunProc("Update Xt_Xtgnb set " + + " gnbm='" + gnbm + "'" + + ",gnsy='" + gnsy + "'" + + ",gnmc='" + gnmc + "'" + + ",gnms='" + gnms + "'" + + ",sjgnbm= '" + sjgnbm + "' Where id =" + HItemID, ref DBUtility.ClsPub.sExeReturnInfo); + //淇敼瀛愰」鐩唬鐮� + //oCN.RunProc("exec h_p_Gy_UpdateNumber Gy_Department,'" + HNumber + ".','" + this.HOldNumber + ".'", ref DBUtility.ClsPub.sExeReturnInfo); + //灏嗕笂绾� 涓洪潪鏈骇 + // + oCN.Commit(); + objJsonResult.code = "1"; + objJsonResult.count = 1; + objJsonResult.Message = "淇敼鍗曟嵁鎴愬姛锛�"; + //objJsonResult.data = null; + return objJsonResult; + } + catch (Exception e) + { + oCN.RollBack(); + objJsonResult.code = "0"; + objJsonResult.count = 0; + objJsonResult.Message = "Exception锛�" + e.Message; + objJsonResult.data = null; + return objJsonResult; + } + } + + + /// <summary> + /// 鏂板鍗曟嵁-淇濆瓨鎸夐挳 + ///鍙傛暟锛歴tring sql銆� + ///杩斿洖鍊硷細object銆� + /// </summary> + [Route("Xt_Xtgnb/AddBill")] + [HttpPost] + public object AddBill([FromBody] JObject oMain) + { + try + { + var _value = oMain["oMain"].ToString(); + string msg1 = _value.ToString(); + //鍙嶅簭鍒楀寲 + msg1 = "[" + msg1.ToString() + "]"; + + + + List<xtgnb> list = Newtonsoft.Json.JsonConvert.DeserializeObject<List<xtgnb>>(msg1); + + long HItemID = list[0].id; + string gnbm = list[0].gnbm; + string gnsy = list[0].gnsy; + string gnmc = list[0].gnmc; + string gnms = list[0].gnms; + string sjgnbm = list[0].sjgnbm; + string mjbz = list[0].mjbz; + string MenuList = list[0].MenuList; + string RightFlag = list[0].RightFlag; + string useflag = list[0].useflag; + string netmenulist = list[0].netmenulist; + string buyFlag = list[0].buyflag; + + + + + + + + //鑻AINDI閲嶅鍒欓噸鏂拌幏鍙� + oCN.BeginTran(); + //涓昏〃 + oCN.RunProc("Insert Into Xt_Xtgnb " + + "(gnbm,gnsy,gnmc,gnms" + + ",sjgnbm,mjbz,MenuList,RightFlag,useflag" + + ",netmenulist,buyFlag" + + ") " + + " values('" + gnbm + "','" + gnsy + "','" + gnmc + "','" + gnms + "'" + + ",'" + sjgnbm + "','" + mjbz + "','" + MenuList + "','" + RightFlag + "','" + useflag + "'" + + ",'" + netmenulist + "','" + buyFlag + "'" + + ") "); + //淇敼涓婄骇涓洪潪鏈骇浠g爜 + oCN.Commit(); + objJsonResult.code = "1"; + objJsonResult.count = 1; + objJsonResult.Message = "鏂板鍗曟嵁鎴愬姛锛�"; + //objJsonResult.data = null; + return objJsonResult; + } + catch (Exception e) + { + oCN.RollBack(); + objJsonResult.code = "0"; + objJsonResult.count = 0; + objJsonResult.Message = "Exception锛�" + e.Message; + objJsonResult.data = null; + return objJsonResult; + } + } + + + + /// <summary> + /// 绯荤粺鍔熻兘鍒楄〃鍒犻櫎鎸夐挳 + ///鍙傛暟锛歴tring sql銆� + ///杩斿洖鍊硷細object銆� + /// </summary> + [Route("Xt_Xtgnb/Delete_Json")] + [HttpGet] + public object Delete_Json(long HItemID) + { + + try + { + //鑻AINDI閲嶅鍒欓噸鏂拌幏鍙� + oCN.BeginTran(); + //涓昏〃 + oCN.RunProc("delete from Xt_Xtgnb Where id =" + HItemID, ref DBUtility.ClsPub.sExeReturnInfo); + 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 = "Exception锛�" + e.ToString(); + objJsonResult.data = null; + return objJsonResult; + } + } // } diff --git a/WebAPI/Controllers/BaseSet/Gy_CustomerController.cs b/WebAPI/Controllers/BaseSet/Gy_CustomerController.cs index 107601f..660e6e1 100644 --- a/WebAPI/Controllers/BaseSet/Gy_CustomerController.cs +++ b/WebAPI/Controllers/BaseSet/Gy_CustomerController.cs @@ -66,7 +66,443 @@ } } + /// <summary> + /// 瀹㈡埛鍒楄〃淇敼鎸夐挳鏂规硶 + ///鍙傛暟锛歴tring sql銆� + ///杩斿洖鍊硷細object銆� + /// </summary> + [Route("Gy_Customer/xg")] + [HttpGet] + public object xg(long HInterID) + { + try + { + ds = oCN.RunProcReturn("select * from Gy_Customer where HItemID=" + HInterID, "Gy_Customer"); + objJsonResult.code = "1"; + objJsonResult.count = 1; + objJsonResult.Message = ""; + objJsonResult.data = ds.Tables[0]; + return objJsonResult; + } + catch (Exception e) + { + objJsonResult.code = "0"; + objJsonResult.count = 0; + objJsonResult.Message = "Exception锛�" + e.ToString(); + objJsonResult.data = null; + return objJsonResult; + } + } + + /// <summary> + /// 鑾峰彇鏈�澶у熀纭�璧勬枡ID + ///鍙傛暟锛歴tring sql銆� + ///杩斿洖鍊硷細object銆� + /// </summary> + [Route("Gy_Customer/GetMAXBillID")] + [HttpGet] + public object GetMAXBillID() + { + try + { + ds = oCN.RunProcReturn("select max(hitemid)+1 hitemid from Gy_Customer", "Gy_Customer"); + + objJsonResult.code = "1"; + objJsonResult.count = 1; + objJsonResult.Message = ""; + objJsonResult.data = ds.Tables[0]; + return objJsonResult; + } + catch (Exception e) + { + objJsonResult.code = "0"; + objJsonResult.count = 0; + objJsonResult.Message = "Exception锛�" + e.ToString(); + objJsonResult.data = null; + return objJsonResult; + } + } + + + /// <summary> + /// 瀹㈡埛鍒楄〃鏍戝舰缁撴瀯 + ///鍙傛暟锛歴tring sql銆� + ///杩斿洖鍊硷細object銆� + /// </summary> + [Route("Gy_Customer/LoadTree")] + [HttpGet] + public object LoadTree_Json(string sWhere) + { + SQLHelper.ClsCN SubCn = new SQLHelper.ClsCN(); + //ds = oCN.RunProcReturn("select * from h_v_IF_GroupList " + sWhere, "h_v_IF_GroupList"); + ds = oCN.RunProcReturn("select * from h_v_CustomerLoadTree", "h_v_CustomerLoadTree"); + if (ds == null || ds.Tables[0].Rows.Count == 0) + { + objJsonResult.code = "0"; + objJsonResult.count = 0; + objJsonResult.Message = "false锛�"; + objJsonResult.data = null; + return objJsonResult; + } + else + { + objJsonResult.code = "1"; + objJsonResult.count = 1; + objJsonResult.Message = "Sucess锛�"; + objJsonResult.data = ds.Tables[0]; + return objJsonResult; + } + } + + /// <summary> + /// 鏂板鍗曟嵁-淇濆瓨鎸夐挳 + ///鍙傛暟锛歴tring sql銆� + ///杩斿洖鍊硷細object銆� + /// </summary> + [Route("Gy_Customer/AddBill")] + [HttpPost] + public object AddBill([FromBody] JObject oMain) + { + try + { + var _value = oMain["oMain"].ToString(); + string msg1 = _value.ToString(); + //鍙嶅簭鍒楀寲 + msg1 = "[" + msg1.ToString() + "]"; + + DAL.ClsGy_Customer_Ctl oDept = new DAL.ClsGy_Customer_Ctl(); + DAL.ClsGy_Customer_View oDeptHlp = new DAL.ClsGy_Customer_View(); + + + + List<Customer> list = Newtonsoft.Json.JsonConvert.DeserializeObject<List<Customer>>(msg1); + + long HItemID = list[0].HItemID; + string HNumber = list[0].HNumber; + string HName = list[0].HName; + string HShortNumber = list[0].HShortNumber; + long HLevel = list[0].HLevel; + string HEndFlag = list[0].HEndFlag; + long HParentID = list[0].HParentID; + string HRemark = list[0].HRemark; + string HStopflag = list[0].HStopFlag; + string HHelpCode = list[0].HHelpCode; + string HShortName = list[0].HShortName; + string HAddress = list[0].HAddress; + string HLinkMan = list[0].HLinkMan; + string HLinkPhone = list[0].HLinkPhone; + string HMobilePhone = list[0].HMobilePhone; + string HFax = list[0].HFax; + string HPostalCode = list[0].HPostalCode; + string HEmail = list[0].HEmail; + string HBank = list[0].HBank; + string HBankAccount = list[0].HBankAccount; + string HTaxNum = list[0].HTaxNum; + double HTaxRate = list[0].HTaxRate; + string HCountry = list[0].HCountry; + string HCorMan = list[0].HCorMan; + string HEnglishName = list[0].HEnglishName; + string HEnglishAddress = list[0].HEnglishAddress; + long HCurID = list[0].HCurID; + long HSSID = list[0].HSSID; + long HAreaID = list[0].HAreaID; + string HCusStatus = list[0].HCusStatus; + long HCusTypeID = list[0].HCusTypeID; + string HUseFlag = list[0].HUseFlag; + long HCreditDate = list[0].HCreditDate; + long HCreditRatingDate = list[0].HCreditRatingDate; + long HMaxCredRatingDate = list[0].HMaxCreditRatingDate; + double HMonthUseQty = list[0].HMonthUseQty; + double HForecastCreditRating = list[0].HForecastCreditRating; + long HCreditLevelID = list[0].HCreditLevelID; + double HCountAccrualRating = list[0].HCountAccrualRating; + double HSubsidyAccrualRating = list[0].HSubsidyAccrualRating; + double HCreditRating = list[0].HCreditRating; + double HMaxCreditRating = list[0].HMaxCreditRating; + long HEmpID = list[0].HEmpID; + long HERPItemID = list[0].HERPItemID; + DateTime HMakeTime = list[0].HMakeTime; + long HCreateOrgID = list[0].HCREATEORGID; + long HUseOrgID = list[0].HUSEORGID; + + //DateTime HDeleteDate = list[0].HDeleteDate; + + + if (!DBUtility.ClsPub.AllowNumber(HNumber)) + { + objJsonResult.code = "0"; + objJsonResult.count = 0; + objJsonResult.Message = "浠g爜涓笉鑳藉嚭鐜拌繛缁��.鈥欏苟涓旈浣嶆湯浣嶄笉鑳戒负鈥�.鈥欙紒"; + objJsonResult.data = null; + return objJsonResult; + } + + + + //鑻AINDI閲嶅鍒欓噸鏂拌幏鍙� + oCN.BeginTran(); + //涓昏〃 + oCN.RunProc("Insert into Gy_Customer " + + " (HNumber,HName,HHelpCode,HShortNumber,HParentID" + + ",HLevel,HEndFlag,HStopflag,HRemark" + + ",HShortName,HAddress,HLinkMan,HLinkPhone,HMobilePhone" + + ",HFax,HPostalCode,HEmail,HBank,HBankAccount" + + ",HTaxNum,HTaxRate,HCountry,HCorMan,HEnglishName" + + ",HEnglishAddress,HCurID,HSSID,HAreaID,HCusStatus" + + ",HEmpID,HCreditDate,HCreditRatingDate,HMaxCreditRatingDate" + + ",HMonthUseQty,HForecastCreditRating,HCreditLevelID,HCountAccrualRating" + + ",HSubsidyAccrualRating,HCreditRating,HMaxCreditRating" + + ",HCusTypeID) " + + " Values('" + HNumber + "','" + HName + "','" + HHelpCode + "','" + HShortNumber + "'," + HParentID + + ", " + HLevel + ",0,0,'" + HRemark + "'" + + ",'" + HShortName + "','" + HAddress + "','" + HLinkMan + "','" + HLinkPhone + "','" + HMobilePhone + "'" + + ",'" + HFax + "','" + HPostalCode + "','" + HEmail + "','" + HBank + "','" + HBankAccount + "'" + + ",'" + HTaxNum + "'," + HTaxRate + ",'" + HCountry + "','" + HCorMan + "','" + HEnglishName + "'" + + ",'" + HEnglishAddress + "'," + HCurID + "," + HSSID + "," + HAreaID + ",'" + HCusStatus + "'" + + "," + HEmpID + "," + HCreditDate + "," + HCreditRatingDate + "," + HMaxCredRatingDate + + "," + HMonthUseQty + "," + HForecastCreditRating + "," + HCreditLevelID + "," + HCountAccrualRating + + "," + HSubsidyAccrualRating + "," + HCreditRating + "," + HMaxCreditRating + + ", " + HCusTypeID + ")"); + //淇敼涓婄骇涓洪潪鏈骇浠g爜 + oCN.RunProc("Update Gy_Customer set HEndflag=0 where HItemID=" + HParentID, ref DBUtility.ClsPub.sExeReturnInfo); + oCN.Commit(); + objJsonResult.code = "1"; + objJsonResult.count = 1; + objJsonResult.Message = "鏂板鍗曟嵁鎴愬姛锛�"; + //objJsonResult.data = null; + return objJsonResult; + } + catch (Exception e) + { + oCN.RollBack(); + objJsonResult.code = "0"; + objJsonResult.count = 0; + objJsonResult.Message = "Exception锛�" + e.Message; + objJsonResult.data = null; + return objJsonResult; + } + } + + + /// <summary> + /// 淇敼鍗曟嵁-淇濆瓨鎸夐挳 + ///鍙傛暟锛歴tring sql銆� + ///杩斿洖鍊硷細object銆� + /// </summary> + [Route("Gy_Customer/AddBill1")] + [HttpPost] + public object AddBill1([FromBody] JObject oMain) + { + + try + { + + DAL.ClsGy_Customer_Ctl oDept = new DAL.ClsGy_Customer_Ctl(); + DAL.ClsGy_Customer_View oDeptHlp = new DAL.ClsGy_Customer_View(); + + var _value = oMain["oMain"].ToString(); + string msg1 = _value.ToString(); + string[] sArray = msg1.Split(new string[] { ";" }, StringSplitOptions.RemoveEmptyEntries); + string msg2 = sArray[0].ToString(); + string msg3 = sArray[1].ToString(); + string msg4 = sArray[2].ToString(); + string msg5 = sArray[3].ToString(); + //鍙嶅簭鍒楀寲 + msg2 = "[" + msg2.ToString() + "]"; + List<Customer> list = Newtonsoft.Json.JsonConvert.DeserializeObject<List<Customer>>(msg2); + + long HItemID = int.Parse(msg3); + string HNumber = list[0].HNumber; + string HName = list[0].HName; + string HShortNumber = list[0].HShortNumber; + long HLevel = list[0].HLevel; + string HEndFlag = list[0].HEndFlag; + long HParentID = list[0].HParentID; + string HRemark = list[0].HRemark; + string HStopflag = list[0].HStopFlag; + string HHelpCode = list[0].HHelpCode; + string HShortName = list[0].HShortName; + string HAddress = list[0].HAddress; + string HLinkMan = list[0].HLinkMan; + string HLinkPhone = list[0].HLinkPhone; + string HMobilePhone = list[0].HMobilePhone; + string HFax = list[0].HFax; + string HPostalCode = list[0].HPostalCode; + string HEmail = list[0].HEmail; + string HBank = list[0].HBank; + string HBankAccount = list[0].HBankAccount; + string HTaxNum = list[0].HTaxNum; + double HTaxRate = list[0].HTaxRate; + string HCountry = list[0].HCountry; + string HCorMan = list[0].HCorMan; + string HEnglishName = list[0].HEnglishName; + string HEnglishAddress = list[0].HEnglishAddress; + long HCurID = list[0].HCurID; + long HSSID = list[0].HSSID; + long HAreaID = list[0].HAreaID; + string HCusStatus = list[0].HCusStatus; + long HCusTypeID = list[0].HCusTypeID; + string HUseFlag = list[0].HUseFlag; + long HCreditDate = list[0].HCreditDate; + long HCreditRatingDate = list[0].HCreditRatingDate; + long HMaxCredRatingDate = list[0].HMaxCreditRatingDate; + double HMonthUseQty = list[0].HMonthUseQty; + double HForecastCreditRating = list[0].HForecastCreditRating; + long HCreditLevelID = list[0].HCreditLevelID; + double HCountAccrualRating = list[0].HCountAccrualRating; + double HSubsidyAccrualRating = list[0].HSubsidyAccrualRating; + double HCreditRating = list[0].HCreditRating; + double HMaxCreditRating = list[0].HMaxCreditRating; + long HEmpID = list[0].HEmpID; + long HERPItemID = list[0].HERPItemID; + DateTime HMakeTime = list[0].HMakeTime; + long HCreateOrgID = list[0].HCREATEORGID; + long HUseOrgID = list[0].HUSEORGID; + + + //鍒ゆ柇鏉冮檺 + if (!ClsPub.Security_Log(msg5, 1, true, msg4)) + { + objJsonResult.code = "0"; + objJsonResult.count = 0; + objJsonResult.Message = "娌℃湁鎵惧埌璇ュ姛鑳芥ā鍧楋紒"; + objJsonResult.data = null; + return objJsonResult; + } + + + if (!DBUtility.ClsPub.AllowNumber(HNumber)) + { + objJsonResult.code = "0"; + objJsonResult.count = 0; + objJsonResult.Message = "浠g爜涓笉鑳藉嚭鐜拌繛缁��.鈥欏苟涓旈浣嶆湯浣嶄笉鑳戒负鈥�.鈥欙紒"; + objJsonResult.data = null; + return objJsonResult; + } + + if (oDept.HavSameNumber(HItemID, HNumber)) + { + objJsonResult.code = "0"; + objJsonResult.count = 0; + objJsonResult.Message = "浠g爜閲嶅锛�"; + objJsonResult.data = null; + return objJsonResult; + } + + + //鑻AINDI閲嶅鍒欓噸鏂拌幏鍙� + oCN.BeginTran(); + //涓昏〃 + oCN.RunProc("Update Gy_Customer set " + + " HNumber='" + HNumber + "'" + + ",HName='" + HName + "'" + + ",HShortNumber='" + HShortNumber + "'" + + ",HParentID=" + HParentID + + ",HRemark= '" + HRemark + "' Where HItemID=" + HItemID, ref DBUtility.ClsPub.sExeReturnInfo); + //淇敼瀛愰」鐩唬鐮� + //oCN.RunProc("exec h_p_Gy_UpdateNumber Gy_Department,'" + HNumber + ".','" + this.HOldNumber + ".'", ref DBUtility.ClsPub.sExeReturnInfo); + //灏嗕笂绾� 涓洪潪鏈骇 + oCN.RunProc("Update Gy_Customer set HEndflag=0 where HItemID=" + HParentID, ref DBUtility.ClsPub.sExeReturnInfo); + // + oCN.Commit(); + objJsonResult.code = "1"; + objJsonResult.count = 1; + objJsonResult.Message = "淇敼鍗曟嵁鎴愬姛锛�"; + //objJsonResult.data = null; + return objJsonResult; + } + catch (Exception e) + { + oCN.RollBack(); + objJsonResult.code = "0"; + objJsonResult.count = 0; + objJsonResult.Message = "Exception锛�" + e.Message; + objJsonResult.data = null; + return objJsonResult; + } + } + + + + /// <summary> + /// 瀹㈡埛鍒楄〃鍒犻櫎鎸夐挳 + ///鍙傛暟锛歴tring sql銆� + ///杩斿洖鍊硷細object銆� + /// </summary> + [Route("Gy_Customer/Delete_Json")] + [HttpGet] + public object Delete_Json(long HItemID, string User, string ModRightNameDelete) + { + DAL.ClsGy_Customer_Ctl oDept = new DAL.ClsGy_Customer_Ctl(); + DAL.ClsGy_Customer_View oDeptHlp = new DAL.ClsGy_Customer_View(); + try + { + if (!DBUtility.ClsPub.Security_Log(ModRightNameDelete, 1, true, User)) + { + objJsonResult.code = "0"; + objJsonResult.count = 0; + objJsonResult.Message = "娌℃湁鍒犻櫎鏉冮檺"; + objJsonResult.data = null; + return objJsonResult; + } + if (oDeptHlp.GetInfoByID(HItemID)) + { + if (oDept.HavChildCodes(HItemID)) + { + objJsonResult.code = "0"; + objJsonResult.count = 0; + objJsonResult.Message = "姝ら」鐩瓨鍦ㄥ瓙椤圭洰,涓嶈兘鍒犻櫎锛�"; + objJsonResult.data = null; + return objJsonResult; + } + //鍒犻櫎鍓嶅垽鏂槸鍚� 宸蹭娇鐢� 20141020 + if (oDeptHlp.omodel.HUseFlag != "鏈娇鐢�") + { + objJsonResult.code = "0"; + objJsonResult.count = 0; + objJsonResult.Message = "姝ら」鐩凡浣跨敤鎴栬�呮湭妫�娴嬶紝涓嶈兘鍒犻櫎锛佽閲嶆柊妫�娴嬪啀鍒犻櫎锛�"; + objJsonResult.data = null; + return objJsonResult; + } + // + if (oDept.DeleteByID(HItemID)) + { + //鍐欏叆鏃ュ織 + ClsPub.Add_Log("", "鍒犻櫎椤圭洰锛屼唬鐮侊細" + oDeptHlp.omodel.HNumber + ",鍚嶇О锛�" + oDeptHlp.omodel.HName, ClsPub.CurUserName); + //鏇存柊涓婄骇涓� 鏈骇 + objJsonResult.code = "1"; + objJsonResult.count = 1; + objJsonResult.Message = "鍒犻櫎鎴愬姛"; + objJsonResult.data = null; + return objJsonResult; + } + else + { + objJsonResult.code = "0"; + objJsonResult.count = 0; + objJsonResult.Message = "鍒犻櫎澶辫触"; + objJsonResult.data = null; + return objJsonResult; + } + } + //ds = oCN.RunProcReturn("delete from Gy_Department where HItemID = " + HItemID, "Gy_Department"); + + objJsonResult.code = "1"; + objJsonResult.count = 1; + objJsonResult.Message = "鍒犻櫎鎴愬姛"; + objJsonResult.data = null; + return objJsonResult; + } + catch (Exception e) + { + objJsonResult.code = "0"; + objJsonResult.count = 0; + objJsonResult.Message = "Exception锛�" + e.ToString(); + objJsonResult.data = null; + return objJsonResult; + } + } // } diff --git a/WebAPI/Controllers/BaseSet/Gy_EquipMentController.cs b/WebAPI/Controllers/BaseSet/Gy_EquipMentController.cs new file mode 100644 index 0000000..8a323ce --- /dev/null +++ b/WebAPI/Controllers/BaseSet/Gy_EquipMentController.cs @@ -0,0 +1,516 @@ +锘縰sing Newtonsoft.Json.Linq; +using Pub_Class; +using System; +using System.Collections; +using System.Collections.Generic; +using System.Data; +using System.Data.SqlClient; +using System.Web.Http; +using WebAPI.Models; +namespace WebAPI.Controllers +{ + public class Gy_EquipMentController : ApiController + { + public DBUtility.ClsPub.Enum_BillStatus BillStatus; + + private json objJsonResult = new json(); + SQLHelper.ClsCN oCN = new SQLHelper.ClsCN(); + DataSet ds; + + + /// <summary> + /// 杩斿洖璁惧鍒楄〃 + ///鍙傛暟锛歴tring sql銆� + ///杩斿洖鍊硷細object銆� + /// </summary> + [Route("Gy_EquipMent/list")] + [HttpGet] + public object list(string sWhere) + { + try + { + if (sWhere == null || sWhere.Equals("")) + { + ds = oCN.RunProcReturn("select * from h_v_Gy_EquipMentList " + sWhere, "h_v_Gy_EquipMentList"); + } + else + { + string sql1 = "select * from h_v_Gy_EquipMentList where 1 = 1 "; + string sql = sql1 + sWhere; + ds = oCN.RunProcReturn(sql, "h_v_Gy_EquipMentList"); + } + if (ds == null || ds.Tables[0].Rows.Count == 0) + { + objJsonResult.code = "0"; + objJsonResult.count = 0; + objJsonResult.Message = "false锛�"; + objJsonResult.data = null; + return objJsonResult; + } + else + { + objJsonResult.code = "1"; + objJsonResult.count = 1; + objJsonResult.Message = "Sucess锛�"; + objJsonResult.data = ds.Tables[0]; + return objJsonResult; + } + } + catch (Exception e) + { + objJsonResult.code = "0"; + objJsonResult.count = 0; + objJsonResult.Message = "Exception锛�" + e.ToString(); + objJsonResult.data = null; + return objJsonResult; + } + } + + + /// <summary> + /// 鏍规嵁鍩虹璧勬枡ID 鏌ユ壘璁板綍 + ///鍙傛暟锛歴tring sql銆� + ///杩斿洖鍊硷細object銆� + /// </summary> + [Route("Gy_EquipMent/cx")] + [HttpGet] + public object cx(long HInterID) + { + try + { + ds = oCN.RunProcReturn("select * from Gy_EquipMent where hitemid = " + HInterID, "Gy_EquipMent"); + + objJsonResult.code = "1"; + objJsonResult.count = 1; + objJsonResult.Message = "Sucess锛�"; + objJsonResult.data = ds.Tables[0]; + return objJsonResult; + } + catch (Exception e) + { + objJsonResult.code = "0"; + objJsonResult.count = 0; + objJsonResult.Message = "Exception锛�" + e.ToString(); + objJsonResult.data = null; + return objJsonResult; + } + } + + /// <summary> + /// 璁惧鍒楄〃鍒犻櫎鎸夐挳 + ///鍙傛暟锛歴tring sql銆� + ///杩斿洖鍊硷細object銆� + /// </summary> + [Route("Gy_EquipMent/Delete_Json")] + [HttpGet] + public object Delete_Json(long HItemID,string User,string ModRightNameDelete) + { + DAL.ClsGy_EquipMent_Ctl oDept = new DAL.ClsGy_EquipMent_Ctl(); + DAL.ClsGy_EquipMent_View oDeptHlp = new DAL.ClsGy_EquipMent_View(); + try + { + //if (!DBUtility.ClsPub.Security_Log(ModRightNameDelete, 1, true,User)) + //{ + // objJsonResult.code = "0"; + // objJsonResult.count = 0; + // objJsonResult.Message = "娌℃湁鍒犻櫎鏉冮檺"; + // objJsonResult.data = null; + // return objJsonResult; + //} + if (oDeptHlp.GetInfoByID(HItemID)) + { + if (oDept.HavChildCodes(HItemID)) + { + objJsonResult.code = "0"; + objJsonResult.count = 0; + objJsonResult.Message = "姝ら」鐩瓨鍦ㄥ瓙椤圭洰,涓嶈兘鍒犻櫎锛�"; + objJsonResult.data = null; + return objJsonResult; + } + //鍒犻櫎鍓嶅垽鏂槸鍚� 宸蹭娇鐢� 20141020 + if (oDeptHlp.omodel.HUseFlag != "鏈娇鐢�") + { + objJsonResult.code = "0"; + objJsonResult.count = 0; + objJsonResult.Message = "姝ら」鐩凡浣跨敤鎴栬�呮湭妫�娴嬶紝涓嶈兘鍒犻櫎锛佽閲嶆柊妫�娴嬪啀鍒犻櫎锛�"; + objJsonResult.data = null; + return objJsonResult; + } + // + if (oDept.DeleteByID(HItemID)) + { + //鍐欏叆鏃ュ織 + ClsPub.Add_Log("", "鍒犻櫎椤圭洰锛屼唬鐮侊細" + oDeptHlp.omodel.HNumber + ",鍚嶇О锛�" + oDeptHlp.omodel.HName, ClsPub.CurUserName); + //鏇存柊涓婄骇涓� 鏈骇 + objJsonResult.code = "1"; + objJsonResult.count = 1; + objJsonResult.Message = "鍒犻櫎鎴愬姛"; + objJsonResult.data = null; + return objJsonResult; + } + else + { + objJsonResult.code = "0"; + objJsonResult.count = 0; + objJsonResult.Message = "鍒犻櫎澶辫触"; + objJsonResult.data = null; + return objJsonResult; + } + } + //ds = oCN.RunProcReturn("delete from Gy_EquipMent where HItemID = " + HItemID, "Gy_EquipMent"); + + objJsonResult.code = "1"; + objJsonResult.count = 1; + objJsonResult.Message = "鍒犻櫎鎴愬姛"; + objJsonResult.data = null; + return objJsonResult; + } + catch (Exception e) + { + objJsonResult.code = "0"; + objJsonResult.count = 0; + objJsonResult.Message = "Exception锛�" + e.ToString(); + objJsonResult.data = null; + return objJsonResult; + } + } + + //[Route("Gy_EquipMent/LoadTree")] + //[HttpGet] + //public object LoadTree_Json() + //{ + // DBUtility.Gy_BaseFun.LoadTree(tv, imageList1, this.Text, BillName); + //} + + + /// <summary> + /// 閮ㄩ棬鍒楄〃绂佺敤鎸夐挳 + ///鍙傛暟锛歴tring sql銆� + ///杩斿洖鍊硷細object銆� + /// </summary> + [Route("Gy_EquipMent/JY_Json")] + [HttpGet] + public object JY_Json(long HItemID) + { + try + { + ds = oCN.RunProcReturn("update Gy_EquipMent set HStopFlag = 1 where HItemID = " + HItemID, "Gy_EquipMent"); + + objJsonResult.code = "1"; + objJsonResult.count = 1; + objJsonResult.Message = "绂佺敤鎴愬姛"; + objJsonResult.data = null; + return objJsonResult; + } + catch (Exception e) + { + objJsonResult.code = "0"; + objJsonResult.count = 0; + objJsonResult.Message = "Exception锛�" + e.ToString(); + objJsonResult.data = null; + return objJsonResult; + } + } + + /// <summary> + /// 閮ㄩ棬鍒楄〃鍙嶇鐢ㄦ寜閽� + ///鍙傛暟锛歴tring sql銆� + ///杩斿洖鍊硷細object銆� + /// </summary> + [Route("Gy_EquipMent/FJY_Json")] + [HttpGet] + public object FJY_Json(long HItemID) + { + try + { + ds = oCN.RunProcReturn("update Gy_EquipMent set HStopFlag = 0 where HItemID = " + HItemID, "Gy_EquipMent"); + + objJsonResult.code = "1"; + objJsonResult.count = 1; + objJsonResult.Message = "鍙嶇鐢ㄦ垚鍔�"; + objJsonResult.data = null; + return objJsonResult; + } + catch (Exception e) + { + objJsonResult.code = "0"; + objJsonResult.count = 0; + objJsonResult.Message = "Exception锛�" + e.ToString(); + objJsonResult.data = null; + return objJsonResult; + } + } + + /// <summary> + /// 鏂板鍗曟嵁-淇濆瓨鎸夐挳 + ///鍙傛暟锛歴tring sql銆� + ///杩斿洖鍊硷細object銆� + /// </summary> + [Route("Gy_EquipMent/AddBill")] + [HttpPost] + public object AddBill([FromBody] JObject oMain) + { + try { + var _value = oMain["oMain"].ToString(); + string msg1 = _value.ToString(); + //鍙嶅簭鍒楀寲 + msg1 = "[" + msg1.ToString() + "]"; + + DAL.ClsGy_EquipMent_Ctl oDept = new DAL.ClsGy_EquipMent_Ctl(); + DAL.ClsGy_EquipMent_View oDeptHlp = new DAL.ClsGy_EquipMent_View(); + + + + List<EquipMent> list = Newtonsoft.Json.JsonConvert.DeserializeObject<List<EquipMent>>(msg1); + + long HItemID = list[0].HItemID; + string HNumber = list[0].HNumber; + string HName = list[0].HName; + string HShortNumber = list[0].HShortNumber; + string HHelpCode = list[0].HHelpCode; + long HParentID = list[0].HParentID; + long HLevel = list[0].HLevel; + string HEndFlag = list[0].HEndFlag; + string HStopFlag = list[0].HStopFlag; + string HRemark = list[0].HRemark; + double HMadeMoney = list[0].HMadeMoney; + double HStdPay = list[0].HStdPay; + string HUseFlag = list[0].HUseFlag; + + + if (!DBUtility.ClsPub.AllowNumber(HNumber)) + { + objJsonResult.code = "0"; + objJsonResult.count = 0; + objJsonResult.Message = "浠g爜涓笉鑳藉嚭鐜拌繛缁��.鈥欏苟涓旈浣嶆湯浣嶄笉鑳戒负鈥�.鈥欙紒"; + objJsonResult.data = null; + return objJsonResult; + } + + + + //鑻AINDI閲嶅鍒欓噸鏂拌幏鍙� + oCN.BeginTran(); + //涓昏〃 + oCN.RunProc("Insert Into Gy_EquipMent " + + "(HNumber,HName,HHelpCode,HShortNumber,HParentID" + + ",HLevel,HEndFlag,HStopflag,HRemark,HMadeMoney,HStdPay) " + + " values('" + HNumber + "','" + HName + "','" + HHelpCode + "','" + HShortNumber + "'," + HParentID + + "," + HLevel + ",'" + HEndFlag + "','" + HStopFlag + "','" + HRemark + "','" + HMadeMoney + "','" + HStdPay + "'" + + ") "); + //淇敼涓婄骇涓洪潪鏈骇浠g爜 + oCN.RunProc("Update Gy_EquipMent set HEndflag=0 where HItemID=" + HParentID, ref DBUtility.ClsPub.sExeReturnInfo); + oCN.Commit(); + objJsonResult.code = "1"; + objJsonResult.count = 1; + objJsonResult.Message = "鏂板鍗曟嵁鎴愬姛锛�"; + //objJsonResult.data = null; + return objJsonResult; + } + catch(Exception e) + { + oCN.RollBack(); + objJsonResult.code = "0"; + objJsonResult.count = 0; + objJsonResult.Message = "Exception锛�" + e.Message; + objJsonResult.data = null; + return objJsonResult; + } + } + + + /// <summary> + /// 淇敼鍗曟嵁-淇濆瓨鎸夐挳 + ///鍙傛暟锛歴tring sql銆� + ///杩斿洖鍊硷細object銆� + /// </summary> + [Route("Gy_EquipMent/AddBill1")] + [HttpPost] + public object AddBill1([FromBody] JObject oMain) + { + + try + { + DAL.ClsGy_EquipMent_Ctl oDept = new DAL.ClsGy_EquipMent_Ctl(); + DAL.ClsGy_EquipMent_View oDeptHlp = new DAL.ClsGy_EquipMent_View(); + + var _value = oMain["oMain"].ToString(); + string msg1 = _value.ToString(); + string[] sArray = msg1.Split(new string[] { ";" }, StringSplitOptions.RemoveEmptyEntries); + string msg2 = sArray[0].ToString(); + string msg3 = sArray[1].ToString(); + string msg4 = sArray[2].ToString(); + string msg5 = sArray[3].ToString(); + //鍙嶅簭鍒楀寲 + msg2 = "[" + msg2.ToString() + "]"; + List<EquipMent> list = Newtonsoft.Json.JsonConvert.DeserializeObject<List<EquipMent>>(msg2); + + long HItemID = list[0].HItemID; + string HNumber = list[0].HNumber; + string HName = list[0].HName; + string HShortNumber = list[0].HShortNumber; + string HHelpCode = list[0].HHelpCode; + long HParentID = list[0].HParentID; + long HLevel = list[0].HLevel; + string HEndFlag = list[0].HEndFlag; + string HStopFlag = list[0].HStopFlag; + string HRemark = list[0].HRemark; + double HMadeMoney = list[0].HMadeMoney; + double HStdPay = list[0].HStdPay; + string HUseFlag = list[0].HUseFlag; + + + ////鍒ゆ柇鏉冮檺 + //if (!ClsPub.Security_Log(msg5, 1, true, msg4)) + //{ + // objJsonResult.code = "0"; + // objJsonResult.count = 0; + // objJsonResult.Message = "娌℃湁鎵惧埌璇ュ姛鑳芥ā鍧楋紒"; + // objJsonResult.data = null; + // return objJsonResult; + //} + + + if (!DBUtility.ClsPub.AllowNumber(HNumber)) + { + objJsonResult.code = "0"; + objJsonResult.count = 0; + objJsonResult.Message = "浠g爜涓笉鑳藉嚭鐜拌繛缁��.鈥欏苟涓旈浣嶆湯浣嶄笉鑳戒负鈥�.鈥欙紒"; + objJsonResult.data = null; + return objJsonResult; + } + + //if (oDept.HavSameNumber(HItemID, HNumber)) + //{ + // objJsonResult.code = "0"; + // objJsonResult.count = 0; + // objJsonResult.Message = "浠g爜閲嶅锛�"; + // objJsonResult.data = null; + // return objJsonResult; + //} + + + //鑻AINDI閲嶅鍒欓噸鏂拌幏鍙� + oCN.BeginTran(); + //涓昏〃 + oCN.RunProc("Update Gy_EquipMent set " + + " HNumber='" + HNumber + "'" + + ",HName='" + HName + "'" + + ",HShortNumber='" + HShortNumber + "'" + + ",HParentID=" + HParentID + + ",HRemark= '" + HRemark + "' Where HItemID=" + HItemID, ref DBUtility.ClsPub.sExeReturnInfo); + //淇敼瀛愰」鐩唬鐮� + //oCN.RunProc("exec h_p_Gy_UpdateNumber Gy_EquipMent,'" + HNumber + ".','" + this.HOldNumber + ".'", ref DBUtility.ClsPub.sExeReturnInfo); + //灏嗕笂绾� 涓洪潪鏈骇 + oCN.RunProc("Update Gy_EquipMent set HEndflag=0 where HItemID=" + HParentID, ref DBUtility.ClsPub.sExeReturnInfo); + // + oCN.Commit(); + objJsonResult.code = "1"; + objJsonResult.count = 1; + objJsonResult.Message = "淇敼鍗曟嵁鎴愬姛锛�"; + //objJsonResult.data = null; + return objJsonResult; + } + catch (Exception e) + { + oCN.RollBack(); + objJsonResult.code = "0"; + objJsonResult.count = 0; + objJsonResult.Message = "Exception锛�" + e.Message; + objJsonResult.data = null; + return objJsonResult; + } + } + + + /// <summary> + /// 鑾峰彇鏈�澶у熀纭�璧勬枡ID + ///鍙傛暟锛歴tring sql銆� + ///杩斿洖鍊硷細object銆� + /// </summary> + [Route("Gy_EquipMent/GetMAXBillID")] + [HttpGet] + public object GetMAXBillID() + { + try + { + ds = oCN.RunProcReturn("select max(hitemid)+1 hitemid from Gy_EquipMent", "Gy_EquipMent"); + + objJsonResult.code = "1"; + objJsonResult.count = 1; + objJsonResult.Message = ""; + objJsonResult.data = ds.Tables[0]; + return objJsonResult; + } + catch (Exception e) + { + objJsonResult.code = "0"; + objJsonResult.count = 0; + objJsonResult.Message = "Exception锛�" + e.ToString(); + objJsonResult.data = null; + return objJsonResult; + } + } + + + /// <summary> + /// 閮ㄩ棬鍒楄〃淇敼鎸夐挳鏂规硶 + ///鍙傛暟锛歴tring sql銆� + ///杩斿洖鍊硷細object銆� + /// </summary> + [Route("Gy_EquipMent/xg")] + [HttpGet] + public object xg(long HInterID) + { + try + { + ds = oCN.RunProcReturn("select * from Gy_EquipMent where HItemID=" + HInterID, "Gy_EquipMent"); + + objJsonResult.code = "1"; + objJsonResult.count = 1; + objJsonResult.Message = ""; + objJsonResult.data = ds.Tables[0]; + return objJsonResult; + } + catch (Exception e) + { + objJsonResult.code = "0"; + objJsonResult.count = 0; + objJsonResult.Message = "Exception锛�" + e.ToString(); + objJsonResult.data = null; + return objJsonResult; + } + } + + + + [Route("Gy_EquipMent/LoadTree")] + [HttpGet] + public object LoadTree_Json(string sWhere) + { + SQLHelper.ClsCN SubCn = new SQLHelper.ClsCN(); + //ds = oCN.RunProcReturn("select * from h_v_IF_GroupList " + sWhere, "h_v_IF_GroupList"); + ds = oCN.RunProcReturn("select * from h_v_DepartmentLoadTree", "h_v_DepartmentLoadTree"); + if (ds == null || ds.Tables[0].Rows.Count == 0) + { + objJsonResult.code = "0"; + objJsonResult.count = 0; + objJsonResult.Message = "false锛�"; + objJsonResult.data = null; + return objJsonResult; + } + else + { + objJsonResult.code = "1"; + objJsonResult.count = 1; + objJsonResult.Message = "Sucess锛�"; + objJsonResult.data = ds.Tables[0]; + return objJsonResult; + } + } + + + + // + } +} \ No newline at end of file diff --git a/WebAPI/Controllers/BaseSet/Gy_MaterialController.cs b/WebAPI/Controllers/BaseSet/Gy_MaterialController.cs index 4578cc0..04b5522 100644 --- a/WebAPI/Controllers/BaseSet/Gy_MaterialController.cs +++ b/WebAPI/Controllers/BaseSet/Gy_MaterialController.cs @@ -117,6 +117,8 @@ + + /// <summary> /// 杩斿洖妫�鍏锋。妗堝垪琛� ///鍙傛暟锛歴tring sql銆� @@ -214,6 +216,321 @@ } + + /// <summary> + /// 鏂板妯″叿妗f-淇濆瓨鎸夐挳 + ///鍙傛暟锛歴tring sql銆� + ///杩斿洖鍊硷細object銆� + /// </summary> + [Route("Gy_Mould_Edit/AddBill")] + [HttpPost] + public object AddBill([FromBody] JObject sMainSub) + { + var _value = sMainSub["sMainSub"].ToString(); + string msg1 = _value.ToString(); + oCN.BeginTran(); + //淇濆瓨涓昏〃 + objJsonResult = AddBillMain(msg1); + if (objJsonResult.code == "0") + { + oCN.RollBack(); + objJsonResult.code = "0"; + objJsonResult.count = 0; + objJsonResult.Message = objJsonResult.Message; + objJsonResult.data = null; + return objJsonResult; + } + oCN.Commit(); + objJsonResult.code = "1"; + objJsonResult.count = 1; + objJsonResult.Message = "鏂板鍗曟嵁鎴愬姛锛�"; + return objJsonResult; + } + + public json AddBillMain(string msg1) + { + string[] sArray = msg1.Split(new string[] { ";" }, StringSplitOptions.RemoveEmptyEntries); + string msg2 = sArray[0].ToString(); + try + { + msg2 = "[" + msg2.ToString() + "]"; + List<Gy_Mould> mainList = Newtonsoft.Json.JsonConvert.DeserializeObject<List<Gy_Mould>>(msg2); + string BillType = "7507"; + long HInterID = mainList[0].HInterID;//閫掑叆type寰楀埌鐨勫崟鎹甀D + string HBillNo = mainList[0].HBillNo;//閫掑叆type寰楀埌鐨勫崟鎹彿 + DateTime HDate = mainList[0].HDate;//鏃ユ湡 + int HYear = 2021; + double HPeriod = 1; + string HMouldNo = mainList[0].HMouldNo; + string HName = mainList[0].HName; + string HModel = mainList[0].HModel; + string HModel2 = mainList[0].HModel2; + string HDiameter = mainList[0].HDiameter; + string HSubjoin = mainList[0].HSubjoin; + string HSubjoin2 = mainList[0].HSubjoin2; + string HPICNo = mainList[0].HPICNo; + string HWorkMaterModel = mainList[0].HWorkMaterModel; + long HMaterID = mainList[0].HMaterID; + long HMouleTypeID = mainList[0].HMouldTypeID; + long HUnitID = mainList[0].HUnitID; + DateTime HOutComDate = mainList[0].HOutComDate; + string HOutComNo = mainList[0].HOutComNo; + long HDeptID = mainList[0].HDeptID; + long HSupID = mainList[0].HSupID; + string HMouldStatus = mainList[0].HMouldStatus; + long HWHID = mainList[0].HWHID; + long HRoutingID = mainList[0].HRoutingID; + long HBOMID = mainList[0].HBOMID; + string HVersion = mainList[0].HVersion; + long HSPGroupID = mainList[0].HSPGroupID; + long HSPID = mainList[0].HSPID; + Double HDesignLife = mainList[0].HDesignLife; + Double HUseLife = mainList[0].HUseLife; + Double HLeaveLife = mainList[0].HLeaveLife; + Double HProdQty = mainList[0].HProdQty; + Double HProdWeight = mainList[0].HProdWeight; + string HRemark = mainList[0].HRemark; + string HMaker = mainList[0].HMaker; + string HMaterNumber = mainList[0].HMaterNumber; + string HSupNumber = mainList[0].HSupNumber; + long HPrintQty = mainList[0].HPrintQty; + + //涓昏〃 + oCN.RunProc("Insert Into Gy_MouldFileMain " + + "(HBillType,HBillSubType,HInterID,HBillNo,HDate" + + ",HYear,HPeriod,HRemark,HMaker,HMakeDate" + + ",HMouldNo,HName,HModel,HModel2,HDiameter" + + ",HSubjoin,HSubjoin2,HPICNo,HWorkMaterModel" + + ",HMaterID,HMaterNumber,HMouldType,HUnitID" + + ",HOutComDate,HOutComNo,HDeptID,HSupID,HSupNumber" + + ",HPrintQty,HMouldStatus,HWhID,HRoutingID" + + ",HBomID,HVersion,HSPGroupID,HSPID,HDesignLife" + + ",HUseLife,HLeaveLife,HProdQty,HProdWeight" + + ") " + + " values('" + BillType + "','" + BillType + "'," + HInterID + ",'" + HBillNo + "','" + HDate + "'" + + "," + HYear + "," + HPeriod + ",'" + HRemark + "','" + HMaker + "',getdate()" + + ",'" + HMouldNo + "','" + HName + "','" + HModel + "','" + HModel2 + "','" + HDiameter + "'" + + "," + HSubjoin + ",'" + HSubjoin2 + "','" + HPICNo + "','" + HWorkMaterModel + "'" + + "," + HMaterID + ",'" + HMaterNumber + "'," + HMouleTypeID + "," + HUnitID + + ",'" + HOutComDate + "','" + HOutComNo + "'," + HDeptID + "," + HSupID + ",'" + HSupNumber + "'" + + "," + HPrintQty + ",'" + HMouldStatus + "'," + HWHID + "," + HRoutingID + + "," + HBOMID + ",'" + HVersion + "'," + HSPGroupID + "," + HSPID + ",'" + HDesignLife + "'" + + ",'" + HUseLife + "','" + HLeaveLife + "','" + HProdQty + "','" + HProdWeight + "'" + + ") "); + + + //瀛愯〃 + oCN.RunProc("Insert into Gy_MouldFileSub " + + " (HInterID,HEntryID,HRemark" + + ",HSourceInterID,HSourceEntryID,HSourceBillNo,HSourceBillType,HRelationQty,HRelationMoney" + + ") " + + " values('" + HInterID + "',0,''" + + ",0,0,'','',0,0 " + + ") "); + if (objJsonResult.code == "0") + { + objJsonResult.code = "0"; + objJsonResult.count = 0; + objJsonResult.Message = objJsonResult.Message; + objJsonResult.data = null; + return objJsonResult; + } + + objJsonResult.code = "1"; + objJsonResult.count = 1; + objJsonResult.Message = null; + objJsonResult.data = null; + return objJsonResult; + } + catch (Exception e) + { + objJsonResult.code = "0"; + objJsonResult.count = 0; + objJsonResult.Message = "Exception锛�" + e.ToString(); + objJsonResult.data = null; + return objJsonResult; + } + } + + + /// <summary> + /// 淇敼鍗曟嵁-淇濆瓨鎸夐挳 + ///鍙傛暟锛歴tring sql銆� + ///杩斿洖鍊硷細object銆� + /// </summary> + [Route("Gy_Mould_Edit/AddBill1")] + [HttpPost] + public object AddBill1([FromBody] JObject oMain) + { + + try + { + DAL.ClsGy_MouldFile oMould = new DAL.ClsGy_MouldFile(); + DAL.ClsGy_MouldFileMain_View oDeptHlp = new DAL.ClsGy_MouldFileMain_View(); + + var _value = oMain["oMain"].ToString(); + string msg1 = _value.ToString(); + string[] sArray = msg1.Split(new string[] { ";" }, StringSplitOptions.RemoveEmptyEntries); + string msg2 = sArray[0].ToString(); + string msg3 = sArray[1].ToString(); + string msg4 = sArray[2].ToString(); + string msg5 = sArray[3].ToString(); + //鍙嶅簭鍒楀寲 + msg2 = "[" + msg2.ToString() + "]"; + List<Gy_Mould> mainList = Newtonsoft.Json.JsonConvert.DeserializeObject<List<Gy_Mould>>(msg2); + string BillType = "7507"; + long HInterID = mainList[0].HInterID;//閫掑叆type寰楀埌鐨勫崟鎹甀D + string HBillNo = mainList[0].HBillNo;//閫掑叆type寰楀埌鐨勫崟鎹彿 + DateTime HDate = mainList[0].HDate;//鏃ユ湡 + int HYear = 2021; + double HPeriod = 1; + string HMouldNo = mainList[0].HMouldNo; + string HName = mainList[0].HName; + string HModel = mainList[0].HModel; + string HModel2 = mainList[0].HModel2; + string HDiameter = mainList[0].HDiameter; + string HSubjoin = mainList[0].HSubjoin; + string HSubjoin2 = mainList[0].HSubjoin2; + string HPICNo = mainList[0].HPICNo; + string HWorkMaterModel = mainList[0].HWorkMaterModel; + long HMaterID = mainList[0].HMaterID; + long HMouleTypeID = mainList[0].HMouldTypeID; + long HUnitID = mainList[0].HUnitID; + DateTime HOutComDate = mainList[0].HOutComDate; + string HOutComNo = mainList[0].HOutComNo; + long HDeptID = mainList[0].HDeptID; + long HSupID = mainList[0].HSupID; + string HMouldStatus = mainList[0].HMouldStatus; + long HWHID = mainList[0].HWHID; + long HRoutingID = mainList[0].HRoutingID; + long HBOMID = mainList[0].HBOMID; + string HVersion = mainList[0].HVersion; + long HSPGroupID = mainList[0].HSPGroupID; + long HSPID = mainList[0].HSPID; + Double HDesignLife = mainList[0].HDesignLife; + Double HUseLife = mainList[0].HUseLife; + Double HLeaveLife = mainList[0].HLeaveLife; + Double HProdQty = mainList[0].HProdQty; + Double HProdWeight = mainList[0].HProdWeight; + string HRemark = mainList[0].HRemark; + string HMaker = mainList[0].HMaker; + string HMaterNumber = mainList[0].HMaterNumber; + string HSupNumber = mainList[0].HSupNumber; + long HPrintQty = mainList[0].HPrintQty; + + + + + + //鑻AINDI閲嶅鍒欓噸鏂拌幏鍙� + oCN.BeginTran(); + //涓昏〃 + oCN.RunProc("Update Gy_MouldFileMain set " + + " HMouldNo='" + HMouldNo + "'" + + ",HName='" + HName + "'" + + ",HModel='" + HModel + "'" + + ",HModel2= '" + HModel2 + "' Where HInterID=" + HInterID, ref DBUtility.ClsPub.sExeReturnInfo); + //淇敼瀛愰」鐩唬鐮� + //oCN.RunProc("exec h_p_Gy_UpdateNumber Gy_Department,'" + HNumber + ".','" + this.HOldNumber + ".'", ref DBUtility.ClsPub.sExeReturnInfo); + //灏嗕笂绾� 涓洪潪鏈骇 + // oCN.RunProc("Update Gy_Department set HEndflag=0 where HItemID=" + HInterID, ref DBUtility.ClsPub.sExeReturnInfo); + // + oCN.Commit(); + objJsonResult.code = "1"; + objJsonResult.count = 1; + objJsonResult.Message = "淇敼鍗曟嵁鎴愬姛锛�"; + //objJsonResult.data = null; + return objJsonResult; + } + catch (Exception e) + { + oCN.RollBack(); + objJsonResult.code = "0"; + objJsonResult.count = 0; + objJsonResult.Message = "Exception锛�" + e.Message; + objJsonResult.data = null; + return objJsonResult; + } + } + + /// <summary> + /// 纾ㄥ叿妗f淇敼鎸夐挳鏂规硶 + ///鍙傛暟锛歴tring sql銆� + ///杩斿洖鍊硷細object銆� + /// </summary> + [Route("Gy_Mould_Edit/xg")] + [HttpGet] + public object xg(long HInterID) + { + try + { + ds = oCN.RunProcReturn("select * from Gy_MouldFileMain where HInterID=" + HInterID, "Gy_MouldFileMain"); + + objJsonResult.code = "1"; + objJsonResult.count = 1; + objJsonResult.Message = ""; + objJsonResult.data = ds.Tables[0]; + return objJsonResult; + } + catch (Exception e) + { + objJsonResult.code = "0"; + objJsonResult.count = 0; + objJsonResult.Message = "Exception锛�" + e.ToString(); + objJsonResult.data = null; + return objJsonResult; + } + } + + /// <summary> + /// 妯″叿妗f鍒犻櫎鎸夐挳 + ///鍙傛暟锛歴tring sql銆� + ///杩斿洖鍊硷細object銆� + /// </summary> + [Route("Gy_Mould_Edit/Delete_Json")] + [HttpGet] + public object Delete_Json(long HItemID) + { + DAL.ClsGy_MouldFile oBill = new DAL.ClsGy_MouldFile(); + try + { + if (oBill.DeleteBill(HItemID, ref DBUtility.ClsPub.sExeReturnInfo)) + { + //鍐欏叆鏃ュ織 + ClsPub.Add_Log("", "鍒犻櫎椤圭洰锛屼唬鐮侊細" + oBill.omodel.HMouldNo + ",鍚嶇О锛�" + oBill.omodel.HName, ClsPub.CurUserName); + //鏇存柊涓婄骇涓� 鏈骇 + objJsonResult.code = "1"; + objJsonResult.count = 1; + objJsonResult.Message = "鍒犻櫎鎴愬姛"; + objJsonResult.data = null; + return objJsonResult; + } + else + { + objJsonResult.code = "0"; + objJsonResult.count = 0; + objJsonResult.Message = "鍒犻櫎澶辫触"; + objJsonResult.data = null; + return objJsonResult; + } + //ds = oCN.RunProcReturn("delete from Gy_Department where HItemID = " + HItemID, "Gy_Department"); + + objJsonResult.code = "1"; + objJsonResult.count = 1; + objJsonResult.Message = "鍒犻櫎鎴愬姛"; + objJsonResult.data = null; + return objJsonResult; + } + catch (Exception e) + { + objJsonResult.code = "0"; + objJsonResult.count = 0; + objJsonResult.Message = "Exception锛�" + e.ToString(); + objJsonResult.data = null; + return objJsonResult; + } + } + // } } \ No newline at end of file diff --git a/WebAPI/Controllers/BaseSet/Gy_SupplierController.cs b/WebAPI/Controllers/BaseSet/Gy_SupplierController.cs index 5da7344..ce1908d 100644 --- a/WebAPI/Controllers/BaseSet/Gy_SupplierController.cs +++ b/WebAPI/Controllers/BaseSet/Gy_SupplierController.cs @@ -68,6 +68,296 @@ + + /// <summary> + /// 鑾峰彇鏈�澶у熀纭�璧勬枡ID + ///鍙傛暟锛歴tring sql銆� + ///杩斿洖鍊硷細object銆� + /// </summary> + [Route("Gy_Supplier/GetMAXBillID")] + [HttpGet] + public object GetMAXBillID() + { + try + { + ds = oCN.RunProcReturn("select max(hitemid)+1 hitemid from Gy_Supplier", "Gy_Supplier"); + + objJsonResult.code = "1"; + objJsonResult.count = 1; + objJsonResult.Message = ""; + objJsonResult.data = ds.Tables[0]; + return objJsonResult; + } + catch (Exception e) + { + objJsonResult.code = "0"; + objJsonResult.count = 0; + objJsonResult.Message = "Exception锛�" + e.ToString(); + objJsonResult.data = null; + return objJsonResult; + } + } + + /// <summary> + /// 渚涘簲鍟嗗垪琛ㄤ慨鏀规寜閽柟娉� + ///鍙傛暟锛歴tring sql銆� + ///杩斿洖鍊硷細object銆� + /// </summary> + [Route("Gy_Supplier/xg")] + [HttpGet] + public object xg(long HInterID) + { + try + { + ds = oCN.RunProcReturn("select * from Gy_Supplier where HItemID=" + HInterID, "Gy_Supplier"); + + objJsonResult.code = "1"; + objJsonResult.count = 1; + objJsonResult.Message = ""; + objJsonResult.data = ds.Tables[0]; + return objJsonResult; + } + catch (Exception e) + { + objJsonResult.code = "0"; + objJsonResult.count = 0; + objJsonResult.Message = "Exception锛�" + e.ToString(); + objJsonResult.data = null; + return objJsonResult; + } + } + + + /// <summary> + /// 鏂板鍗曟嵁-淇濆瓨鎸夐挳 + ///鍙傛暟锛歴tring sql銆� + ///杩斿洖鍊硷細object銆� + /// </summary> + [Route("Gy_Supplier/AddBill")] + [HttpPost] + public object AddBill([FromBody] JObject oMain) + { + try + { + var _value = oMain["oMain"].ToString(); + string msg1 = _value.ToString(); + //鍙嶅簭鍒楀寲 + msg1 = "[" + msg1.ToString() + "]"; + + DAL.ClsGy_Supplier_Ctl oDept = new DAL.ClsGy_Supplier_Ctl(); + DAL.ClsGy_Supplier_View oDeptHlp = new DAL.ClsGy_Supplier_View(); + + + + List<Supplier> list = Newtonsoft.Json.JsonConvert.DeserializeObject<List<Supplier>>(msg1); + + long HItemID = list[0].HItemID; + string HNumber = list[0].HNumber; + string HShortNumber = list[0].HShortNumber; + string HName = list[0].HName; + long HParentID = list[0].HParentID; + long HLevel = list[0].HLevel; + string HEndFlag = list[0].HEnfFlag; + string HHelpCode = list[0].HHelpCode; + string HShortName = list[0].HShortName; + string HAddress = list[0].HAddress; + string HLinkMan = list[0].HLinkMan; + string HLinkPhone = list[0].HLinkPhone; + string HBankAccount = list[0].HMobilePhone; + string HFax = list[0].HFax; + string HPostalCode = list[0].HPostalCode; + string HEmail = list[0].HEmail; + string HBank = list[0].HBank; + string HMobilePhone = list[0].HMobilePhone; + string HTaxNum = list[0].HTaxNum; + Double HTaxRate = list[0].HTaxRate; + string HCountry = list[0].HCountry; + string HCorMan = list[0].HCorMan; + string HEnglishName = list[0].HEnglishName; + string HEnglishAddress = list[0].HEnglishAddress; + long HCurID = list[0].HCurID; + long HSSID = list[0].HSSID; + long HAreaID = list[0].HAreaID; + string HUseFlag = list[0].HUseFlag; + long HERPItemID = list[0].HERPItemID; + DateTime HMakeTime = list[0].HMakeTime; + long HCreateOrgID = list[0].HCreateOrgID; + long HUseOrgID = list[0].HUseOrgID; + string HRemark = list[0].HRemark; + + + if (!DBUtility.ClsPub.AllowNumber(HNumber)) + { + objJsonResult.code = "0"; + objJsonResult.count = 0; + objJsonResult.Message = "浠g爜涓笉鑳藉嚭鐜拌繛缁��.鈥欏苟涓旈浣嶆湯浣嶄笉鑳戒负鈥�.鈥欙紒"; + objJsonResult.data = null; + return objJsonResult; + } + + + + //鑻AINDI閲嶅鍒欓噸鏂拌幏鍙� + oCN.BeginTran(); + //涓昏〃 + oCN.RunProc("Insert Into Gy_Supplier " + + "(HNumber,HName,HHelpCode,HShortNumber,HParentID" + + ",HLevel,HEndFlag,HStopflag,HRemark" + + ",HShortName,HAddress,HLinkMan,HLinkPhone,HMobilePhone" + + ",HFax,HPostalCode,HEmail,HBank,HBankAccount" + + ",HTaxNum,HTaxRate,HCountry,HCorMan,HEnglishName" + + ",HEnglishAddress,HCurID,HSSID,HAreaID) " + + " values('" + HNumber + "','" + HName + "','" + HHelpCode + "','" + HShortNumber + "','" + HParentID + "'" + + "," + HLevel + ",'0','0','" + HRemark + "'" + + ",'" + HShortName + "','" + HAddress + "','" + HLinkMan + "','" + HLinkPhone + "','" + HMobilePhone + "'" + + ",'" + HFax + "','" + HPostalCode + "','" + HEmail + "','" + HBank + "','" + HBankAccount + "'" + + ",'" + HTaxNum + "','" + HTaxRate + "','" + HCountry + "','" + HCorMan + "','" + HEnglishName + "'" + + ",'" + HEnglishAddress + "'," + HCurID + "," + HSSID + "," + HAreaID + + ") "); + //淇敼涓婄骇涓洪潪鏈骇浠g爜 + oCN.RunProc("Update Gy_Supplier set HEndflag=0 where HItemID=" + HParentID, ref DBUtility.ClsPub.sExeReturnInfo); + oCN.Commit(); + objJsonResult.code = "1"; + objJsonResult.count = 1; + objJsonResult.Message = "鏂板鍗曟嵁鎴愬姛锛�"; + //objJsonResult.data = null; + return objJsonResult; + } + catch (Exception e) + { + oCN.RollBack(); + objJsonResult.code = "0"; + objJsonResult.count = 0; + objJsonResult.Message = "Exception锛�" + e.Message; + objJsonResult.data = null; + return objJsonResult; + } + } + + + /// <summary> + /// 淇敼鍗曟嵁-淇濆瓨鎸夐挳 + ///鍙傛暟锛歴tring sql銆� + ///杩斿洖鍊硷細object銆� + /// </summary> + [Route("Gy_Supplier/AddBill1")] + [HttpPost] + public object AddBill1([FromBody] JObject oMain) + { + + try + { + DAL.ClsGy_Supplier_Ctl oDept = new DAL.ClsGy_Supplier_Ctl(); + DAL.ClsGy_Supplier_View oDeptHlp = new DAL.ClsGy_Supplier_View(); + + var _value = oMain["oMain"].ToString(); + string msg1 = _value.ToString(); + string[] sArray = msg1.Split(new string[] { ";" }, StringSplitOptions.RemoveEmptyEntries); + string msg2 = sArray[0].ToString(); + string msg3 = sArray[1].ToString(); + string msg4 = sArray[2].ToString(); + string msg5 = sArray[3].ToString(); + //鍙嶅簭鍒楀寲 + msg2 = "[" + msg2.ToString() + "]"; + List<Supplier> list = Newtonsoft.Json.JsonConvert.DeserializeObject<List<Supplier>>(msg2); + + long HItemID = list[0].HItemID; + string HNumber = list[0].HNumber; + string HShortNumber = list[0].HShortNumber; + string HName = list[0].HName; + long HParentID = list[0].HParentID; + long HLevel = list[0].HLevel; + string HEndFlag = list[0].HEnfFlag; + string HHelpCode = list[0].HHelpCode; + string HShortName = list[0].HShortName; + string HAddress = list[0].HAddress; + string HLinkMan = list[0].HLinkMan; + string HLinkPhone = list[0].HLinkPhone; + string HBankAccount = list[0].HMobilePhone; + string HFax = list[0].HFax; + string HPostalCode = list[0].HPostalCode; + string HEmail = list[0].HEmail; + string HBank = list[0].HBank; + string HMobilePhone = list[0].HMobilePhone; + string HTaxNum = list[0].HTaxNum; + Double HTaxRate = list[0].HTaxRate; + string HCountry = list[0].HCountry; + string HCorMan = list[0].HCorMan; + string HEnglishName = list[0].HEnglishName; + string HEnglishAddress = list[0].HEnglishAddress; + long HCurID = list[0].HCurID; + long HSSID = list[0].HSSID; + long HAreaID = list[0].HAreaID; + string HUseFlag = list[0].HUseFlag; + long HERPItemID = list[0].HERPItemID; + DateTime HMakeTime = list[0].HMakeTime; + long HCreateOrgID = list[0].HCreateOrgID; + long HUseOrgID = list[0].HUseOrgID; + string HRemark = list[0].HRemark; + + + //鍒ゆ柇鏉冮檺 + if (!ClsPub.Security_Log(msg5, 1, true, msg4)) + { + objJsonResult.code = "0"; + objJsonResult.count = 0; + objJsonResult.Message = "娌℃湁鎵惧埌璇ュ姛鑳芥ā鍧楋紒"; + objJsonResult.data = null; + return objJsonResult; + } + + + if (!DBUtility.ClsPub.AllowNumber(HNumber)) + { + objJsonResult.code = "0"; + objJsonResult.count = 0; + objJsonResult.Message = "浠g爜涓笉鑳藉嚭鐜拌繛缁��.鈥欏苟涓旈浣嶆湯浣嶄笉鑳戒负鈥�.鈥欙紒"; + objJsonResult.data = null; + return objJsonResult; + } + + if (oDept.HavSameNumber(HItemID, HNumber)) + { + objJsonResult.code = "0"; + objJsonResult.count = 0; + objJsonResult.Message = "浠g爜閲嶅锛�"; + objJsonResult.data = null; + return objJsonResult; + } + + + //鑻AINDI閲嶅鍒欓噸鏂拌幏鍙� + oCN.BeginTran(); + //涓昏〃 + oCN.RunProc("Update Gy_Supplier set " + + " HNumber='" + HNumber + "'" + + ",HName='" + HName + "'" + + ",HShortNumber='" + HShortNumber + "'" + + ",HParentID=" + HParentID + + ",HRemark= '" + HRemark + "' Where HItemID=" + HItemID, ref DBUtility.ClsPub.sExeReturnInfo); + //淇敼瀛愰」鐩唬鐮� + //oCN.RunProc("exec h_p_Gy_UpdateNumber Gy_Department,'" + HNumber + ".','" + this.HOldNumber + ".'", ref DBUtility.ClsPub.sExeReturnInfo); + //灏嗕笂绾� 涓洪潪鏈骇 + oCN.RunProc("Update Gy_Supplier set HEndflag=0 where HItemID=" + HParentID, ref DBUtility.ClsPub.sExeReturnInfo); + // + oCN.Commit(); + objJsonResult.code = "1"; + objJsonResult.count = 1; + objJsonResult.Message = "淇敼鍗曟嵁鎴愬姛锛�"; + //objJsonResult.data = null; + return objJsonResult; + } + catch (Exception e) + { + oCN.RollBack(); + objJsonResult.code = "0"; + objJsonResult.count = 0; + objJsonResult.Message = "Exception锛�" + e.Message; + objJsonResult.data = null; + return objJsonResult; + } + } + // } } \ No newline at end of file diff --git a/WebAPI/Controllers/SCGL/QC_LastPieceCheckBillController.cs b/WebAPI/Controllers/SCGL/QC_LastPieceCheckBillController.cs index 68e40ab..f4ee717 100644 --- a/WebAPI/Controllers/SCGL/QC_LastPieceCheckBillController.cs +++ b/WebAPI/Controllers/SCGL/QC_LastPieceCheckBillController.cs @@ -25,6 +25,179 @@ /// <summary> + /// 鏂板鍗曟嵁-淇濆瓨鎸夐挳 + ///鍙傛暟锛歴tring sql銆� + ///杩斿洖鍊硷細object銆� + /// </summary> + [Route("QC_LastPieceCheckBill/AddBill")] + [HttpPost] + public object AddBill([FromBody] JObject sMainSub) + { + var _value = sMainSub["sMainSub"].ToString(); + string msg1 = _value.ToString(); + oCN.BeginTran(); + //淇濆瓨涓昏〃 + objJsonResult = AddBillMain(msg1); + if (objJsonResult.code == "0") + { + oCN.RollBack(); + objJsonResult.code = "0"; + objJsonResult.count = 0; + objJsonResult.Message = objJsonResult.Message; + objJsonResult.data = null; + return objJsonResult; + } + oCN.Commit(); + objJsonResult.code = "1"; + objJsonResult.count = 1; + objJsonResult.Message = "鏂板鍗曟嵁鎴愬姛锛�"; + return objJsonResult; + } + + public json AddBillMain(string msg1) + { + string[] sArray = msg1.Split(new string[] { ";" }, StringSplitOptions.RemoveEmptyEntries); + string msg2 = sArray[0].ToString(); + string msg3 = sArray[1].ToString(); + try + { + msg2 = "[" + msg2.ToString() + "]"; + List<QC_LastPieceCheckBillMain> mainList = Newtonsoft.Json.JsonConvert.DeserializeObject<List<QC_LastPieceCheckBillMain>>(msg2); + string BillType = "7507"; + long HInterID = mainList[0].HInterID;//閫掑叆type寰楀埌鐨勫崟鎹甀D + string HBillNo = mainList[0].HBillNo;//閫掑叆type寰楀埌鐨勫崟鎹彿 + DateTime HDate = mainList[0].HDate;//鏃ユ湡 + int HYear = 2021; + double HPeriod = 1; + long HBillStatus = mainList[0].HBillStatus; + long HCheckItemNowID = mainList[0].HCheckItemNowID; + long HCkeckItemNextID = mainList[0].HCheckItemNextID; + long HCheckFlowID = mainList[0].HCheckFlowID; + string HRemark = mainList[0].HRemark;//澶囨敞 + string HBacker = mainList[0].HBacker; + DateTime HBackDate = mainList[0].HBackDate; + string HBackRemark = mainList[0].HBackRemark; + string HChecker = mainList[0].HChecker; + DateTime HCheckDate = mainList[0].HCheckDate; + string HMaker = mainList[0].HMaker; + DateTime HMakeDate = mainList[0].HMakeDate; + string HUpDater = mainList[0].HUpDater; + DateTime HUpDateDate = mainList[0].HUpDateDate; + string HCloseMan = mainList[0].HCloseMan; + DateTime HCloseDate = mainList[0].HCloseDate; + string HCloseType = mainList[0].HCloseType; + string HDeleteMan = mainList[0].HDeleteMan; + DateTime HDeleteDate = mainList[0].HDeleteDate; + string HMainSourceBillType = mainList[0].HMainSourceBillType; + long HMainSourceInterID = mainList[0].HMainSourceInterID; + long HMainSourceEntryID = mainList[0].HMainSourceEntryID; + string HMainSourceBillNo = mainList[0].HMainSourceBillNo; + double HPrintQty = mainList[0].HPrintQty; + long HICMOInterID = mainList[0].HICMOInterID; + string HICMOBillNo = mainList[0].HICMOBillNo; + Double HInStockQty = mainList[0].HInStockQty; + Double HCheckQty = mainList[0].HCheckQty; + Double HRightQty = mainList[0].HRightQTy; + Double HBadQty = mainList[0].HBadQty; + long HMaterID = mainList[0].HMaterID; + long HFirstCheckEmp = mainList[0].HFirstCheckEmp; + string HCheckerResult = mainList[0].HCheckerResult; + long HCheckDept = mainList[0].HCheckDept; + long HCheckDept2 = mainList[0].HCheckDept2; + string HCheckDeptResult = mainList[0].HCheckDeptResult; + string HCheckDeptResult2 = mainList[0].HCheckDeptResult2; + string HBarCode = mainList[0].HBarCode; + string HStoveBatchNo = mainList[0].HStoveBatchNo; + long HCusID = mainList[0].HCusID; + string HSortBillNo = mainList[0].HSortBillNo; + string HContrctBatchNo = mainList[0].HContrctBatchNo; + long HProdAreaID = mainList[0].HProdAreaID; + long HProdTypeID = mainList[0].HProdTypeID; + long HRoutingInterID = mainList[0].HRoutingInterID; + long HDrawingDireID = mainList[0].HDrawingDireID; + long HPackTypeID = mainList[0].HPackTypeID; + + //涓昏〃 + oCN.RunProc("Insert Into QC_LastPieceCheckBillMain " + + "(HBillType,HBillSubType,HInterID,HBillNo,HBillStatus,HDate,HMaker,HMakeDate" + + ",HYear,HPeriod,HRemark" + + ",HICMOInterID,HICMOBillNo,HInStockQTy,HCheckQty,HRightQty" + + ",HBadQty,HMaterID,HFirstCheckEmp,HCheckerResult,HCheckDept" + + ",HCheckDeptResult,HCheckDept2,HCheckDeptResult2,HBarCode,HStoveBatchNo" + + ",HCusID,HSortBillNo,HContrctBatchNo,HProdAreaID,HProdTypeID" + + ",HRoutingInterID,HDrawingDireID,HPackTypeID" + + ") " + + " values('" + BillType + "','" + BillType + "'," + HInterID + ",'" + HBillNo + "','" + HBillStatus + "','" + HDate + "','" + HMaker + "','" + HDate + "'" + + "," + HYear + "," + HPeriod + ",'" + HRemark + "'" + + "," + 0 + ",'" + HICMOBillNo + "'," + HInStockQty + "," + HCheckQty + "," + HRightQty + + "," + HBadQty + "," + HMaterID + "," + HFirstCheckEmp + ",'" + HCheckerResult + "'," + HCheckDept + + ",'" + HCheckDeptResult + "'," + HCheckDept2 + ",'" + HCheckDeptResult2 + "','" + HBarCode + "','" + HStoveBatchNo + "'" + + "," + HCusID + ",'" + HSortBillNo + "','" + HContrctBatchNo + "'," + HProdAreaID + "," + HProdTypeID + + "," + HRoutingInterID + "," + HDrawingDireID + "," + HPackTypeID + + ") "); + + + //淇濆瓨瀛愯〃 + objJsonResult = AddBillSub(msg3, HInterID); + if (objJsonResult.code == "0") + { + objJsonResult.code = "0"; + objJsonResult.count = 0; + objJsonResult.Message = objJsonResult.Message; + objJsonResult.data = null; + return objJsonResult; + } + + objJsonResult.code = "1"; + objJsonResult.count = 1; + objJsonResult.Message = null; + objJsonResult.data = null; + return objJsonResult; + } + catch (Exception e) + { + objJsonResult.code = "0"; + objJsonResult.count = 0; + objJsonResult.Message = "Exception锛�" + e.ToString(); + objJsonResult.data = null; + return objJsonResult; + } + } + + public json AddBillSub(string msg3, long HInterID) + { + List<QC_LastPieceCheckBillSub> subList = Newtonsoft.Json.JsonConvert.DeserializeObject<List<QC_LastPieceCheckBillSub>>(msg3); + for (int i = 0; i < subList.ToArray().Length; i++) + { + long HSourceInterID = 0;//婧愬崟涓诲唴鐮� + long HSourceEntryID = 0;//婧愬崟瀛愬唴鐮� + string HSourceBillNo = "";//婧愬崟鍗曞彿 + string HSourceBillType = "";//婧愬崟绫诲瀷 + double HRelationQty = 0;//鍏宠仈鏁伴噺 + double HRelationMoney = 0;//鍏宠仈閲戦 + + + oCN.RunProc("Insert into QC_LastPieceCheckBillSub " + + "(HInterID,HEntryID,HCloseMan,HRemark,HSourceInterID,HSourceEntryID" + + ",HSourceBillNo,HSourceBillType,HRelationQty,HRelationMoney" + + ",HQCCheckClassID,HQCCheckItemID,HQCStd,HResult,HQCRelValue" + + ",HProcCheckEmp" + + ") values(" + + HInterID + "," + i + ",'" + subList[i].HCloseMan + "','" + subList[i].HRemark + "'," + HSourceInterID + "," + HSourceEntryID + "" + + ",'" + HSourceBillNo + "','" + HSourceBillType + "'," + HRelationQty + "," + HRelationMoney + + "," + subList[i].HQCCheckClassID + "," + subList[i].HQCCheckItemID + ",'" + subList[i].HQCStd + "','" + subList[i].HResult + "','" + subList[i].HQCRelvalue + "'" + + "," + subList[i].HProCheckEmp + "" + + ") "); + } + + objJsonResult.code = "1"; + objJsonResult.count = 1; + objJsonResult.Message = null; + objJsonResult.data = null; + return objJsonResult; + } + + /// <summary> /// 杩斿洖浜у搧鍏ュ簱妫�楠屽崟鍒楄〃 ///鍙傛暟锛歴tring sql銆� ///杩斿洖鍊硷細object銆� diff --git a/WebAPI/Controllers/Sc_MouldOtherInBillController.cs b/WebAPI/Controllers/Sc_MouldOtherInBillController.cs new file mode 100644 index 0000000..a862f37 --- /dev/null +++ b/WebAPI/Controllers/Sc_MouldOtherInBillController.cs @@ -0,0 +1,372 @@ +锘縰sing Newtonsoft.Json.Linq; +using System; +using System.Collections.Generic; +using System.Data; +using System.Web.Http; +using WebAPI.Models; +using Pub_Class; +namespace WebAPI.Controllers +{ + /** + * 鎵捐揣鍗曞崟 + */ + public class Sc_MouldOtherInBillController : ApiController + { + private json objJsonResult = new json(); + public DataSet ds = new DataSet(); + public WebServer webserver = new WebServer(); + SQLHelper.ClsCN oCN = new SQLHelper.ClsCN(); + + /// <summary> + /// 鏍规嵁鍖呰鍗� 杩斿洖姝ゅ寘瑁呭崟鍐呯殑鐩稿叧淇℃伅 + /// </summary> + /// <returns></returns> + + /// <summary> + /// 妯″叿鍏朵粬鍏ュ簱鍗曞垪琛� + /// </summary> + /// <returns></returns> + [Route("Sc_MouldOtherInBill/GetMouldOtherInBillList")] + [HttpGet] + public object GetMouldOtherInBillList(string sWhere) + { + try + { + + ds = Sc_MouldOtherInBillList_s(sWhere); + if (ds == null || ds.Tables[0].Rows.Count <= 0) + { + objJsonResult.code = "0"; + objJsonResult.count = 0; + objJsonResult.Message = "娌℃湁杩斿洖浠讳綍璁板綍锛�"; + objJsonResult.data = null; + return objJsonResult; + } + else + { + objJsonResult.code = "1"; + objJsonResult.count = 1; + objJsonResult.Message = "杩斿洖璁板綍鎴愬姛锛�"; + objJsonResult.data = ds.Tables[0]; + return objJsonResult; + } + } + catch (Exception ex) + { + objJsonResult.code = "0"; + objJsonResult.count = 0; + objJsonResult.Message = "娌℃湁杩斿洖浠讳綍璁板綍锛�" + ex.ToString(); + objJsonResult.data = null; + return objJsonResult; + } + } + + #region sql璇彞 + + + public static DataSet Sc_MouldOtherInBillList_s(string sWhere) + { + return new SQLHelper.ClsCN().RunProcReturn("select * from h_v_Sc_MouldOtherInBillList ", "h_v_Sc_MouldOtherInBillList"); + } + + + + + #endregion + + /// <summary> + /// 淇敼鍗曟嵁-淇濆瓨鎸夐挳 + ///鍙傛暟锛歴tring sql銆� + ///杩斿洖鍊硷細object銆� + /// </summary> + [Route("Sc_MouldOtherInBill/AddBill1")] + [HttpPost] + public object AddBill1([FromBody] JObject oMain) + { + + try + { + DAL.ClsSc_MouldOtherInBill oMould = new DAL.ClsSc_MouldOtherInBill(); + + var _value = oMain["oMain"].ToString(); + string msg1 = _value.ToString(); + string[] sArray = msg1.Split(new string[] { ";" }, StringSplitOptions.RemoveEmptyEntries); + string msg2 = sArray[0].ToString(); + string msg3 = sArray[1].ToString(); + string msg4 = sArray[2].ToString(); + string msg5 = sArray[3].ToString(); + //鍙嶅簭鍒楀寲 + msg2 = "[" + msg2.ToString() + "]"; + List<Sc_MouldStockBillMain> list = Newtonsoft.Json.JsonConvert.DeserializeObject<List<Sc_MouldStockBillMain>>(msg2); + + long HItemID = list[0].HInterID; + string HBillNo = list[0].HBillNo; + DateTime HDate = list[0].HDate; + long HSCWHID = list[0].HSCWHID; + long HWHID = list[0].HWHID; + long HSupID = list[0].HSupID; + long HSecManagerID = list[0].HSecManagerID; + long HRepairID = list[0].HRepairID; + long HManagerID = list[0].HManagerID; + string HUpDater = list[0].HUpDater; + long HDeptID = list[0].HDeptID; + + + + + + + //鑻AINDI閲嶅鍒欓噸鏂拌幏鍙� + oCN.BeginTran(); + //涓昏〃 + oCN.RunProc("Update Sc_MouldStockBillMain set " + + " HSCWHID=" + HSCWHID + + ",HWHID=" + HWHID + + ",HSupID=" + HSupID + + ",HSecManagerID=" + HSecManagerID + + ",HManagerID= " + HManagerID + " Where HInterID=" + HItemID, ref DBUtility.ClsPub.sExeReturnInfo); + //淇敼瀛愰」鐩唬鐮� + //oCN.RunProc("exec h_p_Gy_UpdateNumber Gy_EquipMent,'" + HNumber + ".','" + this.HOldNumber + ".'", ref DBUtility.ClsPub.sExeReturnInfo); + //灏嗕笂绾� 涓洪潪鏈骇 + //oCN.RunProc("Update Gy_EquipMent set HEndflag=0 where HItemID=" + HParentID, ref DBUtility.ClsPub.sExeReturnInfo); + // + oCN.Commit(); + objJsonResult.code = "1"; + objJsonResult.count = 1; + objJsonResult.Message = "淇敼鍗曟嵁鎴愬姛锛�"; + //objJsonResult.data = null; + return objJsonResult; + } + catch (Exception e) + { + oCN.RollBack(); + objJsonResult.code = "0"; + objJsonResult.count = 0; + objJsonResult.Message = "Exception锛�" + e.Message; + objJsonResult.data = null; + return objJsonResult; + } + } + + + + /// <summary> + /// 妯″叿鍏ュ簱鍗曞垪琛ㄥ垹闄ゆ寜閽� + ///鍙傛暟锛歴tring sql銆� + ///杩斿洖鍊硷細object銆� + /// </summary> + [Route("Sc_MouldOtherInBill/Delete_Json")] + [HttpGet] + public object Delete_Json(long HItemID) + { + DAL.ClsSc_MouldOtherInBill oMould = new DAL.ClsSc_MouldOtherInBill(); + try + { + if (oMould.omodel.HBillStatus > 1) + { + objJsonResult.code = "0"; + objJsonResult.count = 0; + objJsonResult.Message = "鍗曟嵁褰撳墠澶勪簬涓嶈兘鍒犻櫎鐘舵��,涓嶈兘鍒犻櫎锛�"; + objJsonResult.data = null; + return objJsonResult; + } + if (oMould.omodel.HChecker != "") + { + objJsonResult.code = "0"; + objJsonResult.count = 0; + objJsonResult.Message = "鍗曟嵁宸茬粡瀹℃牳,涓嶈兘鍒犻櫎锛�"; + objJsonResult.data = null; + return objJsonResult; + } + // + if (oMould.DeleteBill(HItemID, ref DBUtility.ClsPub.sExeReturnInfo)) + { + //鍐欏叆鏃ュ織 + ClsPub.Add_Log("", "鍒犻櫎椤圭洰锛屼唬鐮侊細" + oMould.omodel.HNumber + ",鍚嶇О锛�" + oMould.omodel.HName, ClsPub.CurUserName); + //鏇存柊涓婄骇涓� 鏈骇 + objJsonResult.code = "1"; + objJsonResult.count = 1; + objJsonResult.Message = "鍒犻櫎鎴愬姛"; + objJsonResult.data = null; + return objJsonResult; + } + else + { + objJsonResult.code = "0"; + objJsonResult.count = 0; + objJsonResult.Message = "鍒犻櫎澶辫触"; + objJsonResult.data = null; + return objJsonResult; + } + //ds = oCN.RunProcReturn("delete from Gy_Department where HItemID = " + HItemID, "Gy_Department"); + + objJsonResult.code = "1"; + objJsonResult.count = 1; + objJsonResult.Message = "鍒犻櫎鎴愬姛"; + objJsonResult.data = null; + return objJsonResult; + } + catch (Exception e) + { + objJsonResult.code = "0"; + objJsonResult.count = 0; + objJsonResult.Message = "Exception锛�" + e.ToString(); + objJsonResult.data = null; + return objJsonResult; + } + } + + + + +/// <summary> +/// 鏂板鍗曟嵁-淇濆瓨鎸夐挳 +///鍙傛暟锛歴tring sql銆� +///杩斿洖鍊硷細object銆� +/// </summary> +[Route("Sc_MouldOtherInBill/AddBill")] + [HttpPost] + public object AddBill([FromBody] JObject sMainSub) + { + var _value = sMainSub["sMainSub"].ToString(); + string msg1 = _value.ToString(); + oCN.BeginTran(); + //淇濆瓨涓昏〃 + objJsonResult = AddBillMain(msg1); + if (objJsonResult.code == "0") + { + oCN.RollBack(); + objJsonResult.code = "0"; + objJsonResult.count = 0; + objJsonResult.Message = objJsonResult.Message; + objJsonResult.data = null; + return objJsonResult; + } + oCN.Commit(); + objJsonResult.code = "1"; + objJsonResult.count = 1; + objJsonResult.Message = "鏂板鍗曟嵁鎴愬姛锛�"; + objJsonResult.data = null; + return objJsonResult; + } + + public json AddBillMain(string msg1) + { + string[] sArray = msg1.Split(new string[] { ";" }, StringSplitOptions.RemoveEmptyEntries); + string msg2 = sArray[0].ToString(); + string msg3 = sArray[1].ToString(); + try + { + msg2 = "[" + msg2.ToString() + "]"; + List<Sc_MouldStockBillMain> mainList = Newtonsoft.Json.JsonConvert.DeserializeObject<List<Sc_MouldStockBillMain>>(msg2); + string BillType = "3795"; + long HInterID = mainList[0].HInterID;//閫掑叆type寰楀埌鐨勫崟鎹甀D + string HBillNo = mainList[0].HBillNo;//閫掑叆type寰楀埌鐨勫崟鎹彿 + DateTime HDate = mainList[0].HDate;//鏃ユ湡 + int HYear = 2021; + double HPeriod = 1; + string HRemark = mainList[0].HRemark;//澶囨敞 + string HMaker = mainList[0].HMaker;//鍒跺崟浜� + long HSCWHID = mainList[0].HSCWHID;// + long HSupID = mainList[0].HSupID;// + long HEmpID = mainList[0].HEmpID; + long HManagerID = mainList[0].HManagerID;// + long HWHID = mainList[0].HWHID;// + long HProcID = mainList[0].HProcID;// + long HSecManagerID = mainList[0].HSecManagerID;// + long HKeeperID = mainList[0].HKeeperID;// + long HDeptID = mainList[0].HDeptID; + string HExplanation = mainList[0].HExplanation;// + string HInnerBillNo = mainList[0].HInnerBillNo;// + string HRedBlueFlag = mainList[0].HRedBlueFlag;// + string HRepairType = mainList[0].HRepairType;// + long HRepairID = mainList[0].HRepairID;// + + //涓昏〃 + oCN.RunProc("Insert Into Sc_MouldStockBillMain " + + "(HBillType,HBillSubType,HInterID,HBillNo,HDate" + + ",HYear,HPeriod,HRemark,HMaker,HMakeDate" + + ",HSupID,HWHID,HSCWHID,HEmpID,HManagerID,HSecManagerID" + + ",HKeeperID,HDeptID,HExplanation,HInnerBillNo,HRedBlueFlag" + + ") " + + " values('" + BillType + "','" + BillType + "'," + HInterID + ",'" + HBillNo + "','" + HDate + "'" + + "," + HYear + "," + HPeriod + ",'" + HRemark + "','" + HMaker + "',getdate()" + + "," + HSupID + "," + HWHID + "," + HSCWHID + "," + HEmpID + "," + HManagerID + "," + HSecManagerID + + "," + HKeeperID + "," + HDeptID + ",'" + HExplanation + "','" + HInnerBillNo + "','" + HRedBlueFlag + "'" + + ") "); + + //淇濆瓨瀛愯〃 + objJsonResult = AddBillSub(msg3, HInterID); + if (objJsonResult.code == "0") + { + objJsonResult.code = "0"; + objJsonResult.count = 0; + objJsonResult.Message = objJsonResult.Message; + objJsonResult.data = null; + return objJsonResult; + } + objJsonResult.code = "1"; + objJsonResult.count = 1; + objJsonResult.Message = null; + objJsonResult.data = null; + return objJsonResult; + } + catch (Exception e) + { + objJsonResult.code = "0"; + objJsonResult.count = 0; + objJsonResult.Message = "Exception锛�" + e.ToString(); + objJsonResult.data = null; + return objJsonResult; + } + } + + public json AddBillSub(string msg3, long HInterID) + { + List<Sc_MouldStockBillSub> subList = Newtonsoft.Json.JsonConvert.DeserializeObject<List<Sc_MouldStockBillSub>>(msg3); + for (int i = 0; i < subList.ToArray().Length; i++) + { + long HMaterID = 0;//鐗╂枡ID + long HPropertyID = 0;// + long HSecUnitID = 0;// + long HUnitID = 0;// + long HWHID = 0;// + long HSCWHID = 0;// + long HSPID = 0;// + long HSCSPID = 0;// + long HSPGroupID = 0;// + long HLifeUnitID = 0;// + + oCN.RunProc("Insert into Sc_MouldStockBillSub " + + " (HInterID,HEntryID,HCloseMan,HEntryCloseDate,HCloseType,HRemark" + + ",HSourceInterID,HSourceEntryID,HSourceBillNo,HSourceBillType,HRelationQty,HRelationMoney" + + ",HMaterID,HPropertyID,HSecUnitID,HSecUnitRate,HUnitID,HQtyMust" + + ",HQty,HPrice,HMoney,HWHID,HSCWHID,HSPID" + + ",HDesignLife,HLeaveLife,HUseLife,HUseLifeQty" + + ",HSCSPID,HSPGroupID,HBatchNo" + + ",HNewModel,HWallThickness,HHardness,HLastProdModel,HDiameter,HBackFlag" + + ",HQtyRel,HNewLifeQty,HNowModel,HNowLife" + + ",HMouldType,HInitModel,HInitDesignLife,HLifeUnitID" + + ") values(" + + HInterID + "," + i + ",'','','','" + subList[i].HRemark + "'" + + "," + subList[i].HSourceInterID + "," + subList[i].HSourceEntryID + ",'" + subList[i].HSourceBillNo + "','" + subList[i].HSourceBillType + "','" + subList[i].HrelationQty + "','" + subList[i].HrelationQty + "'" + + "," + HMaterID + "," + HPropertyID + "," + HSecUnitID + ",'" + subList[i].HSecUnitRate + "','" + HUnitID + "','" + subList[i].HQtyMust + "'" + + ",'" + subList[i].HQty + "','" + subList[i].HPrice + "','" + subList[i].HMoney + "'," + HWHID + "," + HSCWHID + "," + HSPID + + ",'" + subList[i].HDesignLife + "','" + subList[i].HLeaveLife + "','" + subList[i].HUseLife + "','" + subList[i].HUseLifeQty + "'" + + "," + HSCSPID + "," + HSPGroupID + ",'" + subList[i].HBatchNo + "'" + + ",'" + subList[i].HNewModel + "','" + subList[i].HWallThickness + "','" + subList[i].HHardness + "','" + subList[i].HLastProdModel + "','" + subList[i].HDiameter + "','" + subList[i].HBackFlag + "'" + + ",'" + subList[i].HQtyRel + "','" + subList[i].HNewLifeQty + "','" + subList[i].HNowModel + "','" + subList[i].HNowLife + "'" + + ",'" + subList[i].HMouldType + "','" + subList[i].HInitModel + "','" + subList[i].HInitDesignLife + "'," + HLifeUnitID + + ") "); + } + + objJsonResult.code = "1"; + objJsonResult.count = 1; + objJsonResult.Message = null; + objJsonResult.data = null; + return objJsonResult; + } + + + } +} \ No newline at end of file diff --git a/WebAPI/ListModels.cs b/WebAPI/ListModels.cs index 16975d4..2e50628 100644 --- a/WebAPI/ListModels.cs +++ b/WebAPI/ListModels.cs @@ -1179,5 +1179,31 @@ List<Models.ClsSb_EquipRepairWorkBillSub> list = Newtonsoft.Json.JsonConvert.DeserializeObject<List<Models.ClsSb_EquipRepairWorkBillSub>>(jsonString); return list; } + + /// <summary> + /// 澶勭悊鏂板妯″叿鍏ュ簱鍗曚富琛ㄧ殑json + /// </summary> + /// <param name="jsonString"></param> + /// <returns></returns> + public List<Model.ClsSc_MouldOtherInBillMain> getObjectByJson_Sc_MouldOtherInBillMain(string jsonString) + { + jsonString = "[" + jsonString.ToString() + "]"; + List<Model.ClsSc_MouldOtherInBillMain> list = Newtonsoft.Json.JsonConvert.DeserializeObject<List<Model.ClsSc_MouldOtherInBillMain>>(jsonString); + return list; + } + + + /// <summary> + /// 澶勭悊鏂板妯″叿鍏ュ簱鍗曞瓙琛ㄧ殑json + /// </summary> + /// <param name="jsonString"></param> + /// <returns></returns> + public List<Model.ClsSc_MouldOtherInBillSub> getObjectByJson_Sc_MouldOtherInBillSub(string jsonString) + { + jsonString = "[" + jsonString.ToString() + "]"; + List<Model.ClsSc_MouldOtherInBillSub> list = Newtonsoft.Json.JsonConvert.DeserializeObject<List<Model.ClsSc_MouldOtherInBillSub>>(jsonString); + return list; + } + } } \ No newline at end of file diff --git a/WebAPI/Models/BillType.cs b/WebAPI/Models/BillType.cs new file mode 100644 index 0000000..5cc6057 --- /dev/null +++ b/WebAPI/Models/BillType.cs @@ -0,0 +1,42 @@ +锘縰sing System; +using System.Collections.Generic; +using System.Linq; +using System.Web; + +namespace WebAPI.Models +{ + public class BillType + { + public long HItemID { get; set; } + public string HNumber { get; set; } + public string HName { get; set; } + public string HTemplate { get; set; } + + public string HHeadTable { get; set; } + + public string HEntryTable { get; set; } + + public string HViewName { get; set; } + + public string HRightName { get; set; } + + + public string HCreator { get; set; } + + //public DateTime HCreateDate { get; set; } + + public string HUpDater { get; set; } + + //public DateTime HUpDateDate { get; set; } + + public string HChecker { get; set; } + + //public DateTime HCheckDate { get; set; } + + public string HDeleteMan { get; set; } + + //public DateTime HDeleteDate { get; set; } + + + } +} \ No newline at end of file diff --git a/WebAPI/Models/Customer.cs b/WebAPI/Models/Customer.cs new file mode 100644 index 0000000..5516a7a --- /dev/null +++ b/WebAPI/Models/Customer.cs @@ -0,0 +1,103 @@ +锘縰sing System; +using System.Collections.Generic; +using System.Linq; +using System.Web; + +namespace WebAPI.Models +{ + public class Customer + { + public long HItemID { get; set; } + public string HNumber { get; set; } + public string HShortNumber { get; set; } + public string HName { get; set; } + + public long HParentID { get; set; } + + public long HLevel { get; set; } + + public string HEndFlag { get; set; } + + public string HRemark { get; set; } + + public string HStopFlag { get; set; } + + public string HHelpCode { get; set; } + + public string HShortName { get; set; } + + public string HAddress { get; set; } + + public string HLinkMan { get; set; } + + public string HLinkPhone { get; set; } + + public string HMobilePhone { get; set; } + + public string HFax { get; set; } + + public string HPostalCode { get; set; } + + public string HEmail { get; set; } + + public string HBank { get; set; } + + public string HBankAccount { get; set; } + + public string HTaxNum { get; set; } + public double HTaxRate { get; set; } + + public string HCountry { get; set; } + + public string HCorMan { get; set; } + + public string HEnglishName { get; set; } + + public string HEnglishAddress { get; set; } + + public long HCurID { get; set; } + + public long HSSID { get; set; } + public long HAreaID { get; set; } + + public string HCusStatus { get; set; } + + public long HCusTypeID { get; set; } + + public string HUseFlag { get; set; } + + public long HCreditDate { get; set; } + + public long HCreditRatingDate { get; set; } + + public long HMaxCreditRatingDate { get; set; } + + public double HMonthUseQty { get; set; } + + public double HForecastCreditRating { get; set; } + + public long HCreditLevelID { get; set; } + + public double HCountAccrualRating { get; set; } + + public double HSubsidyAccrualRating { get; set; } + + public double HCreditRating { get; set; } + + public double HMaxCreditRating { get; set; } + + public long HEmpID { get; set; } + + public long HERPItemID { get; set; } + + public DateTime HMakeTime { get; set; } + + public long HCREATEORGID { get; set; } + + public long HUSEORGID { get; set; } + + + + + } +} \ No newline at end of file diff --git a/WebAPI/Models/EquipMent.cs b/WebAPI/Models/EquipMent.cs new file mode 100644 index 0000000..d4e26e8 --- /dev/null +++ b/WebAPI/Models/EquipMent.cs @@ -0,0 +1,36 @@ +锘縰sing System; +using System.Collections.Generic; +using System.Linq; +using System.Web; + +namespace WebAPI.Models +{ + public class EquipMent + { + public long HItemID { get; set; } + public string HNumber { get; set; } + public string HName { get; set; } + public string HHelpCode { get; set; } + + public string HShortNumber { get; set; } + + public long HParentID { get; set; } + + public long HLevel { get; set; } + + public string HEndFlag { get; set; } + + public string HStopFlag { get; set; } + + public string HRemark { get; set; } + + public double HMadeMoney { get; set; } + + public double HStdPay { get; set; } + + + public string HUseFlag { get; set; } + + + } +} \ No newline at end of file diff --git a/WebAPI/Models/Gy_Mould.cs b/WebAPI/Models/Gy_Mould.cs new file mode 100644 index 0000000..fbb5e9e --- /dev/null +++ b/WebAPI/Models/Gy_Mould.cs @@ -0,0 +1,67 @@ +锘縰sing System; +using System.Collections.Generic; +using System.Linq; +using System.Web; + +namespace WebAPI.Models +{ + public class Gy_Mould + { + public long HInterID { get; set; } + public string HBillNo { get; set; } + public DateTime HDate { get; set; } + public string HRemark { get; set; } + public string HMouldNo { get; set; } + public string HName { get; set; } + public string HModel { get; set; } + public string HModel2 { get; set; } + public string HDiameter { get; set; } + public string HSubjoin { get; set; } + public string HSubjoin2 { get; set; } + public string HPICNo { get; set; } + public string HWorkMaterModel { get; set; } + public long HMaterID { get; set; } + public string HMaterNumber { get; set; } + public long HMouldTypeID { get; set; } + public long HUnitID { get; set; } + public DateTime HOutComDate { get; set; } + public string HOutComNo { get; set; } + public long HDeptID { get; set; } + public long HSupID { get; set; } + public string HSupNumber { get; set; } + public string HMouldStatus { get; set; } + public long HWHID { get; set; } + public long HRoutingID { get; set; } + public long HBomID { get; set; } + public string HVersion { get; set; } + public long HSPGroupID { get; set; } + + public long HSPID { get; set; } + public double HInitDesignLife { get; set; } + public string HInitModel { get; set; } + public double HDesignLife { get; set; } + public double HUseLife { get; set; } + public double HLeaveLife { get; set; } + public double HProdQty { get; set; } + + public double HProdWeight { get; set; } + public string HBarCode { get; set; } + public string HWallThickness { get; set; } + public string HHardness { get; set; } + public string HLastWorkMaterModel { get; set; } + public long HSecUnitID { get; set; } + public double HSecUnitRate { get; set; } + + public DateTime HInComDate { get; set; } + public string HNumber { get; set; } + public string HInnerBillNo { get; set; } + public long HLifeUnitID { get; set; } + + public long HBOMID { get; set; } + + public string HMaker { get; set; } + + public long HPrintQty { get; set; } + + } +} \ No newline at end of file diff --git a/WebAPI/Models/Gy_MouldSub.cs b/WebAPI/Models/Gy_MouldSub.cs new file mode 100644 index 0000000..40b38e9 --- /dev/null +++ b/WebAPI/Models/Gy_MouldSub.cs @@ -0,0 +1,26 @@ +锘縰sing System; +using System.Collections.Generic; +using System.Linq; +using System.Web; + +namespace WebAPI.Models +{ + public class Gy_MouldSub + { + public long HInterID { get; set; }// + public long HEntryID { get; set; }// + public string HCloseMan { get; set; }// + public DateTime HEntryCloseDate { get; set; }// + public string HCloseType { get; set; }// + public string HRemark { get; set; }// + public long HSourceInterID { get; set; }// + public long HSourceEntryID { get; set; }// + + public string HSourceBillNo { get; set; }// + public string HSourceBillType { get; set; }// + public double HRelationQty { get; set; }// + + public double HRelationMoney { get; set; }// + + } +} \ No newline at end of file diff --git a/WebAPI/Models/QC_LastPieceCheckBillMain.cs b/WebAPI/Models/QC_LastPieceCheckBillMain.cs new file mode 100644 index 0000000..32a5575 --- /dev/null +++ b/WebAPI/Models/QC_LastPieceCheckBillMain.cs @@ -0,0 +1,65 @@ +锘縰sing System; +using System.Collections.Generic; +using System.Linq; +using System.Web; + +namespace WebAPI.Models +{ + public class QC_LastPieceCheckBillMain + { + public long HInterID { get; set; } + public string HBillNo { get; set; } + public DateTime HDate { get; set; } + public long HBillStatus { get; set; } + public long HCheckItemNowID { get; set; } + public long HCheckItemNextID { get; set; } + public long HCheckFlowID { get; set; } + public string HRemark { get; set; } + public string HBacker { get; set; } + public DateTime HBackDate { get; set; } + public string HBackRemark { get; set; } + public string HChecker { get; set; } + public DateTime HCheckDate { get; set; } + public string HMaker { get; set; } + public DateTime HMakeDate { get; set; } + public string HUpDater { get; set; } + public DateTime HUpDateDate { get; set; } + public string HCloseMan { get; set; } + public DateTime HCloseDate { get; set; } + public string HCloseType { get; set; } + public string HDeleteMan { get; set; } + public DateTime HDeleteDate { get; set; } + public string HMainSourceBillType { get; set; } + public long HMainSourceInterID { get; set; } + public long HMainSourceEntryID { get; set; } + public string HMainSourceBillNo { get; set; } + public long HPrintQty { get; set; } + public long HSourceID { get; set; } + public long HICMOInterID { get; set; } + public string HICMOBillNo { get; set; } + public double HInStockQty { get; set; } + public double HCheckQty { get; set; } + public double HRightQTy { get; set; } + public double HBadQty { get; set; } + public long HMaterID { get; set; } + public long HFirstCheckEmp { get; set; } + public string HCheckerResult { get; set; } + public long HCheckDept { get; set; } + public string HCheckDeptResult { get; set; } + public long HCheckDept2 { get; set; } + public string HCheckDeptResult2 { get; set; } + public string HBarCode { get; set; } + public string HStoveBatchNo { get; set; } + public long HCusID { get; set; } + public string HSortBillNo { get; set; } + public string HContrctBatchNo { get; set; } + public long HProdAreaID { get; set; } + public long HProdTypeID { get; set; } + + + public long HRoutingInterID { get; set; } + public long HDrawingDireID { get; set; } + public long HPackTypeID { get; set; } + + } +} \ No newline at end of file diff --git a/WebAPI/Models/QC_LastPieceCheckBillSub.cs b/WebAPI/Models/QC_LastPieceCheckBillSub.cs new file mode 100644 index 0000000..0624d3c --- /dev/null +++ b/WebAPI/Models/QC_LastPieceCheckBillSub.cs @@ -0,0 +1,32 @@ +锘縰sing System; +using System.Collections.Generic; +using System.Linq; +using System.Web; + +namespace WebAPI.Models +{ + public class QC_LastPieceCheckBillSub + { + public long HInterID { get; set; } + public string HBillNo_bak { get; set; } + public long HEntryID { get; set; } + public string HCloseMan { get; set; } + public DateTime HEntryCloseDate { get; set; } + public string HCloseType { get; set; } + public string HRemark { get; set; } + public long HSourceInterID { get; set; } + public long HSourceEntryID { get; set; } + public string HSourceBillNo { get; set; } + public string HSourceBillType { get; set; } + public long HrelationQty { get; set; } + public double HRelationMoney { get; set; } + public long HQCCheckClassID { get; set; } + public long HQCCheckItemID { get; set; } + public string HQCStd { get; set; } + public string HQCRelvalue { get; set; } + public string HResult { get; set; } + public long HProCheckEmp { get; set; } + public DateTime HProcCheckTime { get; set; } + + } +} \ No newline at end of file diff --git a/WebAPI/Models/QC_OutCompCheckBillMain.cs b/WebAPI/Models/QC_OutCompCheckBillMain.cs new file mode 100644 index 0000000..7ce7872 --- /dev/null +++ b/WebAPI/Models/QC_OutCompCheckBillMain.cs @@ -0,0 +1,47 @@ +锘縰sing System; +using System.Collections.Generic; +using System.Linq; +using System.Web; + +namespace WebAPI.Models +{ + public class QC_OutCompCheckBillMain + { + public long HInterID { get; set; } + public string HBillNo { get; set; } + public DateTime HDate { get; set; } + public long HBillStatus { get; set; } + public long HCheckItemNowID { get; set; } + public long HCheckItemNextID { get; set; } + public long HCheckFlowID { get; set; } + public string HRemark { get; set; } + public string HBacker { get; set; } + public DateTime HBackDate { get; set; } + public string HBackRemark { get; set; } + public string HChecker { get; set; } + public DateTime HCheckDate { get; set; } + public string HMaker { get; set; } + public DateTime HMakeDate { get; set; } + public string HUpDater { get; set; } + public DateTime HUpDateDate { get; set; } + public string HCloseMan { get; set; } + public DateTime HCloseDate { get; set; } + public string HCloseType { get; set; } + public string HDeleteMan { get; set; } + public DateTime HDeleteDate { get; set; } + public string HMainSourceBillType { get; set; } + public long HMainSourceInterID { get; set; } + public long HMainSourceEntryID { get; set; } + public string HMainSourceBillNo { get; set; } + public long HPrintQty { get; set; } + public long HCusID { get; set; } + public long HMaterID { get; set; } + public double HInStockQty { get; set; } + public double HCheckQty { get; set; } + public double HRightQTy { get; set; } + public double HBadQty { get; set; } + public long HFirstCheckEmp { get; set; } + public string HCheckerResult { get; set; } + + } +} \ No newline at end of file diff --git a/WebAPI/Models/QC_OutCompCheckBillSub.cs b/WebAPI/Models/QC_OutCompCheckBillSub.cs new file mode 100644 index 0000000..607286d --- /dev/null +++ b/WebAPI/Models/QC_OutCompCheckBillSub.cs @@ -0,0 +1,29 @@ +锘縰sing System; +using System.Collections.Generic; +using System.Linq; +using System.Web; + +namespace WebAPI.Models +{ + public class QC_OutCompCheckBillSub + { + public long HInterID { get; set; } + public string HBillNo_bak { get; set; } + public long HEntryID { get; set; } + public string HCloseMan { get; set; } + public DateTime HEntryCloseDate { get; set; } + public string HCloseType { get; set; } + public string HRemark { get; set; } + public long HSourceInterID { get; set; } + public long HSourceEntryID { get; set; } + public string HSourceBillNo { get; set; } + public string HSourceBillType { get; set; } + public double HRelationQty { get; set; } + public double HRelationMoney { get; set; } + public long HQCCheckClassID { get; set; } + public long HQCCheckItemID { get; set; } + public string HQCStd { get; set; } + public string HResult { get; set; } + + } +} \ No newline at end of file diff --git a/WebAPI/Models/Sc_MouldStockBillMain.cs b/WebAPI/Models/Sc_MouldStockBillMain.cs new file mode 100644 index 0000000..fc23eac --- /dev/null +++ b/WebAPI/Models/Sc_MouldStockBillMain.cs @@ -0,0 +1,51 @@ +锘縰sing System; +using System.Collections.Generic; +using System.Linq; +using System.Web; + +namespace WebAPI.Models +{ + public class Sc_MouldStockBillMain + { + public long HInterID { get; set; } + public string HBillNo { get; set; } + public DateTime HDate { get; set; } + public long HBillStatus { get; set; } + public long HCheckItemNowID { get; set; } + public long HCheckItemNextID { get; set; } + public long HCheckFlowID { get; set; } + public string HRemark { get; set; } + public string HBacker { get; set; } + public DateTime HBackDate { get; set; } + public string HBackRemark { get; set; } + public string HChecker { get; set; } + public DateTime HCheckDate { get; set; } + public string HMaker { get; set; } + public DateTime HMakeDate { get; set; } + public string HUpDater { get; set; } + public DateTime HUpDateDate { get; set; } + public string HCloseMan { get; set; } + public DateTime HCloseDate { get; set; } + public string HCloseType { get; set; } + public string HDeleteMan { get; set; } + public DateTime HDeleteDate { get; set; } + public string HMainSourceBillType { get; set; } + public long HMainSourceInterID { get; set; } + public long HMainSourceEntryID { get; set; } + public string HMainSourceBillNo { get; set; } + public long HSCWHID { get; set; } + public long HSupID { get; set; } + public long HEmpID { get; set; } + public long HManagerID { get; set; } + public long HWHID { get; set; } + public long HProcID { get; set; } + public long HSecManagerID { get; set; } + public long HKeeperID { get; set; } + public long HDeptID { get; set; } + public string HExplanation { get; set; } + public string HInnerBillNo { get; set; } + public string HRedBlueFlag { get; set; } + public string HRepairType { get; set; } + public long HRepairID { get; set; } + } +} \ No newline at end of file diff --git a/WebAPI/Models/Sc_MouldStockBillSub.cs b/WebAPI/Models/Sc_MouldStockBillSub.cs new file mode 100644 index 0000000..ad24b85 --- /dev/null +++ b/WebAPI/Models/Sc_MouldStockBillSub.cs @@ -0,0 +1,71 @@ +锘縰sing System; +using System.Collections.Generic; +using System.Linq; +using System.Web; + +namespace WebAPI.Models +{ + public class Sc_MouldStockBillSub + { + public long HInterID { get; set; } + public string HBillNo_bak { get; set; } + public long HEntryID { get; set; } + public string HCloseMan { get; set; } + public DateTime HEntryCloseDate { get; set; } + public string HCloseType { get; set; } + public string HRemark { get; set; } + public long HSourceInterID { get; set; } + public long HSourceEntryID { get; set; } + public string HSourceBillNo { get; set; } + public string HSourceBillType { get; set; } + public long HrelationQty { get; set; } + public double HRelationMoney { get; set; } + public long HMaterID { get; set; } + public long HPropertyID { get; set; } + public long HSecUnitID { get; set; } + public double HSecUnitRate { get; set; } + public long HUnitID { get; set; } + public string HBatchNo { get; set; } + public double HQtyMust { get; set; } + + public double HQtyRel { get; set; } + public double HQty { get; set; } + public double HPrice { get; set; } + public double HMoney { get; set; } + public double HDesignLife { get; set; } + public double HLeaveLife { get; set; } + public double HUseLife { get; set; } + + public double HUseLifeQty { get; set; } + public double HNewLifeQty { get; set; } + public long HWHID { get; set; } + public long HSCWHID { get; set; } + public long HSPID { get; set; } + public long HSCSPID { get; set; } + public long HSPGroupID { get; set; } + + public string HNewModel { get; set; } + public string HWallThickness { get; set; } + public string HHardness { get; set; } + public string HLastProdModel { get; set; } + public string HDiameter { get; set; } + public string HBackFlag { get; set; } + public string HBarCode { get; set; } + + + public long HMouldType { get; set; } + public string HInitModel { get; set; } + public double HInitDesignLife { get; set; } + public long HLifeUnitID { get; set; } + public long HPOOrderInterID { get; set; } + public long HPOOrderEntryID { get; set; } + public string HPOOrderBillNo { get; set; } + + public long HSeOrderInterID { get; set; } + public long HSeOrderEntryID { get; set; } + public string HSeOrderBillNo { get; set; } + public string HNowModel { get; set; } + public double HNowLife { get; set; } + + } +} \ No newline at end of file diff --git a/WebAPI/Models/Supplier.cs b/WebAPI/Models/Supplier.cs new file mode 100644 index 0000000..eaa25f1 --- /dev/null +++ b/WebAPI/Models/Supplier.cs @@ -0,0 +1,77 @@ +锘縰sing System; +using System.Collections.Generic; +using System.Linq; +using System.Web; + +namespace WebAPI.Models +{ + public class Supplier + { + public long HItemID { get; set; } + public string HNumber { get; set; } + public string HShortNumber { get; set; } + public string HName { get; set; } + + public long HParentID { get; set; } + + public long HLevel { get; set; } + + public string HEnfFlag { get; set; } + + public string HRemark { get; set; } + + public string HStopflag { get; set; } + + public string HHelpCode { get; set; } + + public string HShortName { get; set; } + + public string HAddress { get; set; } + + public string HLinkMan { get; set; } + + public string HLinkPhone { get; set; } + + public string HMobilePhone { get; set; } + + public string HFax { get; set; } + + public string HPostalCode { get; set; } + + public string HEmail { get; set; } + + public string HBank { get; set; } + + public string HBankAccount { get; set; } + + public string HCorMan { get; set; } + + public string HTaxNum { get; set; } + + public double HTaxRate { get; set; } + + public string HCountry { get; set; } + + public string HEnglishName { get; set; } + + public string HEnglishAddress { get; set; } + + public long HCurID { get; set; } + + public long HSSID { get; set; } + + public long HAreaID { get; set; } + + public string HUseFlag { get; set; } + + public long HERPItemID { get; set; } + + public DateTime HMakeTime { get; set; } + + public long HCreateOrgID { get; set; } + + public long HUseOrgID { get; set; } + + + } +} \ No newline at end of file diff --git a/WebAPI/Models/SystemParameter.cs b/WebAPI/Models/SystemParameter.cs new file mode 100644 index 0000000..8c0b73c --- /dev/null +++ b/WebAPI/Models/SystemParameter.cs @@ -0,0 +1,26 @@ +锘縰sing System; +using System.Collections.Generic; +using System.Linq; +using System.Web; + +namespace WebAPI.Models +{ + public class SystemParameter + { + public long HInterID { get; set; } + public long HItemID { get; set; } + public string HModClass { get; set; } + public string HKey { get; set; } + + public string HCaption { get; set; } + + public string Hvalue { get; set; } + + public string HReadonly { get; set; } + + public string HExplanation { get; set; } + + + public string HFarmat { get; set; } + } +} \ No newline at end of file diff --git a/WebAPI/Models/Xt_AccountPeriod.cs b/WebAPI/Models/Xt_AccountPeriod.cs new file mode 100644 index 0000000..5ba94b7 --- /dev/null +++ b/WebAPI/Models/Xt_AccountPeriod.cs @@ -0,0 +1,19 @@ +锘縰sing System; +using System.Collections.Generic; +using System.Linq; +using System.Web; + +namespace WebAPI.Models +{ + public class Xt_AccountPeriod + { + public long id { get; set; } + public long HYear { get; set; } + public long HPeriod { get; set; } + public DateTime HBeginDate { get; set; } + public DateTime HEndDate { get; set; } + + public string HEndFlag { get; set; } + + } +} \ No newline at end of file diff --git a/WebAPI/Models/xtgnb.cs b/WebAPI/Models/xtgnb.cs new file mode 100644 index 0000000..a3a87e0 --- /dev/null +++ b/WebAPI/Models/xtgnb.cs @@ -0,0 +1,38 @@ +锘縰sing System; +using System.Collections.Generic; +using System.Linq; +using System.Web; + +namespace WebAPI.Models +{ + public class xtgnb + { + public long id { get; set; } + public string gnbm { get; set; } + public string gnsy { get; set; } + public string gnmc { get; set; } + + public string gnms { get; set; } + + public string sjgnbm { get; set; } + + public string mjbz { get; set; } + + public string MenuList { get; set; } + + + public string RightFlag { get; set; } + + + public string useflag { get; set; } + + + public string netmenulist { get; set; } + + + public string buyflag { get; set; } + + + + } +} \ No newline at end of file diff --git a/WebAPI/WebAPI.csproj b/WebAPI/WebAPI.csproj index 912572b..3c7f96b 100644 --- a/WebAPI/WebAPI.csproj +++ b/WebAPI/WebAPI.csproj @@ -320,6 +320,7 @@ <Compile Include="Controllers\BaseSet\Gy_MaintenanceItemController.cs" /> <Compile Include="Controllers\BaseSet\Gy_MaintenanceModeController.cs" /> <Compile Include="Controllers\BaseSet\Gy_StockPlaceController.cs" /> + <Compile Include="Controllers\BaseSet\Gy_EquipMentController.cs" /> <Compile Include="Controllers\BaseSet\Gy_WorkCenterController.cs" /> <Compile Include="Controllers\BaseSet\Gy_CurrencyController.cs" /> <Compile Include="Controllers\BaseSet\Gy_UnitController.cs" /> @@ -371,6 +372,7 @@ <Compile Include="Controllers\SCGL\QC_OutCompCheckBillController.cs" /> <Compile Include="Controllers\SCGL\QC_ProcessCheckBillController.cs" /> <Compile Include="Controllers\SCGL\Sc_QualityReportBillController.cs" /> + <Compile Include="Controllers\Sc_MouldOtherInBillController.cs" /> <Compile Include="Controllers\Sc_ProcessMangementController.cs" /> <Compile Include="Controllers\CJGL\Cj_StationEntrustInBillController.cs" /> <Compile Include="Controllers\LMESController.cs" /> @@ -425,6 +427,14 @@ <Compile Include="Models\ClsSc_MouldMaintainBillSub.cs" /> <Compile Include="Models\ClsSc_MouldStockBillMain.cs" /> <Compile Include="Models\ClsSc_MouldStockBillSub.cs" /> + <Compile Include="Models\EquipMent.cs" /> + <Compile Include="Models\Gy_Mould.cs" /> + <Compile Include="Models\Gy_MouldSub.cs" /> + <Compile Include="Models\Sc_MouldStockBillMain.cs" /> + <Compile Include="Models\Sc_MouldStockBillSub.cs" /> + <Compile Include="Models\Xt_AccountPeriod.cs" /> + <Compile Include="Models\xtgnb.cs" /> + <Compile Include="Models\SystemParameter.cs" /> <Compile Include="Models\ClsSc_ProcessSendWorkMain.cs" /> <Compile Include="Models\ClsWW_EntrustProcessReportBillMain.cs" /> <Compile Include="Models\ClsWW_EntrustProcessReportBillSub.cs" /> @@ -432,11 +442,18 @@ <Compile Include="Models\ClsWW_EntrustProcessSendOutBillSub.cs" /> <Compile Include="Models\ClsWW_EntrustWorkOrderBillMain.cs" /> <Compile Include="Models\ClsWW_EntrustWorkOrderBillSub.cs" /> + <Compile Include="Models\Customer.cs" /> + <Compile Include="Models\BillType.cs" /> + <Compile Include="Models\QC_OutCompCheckBillMain.cs" /> + <Compile Include="Models\QC_OutCompCheckBillSub.cs" /> + <Compile Include="Models\Supplier.cs" /> <Compile Include="Models\DocumentsView.cs" /> <Compile Include="Models\Gy_Group.cs" /> <Compile Include="Models\Gy_WorkCenter.cs" /> <Compile Include="Models\MaintenanceAcceptItem.cs" /> <Compile Include="Models\MaintenanceMode.cs" /> + <Compile Include="Models\QC_LastPieceCheckBillSub.cs" /> + <Compile Include="Models\QC_LastPieceCheckBillMain.cs" /> <Compile Include="Models\QC_ProcessCheckBillSub.cs" /> <Compile Include="Models\QC_ProcessCheckBillMain.cs" /> <Compile Include="Models\Gy_RoutingBillSub.cs" /> -- Gitblit v1.9.1