Merge branch 'master' of http://101.37.171.70:10101/r/MES-WEB-API
| | |
| | | <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" /> |
New file |
| | |
| | | using 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); |
| | | //ä¿®æ¹ä¸çº§ä¸ºéæ«çº§ä»£ç |
| | | 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); |
| | | } |
| | | } |
| | | //æ ¹æ®ä»£ç å¤æä¿¡æ¯ |
| | | 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(); |
| | | } |
| | | } |
| | | } |
| | |
| | | <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" /> |
New file |
| | |
| | | using 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; //使ç¨ç»ç»ï¼Xt_ORGANIZATIONSï¼ |
| | | public Int64 HCREATEORGID; //å建ç»ç»ï¼Xt_ORGANIZATIONSï¼ |
| | | public string HBillType; |
| | | } |
| | | } |
New file |
| | |
| | | using 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));//è·åå°DataColumnå对象çåå |
| | | } |
| | | |
| | | 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 = "ä¿å失败ï¼ç代ç 为空ï¼"; |
| | | 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 |
| | | |
| | | } |
| | | } |
| | |
| | | { |
| | | try |
| | | { |
| | | LogService.Write("éè´è®¢å忥,ä¿åæ¹æ³æ§è¡å®æå¼å¸¸ï¼" + sMainSub.ToString()); |
| | | |
| | | //LogService.Write("éè´è®¢å忥,ä¿åæ¹æ³æ§è¡å®æå¼å¸¸ï¼" + sMainSub.ToString()); |
| | | var model = sMainSub["model"].ToString(); |
| | | var entry = sMainSub["model"]["HENTRY"].ToString(); |
| | | |
| | |
| | | using Newtonsoft.Json; |
| | | using DBUtility; |
| | | using Newtonsoft.Json; |
| | | using Newtonsoft.Json.Linq; |
| | | using System; |
| | | using System.Collections.Generic; |
| | |
| | | { |
| | | 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; |
| | |
| | | } |
| | | } |
| | | #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为å
¬æäºæ¨¡å¼ï¼Yä¸ºç§æäºæ¨¡å¼ |
| | | 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 |
| | | |
| | | } |
| | | } |
| | |
| | | { |
| | | try |
| | | { |
| | | //LogService.Write(sMainSub.ToString()); |
| | | var model = sMainSub["model"].ToString(); |
| | | var entry = sMainSub["model"]["HENTRY"].ToString(); |
| | | var _model = sMainSub["model"]["HPPBOMMAINENTRY"].ToString(); |
| | |
| | | ,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"; |
| | |
| | | } |
| | | catch (Exception e) |
| | | { |
| | | LogService.Write(e.Message.ToString()); |
| | | oCN.RollBack(); |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | |
| | | } |
| | | |
| | | |
| | |
| | | List<Model.ClsXt_BillType_Model> list = Newtonsoft.Json.JsonConvert.DeserializeObject<List<Model.ClsXt_BillType_Model>>(jsonString); |
| | | return list; |
| | | } |
| | | |
| | | |
| | | /// <summary> |
| | | /// å¤çåæ®åç±»å表çjson |
| | | /// </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> |
| | |
| | | <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" /> |
| | |
| | | <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\" /> |