基础资料点检项目、维修项目、维修检验项目、保养项目列表+新增编辑
New file |
| | |
| | | using DBUtility; |
| | | 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 Gy_DotCheckBillController : ApiController |
| | | { |
| | | public DBUtility.ClsPub.Enum_BillStatus BillStatus; |
| | | |
| | | private json objJsonResult = new json(); |
| | | SQLHelper.ClsCN oCN = new SQLHelper.ClsCN(); |
| | | DataSet ds; |
| | | Models.ClsGy_DotCheck oDept = new Models.ClsGy_DotCheck(); |
| | | Models.ClsGy_DotCheck oDeptHlp = new Models.ClsGy_DotCheck(); |
| | | |
| | | #region ç¹æ£é¡¹ç®åè¡¨æ°æ® |
| | | [Route("Gy_DotCheck/GetDotCheckList")] |
| | | [HttpGet] |
| | | public object GetDotCheckList(string sWhere, string user) |
| | | { |
| | | try |
| | | { |
| | | if (!DBUtility.ClsPub.Security_Log("Gy_DotCheck", 1, true, user)) |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "æ²¡ææ¥çæé"; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | ds = oCN.RunProcReturn("select HItemID,HNumber,HName,HLevel, case when HEndFlag<>0 then 'Y'else ' 'end HEndFlag,case when HStopFlag <> 0 then 'Y'else ' 'end HStopFlag, HRemark, HUseFlag from Gy_DotCheck where 1=1 " + sWhere, "Gy_DotCheck"); |
| | | if (ds == null || ds.Tables[0].Rows.Count == 0) |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "æ ä¿å
»é¡¹ç®æ°æ®ï¼"; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | else |
| | | { |
| | | objJsonResult.code = "1"; |
| | | objJsonResult.count = 1; |
| | | objJsonResult.Message = "æ¥æ¾æåï¼"; |
| | | objJsonResult.data = ds.Tables[0]; |
| | | return objJsonResult; |
| | | } |
| | | } |
| | | catch (Exception e) |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "Exceptionï¼" + e.ToString(); |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | } |
| | | #endregion |
| | | |
| | | #region ç¹æ£é¡¹ç®å é¤ |
| | | [Route("Gy_DotCheck/DeleteDotCheck")] |
| | | [HttpGet] |
| | | public object DeleteDotCheck(long HItemID, string User) |
| | | { |
| | | |
| | | try |
| | | { |
| | | if (!DBUtility.ClsPub.Security_Log("Gy_DotCheck", 1, true, User)) |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "没æå 餿é"; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | ds = oCN.RunProcReturn("Select * from Gy_DotCheck Where HItemID='" + HItemID + "'", "Gy_DotCheck", ref DBUtility.ClsPub.sExeReturnInfo); |
| | | if (ds.Tables[0].Rows.Count != 0) |
| | | { |
| | | ds = oCN.RunProcReturn("Delete from Gy_DotCheck Where HItemID='" + HItemID + "'", "Gy_DotCheck", ref DBUtility.ClsPub.sExeReturnInfo); |
| | | objJsonResult.code = "1"; |
| | | objJsonResult.count = 1; |
| | | objJsonResult.Message = "å 餿å"; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | else |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "åæ®ä¸åå¨"; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | } |
| | | catch (Exception e) |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "Exceptionï¼" + e.ToString(); |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | } |
| | | #endregion |
| | | |
| | | #region ä¿®æ¹ç¹æ£é¡¹ç®è·åç»å®æ°æ® |
| | | [Route("Gy_DotCheck/EditDotCheck")] |
| | | [HttpGet] |
| | | public object EditDotCheck(long HInterID) |
| | | { |
| | | try |
| | | { |
| | | ds = oCN.RunProcReturn("select * from Gy_DotCheck where HItemID=" + HInterID, "Gy_DotCheck"); |
| | | |
| | | objJsonResult.code = "1"; |
| | | objJsonResult.count = 1; |
| | | objJsonResult.Message = ""; |
| | | objJsonResult.data = ds.Tables[0]; |
| | | return objJsonResult; |
| | | } |
| | | catch (Exception e) |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "Exceptionï¼" + e.ToString(); |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | } |
| | | #endregion |
| | | |
| | | #region ç¹æ£é¡¹ç®ä¿®æ¹ä¿å |
| | | [Route("Gy_DotCheck/EditBill")] |
| | | [HttpPost] |
| | | public object EditBill([FromBody] JObject oMain) |
| | | { |
| | | |
| | | try |
| | | { |
| | | var _value = oMain["oMain"].ToString(); |
| | | string msg1 = _value.ToString(); |
| | | string[] sArray = msg1.Split(new string[] { ";" }, StringSplitOptions.RemoveEmptyEntries); |
| | | string msg2 = sArray[0].ToString(); |
| | | string msg3 = sArray[1].ToString(); |
| | | string msg4 = sArray[2].ToString();//å½å人 |
| | | |
| | | //ååºåå |
| | | msg2 = "[" + msg2.ToString() + "]"; |
| | | List<Models.ClsGy_DotCheck> list = Newtonsoft.Json.JsonConvert.DeserializeObject<List<Models.ClsGy_DotCheck>>(msg2); |
| | | |
| | | long HItemID = int.Parse(msg3); |
| | | string HNumber = list[0].HNumber; |
| | | string HName = list[0].HName; |
| | | string HShortNumber = list[0].HNumber; |
| | | string HHelpCode = list[0].HHelpCode; |
| | | string HRemark = list[0].HRemark; |
| | | bool HStopflag = list[0].HStopflag; |
| | | string HUseFlag = list[0].HUseFlag; |
| | | |
| | | //夿æé |
| | | if (!ClsPub.Security_Log("Gy_DotCheck", 1, true, msg4)) |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "æ²¡ææ¾å°è¯¥åè½æ¨¡åï¼"; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | |
| | | |
| | | if (!DBUtility.ClsPub.AllowNumber(HNumber)) |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "代ç ä¸ä¸è½åºç°è¿ç»â.âå¹¶ä¸é¦ä½æ«ä½ä¸è½ä¸ºâ.âï¼"; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | |
| | | if (oDept.HavSameNumber(HItemID, HNumber)) |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "代ç éå¤ï¼"; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | |
| | | |
| | | //è¥MAINDIéå¤åéæ°è·å |
| | | oCN.BeginTran(); |
| | | //主表 |
| | | oCN.RunProc("Update Gy_DotCheck set " + |
| | | " HNumber='" + HNumber + "'" + |
| | | ",HName='" + HName + "'" + |
| | | ",HShortNumber='" + HShortNumber + "'" + |
| | | ",HHelpCode='" + HHelpCode + "'" + |
| | | ",HStopflag='" + HStopflag + "'" + |
| | | ",HRemark= '" + HRemark + "' Where HItemID=" + HItemID, ref DBUtility.ClsPub.sExeReturnInfo); |
| | | //ä¿®æ¹å项ç®ä»£ç |
| | | //oCN.RunProc("exec h_p_Gy_UpdateNumber Gy_RepairCheck,'" + HNumber + ".','" + this.HOldNumber + ".'", ref DBUtility.ClsPub.sExeReturnInfo); |
| | | |
| | | oCN.Commit(); |
| | | objJsonResult.code = "1"; |
| | | objJsonResult.count = 1; |
| | | objJsonResult.Message = "ä¿®æ¹æåï¼"; |
| | | //objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | catch (Exception e) |
| | | { |
| | | oCN.RollBack(); |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "Exceptionï¼" + e.Message; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | } |
| | | #endregion |
| | | |
| | | #region ç¹æ£é¡¹ç®æ°å¢ä¿å |
| | | [Route("GetDotCheck/AddBill")] |
| | | [HttpPost] |
| | | public object AddBill([FromBody] JObject oMain) |
| | | { |
| | | try |
| | | { |
| | | var _value = oMain["oMain"].ToString(); |
| | | string msg1 = _value.ToString(); |
| | | string[] sArray = msg1.Split(new string[] { ";" }, StringSplitOptions.RemoveEmptyEntries); |
| | | string msg2 = sArray[0].ToString(); |
| | | string msg3 = sArray[1].ToString();//å½å人 |
| | | |
| | | //ååºåå |
| | | msg2 = "[" + msg2.ToString() + "]"; |
| | | |
| | | List<Models.ClsGy_DotCheck> list = Newtonsoft.Json.JsonConvert.DeserializeObject<List<Models.ClsGy_DotCheck>>(msg2); |
| | | |
| | | string HNumber = list[0].HNumber; |
| | | string HName = list[0].HName; |
| | | string HShortNumber = list[0].HNumber; |
| | | long HLevel = list[0].HLevel; |
| | | string HHelpCode = list[0].HHelpCode; |
| | | string HRemark = list[0].HRemark; |
| | | bool HStopflag = list[0].HStopflag; |
| | | string HUseFlag = list[0].HUseFlag; |
| | | bool HEndFlag = list[0].HEndFlag; |
| | | |
| | | //夿æé |
| | | if (!ClsPub.Security_Log("Gy_DotCheck", 1, true, msg3)) |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "æ²¡ææ¾å°è¯¥åè½æ¨¡åï¼"; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | |
| | | if (!DBUtility.ClsPub.AllowNumber(HNumber)) |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "代ç ä¸ä¸è½åºç°è¿ç»â.âå¹¶ä¸é¦ä½æ«ä½ä¸è½ä¸ºâ.âï¼"; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | |
| | | |
| | | |
| | | //è¥MAINDIéå¤åéæ°è·å |
| | | oCN.BeginTran(); |
| | | //主表 |
| | | oCN.RunProc("Insert into Gy_DotCheck " + |
| | | " (HNumber,HName,HHelpCode,HShortNumber" + |
| | | ",HLevel,HEndFlag,HStopflag,HRemark,HMakeTime) " + |
| | | " Values('" + HNumber + "','" + HName + "','" + HHelpCode + "','" + HShortNumber + "'," + |
| | | +HLevel + "," + Convert.ToString(HEndFlag ? 1 : 0) + "," + Convert.ToString(HStopflag ? 1 : 0) + ",'" + HRemark + "',getdate())", ref DBUtility.ClsPub.sExeReturnInfo); |
| | | //ä¿®æ¹ä¸çº§ä¸ºéæ«çº§ä»£ç |
| | | //oCN.RunProc("Update Gy_MouldType set HEndflag=0 where HItemID=" + HParentID, ref DBUtility.ClsPub.sExeReturnInfo); |
| | | oCN.Commit(); |
| | | objJsonResult.code = "1"; |
| | | objJsonResult.count = 1; |
| | | objJsonResult.Message = "æ°å¢æåï¼"; |
| | | //objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | catch (Exception e) |
| | | { |
| | | oCN.RollBack(); |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "Exceptionï¼" + e.Message; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | } |
| | | #endregion |
| | | } |
| | | } |
New file |
| | |
| | | using DBUtility; |
| | | 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 Gy_MaintainBillController : ApiController |
| | | { |
| | | public DBUtility.ClsPub.Enum_BillStatus BillStatus; |
| | | |
| | | private json objJsonResult = new json(); |
| | | SQLHelper.ClsCN oCN = new SQLHelper.ClsCN(); |
| | | DataSet ds; |
| | | Models.ClsGy_Maintain oDept = new Models.ClsGy_Maintain(); |
| | | Models.ClsGy_Maintain oDeptHlp = new Models.ClsGy_Maintain(); |
| | | |
| | | #region ä¿å
»é¡¹ç®åè¡¨æ°æ® |
| | | [Route("Gy_Maintain/GetMaintainlist")] |
| | | [HttpGet] |
| | | public object GetMaintainlist(string sWhere, string user) |
| | | { |
| | | try |
| | | { |
| | | if (!DBUtility.ClsPub.Security_Log("Gy_Maintain", 1, true, user)) |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "æ²¡ææ¥çæé"; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | ds = oCN.RunProcReturn("select HItemID,HNumber,HName,HLevel, case when HEndFlag<>0 then 'Y'else ' 'end HEndFlag,case when HStopFlag <> 0 then 'Y'else ' 'end HStopFlag, HRemark, HUseFlag from Gy_Maintain where 1=1 " + sWhere, "Gy_Maintain"); |
| | | if (ds == null || ds.Tables[0].Rows.Count == 0) |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "æ ä¿å
»é¡¹ç®æ°æ®ï¼"; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | else |
| | | { |
| | | objJsonResult.code = "1"; |
| | | objJsonResult.count = 1; |
| | | objJsonResult.Message = "æ¥æ¾æåï¼"; |
| | | objJsonResult.data = ds.Tables[0]; |
| | | return objJsonResult; |
| | | } |
| | | } |
| | | catch (Exception e) |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "Exceptionï¼" + e.ToString(); |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | } |
| | | #endregion |
| | | |
| | | #region ä¿å
»é¡¹ç®å é¤ |
| | | [Route("Gy_Maintain/DeleteMaintain")] |
| | | [HttpGet] |
| | | public object DeleteMaintain(long HItemID, string User) |
| | | { |
| | | |
| | | try |
| | | { |
| | | if (!DBUtility.ClsPub.Security_Log("Gy_Maintain_Delete", 1, true, User)) |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "没æå 餿é"; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | ds = oCN.RunProcReturn("Select * from Gy_Maintain Where HItemID='" + HItemID + "'", "Gy_Maintain", ref DBUtility.ClsPub.sExeReturnInfo); |
| | | if (ds.Tables[0].Rows.Count != 0) |
| | | { |
| | | ds = oCN.RunProcReturn("Delete from Gy_Maintain Where HItemID='" + HItemID + "'", "Gy_Maintain", ref DBUtility.ClsPub.sExeReturnInfo); |
| | | objJsonResult.code = "1"; |
| | | objJsonResult.count = 1; |
| | | objJsonResult.Message = "å 餿å"; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | else |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "åæ®ä¸åå¨"; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | } |
| | | catch (Exception e) |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "Exceptionï¼" + e.ToString(); |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | } |
| | | #endregion |
| | | |
| | | #region ä¿®æ¹ä¿å
»é¡¹ç®è·åç»å®æ°æ® |
| | | [Route("Gy_Maintain/EditMaintain")] |
| | | [HttpGet] |
| | | public object EditMaintain(long HInterID) |
| | | { |
| | | try |
| | | { |
| | | ds = oCN.RunProcReturn("select * from Gy_Maintain where HItemID=" + HInterID, "Gy_Maintain"); |
| | | |
| | | objJsonResult.code = "1"; |
| | | objJsonResult.count = 1; |
| | | objJsonResult.Message = ""; |
| | | objJsonResult.data = ds.Tables[0]; |
| | | return objJsonResult; |
| | | } |
| | | catch (Exception e) |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "Exceptionï¼" + e.ToString(); |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | } |
| | | #endregion |
| | | |
| | | #region ä¿å
»é¡¹ç®ä¿®æ¹ä¿å |
| | | [Route("Gy_Maintain/EditBill")] |
| | | [HttpPost] |
| | | public object EditBill([FromBody] JObject oMain) |
| | | { |
| | | |
| | | try |
| | | { |
| | | var _value = oMain["oMain"].ToString(); |
| | | string msg1 = _value.ToString(); |
| | | string[] sArray = msg1.Split(new string[] { ";" }, StringSplitOptions.RemoveEmptyEntries); |
| | | string msg2 = sArray[0].ToString(); |
| | | string msg3 = sArray[1].ToString(); |
| | | string msg4 = sArray[2].ToString();//å½å人 |
| | | |
| | | //ååºåå |
| | | msg2 = "[" + msg2.ToString() + "]"; |
| | | List<Models.ClsGy_Maintain> list = Newtonsoft.Json.JsonConvert.DeserializeObject<List<Models.ClsGy_Maintain>>(msg2); |
| | | |
| | | long HItemID = int.Parse(msg3); |
| | | string HNumber = list[0].HNumber; |
| | | string HName = list[0].HName; |
| | | string HShortNumber = list[0].HNumber; |
| | | string HHelpCode = list[0].HHelpCode; |
| | | string HRemark = list[0].HRemark; |
| | | bool HStopflag = list[0].HStopflag; |
| | | string HUseFlag = list[0].HUseFlag; |
| | | |
| | | //夿æé |
| | | if (!ClsPub.Security_Log("Gy_Maintain_Edit", 1, true, msg4)) |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "æ²¡ææ¾å°è¯¥åè½æ¨¡åï¼"; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | |
| | | |
| | | if (!DBUtility.ClsPub.AllowNumber(HNumber)) |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "代ç ä¸ä¸è½åºç°è¿ç»â.âå¹¶ä¸é¦ä½æ«ä½ä¸è½ä¸ºâ.âï¼"; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | |
| | | if (oDept.HavSameNumber(HItemID, HNumber)) |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "代ç éå¤ï¼"; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | |
| | | |
| | | //è¥MAINDIéå¤åéæ°è·å |
| | | oCN.BeginTran(); |
| | | //主表 |
| | | oCN.RunProc("Update Gy_Maintain set " + |
| | | " HNumber='" + HNumber + "'" + |
| | | ",HName='" + HName + "'" + |
| | | ",HShortNumber='" + HShortNumber + "'" + |
| | | ",HHelpCode='" + HHelpCode + "'" + |
| | | ",HStopflag='" + HStopflag + "'" + |
| | | ",HRemark= '" + HRemark + "' Where HItemID=" + HItemID, ref DBUtility.ClsPub.sExeReturnInfo); |
| | | //ä¿®æ¹å项ç®ä»£ç |
| | | //oCN.RunProc("exec h_p_Gy_UpdateNumber Gy_RepairCheck,'" + HNumber + ".','" + this.HOldNumber + ".'", ref DBUtility.ClsPub.sExeReturnInfo); |
| | | |
| | | oCN.Commit(); |
| | | objJsonResult.code = "1"; |
| | | objJsonResult.count = 1; |
| | | objJsonResult.Message = "ä¿®æ¹æåï¼"; |
| | | //objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | catch (Exception e) |
| | | { |
| | | oCN.RollBack(); |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "Exceptionï¼" + e.Message; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | } |
| | | #endregion |
| | | |
| | | #region ä¿å
»é¡¹ç®æ°å¢ä¿å |
| | | [Route("Gy_Maintain/AddBill")] |
| | | [HttpPost] |
| | | public object AddBill([FromBody] JObject oMain) |
| | | { |
| | | try |
| | | { |
| | | var _value = oMain["oMain"].ToString(); |
| | | string msg1 = _value.ToString(); |
| | | string[] sArray = msg1.Split(new string[] { ";" }, StringSplitOptions.RemoveEmptyEntries); |
| | | string msg2 = sArray[0].ToString(); |
| | | string msg3 = sArray[1].ToString();//å½å人 |
| | | |
| | | //ååºåå |
| | | msg2 = "[" + msg2.ToString() + "]"; |
| | | |
| | | List<Models.ClsGy_Maintain> list = Newtonsoft.Json.JsonConvert.DeserializeObject<List<Models.ClsGy_Maintain>>(msg2); |
| | | |
| | | string HNumber = list[0].HNumber; |
| | | string HName = list[0].HName; |
| | | string HShortNumber = list[0].HNumber; |
| | | long HLevel = list[0].HLevel; |
| | | string HHelpCode = list[0].HHelpCode; |
| | | string HRemark = list[0].HRemark; |
| | | bool HStopflag = list[0].HStopflag; |
| | | string HUseFlag = list[0].HUseFlag; |
| | | bool HEndFlag = list[0].HEndFlag; |
| | | |
| | | //夿æé |
| | | if (!ClsPub.Security_Log("Gy_Maintain_Edit", 1, true, msg3)) |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "æ²¡ææ¾å°è¯¥åè½æ¨¡åï¼"; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | |
| | | if (!DBUtility.ClsPub.AllowNumber(HNumber)) |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "代ç ä¸ä¸è½åºç°è¿ç»â.âå¹¶ä¸é¦ä½æ«ä½ä¸è½ä¸ºâ.âï¼"; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | |
| | | |
| | | |
| | | //è¥MAINDIéå¤åéæ°è·å |
| | | oCN.BeginTran(); |
| | | //主表 |
| | | oCN.RunProc("Insert into Gy_Maintain " + |
| | | " (HNumber,HName,HHelpCode,HShortNumber" + |
| | | ",HLevel,HEndFlag,HStopflag,HRemark,HMakeTime) " + |
| | | " Values('" + HNumber + "','" + HName + "','" + HHelpCode + "','" + HShortNumber + "'," + |
| | | + HLevel + "," + Convert.ToString(HEndFlag ? 1 : 0) + "," + Convert.ToString(HStopflag ? 1 : 0) + ",'" + HRemark + "',getdate())", ref DBUtility.ClsPub.sExeReturnInfo); |
| | | //ä¿®æ¹ä¸çº§ä¸ºéæ«çº§ä»£ç |
| | | //oCN.RunProc("Update Gy_MouldType set HEndflag=0 where HItemID=" + HParentID, ref DBUtility.ClsPub.sExeReturnInfo); |
| | | oCN.Commit(); |
| | | objJsonResult.code = "1"; |
| | | objJsonResult.count = 1; |
| | | objJsonResult.Message = "æ°å¢æåï¼"; |
| | | //objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | catch (Exception e) |
| | | { |
| | | oCN.RollBack(); |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "Exceptionï¼" + e.Message; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | } |
| | | #endregion |
| | | } |
| | | } |
New file |
| | |
| | | using DBUtility; |
| | | 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 Gy_RepairBillController : ApiController |
| | | { |
| | | public DBUtility.ClsPub.Enum_BillStatus BillStatus; |
| | | |
| | | private json objJsonResult = new json(); |
| | | SQLHelper.ClsCN oCN = new SQLHelper.ClsCN(); |
| | | DataSet ds; |
| | | Models.ClsGy_Repair oDept = new Models.ClsGy_Repair(); |
| | | Models.ClsGy_Repair oDeptHlp = new Models.ClsGy_Repair(); |
| | | |
| | | #region 维修项ç®åè¡¨æ°æ® |
| | | [Route("Gy_Repair/GetRepairList")] |
| | | [HttpGet] |
| | | public object GetRepairList(string sWhere, string user) |
| | | { |
| | | try |
| | | { |
| | | if (!DBUtility.ClsPub.Security_Log("Gy_Repair", 1, true, user)) |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "æ²¡ææ¥çæé"; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | ds = oCN.RunProcReturn("select HItemID,HNumber,HName,HLevel, case when HEndFlag<>0 then 'Y'else ' 'end HEndFlag,case when HStopFlag <> 0 then 'Y'else ' 'end HStopFlag, HRemark, HUseFlag from Gy_Repair where 1=1 " + sWhere, "Gy_Repair"); |
| | | if (ds == null || ds.Tables[0].Rows.Count == 0) |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "æ ä¿å
»é¡¹ç®æ°æ®ï¼"; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | else |
| | | { |
| | | objJsonResult.code = "1"; |
| | | objJsonResult.count = 1; |
| | | objJsonResult.Message = "æ¥æ¾æåï¼"; |
| | | objJsonResult.data = ds.Tables[0]; |
| | | return objJsonResult; |
| | | } |
| | | } |
| | | catch (Exception e) |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "Exceptionï¼" + e.ToString(); |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | } |
| | | #endregion |
| | | |
| | | #region 维修项ç®å é¤ |
| | | [Route("Gy_Repair/DeleteRepair")] |
| | | [HttpGet] |
| | | public object DeleteRepair(long HItemID, string User) |
| | | { |
| | | |
| | | try |
| | | { |
| | | if (!DBUtility.ClsPub.Security_Log("Gy_Repair_Delete", 1, true, User)) |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "没æå 餿é"; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | ds = oCN.RunProcReturn("Select * from Gy_Repair Where HItemID='" + HItemID + "'", "Gy_Repair", ref DBUtility.ClsPub.sExeReturnInfo); |
| | | if (ds.Tables[0].Rows.Count != 0) |
| | | { |
| | | ds = oCN.RunProcReturn("Delete from Gy_Repair Where HItemID='" + HItemID + "'", "Gy_Repair", ref DBUtility.ClsPub.sExeReturnInfo); |
| | | objJsonResult.code = "1"; |
| | | objJsonResult.count = 1; |
| | | objJsonResult.Message = "å 餿å"; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | else |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "åæ®ä¸åå¨"; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | } |
| | | catch (Exception e) |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "Exceptionï¼" + e.ToString(); |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | } |
| | | #endregion |
| | | |
| | | #region ä¿®æ¹ç»´ä¿®é¡¹ç®è·åç»å®æ°æ® |
| | | [Route("Gy_Repair/EditRepair")] |
| | | [HttpGet] |
| | | public object EditRepair(long HInterID) |
| | | { |
| | | try |
| | | { |
| | | ds = oCN.RunProcReturn("select * from Gy_Repair where HItemID=" + HInterID, "Gy_Repair"); |
| | | |
| | | objJsonResult.code = "1"; |
| | | objJsonResult.count = 1; |
| | | objJsonResult.Message = ""; |
| | | objJsonResult.data = ds.Tables[0]; |
| | | return objJsonResult; |
| | | } |
| | | catch (Exception e) |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "Exceptionï¼" + e.ToString(); |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | } |
| | | #endregion |
| | | |
| | | #region 维修项ç®ä¿®æ¹ä¿å |
| | | [Route("Gy_Repair/EditBill")] |
| | | [HttpPost] |
| | | public object EditBill([FromBody] JObject oMain) |
| | | { |
| | | |
| | | try |
| | | { |
| | | var _value = oMain["oMain"].ToString(); |
| | | string msg1 = _value.ToString(); |
| | | string[] sArray = msg1.Split(new string[] { ";" }, StringSplitOptions.RemoveEmptyEntries); |
| | | string msg2 = sArray[0].ToString(); |
| | | string msg3 = sArray[1].ToString(); |
| | | string msg4 = sArray[2].ToString();//å½å人 |
| | | |
| | | //ååºåå |
| | | msg2 = "[" + msg2.ToString() + "]"; |
| | | List<Models.ClsGy_Repair> list = Newtonsoft.Json.JsonConvert.DeserializeObject<List<Models.ClsGy_Repair>>(msg2); |
| | | |
| | | long HItemID = int.Parse(msg3); |
| | | string HNumber = list[0].HNumber; |
| | | string HName = list[0].HName; |
| | | string HShortNumber = list[0].HNumber; |
| | | string HHelpCode = list[0].HHelpCode; |
| | | string HRemark = list[0].HRemark; |
| | | bool HStopflag = list[0].HStopflag; |
| | | string HUseFlag = list[0].HUseFlag; |
| | | |
| | | //夿æé |
| | | if (!ClsPub.Security_Log("Gy_Repair_Edit", 1, true, msg4)) |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "æ²¡ææ¾å°è¯¥åè½æ¨¡åï¼"; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | |
| | | |
| | | if (!DBUtility.ClsPub.AllowNumber(HNumber)) |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "代ç ä¸ä¸è½åºç°è¿ç»â.âå¹¶ä¸é¦ä½æ«ä½ä¸è½ä¸ºâ.âï¼"; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | |
| | | if (oDept.HavSameNumber(HItemID, HNumber)) |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "代ç éå¤ï¼"; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | |
| | | |
| | | //è¥MAINDIéå¤åéæ°è·å |
| | | oCN.BeginTran(); |
| | | //主表 |
| | | oCN.RunProc("Update Gy_Repair set " + |
| | | " HNumber='" + HNumber + "'" + |
| | | ",HName='" + HName + "'" + |
| | | ",HShortNumber='" + HShortNumber + "'" + |
| | | ",HHelpCode='" + HHelpCode + "'" + |
| | | ",HStopflag='" + HStopflag + "'" + |
| | | ",HRemark= '" + HRemark + "' Where HItemID=" + HItemID, ref DBUtility.ClsPub.sExeReturnInfo); |
| | | //ä¿®æ¹å项ç®ä»£ç |
| | | //oCN.RunProc("exec h_p_Gy_UpdateNumber Gy_RepairCheck,'" + HNumber + ".','" + this.HOldNumber + ".'", ref DBUtility.ClsPub.sExeReturnInfo); |
| | | |
| | | oCN.Commit(); |
| | | objJsonResult.code = "1"; |
| | | objJsonResult.count = 1; |
| | | objJsonResult.Message = "ä¿®æ¹æåï¼"; |
| | | //objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | catch (Exception e) |
| | | { |
| | | oCN.RollBack(); |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "Exceptionï¼" + e.Message; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | } |
| | | #endregion |
| | | |
| | | #region ç»´ä¿®é¡¹ç®æ°å¢ä¿å |
| | | [Route("Gy_Repair/AddBill")] |
| | | [HttpPost] |
| | | public object AddBill([FromBody] JObject oMain) |
| | | { |
| | | try |
| | | { |
| | | var _value = oMain["oMain"].ToString(); |
| | | string msg1 = _value.ToString(); |
| | | string[] sArray = msg1.Split(new string[] { ";" }, StringSplitOptions.RemoveEmptyEntries); |
| | | string msg2 = sArray[0].ToString(); |
| | | string msg3 = sArray[1].ToString();//å½å人 |
| | | |
| | | //ååºåå |
| | | msg2 = "[" + msg2.ToString() + "]"; |
| | | |
| | | List<Models.ClsGy_Repair> list = Newtonsoft.Json.JsonConvert.DeserializeObject<List<Models.ClsGy_Repair>>(msg2); |
| | | |
| | | string HNumber = list[0].HNumber; |
| | | string HName = list[0].HName; |
| | | string HShortNumber = list[0].HNumber; |
| | | long HLevel = list[0].HLevel; |
| | | string HHelpCode = list[0].HHelpCode; |
| | | string HRemark = list[0].HRemark; |
| | | bool HStopflag = list[0].HStopflag; |
| | | string HUseFlag = list[0].HUseFlag; |
| | | bool HEndFlag = list[0].HEndFlag; |
| | | |
| | | //夿æé |
| | | if (!ClsPub.Security_Log("Gy_Repair_Edit", 1, true, msg3)) |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "æ²¡ææ¾å°è¯¥åè½æ¨¡åï¼"; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | |
| | | if (!DBUtility.ClsPub.AllowNumber(HNumber)) |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "代ç ä¸ä¸è½åºç°è¿ç»â.âå¹¶ä¸é¦ä½æ«ä½ä¸è½ä¸ºâ.âï¼"; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | |
| | | |
| | | |
| | | //è¥MAINDIéå¤åéæ°è·å |
| | | oCN.BeginTran(); |
| | | //主表 |
| | | oCN.RunProc("Insert into Gy_Repair " + |
| | | " (HNumber,HName,HHelpCode,HShortNumber" + |
| | | ",HLevel,HEndFlag,HStopflag,HRemark,HMakeTime) " + |
| | | " Values('" + HNumber + "','" + HName + "','" + HHelpCode + "','" + HShortNumber + "'," + |
| | | +HLevel + "," + Convert.ToString(HEndFlag ? 1 : 0) + "," + Convert.ToString(HStopflag ? 1 : 0) + ",'" + HRemark + "',getdate())", ref DBUtility.ClsPub.sExeReturnInfo); |
| | | //ä¿®æ¹ä¸çº§ä¸ºéæ«çº§ä»£ç |
| | | //oCN.RunProc("Update Gy_MouldType set HEndflag=0 where HItemID=" + HParentID, ref DBUtility.ClsPub.sExeReturnInfo); |
| | | oCN.Commit(); |
| | | objJsonResult.code = "1"; |
| | | objJsonResult.count = 1; |
| | | objJsonResult.Message = "æ°å¢æåï¼"; |
| | | //objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | catch (Exception e) |
| | | { |
| | | oCN.RollBack(); |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "Exceptionï¼" + e.Message; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | } |
| | | #endregion |
| | | } |
| | | } |
New file |
| | |
| | | using DBUtility; |
| | | 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 Gy_RepairCheckBillController : ApiController |
| | | { |
| | | public DBUtility.ClsPub.Enum_BillStatus BillStatus; |
| | | |
| | | private json objJsonResult = new json(); |
| | | SQLHelper.ClsCN oCN = new SQLHelper.ClsCN(); |
| | | DataSet ds; |
| | | Models.ClsGy_RepairCheck oDept = new Models.ClsGy_RepairCheck(); |
| | | Models.ClsGy_RepairCheck oDeptHlp = new Models.ClsGy_RepairCheck(); |
| | | |
| | | #region ç»´ä¿®éªæ¶é¡¹ç®åè¡¨æ°æ® |
| | | [Route("Gy_RepairCheck/GetRepairCheckList")] |
| | | [HttpGet] |
| | | public object GetRepairCheckList(string sWhere, string user) |
| | | { |
| | | try |
| | | { |
| | | if (!DBUtility.ClsPub.Security_Log("Gy_RepairCheck", 1, true, user)) |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "æ²¡ææ¥çæé"; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | ds = oCN.RunProcReturn("select HItemID,HNumber,HName,HLevel, case when HEndFlag<>0 then 'Y'else ' 'end HEndFlag,case when HStopFlag <> 0 then 'Y'else ' 'end HStopFlag, HRemark, HUseFlag from Gy_RepairCheck where 1=1 " + sWhere, "Gy_RepairCheck"); |
| | | if (ds == null || ds.Tables[0].Rows.Count == 0) |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "æ ä¿å
»é¡¹ç®æ°æ®ï¼"; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | else |
| | | { |
| | | objJsonResult.code = "1"; |
| | | objJsonResult.count = 1; |
| | | objJsonResult.Message = "æ¥æ¾æåï¼"; |
| | | objJsonResult.data = ds.Tables[0]; |
| | | return objJsonResult; |
| | | } |
| | | } |
| | | catch (Exception e) |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "Exceptionï¼" + e.ToString(); |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | } |
| | | #endregion |
| | | |
| | | #region ç»´ä¿®éªæ¶é¡¹ç®å é¤ |
| | | [Route("Gy_RepairCheck/DeleteRepairCheck")] |
| | | [HttpGet] |
| | | public object DeleteRepairCheck(long HItemID, string User) |
| | | { |
| | | |
| | | try |
| | | { |
| | | if (!DBUtility.ClsPub.Security_Log("Gy_RepairCheck_Delete", 1, true, User)) |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "没æå 餿é"; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | ds = oCN.RunProcReturn("Select * from Gy_RepairCheck Where HItemID='" + HItemID + "'", "Gy_RepairCheck", ref DBUtility.ClsPub.sExeReturnInfo); |
| | | if (ds.Tables[0].Rows.Count != 0) |
| | | { |
| | | ds = oCN.RunProcReturn("Delete from Gy_RepairCheck Where HItemID='" + HItemID + "'", "Gy_RepairCheck", ref DBUtility.ClsPub.sExeReturnInfo); |
| | | objJsonResult.code = "1"; |
| | | objJsonResult.count = 1; |
| | | objJsonResult.Message = "å 餿å"; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | else |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "åæ®ä¸åå¨"; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | } |
| | | catch (Exception e) |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "Exceptionï¼" + e.ToString(); |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | } |
| | | #endregion |
| | | |
| | | #region ä¿®æ¹ç»´ä¿®éªæ¶é¡¹ç®è·åç»å®æ°æ® |
| | | [Route("Gy_RepairCheck/EditRepairCheck")] |
| | | [HttpGet] |
| | | public object EditRepairCheck(long HInterID) |
| | | { |
| | | try |
| | | { |
| | | ds = oCN.RunProcReturn("select * from Gy_RepairCheck where HItemID=" + HInterID, "Gy_RepairCheck"); |
| | | |
| | | objJsonResult.code = "1"; |
| | | objJsonResult.count = 1; |
| | | objJsonResult.Message = ""; |
| | | objJsonResult.data = ds.Tables[0]; |
| | | return objJsonResult; |
| | | } |
| | | catch (Exception e) |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "Exceptionï¼" + e.ToString(); |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | } |
| | | #endregion |
| | | |
| | | #region ç»´ä¿®éªæ¶é¡¹ç®ä¿®æ¹ä¿å |
| | | [Route("Gy_RepairCheck/EditBill")] |
| | | [HttpPost] |
| | | public object EditBill([FromBody] JObject oMain) |
| | | { |
| | | |
| | | try |
| | | { |
| | | var _value = oMain["oMain"].ToString(); |
| | | string msg1 = _value.ToString(); |
| | | string[] sArray = msg1.Split(new string[] { ";" }, StringSplitOptions.RemoveEmptyEntries); |
| | | string msg2 = sArray[0].ToString(); |
| | | string msg3 = sArray[1].ToString(); |
| | | string msg4 = sArray[2].ToString();//å½å人 |
| | | |
| | | //ååºåå |
| | | msg2 = "[" + msg2.ToString() + "]"; |
| | | List<Models.ClsGy_RepairCheck> list = Newtonsoft.Json.JsonConvert.DeserializeObject<List<Models.ClsGy_RepairCheck>>(msg2); |
| | | |
| | | long HItemID = int.Parse(msg3); |
| | | string HNumber = list[0].HNumber; |
| | | string HName = list[0].HName; |
| | | string HShortNumber = list[0].HNumber; |
| | | string HHelpCode = list[0].HHelpCode; |
| | | string HRemark = list[0].HRemark; |
| | | bool HStopflag = list[0].HStopflag; |
| | | string HUseFlag = list[0].HUseFlag; |
| | | |
| | | //夿æé |
| | | if (!ClsPub.Security_Log("Gy_RepairCheck_Edit", 1, true, msg4)) |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "æ²¡ææ¾å°è¯¥åè½æ¨¡åï¼"; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | |
| | | |
| | | if (!DBUtility.ClsPub.AllowNumber(HNumber)) |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "代ç ä¸ä¸è½åºç°è¿ç»â.âå¹¶ä¸é¦ä½æ«ä½ä¸è½ä¸ºâ.âï¼"; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | |
| | | if (oDept.HavSameNumber(HItemID, HNumber)) |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "代ç éå¤ï¼"; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | |
| | | |
| | | //è¥MAINDIéå¤åéæ°è·å |
| | | oCN.BeginTran(); |
| | | //主表 |
| | | oCN.RunProc("Update Gy_RepairCheck set " + |
| | | " HNumber='" + HNumber + "'" + |
| | | ",HName='" + HName + "'" + |
| | | ",HShortNumber='" + HShortNumber + "'" + |
| | | ",HHelpCode='" + HHelpCode + "'" + |
| | | ",HStopflag='" + HStopflag + "'" + |
| | | ",HRemark= '" + HRemark + "' Where HItemID=" + HItemID, ref DBUtility.ClsPub.sExeReturnInfo); |
| | | //ä¿®æ¹å项ç®ä»£ç |
| | | //oCN.RunProc("exec h_p_Gy_UpdateNumber Gy_RepairCheck,'" + HNumber + ".','" + this.HOldNumber + ".'", ref DBUtility.ClsPub.sExeReturnInfo); |
| | | |
| | | oCN.Commit(); |
| | | objJsonResult.code = "1"; |
| | | objJsonResult.count = 1; |
| | | objJsonResult.Message = "ä¿®æ¹æåï¼"; |
| | | //objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | catch (Exception e) |
| | | { |
| | | oCN.RollBack(); |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "Exceptionï¼" + e.Message; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | } |
| | | #endregion |
| | | |
| | | #region ç»´ä¿®éªæ¶é¡¹ç®æ°å¢ä¿å |
| | | [Route("Gy_RepairCheck/AddBill")] |
| | | [HttpPost] |
| | | public object AddBill([FromBody] JObject oMain) |
| | | { |
| | | try |
| | | { |
| | | var _value = oMain["oMain"].ToString(); |
| | | string msg1 = _value.ToString(); |
| | | string[] sArray = msg1.Split(new string[] { ";" }, StringSplitOptions.RemoveEmptyEntries); |
| | | string msg2 = sArray[0].ToString(); |
| | | string msg3 = sArray[1].ToString();//å½å人 |
| | | |
| | | //ååºåå |
| | | msg2 = "[" + msg2.ToString() + "]"; |
| | | |
| | | List<Models.ClsGy_RepairCheck> list = Newtonsoft.Json.JsonConvert.DeserializeObject<List<Models.ClsGy_RepairCheck>>(msg2); |
| | | |
| | | string HNumber = list[0].HNumber; |
| | | string HName = list[0].HName; |
| | | string HShortNumber = list[0].HNumber; |
| | | long HLevel = list[0].HLevel; |
| | | string HHelpCode = list[0].HHelpCode; |
| | | string HRemark = list[0].HRemark; |
| | | bool HStopflag = list[0].HStopflag; |
| | | string HUseFlag = list[0].HUseFlag; |
| | | bool HEndFlag = list[0].HEndFlag; |
| | | |
| | | //夿æé |
| | | if (!ClsPub.Security_Log("Gy_RepairCheck_Edit", 1, true, msg3)) |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "æ²¡ææ¾å°è¯¥åè½æ¨¡åï¼"; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | |
| | | if (!DBUtility.ClsPub.AllowNumber(HNumber)) |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "代ç ä¸ä¸è½åºç°è¿ç»â.âå¹¶ä¸é¦ä½æ«ä½ä¸è½ä¸ºâ.âï¼"; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | |
| | | |
| | | |
| | | //è¥MAINDIéå¤åéæ°è·å |
| | | oCN.BeginTran(); |
| | | //主表 |
| | | oCN.RunProc("Insert into Gy_RepairCheck " + |
| | | " (HNumber,HName,HHelpCode,HShortNumber" + |
| | | ",HLevel,HEndFlag,HStopflag,HRemark,HMakeTime) " + |
| | | " Values('" + HNumber + "','" + HName + "','" + HHelpCode + "','" + HShortNumber + "'," + |
| | | +HLevel + "," + Convert.ToString(HEndFlag ? 1 : 0) + "," + Convert.ToString(HStopflag ? 1 : 0) + ",'" + HRemark + "',getdate())", ref DBUtility.ClsPub.sExeReturnInfo); |
| | | //ä¿®æ¹ä¸çº§ä¸ºéæ«çº§ä»£ç |
| | | //oCN.RunProc("Update Gy_MouldType set HEndflag=0 where HItemID=" + HParentID, ref DBUtility.ClsPub.sExeReturnInfo); |
| | | oCN.Commit(); |
| | | objJsonResult.code = "1"; |
| | | objJsonResult.count = 1; |
| | | objJsonResult.Message = "æ°å¢æåï¼"; |
| | | //objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | catch (Exception e) |
| | | { |
| | | oCN.RollBack(); |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "Exceptionï¼" + e.Message; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | } |
| | | #endregion |
| | | } |
| | | } |
New file |
| | |
| | | using System; |
| | | using System.Collections.Generic; |
| | | using System.Linq; |
| | | using System.Web; |
| | | |
| | | namespace WebAPI.Models |
| | | { |
| | | public class ClsGy_DotCheck : DBUtility.ClsGy_Base_Ctl |
| | | { |
| | | public int HItemID; |
| | | public string HNumber; //代ç |
| | | public string HName; //åç§° |
| | | public string HHelpCode; //å©è®°ç |
| | | public string HShortNumber; //ç代ç |
| | | public int HParentID; //ç¶çº§ |
| | | public int HLevel; //ç级 |
| | | public bool HEndFlag; //æ«çº§æ å¿ |
| | | public bool HStopflag; //ç¦ç¨æ å¿ |
| | | public string HRemark; //夿³¨ |
| | | public string HUseFlag = "æªä½¿ç¨"; |
| | | |
| | | } |
| | | } |
New file |
| | |
| | | using System; |
| | | using System.Collections.Generic; |
| | | using System.Linq; |
| | | using System.Web; |
| | | |
| | | namespace WebAPI.Models |
| | | { |
| | | public class ClsGy_Maintain : DBUtility.ClsGy_Base_Ctl |
| | | { |
| | | public int HItemID; |
| | | public string HNumber; //代ç |
| | | public string HName; //åç§° |
| | | public string HHelpCode; //å©è®°ç |
| | | public string HShortNumber; //ç代ç |
| | | public int HParentID; //ç¶çº§ |
| | | public int HLevel; //ç级 |
| | | public bool HEndFlag; //æ«çº§æ å¿ |
| | | public bool HStopflag; //ç¦ç¨æ å¿ |
| | | public string HRemark; //夿³¨ |
| | | public string HUseFlag = "æªä½¿ç¨"; |
| | | |
| | | |
| | | } |
| | | } |
New file |
| | |
| | | using System; |
| | | using System.Collections.Generic; |
| | | using System.Linq; |
| | | using System.Web; |
| | | |
| | | namespace WebAPI.Models |
| | | { |
| | | public class ClsGy_Repair : DBUtility.ClsGy_Base_Ctl |
| | | { |
| | | public int HItemID; |
| | | public string HNumber; //代ç |
| | | public string HName; //åç§° |
| | | public string HHelpCode; //å©è®°ç |
| | | public string HShortNumber; //ç代ç |
| | | public int HParentID; //ç¶çº§ |
| | | public int HLevel; //ç级 |
| | | public bool HEndFlag; //æ«çº§æ å¿ |
| | | public bool HStopflag; //ç¦ç¨æ å¿ |
| | | public string HRemark; //夿³¨ |
| | | public string HUseFlag = "æªä½¿ç¨"; |
| | | } |
| | | } |
New file |
| | |
| | | using System; |
| | | using System.Collections.Generic; |
| | | using System.Linq; |
| | | using System.Web; |
| | | |
| | | namespace WebAPI.Models |
| | | { |
| | | public class ClsGy_RepairCheck : DBUtility.ClsGy_Base_Ctl |
| | | { |
| | | public int HItemID; |
| | | public string HNumber; //代ç |
| | | public string HName; //åç§° |
| | | public string HHelpCode; //å©è®°ç |
| | | public string HShortNumber; //ç代ç |
| | | public int HParentID; //ç¶çº§ |
| | | public int HLevel; //ç级 |
| | | public bool HEndFlag; //æ«çº§æ å¿ |
| | | public bool HStopflag; //ç¦ç¨æ å¿ |
| | | public string HRemark; //夿³¨ |
| | | public string HUseFlag = "æªä½¿ç¨"; |
| | | |
| | | |
| | | } |
| | | } |
| | |
| | | <publishTime>02/22/2013 08:43:40</publishTime> |
| | | </File> |
| | | <File Include="bin/BLL.dll"> |
| | | <publishTime>11/02/2021 16:45:08</publishTime> |
| | | <publishTime>11/03/2021 17:04:35</publishTime> |
| | | </File> |
| | | <File Include="bin/BLL.pdb"> |
| | | <publishTime>11/02/2021 16:45:08</publishTime> |
| | | <publishTime>11/03/2021 17:04:35</publishTime> |
| | | </File> |
| | | <File Include="bin/DAL.dll"> |
| | | <publishTime>11/02/2021 16:45:06</publishTime> |
| | | <publishTime>11/03/2021 17:04:33</publishTime> |
| | | </File> |
| | | <File Include="bin/DAL.pdb"> |
| | | <publishTime>11/02/2021 16:45:06</publishTime> |
| | | <publishTime>11/03/2021 17:04:33</publishTime> |
| | | </File> |
| | | <File Include="bin/Dapper.dll"> |
| | | <publishTime>07/22/2016 14:52:40</publishTime> |
| | | </File> |
| | | <File Include="bin/DBUtility.dll"> |
| | | <publishTime>11/02/2021 16:45:02</publishTime> |
| | | <publishTime>11/03/2021 17:04:29</publishTime> |
| | | </File> |
| | | <File Include="bin/DBUtility.pdb"> |
| | | <publishTime>11/02/2021 16:45:02</publishTime> |
| | | <publishTime>11/03/2021 17:04:29</publishTime> |
| | | </File> |
| | | <File Include="bin/Interop.gregn6Lib.dll"> |
| | | <publishTime>08/25/2021 10:28:25</publishTime> |
| | |
| | | <publishTime>07/25/2012 11:48:56</publishTime> |
| | | </File> |
| | | <File Include="bin/Model.dll"> |
| | | <publishTime>11/02/2021 16:45:02</publishTime> |
| | | <publishTime>11/03/2021 17:04:29</publishTime> |
| | | </File> |
| | | <File Include="bin/Model.pdb"> |
| | | <publishTime>11/02/2021 16:45:02</publishTime> |
| | | <publishTime>11/03/2021 17:04:29</publishTime> |
| | | </File> |
| | | <File Include="bin/Models/ClsSc_MouldScrapOutBillMain.cs"> |
| | | <publishTime>08/16/2021 17:23:15</publishTime> |
| | |
| | | <publishTime>08/03/2014 20:33:56</publishTime> |
| | | </File> |
| | | <File Include="bin/Pub_Class.dll"> |
| | | <publishTime>11/02/2021 16:44:59</publishTime> |
| | | <publishTime>11/03/2021 17:04:27</publishTime> |
| | | </File> |
| | | <File Include="bin/Pub_Class.pdb"> |
| | | <publishTime>11/02/2021 16:44:59</publishTime> |
| | | <publishTime>11/03/2021 17:04:27</publishTime> |
| | | </File> |
| | | <File Include="bin/Pub_Control.dll"> |
| | | <publishTime>11/02/2021 16:45:00</publishTime> |
| | | <publishTime>11/03/2021 17:04:28</publishTime> |
| | | </File> |
| | | <File Include="bin/Pub_Control.pdb"> |
| | | <publishTime>11/02/2021 16:45:00</publishTime> |
| | | <publishTime>11/03/2021 17:04:28</publishTime> |
| | | </File> |
| | | <File Include="bin/SQLHelper.dll"> |
| | | <publishTime>11/02/2021 16:45:01</publishTime> |
| | | <publishTime>11/03/2021 17:04:28</publishTime> |
| | | </File> |
| | | <File Include="bin/SQLHelper.pdb"> |
| | | <publishTime>11/02/2021 16:45:01</publishTime> |
| | | <publishTime>11/03/2021 17:04:28</publishTime> |
| | | </File> |
| | | <File Include="bin/stdole.dll"> |
| | | <publishTime>05/09/2021 13:35:37</publishTime> |
| | |
| | | <publishTime>11/24/2014 11:18:48</publishTime> |
| | | </File> |
| | | <File Include="bin/WebAPI.dll"> |
| | | <publishTime>11/02/2021 16:45:11</publishTime> |
| | | <publishTime>11/03/2021 17:04:38</publishTime> |
| | | </File> |
| | | <File Include="bin/WebAPI.pdb"> |
| | | <publishTime>11/02/2021 16:45:11</publishTime> |
| | | <publishTime>11/03/2021 17:04:38</publishTime> |
| | | </File> |
| | | <File Include="bin/WebGrease.dll"> |
| | | <publishTime>07/17/2013 17:03:52</publishTime> |
| | |
| | | <publishTime>08/06/2021 22:57:28</publishTime> |
| | | </File> |
| | | <File Include="Web.config"> |
| | | <publishTime>11/02/2021 16:45:28</publishTime> |
| | | <publishTime>11/03/2021 17:05:39</publishTime> |
| | | </File> |
| | | </ItemGroup> |
| | | </Project> |
| | |
| | | <Compile Include="Controllers\XSGL\Xs_SeOrderBillController.cs" /> |
| | | <Compile Include="Controllers\å质管ç\å·¥åºæ£éªå\QC_ProcessCheckBillController.cs" /> |
| | | <Compile Include="Controllers\å质管ç\é¦ä»¶æ£éªå\QC_FirstPieceCheckBillController.cs" /> |
| | | <Compile Include="Controllers\åºç¡èµæ\åºç¡èµæ\Gy_DotCheckBillController.cs" /> |
| | | <Compile Include="Controllers\åºç¡èµæ\åºç¡èµæ\Gy_MaintainBillController.cs" /> |
| | | <Compile Include="Controllers\åºç¡èµæ\åºç¡èµæ\Gy_RepairBillController.cs" /> |
| | | <Compile Include="Controllers\åºç¡èµæ\åºç¡èµæ\Gy_RepairCheckBillController.cs" /> |
| | | <Compile Include="Controllers\åºç¡èµæ\å·¥èµåºç¡èµæ\Gy_ProcPriceController.cs" /> |
| | | <Compile Include="Controllers\ç产管ç\ç产任å¡å\Sc_ICMOBillController.cs" /> |
| | | <Compile Include="Controllers\ç产管ç\è´¨éæ±æ¥å\Sc_QualityReportBillController.cs" /> |
| | |
| | | <Compile Include="Models\ApiConfig.cs" /> |
| | | <Compile Include="Models\ApiResult.cs" /> |
| | | <Compile Include="Models\CheckItem.cs" /> |
| | | <Compile Include="Models\ClsGy_DotCheck.cs" /> |
| | | <Compile Include="Models\ClsGy_Maintain.cs" /> |
| | | <Compile Include="Models\ClsGy_Repair.cs" /> |
| | | <Compile Include="Models\ClsGy_RepairCheck.cs" /> |
| | | <Compile Include="Models\Gy_OrderBackInfo.cs" /> |
| | | <Compile Include="Models\Gy_OrderLevList.cs" /> |
| | | <Compile Include="Models\ClsGy_EquipFileMain.cs" /> |