Merge branch 'master' of http://101.37.171.70:10101/r/MES-WEB-API
| | |
| | | |
| | | msg2 = "[" + msg2.ToString() + "]"; |
| | | List<Gy_RoutingBill> mainList = Newtonsoft.Json.JsonConvert.DeserializeObject<List<Gy_RoutingBill>>(msg2); |
| | | |
| | | |
| | | long HInterID = mainList[0].HInterID;//éå
¥typeå¾å°çåæ®ID |
| | | string HBillNo = mainList[0].HBillNo;//éå
¥typeå¾å°çåæ®å· |
| | | DateTime HDate = mainList[0].HDate;//æ¥æ |
| | |
| | | string HProductNum = mainList[0].HProductNum;//æåç¼å· |
| | | string HVerNum = mainList[0].HVerNum;//çæ¬ |
| | | |
| | | if (OperationType == 2) |
| | | { |
| | | ds = oCN.RunProcReturn("select * from h_v_Gy_RoutingBillList where åæ®å·='" + HBillNo + "'", "h_v_Gy_RoutingBillList"); |
| | | if (ds.Tables[0].Rows.Count > 0) |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "åæ®å·éå¤,è¯·éæ°è¾å
¥!"; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | } |
| | | |
| | | ds = oCN.RunProcReturn("select * from h_v_Gy_RoutingBillList where hmainid=" + HInterID + " and åæ®å·='" + HBillNo + "'", "h_v_Gy_RoutingBillList"); |
| | | |
| | | if (OperationType == 1 && ds.Tables[0].Rows.Count == 0)//æ°å¢ |
| | | if ((OperationType == 1 || OperationType == 2) && ds.Tables[0].Rows.Count == 0)//æ°å¢ |
| | | { |
| | | //主表 |
| | | oCN.RunProc("Insert Into Gy_RoutingBillMain " + |
| | |
| | | ",HProductNum='" + HProductNum + "',HVerNum='" + HVerNum + "' where HInterID='" + HInterID + "'"); |
| | | |
| | | //å é¤å表 |
| | | oCN.RunProc("delete from Gy_RoutingBillSub where HInterID='" + HInterID+ "' and HProcNo!='9999'"); |
| | | oCN.RunProc("delete from Gy_RoutingBillSub where HInterID='" + HInterID + "' and HProcNo!='9999'"); |
| | | } |
| | | //ä¿åå表 |
| | | objJsonResult = AddBillSub(msg3, HInterID); |
| | | objJsonResult = AddBillSub(msg3, HInterID, OperationType); |
| | | if (objJsonResult.code == "0") |
| | | { |
| | | objJsonResult.code = "0"; |
| | |
| | | |
| | | if (OperationType == 1) |
| | | { |
| | | |
| | | |
| | | if (ds == null || ds.Tables[0].Rows.Count == 0) |
| | | { |
| | | objJsonResult.code = "0"; |
| | |
| | | } |
| | | } |
| | | |
| | | public json AddBillSub(string msg3, long HInterID) |
| | | public json AddBillSub(string msg3, long HInterID,int OperationType) |
| | | { |
| | | List<Gy_RoutingBillSub> DetailColl = Newtonsoft.Json.JsonConvert.DeserializeObject<List<Gy_RoutingBillSub>>(msg3); |
| | | int i = 0; |
| | |
| | | return objJsonResult; |
| | | } |
| | | |
| | | if (oSub.HProcNo!="9999") |
| | | if (oSub.HProcNo != "9999" || OperationType == 2) |
| | | { |
| | | oCN.RunProc("Insert into Gy_RoutingBillSub " + |
| | | "(HInterID,HEntryID,HProcID,HProcNO,HSupID,HSupFlag" + |
| | |
| | | file.SaveAs(ExcelPath); |
| | | |
| | | NpoiHelper np = new NpoiHelper(); |
| | | DataSet ExcelDs = np.ReadExcel(ExcelPath, 1,2, WorkBookName); |
| | | DataSet ExcelDs = np.ReadExcel(ExcelPath, 1, 2, WorkBookName); |
| | | |
| | | //å 餿件 |
| | | File.Delete(ExcelPath); |
| | |
| | | |
| | | if (!tb2.Columns.Contains("å·¥åº")) |
| | | error += "æ²¡ææ¾å°ãå·¥åºãçæ é¢,"; |
| | | |
| | | |
| | | if (!tb2.Columns.Contains("å·¥ä½ä¸å¿")) |
| | | error += "æ²¡ææ¾å°ãå·¥ä½ä¸å¿ãçæ é¢,"; |
| | | |
| | |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = $"Excel模æ¿åå¨é误,{error}\r\n" ; |
| | | objJsonResult.Message = $"Excel模æ¿åå¨é误,{error}\r\n"; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | |
| | | , æ¬å·¥åºç¡®è®¤è®°å½, 夿³¨, å¾å·çæ¬, æ»è£
å¾å·, æè´¨, æåç¼å·, çæ¬ |
| | | , 模å
·ç¼å·, ç¨åºå·, ç产å®é¢, å·¥èºè·¯çº¿åç§°, æ¶é´åä½,å·¥èºè·¯çº¿ä»£ç )values |
| | | ('" + tb2.Rows[i]["产å代ç "].ToString() + "','" + tb2.Rows[i]["产ååç§°"].ToString() + "','" + tb2.Rows[i]["å·¥åºåºå·"].ToString() + "','" + tb2.Rows[i]["å·¥åºä»£ç "].ToString() + "','" + tb2.Rows[i]["å·¥åº"].ToString() + "','" + tb2.Rows[i]["å·¥ä½ä¸å¿"].ToString() + "','" + tb2.Rows[i]["å å·¥æ°é"].ToString() + "'" + |
| | | ",'" + tb2.Rows[i]["è¯ç"].ToString() + "','" + (tb2.Rows[i]["å·¥åºå·¥ä»·"].ToString()==""?"0": tb2.Rows[i]["å·¥åºå·¥ä»·"].ToString()) + "','" + tb2.Rows[i]["ä¸åæ ¼åä»·"].ToString() + "','" + tb2.Rows[i]["æ¥åºåä»·"].ToString() + "','" + tb2.Rows[i]["æ¬éåºå®å¼å·¥å¤©æ°"].ToString() + "','" + tb2.Rows[i]["æ¬éå¼å·¥ä½é"].ToString() + "','" + tb2.Rows[i]["ä¸éçå¾
天æ°"].ToString() + "'" + |
| | | ",'" + tb2.Rows[i]["è¯ç"].ToString() + "','" + (tb2.Rows[i]["å·¥åºå·¥ä»·"].ToString() == "" ? "0" : tb2.Rows[i]["å·¥åºå·¥ä»·"].ToString()) + "','" + tb2.Rows[i]["ä¸åæ ¼åä»·"].ToString() + "','" + tb2.Rows[i]["æ¥åºåä»·"].ToString() + "','" + tb2.Rows[i]["æ¬éåºå®å¼å·¥å¤©æ°"].ToString() + "','" + tb2.Rows[i]["æ¬éå¼å·¥ä½é"].ToString() + "','" + tb2.Rows[i]["ä¸éçå¾
天æ°"].ToString() + "'" + |
| | | ",'" + tb2.Rows[i]["ä¸é循ç¯å¨æ"].ToString() + "','" + tb2.Rows[i]["èªå¨è½¬ç§»"].ToString() + "','" + tb2.Rows[i]["å¤åæ è®°"].ToString() + "','" + tb2.Rows[i]["ä¾åºå代ç "].ToString() + "','" + tb2.Rows[i]["ä¾åºå"].ToString() + "','" + tb2.Rows[i]["å·¥èºåæ°"].ToString() + "','" + tb2.Rows[i]["å¾çº¸ç¼å·"].ToString() + "'" + |
| | | ",'" + tb2.Rows[i]["æ¬å·¥åºç¡®è®¤è®°å½"].ToString() + "','" + tb2.Rows[i]["夿³¨"].ToString() + "','" + tb2.Rows[i]["å¾å·çæ¬"].ToString() + "','" + tb2.Rows[i]["æ»è£
å¾å·"].ToString() + "','" + tb2.Rows[i]["æè´¨"].ToString() + "','" + tb2.Rows[i]["æåç¼å·"].ToString() + "','" + tb2.Rows[i]["çæ¬"].ToString() + "'" + |
| | | ",'" + tb2.Rows[i]["模å
·ç¼å·"].ToString() + "','" + tb2.Rows[i]["ç¨åºå·"].ToString() + "','" + tb2.Rows[i]["ç产å®é¢"].ToString() + "','" + tb2.Rows[i]["å·¥èºè·¯çº¿åç§°"].ToString() + "','" + tb2.Rows[i]["æ¶é´åä½"].ToString() + "','" + tb2.Rows[i]["å·¥èºè·¯çº¿ä»£ç "].ToString() + "')"); |
| | |
| | | { |
| | | if (HBillNo != "") |
| | | { |
| | | if (dataSet.Tables[0].Rows.Count==0) |
| | | if (dataSet.Tables[0].Rows.Count == 0) |
| | | { |
| | | break; |
| | | } |
| | |
| | | using Newtonsoft.Json.Linq; |
| | | using Newtonsoft.Json; |
| | | using Newtonsoft.Json.Linq; |
| | | using Pub_Class; |
| | | using System; |
| | | using System.Collections; |
| | |
| | | DataSet ds; |
| | | try |
| | | { |
| | | List<object> columnNameList = new List<object>(); |
| | | //夿æ¯å¦ææ¥è¯¢æé |
| | | //if (!DBUtility.ClsPub.Security_Log("Sc_ProcessExchangeBill_Query", 1, false, user)) |
| | | //{ |
| | |
| | | SQLHelper.ClsCN oCN = new SQLHelper.ClsCN(); |
| | | ds = oCN.RunProcReturn("select * from h_v_Sc_ProcessExchangeBillQuery where 1 = 1 " + sWhere + " order by hmainid desc ", "h_v_Sc_ProcessExchangeBillQuery"); |
| | | |
| | | //æ·»å åå |
| | | 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å对象çåå |
| | | } |
| | | //if (ds.Tables[0].Rows.Count != 0 || ds != null) |
| | | //{ |
| | | objJsonResult.code = "1"; |
| | | objJsonResult.count = 1; |
| | | objJsonResult.Message = "Sucessï¼"; |
| | | objJsonResult.list = columnNameList; |
| | | objJsonResult.data = ds.Tables[0]; |
| | | return objJsonResult; |
| | | //} |
| | |
| | | { |
| | | try |
| | | { |
| | | List<object> columnNameList = new List<object>(); |
| | | //if (ds.Tables[0].Rows.Count != 0 || ds != null) |
| | | //{ |
| | | //æ·»å åå |
| | | foreach (DataColumn col in ds.Tables[0].Columns) |
| | | { |
| | | Type dataType = col.DataType; |
| | | string ColmString = "{\"ColmCols\":\"" + col.ColumnName + "\",\"ColmType\":\"" + dataType.Name + "\"}"; |
| | | columnNameList.Add(JsonConvert.DeserializeObject(ColmString));//è·åå°DataColumnå对象çåå |
| | | } |
| | | |
| | | objJsonResult.code = "1"; |
| | | objJsonResult.count = 1; |
| | | objJsonResult.Message = "Sucessï¼"; |
| | | objJsonResult.list = columnNameList; |
| | | objJsonResult.data = ds.Tables[0]; |
| | | return objJsonResult; |
| | | //} |
New file |
| | |
| | | using Newtonsoft.Json; |
| | | using Newtonsoft.Json.Linq; |
| | | using System; |
| | | using System.Collections.Generic; |
| | | using System.Data; |
| | | using System.Linq; |
| | | using System.Net; |
| | | using System.Net.Http; |
| | | using System.Web.Http; |
| | | using WebAPI.Models.åºç¡èµæ; |
| | | using WebAPI.Models; |
| | | |
| | | namespace WebAPI.Controllers.åºç¡èµæ.åºç¡èµæ |
| | | { |
| | | public class Gy_DutyBillController : ApiController |
| | | { |
| | | private json objJsonResult = new json(); |
| | | public DataSet ds = new DataSet(); |
| | | public SQLHelper.ClsCN oCN = new SQLHelper.ClsCN(); |
| | | |
| | | #region ç»ç»æ¶æè®¾ç½® æ å½¢å¾ |
| | | public class TreeModel |
| | | { |
| | | public string id { get; set; } |
| | | public string title { get; set; } |
| | | public List<TreeModel> children = new List<TreeModel>(); |
| | | } |
| | | [Route("Gy_DutyBill/Gy_DutyBillTreeList")] |
| | | [HttpGet] |
| | | public object Gy_DutyBillTreeList() |
| | | { |
| | | try |
| | | { |
| | | string sql1 = string.Format("select hitemid,hnumber,hname from Gy_Duty order by hnumber"); |
| | | |
| | | ds = oCN.RunProcReturn(sql1, "Gy_Duty"); |
| | | |
| | | List<TreeModel> treeModels = new List<TreeModel>(); |
| | | TreeModel first = new TreeModel(); |
| | | first.id = "0"; |
| | | first.title = "ç»ç»æ¶æè®¾ç½®"; |
| | | treeModels.Add(first); |
| | | |
| | | foreach (DataRow row in ds.Tables[0].Rows) |
| | | { |
| | | var strLen = row["hnumber"].ToString().Split('.'); |
| | | if (strLen.Length == 1) |
| | | { |
| | | TreeModel tree = new TreeModel(); |
| | | tree.id = row["hnumber"].ToString(); |
| | | tree.title = row["hname"].ToString(); |
| | | treeModels[0].children.Add(tree); |
| | | } |
| | | } |
| | | |
| | | digui(ds.Tables[0], treeModels[0].children, 2); |
| | | |
| | | objJsonResult.code = "1"; |
| | | objJsonResult.count = 1; |
| | | objJsonResult.Message = "Sucessï¼"; |
| | | objJsonResult.data = Newtonsoft.Json.JsonConvert.SerializeObject(treeModels); |
| | | return objJsonResult; |
| | | } |
| | | catch (Exception e) |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "Exceptionï¼" + e.ToString(); |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | } |
| | | |
| | | /// <summary> |
| | | /// éå½å½æ° |
| | | /// </summary> |
| | | public void digui(DataTable dt, List<TreeModel> tree,int num) |
| | | { |
| | | for (int m = 0; m < tree.Count; m++) |
| | | { |
| | | tree[m].children = new List<TreeModel>(); |
| | | for (int i = 0; i < dt.Rows.Count; i++)//ç¬¬ä¸æ¬¡å¾ªç¯ï¼å¾å°æææ ¹èç¹çåé |
| | | { |
| | | var strLen = dt.Rows[i]["hnumber"].ToString().Split('.'); |
| | | if (strLen.Length == num && dt.Rows[i]["hnumber"].ToString().Contains(tree[m].id + ".")) |
| | | { |
| | | TreeModel tbjson = new TreeModel(); |
| | | tbjson.id = dt.Rows[i]["hnumber"].ToString(); |
| | | tbjson.title = dt.Rows[i]["hname"].ToString(); |
| | | tree[m].children.Add(tbjson); |
| | | } |
| | | } |
| | | var strLens = tree[m].id.Split('.'); |
| | | for (int i = 0; i < tree[m].children.Count; i++) |
| | | { |
| | | digui(dt, tree[m].children, strLens.Length + 2);//忬¡ç¨åéå»å¾ªç¯ï¼æ¿åºåéçåé |
| | | } |
| | | } |
| | | |
| | | } |
| | | #endregion |
| | | |
| | | #region ç»ç»æ¶æè®¾ç½® å表 |
| | | [Route("Gy_DutyBill/Gy_DutyBillList")] |
| | | [HttpGet] |
| | | public object Gy_DutyBillList(string sWhere) |
| | | { |
| | | try |
| | | { |
| | | string sql1 = string.Format(@"select * from h_v_Gy_DutyList where 1=1 "); |
| | | |
| | | ds = oCN.RunProcReturn(sql1+ sWhere+ " order by ç»ç»æ¶æä»£ç ", "h_v_Gy_DutyList"); |
| | | |
| | | 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; |
| | | } |
| | | } |
| | | #endregion |
| | | |
| | | #region ç»ç»æ¶æè®¾ç½® ä¿å |
| | | [Route("Gy_DutyBill/Gy_DutyBillEdit")] |
| | | [HttpPost] |
| | | public object Xt_CheckFlowBillEdit([FromBody] JObject msg) |
| | | { |
| | | var _value = msg["msg"].ToString(); |
| | | string msg3 = _value.ToString(); |
| | | string[] sArray = msg3.Split(new string[] { ";" }, StringSplitOptions.RemoveEmptyEntries); |
| | | string msg1 = sArray[0].ToString(); |
| | | string msg2 = sArray[1].ToString(); |
| | | string msg4 = sArray[2].ToString(); |
| | | SQLHelper.ClsCN oCN = new SQLHelper.ClsCN(); |
| | | |
| | | try |
| | | { |
| | | Gy_Duty Duty = JsonConvert.DeserializeObject<Gy_Duty>(msg1); |
| | | |
| | | |
| | | //è·åä¸çº§ç代ç |
| | | var topHNum = DBUtility.ClsPub.GetParentCode(Duty.HNumber); |
| | | |
| | | if (topHNum == "") |
| | | { |
| | | Duty.HParentID = 0; |
| | | } |
| | | else |
| | | { |
| | | ds = oCN.RunProcReturn("select * from Gy_Duty where HStopflag=0 and HNumber='" + topHNum + "' or HNumber='" + Duty.HNumber + "' ", "Gy_Duty"); |
| | | if (ds.Tables[0].Rows.Count == 0) |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "ä¸çº§ä»£ç ä¸åå¨æè¢«ç¦ç¨ï¼"; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | if (msg4 == "1") { |
| | | if (ds.Tables[0].Rows.Count == 2) |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "代ç éå¤ï¼"; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | } |
| | | |
| | | Duty.HParentID = int.Parse(ds.Tables[0].Rows[0]["HItemID"].ToString()); |
| | | } |
| | | |
| | | if (Duty.HItemID != 0) |
| | | { |
| | | ds = oCN.RunProcReturn("select * from Gy_Duty where HItemID='" + Duty.HItemID + "' ", "Gy_Duty"); |
| | | var newHNum = Duty.HNumber.Split('.'); |
| | | var oldHNum = ds.Tables[0].Rows[0]["HNumber"].ToString().Split('.'); |
| | | |
| | | if (newHNum.Length > oldHNum.Length && Duty.HItemID == Duty.HParentID) |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "æ°ä»£ç ä¸è½æ¯èªå·±çä¸çº§çå项ç®ï¼"; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | |
| | | ds = oCN.RunProcReturn("select * from Gy_Duty where HParentID='" + Duty.HItemID + "' ", "Gy_Duty"); |
| | | |
| | | if (ds.Tables[0].Rows.Count>0) |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "该项ç®ä¸é¢æå项ç®,ä¸è½ä¿®æ¹ï¼"; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | } |
| | | |
| | | Duty.HEndFlag = 1; |
| | | Duty.HShortNumber = DBUtility.ClsPub.GetShortNumber(Duty.HNumber); |
| | | Duty.HLevel = DBUtility.ClsPub.GetLevel(Duty.HNumber); |
| | | |
| | | if (Duty.HShortNumber == "") |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "ç代ç 为空ï¼"; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | |
| | | oCN.BeginTran(); |
| | | |
| | | if (msg4 == "1") |
| | | { |
| | | //ä¿å |
| | | //ä¿å宿¯åå¤ç |
| | | oCN.RunProc("Insert into Gy_Duty " + |
| | | " (HNumber,HName,HHelpCode,HShortNumber,HParentID,HUserGroupID" + |
| | | ",HLevel,HEndFlag,HStopflag,HRemark) " + |
| | | " Values('" + Duty.HNumber + "','" + Duty.HName + "','" + Duty.HHelpCode + "','" + Duty.HShortNumber + "'," + Duty.HParentID.ToString() + "," + Duty.HUserGroupID.ToString() + |
| | | "," + Duty.HLevel.ToString() + "," + Duty.HEndFlag + "," + Convert.ToString(Duty.HStopflag ? 1 : 0) + ",'" + Duty.HRemark + "')", ref DBUtility.ClsPub.sExeReturnInfo); |
| | | } |
| | | else |
| | | { |
| | | oCN.RunProc("Update Gy_Duty set " + |
| | | " HNumber='" + Duty.HNumber + "'" + |
| | | ",HName='" + Duty.HName + "'" + |
| | | ",HShortNumber='" + Duty.HShortNumber + "'" + |
| | | ",HHelpCode='" + Duty.HHelpCode + "'" + |
| | | ",HLevel=" + Duty.HLevel.ToString() + |
| | | ",HParentID=" + Duty.HParentID.ToString() + |
| | | ",HUserGroupID=" + Duty.HUserGroupID.ToString() + |
| | | ",HEndflag=" + Duty.HEndFlag + |
| | | ",HStopflag=" + Convert.ToString(Duty.HStopflag ? 1 : 0) + |
| | | ",HRemark= '" + Duty.HRemark + "' Where HItemID=" + Duty.HItemID, ref DBUtility.ClsPub.sExeReturnInfo); |
| | | } |
| | | |
| | | //ä¿®æ¹ä¸çº§ä¸ºéæ«çº§ä»£ç |
| | | oCN.RunProc("Update Gy_Duty set HEndflag=0 where HItemID=" + Duty.HParentID, ref DBUtility.ClsPub.sExeReturnInfo); |
| | | oCN.Commit(); |
| | | |
| | | |
| | | objJsonResult.code = "1"; |
| | | objJsonResult.count = 1; |
| | | objJsonResult.Message = "ä¿åæåï¼"; |
| | | objJsonResult.data = 1; |
| | | return objJsonResult; |
| | | } |
| | | catch (Exception e) |
| | | { |
| | | oCN.RollBack(); |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "ä¿å失败ï¼" + e.ToString(); |
| | | objJsonResult.data = 1; |
| | | return objJsonResult; |
| | | } |
| | | } |
| | | |
| | | #endregion |
| | | |
| | | #region ç»ç»æ¶æè®¾ç½® å é¤ |
| | | [Route("Gy_DutyBill/Gy_DutyBillDel")] |
| | | [HttpGet] |
| | | public object Gy_DutyBillDel(string HItemID, string user) |
| | | { |
| | | 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; |
| | | } |
| | | |
| | | ds = oCN.RunProcReturn("select * from Gy_Duty where HParentID='" + HItemID + "' ", "Gy_Duty"); |
| | | |
| | | if (ds.Tables[0].Rows.Count > 0) |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "该项ç®ä¸é¢æå项ç®,ä¸è½å é¤ï¼,请å
å é¤å项ç®!"; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | |
| | | ds = oCN.RunProcReturn("select * from Gy_Duty where HItemID='" + HItemID + "' ", "Gy_Duty"); |
| | | |
| | | oCN.BeginTran();//å¼å§äºå¡ |
| | | |
| | | //å 餿°æ® |
| | | oCN.RunProc("Delete from Gy_Duty where HItemID='" + HItemID + "'"); |
| | | //ä¿®æ¹ä¸çº§ä¸ºæ«çº§ |
| | | oCN.RunProc("Update Gy_Duty set HEndflag=1 where HItemID=" + ds.Tables[0].Rows[0]["HParentID"].ToString()); |
| | | |
| | | 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 = "å é¤å¤±è´¥ï¼" + e.ToString(); |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | } |
| | | #endregion |
| | | |
| | | #region ç»ç»æ¶æè®¾ç½® æ£æµ |
| | | [Route("Gy_DutyBill/Gy_DutyBillTest")] |
| | | [HttpGet] |
| | | public object Gy_DutyBillTest(string HItemID, string user) |
| | | { |
| | | 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();//å¼å§äºå¡ |
| | | |
| | | //æ£æµæ°æ® |
| | | oCN.RunProc("exec h_p_Gy_Duty " + HItemID ); |
| | | |
| | | 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 = "失败ï¼" + e.ToString(); |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | } |
| | | #endregion |
| | | } |
| | | } |
| | |
| | | using Newtonsoft.Json.Linq; |
| | | using NPOI.HSSF.UserModel; |
| | | using NPOI.SS.UserModel; |
| | | using Newtonsoft.Json; |
| | | using Newtonsoft.Json.Linq; |
| | | using Pub_Class; |
| | | using System; |
| | | using System.Collections; |
| | | using System.Collections.Generic; |
| | | using System.Data; |
| | | using System.IO; |
| | | using System.Net; |
| | | using System.Net.Http; |
| | | using System.Net.Http.Headers; |
| | | using System.Runtime.InteropServices; |
| | | using System.Web; |
| | | using System.Data.SqlClient; |
| | | using System.Web.Http; |
| | | using System.Windows.Forms; |
| | | using WebAPI.Models; |
| | | using WebAPI.Service; |
| | | |
| | | namespace WebAPI.Controllers.åºç¡èµæ.åºç¡èµæ |
| | | { |
| | | public class Gy_SOPBillController : ApiController |
| | |
| | | private json objJsonResult = new json(); |
| | | SQLHelper.ClsCN oCN = new SQLHelper.ClsCN(); |
| | | DataSet ds; |
| | | public DAL.ClsGy_SOPBill BillNew = new DAL.ClsGy_SOPBill(); |
| | | public DAL.ClsGy_SOPBill BillOld = new DAL.ClsGy_SOPBill(); |
| | | public bool BillChange; // |
| | | public DataGridView grdMain = new System.Windows.Forms.DataGridView(); |
| | | ClsGridViewSum oSumGrid = new ClsGridViewSum(); |
| | | |
| | | //å®ä¹ |
| | | public const Int16 HTagCol = 0; |
| | | public const Int16 HSnoCol = 1; |
| | | public const Int16 HProcNoCol = 2; |
| | | public const Int16 HProcIDCol = 3; |
| | | public const Int16 HProcNumberCol = 4; |
| | | public const Int16 HProcNameCol = 5; |
| | | public const Int16 HWorkStationIDCol = 6; |
| | | public const Int16 HWorkStationNumberCol = 7; |
| | | public const Int16 HWorkStationNameCol = 8; |
| | | public const Int16 HCenterIDCol = 9; |
| | | public const Int16 HCenterNumberCol = 10; |
| | | public const Int16 HCenterNameCol = 11; |
| | | public const Int16 HRemarkCol = 12; |
| | | public const Int16 HEntryIDCol = 13; |
| | | |
| | | DAL.ClsIF_Material_View oMater = new DAL.ClsIF_Material_View(); |
| | | DAL.ClsIF_Unit_View oUnit = new DAL.ClsIF_Unit_View(); |
| | | DAL.ClsIF_Process_View oProc = new DAL.ClsIF_Process_View(); |
| | | DAL.ClsGy_WorkStation_View oStation = new DAL.ClsGy_WorkStation_View(); |
| | | DAL.ClsGy_WorkCenter_View oCenter = new DAL.ClsGy_WorkCenter_View(); |
| | | |
| | | #region 读åç±» |
| | | //æ¾ç¤ºåæ® |
| | | public void Sub_ShowBill() |
| | | { |
| | | DAL.ClsIF_Material_View oMater = new DAL.ClsIF_Material_View(); |
| | | DAL.ClsIF_Unit_View oUnit = new DAL.ClsIF_Unit_View(); |
| | | DAL.ClsIF_Process_View oProc = new DAL.ClsIF_Process_View(); |
| | | DAL.ClsGy_WorkStation_View oStation = new DAL.ClsGy_WorkStation_View(); |
| | | DAL.ClsGy_WorkCenter_View oCenter = new DAL.ClsGy_WorkCenter_View(); |
| | | //ClsGy_SourceHlp oSource = new ClsGy_SourceHlp(); |
| | | //夿æ¯å¦åå¨åæ® |
| | | if (BillOld.ShowBill(BillOld.omodel.HInterID, ref ClsPub.sExeReturnInfo) == false) |
| | | { |
| | | MessageBox.Show(ClsPub.sExeReturnInfo, "æç¤º"); |
| | | return; |
| | | } |
| | | //gridç¦æ¢å·æ° |
| | | |
| | | |
| | | //å è½½è¡¨ä½ |
| | | int i = 0; |
| | | foreach (Model.ClsGy_SOPBillSub oSub in BillOld.DetailColl) |
| | | { |
| | | if (i >= grdMain.RowCount - 1) |
| | | grdMain.Rows.Add(); |
| | | grdMain.Rows[i].Cells[HTagCol].Value = "*"; |
| | | |
| | | grdMain.Rows[i].Cells[HProcIDCol].Value = oSub.HProcID.ToString(); |
| | | if (oProc.GetInfoByID(oSub.HProcID)) |
| | | { |
| | | grdMain.Rows[i].Cells[HProcNumberCol].Value = oProc.omodel.HNumber; |
| | | grdMain.Rows[i].Cells[HProcNameCol].Value = oProc.omodel.HName; |
| | | } |
| | | else |
| | | { |
| | | grdMain.Rows[i].Cells[HProcNumberCol].Value = ""; |
| | | grdMain.Rows[i].Cells[HProcNameCol].Value = ""; |
| | | } |
| | | // |
| | | grdMain.Rows[i].Cells[HCenterIDCol].Value = oSub.HCenterID.ToString(); |
| | | if (oCenter.GetInfoByID(oSub.HCenterID)) |
| | | { |
| | | grdMain.Rows[i].Cells[HCenterNumberCol].Value = oCenter.omodel.HNumber; |
| | | grdMain.Rows[i].Cells[HCenterNameCol].Value = oCenter.omodel.HName; |
| | | } |
| | | else |
| | | { |
| | | grdMain.Rows[i].Cells[HCenterNameCol].Value = ""; |
| | | grdMain.Rows[i].Cells[HCenterNumberCol].Value = ""; |
| | | } |
| | | // |
| | | grdMain.Rows[i].Cells[HWorkStationIDCol].Value = oSub.HWorkStationID.ToString(); |
| | | if (oStation.GetInfoByID(oSub.HWorkStationID)) |
| | | { |
| | | grdMain.Rows[i].Cells[HWorkStationNumberCol].Value = oStation.omodel.HNumber; |
| | | grdMain.Rows[i].Cells[HWorkStationNameCol].Value = oStation.omodel.HName; |
| | | } |
| | | else |
| | | { |
| | | grdMain.Rows[i].Cells[HWorkStationNumberCol].Value = ""; |
| | | grdMain.Rows[i].Cells[HWorkStationNameCol].Value = ""; |
| | | } |
| | | // |
| | | grdMain.Rows[i].Cells[HProcNoCol].Value = oSub.HProcNo.ToString(); |
| | | |
| | | grdMain.Rows[i].Cells[HRemarkCol].Value = oSub.HRemark; |
| | | grdMain.Rows[i].Cells[HEntryIDCol].Value = oSub.HEntryID; |
| | | i = i + 1; |
| | | } |
| | | //GRIDå
è®¸å·æ° |
| | | DBUtility.Xt_BaseBillFun.SetSumGrid(oSumGrid); |
| | | // |
| | | //Sub_OperStatus(); |
| | | } |
| | | #endregion |
| | | |
| | | |
| | | #region ä¿ååæ® |
| | | [Route("Gy_SOPBill/ModifyByID")] |
| | | [HttpPost] |
| | | public object Sub_SaveBill([FromBody] JObject oMain) |
| | | /// <summary> |
| | | /// è¿åçäº§èµæºçäº§ç¶æå·¥åå表 |
| | | ///åæ°ï¼string sqlã |
| | | ///è¿åå¼ï¼objectã |
| | | /// </summary> |
| | | [Route("Sc_ICMOBillStatus_Tmp/list")] |
| | | [HttpGet] |
| | | public object list(string sWhere, string user) |
| | | { |
| | | 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<SOPBill> list = Newtonsoft.Json.JsonConvert.DeserializeObject<List<SOPBill>>(msg2); |
| | | |
| | | string HBillNo = list[0].HBillNo; |
| | | DateTime HDate = list[0].HDate; |
| | | string HName = list[0].HName; |
| | | int HMaterID = list[0].HMaterID; |
| | | string HMaterNumber = list[0].HMaterNumber; |
| | | string HMaterName = list[0].HMaterName; |
| | | string HMaterModel = list[0].HMaterModel; |
| | | int HUnitID = list[0].HUnitID; |
| | | string HUnitNumber = list[0].HUnitNumber; |
| | | string HUnitName = list[0].HUnitName; |
| | | string HRemark = list[0].HRemark; |
| | | bool HStandard = list[0].HStandard; |
| | | bool HUse = list[0].HUse; |
| | | |
| | | //夿æé |
| | | //if (!ClsPub.Security_Log("Gy_Repair_Edit", 1, false, msg3)) |
| | | //ç¼è¾æé |
| | | //if (!DBUtility.ClsPub.Security_Log_second("Gy_Material", 1, false, user)) |
| | | //{ |
| | | // objJsonResult.code = "0"; |
| | | // objJsonResult.count = 0; |
| | | // objJsonResult.Message = "æ²¡ææ¾å°è¯¥åè½æ¨¡åï¼"; |
| | | // objJsonResult.Message = "æ æ¥çæéï¼"; |
| | | // objJsonResult.data = null; |
| | | // return objJsonResult; |
| | | //} |
| | | string sql1 = string.Format(@"select * from h_v_Sc_WorkOrderList where HMainID='" + sWhere + "'"); |
| | | |
| | | ds = oCN.RunProcReturn(sql1, "h_v_Sc_WorkOrderList"); |
| | | |
| | | |
| | | //è¥MAINDIéå¤åéæ°è·å |
| | | oCN.BeginTran(); |
| | | //主表 |
| | | oCN.RunProc("Insert Into Gy_SOPBillMain " + |
| | | "(HBillType,HInterID,HBillNo,HDate" + |
| | | ",HYear,HPeriod,HRemark,HMaker,Hmakedate,HMaterID,HName,HMaterTypeID" + |
| | | ",HUnitID,HMaterNumber,HUnitNumber,HStandard" + |
| | | ") " + |
| | | " values('" + 3305 + "'," + HMaterID + ",'" + HMaterID + "','" + "2022-11-04" + "'" + |
| | | "," + 2022 + "," + 11 + ",'" + HRemark + "','" + "Test" + "'," + "2022-11-04" + "," + HMaterID.ToString() + ",'" + HName + "'," + 656 + |
| | | "," + HUnitID.ToString() + ",'" + HMaterNumber + "','" + HUnitNumber + "','" + HStandard.ToString() + |
| | | "') "); |
| | | //" values(" + 3305 + "','" + 12333 + "','" + "test" + "','" + HDate + "','" + |
| | | //2022 + "','" + 11 + "','" + HRemark + "','" + "Test" + "','" + "2022-11-04" + "','" + HMaterID.ToString() + "','" + HName + "','" + "656" + |
| | | //"','" + HUnitID.ToString() + "','" + HMaterNumber + "','" + HUnitNumber + "','" + HStandard.ToString() + |
| | | //") "); |
| | | //ä¿®æ¹ä¸çº§ä¸ºéæ«çº§ä»£ç |
| | | //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.Message = "Sucessï¼"; |
| | | objJsonResult.data = ds.Tables[0]; |
| | | return objJsonResult; |
| | | } |
| | | catch (Exception e) |
| | | { |
| | | oCN.RollBack(); |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "Exceptionï¼" + e.Message; |
| | | objJsonResult.Message = "Exceptionï¼" + e.ToString(); |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | } |
| | | #endregion |
| | | [Route("Gy_SOPBill/Use")] |
| | | |
| | | /// <summary> |
| | | /// è¿åæä»¶æ¸
åå表 |
| | | ///åæ°ï¼string sqlã |
| | | ///è¿åå¼ï¼objectã |
| | | /// </summary> |
| | | [Route("Sc_ICMOBillStatus_Tmp/Filelist")] |
| | | [HttpGet] |
| | | public object sy_Click() |
| | | public object Filelist() |
| | | { |
| | | if (BillOld.omodel.HInterID == 0) |
| | | { |
| | | objJsonResult.Message = "使ç¨å¤±è´¥!å½åä½ä¸æå¯¼ä¹¦ä¸æ¯æµè§ç¶æ!"; |
| | | return objJsonResult; |
| | | } |
| | | if (BillOld.Sub_RoutingCheckAndUsed(BillOld.omodel.HInterID)) |
| | | { |
| | | objJsonResult.count = 1; |
| | | objJsonResult.Message = "ä½¿ç¨æå!"; |
| | | return objJsonResult; |
| | | } |
| | | else |
| | | { |
| | | objJsonResult.Message = "使ç¨å¤±è´¥!"; |
| | | return objJsonResult; |
| | | } |
| | | } |
| | | |
| | | [Route("Gy_SOPBill/Cancel")] |
| | | [HttpGet] |
| | | public object fsy_Click() |
| | | { |
| | | if (BillOld.omodel.HInterID == 0) |
| | | { |
| | | objJsonResult.Message = "å使ç¨å¤±è´¥!å½åä½ä¸æå¯¼ä¹¦ä¸æ¯æµè§ç¶æ!"; |
| | | return objJsonResult; |
| | | } |
| | | if (BillOld.Sub_RoutingUsed_Back(BillOld.omodel.HInterID)) |
| | | { |
| | | objJsonResult.count = 1; |
| | | objJsonResult.Message = "åä½¿ç¨æå!"; |
| | | return objJsonResult; |
| | | } |
| | | else |
| | | { |
| | | objJsonResult.Message = "å使ç¨å¤±è´¥!"; |
| | | return objJsonResult; |
| | | } |
| | | } |
| | | |
| | | [Route("Gy_SOPBill/UploadFile1")] |
| | | [HttpPost] |
| | | public object UploadFile1() |
| | | { |
| | | |
| | | string HBillNo = HttpContext.Current.Request.Params["HBillNo"]; //åæ®å· |
| | | string HRemark = HttpContext.Current.Request.Params["HRemark"]; //夿³¨ |
| | | string HUserName = HttpContext.Current.Request.Params["HUserName"]; //å建人 |
| | | HttpPostedFile files = HttpContext.Current.Request.Files["file"]; |
| | | string path = HttpContext.Current.Server.MapPath("~/../Files/" + HBillNo); |
| | | //string path = @"D:\\Files\\"+ HBillNo; |
| | | dynamic dyResult = UpLoadFile(files, path, HBillNo, HRemark, HUserName); |
| | | if (dyResult != null && dyResult.result == 1) |
| | | { |
| | | objJsonResult.code = "1"; |
| | | objJsonResult.count = 1; |
| | | objJsonResult.Message = "ä¸ä¼ æåï¼"; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | else |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = dyResult.returnval; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | |
| | | } |
| | | |
| | | public dynamic UpLoadFile(HttpPostedFile files, string path, string HBillNo, string HRemark, string HUserName) |
| | | { |
| | | dynamic Result_Ob = new { result = 1, returnval = "ä¸ä¼ æåï¼" }; |
| | | string filePath = Path.GetFullPath(files.FileName);//æä»¶ä¸ä¼ è·¯å¾ |
| | | string fileExtension = Path.GetExtension(files.FileName);// æä»¶æ©å±å |
| | | string filename = files.FileName;//æä»¶å |
| | | string fileSavePath = path;// ä¸ä¼ ä¿åè·¯å¾ |
| | | int filesize = files.ContentLength;//è·åä¸ä¼ æä»¶ç大å°åä½ä¸ºåèbyte |
| | | int Maxsize = 40000 * 1024;//å®ä¹ä¸ä¼ æä»¶çæå¤§ç©ºé´å¤§å°ä¸º40M |
| | | |
| | | try |
| | | { |
| | | if (files == null || files.ContentLength <= 0) |
| | | { |
| | | Result_Ob = new { result = 0, returnval = "æä»¶ä¸è½ä¸ºç©º!" }; |
| | | return Result_Ob; |
| | | } |
| | | if (filesize >= Maxsize) |
| | | { |
| | | Result_Ob = new { result = 0, returnval = "ä¸ä¼ æä»¶è¶
è¿40Mï¼ä¸è½ä¸ä¼ ï¼" }; |
| | | return Result_Ob; |
| | | } |
| | | //ç¼è¾æé |
| | | //if (!DBUtility.ClsPub.Security_Log_second("Gy_Material", 1, false, user)) |
| | | //{ |
| | | // objJsonResult.code = "0"; |
| | | // objJsonResult.count = 0; |
| | | // objJsonResult.Message = "æ æ¥çæéï¼"; |
| | | // objJsonResult.data = null; |
| | | // return objJsonResult; |
| | | //} |
| | | string sql1 = string.Format(@"select HSno åºå·,HFileName æä»¶åç§° from Gy_SOPBillSub2"); |
| | | |
| | | string fileurl = Path.Combine(fileSavePath, filename); |
| | | if (Directory.Exists(fileurl) == true) //妿åå¨éåæä»¶å°±æç¤º |
| | | { |
| | | Result_Ob = new { result = 0, returnval = "åå¨ååæä»¶ï¼" }; |
| | | return Result_Ob; |
| | | } |
| | | //å 餿°æ®è¡¨æ°æ® |
| | | ds = oCN.RunProcReturn("delete from Gy_SOPBillSub2 where HFileName='" + filename + "'", "Gy_SOPBillSub2"); |
| | | if (Directory.Exists(path)) |
| | | { |
| | | File.Delete(fileurl); //å 餿宿件 |
| | | files.SaveAs(fileurl); |
| | | string StrPath = "/files/" + HBillNo + "/" + filename; |
| | | if (File.Exists(fileurl)) |
| | | { |
| | | //è¿éå¯ä»¥æ§è¡ä¸äºå
¶å®çæä½ï¼æ¯å¦æ´æ°æ°æ®åº |
| | | //åå
¥æ°æ®è¡¨ |
| | | oCN.RunProc("Insert into Gy_SOPBillSub2 (HFileName,HPath,HFileType" + |
| | | ",HUpMan,HUpTime,HInterID,HEntryID,HSno,HFileID,HFileSize" + |
| | | ") values('" |
| | | + filename.ToString() + "','" + filePath.ToString() + "','" + fileExtension.ToString() + "'" + |
| | | ",'" + HUserName + "',getdate()" + ",'" + 0 + "','" + 0 + "','" + 0 + "','" + 0 + "','" + 0 + |
| | | "') "); |
| | | } |
| | | else |
| | | { |
| | | Result_Ob = new { result = 0, returnval = "ä¸ä¼ å¤±è´¥ï¼æ¤æä»¶ä¸ºæ¶ææä»¶" }; |
| | | } |
| | | } |
| | | else |
| | | { |
| | | Directory.CreateDirectory(fileSavePath); //æ·»å æä»¶å¤¹ |
| | | files.SaveAs(fileurl); |
| | | string StrPath = "/files/" + HBillNo + "/" + filename; |
| | | if (File.Exists(fileurl)) |
| | | { |
| | | //è¿éå¯ä»¥æ§è¡ä¸äºå
¶å®çæä½ï¼æ¯å¦æ´æ°æ°æ®åº |
| | | //åå
¥æ°æ®è¡¨ |
| | | oCN.RunProc("Insert into Gy_SOPBillSub2 (HFileName,HPath,HFileType" + |
| | | ",HUpMan,HUpTime,HInterID,HEntryID,HSno,HFileID,HFileSize" + |
| | | ") values('" |
| | | + filename.ToString() + "','" + filePath.ToString() + "','" + fileExtension.ToString() + "'" + |
| | | ",'" + HUserName + "',getdate()" + ",'" + 111 + "','" + 222 + "','" + 333 + "','" + 444 + "','" + 555 + |
| | | "') "); |
| | | } |
| | | else |
| | | { |
| | | Result_Ob = new { result = 0, returnval = "ä¸ä¼ å¤±è´¥ï¼æ¤æä»¶ä¸ºæ¶ææä»¶" }; |
| | | } |
| | | } |
| | | ds = oCN.RunProcReturn(sql1, "Gy_SOPBillSub2"); |
| | | |
| | | |
| | | objJsonResult.code = "1"; |
| | | objJsonResult.count = 1; |
| | | objJsonResult.Message = "Sucessï¼"; |
| | | objJsonResult.data = ds.Tables[0]; |
| | | return objJsonResult; |
| | | } |
| | | catch (Exception e) |
| | | { |
| | | Result_Ob = new { result = 0, returnval = e.Message }; |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "Exceptionï¼" + e.ToString(); |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | return Result_Ob; |
| | | } |
| | | |
| | | } |
New file |
| | |
| | | using Newtonsoft.Json.Linq; |
| | | using NPOI.HSSF.UserModel; |
| | | using NPOI.SS.UserModel; |
| | | using Pub_Class; |
| | | using System; |
| | | using System.Collections.Generic; |
| | | using System.Data; |
| | | using System.IO; |
| | | using System.Net; |
| | | using System.Net.Http; |
| | | using System.Net.Http.Headers; |
| | | using System.Runtime.InteropServices; |
| | | using System.Web; |
| | | using System.Web.Http; |
| | | using System.Windows.Forms; |
| | | using WebAPI.Models; |
| | | namespace WebAPI.Controllers.åºç¡èµæ.åºç¡èµæ |
| | | { |
| | | public class Gy_SOPBillEditController : ApiController |
| | | { |
| | | public DBUtility.ClsPub.Enum_BillStatus BillStatus; |
| | | |
| | | private json objJsonResult = new json(); |
| | | SQLHelper.ClsCN oCN = new SQLHelper.ClsCN(); |
| | | DataSet ds; |
| | | public DAL.ClsGy_SOPBill BillNew = new DAL.ClsGy_SOPBill(); |
| | | public DAL.ClsGy_SOPBill BillOld = new DAL.ClsGy_SOPBill(); |
| | | public bool BillChange; // |
| | | public DataGridView grdMain = new System.Windows.Forms.DataGridView(); |
| | | ClsGridViewSum oSumGrid = new ClsGridViewSum(); |
| | | |
| | | //å®ä¹ |
| | | public const Int16 HTagCol = 0; |
| | | public const Int16 HSnoCol = 1; |
| | | public const Int16 HProcNoCol = 2; |
| | | public const Int16 HProcIDCol = 3; |
| | | public const Int16 HProcNumberCol = 4; |
| | | public const Int16 HProcNameCol = 5; |
| | | public const Int16 HWorkStationIDCol = 6; |
| | | public const Int16 HWorkStationNumberCol = 7; |
| | | public const Int16 HWorkStationNameCol = 8; |
| | | public const Int16 HCenterIDCol = 9; |
| | | public const Int16 HCenterNumberCol = 10; |
| | | public const Int16 HCenterNameCol = 11; |
| | | public const Int16 HRemarkCol = 12; |
| | | public const Int16 HEntryIDCol = 13; |
| | | |
| | | DAL.ClsIF_Material_View oMater = new DAL.ClsIF_Material_View(); |
| | | DAL.ClsIF_Unit_View oUnit = new DAL.ClsIF_Unit_View(); |
| | | DAL.ClsIF_Process_View oProc = new DAL.ClsIF_Process_View(); |
| | | DAL.ClsGy_WorkStation_View oStation = new DAL.ClsGy_WorkStation_View(); |
| | | DAL.ClsGy_WorkCenter_View oCenter = new DAL.ClsGy_WorkCenter_View(); |
| | | |
| | | #region 读åç±» |
| | | //æ¾ç¤ºåæ® |
| | | public void Sub_ShowBill() |
| | | { |
| | | DAL.ClsIF_Material_View oMater = new DAL.ClsIF_Material_View(); |
| | | DAL.ClsIF_Unit_View oUnit = new DAL.ClsIF_Unit_View(); |
| | | DAL.ClsIF_Process_View oProc = new DAL.ClsIF_Process_View(); |
| | | DAL.ClsGy_WorkStation_View oStation = new DAL.ClsGy_WorkStation_View(); |
| | | DAL.ClsGy_WorkCenter_View oCenter = new DAL.ClsGy_WorkCenter_View(); |
| | | //ClsGy_SourceHlp oSource = new ClsGy_SourceHlp(); |
| | | //夿æ¯å¦åå¨åæ® |
| | | if (BillOld.ShowBill(BillOld.omodel.HInterID, ref ClsPub.sExeReturnInfo) == false) |
| | | { |
| | | MessageBox.Show(ClsPub.sExeReturnInfo, "æç¤º"); |
| | | return; |
| | | } |
| | | //gridç¦æ¢å·æ° |
| | | |
| | | |
| | | //å è½½è¡¨ä½ |
| | | int i = 0; |
| | | foreach (Model.ClsGy_SOPBillSub oSub in BillOld.DetailColl) |
| | | { |
| | | if (i >= grdMain.RowCount - 1) |
| | | grdMain.Rows.Add(); |
| | | grdMain.Rows[i].Cells[HTagCol].Value = "*"; |
| | | |
| | | grdMain.Rows[i].Cells[HProcIDCol].Value = oSub.HProcID.ToString(); |
| | | if (oProc.GetInfoByID(oSub.HProcID)) |
| | | { |
| | | grdMain.Rows[i].Cells[HProcNumberCol].Value = oProc.omodel.HNumber; |
| | | grdMain.Rows[i].Cells[HProcNameCol].Value = oProc.omodel.HName; |
| | | } |
| | | else |
| | | { |
| | | grdMain.Rows[i].Cells[HProcNumberCol].Value = ""; |
| | | grdMain.Rows[i].Cells[HProcNameCol].Value = ""; |
| | | } |
| | | // |
| | | grdMain.Rows[i].Cells[HCenterIDCol].Value = oSub.HCenterID.ToString(); |
| | | if (oCenter.GetInfoByID(oSub.HCenterID)) |
| | | { |
| | | grdMain.Rows[i].Cells[HCenterNumberCol].Value = oCenter.omodel.HNumber; |
| | | grdMain.Rows[i].Cells[HCenterNameCol].Value = oCenter.omodel.HName; |
| | | } |
| | | else |
| | | { |
| | | grdMain.Rows[i].Cells[HCenterNameCol].Value = ""; |
| | | grdMain.Rows[i].Cells[HCenterNumberCol].Value = ""; |
| | | } |
| | | // |
| | | grdMain.Rows[i].Cells[HWorkStationIDCol].Value = oSub.HWorkStationID.ToString(); |
| | | if (oStation.GetInfoByID(oSub.HWorkStationID)) |
| | | { |
| | | grdMain.Rows[i].Cells[HWorkStationNumberCol].Value = oStation.omodel.HNumber; |
| | | grdMain.Rows[i].Cells[HWorkStationNameCol].Value = oStation.omodel.HName; |
| | | } |
| | | else |
| | | { |
| | | grdMain.Rows[i].Cells[HWorkStationNumberCol].Value = ""; |
| | | grdMain.Rows[i].Cells[HWorkStationNameCol].Value = ""; |
| | | } |
| | | // |
| | | grdMain.Rows[i].Cells[HProcNoCol].Value = oSub.HProcNo.ToString(); |
| | | |
| | | grdMain.Rows[i].Cells[HRemarkCol].Value = oSub.HRemark; |
| | | grdMain.Rows[i].Cells[HEntryIDCol].Value = oSub.HEntryID; |
| | | i = i + 1; |
| | | } |
| | | //GRIDå
è®¸å·æ° |
| | | DBUtility.Xt_BaseBillFun.SetSumGrid(oSumGrid); |
| | | // |
| | | //Sub_OperStatus(); |
| | | } |
| | | #endregion |
| | | |
| | | |
| | | #region ä¿ååæ® |
| | | [Route("Gy_SOPBill/ModifyByID")] |
| | | [HttpPost] |
| | | public object Sub_SaveBill([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<SOPBill> list = Newtonsoft.Json.JsonConvert.DeserializeObject<List<SOPBill>>(msg2); |
| | | |
| | | string HBillNo = list[0].HBillNo; |
| | | DateTime HDate = list[0].HDate; |
| | | string HName = list[0].HName; |
| | | int HMaterID = list[0].HMaterID; |
| | | string HMaterNumber = list[0].HMaterNumber; |
| | | string HMaterName = list[0].HMaterName; |
| | | string HMaterModel = list[0].HMaterModel; |
| | | int HUnitID = list[0].HUnitID; |
| | | string HUnitNumber = list[0].HUnitNumber; |
| | | string HUnitName = list[0].HUnitName; |
| | | string HRemark = list[0].HRemark; |
| | | bool HStandard = list[0].HStandard; |
| | | bool HUse = list[0].HUse; |
| | | |
| | | //夿æé |
| | | //if (!ClsPub.Security_Log("Gy_Repair_Edit", 1, false, msg3)) |
| | | //{ |
| | | // objJsonResult.code = "0"; |
| | | // objJsonResult.count = 0; |
| | | // objJsonResult.Message = "æ²¡ææ¾å°è¯¥åè½æ¨¡åï¼"; |
| | | // objJsonResult.data = null; |
| | | // return objJsonResult; |
| | | //} |
| | | |
| | | //è¥MAINDIéå¤åéæ°è·å |
| | | oCN.BeginTran(); |
| | | //主表 |
| | | oCN.RunProc("Insert Into Gy_SOPBillMain " + |
| | | "(HBillType,HInterID,HBillNo,HDate" + |
| | | ",HYear,HPeriod,HRemark,HMaker,Hmakedate,HMaterID,HName,HMaterTypeID" + |
| | | ",HUnitID,HMaterNumber,HUnitNumber,HStandard" + |
| | | ") " + |
| | | " values('" + 3305 + "'," + HMaterID + ",'" + HMaterID + "','" + "2022-11-04" + "'" + |
| | | "," + 2022 + "," + 11 + ",'" + HRemark + "','" + "Test" + "'," + "2022-11-04" + "," + HMaterID.ToString() + ",'" + HName + "'," + 656 + |
| | | "," + HUnitID.ToString() + ",'" + HMaterNumber + "','" + HUnitNumber + "','" + HStandard.ToString() + |
| | | "') "); |
| | | //" values(" + 3305 + "','" + 12333 + "','" + "test" + "','" + HDate + "','" + |
| | | //2022 + "','" + 11 + "','" + HRemark + "','" + "Test" + "','" + "2022-11-04" + "','" + HMaterID.ToString() + "','" + HName + "','" + "656" + |
| | | //"','" + HUnitID.ToString() + "','" + HMaterNumber + "','" + HUnitNumber + "','" + HStandard.ToString() + |
| | | //") "); |
| | | //ä¿®æ¹ä¸çº§ä¸ºéæ«çº§ä»£ç |
| | | //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 = "æ°å¢æåï¼"; |
| | | return objJsonResult; |
| | | } |
| | | catch (Exception e) |
| | | { |
| | | oCN.RollBack(); |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "Exceptionï¼" + e.Message; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | } |
| | | #endregion |
| | | [Route("Gy_SOPBill/Use")] |
| | | [HttpGet] |
| | | public object sy_Click() |
| | | { |
| | | if (BillOld.omodel.HInterID == 0) |
| | | { |
| | | objJsonResult.Message = "使ç¨å¤±è´¥!å½åä½ä¸æå¯¼ä¹¦ä¸æ¯æµè§ç¶æ!"; |
| | | return objJsonResult; |
| | | } |
| | | if (BillOld.Sub_RoutingCheckAndUsed(BillOld.omodel.HInterID)) |
| | | { |
| | | objJsonResult.count = 1; |
| | | objJsonResult.Message = "ä½¿ç¨æå!"; |
| | | return objJsonResult; |
| | | } |
| | | else |
| | | { |
| | | objJsonResult.Message = "使ç¨å¤±è´¥!"; |
| | | return objJsonResult; |
| | | } |
| | | } |
| | | |
| | | [Route("Gy_SOPBill/Cancel")] |
| | | [HttpGet] |
| | | public object fsy_Click() |
| | | { |
| | | if (BillOld.omodel.HInterID == 0) |
| | | { |
| | | objJsonResult.Message = "å使ç¨å¤±è´¥!å½åä½ä¸æå¯¼ä¹¦ä¸æ¯æµè§ç¶æ!"; |
| | | return objJsonResult; |
| | | } |
| | | if (BillOld.Sub_RoutingUsed_Back(BillOld.omodel.HInterID)) |
| | | { |
| | | objJsonResult.count = 1; |
| | | objJsonResult.Message = "åä½¿ç¨æå!"; |
| | | return objJsonResult; |
| | | } |
| | | else |
| | | { |
| | | objJsonResult.Message = "å使ç¨å¤±è´¥!"; |
| | | return objJsonResult; |
| | | } |
| | | } |
| | | |
| | | [Route("Gy_SOPBill/UploadFile1")] |
| | | [HttpPost] |
| | | public object UploadFile1() |
| | | { |
| | | |
| | | string HBillNo = HttpContext.Current.Request.Params["HBillNo"]; //åæ®å· |
| | | string HRemark = HttpContext.Current.Request.Params["HRemark"]; //夿³¨ |
| | | string HUserName = HttpContext.Current.Request.Params["HUserName"]; //å建人 |
| | | HttpPostedFile files = HttpContext.Current.Request.Files["file"]; |
| | | string path = HttpContext.Current.Server.MapPath("~/../Files/" + HBillNo); |
| | | //string path = @"D:\\Files\\"+ HBillNo; |
| | | dynamic dyResult = UpLoadFile(files, path, HBillNo, HRemark, HUserName); |
| | | if (dyResult != null && dyResult.result == 1) |
| | | { |
| | | objJsonResult.code = "1"; |
| | | objJsonResult.count = 1; |
| | | objJsonResult.Message = "ä¸ä¼ æåï¼"; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | else |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = dyResult.returnval; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | |
| | | } |
| | | |
| | | public dynamic UpLoadFile(HttpPostedFile files, string path, string HBillNo, string HRemark, string HUserName) |
| | | { |
| | | dynamic Result_Ob = new { result = 1, returnval = "ä¸ä¼ æåï¼" }; |
| | | string filePath = Path.GetFullPath(files.FileName);//æä»¶ä¸ä¼ è·¯å¾ |
| | | string fileExtension = Path.GetExtension(files.FileName);// æä»¶æ©å±å |
| | | string filename = files.FileName;//æä»¶å |
| | | string fileSavePath = path;// ä¸ä¼ ä¿åè·¯å¾ |
| | | int filesize = files.ContentLength;//è·åä¸ä¼ æä»¶ç大å°åä½ä¸ºåèbyte |
| | | int Maxsize = 40000 * 1024;//å®ä¹ä¸ä¼ æä»¶çæå¤§ç©ºé´å¤§å°ä¸º40M |
| | | |
| | | try |
| | | { |
| | | if (files == null || files.ContentLength <= 0) |
| | | { |
| | | Result_Ob = new { result = 0, returnval = "æä»¶ä¸è½ä¸ºç©º!" }; |
| | | return Result_Ob; |
| | | } |
| | | if (filesize >= Maxsize) |
| | | { |
| | | Result_Ob = new { result = 0, returnval = "ä¸ä¼ æä»¶è¶
è¿40Mï¼ä¸è½ä¸ä¼ ï¼" }; |
| | | return Result_Ob; |
| | | } |
| | | |
| | | string fileurl = Path.Combine(fileSavePath, filename); |
| | | if (Directory.Exists(fileurl) == true) //妿åå¨éåæä»¶å°±æç¤º |
| | | { |
| | | Result_Ob = new { result = 0, returnval = "åå¨ååæä»¶ï¼" }; |
| | | return Result_Ob; |
| | | } |
| | | //å 餿°æ®è¡¨æ°æ® |
| | | ds = oCN.RunProcReturn("delete from Gy_SOPBillSub2 where HFileName='" + filename + "'", "Gy_SOPBillSub2"); |
| | | if (Directory.Exists(path)) |
| | | { |
| | | File.Delete(fileurl); //å 餿宿件 |
| | | files.SaveAs(fileurl); |
| | | string StrPath = "/files/" + HBillNo + "/" + filename; |
| | | if (File.Exists(fileurl)) |
| | | { |
| | | //è¿éå¯ä»¥æ§è¡ä¸äºå
¶å®çæä½ï¼æ¯å¦æ´æ°æ°æ®åº |
| | | //åå
¥æ°æ®è¡¨ |
| | | oCN.RunProc("Insert into Gy_SOPBillSub2 (HFileName,HPath,HFileType" + |
| | | ",HUpMan,HUpTime,HInterID,HEntryID,HSno,HFileID,HFileSize" + |
| | | ") values('" |
| | | + filename.ToString() + "','" + filePath.ToString() + "','" + fileExtension.ToString() + "'" + |
| | | ",'" + HUserName + "',getdate()" + ",'" + 0 + "','" + 0 + "','" + 0 + "','" + 0 + "','" + 0 + |
| | | "') "); |
| | | } |
| | | else |
| | | { |
| | | Result_Ob = new { result = 0, returnval = "ä¸ä¼ å¤±è´¥ï¼æ¤æä»¶ä¸ºæ¶ææä»¶" }; |
| | | } |
| | | } |
| | | else |
| | | { |
| | | Directory.CreateDirectory(fileSavePath); //æ·»å æä»¶å¤¹ |
| | | files.SaveAs(fileurl); |
| | | string StrPath = "/files/" + HBillNo + "/" + filename; |
| | | if (File.Exists(fileurl)) |
| | | { |
| | | //è¿éå¯ä»¥æ§è¡ä¸äºå
¶å®çæä½ï¼æ¯å¦æ´æ°æ°æ®åº |
| | | //åå
¥æ°æ®è¡¨ |
| | | oCN.RunProc("Insert into Gy_SOPBillSub2 (HFileName,HPath,HFileType" + |
| | | ",HUpMan,HUpTime,HInterID,HEntryID,HSno,HFileID,HFileSize" + |
| | | ") values('" |
| | | + filename.ToString() + "','" + filePath.ToString() + "','" + fileExtension.ToString() + "'" + |
| | | ",'" + HUserName + "',getdate()" + ",'" + 111 + "','" + 222 + "','" + 333 + "','" + 444 + "','" + 555 + |
| | | "') "); |
| | | } |
| | | else |
| | | { |
| | | Result_Ob = new { result = 0, returnval = "ä¸ä¼ å¤±è´¥ï¼æ¤æä»¶ä¸ºæ¶ææä»¶" }; |
| | | } |
| | | } |
| | | |
| | | } |
| | | catch (Exception e) |
| | | { |
| | | Result_Ob = new { result = 0, returnval = e.Message }; |
| | | } |
| | | return Result_Ob; |
| | | } |
| | | |
| | | } |
| | | } |
New file |
| | |
| | | using Newtonsoft.Json; |
| | | using Newtonsoft.Json.Linq; |
| | | using System; |
| | | using System.Collections.Generic; |
| | | using System.Data; |
| | | using System.Linq; |
| | | using System.Net; |
| | | using System.Net.Http; |
| | | using System.Web.Http; |
| | | using WebAPI.Models; |
| | | |
| | | namespace WebAPI.Controllers.åºç¡èµæ.åºç¡èµæ |
| | | { |
| | | public class Xt_CheckFlowBillController : ApiController |
| | | { |
| | | private json objJsonResult = new json(); |
| | | public DataSet ds = new DataSet(); |
| | | public SQLHelper.ClsCN oCN = new SQLHelper.ClsCN(); |
| | | |
| | | #region å®¡æ ¸æµç¨åå表 |
| | | [Route("Xt_CheckFlowBill/Xt_CheckFlowBillList")] |
| | | [HttpGet] |
| | | public object Xt_CheckFlowBillList(string sWhere, string user) |
| | | { |
| | | try |
| | | { |
| | | List<object> columnNameList = new List<object>(); |
| | | //æ¥è¯¢æé |
| | | if (!DBUtility.ClsPub.Security_Log_second("Xt_CheckFlow_Query", 1, false, user)) |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "æ æ¥çæéï¼"; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | |
| | | string sql1 = string.Format(@"select * from h_v_Xt_CheckFlowList where 1=1 "); |
| | | |
| | | ds = oCN.RunProcReturn(sql1 + sWhere+ " order by æµç¨åç§°", "h_v_Xt_CheckFlowList"); |
| | | |
| | | //æ·»å åå |
| | | 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; |
| | | } |
| | | } |
| | | #endregion |
| | | |
| | | # region å®¡æ ¸æµç¨å ä¿å |
| | | [Route("Xt_CheckFlowBill/Xt_CheckFlowBillEdit")] |
| | | [HttpPost] |
| | | public object Xt_CheckFlowBillEdit([FromBody] JObject msg) |
| | | { |
| | | var _value = msg["msg"].ToString(); |
| | | string msg3 = _value.ToString(); |
| | | string[] sArray = msg3.Split(new string[] { ";" }, StringSplitOptions.RemoveEmptyEntries); |
| | | string msg1 = sArray[0].ToString(); |
| | | string msg2 = sArray[1].ToString(); |
| | | msg3 = sArray[2].ToString(); |
| | | string msg4 = sArray[3].ToString(); |
| | | SQLHelper.ClsCN oCN = new SQLHelper.ClsCN(); |
| | | |
| | | //ç¼è¾æé |
| | | if (!DBUtility.ClsPub.Security_Log_second("Xt_CheckFlow_Edit", 1, false, msg4)) |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "æ ä¿åæéï¼"; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | try |
| | | { |
| | | Models.Xt_CheckFlowMain main = JsonConvert.DeserializeObject<Xt_CheckFlowMain>(msg1); |
| | | List<Models.Xt_CheckFlowSub> lsmain = new List<Models.Xt_CheckFlowSub>(); |
| | | msg2 = msg2.Replace("\\", ""); |
| | | msg2 = msg2.Replace("\n", ""); //\n |
| | | lsmain =JsonConvert.DeserializeObject<List<Xt_CheckFlowSub>>(msg2); |
| | | foreach (Xt_CheckFlowSub oItem in lsmain) |
| | | { |
| | | if (oItem.HCheckItemID == 0) |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "ä¿å失败ï¼å®¡æ¹é¡¹ç®ä»£ç ä¸è½ä¸ºç©ºï¼"; |
| | | objJsonResult.data = 1; |
| | | return objJsonResult; |
| | | } |
| | | if (oItem.HFlowNo == "") |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "ä¿åå¤±è´¥ï¼æµç¨å·ä¸è½ä¸ºç©ºï¼"; |
| | | objJsonResult.data = 1; |
| | | return objJsonResult; |
| | | } |
| | | } |
| | | ds = oCN.RunProcReturn("select * from h_v_Xt_CheckFlowList where Hmainid= " + main.HInterID, "h_v_Xt_CheckFlowList"); |
| | | |
| | | //ä¿å |
| | | //ä¿å宿¯åå¤ç |
| | | oCN.BeginTran(); |
| | | if (msg3 == "1" && ds.Tables[0].Rows.Count == 0) |
| | | { |
| | | oCN.RunProc("Insert Into Xt_CheckFlowMain " + |
| | | "(HBillTypeID,HInterID,HDeptID" + |
| | | ",HRemark,HStandard,HName" + ") " + |
| | | " values('" + main.HBillTypeID.ToString() + "'," + main.HInterID.ToString() + "," + main.HDeptID.ToString() + |
| | | ",'" + main.HRemark + "'," + Convert.ToString(main.HStandard ? 1 : 0) + ",'" + main.HName.ToString() + "') "); |
| | | } |
| | | else |
| | | { |
| | | //æ´æ°ä¸»è¡¨ |
| | | oCN.RunProc("UpDate Xt_CheckFlowMain set " + |
| | | "HRemark='" + main.HRemark + "'" + |
| | | ",HName='" + main.HName + "'" + |
| | | ",HDeptID=" + main.HDeptID.ToString() + |
| | | ",HBillTypeID='" + main.HBillTypeID + "'" + |
| | | ",HStandard='" + Convert.ToString(main.HStandard ? 1 : 0) + "'" + |
| | | " where HInterID=" + main.HInterID.ToString()); |
| | | //å é¤å表 |
| | | oCN.RunProc("delete from Xt_CheckFlowSub where HInterID=" + main.HInterID.ToString()); |
| | | } |
| | | AddBillSub(lsmain, main.HInterID); |
| | | |
| | | oCN.Commit(); |
| | | |
| | | objJsonResult.code = "1"; |
| | | objJsonResult.count = 1; |
| | | objJsonResult.Message = "ä¿åæåï¼"; |
| | | objJsonResult.data = 1; |
| | | return objJsonResult; |
| | | } |
| | | catch (Exception e) |
| | | { |
| | | oCN.RollBack(); |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "ä¿å失败ï¼" + e.ToString(); |
| | | objJsonResult.data = 1; |
| | | return objJsonResult; |
| | | } |
| | | } |
| | | |
| | | public json AddBillSub(List<Xt_CheckFlowSub> DetailColl, long HInterID) |
| | | { |
| | | int i = 1; |
| | | foreach (Xt_CheckFlowSub oSub in DetailColl) |
| | | { |
| | | |
| | | oCN.RunProc("Insert into Xt_CheckFlowSub " + |
| | | " (HInterID,HEntryID,HCheckMan" + |
| | | ",HFlowNo,HJumpFlag,HMakerSelf,HCheckItemID" + |
| | | " )values(" |
| | | + HInterID + "," + i + ",'" + oSub.HCheckMan + "'" + |
| | | "," + oSub.HFlowNo + "," + Convert.ToString(oSub.HJumpFlag ? 1 : 0) + "," + Convert.ToString(oSub.HMakerSelf ? 1 : 0) + "," + oSub.HCheckItemID + ") "); |
| | | i++; |
| | | } |
| | | objJsonResult.code = "1"; |
| | | objJsonResult.count = 1; |
| | | objJsonResult.Message = null; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | |
| | | #endregion |
| | | |
| | | #region å®¡æ ¸æµç¨å å é¤ |
| | | [Route("Xt_CheckFlowBill/Xt_CheckFlowBillDelete")] |
| | | [HttpGet] |
| | | public object Xt_CheckFlowBillDelete(string HItemID, string user) |
| | | { |
| | | try |
| | | { |
| | | //å 餿é |
| | | if (!DBUtility.ClsPub.Security_Log("Xt_CheckFlow_Drop", 1, false, user)) |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "æ å 餿é"; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | |
| | | 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();//å¼å§äºå¡ |
| | | |
| | | //å é¤å表 |
| | | oCN.RunProc("Delete From Xt_CheckFlowSub where HInterID=" + HItemID); |
| | | |
| | | //å é¤ä¸»è¡¨ |
| | | oCN.RunProc("Delete From Xt_CheckFlowMain where HInterID=" + HItemID); |
| | | |
| | | oCN.Commit();//æäº¤äºå¡ |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 1; |
| | | objJsonResult.Message = "* æ°æ®å 餿åï¼"; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; ; |
| | | |
| | | } |
| | | catch (Exception e) |
| | | { |
| | | //åæ» |
| | | oCN.RollBack(); |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "å é¤å¤±è´¥ï¼" + e.ToString(); |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | } |
| | | #endregion |
| | | |
| | | #region 审æ¹ç¨æ·æé设置 |
| | | [Route("Xt_CheckFlowBill/Xt_CheckUserRight")] |
| | | [HttpGet] |
| | | public object Xt_CheckUserRight() |
| | | { |
| | | try |
| | | { |
| | | string sql1 = string.Format(@"select * from Gy_Czygl "); |
| | | |
| | | ds = oCN.RunProcReturn(sql1, "Gy_Czygl"); |
| | | |
| | | string TreeStr = "[{\"title\": \"审æ¹ç¨æ·æé设置\", \"id\": \"1\" ,\"spread\": \"true\",\"children\":["; |
| | | |
| | | foreach (DataRow item in ds.Tables[0].Rows) |
| | | { |
| | | TreeStr+= "{ \"title\": \"" + item["Czymc"].ToString() + "\",\"id\": \"" + item["Czybm"].ToString() + "\"},"; |
| | | } |
| | | TreeStr = TreeStr.Substring(0, TreeStr.Length - 1); |
| | | TreeStr += "]}]"; |
| | | |
| | | objJsonResult.code = "1"; |
| | | objJsonResult.count = 1; |
| | | objJsonResult.Message = "Sucessï¼"; |
| | | objJsonResult.data = JsonConvert.DeserializeObject(TreeStr); |
| | | return objJsonResult; |
| | | } |
| | | catch (Exception e) |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "Exceptionï¼" + e.ToString(); |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | } |
| | | #endregion |
| | | |
| | | #region 审æ¹ç¨æ·æé设置 å³ |
| | | [Route("Xt_CheckFlowBill/Xt_CheckUserRightListMain")] |
| | | [HttpGet] |
| | | public object Xt_CheckUserRightListMain(string sWhere) |
| | | { |
| | | try |
| | | { |
| | | string sql1 = string.Format(@"select *,row_number()over(ORDER BY HInterID ) num from h_v_Xt_CheckUserRightMain where 1=1 "); |
| | | |
| | | ds = oCN.RunProcReturn(sql1+sWhere, "h_v_Xt_CheckUserRightMain"); |
| | | |
| | | 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; |
| | | } |
| | | } |
| | | #endregion |
| | | |
| | | #region 审æ¹ç¨æ·æé设置 å·¦ |
| | | [Route("Xt_CheckFlowBill/Xt_CheckUserRightListMainSource")] |
| | | [HttpGet] |
| | | public object Xt_CheckUserRightListMainSource(string sWhere) |
| | | { |
| | | try |
| | | { |
| | | string sql1 = string.Format(@"select *,row_number()over(ORDER BY HInterID ) num from h_v_Xt_CheckUserRightSource where 1=1 "); |
| | | |
| | | ds = oCN.RunProcReturn(sql1 + sWhere, "h_v_Xt_CheckUserRightSource"); |
| | | |
| | | 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; |
| | | } |
| | | } |
| | | #endregion |
| | | |
| | | #region 审æ¹ç¨æ·æé设置 ä¿å |
| | | //åæ®µ |
| | | public class Xt_CheckUserRightsub |
| | | { |
| | | public int hcheckitemid; |
| | | } |
| | | [Route("Xt_CheckFlowBill/Xt_CheckUserRightEdit")] |
| | | [HttpPost] |
| | | public object Xt_CheckUserRightEdit([FromBody] JObject msg) |
| | | { |
| | | var _value = msg["msg"].ToString(); |
| | | string msg3 = _value.ToString(); |
| | | string[] sArray = msg3.Split(new string[] { ";" }, StringSplitOptions.RemoveEmptyEntries); |
| | | string msg1 = sArray[0].ToString(); |
| | | string msg2 = sArray[1].ToString(); |
| | | msg3 = sArray[2].ToString(); |
| | | string msg4 = sArray[3].ToString(); |
| | | SQLHelper.ClsCN oCN = new SQLHelper.ClsCN(); |
| | | |
| | | //ç¼è¾æé |
| | | if (!DBUtility.ClsPub.Security_Log_second("Xt_CheckFlow_Edit", 1, false, msg4)) |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "æ ä¿åæéï¼"; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | try |
| | | { |
| | | List<Xt_CheckUserRightsub> lsmain = new List<Xt_CheckUserRightsub>(); |
| | | msg1 = msg1.Replace("\\", ""); |
| | | msg1 = msg1.Replace("\n", ""); //\n |
| | | lsmain = JsonConvert.DeserializeObject<List<Xt_CheckUserRightsub>>(msg1); |
| | | |
| | | oCN.BeginTran(); |
| | | //å é¤åè®°å½ |
| | | oCN.RunProc("Delete From Xt_CheckUserRight where HUserID='" + msg2 + "'and HCheckFlowInterID=" + msg3 + ""); |
| | | var HCheckItemID=0; |
| | | //æ°å¢è®°å½ |
| | | for (int i = 0; i <= lsmain.Count - 1; i++) |
| | | { |
| | | if (HCheckItemID != lsmain[i].hcheckitemid) |
| | | { |
| | | oCN.RunProc("insert into Xt_CheckUserRight(HUserID,HCheckFlowInterID,HCheckItemID) values('" + msg2 + "'," + msg3 + "," + lsmain[i].hcheckitemid + ") "); |
| | | HCheckItemID = lsmain[i].hcheckitemid; |
| | | } |
| | | |
| | | } |
| | | |
| | | oCN.Commit(); |
| | | |
| | | objJsonResult.code = "1"; |
| | | objJsonResult.count = 1; |
| | | objJsonResult.Message = "ä¿åæåï¼"; |
| | | objJsonResult.data = 1; |
| | | return objJsonResult; |
| | | } |
| | | catch (Exception e) |
| | | { |
| | | oCN.RollBack(); |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "ä¿å失败ï¼" + e.ToString(); |
| | | objJsonResult.data = 1; |
| | | return objJsonResult; |
| | | } |
| | | } |
| | | |
| | | #endregion |
| | | |
| | | } |
| | | } |
New file |
| | |
| | | using Newtonsoft.Json; |
| | | using Newtonsoft.Json.Linq; |
| | | using System; |
| | | using System.Collections.Generic; |
| | | using System.Data; |
| | | using System.Linq; |
| | | using System.Net; |
| | | using System.Net.Http; |
| | | using System.Web.Http; |
| | | using WebAPI.Models; |
| | | |
| | | namespace WebAPI.Controllers.åºç¡èµæ.åºç¡èµæ |
| | | { |
| | | public class Xt_CheckItemBillController : ApiController |
| | | { |
| | | private json objJsonResult = new json(); |
| | | public DataSet ds = new DataSet(); |
| | | public SQLHelper.ClsCN oCN = new SQLHelper.ClsCN(); |
| | | |
| | | #region å®¡æ ¸é¡¹ç®å表 |
| | | [Route("Xt_CheckItemBill/Xt_CheckItemList")] |
| | | [HttpGet] |
| | | public object Xt_CheckItemList(string sWhere, string user) |
| | | { |
| | | try |
| | | { |
| | | List<object> columnNameList = new List<object>(); |
| | | //æ¥è¯¢æé |
| | | if (!DBUtility.ClsPub.Security_Log_second("Xt_CheckItem_Query", 1, false, user)) |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "æ æ¥çæéï¼"; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | |
| | | string sql1 = string.Format(@"select * from h_v_Xt_CheckItemList where 1=1 "); |
| | | |
| | | ds = oCN.RunProcReturn(sql1 + sWhere + " order by 审æ¹é¡¹ç®ä»£ç ", "h_v_Xt_CheckItemList"); |
| | | |
| | | //æ·»å åå |
| | | 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; |
| | | } |
| | | } |
| | | #endregion |
| | | |
| | | #region å®¡æ ¸é¡¹ç®ä¿å |
| | | [Route("Xt_CheckItemBill/Xt_CheckItemEdit")] |
| | | [HttpPost] |
| | | public object Xt_CheckItemEdit([FromBody] JObject msg) |
| | | { |
| | | DataSet ds; |
| | | var _value = msg["msg"].ToString(); |
| | | string msg3 = _value.ToString(); |
| | | string[] sArray = msg3.Split(new string[] { ";" }, StringSplitOptions.RemoveEmptyEntries); |
| | | string msg1 = sArray[0].ToString(); |
| | | string msg2 = sArray[1].ToString(); |
| | | SQLHelper.ClsCN oCN = new SQLHelper.ClsCN(); |
| | | |
| | | //ç¼è¾æé |
| | | if (!DBUtility.ClsPub.Security_Log_second("Xt_CheckItem_Edit", 1, false, msg2)) |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "æ ä¿åæéï¼"; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | ListModels oListModels = new ListModels(); |
| | | try |
| | | { |
| | | List<Models.Xt_CheckItem> lsmain = new List<Models.Xt_CheckItem>(); |
| | | msg1 = msg1.Replace("\\", ""); |
| | | msg1 = msg1.Replace("\n", ""); //\n |
| | | lsmain = oListModels.getObjectByJson_Xt_CheckItem(msg1); |
| | | foreach (Xt_CheckItem oItem in lsmain) |
| | | { |
| | | if (oItem.HNumber.Trim() == "") |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "ä¿å失败ï¼ä»£ç ä¸è½ä¸ºç©ºï¼"; |
| | | objJsonResult.data = 1; |
| | | return objJsonResult; |
| | | } |
| | | if (oItem.HName.Trim() == "") |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "ä¿å失败ï¼åç§°ä¸è½ä¸ºç©ºï¼"; |
| | | objJsonResult.data = 1; |
| | | return objJsonResult; |
| | | } |
| | | |
| | | //æ¥è¯¢æ°æ®ä¸æ¯å¦åå¨éå¤ä»£ç |
| | | ds = oCN.RunProcReturn("select * from Xt_CheckItem where HStopflag=0 and HNumber='" + oItem.HNumber.Trim() + "'", "Xt_CheckItem"); |
| | | //æ°å¢æ¶å¤æ |
| | | if (oItem.HItemID == 0) |
| | | { |
| | | if (ds == null || ds.Tables[0].Rows.Count == 0) |
| | | { |
| | | |
| | | } |
| | | else |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "ä¿å失败ï¼ä»£ç éå¤ï¼"; |
| | | objJsonResult.data = 1; |
| | | return objJsonResult; |
| | | } |
| | | } |
| | | } |
| | | |
| | | //ä¿å |
| | | //ä¿å宿¯åå¤ç |
| | | oCN.BeginTran(); |
| | | foreach (Xt_CheckItem oItem in lsmain) |
| | | { |
| | | bool bResult = false; |
| | | if (oItem.HItemID == 0) |
| | | { |
| | | |
| | | oCN.RunProc("Insert into Xt_CheckItem " + |
| | | " (HNumber,HName" + |
| | | ",HStopflag,HRemark) " + |
| | | " Values('" + oItem.HNumber + "','" + oItem.HName + |
| | | "'," + Convert.ToString(oItem.HStopFlag ? 1 : 0) + ",'" + oItem.HRemark + "')"); |
| | | |
| | | bResult = true; |
| | | } |
| | | else |
| | | { |
| | | oCN.RunProc("Update Xt_CheckItem set " + |
| | | " HNumber='" + oItem.HNumber + "'" + |
| | | ",HName='" + oItem.HName + "'" + |
| | | ",HStopflag=" + Convert.ToString(oItem.HStopFlag ? 1 : 0) + |
| | | ",HRemark= '" + oItem.HRemark + "' Where HItemID=" + oItem.HItemID); |
| | | bResult = true; |
| | | } |
| | | |
| | | if (!bResult) |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "ä¿å失败ï¼" + DBUtility.ClsPub.sExeReturnInfo; |
| | | objJsonResult.data = 1; |
| | | return objJsonResult; |
| | | } |
| | | |
| | | } |
| | | |
| | | oCN.Commit(); |
| | | |
| | | objJsonResult.code = "1"; |
| | | objJsonResult.count = 1; |
| | | objJsonResult.Message = "ä¿åæåï¼"; |
| | | objJsonResult.data = 1; |
| | | return objJsonResult; |
| | | } |
| | | catch (Exception e) |
| | | { |
| | | oCN.RollBack(); |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "ä¿å失败ï¼" + e.ToString(); |
| | | objJsonResult.data = 1; |
| | | return objJsonResult; |
| | | } |
| | | } |
| | | |
| | | #endregion |
| | | |
| | | #region å®¡æ ¸é¡¹ç®å é¤ |
| | | [Route("Xt_CheckItemBill/Xt_CheckItemBillDelete")] |
| | | [HttpGet] |
| | | public object Xt_CheckItemBillDelete(string HItemID, string user) |
| | | { |
| | | try |
| | | { |
| | | //å 餿é |
| | | if (!DBUtility.ClsPub.Security_Log("Xt_CheckItem_Drop", 1, false, user)) |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "æ å 餿é"; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | |
| | | 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 Xt_CheckItem where HItemID=" + HItemID, "Xt_CheckItem"); |
| | | if (ds == null || ds.Tables[0].Rows.Count == 0) |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "æ²¡ææ°æ®ï¼æ æ³å é¤ï¼"; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; ; |
| | | } |
| | | var HStopflag = Convert.ToBoolean(ds.Tables[0].Rows[0]["HStopflag"]); |
| | | if (HStopflag) |
| | | { |
| | | oCN.RollBack();//åæ»äºå¡ |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "æ°æ®å·²å 餿 æ³å次å é¤ï¼"; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | |
| | | oCN.RunProc("update Xt_CheckItem set HStopflag=1 where HItemID=" + HItemID); |
| | | oCN.Commit();//æäº¤äºå¡ |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 1; |
| | | objJsonResult.Message = "* æ°æ®å 餿åï¼"; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; ; |
| | | |
| | | } |
| | | catch (Exception e) |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "å é¤å¤±è´¥ï¼" + e.ToString(); |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | } |
| | | #endregion |
| | | } |
| | | } |
| | |
| | | } |
| | | |
| | | /// <summary> |
| | | /// å¤çæ°å¢å®¡æ ¸é¡¹ç®çjson |
| | | /// </summary> |
| | | /// <param name="jsonString"></param> |
| | | /// <returns></returns> |
| | | public List<Models.Xt_CheckItem> getObjectByJson_Xt_CheckItem(string jsonString) |
| | | { |
| | | jsonString = "[" + jsonString.ToString() + "]"; |
| | | List<Models.Xt_CheckItem> list = Newtonsoft.Json.JsonConvert.DeserializeObject<List<Models.Xt_CheckItem>>(jsonString); |
| | | return list; |
| | | } |
| | | |
| | | /// <summary> |
| | | /// å¤çæ°å¢è®¾å¤ç»´ä¿®ä¸»è¡¨çjson |
| | | /// </summary> |
| | | /// <param name="jsonString"></param> |
New file |
| | |
| | | using System; |
| | | using System.Collections.Generic; |
| | | using System.Linq; |
| | | using System.Web; |
| | | |
| | | namespace WebAPI.Models |
| | | { |
| | | public class Xt_CheckFlowMain |
| | | { |
| | | public Int64 HInterID; |
| | | public string HName; |
| | | public string HBillTypeID; |
| | | public Int64 HDeptID; |
| | | public bool HStandard; |
| | | public string HRemark; |
| | | } |
| | | } |
New file |
| | |
| | | using System; |
| | | using System.Collections.Generic; |
| | | using System.Linq; |
| | | using System.Web; |
| | | |
| | | namespace WebAPI.Models |
| | | { |
| | | public class Xt_CheckFlowSub |
| | | { |
| | | public Int64 HInterID; |
| | | public Int64 HEntryID; |
| | | public int HSno; |
| | | public string HFlowNo; |
| | | public long HCheckItemID; |
| | | public bool HJumpFlag; |
| | | public bool HMakerSelf; |
| | | public string HCheckMan; |
| | | } |
| | | } |
New file |
| | |
| | | using System; |
| | | using System.Collections.Generic; |
| | | using System.Linq; |
| | | using System.Web; |
| | | |
| | | namespace WebAPI.Models |
| | | { |
| | | public class Xt_CheckItem |
| | | { |
| | | public int HItemID; |
| | | public string HNumber; |
| | | public string HName; |
| | | public string HRemark; |
| | | public bool HStopFlag; |
| | | } |
| | | } |
New file |
| | |
| | | using System; |
| | | using System.Collections.Generic; |
| | | using System.Linq; |
| | | using System.Web; |
| | | |
| | | namespace WebAPI.Models.åºç¡èµæ |
| | | { |
| | | public class Gy_Duty |
| | | { |
| | | public int HItemID; |
| | | public int HParentID; |
| | | public int HLevel; |
| | | public string HNumber { get; set; } |
| | | public string HName { get; set; } |
| | | public string HUserGroupID { get; set; } |
| | | public string HRemark { get; set; } |
| | | public string HShortNumber { get; set; } |
| | | public string HHelpCode { get; set; } |
| | | public bool HStopflag; |
| | | public int HEndFlag; |
| | | } |
| | | } |
| | |
| | | <Compile Include="Controllers\ä»å管ç\颿åè´§\Kf_StepFoldOutBillController.cs" /> |
| | | <Compile Include="Controllers\ä»å管ç\éªæ¶å
¥åº\Kf_StepFoldinBillController.cs" /> |
| | | <Compile Include="Controllers\忥èªå¨æ«ç 线\ScanlineAPIController.cs" /> |
| | | <Compile Include="Controllers\åºç¡èµæ\åºç¡èµæ\Gy_DutyBillController.cs" /> |
| | | <Compile Include="Controllers\åºç¡èµæ\åºç¡èµæ\Gy_SOPBillController.cs" /> |
| | | <Compile Include="Controllers\åºç¡èµæ\åºç¡èµæ\Gy_SOPBillListController.cs" /> |
| | | <Compile Include="Controllers\åºç¡èµæ\åºç¡èµæ\Gy_StockCheckItemBillController.cs" /> |
| | | <Compile Include="Controllers\åºç¡èµæ\åºç¡èµæ\Gy_WorkStationBillController.cs" /> |
| | | <Compile Include="Controllers\åºç¡èµæ\åºç¡èµæ\Xt_CheckFlowBillController.cs" /> |
| | | <Compile Include="Controllers\åºç¡èµæ\åºç¡èµæ\Xt_CheckItemBillController.cs" /> |
| | | <Compile Include="Controllers\å·¥èµç®¡ç\Pay_MonthlySalaryReportController.cs" /> |
| | | <Compile Include="Controllers\å·¥èµç®¡ç\Pay_PieceRateWageReportController.cs" /> |
| | | <Compile Include="Controllers\å·¥èµç®¡ç\Gy_ClassTimePrjBillController.cs" /> |
| | |
| | | <Compile Include="Models\TechnologyParameter.cs" /> |
| | | <Compile Include="Models\TechnologyParameterUnit.cs" /> |
| | | <Compile Include="Models\TechParamByProc.cs" /> |
| | | <Compile Include="Models\Xt_CheckFlowMain.cs" /> |
| | | <Compile Include="Models\Xt_CheckFlowSub.cs" /> |
| | | <Compile Include="Models\Xt_CheckItem.cs" /> |
| | | <Compile Include="Models\å
¶å®\ReciveBill_FastModel.cs" /> |
| | | <Compile Include="Models\卿å\OptionListModel.cs" /> |
| | | <Compile Include="Models\åºç¡èµæ\ConkType.cs" /> |
| | | <Compile Include="Models\åºç¡èµæ\Gy_ClassTimePrj.cs" /> |
| | | <Compile Include="Models\åºç¡èµæ\Gy_Duty.cs" /> |
| | | <Compile Include="Models\åºç¡èµæ\PackType.cs" /> |
| | | <Compile Include="Models\åºç¡èµæ\WorkStation.cs" /> |
| | | <Compile Include="Models\å·¥èµç®¡ç\ClsGy_ClassTimePrj_Model.cs" /> |
| | |
| | | <Folder Include="Views\Cj_ComplementGoodsBill\" /> |
| | | <Folder Include="Views\Cj_SendGoodsBill\" /> |
| | | <Folder Include="Views\Gy_ConkType\" /> |
| | | <Folder Include="Views\Gy_DutyBill\" /> |
| | | <Folder Include="Views\Gy_EquipType\" /> |
| | | <Folder Include="Views\Gy_ICBomBill\" /> |
| | | <Folder Include="Views\Gy_MateMould\" /> |
| | |
| | | <Folder Include="Views\Sc_WorkBillAutoSortBillMain\" /> |
| | | <Folder Include="Views\Sc_WorkBillSortBill\" /> |
| | | <Folder Include="Views\Sc_WorkDemandPlanBill\" /> |
| | | <Folder Include="Views\Xt_CheckFlowBill\" /> |
| | | <Folder Include="Views\Xt_CheckItem\" /> |
| | | <Folder Include="Views\Xt_grdAlignment_WMES\" /> |
| | | </ItemGroup> |
| | | <ItemGroup> |