同步基础资料(物料,仓库,部门,计量单位,客户,供应商,职员,仓位)
| | |
| | | public string HWhNumber; |
| | | public string HWhName; |
| | | public string HBarCode; |
| | | public Int64 HCREATEORGID; |
| | | public Int64 HUSEORGID; |
| | | } |
| | | } |
| | |
| | | { |
| | | public class Gy_CustomerController : ApiController |
| | | { |
| | | //è·åç³»ç»åæ° |
| | | Pub_Class.ClsXt_SystemParameter oSystemParameter = new Pub_Class.ClsXt_SystemParameter(); |
| | | public DBUtility.ClsPub.Enum_BillStatus BillStatus; |
| | | |
| | | private json objJsonResult = new json(); |
| | |
| | | } |
| | | } |
| | | |
| | | // |
| | | #region [忥åºç¡èµæ] |
| | | [Route("Gy_Customer/Gy_CustomerViewApi")] |
| | | [HttpGet] |
| | | public json Gy_CustomerViewApi(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_Customer", 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_Customer where HNumber = '" + Number + "'", "Gy_Customer"); |
| | | 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"], |
| | | HERPItemID = _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 = "已使ç¨", |
| | | HMakeTime = _saveObj["Result"]["Result"]["CreateDate"], |
| | | HCREATEORGID = _saveObj["Result"]["Result"]["CreateOrgId_Id"], |
| | | HUSEORGID = _saveObj["Result"]["Result"]["UseOrgId_Id"], |
| | | }; |
| | | #endregion |
| | | // å é¤ä¸»è¡¨å¯¹åºæ°æ® |
| | | sql = $"delete from Gy_Customer where HItemID = " + jsonData.HItemID + " and HNumber = '" + Number + "'"; |
| | | oCN.RunProc(sql); |
| | | |
| | | sql = "set identity_insert Gy_Customer on"; |
| | | oCN.RunProc(sql); |
| | | |
| | | //æå
¥è¡¨ |
| | | sql = $@" |
| | | insert into Gy_Customer |
| | | (HItemID,HERPItemID,HNumber,HName,HShortNumber,HParentID |
| | | ,HLevel,HEndFlag,HStopflag,HRemark,HUseFlag,HMakeTime,HCREATEORGID,HUSEORGID |
| | | ) |
| | | values |
| | | ({jsonData.HItemID},{jsonData.HERPItemID},'{jsonData.HNumber}','{jsonData.HName}', |
| | | '{jsonData.HShortNumber}',{jsonData.HParentID},{jsonData.HLevel},{jsonData.HEndFlag},{jsonData.HStopflag},'{jsonData.HRemark}','{jsonData.HUseFlag}','{jsonData.HMakeTime}',{jsonData.HCREATEORGID},{jsonData.HUSEORGID})"; |
| | | |
| | | oCN.RunProc(sql); |
| | | |
| | | sql = "set identity_insert Gy_Customer 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 |
| | | |
| | | } |
| | | } |
| | |
| | | { |
| | | public class Gy_DepartmentController : ApiController |
| | | { |
| | | //è·åç³»ç»åæ° |
| | | Pub_Class.ClsXt_SystemParameter oSystemParameter = new Pub_Class.ClsXt_SystemParameter(); |
| | | public DBUtility.ClsPub.Enum_BillStatus BillStatus; |
| | | |
| | | private json objJsonResult = new json(); |
| | |
| | | } |
| | | } |
| | | |
| | | #region [忥åºç¡èµæ] |
| | | [Route("Gy_Department/Gy_DepartmentViewApi")] |
| | | [HttpGet] |
| | | public json Gy_DepartmentViewApi(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_Department", 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_Department where HNumber = '" + Number + "'", "Gy_Department"); |
| | | 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"], |
| | | HERPItemID = _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 = "已使ç¨", |
| | | HMakeTime = _saveObj["Result"]["Result"]["CreateDate"], |
| | | HCREATEORGID = _saveObj["Result"]["Result"]["CreateOrgId_Id"], |
| | | HUSEORGID = _saveObj["Result"]["Result"]["UseOrgId_Id"], |
| | | }; |
| | | #endregion |
| | | // å é¤ä¸»è¡¨å¯¹åºæ°æ® |
| | | sql = $"delete from Gy_Department where HItemID = " + jsonData.HItemID + " and HNumber = '" + Number + "'"; |
| | | oCN.RunProc(sql); |
| | | |
| | | sql = "set identity_insert Gy_Department on"; |
| | | oCN.RunProc(sql); |
| | | |
| | | //æå
¥è¡¨ |
| | | sql = $@" |
| | | insert into Gy_Department |
| | | (HItemID,HERPItemID,HNumber,HName,HShortNumber,HParentID |
| | | ,HLevel,HEndFlag,HStopflag,HRemark,HUseFlag,HMakeTime,HCREATEORGID,HUSEORGID |
| | | ) |
| | | values |
| | | ({jsonData.HItemID},{jsonData.HERPItemID},'{jsonData.HNumber}','{jsonData.HName}', |
| | | '{jsonData.HShortNumber}',{jsonData.HParentID},{jsonData.HLevel},{jsonData.HEndFlag},{jsonData.HStopflag},'{jsonData.HRemark}','{jsonData.HUseFlag}','{jsonData.HMakeTime}',{jsonData.HCREATEORGID},{jsonData.HUSEORGID})"; |
| | | |
| | | oCN.RunProc(sql); |
| | | |
| | | sql = "set identity_insert Gy_Department 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 |
| | | |
| | | } |
| | | } |
| | |
| | | { |
| | | public class Gy_EmployeeController : ApiController |
| | | { |
| | | //è·åç³»ç»åæ° |
| | | Pub_Class.ClsXt_SystemParameter oSystemParameter = new Pub_Class.ClsXt_SystemParameter(); |
| | | public DBUtility.ClsPub.Enum_BillStatus BillStatus; |
| | | |
| | | private json objJsonResult = new json(); |
| | |
| | | } |
| | | #endregion |
| | | |
| | | #region [忥åºç¡èµæ] |
| | | [Route("Gy_Employee/Gy_EmployeeViewApi")] |
| | | [HttpGet] |
| | | public json Gy_EmployeeViewApi(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_Employee where HNumber = '" + Number + "'", "Gy_Employee"); |
| | | 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"]["PersonId_Id"], |
| | | HERPItemID = _saveObj["Result"]["Result"]["PersonId_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导å
¥", |
| | | HDeptID = 0, |
| | | HGroupID = 0, |
| | | HUseFlag = "已使ç¨", |
| | | HMakeTime = _saveObj["Result"]["Result"]["CreateDate"], |
| | | HCREATEORGID = _saveObj["Result"]["Result"]["CreateOrgId_Id"], |
| | | HUSEORGID = _saveObj["Result"]["Result"]["UseOrgId_Id"], |
| | | }; |
| | | #endregion |
| | | // å é¤ä¸»è¡¨å¯¹åºæ°æ® |
| | | sql = $"delete from Gy_Employee where HItemID = " + jsonData.HItemID + " and HNumber = '" + Number + "'"; |
| | | oCN.RunProc(sql); |
| | | |
| | | sql = "set identity_insert Gy_Employee on"; |
| | | oCN.RunProc(sql); |
| | | |
| | | //æå
¥è¡¨ |
| | | sql = $@" |
| | | insert into Gy_Employee |
| | | (HItemID,HERPItemID,HNumber,HName,HShortNumber,HParentID |
| | | ,HLevel,HEndFlag,HStopflag,HRemark,HDeptID,HGroupID,HUseFlag,HMakeTime,HCREATEORGID,HUSEORGID |
| | | ) |
| | | values |
| | | ({jsonData.HItemID},{jsonData.HERPItemID},'{jsonData.HNumber}','{jsonData.HName}', |
| | | '{jsonData.HShortNumber}',{jsonData.HParentID},{jsonData.HLevel},{jsonData.HEndFlag},{jsonData.HStopflag},'{jsonData.HRemark}',{jsonData.HDeptID},{jsonData.HGroupID},'{jsonData.HUseFlag}','{jsonData.HMakeTime}',{jsonData.HCREATEORGID},{jsonData.HUSEORGID})"; |
| | | |
| | | oCN.RunProc(sql); |
| | | |
| | | sql = "set identity_insert Gy_Employee 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 |
| | | |
| | | } |
| | | } |
| | |
| | | { |
| | | public class Gy_MaterialController : ApiController |
| | | { |
| | | //è·åç³»ç»åæ° |
| | | Pub_Class.ClsXt_SystemParameter oSystemParameter = new Pub_Class.ClsXt_SystemParameter(); |
| | | public DBUtility.ClsPub.Enum_BillStatus BillStatus; |
| | | |
| | | private json objJsonResult = new json(); |
| | |
| | | |
| | | } |
| | | |
| | | #region [忥åºç¡èµæ] |
| | | [Route("Gy_Material/Gy_MaterialViewApi")] |
| | | [HttpGet] |
| | | public json Gy_MaterialViewApi(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_MATERIAL", 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_Material where HNumber = '" + Number + "'", "Gy_Material"); |
| | | 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"], |
| | | HERPItemID = _saveObj["Result"]["Result"]["Id"], |
| | | HNumber = _saveObj["Result"]["Result"]["Number"], |
| | | HName = _saveObj["Result"]["Result"]["Name"][1]["Value"], |
| | | HModel = _saveObj["Result"]["Result"]["Specification"][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导å
¥", |
| | | HMaterClsID = _saveObj["Result"]["Result"]["MaterialBase"][0]["ErpClsID"], |
| | | HUnitID = _saveObj["Result"]["Result"]["MaterialBase"][0]["BaseUnitId_Id"], |
| | | HUnitGroupID = 0, |
| | | HLength = _saveObj["Result"]["Result"]["MaterialBase"][0]["LENGTH"], |
| | | HWidth = _saveObj["Result"]["Result"]["MaterialBase"][0]["WIDTH"], |
| | | HHeight = _saveObj["Result"]["Result"]["MaterialBase"][0]["HEIGHT"], |
| | | HJQty = _saveObj["Result"]["Result"]["MaterialBase"][0]["NETWEIGHT"], |
| | | HMQty = _saveObj["Result"]["Result"]["MaterialBase"][0]["GROSSWEIGHT"], |
| | | HOldMaterNumber = _saveObj["Result"]["Result"]["OldNumber"], |
| | | HWHID = 0, |
| | | HSPID = _saveObj["Result"]["Result"]["MaterialStock"][0]["StockPlaceId_Id"], |
| | | HPlanMode = _saveObj["Result"]["Result"]["MaterialPlan"][0]["PlanMode"], |
| | | HUseFlag = "æªæ£éª", |
| | | HMakeTime = _saveObj["Result"]["Result"]["CreateDate"], |
| | | HMinPickQty = 0, |
| | | HCREATEORGID = _saveObj["Result"]["Result"]["CreateOrgId_Id"], |
| | | HUSEORGID = _saveObj["Result"]["Result"]["UseOrgId_Id"], |
| | | HBatchManager = _saveObj["Result"]["Result"]["MaterialStock"][0]["IsBatchManage"].ToString() == "false" ? 0 : 1, |
| | | HCHECKINCOMING = _saveObj["Result"]["Result"]["MaterialQM"][0]["CheckIncoming"].ToString() == "false" ? 0 : 1, |
| | | HAuxPropFlag = _saveObj["Result"]["Result"]["MaterialAuxPty"][0]["IsEnable1"].ToString() == "false" ? 0 : 1, |
| | | HISKFPERIOD = _saveObj["Result"]["Result"]["MaterialStock"][0]["IsKFPeriod"].ToString() == "false" ? 0 : 1, |
| | | HAuxUnitID = _saveObj["Result"]["Result"]["MaterialStock"][0]["AuxUnitID_Id"], |
| | | HSNUnitID = _saveObj["Result"]["Result"]["MaterialStock"][0]["SNUnit_Id"], |
| | | HBASEUNITID = _saveObj["Result"]["Result"]["MaterialBase"][0]["BaseUnitId_Id"], |
| | | HSALEUNITID = _saveObj["Result"]["Result"]["MaterialSale"][0]["SaleUnitId_Id"], |
| | | HSALEPRICEUNITID = _saveObj["Result"]["Result"]["MaterialSale"][0]["SalePriceUnitId_Id"], |
| | | HPERUNITSTANDHOUR = _saveObj["Result"]["Result"]["MaterialProduce"][0]["PerUnitStandHour"], |
| | | HSTDLABORPREPARETIME = _saveObj["Result"]["Result"]["MaterialProduce"][0]["StdLaborPrePareTime"], |
| | | HSTDMACHINEPREPARETIME = _saveObj["Result"]["Result"]["MaterialProduce"][0]["StdMachinePrepareTime"] |
| | | }; |
| | | #endregion |
| | | // å é¤ä¸»è¡¨å¯¹åºæ°æ® |
| | | sql = $"delete from Gy_Material where HItemID = " + jsonData.HItemID + " and HNumber = '" + Number + "'"; |
| | | oCN.RunProc(sql); |
| | | |
| | | sql = "set identity_insert Gy_Material on"; |
| | | oCN.RunProc(sql); |
| | | |
| | | //æå
¥è¡¨ |
| | | sql = $@" |
| | | insert into Gy_Material |
| | | (HItemID,HERPItemID,HNumber,HName,HModel,HShortNumber,HParentID |
| | | ,HLevel,HEndFlag,HStopflag,HRemark,HMaterClsID,HUnitID,HUnitGroupID |
| | | ,HLength,HWidth,HHeight,HJQty,HMQty,HOldMaterNumber |
| | | ,HWHID,HSPID,HPlanMode,HUseFlag,HMakeTime,HMinPickQty |
| | | ,HCREATEORGID,HUSEORGID,HBatchManager,HCHECKINCOMING |
| | | ,HAuxPropFlag,HISKFPERIOD |
| | | ,HAuxUnitID,HSNUnitID,HBASEUNITID,HSALEUNITID,HSALEPRICEUNITID |
| | | ,HPERUNITSTANDHOUR,HSTDLABORPREPARETIME,HSTDMACHINEPREPARETIME |
| | | ) |
| | | values |
| | | ({jsonData.HItemID},{jsonData.HERPItemID},'{jsonData.HNumber}','{jsonData.HName}','{jsonData.HModel}', |
| | | '{jsonData.HShortNumber}',{jsonData.HParentID},{jsonData.HLevel},{jsonData.HEndFlag},{jsonData.HStopflag},'{jsonData.HRemark}',{jsonData.HMaterClsID},{jsonData.HUnitID},{jsonData.HUnitGroupID},{jsonData.HLength},{jsonData.HWidth},{jsonData.HHeight},{jsonData.HJQty},{jsonData.HMQty},'{jsonData.HOldMaterNumber}',{jsonData.HWHID},{jsonData.HSPID},'{jsonData.HPlanMode}','{jsonData.HUseFlag}','{jsonData.HMakeTime}',{jsonData.HMinPickQty},{jsonData.HCREATEORGID},{jsonData.HUSEORGID},'{jsonData.HBatchManager}',{jsonData.HCHECKINCOMING},{jsonData.HAuxPropFlag},{jsonData.HISKFPERIOD},{jsonData.HAuxUnitID},{jsonData.HSNUnitID},{jsonData.HBASEUNITID},{jsonData.HSALEUNITID},{jsonData.HSALEPRICEUNITID},{jsonData.HPERUNITSTANDHOUR},'{jsonData.HSTDLABORPREPARETIME}','{jsonData.HSTDMACHINEPREPARETIME}')"; |
| | | |
| | | oCN.RunProc(sql); |
| | | |
| | | sql = "set identity_insert Gy_Material 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 |
| | | |
| | | #region [模å
·æ¡£æ¡å®¡æ ¸ãåå®¡æ ¸] |
| | | /// <summary> |
| | | /// |
| | |
| | | { |
| | | public class Gy_SupplierController : ApiController |
| | | { |
| | | //è·åç³»ç»åæ° |
| | | Pub_Class.ClsXt_SystemParameter oSystemParameter = new Pub_Class.ClsXt_SystemParameter(); |
| | | public DBUtility.ClsPub.Enum_BillStatus BillStatus; |
| | | |
| | | private json objJsonResult = new json(); |
| | |
| | | return objJsonResult; |
| | | } |
| | | } |
| | | // |
| | | |
| | | #region [忥åºç¡èµæ] |
| | | [Route("Gy_Supplier/Gy_SupplierViewApi")] |
| | | [HttpGet] |
| | | public json Gy_SupplierViewApi(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_Supplier", 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_Supplier where HNumber = '" + Number + "'", "Gy_Supplier"); |
| | | 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"], |
| | | HERPItemID = _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 = "已使ç¨", |
| | | HMakeTime = _saveObj["Result"]["Result"]["CreateDate"], |
| | | HCREATEORGID = _saveObj["Result"]["Result"]["CreateOrgId_Id"], |
| | | HUSEORGID = _saveObj["Result"]["Result"]["UseOrgId_Id"], |
| | | HPAYCONDITION = _saveObj["Result"]["Result"]["SupplierFinance"][0]["PayCondition_Id"] |
| | | }; |
| | | #endregion |
| | | // å é¤ä¸»è¡¨å¯¹åºæ°æ® |
| | | sql = $"delete from Gy_Supplier where HItemID = " + jsonData.HItemID + " and HNumber = '" + Number + "'"; |
| | | oCN.RunProc(sql); |
| | | |
| | | sql = "set identity_insert Gy_Supplier on"; |
| | | oCN.RunProc(sql); |
| | | |
| | | //æå
¥è¡¨ |
| | | sql = $@" |
| | | insert into Gy_Supplier |
| | | (HItemID,HERPItemID,HNumber,HName,HShortNumber,HParentID |
| | | ,HLevel,HEndFlag,HStopflag,HRemark,HUseFlag,HMakeTime,HCREATEORGID,HUSEORGID |
| | | ,HPAYCONDITION |
| | | ) |
| | | values |
| | | ({jsonData.HItemID},{jsonData.HERPItemID},'{jsonData.HNumber}','{jsonData.HName}', |
| | | '{jsonData.HShortNumber}',{jsonData.HParentID},{jsonData.HLevel},{jsonData.HEndFlag},{jsonData.HStopflag},'{jsonData.HRemark}','{jsonData.HUseFlag}','{jsonData.HMakeTime}',{jsonData.HCREATEORGID},{jsonData.HUSEORGID},{jsonData.HPAYCONDITION})"; |
| | | |
| | | oCN.RunProc(sql); |
| | | |
| | | sql = "set identity_insert Gy_Supplier 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 |
| | | |
| | | } |
| | | } |
| | |
| | | { |
| | | public class Gy_UnitController : ApiController |
| | | { |
| | | //è·åç³»ç»åæ° |
| | | Pub_Class.ClsXt_SystemParameter oSystemParameter = new Pub_Class.ClsXt_SystemParameter(); |
| | | public DBUtility.ClsPub.Enum_BillStatus BillStatus; |
| | | |
| | | private json objJsonResult = new json(); |
| | |
| | | } |
| | | } |
| | | |
| | | #region [忥åºç¡èµæ] |
| | | [Route("Gy_Unit/Gy_UnitViewApi")] |
| | | [HttpGet] |
| | | public json Gy_UnitViewApi(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_UNIT", 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_Unit where HNumber = '" + Number + "'", "Gy_Unit"); |
| | | 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"], |
| | | HERPItemID = _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 = "æªæ£æµ", |
| | | HRate = "1", |
| | | HMakeTime = _saveObj["Result"]["Result"]["CreateDate"], |
| | | HStandard = 1, |
| | | HCREATEORGID = _saveObj["Result"]["Result"]["CreatorId_Id"], |
| | | HUSEORGID = 0, |
| | | }; |
| | | #endregion |
| | | // å é¤ä¸»è¡¨å¯¹åºæ°æ® |
| | | sql = $"delete from Gy_Unit where HItemID = " + jsonData.HItemID + " and HNumber = '" + Number + "'"; |
| | | oCN.RunProc(sql); |
| | | |
| | | sql = "set identity_insert Gy_Unit on"; |
| | | oCN.RunProc(sql); |
| | | |
| | | //æå
¥è¡¨ |
| | | sql = $@" |
| | | insert into Gy_Unit |
| | | (HItemID,HERPItemID,HNumber,HName,HShortNumber,HParentID |
| | | ,HLevel,HEndFlag,HStopflag,HRemark,HUseFlag,HRate,HMakeTime,HStandard,HCREATEORGID,HUSEORGID |
| | | ) |
| | | values |
| | | ({jsonData.HItemID},{jsonData.HERPItemID},'{jsonData.HNumber}','{jsonData.HName}', |
| | | '{jsonData.HShortNumber}',{jsonData.HParentID},{jsonData.HLevel},{jsonData.HEndFlag},{jsonData.HStopflag},'{jsonData.HRemark}','{jsonData.HUseFlag}','{jsonData.HRate}','{jsonData.HMakeTime}',{jsonData.HStandard},{jsonData.HCREATEORGID},{jsonData.HUSEORGID})"; |
| | | |
| | | oCN.RunProc(sql); |
| | | |
| | | sql = "set identity_insert Gy_Unit 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 |
| | | |
| | | } |
| | | } |
| | |
| | | { |
| | | public class Gy_WarehouseController : ApiController |
| | | { |
| | | //è·åç³»ç»åæ° |
| | | Pub_Class.ClsXt_SystemParameter oSystemParameter = new Pub_Class.ClsXt_SystemParameter(); |
| | | public DBUtility.ClsPub.Enum_BillStatus BillStatus; |
| | | |
| | | private json objJsonResult = new json(); |
| | |
| | | } |
| | | } |
| | | |
| | | #region [忥åºç¡èµæ] |
| | | [Route("Gy_Warehouse/Gy_WarehouseViewApi")] |
| | | [HttpGet] |
| | | public json Gy_WarehouseViewApi(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_STOCK", 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_Warehouse where HNumber = '" + Number + "'", "Gy_Warehouse"); |
| | | 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"], |
| | | HERPItemID = _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导å
¥", |
| | | HSPFlag = _saveObj["Result"]["Result"]["IsOpenLocation"].ToString() == "false" ? 0 : 1, |
| | | HSPGroupID = 0, |
| | | HUnderStock = _saveObj["Result"]["Result"]["AllowMinusQty"].ToString() == "false" ? 0 : 1, |
| | | HUseFlag = "已使ç¨", |
| | | HMakeTime = _saveObj["Result"]["Result"]["CreateDate"], |
| | | HCREATEORGID = _saveObj["Result"]["Result"]["CreateOrgId_Id"], |
| | | HUSEORGID = _saveObj["Result"]["Result"]["UseOrgId_Id"], |
| | | HSTOCKPROPERTY = _saveObj["Result"]["Result"]["StockProperty"], |
| | | HDEFSTOCKSTATUSID = _saveObj["Result"]["Result"]["DefStockStatusId_Id"], |
| | | }; |
| | | #endregion |
| | | // å é¤ä¸»è¡¨å¯¹åºæ°æ® |
| | | sql = $"delete from Gy_Warehouse where HItemID = " + jsonData.HItemID + " and HNumber = '" + Number + "'"; |
| | | oCN.RunProc(sql); |
| | | |
| | | sql = "set identity_insert Gy_Warehouse on"; |
| | | oCN.RunProc(sql); |
| | | |
| | | //æå
¥è¡¨ |
| | | sql = $@" |
| | | insert into Gy_Warehouse |
| | | (HItemID,HERPItemID,HNumber,HName,HShortNumber,HParentID |
| | | ,HLevel,HEndFlag,HStopflag,HRemark |
| | | ,HSPFlag,HSPGroupID,HUnderStock,HUseFlag |
| | | ,HMakeTime,HCREATEORGID,HUSEORGID,HSTOCKPROPERTY,HDEFSTOCKSTATUSID |
| | | ) |
| | | values |
| | | ({jsonData.HItemID},{jsonData.HERPItemID},'{jsonData.HNumber}','{jsonData.HName}', |
| | | '{jsonData.HShortNumber}',{jsonData.HParentID},{jsonData.HLevel},{jsonData.HEndFlag},{jsonData.HStopflag},'{jsonData.HRemark}',{jsonData.HSPFlag},{jsonData.HSPGroupID},{jsonData.HUnderStock},'{jsonData.HUseFlag}','{jsonData.HMakeTime}',{jsonData.HCREATEORGID},{jsonData.HUSEORGID},{jsonData.HSTOCKPROPERTY},{jsonData.HDEFSTOCKSTATUSID})"; |
| | | |
| | | oCN.RunProc(sql); |
| | | |
| | | sql = "set identity_insert Gy_Warehouse 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 |
| | | |
| | | } |
| | | } |
| | |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "éè¶æ¶æéç¥ååæ¥å¤±è´¥jsonRootï¼" + _result; |
| | | objJsonResult.Message = "éè¶éæéç¥ååæ¥å¤±è´¥jsonRootï¼" + _result; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "éè¶æ¶æéç¥ååæ¥å¤±è´¥jsonRootï¼" + _result; |
| | | objJsonResult.Message = "éè¶éè´è®¢ååæ¥å¤±è´¥jsonRootï¼" + _result; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "éè¶æ¶æéç¥ååæ¥å¤±è´¥jsonRootï¼" + _result; |
| | | objJsonResult.Message = "éè¶çäº§æ±æ¥ååæ¥å¤±è´¥jsonRootï¼" + _result; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "éè¶æ¶æéç¥ååæ¥å¤±è´¥jsonRootï¼" + _result; |
| | | objJsonResult.Message = "éè¶çäº§ç¨æååæ¥å¤±è´¥jsonRootï¼" + _result; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "éè¶æ¶æéç¥ååæ¥å¤±è´¥jsonRootï¼" + _result; |
| | | objJsonResult.Message = "éè¶éå®è®¢ååæ¥å¤±è´¥jsonRootï¼" + _result; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "éè¶æ¶æéç¥ååæ¥å¤±è´¥jsonRootï¼" + _result; |
| | | objJsonResult.Message = "éè¶éè´§éç¥ååæ¥å¤±è´¥jsonRootï¼" + _result; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "éè¶æ¶æéç¥ååæ¥å¤±è´¥jsonRootï¼" + _result; |
| | | objJsonResult.Message = "éè¶åè´§éç¥ååæ¥å¤±è´¥jsonRootï¼" + _result; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
New file |
| | |
| | | using Model; |
| | | using Newtonsoft.Json; |
| | | using 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; |
| | | using WebAPI.Service; |
| | | |
| | | namespace WebAPI.Controllers |
| | | { |
| | | public class Gy_StockPlace_Controller : ApiController |
| | | { |
| | | //è·åç³»ç»åæ° |
| | | Pub_Class.ClsXt_SystemParameter oSystemParameter = new Pub_Class.ClsXt_SystemParameter(); |
| | | public DBUtility.ClsPub.Enum_BillStatus BillStatus; |
| | | |
| | | private json objJsonResult = new json(); |
| | | SQLHelper.ClsCN oCN = new SQLHelper.ClsCN(); |
| | | DataSet ds; |
| | | |
| | | |
| | | /// <summary> |
| | | /// è¿åä»ä½å表 |
| | | ///åæ°ï¼string sqlã |
| | | ///è¿åå¼ï¼objectã |
| | | /// </summary> |
| | | [Route("Gy_StockPlace/list")] |
| | | [HttpGet] |
| | | public object list(string sWhere, string user, string Organization) |
| | | { |
| | | try |
| | | { |
| | | List<object> columnNameList = new List<object>(); |
| | | |
| | | string sql1 = string.Format(@"select * from h_v_IF_StockPlaceList_ where 使ç¨ç»ç»='" + Organization + "'"); |
| | | if (sWhere == null || sWhere.Equals("")) |
| | | { |
| | | ds = oCN.RunProcReturn(sql1 + sWhere + " order by HMainID", "h_v_IF_StockPlaceList_"); |
| | | } |
| | | else |
| | | { |
| | | string sql = sql1 + sWhere + " order by HMainID"; |
| | | ds = oCN.RunProcReturn(sql, "h_v_IF_StockPlaceList_"); |
| | | } |
| | | |
| | | //æ·»å åå |
| | | 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.data = ds.Tables[0]; |
| | | objJsonResult.list = columnNameList; |
| | | return objJsonResult; |
| | | } |
| | | catch (Exception e) |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "Exceptionï¼" + e.ToString(); |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | } |
| | | |
| | | /// <summary> |
| | | /// æ ¹æ®åºç¡èµæID æ¥æ¾è®°å½ |
| | | ///åæ°ï¼string sqlã |
| | | ///è¿åå¼ï¼objectã |
| | | /// </summary> |
| | | [Route("Gy_StockPlace/cx")] |
| | | [HttpGet] |
| | | public object cx(long HInterID) |
| | | { |
| | | try |
| | | { |
| | | ds = oCN.RunProcReturn("select * from h_v_IF_StockPlaceList_ where HMainID = " + HInterID, "h_v_IF_StockPlaceList_"); |
| | | 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> |
| | | /// ä¿åæé® |
| | | ///åæ°ï¼string sqlã |
| | | ///è¿åå¼ï¼objectã |
| | | /// </summary> |
| | | [Route("Gy_StockPlace/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(); |
| | | |
| | | //ååºåå |
| | | msg2 = msg2.Replace("\\", ""); |
| | | msg2 = msg2.Replace("\n", ""); |
| | | msg2 = "[" + msg2.ToString() + "]"; |
| | | List<ClsGy_StockPlace_Model> list = Newtonsoft.Json.JsonConvert.DeserializeObject<List<ClsGy_StockPlace_Model>>(msg2); |
| | | |
| | | long HItemID = list[0].HItemID; |
| | | string HNumber = list[0].HNumber; |
| | | string HName = list[0].HName; |
| | | string HShortNumber = list[0].HNumber; |
| | | string HRemark = list[0].HRemark; |
| | | string HHelpCode = list[0].HHelpCode; |
| | | long HSPGroupID = list[0].HSPGroupID; |
| | | bool HStopflag = list[0].HStopflag; |
| | | bool HStandard = list[0].HStandard; |
| | | string HUseFlag = "æªå®¡"; |
| | | long HCREATEORGID = list[0].HCREATEORGID; |
| | | long HUSEORGID = list[0].HUSEORGID; |
| | | |
| | | //ä¿å |
| | | //ä¿å宿¯åå¤ç |
| | | if (HItemID == 0) |
| | | { |
| | | //æ°å¢ |
| | | oCN.BeginTran(); |
| | | oCN.RunProc("Insert into Gy_StockPlace " + |
| | | " (HNumber,HName,HHelpCode,HShortNumber,HParentID" + |
| | | ",HLevel,HEndFlag,HStopflag,HRemark,HSPGroupID,HStandard,HUseFlag,HERPItemID," + |
| | | "HMakeTime,HCREATEORGID,HUSEORGID,HSPType,HDesSPType,HSrcSPType) " + |
| | | " Values('" + HNumber + "','" + HName + "','" + HHelpCode + "','" + HShortNumber + "'," + 0 + |
| | | "," + 1 + "," + 1 + "," + Convert.ToString(HStopflag ? 1 : 0) + ",'" + HRemark + "'," + HSPGroupID + "," |
| | | + Convert.ToString(HStandard ? 1 : 0) + ",'" + HUseFlag + "'," + 0 + ",'" + System.DateTime.Now.ToString("G") + "'," |
| | | + HCREATEORGID + "," + HUSEORGID + ",' ',' ',' '" + ")", ref DBUtility.ClsPub.sExeReturnInfo); |
| | | |
| | | oCN.Commit(); |
| | | } |
| | | else |
| | | { |
| | | oCN.BeginTran(); |
| | | //主表 |
| | | oCN.RunProc("Update Gy_StockPlace set " + |
| | | " HNumber='" + HNumber + "'" + |
| | | ",HName='" + HName + "'" + |
| | | ",HHelpCode='" + HHelpCode + "'" + |
| | | ",HSPGroupID=" + HSPGroupID + |
| | | ",HUSEORGID=" + HUSEORGID + |
| | | ",HStopflag=" + Convert.ToString(HStopflag ? 1 : 0) + |
| | | ",HStandard=" + Convert.ToString(HStandard ? 1 : 0) + |
| | | ",HRemark= '" + HRemark + "' Where HItemID=" + HItemID, ref DBUtility.ClsPub.sExeReturnInfo); |
| | | oCN.Commit(); |
| | | } |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 1; |
| | | objJsonResult.Message = "ä¿åæåï¼"; |
| | | objJsonResult.data = 1; |
| | | return objJsonResult; |
| | | } |
| | | catch (Exception e) |
| | | { |
| | | //oCN.RollBack(); |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "Exceptionï¼" + e.Message; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | } |
| | | |
| | | /// <summary> |
| | | /// ä»ä½å表å é¤åè½ |
| | | /// </summary> |
| | | /// <returns></returns> |
| | | [Route("Deltet_Gy_StockPlace")] |
| | | [HttpGet] |
| | | public object Deltet_Gy_StockPlace(string HItemID, string user) |
| | | { |
| | | DataSet ds; |
| | | DataSet ds1; |
| | | try |
| | | { |
| | | SQLHelper.ClsCN oCN = new SQLHelper.ClsCN(); |
| | | 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 Gy_StockPlace where HItemID=" + HItemID, "Gy_StockPlace"); |
| | | if (ds == null || ds.Tables[0].Rows.Count == 0) |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "æ²¡ææ°æ®ï¼æ æ³å é¤ï¼"; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; ; |
| | | } |
| | | ds1 = oCN.RunProcReturn("Select HItemID from Gy_StockPlace Where HParentID='" + HItemID + "'", "Gy_StockPlace"); |
| | | if (ds1.Tables[0].Rows.Count != 0) |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "æ¤é¡¹ç®åå¨å项ç®ï¼ä¸è½å é¤ï¼"; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | string HUseFlag = Convert.ToString(ds.Tables[0].Rows[0]["HUseFlag"]); |
| | | if (HUseFlag == "已使ç¨") |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "æ¤é¡¹ç®å·²ä½¿ç¨ï¼ä¸è½å é¤ï¼"; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | |
| | | oCN.RunProc("delete from Gy_StockPlace 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; |
| | | } |
| | | } |
| | | |
| | | } |
| | | } |
| | |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "éè¶æ¶æéç¥ååæ¥å¤±è´¥jsonRootï¼" + _result; |
| | | objJsonResult.Message = "éè¶ç产任å¡ååæ¥å¤±è´¥jsonRootï¼" + _result; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | |
| | | <Compile Include="Controllers\SBGL\SBTC\Sb_EquipWorkBeforeCheckBillController.cs" /> |
| | | <Compile Include="Controllers\SBGL\Sb_EquipWorkBeforeCheckSBillController.cs" /> |
| | | <Compile Include="Controllers\SBGL\Sb_EquipStockInCheckBillSController.cs" /> |
| | | <Compile Include="Controllers\SBGL\Sb_EquipWorkBeforeCheckBillController.cs" /> |
| | | <Compile Include="Controllers\SBGL\Sb_EquipStockInCheckBillController.cs" /> |
| | | <Compile Include="Controllers\SCGL\Sc_ComplementGoodBill_ZXBZController.cs" /> |
| | | <Compile Include="Controllers\SCGL\æ¥è®¡å管ç\DataHelper.cs" /> |
| | | <Compile Include="Controllers\SCGL\æ¥è®¡å管ç\JIT_Cg_PODemandPlanBillController.cs" /> |
| | |
| | | <Compile Include="Controllers\åºç¡èµæ\åºç¡èµæ\Gy_SOPBillListController.cs" /> |
| | | <Compile Include="Controllers\åºç¡èµæ\åºç¡èµæ\Gy_StaffController.cs" /> |
| | | <Compile Include="Controllers\åºç¡èµæ\åºç¡èµæ\Gy_StockCheckItemBillController.cs" /> |
| | | <Compile Include="Controllers\åºç¡èµæ\åºç¡èµæ\Gy_StockPlace_Controller.cs" /> |
| | | <Compile Include="Controllers\åºç¡èµæ\åºç¡èµæ\Gy_StockStatusBillController.cs" /> |
| | | <Compile Include="Controllers\åºç¡èµæ\åºç¡èµæ\Gy_SupplierContactBillController.cs" /> |
| | | <Compile Include="Controllers\åºç¡èµæ\åºç¡èµæ\Gy_TaxMIXController.cs" /> |
| | |
| | | <Folder Include="Views\Gy_SettleStyle\" /> |
| | | <Folder Include="Views\Gy_SOPBill\" /> |
| | | <Folder Include="Views\Gy_Staff\" /> |
| | | <Folder Include="Views\Gy_StockPlace_\" /> |
| | | <Folder Include="Views\Gy_StockStatusBill\" /> |
| | | <Folder Include="Views\Gy_SupplierContactBill\" /> |
| | | <Folder Include="Views\Gy_TaxMIXMain\" /> |