| | |
| | | public int HMainSourceEntryID; |
| | | public string HMainSourceBillNo; |
| | | public string HMainSourceBillType; |
| | | public int HOrderLevID; |
| | | public int HHasten; |
| | | } |
| | | #endregion |
| | | |
| | |
| | | int HMainSourceEntryID = mainList[0].HMainSourceEntryID; |
| | | string HMainSourceBillNo = mainList[0].HMainSourceBillNo; |
| | | string HMainSourceBillType = mainList[0].HMainSourceBillType; |
| | | int HOrderLevID = mainList[0].HOrderLevID; |
| | | int HHasten = mainList[0].HHasten; |
| | | |
| | | |
| | | if (OperationType == 2) |
| | |
| | | { |
| | | string sql = "insert into PM_WorkTaskBillMain" + |
| | | "(HYear,HPeriod,HBillType,HBillSubType,HInterID,HBillNo,HProjectID,HProNumber,HProjectStageID,HName,HDate,HTaskNote,HPlanTimes" + |
| | | ",HSelfTimes,HLastDate,HSendEmp,HReceiveEmp,HType,HCopyEmp,HRemark,HOrgID,HMaker,HMakeDate,HMainSourceInterID,HMainSourceEntryID,HMainSourceBillNo,HMainSourceBillType)" + |
| | | ",HSelfTimes,HLastDate,HSendEmp,HReceiveEmp,HType,HCopyEmp,HRemark,HOrgID,HMaker,HMakeDate,HMainSourceInterID,HMainSourceEntryID,HMainSourceBillNo,HMainSourceBillType,HOrderLevID,HHasten)" + |
| | | "values(" + |
| | | "" + HYear + |
| | | "," + HPeriod + |
| | |
| | | "," + HMainSourceEntryID + |
| | | ",'" + HMainSourceBillNo + |
| | | "','" + HMainSourceBillType + |
| | | "','" + HOrderLevID + |
| | | "','" + HHasten + |
| | | "')"; |
| | | |
| | | //主表 |
| | |
| | | ",HMainSourceEntryID = " + HMainSourceEntryID + |
| | | ",HMainSourceBillNo = '" + HMainSourceBillNo + |
| | | "',HMainSourceBillType = '" + HMainSourceBillType + |
| | | "',HOrderLevID = '" + HOrderLevID + |
| | | "',HHasten = '" + HHasten + |
| | | "' where HInterID = " + HInterID; |
| | | |
| | | oCN.RunProc(sql); |
| | |
| | | { |
| | | string sql = "insert into PM_WorkTaskBillMain" + |
| | | "(HYear,HPeriod,HBillType,HBillSubType,HInterID,HBillNo,HProjectID,HProNumber,HProjectStageID,HName,HDate,HTaskNote,HPlanTimes" + |
| | | ",HSelfTimes,HLastDate,HSendEmp,HReceiveEmp,HType,HCopyEmp,HRemark,HOrgID,HMaker,HMakeDate,HMainSourceInterID,HMainSourceEntryID,HMainSourceBillNo,HMainSourceBillType)" + |
| | | ",HSelfTimes,HLastDate,HSendEmp,HReceiveEmp,HType,HCopyEmp,HRemark,HOrgID,HMaker,HMakeDate,HMainSourceInterID,HMainSourceEntryID,HMainSourceBillNo,HMainSourceBillType,HOrderLevID,HHasten )" + |
| | | "values(" + |
| | | "" + HYear + |
| | | "," + HPeriod + |
| | |
| | | "," + HMainSourceEntryID + |
| | | ",'" + HMainSourceBillNo + |
| | | "','" + HMainSourceBillType + |
| | | "','" + HOrderLevID + |
| | | "','" + HHasten + |
| | | "')"; |
| | | //主表 |
| | | oCN.RunProc(sql); |
| | |
| | | string sql = sql1 + sWhere + " order by åæ®å· desc"; |
| | | ds = oCN.RunProcReturn(sql, "h_v_PM_WorkTaskBillList"); |
| | | } |
| | | |
| | | //æ·»å åå |
| | | 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 å·¥ä½ä»»å¡å表 䏿¨æ°æ®æ¥è¯¢ |
| | | /// <summary> |
| | | /// è¿å项ç®é¶æ®µå表 |
| | | ///åæ°ï¼string sqlã |
| | | ///è¿åå¼ï¼objectã |
| | | /// </summary> |
| | | [Route("PM_WorkTaskBill/XTList")] |
| | | [HttpGet] |
| | | public object XTList(string HInterID,string user) |
| | | { |
| | | try |
| | | { |
| | | List<object> columnNameList = new List<object>(); |
| | | |
| | | ds = oCN.RunProcReturn("select * from h_v_PM_WorkTaskBillMyList where HInterID ='"+ HInterID + "' and æ¥å人='"+user+"'", "h_v_PM_WorkTaskBillMyList"); |
| | | |
| | | |
| | | //æ·»å åå |
| | | 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 订åç级å表 æ¥è¯¢ |
| | | /// <summary> |
| | | /// è¿å项ç®é¶æ®µå表 |
| | | ///åæ°ï¼string sqlã |
| | | ///è¿åå¼ï¼objectã |
| | | /// </summary> |
| | | [Route("PM_WorkTaskBill/getOrder")] |
| | | [HttpGet] |
| | | public object getOrder() |
| | | { |
| | | try |
| | | { |
| | | List<object> columnNameList = new List<object>(); |
| | | |
| | | //if (HItemID == null || HItemID.Equals("")) |
| | | //{ |
| | | //ds = oCN.RunProcReturn("select * from Gy_OrderLev ", "Gy_OrderLev"); |
| | | //} |
| | | //else |
| | | //{ |
| | | // string sql = "select * from Gy_OrderLev where HItemID='"+ HItemID + "'"; |
| | | // ds = oCN.RunProcReturn(sql, "Gy_OrderLev"); |
| | | //} |
| | | ds = oCN.RunProcReturn("select * from Gy_OrderLev ", "Gy_OrderLev"); |
| | | |
| | | |
| | | //æ·»å åå |
| | | foreach (DataColumn col in ds.Tables[0].Columns) |
| | |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | } |
| | | } |
| | | |
| | | 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 |
| | | |
| | | #region å·¥ä½ä»»å¡ å¼å§ä»»å¡/æ¤éå¼å§åè½ |
| | | [Route("PM_WorkTaskBill/BeginPM_WorkTaskBill")] |
| | | [HttpGet] |
| | | public object BeginPM_WorkTaskBill(string HInterID, int Type, string user) |
| | | { |
| | | try |
| | | { |
| | | |
| | | if (string.IsNullOrWhiteSpace(HInterID)) |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "HInterID为空ï¼"; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | |
| | | ClsPub.CurUserName = user; |
| | | BillOld.MvarItemKey = "PM_WorkTaskBillMain"; |
| | | oCN.BeginTran();//å¼å§äºå¡ |
| | | |
| | | //Type 0 å¼å§ä»»å¡ 1 æ¤éä»»å¡ |
| | | if (Type == 0) |
| | | { |
| | | //夿忮æ¯å¦åå¨ |
| | | DataSet ds; |
| | | string sql = "select * from PM_WorkTaskBillMain where HinterID = " + HInterID; |
| | | ds = oCN.RunProcReturn(sql, "PM_WorkTaskBillMain"); |
| | | if (ds == null || ds.Tables[0].Rows.Count == 0) |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "åæ®ä¸åå¨ï¼"; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | if (ds.Tables[0] != null && ds.Tables[0].Rows.Count > 0) |
| | | { |
| | | string sql1= "update PM_WorkTaskBillMain set HTaskStatus='è¿è¡ä¸' where HinterID = " + HInterID; |
| | | ds = oCN.RunProcReturn(sql1, "PM_WorkTaskBillMain"); |
| | | |
| | | } |
| | | } |
| | | else if(Type==1) |
| | | { |
| | | //夿忮æ¯å¦åå¨ |
| | | DataSet ds; |
| | | string sql = "select * from PM_WorkTaskBillMain where HinterID = " + HInterID; |
| | | ds = oCN.RunProcReturn(sql, "PM_WorkTaskBillMain"); |
| | | if (ds == null || ds.Tables[0].Rows.Count == 0) |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "åæ®ä¸åå¨ï¼"; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | if (ds.Tables[0] != null && ds.Tables[0].Rows.Count > 0) |
| | | { |
| | | string sql1 = "update PM_WorkTaskBillMain set HTaskStatus='æªå¼å§' where HinterID = " + HInterID; |
| | | ds = oCN.RunProcReturn(sql1, "PM_WorkTaskBillMain"); |
| | | } |
| | | } |
| | | else if (Type == 2) |
| | | { |
| | | //夿忮æ¯å¦åå¨ |
| | | DataSet ds; |
| | | string sql = "select * from PM_WorkTaskBillMain where HinterID = " + HInterID; |
| | | ds = oCN.RunProcReturn(sql, "PM_WorkTaskBillMain"); |
| | | if (ds == null || ds.Tables[0].Rows.Count == 0) |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "åæ®ä¸åå¨ï¼"; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | if (ds.Tables[0] != null && ds.Tables[0].Rows.Count > 0) |
| | | { |
| | | string sql1 = "update PM_WorkTaskBillMain set HTaskStatus='å·²ç»æ' where HinterID = " + HInterID; |
| | | ds = oCN.RunProcReturn(sql1, "PM_WorkTaskBillMain"); |
| | | } |
| | | } |
| | | |
| | |
| | | string ColmString = "{\"ColmCols\":\"" + col.ColumnName + "\",\"ColmType\":\"" + dataType.Name + "\"}"; |
| | | columnNameList.Add(JsonConvert.DeserializeObject(ColmString));//è·åå°DataColumnå对象çåå |
| | | } |
| | | |
| | | //æ·»å åå |
| | | foreach (DataColumn col in ds.Tables[1].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ï¼"; |
| | |
| | | } |
| | | } |
| | | #endregion |
| | | |
| | | |
| | | } |
| | | } |