From 38189dd485d2d171bcca2e0ced35d6c8d187bdd3 Mon Sep 17 00:00:00 2001 From: yangle <admin@YINMOU> Date: 星期一, 06 二月 2023 08:32:16 +0800 Subject: [PATCH] Merge branch 'master' of http://101.37.171.70:10101/r/MES-WEB-API --- WebAPI/ListModels.cs | 14 + DAL/系统公用/ClsXt_BillSubType_Ctl.cs | 104 ++++++++ DAL/DAL.csproj | 1 Model/系统公用/ClsXt_BillSubType_Model.cs | 22 + WebAPI/Controllers/基础资料/基础资料/Gy_StaffController.cs | 174 ++++++++++++++ Model/Model.csproj | 1 WebAPI/Controllers/CGGL/Cg_POOrderBillController.cs | 3 WebAPI/WebAPI.csproj | 2 WebAPI/Controllers/BLL/Xt_BillSubTypeController.cs | 336 ++++++++++++++++++++++++++++ WebAPI/Controllers/生产管理/生产任务单/Sc_ICMOBillController.cs | 5 10 files changed, 657 insertions(+), 5 deletions(-) diff --git a/DAL/DAL.csproj b/DAL/DAL.csproj index f092791..d40e497 100644 --- a/DAL/DAL.csproj +++ b/DAL/DAL.csproj @@ -611,6 +611,7 @@ <Compile Include="鐢熶骇绠$悊\璁惧绠$悊\璁惧鎶曚骇\ClsSb_EquipStockInCheckBill.cs" /> <Compile Include="鐢熶骇绠$悊\璁惧绠$悊\ClsSb_EquipStatusChangeBill.cs" /> <Compile Include="鐢熶骇绠$悊\璁惧绠$悊\璁惧鎶曚骇\ClsSb_EquipWorkBeforeCheckBill.cs" /> + <Compile Include="绯荤粺鍏敤\ClsXt_BillSubType_Ctl.cs" /> <Compile Include="璐ㄦ绠$悊\ClsQC_FirstPieceCheckBill.cs" /> <Compile Include="璐ㄦ绠$悊\ClsQC_LastPieceCheckBill.cs" /> <Compile Include="璐ㄦ绠$悊\ClsQC_NoPassProdCheckBill.cs" /> diff --git "a/DAL/\347\263\273\347\273\237\345\205\254\347\224\250/ClsXt_BillSubType_Ctl.cs" "b/DAL/\347\263\273\347\273\237\345\205\254\347\224\250/ClsXt_BillSubType_Ctl.cs" new file mode 100644 index 0000000..d5ee902 --- /dev/null +++ "b/DAL/\347\263\273\347\273\237\345\205\254\347\224\250/ClsXt_BillSubType_Ctl.cs" @@ -0,0 +1,104 @@ +锘縰sing System; +using System.Collections.Generic; +using System.Text; +using System.Data; + +namespace DAL +{ + public class ClsXt_BillSubType_Ctl : DBUtility.ClsGy_Base_Ctl + { + SQLHelper.ClsCN oCn = new SQLHelper.ClsCN(); + //鍘熶唬鐮� 鐢ㄤ簬 鏇挎崲瀛愰」鐩� + public string HOldNumber; + public Model.ClsXt_BillSubType_Model oModel = new Model.ClsXt_BillSubType_Model(); + //鏂板 + public override bool AddNew() + { + + try + { + oCn.BeginTran(); + oCn.RunProc($@"insert into Xt_BillSubType(HNumber ,HName ,HShortNumber ,HParentID ,HLevel + ,HEndFlag ,HStopflag ,HRemark ,HHelpCode ,HUseFlag + ,HMakeTime ,HMakeEmp ,HCheckEmp ,HCheckTime ,HModifyEmp + ,HModifyTime ,HStopEmp ,HStopTime ,HUSEORGID,HCREATEORGID ,HBillType ,HIsDefault ,HBillTypeID) + values('{oModel.HNumber}','{oModel.HName}','{oModel.HShortNumber}',{oModel.HParentID}, + {oModel.HLevel},{(oModel.HEndFlag == true ? 1 : 0)},{(oModel.HStopflag == true ? 1 : 0)}, + '{oModel.HRemark}','{oModel.HHelpCode}','{oModel.HUseFlag}',GETDATE(),'{oModel.HMakeEmp}','','','' + ,'','','',{oModel.HUSEORGID},{oModel.HCREATEORGID},{oModel.HBillType},{0},'')" + , ref DBUtility.ClsPub.sExeReturnInfo); + //淇敼涓婄骇涓洪潪鏈骇浠g爜 + oCn.RunProc("Update " + MvarItemKey + " set HEndflag=0 where HItemID=" + oModel.HParentID, ref DBUtility.ClsPub.sExeReturnInfo); + oCn.Commit(); + return true; + } + catch (Exception e) + { + oCn.RollBack(); + throw (e); + } + } + + //淇敼 + public override bool ModifyByID(Int64 sItemID) + { + try + { + oCn.BeginTran(); + oCn.RunProc("Update " + MvarItemKey + " set " + + " HNumber='" + oModel.HNumber + "'" + + ",HName='" + oModel.HName + "'" + + ",HBillType='" + oModel.HBillType + "'" + + ",HShortNumber='" + oModel.HShortNumber + "'" + + ",HParentID=" + oModel.HParentID.ToString() + + ",HLevel=" + oModel.HLevel.ToString() + + ",HEndflag=" + Convert.ToString(oModel.HEndFlag ? 1 : 0) + + ",HStopflag=" + Convert.ToString(oModel.HStopflag ? 1 : 0) + + ",HRemark= '" + oModel.HRemark + "'" + + ",HHelpCode='" + oModel.HHelpCode + "'" + + ",HModifyEmp ='" + oModel.HMakeEmp + "'" + + ",HModifyTime =getdate()" + + " Where HItemID=" + sItemID, ref DBUtility.ClsPub.sExeReturnInfo); + //淇敼瀛愰」鐩唬鐮� + //oCn.RunProc("exec h_p_Gy_UpdateNumber '" + MvarItemKey + "','" + oModel.HNumber + ".','" + this.HOldNumber + ".'", ref DBUtility.ClsPub.sExeReturnInfo); + //灏嗕笂绾� 涓洪潪鏈骇 + oCn.RunProc("Update " + MvarItemKey + " set HEndflag=0 where HItemID=" + oModel.HParentID, ref DBUtility.ClsPub.sExeReturnInfo); + // + oCn.Commit(); + return true; + } + catch (Exception e) + { + oCn.RollBack(); + throw (e); + } + } + //鏍规嵁浠g爜鍒ゆ柇淇℃伅 + public override bool HavParentCode(string sCode, Int64 sItemID) + { + DataSet DS; + try + { + DS = oCn.RunProcReturn("Select * from " + MvarItemKey + " Where HStopflag=0 and HNumber='" + sCode + "' and HItemID<>" + sItemID, MvarItemKey, ref Pub_Class.ClsPub.sExeReturnInfo); + if (DS.Tables[0].Rows.Count == 0) + return false; + else + { + oModel.HItemID = Convert.ToInt64(DS.Tables[0].Rows[0]["HItemID"]); + return true; + } + } + catch (Exception e) + { + throw (e); + } + } + //鏋勯�犲嚱鏁� + public ClsXt_BillSubType_Ctl() + { + MvarItemKey = "Xt_BillSubType"; + MvarReportTitle = "鍗曟嵁瀛愮被鍨�"; + oModel = new Model.ClsXt_BillSubType_Model(); + } + } +} diff --git a/Model/Model.csproj b/Model/Model.csproj index 0a816cb..959d818 100644 --- a/Model/Model.csproj +++ b/Model/Model.csproj @@ -619,6 +619,7 @@ <Compile Include="绯荤粺鍏敤\ClsOA_EmpMessageBillModSub.cs" /> <Compile Include="绯荤粺鍏敤\ClsOA_FieldToChangeMain.cs" /> <Compile Include="绯荤粺鍏敤\ClsOA_FieldToChangeSub.cs" /> + <Compile Include="绯荤粺鍏敤\ClsXt_BillSubType_Model.cs" /> <Compile Include="绯荤粺鍏敤\ClsXt_BillType_Model.cs" /> <Compile Include="绯荤粺鍏敤\ClsXt_ModuleParameterMain.cs" /> <Compile Include="绯荤粺鍏敤\ClsXt_ModuleParameterSub.cs" /> diff --git "a/Model/\347\263\273\347\273\237\345\205\254\347\224\250/ClsXt_BillSubType_Model.cs" "b/Model/\347\263\273\347\273\237\345\205\254\347\224\250/ClsXt_BillSubType_Model.cs" new file mode 100644 index 0000000..6cfc50a --- /dev/null +++ "b/Model/\347\263\273\347\273\237\345\205\254\347\224\250/ClsXt_BillSubType_Model.cs" @@ -0,0 +1,22 @@ +锘縰sing System; +using System.Collections.Generic; +using System.Linq; +using System.Text; + +namespace Model +{ + public class ClsXt_BillSubType_Model : DBUtility.ClsGy_Base_Model + { + public DateTime HMakeTime; //寤虹珛鏃堕棿(getdate()) + public string HMakeEmp; //鍒涘缓浜� + public string HCheckEmp; //瀹℃牳浜� + public DateTime HCheckTime; //瀹℃牳鏃堕棿 + public string HModifyEmp; //淇敼浜� + public DateTime HModifyTime; //淇敼鏃堕棿 + public string HStopEmp; //绂佺敤浜� + public DateTime HStopTime; //绂佺敤鏃堕棿 + public Int64 HUSEORGID; //浣跨敤缁勭粐锛圶t_ORGANIZATIONS锛� + public Int64 HCREATEORGID; //鍒涘缓缁勭粐锛圶t_ORGANIZATIONS锛� + public string HBillType; + } +} diff --git a/WebAPI/Controllers/BLL/Xt_BillSubTypeController.cs b/WebAPI/Controllers/BLL/Xt_BillSubTypeController.cs new file mode 100644 index 0000000..4fa5ac1 --- /dev/null +++ b/WebAPI/Controllers/BLL/Xt_BillSubTypeController.cs @@ -0,0 +1,336 @@ +锘縰sing Newtonsoft.Json; +using Newtonsoft.Json.Linq; +using System; +using System.Collections.Generic; +using System.Data; +using System.Linq; +using System.Net; +using System.Net.Http; +using System.Web.Http; +using WebAPI.Models; + +namespace WebAPI.Controllers +{ + public class Xt_BillSubTypeController : ApiController + { + private json objJsonResult = new json(); + SQLHelper.ClsCN oCN = new SQLHelper.ClsCN(); + DataSet ds; + + #region 鍗曟嵁瀛愮被鍨� 鍒楄〃 + [Route("Xt_BillSubType/List")] + [HttpGet] + public object Xt_BillSubTypeList(string sWhere, string user, string Organization) + { + try + { + List<object> columnNameList = new List<object>(); + //缂栬緫鏉冮檺 + //if (!DBUtility.ClsPub.Security_Log_second("Xt_BillSubType_Query", 1, false, user)) + //{ + // objJsonResult.code = "0"; + // objJsonResult.count = 0; + // objJsonResult.Message = "鏃犳煡鐪嬫潈闄愶紒"; + // objJsonResult.data = null; + // return objJsonResult; + //} + string sql1 = string.Format(@"select * from h_v_Xt_BillSubTypeList where 1='" + 1 + "'"); + + string sql = sql1 + sWhere; + ds = oCN.RunProcReturn(sql, "h_v_Xt_BillSubTypeList"); + + //娣诲姞鍒楀悕 + foreach (DataColumn col in ds.Tables[0].Columns) + { + Type dataType = col.DataType; + string ColmString = "{\"ColmCols\":\"" + col.ColumnName + "\",\"ColmType\":\"" + dataType.Name + "\"}"; + columnNameList.Add(JsonConvert.DeserializeObject(ColmString));//鑾峰彇鍒癉ataColumn鍒楀璞$殑鍒楀悕 + } + + objJsonResult.code = "1"; + objJsonResult.count = 1; + objJsonResult.Message = "Sucess锛�"; + objJsonResult.list = columnNameList; + 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; + } + } + #endregion + + #region 鍗曟嵁瀛愮被鍨� 缂栬緫 + [Route("Xt_BillSubType/Edit")] + [HttpPost] + public object Xt_BillSubTypeEdit([FromBody] JObject msg) + { + DataSet ds; + var _value = msg["msg"].ToString(); + string msg3 = _value.ToString(); + string[] sArray = msg3.Split(new string[] { ";" }, StringSplitOptions.RemoveEmptyEntries); + string msg1 = sArray[0].ToString(); + string msg2 = sArray[1].ToString(); + //string msg_HUSEORGID = sArray[2].ToString(); + Int64 HItemID = 0; + SQLHelper.ClsCN oCN = new SQLHelper.ClsCN(); + + ////缂栬緫鏉冮檺 + //if (!DBUtility.ClsPub.Security_Log_second("Xt_BillSubType_Edit", 1, false, msg2)) + //{ + // objJsonResult.code = "0"; + // objJsonResult.count = 0; + // objJsonResult.Message = "鏃犱繚瀛樻潈闄愶紒"; + // objJsonResult.data = null; + // return objJsonResult; + //} + + ListModels oListModels = new ListModels(); + + try + { + DAL.ClsXt_BillSubType_Ctl oBill = new DAL.ClsXt_BillSubType_Ctl(); + List<Model.ClsXt_BillSubType_Model> lsmain = new List<Model.ClsXt_BillSubType_Model>(); + msg1 = msg1.Replace("\\", ""); + msg1 = msg1.Replace("\n", ""); //\n + lsmain = oListModels.getObjectByJson_Xt_BillSubType(msg1); + foreach (Model.ClsXt_BillSubType_Model oItem in lsmain) + { + if (oItem.HNumber.Trim() == "") + { + objJsonResult.code = "0"; + objJsonResult.count = 0; + objJsonResult.Message = "淇濆瓨澶辫触锛佷唬鐮佷笉鑳戒负绌猴紒"; + objJsonResult.data = 1; + return objJsonResult; + } + if (oItem.HName.Trim() == "") + { + objJsonResult.code = "0"; + objJsonResult.count = 0; + objJsonResult.Message = "淇濆瓨澶辫触锛佸悕绉颁笉鑳戒负绌猴紒"; + objJsonResult.data = 1; + return objJsonResult; + } + + //鏌ヨ鏁版嵁涓槸鍚﹀瓨鍦ㄩ噸澶嶄唬鐮� + ds = oCN.RunProcReturn("select * from Xt_BillSubType where HStopflag=0 and HNumber='" + oItem.HNumber.Trim() + "'", "Xt_BillSubType"); + if (oItem.HItemID == 0) + { + if (ds.Tables[0].Rows.Count > 0) + { + objJsonResult.code = "0"; + objJsonResult.count = 0; + objJsonResult.Message = "淇濆瓨澶辫触锛佷唬鐮侀噸澶嶏紒"; + objJsonResult.data = null; + return objJsonResult; + } + } + else + { + if (ds.Tables[0].Rows.Count > 0) + { + if (ds.Tables[0].Rows[0]["HItemID"].ToString() != oItem.HItemID.ToString()) + { + objJsonResult.code = "0"; + objJsonResult.count = 0; + objJsonResult.Message = "淇濆瓨澶辫触锛佷唬鐮侀噸澶嶏紒"; + objJsonResult.data = null; + return objJsonResult; + } + } + } + + + //鏂板鏃跺垽鏂� + + if (oItem.HItemID == 0) + { + if (ds == null || ds.Tables[0].Rows.Count > 0) + { + objJsonResult.code = "0"; + objJsonResult.count = 0; + objJsonResult.Message = "淇濆瓨澶辫触锛佷唬鐮侀噸澶嶏紒"; + objJsonResult.data = 1; + return objJsonResult; + } + //妫�鏌ョ埗绾ф槸鍚﹀瓨鍦� + string sParent; + sParent = DBUtility.ClsPub.GetParentCode(oItem.HNumber.Trim()); + if (sParent.Trim() == "") + { + oBill.oModel.HParentID = 0; + } + else + { + if (oBill.HavParentCode(sParent.Trim(), HItemID)) + { + oBill.oModel.HParentID = oBill.oModel.HItemID; + } + else + { + objJsonResult.code = "0"; + objJsonResult.count = 0; + objJsonResult.Message = "淇濆瓨澶辫触锛佷笂绾т唬鐮佷笉瀛樺湪鎴栬绂佺敤锛�"; + objJsonResult.data = 1; + return objJsonResult; + } + } + } + else//缂栬緫鏃跺垽鏂� + { + //妫�鏌ョ埗绾ф槸鍚﹀瓨鍦� + string sParent; + sParent = DBUtility.ClsPub.GetParentCode(oItem.HNumber.Trim()); + if (sParent.Trim() == "") + { + oBill.oModel.HParentID = 0; + } + else + { + if (oBill.HavParentCode(sParent.Trim(), oItem.HItemID)) + { + oBill.oModel.HParentID = oBill.oModel.HItemID; + } + else + { + objJsonResult.code = "0"; + objJsonResult.count = 0; + objJsonResult.Message = "淇濆瓨澶辫触锛佷笂绾т唬鐮佷笉瀛樺湪鎴栬绂佺敤锛�"; + objJsonResult.data = 1; + return objJsonResult; + } + } + } + + //寰楀埌鐭唬鐮� + string sShortNumber; + sShortNumber = DBUtility.ClsPub.GetShortNumber(oItem.HNumber.Trim()); + if (sShortNumber.Trim() == "") + { + objJsonResult.code = "0"; + objJsonResult.count = 0; + objJsonResult.Message = "淇濆瓨澶辫触锛佺煭浠g爜涓虹┖锛�"; + objJsonResult.data = 1; + return objJsonResult; + } + //oItem.HUSEORGID = Convert.ToInt32(msg_HUSEORGID); //缁勭粐id + oItem.HShortNumber = sShortNumber;//鐭唬鐮� + oItem.HEndFlag = true;//鏈骇鏍囧織 + oItem.HLevel = 1; //绛夌骇 DBUtility.ClsPub.GetLevel(oItem.HNumber.Trim()) + oBill.oModel = oItem; + } + //淇濆瓨 + //淇濆瓨瀹屾瘯鍚庡鐞� + bool bResult; + if (oBill.oModel.HItemID == 0) + { + bResult = oBill.AddNew(); + } + else + { + bResult = oBill.ModifyByID(oBill.oModel.HItemID); + } + if (bResult) + { + objJsonResult.code = "1"; + objJsonResult.count = 1; + objJsonResult.Message = "淇濆瓨鎴愬姛锛�"; + //WebAPIController.Add_Log("閫佽揣鍗曚笅鎺�", UserName, "鐢熸垚閫佽揣鍗�"); + objJsonResult.data = 1; + return objJsonResult; + } + else + { + objJsonResult.code = "0"; + objJsonResult.count = 0; + objJsonResult.Message = "淇濆瓨澶辫触锛�" + DBUtility.ClsPub.sExeReturnInfo; + objJsonResult.data = 1; + return objJsonResult; + } + } + catch (Exception e) + { + objJsonResult.code = "0"; + objJsonResult.count = 0; + objJsonResult.Message = "淇濆瓨澶辫触锛�" + e.ToString(); + objJsonResult.data = 1; + return objJsonResult; + } + } + #endregion + + #region 鍗曟嵁瀛愮被鍨� 鍒犻櫎 + [Route("Xt_BillSubType/Delete")] + [HttpGet] + public object Delete(string HItemID, string user) + { + DataSet ds; + try + { + SQLHelper.ClsCN oCN = new SQLHelper.ClsCN(); + ////鍒犻櫎鏉冮檺 + //if (!DBUtility.ClsPub.Security_Log("Xt_BillSubType_Drop", 1, false, user)) + //{ + // objJsonResult.code = "0"; + // objJsonResult.count = 0; + // objJsonResult.Message = "鏃犲垹闄ゆ潈闄�"; + // objJsonResult.data = null; + // return objJsonResult; + //} + if (string.IsNullOrWhiteSpace(HItemID)) + { + objJsonResult.code = "0"; + objJsonResult.count = 0; + objJsonResult.Message = "HItemID涓虹┖锛�"; + objJsonResult.data = null; + return objJsonResult; + } + oCN.BeginTran();//寮�濮嬩簨鍔� + ds = oCN.RunProcReturn("select * from Xt_BillSubType where HItemID=" + HItemID, "Xt_BillSubType"); + if (ds == null || ds.Tables[0].Rows.Count == 0) + { + objJsonResult.code = "0"; + objJsonResult.count = 0; + objJsonResult.Message = "娌℃湁鏁版嵁锛屾棤娉曞垹闄わ紒"; + objJsonResult.data = null; + return objJsonResult; ; + } + var HStopflag = Convert.ToBoolean(ds.Tables[0].Rows[0]["HStopflag"]); + if (HStopflag) + { + oCN.RollBack();//鍥炴粴浜嬪姟 + objJsonResult.code = "0"; + objJsonResult.count = 0; + objJsonResult.Message = "鏁版嵁宸茬鐢ㄦ棤娉曞垹闄わ紒"; + objJsonResult.data = null; + return objJsonResult; + } + + oCN.RunProc("delete from Xt_BillSubType where HItemID=" + HItemID); + oCN.Commit();//鎻愪氦浜嬪姟 + objJsonResult.code = "0"; + objJsonResult.count = 1; + objJsonResult.Message = "* 鏁版嵁鍒犻櫎鎴愬姛锛�"; + objJsonResult.data = null; + return objJsonResult; ; + + } + catch (Exception e) + { + objJsonResult.code = "0"; + objJsonResult.count = 0; + objJsonResult.Message = "鍒犻櫎澶辫触锛�" + e.ToString(); + objJsonResult.data = null; + return objJsonResult; + } + } + #endregion + + } +} \ No newline at end of file diff --git a/WebAPI/Controllers/CGGL/Cg_POOrderBillController.cs b/WebAPI/Controllers/CGGL/Cg_POOrderBillController.cs index ca76da7..2431640 100644 --- a/WebAPI/Controllers/CGGL/Cg_POOrderBillController.cs +++ b/WebAPI/Controllers/CGGL/Cg_POOrderBillController.cs @@ -962,8 +962,7 @@ { try { - LogService.Write("閲囪喘璁㈠崟鍚屾,淇濆瓨鏂规硶鎵ц瀹屾垚寮傚父锛�" + sMainSub.ToString()); - + //LogService.Write("閲囪喘璁㈠崟鍚屾,淇濆瓨鏂规硶鎵ц瀹屾垚寮傚父锛�" + sMainSub.ToString()); var model = sMainSub["model"].ToString(); var entry = sMainSub["model"]["HENTRY"].ToString(); diff --git "a/WebAPI/Controllers/\345\237\272\347\241\200\350\265\204\346\226\231/\345\237\272\347\241\200\350\265\204\346\226\231/Gy_StaffController.cs" "b/WebAPI/Controllers/\345\237\272\347\241\200\350\265\204\346\226\231/\345\237\272\347\241\200\350\265\204\346\226\231/Gy_StaffController.cs" index 1475243..1eb6be7 100644 --- "a/WebAPI/Controllers/\345\237\272\347\241\200\350\265\204\346\226\231/\345\237\272\347\241\200\350\265\204\346\226\231/Gy_StaffController.cs" +++ "b/WebAPI/Controllers/\345\237\272\347\241\200\350\265\204\346\226\231/\345\237\272\347\241\200\350\265\204\346\226\231/Gy_StaffController.cs" @@ -1,4 +1,5 @@ -锘縰sing Newtonsoft.Json; +锘縰sing DBUtility; +using Newtonsoft.Json; using Newtonsoft.Json.Linq; using System; using System.Collections.Generic; @@ -14,6 +15,9 @@ { public class Gy_StaffController : ApiController { + //鑾峰彇绯荤粺鍙傛暟 + Pub_Class.ClsXt_SystemParameter oSystemParameter = new Pub_Class.ClsXt_SystemParameter(); + private json objJsonResult = new json(); SQLHelper.ClsCN oCN = new SQLHelper.ClsCN(); DataSet ds; @@ -391,5 +395,173 @@ } } #endregion + + #region [鍚屾鍩虹璧勬枡] + [Route("Gy_Staff/Gy_StaffViewApi")] + [HttpGet] + public json Gy_StaffViewApi(string Number, string Type) + { + string sql = string.Empty; + string sReturn = ""; + if (oSystemParameter.ShowBill(ref sReturn) == true) + { + //绯荤粺鍙傛暟鏄惁涓虹鏈変簯妯″紡,N涓哄叕鏈変簯妯″紡锛孻涓虹鏈変簯妯″紡 + if (oSystemParameter.omodel.WMS_CloudMode == "Y") + { + #region [绉佹湁浜戞ā寮忥紝鐩存帴璋冪敤鏁版嵁搴撳瓨鍌ㄨ繃绋嬫洿鏂癩 + try + { + oCN.BeginTran(); + SQLHelper.ClsCN oCn = new SQLHelper.ClsCN(); + DataSet DS = oCn.RunProcReturn("exec h_p_WMS_ERPBasicInfoToLocal '" + Number + "','" + Type + "'", "h_p_WMS_ERPBasicInfoToLocal"); + if (DS == null) + { + objJsonResult.code = "0"; + objJsonResult.count = 0; + objJsonResult.Message = "鍩虹璧勬枡鍚屾澶辫触"; + objJsonResult.data = null; + return objJsonResult; + } + else + { + if (DBUtility.ClsPub.isStrNull(DS.Tables[0].Rows[0]["HBack"]) == "2") + { + objJsonResult.code = "0"; + objJsonResult.count = 0; + objJsonResult.Message = "ERP涓笉瀛樺湪璇ヤ唬鐮�"; + objJsonResult.data = null; + return objJsonResult; + } + else + { + 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; + } + #endregion + } + else + { + #region [鍏湁浜戞ā寮忥紝璋冪敤WEBAPI鐨勬柟寮忚繘琛屾洿鏂癩 + var json = new + { + CreateOrgId = 0, + Number = Number, + Id = "" + }; + #region [閲戣澏閮ㄥ垎] + //鐧诲綍閲戣澏 + var loginRet = InvokeHelper.Login(); + var isSuccess = JObject.Parse(loginRet)["LoginResultType"].Value<int>(); + //鍒ゆ柇鏄惁鐧诲綍鎴愬姛 + if (isSuccess < 0) + { + objJsonResult.code = "0"; + objJsonResult.count = 0; + objJsonResult.Message = loginRet; + objJsonResult.data = null; + return objJsonResult; + } + //鏌ョ湅 鑾峰彇鏁版嵁 + var _result = InvokeHelper.View("BD_Empinfo", JsonConvert.SerializeObject(json)); + var _saveObj = JObject.Parse(_result); + //鍒ゆ柇鏁版嵁鏄惁鑾峰彇鎴愬姛 + if (_saveObj["Result"]["ResponseStatus"]["IsSuccess"].ToString().ToUpper() != "TRUE") + { + objJsonResult.code = "0"; + objJsonResult.count = 0; + objJsonResult.Message = "閲戣澏鍛樺伐鍚屾澶辫触jsonRoot锛�" + _result; + objJsonResult.data = null; + return objJsonResult; + } + + #endregion + //鑾峰彇鏁版嵁 + DataSet Ds; + Ds = oCN.RunProcReturn("select * from Gy_Staff where HNumber = '" + Number + "'", "Gy_Staff"); + if (Ds.Tables[0].Rows.Count != 0 && ClsPub.isLong(Ds.Tables[0].Rows[0]["HItemID"].ToString()) != 0) + { + + } + + #region [琛ㄦ暟鎹祴鍊糫 + var jsonData = new + { + HItemID = _saveObj["Result"]["Result"]["Id"], + HNumber = _saveObj["Result"]["Result"]["Number"], + HName = _saveObj["Result"]["Result"]["Name"][0]["Value"], + HShortNumber = _saveObj["Result"]["Result"]["Number"], + HParentID = 0, + HLevel = 1, + HEndFlag = 1, + HStopflag = _saveObj["Result"]["Result"]["ForbidStatus"].ToString() == "A" ? 0 : 1, + HRemark = "CLD-ERP瀵煎叆", + HUseFlag = "宸蹭娇鐢�", + HCREATEORGID = _saveObj["Result"]["Result"]["CreateOrgId_Id"], + HUSEORGID = _saveObj["Result"]["Result"]["UseOrgId_Id"], + HPERSONID = _saveObj["Result"]["Result"]["PersonId_Id"], + HPOSTID = _saveObj["Result"]["Result"]["FPostId_Id"], + HFIRSTCARDID = _saveObj["Result"]["Result"]["FirstCardID_Id"], + HDeptID = _saveObj["Result"]["Result"]["PostEntity"][0]["Post"]["FDept_Id"], + HSTAFFNUMBER = _saveObj["Result"]["Result"]["FStaffNumber"] + }; + #endregion + // 鍒犻櫎涓昏〃瀵瑰簲鏁版嵁 + sql = $"delete from Gy_Staff where HItemID = " + jsonData.HItemID + " and HNumber = '" + Number + "'"; + oCN.RunProc(sql); + + sql = "set identity_insert Gy_Staff on"; + oCN.RunProc(sql); + + //鎻掑叆琛� + sql = $@" + insert into Gy_Staff + (HItemID,HNumber,HName,HShortNumber,HParentID,HLevel + ,HEndFlag,HStopflag,HRemark,HUseFlag,HCREATEORGID,HUSEORGID + ,HPERSONID,HPOSTID,HFIRSTCARDID,HDeptID,HSTAFFNUMBER + ) + values + ({jsonData.HItemID},'{jsonData.HNumber}','{jsonData.HName}', + '{jsonData.HShortNumber}',{jsonData.HParentID},{jsonData.HLevel},{jsonData.HEndFlag},{jsonData.HStopflag},'{jsonData.HRemark}','{jsonData.HUseFlag}',{jsonData.HCREATEORGID},{jsonData.HUSEORGID}, + {jsonData.HPERSONID},{jsonData.HPOSTID},{jsonData.HFIRSTCARDID},{jsonData.HDeptID},'{jsonData.HSTAFFNUMBER}')"; + + oCN.RunProc(sql); + + sql = "set identity_insert Gy_Staff off"; + oCN.RunProc(sql); + + objJsonResult.code = "1"; + objJsonResult.count = 1; + objJsonResult.Message = "鍛樺伐鍚屾鎴愬姛锛�"; + objJsonResult.data = null; + return objJsonResult; + + #endregion + } + } + else + { + objJsonResult.code = "0"; + objJsonResult.count = 0; + objJsonResult.Message = "鍩虹璧勬枡璇诲彇澶辫触锛�"; + objJsonResult.data = null; + return objJsonResult; + } + } + #endregion + } } \ No newline at end of file diff --git "a/WebAPI/Controllers/\347\224\237\344\272\247\347\256\241\347\220\206/\347\224\237\344\272\247\344\273\273\345\212\241\345\215\225/Sc_ICMOBillController.cs" "b/WebAPI/Controllers/\347\224\237\344\272\247\347\256\241\347\220\206/\347\224\237\344\272\247\344\273\273\345\212\241\345\215\225/Sc_ICMOBillController.cs" index ac145e7..2339256 100644 --- "a/WebAPI/Controllers/\347\224\237\344\272\247\347\256\241\347\220\206/\347\224\237\344\272\247\344\273\273\345\212\241\345\215\225/Sc_ICMOBillController.cs" +++ "b/WebAPI/Controllers/\347\224\237\344\272\247\347\256\241\347\220\206/\347\224\237\344\272\247\344\273\273\345\212\241\345\215\225/Sc_ICMOBillController.cs" @@ -251,6 +251,7 @@ { try { + //LogService.Write(sMainSub.ToString()); var model = sMainSub["model"].ToString(); var entry = sMainSub["model"]["HENTRY"].ToString(); var _model = sMainSub["model"]["HPPBOMMAINENTRY"].ToString(); @@ -321,7 +322,7 @@ ,HBackRelationQty,HNumerator,HDenominator,HBASEUNITID,HProcessID,HICMOENTRYSEQ,HPROJECTNO ,HOPERID,HSEQ,HSTOCKSTATUSID,HLOT,HOPTQUEUE,HRESERVETYPE,HSelPickedQty,HSELPRCDRETURNQTY,HProcName) values('{oSub.HInterID}','{oSub.HEntryID}','{oSub.HMaterID}','{oSub.HMaterNumber}','{oSub.HUnitID}','{oSub.HUnitNumber}','{oSub.HSPID}','{oSub.HQty}' - ,'{oSub.HQtyMust}','{oSub.HWHID}','{oSub.HRemark}','{oSub.HSourceInterID}','{oSub.HSourceEntryID}','{oSub.HSourceBillNo}','{oSub.HSourceBillType}','{oSub.HICMOInterID}','{oSub.HICMOEntryID}','{oSub.HICMOBillNo}','{oSub.HCHILDSUPPLYORGID}','{oSub.HSUPPLYORGID}','{oSub.HENTRUSTPICKORGID}','{oSub.HSRCTRANSORGID}','{oSub.HGROUPBYOWNERID}','{oSub.HOWNERID}','{oSub.HOWNERTYPEID}','{oSub.HRelationQty}','{oSub.HMoveStockQty}','{oSub.HAuxPropID}','{oSub.HBatchNO}','{oSub.HMTONo}','{oSub.HQtyScrap}','{oSub.HERPInterID}','{oSub.HERPEntryID}','{oSub.HBackRelationQty}','{oSub.HNumerator}','{oSub.HDenominator}','{oSub.HBASEUNITID}','{oSub.HProcessID}','{oSub.HICMOENTRYSEQ}','{oSub.HPROJECTNO}','{oSub.HOPERID}','{oSub.HSEQ}','{oSub.HSTOCKSTATUSID}','{oSub.HLOT}','{oSub.HOPTQUEUE}','{oSub.HRESERVETYPE}','{oSub.HSelPickedQty}','{oSub.HSELPRCDRETURNQTY}','{oSub.HProcName}')"); + ,'{oSub.HQtyMust}','{oSub.HWHID}','{oSub.HRemark}','{oSub.HSourceInterID}','{oSub.HSourceEntryID}','{oSub.HSourceBillNo}','{oSub.HSourceBillType}','{oSub.HICMOInterID}','{oSub.HICMOEntryID}','{oSub.HICMOBillNo}','{oSub.HCHILDSUPPLYORGID}','{oSub.HSUPPLYORGID}','{oSub.HENTRUSTPICKORGID}','{oSub.HSRCTRANSORGID}','{oSub.HGROUPBYOWNERID}','{oSub.HOWNERID}','{oSub.HOWNERTYPEID}','{oSub.HRelationQty}','{oSub.HMoveStockQty}','{oSub.HAuxPropID}','{oSub.HBatchNO}','{oSub.HMTONo}','{Convert.ToDecimal(oSub.HQtyScrap)}','{oSub.HERPInterID}','{oSub.HERPEntryID}','{oSub.HBackRelationQty}','{oSub.HNumerator}','{oSub.HDenominator}','{oSub.HBASEUNITID}','{oSub.HProcessID}','{oSub.HICMOENTRYSEQ}','{oSub.HPROJECTNO}','{oSub.HOPERID}','{oSub.HSEQ}','{oSub.HSTOCKSTATUSID}','{oSub.HLOT}','{oSub.HOPTQUEUE}','{oSub.HRESERVETYPE}','{oSub.HSelPickedQty}','{oSub.HSELPRCDRETURNQTY}','{oSub.HProcName}')"); } oCN.Commit(); objJsonResult.code = "1"; @@ -333,6 +334,7 @@ } catch (Exception e) { + LogService.Write(e.Message.ToString()); oCN.RollBack(); objJsonResult.code = "0"; objJsonResult.count = 0; @@ -340,6 +342,7 @@ objJsonResult.data = null; return objJsonResult; } + } diff --git a/WebAPI/ListModels.cs b/WebAPI/ListModels.cs index 3c9a568..2e51f32 100644 --- a/WebAPI/ListModels.cs +++ b/WebAPI/ListModels.cs @@ -1123,7 +1123,19 @@ List<Model.ClsXt_BillType_Model> list = Newtonsoft.Json.JsonConvert.DeserializeObject<List<Model.ClsXt_BillType_Model>>(jsonString); return list; } - + + /// <summary> + /// 澶勭悊鍗曟嵁瀛愮被鍨嬭〃鐨刯son + /// </summary> + /// <param name="jsonString"></param> + /// <returns></returns> + public List<Model.ClsXt_BillSubType_Model> getObjectByJson_Xt_BillSubType(string jsonString) + { + jsonString = "[" + jsonString.ToString() + "]"; + List<Model.ClsXt_BillSubType_Model> list = Newtonsoft.Json.JsonConvert.DeserializeObject<List<Model.ClsXt_BillSubType_Model>>(jsonString); + return list; + } + /// <summary> /// 澶勭悊鏀舵鏉′欢琛ㄧ殑json /// </summary> diff --git a/WebAPI/WebAPI.csproj b/WebAPI/WebAPI.csproj index d05c0b1..5825756 100644 --- a/WebAPI/WebAPI.csproj +++ b/WebAPI/WebAPI.csproj @@ -365,6 +365,7 @@ <Compile Include="Controllers\BaseSet\Xt_grdAlignment_WMESController.cs" /> <Compile Include="Controllers\BaseSet\Xt_ORGANIZATIONSController.cs" /> <Compile Include="Controllers\BLL\Xt_AccountPeriodController.cs" /> + <Compile Include="Controllers\BLL\Xt_BillSubTypeController.cs" /> <Compile Include="Controllers\BLL\Xt_BillTypeController.cs" /> <Compile Include="Controllers\BLL\Xt_UserGroupController.cs" /> <Compile Include="Controllers\BLL\Xt_XtgnbController.cs" /> @@ -974,6 +975,7 @@ <Folder Include="Views\Sc_WorkBillAutoSortBillMain\" /> <Folder Include="Views\Sc_WorkBillSortBill\" /> <Folder Include="Views\Sc_WorkDemandPlanBill\" /> + <Folder Include="Views\Xt_BillSubType\" /> <Folder Include="Views\Xt_CheckFlowBill\" /> <Folder Include="Views\Xt_CheckItem\" /> <Folder Include="Views\Xt_grdAlignment_WMES\" /> -- Gitblit v1.9.1