| | |
| | | using WebAPI.Models; |
| | | using System.Threading.Tasks; |
| | | using DLL; |
| | | using SyntacticSugar.constant; |
| | | |
| | | namespace WebAPI.Controllers.项ç®ç®¡ç.å·¥ä½ä»»å¡ |
| | | { |
| | |
| | | } |
| | | } |
| | | #endregion |
| | | |
| | | #region å·¥ä½ä»»å¡å表å页å表 |
| | | [Route("PM_WorkTaskBill/page")] |
| | | [HttpGet] |
| | | public object PM_WorkTaskBillPage(string sWhere, string user, int page, int size) |
| | | { |
| | | DataSet ds; |
| | | try |
| | | { |
| | | List<object> columnNameList = new List<object>(); |
| | | //夿æé |
| | | //if (!DBUtility.ClsPub.Security_Log("Cg_POInStockBillQuery", 1, false, user)) |
| | | //{ |
| | | // objJsonResult.code = CodeConstant.FAIL; |
| | | // objJsonResult.count = CountConstant.FAIL; |
| | | // objJsonResult.Message = "æ¨æ²¡æè¯¥æ¨¡åæé,请ä¸ç®¡çåèç³»ï¼"; |
| | | // objJsonResult.data = null; |
| | | // return objJsonResult; |
| | | //} |
| | | |
| | | if (sWhere == null || sWhere.Equals("")) |
| | | { |
| | | ds = oCN.RunProcReturn("exec h_p_PM_WorkTaskBillList " + page + "," + size + ",''", "h_p_PM_WorkTaskBillList"); |
| | | } |
| | | else |
| | | { |
| | | sWhere = sWhere.Replace("'", "''"); |
| | | ds = oCN.RunProcReturn("exec h_p_PM_WorkTaskBillList " + page + "," + size + ",'" + sWhere + "'", "h_p_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 = CodeConstant.SUCCEED; |
| | | objJsonResult.count = int.Parse(ds.Tables[1].Rows[0]["count"].ToString()); |
| | | objJsonResult.Message = "Sucessï¼"; |
| | | objJsonResult.list = columnNameList; |
| | | objJsonResult.data = ds.Tables[0]; |
| | | return objJsonResult; |
| | | } |
| | | catch (Exception e) |
| | | { |
| | | objJsonResult.code = CodeConstant.FAIL; |
| | | objJsonResult.count = CountConstant.FAIL; |
| | | objJsonResult.Message = "Exceptionï¼" + e.ToString(); |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | } |
| | | #endregion |
| | | |
| | | |
| | | #region å·¥ä½ä»»å¡å表 䏿¨æ°æ®æ¥è¯¢ |
| | | /// <summary> |
| | |
| | | } |
| | | string HSendEmp = ds.Tables[0].Rows[0]["æ´¾å人"].ToString();//æ´¾å人 |
| | | string HCopyEmp = ds.Tables[0].Rows[0]["æé人"].ToString();//æé人 |
| | | string HPlanTimes = ds.Tables[0].Rows[0]["è¯ä¼°å·¥æ¶"].ToString();//è¯ä¼°å·¥æ¶ |
| | | string HWorkTaskDate = DateTime.Parse(ds.Tables[0].Rows[0]["æ¥æ"].ToString()).ToString("yyyy-MM-dd");//å·¥ä½ä»»å¡åæ®æ¶é´ |
| | | string HSelfTimes = ds.Tables[0].Rows[0]["èªè¯å·¥æ¶"].ToString();//èªè¯å·¥æ¶ |
| | | string HProjectName = ds.Tables[0].Rows[0]["项ç®åç§°"].ToString();//项ç®åç§° |
| | | string HTaskDescription = ds.Tables[0].Rows[0]["ä»»å¡æè¿°"].ToString(); |
| | | //æå
¥å表sql |
| | | string sql = "insert into PM_WorkTaskReportBillSub" + |
| | | "(HInterID,HBillNo_bak,HEntryID,HRemark,HProjectID,HProNumber,HProjectStageID,HName,HTaskNote,HType,HRelTimes,HReportNote,HAdv,HSourceInterID,HSourceEntryID,HSourceBillType,HSourceBillNo,HFinishFlag) " + |
| | |
| | | "'," + DBUtility.ClsPub.BoolToString(HFinishFlag) + |
| | | ")"; |
| | | oCN.RunProc(sql); |
| | | string messageContext = "æ¥æ= " + DateTime.Now + ",æ±æ¥äºº=" + reportMan + ",æ±æ¥å
容=" + HReportNote + ",è¯ä¼°å·¥æ¶=" + HPlanTimes + "å°æ¶,èªè¯å·¥æ¶=" + HSelfTimes + "å°æ¶,èç¨å·¥æ¶=" + HRelTimes + "å°æ¶,ä»»å¡åç§°=" + HName + ",项ç®åç§°=" + HProjectName; ; |
| | | string messageContext = "åæ®æ¥æ= " + HWorkTaskDate + ",æ±æ¥äºº=" + reportMan + ",æ±æ¥å
容=" + HReportNote +",ä»»å¡æè¿° ="+ HTaskDescription +",宿æ è®°="+ (HFinishFlag?"æ¯":"å¦") + ",èªè¯å·¥æ¶=" + HSelfTimes + "å°æ¶,èç¨å·¥æ¶=" + HRelTimes + "å°æ¶,ä»»å¡åç§°=" + HName + ",项ç®åç§°=" + HProjectName; ; |
| | | _ = SendDingDingAsync(HSendEmp, messageContext, HCopyEmp); |
| | | } |
| | | |
| | |
| | | } |
| | | } |
| | | #endregion |
| | | |
| | | #region 任塿±æ¥å页å表 |
| | | [Route("PM_WorkTaskReportBill/page")] |
| | | [HttpGet] |
| | | public object PM_WorkTaskReportBillPage(string sWhere, string user, int page, int size) |
| | | { |
| | | DataSet ds; |
| | | try |
| | | { |
| | | List<object> columnNameList = new List<object>(); |
| | | //夿æé |
| | | //if (!DBUtility.ClsPub.Security_Log("Cg_POInStockBillQuery", 1, false, user)) |
| | | //{ |
| | | // objJsonResult.code = CodeConstant.FAIL; |
| | | // objJsonResult.count = CountConstant.FAIL; |
| | | // objJsonResult.Message = "æ¨æ²¡æè¯¥æ¨¡åæé,请ä¸ç®¡çåèç³»ï¼"; |
| | | // objJsonResult.data = null; |
| | | // return objJsonResult; |
| | | //} |
| | | |
| | | if (sWhere == null || sWhere.Equals("")) |
| | | { |
| | | ds = oCN.RunProcReturn("exec h_p_PM_WorkTaskReportBillList " + page + "," + size + ",''", "h_p_PM_WorkTaskReportBillList"); |
| | | } |
| | | else |
| | | { |
| | | sWhere = sWhere.Replace("'", "''"); |
| | | ds = oCN.RunProcReturn("exec h_p_PM_WorkTaskReportBillList " + page + "," + size + ",'" + sWhere + "'", "h_p_PM_WorkTaskReportBillList"); |
| | | } |
| | | |
| | | //æ·»å åå |
| | | 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 = CodeConstant.SUCCEED; |
| | | objJsonResult.count = int.Parse(ds.Tables[1].Rows[0]["count"].ToString()); |
| | | objJsonResult.Message = "Sucessï¼"; |
| | | objJsonResult.list = columnNameList; |
| | | objJsonResult.data = ds.Tables[0]; |
| | | return objJsonResult; |
| | | } |
| | | catch (Exception e) |
| | | { |
| | | objJsonResult.code = CodeConstant.FAIL; |
| | | objJsonResult.count = CountConstant.FAIL; |
| | | objJsonResult.Message = "Exceptionï¼" + e.ToString(); |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | } |
| | | #endregion |
| | | |
| | | |
| | | #region 任塿±æ¥ ç¼è¾-页é¢èµå¼ |
| | | /// <summary> |
| | |
| | | return response; |
| | | } |
| | | #endregion |
| | | |
| | | |
| | | |
| | | //#region èªå¨å 载页é¢è¡¨å¤´ |
| | | ///// <summary> |
| | | ///// è¿å项ç®é¶æ®µå表 |
| | | /////åæ°ï¼string sqlã |
| | | /////è¿åå¼ï¼objectã |
| | | ///// </summary> |
| | | //[Route("Xt_DefineBillMainSet/getDefineBillMainSet")] |
| | | //[HttpGet] |
| | | //public object getDefineBillMainSet(string HModName, string user) |
| | | //{ |
| | | // try |
| | | // { |
| | | // string sql = "select * from h_v_Xt_DefineBillMainSet_AutoLoadList where HModName ='" + HModName + "' and HUser ='" + user + "' order by HArrangeOrder,HArrangeOrderSub"; |
| | | // ds = oCN.RunProcReturn(sql, "Xt_DefineBillMainSet"); |
| | | |
| | | // if(ds!=null && ds.Tables[0].Rows.Count == 0) |
| | | // { |
| | | // sql = "select * from h_v_Xt_DefineBillMainSet_AutoLoadList where HModName ='" + HModName + "' and HUser ='admin' order by HArrangeOrder,HArrangeOrderSub"; |
| | | // ds = oCN.RunProcReturn(sql, "h_v_Xt_DefineBillMainSet_AutoLoadList"); |
| | | // } |
| | | |
| | | // 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 |
| | | } |
| | | } |