From 55a56d0c8709e87275cd96caf7766b4249d6e3fb Mon Sep 17 00:00:00 2001 From: pzy <2829717936@qq.com> Date: 星期日, 11 八月 2024 15:59:44 +0800 Subject: [PATCH] 1 --- WebAPI/Controllers/SCGL/Sc_MESTransFerWorkBillController.cs | 380 +++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 files changed, 375 insertions(+), 5 deletions(-) diff --git a/WebAPI/Controllers/SCGL/Sc_MESTransFerWorkBillController.cs b/WebAPI/Controllers/SCGL/Sc_MESTransFerWorkBillController.cs index 0d3a324..b0a1306 100644 --- a/WebAPI/Controllers/SCGL/Sc_MESTransFerWorkBillController.cs +++ b/WebAPI/Controllers/SCGL/Sc_MESTransFerWorkBillController.cs @@ -534,11 +534,12 @@ A.HLevel,A.HMaterNumber,A.HMaterName,A.HMaterModel, B.HReadFlag, A.HMaker,A.HMakeDate,A.HUpDater,A.HUpDateDate,A.HChecker,A.HCheckDate,A.HCloseMan,A.HCloseDate,A.HDeleteMan,A.HDeleteDate, A.HSourceInterID,A.HSourceEntryID,A.HSourceBillNo,A.HSourceBillType, - A.HHandleEmpID,f.HName HHandleEmpName + A.HHandleEmpID,f.HName HHandleEmpName,A.HErrMsgBackTypeID,g.HName HErrMsgBackTypeName from OA_ErrMsgBackBillMain A inner join OA_ErrMsgBackBillSub2 B on A.HInterID=B.HInterID left join Gy_Department D on A.HDeptID=D.HItemID - left join Gy_Employee f on A.HHandleEmpID=f.HItemID + left join Gy_Employee f on A.HHandleEmpID=f.HItemID + left join Gy_ErrMsgBackType g on A.HErrMsgBackTypeID=g.HItemID where A.HInterID='" + HID + "' and b.HEntryID='" + HEntryID + "'"); var dataSet = oCN.RunProcReturn(sql, "OA_ErrMsgBackBillMain"); if (dataSet == null || dataSet.Tables[0].Rows.Count == 0) @@ -1027,6 +1028,7 @@ { bResult = oBill.AddBill(ref DBUtility.ClsPub.sExeReturnInfo); + _ = SendDingDingAsync(oBill.omodel.HSendMan, oBill.omodel.HHandleEmpID,oBill.omodel.HDescription,""); } else if (refSav == "Update") { @@ -2001,6 +2003,7 @@ { bResult = oBill.AddBill(ref DBUtility.ClsPub.sExeReturnInfo); + _ = SendDingDingAsync(oBill.omodel.HSendMan, 1, oBill.omodel.HDescription, oBill.omodel.HReceiveMan); } else if (refSav == "Update") { @@ -2917,6 +2920,7 @@ { bResult = oBill.AddBill(ref DBUtility.ClsPub.sExeReturnInfo); + _ = SendDingDingAsync(oBill.omodel.HSendMan, 1, oBill.omodel.HDescription, oBill.omodel.HReceiveMan); } else if (refSav == "Update") { @@ -3830,6 +3834,7 @@ { bResult = oBill.AddBill(ref DBUtility.ClsPub.sExeReturnInfo); + _ = SendDingDingAsync(oBill.omodel.HReceiveMan, 0, oBill.omodel.HDescription, oBill.omodel.HCopyMan); } else if (refSav == "Update") { @@ -4809,8 +4814,8 @@ { List<object> columnNameList = new List<object>(); - string sql = "select * from h_v_OA_AndengFlowRuleBillMainList where hmainid='" + HID + "'"; - ds = oCN.RunProcReturn(sql, "h_v_OA_AndengFlowRuleBillMainList"); + string sql = "select * from h_v_OA_AndengFlowRuleBillMainEdit where hmainid='" + HID + "'"; + ds = oCN.RunProcReturn(sql, "h_v_OA_AndengFlowRuleBillMainEdit"); //娣诲姞鍒楀悕 foreach (DataColumn col in ds.Tables[0].Columns) @@ -6606,7 +6611,118 @@ #endregion - + + #region 寮傚父鍙嶉 鎺ユ敹,澶勭悊,楠屾敹鍗曚繚瀛樺彂閫佹秷鎭� + /// <summary> + /// 寮傚父鍙嶉 鎺ユ敹,澶勭悊,楠屾敹鍗曚繚瀛樺彂閫佹秷鎭� + /// </summary> + /// <param name="HSendMan"></param> + /// <param name="HHandleEmpID"></param> + /// <param name="HDescription"></param> + /// <param name="HCopyMan"></param> + /// <returns></returns> + public async Task<object> SendDingDingAsync(string HSendMan, int HHandleEmpID,string HDescription,string HCopyMan) + { + + string concatenatedNames = ""; + string appKey = ""; + string appSecret = ""; + string sReturn = ""; + string agentIds = ""; + Cls_DDMsg msg = new Cls_DDMsg(); + if (oSystemParameter.ShowBill(ref sReturn) == true) + { + //绯荤粺鍙傛暟鏄惁 N涓烘湰鍦帮紝Y涓烘柉鑾皵 + if (oSystemParameter.omodel.OA_ErrMsgBackBill_SendDingDingMsg == "N") + { + appKey = "dingrsrzhdyn3mlaof95"; + appSecret = "RAqH6YtZnPLCpDbuqfaYQkKkVtVdS0wqfC8I26X6qiS-8eoCJCNrzx3fubGND4Sq"; + agentIds = "3118119317"; + } + else if (oSystemParameter.omodel.OA_ErrMsgBackBill_SendDingDingMsg == "Y") + { + appKey = "dingkdddbhdcssk7jduw"; + appSecret = "iv07c-GLfJPnzfJaNAAOfJDl3Z-eODvDAhlInMZCZhGorkle5Evbaxx3ImylvdjQ"; + agentIds = "3151454458"; + } + + } + + if (HHandleEmpID==0) //寮傚父鍙嶉楠屾敹鍗曚繚瀛� 灏嗘秷鎭� 鍙戦�佺粰 鎺ユ敹浜猴紝鎸囨淳澶勭悊浜猴紝鍏ㄩ儴鎶勯�佷汉 + { + string HReceiveMan = HSendMan; + string[] names = HCopyMan.Split(','); + string sqlNames = ""; + foreach (string name in names) + { + sqlNames += "'" + name.Trim() + "',"; + } + sqlNames = sqlNames.TrimEnd(','); + //鑾峰彇鎸囨淳澶勭悊浜�,鍙戦�佷汉鐨勯拤閽塱d + string sql1 = "select HDingDingUserID 閽夐拤id from Gy_Czygl where Czymc in ('" + HReceiveMan + "'," + sqlNames + ")"; + ds = oCN.RunProcReturn(sql1, "Gy_Czygl"); + List<string> HNames = new List<string>(); + for (int i = 0; i < ds.Tables[0].Rows.Count; i++) + { + string HName = ds.Tables[0].Rows[i]["閽夐拤id"].ToString(); + HNames.Add(HName); + + } + concatenatedNames = string.Join(",", HNames); + } + else if (HHandleEmpID==1)//寮傚父鍙嶉绛惧埌鍗�,寮傚父鍙嶉澶勭悊鍗� 灏嗘秷鎭� 鍙戦�佺粰 鍙戦�佷汉锛屾帴鏀朵汉 + { + //鑾峰彇鍙戦�佷汉 鎺ユ敹浜� + string HReceiveMan = HCopyMan; + string sql1 = "select HDingDingUserID 閽夐拤id from Gy_Czygl where Czymc in ('" + HSendMan + "','" + HReceiveMan + "')"; + ds = oCN.RunProcReturn(sql1, "Gy_Czygl"); + List<string> HNames = new List<string>(); + for (int i = 0; i < ds.Tables[0].Rows.Count; i++) + { + string HName = ds.Tables[0].Rows[i]["閽夐拤id"].ToString(); + HNames.Add(HName); + + } + concatenatedNames = string.Join(",", HNames); + } + else + { + //鏌ヨ鎸囨淳澶勭悊浜� + string sql = "select HName from Gy_Employee where HItemID='" + HHandleEmpID + "'"; + ds = oCN.RunProcReturn(sql, "Gy_Employee"); + string HHandleEmpName = ds.Tables[0].Rows[0]["HName"].ToString(); + //鑾峰彇鎸囨淳澶勭悊浜�,鍙戦�佷汉鐨勯拤閽塱d + string sql1 = "select HDingDingUserID 閽夐拤id from Gy_Czygl where Czymc in ('" + HSendMan + "','" + HHandleEmpName + "')"; + LogService.CustomWriteLog("10鍙傛暟" + sql1, "寮傚父缃氭"); + ds = oCN.RunProcReturn(sql1, "Gy_Czygl"); + List<string> HNames = new List<string>(); + for (int i = 0; i < ds.Tables[0].Rows.Count; i++) + { + string HName = ds.Tables[0].Rows[i]["閽夐拤id"].ToString(); + HNames.Add(HName); + + } + concatenatedNames = string.Join(",", HNames); + LogService.CustomWriteLog("9鍙傛暟" + concatenatedNames, "寮傚父缃氭"); + } + + //鑾峰彇浼佷笟鐨刟ccess_token鐨勫�� + string response = msg.GetAccessToken(appKey, appSecret); + JObject responseJson = JObject.Parse(response); + // 鑾峰彇access_token鐨勫�� + string accessToken = responseJson["accessToken"].ToString(); + + //璋冪敤鏂规硶鍙戦�佹秷鎭� + string agentId = agentIds;//閽夐拤鍚庡彴寤虹珛鐨勫皬绋嬪簭id + string userIdList = concatenatedNames;//閽夐拤浜哄憳鐨刬d + string deptIdList = "0"; // 绌哄瓧绗︿覆琛ㄧず涓嶆寚瀹氶儴闂� + string toAllUser = "false"; + string message = HDescription; + response = await msg.SendTextMessage(accessToken, agentId, userIdList, deptIdList, toAllUser, message); + Console.WriteLine(response); + return response; + } + #endregion #region 寮傚父鍙嶉鍗曟煡璇紙鎺ユ敹鐨勶紝鍙戦�佺殑锛屾妱閫佺殑锛� @@ -6657,5 +6773,259 @@ } #endregion + #region 鎶ュ伐鍙拌烦杞紓甯稿弽棣堝崟 寮圭獥鑾峰彇鐢熶骇鐘舵�佷复鏃惰〃鐨� 鐗╂枡 鏁伴噺 淇℃伅 + + [Route("Sc_MESTransFerWorkBill/Get_Sc_ICMOBillStatus")] + [HttpGet] + public object Get_Sc_ICMOBillStatus(string HSourceBill) + { + try + { + List<object> columnNameList = new List<object>(); + + string sql = "select a.HSourceBillNo 娴佽浆鍗″彿,a.HSourceBillType 娴佽浆鍗$被鍨�,a.HSourceInterID 娴佽浆鍗′富鍐呯爜,a.HSourceEntryID 娴佽浆鍗″瓙鍐呯爜,b.HNumber 鐗╂枡浠g爜,b.HName 鐗╂枡鍚嶇О,b.HModel 瑙勬牸鍨嬪彿,a.HPlanQty 璁″垝鏁伴噺 from Sc_ICMOBillStatus_Tmp a left join Gy_Material b on a.HMaterID=b.HItemID where HSourceBillNo='" + HSourceBill + "'"; + ds = oCN.RunProcReturn(sql, "Sc_ICMOBillStatus_Tmp"); + + //娣诲姞鍒楀悕 + 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));//鑾峰彇鍒癉ataColumn鍒楀璞$殑鍒楀悕 + } + + objJsonResult.code = "1"; + objJsonResult.count = 1; + objJsonResult.Message = "Sucess锛�"; + objJsonResult.data = ds.Tables[0]; + objJsonResult.list = columnNameList; + return objJsonResult; + } + catch (Exception ex) + { + objJsonResult.code = "0"; + objJsonResult.count = 0; + objJsonResult.Message = "鏌ヨ鏁版嵁寮傚父锛岃涓庣鐞嗗憳鑱旂郴锛�" + ex.ToString(); + objJsonResult.data = null; + return objJsonResult; + } + } + #endregion + + #region 鎶ュ伐鍙拌烦杞紓甯稿弽棣堝崟 寮圭獥鑾峰彇 寮傚父绫诲瀷 + + [Route("Sc_MESTransFerWorkBill/Get_ErrMsgBackType")] + [HttpGet] + public object Get_ErrMsgBackType(string TypeName) + { + try + { + List<object> columnNameList = new List<object>(); + + string sql = "select HItemID,HName from Gy_ErrMsgBackType where HName='" + TypeName + "'"; + ds = oCN.RunProcReturn(sql, "Gy_ErrMsgBackType"); + + //娣诲姞鍒楀悕 + 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));//鑾峰彇鍒癉ataColumn鍒楀璞$殑鍒楀悕 + } + + objJsonResult.code = "1"; + objJsonResult.count = 1; + objJsonResult.Message = "Sucess锛�"; + objJsonResult.data = ds.Tables[0]; + objJsonResult.list = columnNameList; + return objJsonResult; + } + catch (Exception ex) + { + objJsonResult.code = "0"; + objJsonResult.count = 0; + objJsonResult.Message = "鏌ヨ鏁版嵁寮傚父锛岃涓庣鐞嗗憳鑱旂郴锛�" + ex.ToString(); + objJsonResult.data = null; + return objJsonResult; + } + } + #endregion + + #region 鎶ュ伐鍙拌烦杞紓甯稿弽棣堝崟 寮圭獥鑾峰彇 褰撳墠浜虹殑涓婄骇 + + [Route("Sc_MESTransFerWorkBill/Get_UserSuperiors")] + [HttpGet] + public object Get_UserSuperiors(string HName) + { + try + { + //string sReturn = ""; + List<object> columnNameList = new List<object>(); + //鏍规嵁褰撳墠浜鸿幏鍙栬亴鍔� + string sql = "select a.Czymc 鐢ㄦ埛鍚嶇О,c.GroupName 鑱屽姟 from Gy_Czygl a left join System_UserGroupInfo b on a.Czybm = b.UserId left join System_UserGroup c on b.GroupId = c.GroupID where a.Czymc = '"+HName+"'"; + ds = oCN.RunProcReturn(sql, "Gy_ErrMsgBackType"); + string Job = ds.Tables[0].Rows[0]["鑱屽姟"].ToString(); + if (Job=="娉ㄥ鐝粍闀�" || Job=="鍚庡鐞嗙彮缁勯暱") + { + //鏍规嵁鑱屽姟鎵惧埌浠栫殑涓嬬骇,缁欏彂閫佷汉榛樿涓虹彮缁勯暱涔嬩笅 + string sql1 = "select * from Gy_Duty where HParentID =(select HItemID from Gy_Duty group by HItemID, HName having HName = '"+Job+"' and count(*) = 1)"; + ds = oCN.RunProcReturn(sql1, "Gy_Duty"); + } + else + { + //鏍规嵁鑱屽姟鎵惧埌浠栫殑涓婄骇 + string sql2 = "select * from Gy_Duty where HItemID =(select HParentID from Gy_Duty group by HParentID, HName having HName = '" + Job + "' and count(*) = 1)"; + ds = oCN.RunProcReturn(sql2, "Gy_Duty"); + } + string Job1= ds.Tables[0].Rows[0]["HName"].ToString(); + //鐢ㄨ亴鍔℃壘鍒扮敤鎴� + string sql3 = "select a.Czymc 鐢ㄦ埛鍚嶇О,c.GroupName 鑱屽姟 from Gy_Czygl a left join System_UserGroupInfo b on a.Czybm = b.UserId left join System_UserGroup c on b.GroupId = c.GroupID where c.GroupName = '" + Job1+"'"; + ds = oCN.RunProcReturn(sql3, "Gy_Czygl"); + //娣诲姞鍒楀悕 + 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));//鑾峰彇鍒癉ataColumn鍒楀璞$殑鍒楀悕 + } + + objJsonResult.code = "1"; + objJsonResult.count = 1; + objJsonResult.Message = "Sucess锛�"; + objJsonResult.data = ds.Tables[0]; + objJsonResult.list = columnNameList; + return objJsonResult; + } + catch (Exception ex) + { + objJsonResult.code = "0"; + objJsonResult.count = 0; + objJsonResult.Message = "鏌ヨ鏁版嵁寮傚父锛岃涓庣鐞嗗憳鑱旂郴锛�" + ex.ToString(); + objJsonResult.data = null; + return objJsonResult; + } + } + #endregion + + #region 寮傚父鍙嶉鍗� 璺熻釜鏌ヨ + [Route("Sc_MESTransFerWorkBill/GetErrMsgBackResumeList")] + [HttpGet] + public object GetErrMsgBackResumeList(string HInterID, string user) + { + try + { + List<object> columnNameList = new List<object>(); + if (!DBUtility.ClsPub.Security_Log("OA_ErrMsgBackBill_Query", 1, false, user)) + { + objJsonResult.code = "0"; + objJsonResult.count = 0; + objJsonResult.Message = "娌℃湁鏌ョ湅鏉冮檺"; + objJsonResult.data = null; + return objJsonResult; + } + + ds = oCN.RunProcReturn($@"select a.HInterID,a.HDate '鏃ユ湡',a.HBillType,x.HName 鍗曟嵁绫诲瀷,a.HBillNo as '鍗曟嵁鍙�', + CASE WHEN a.HBillStatus <= 1 THEN '鍒涘缓' WHEN a.HBillStatus = 2 THEN '宸插鏍�' WHEN a.HBillStatus = 3 AND + a.HCloseType = 0 THEN '鑷姩鍏抽棴' WHEN a.HBillStatus = 3 AND + a.HCloseType = 1 THEN '鎵嬪姩鍏抽棴' WHEN a.HBillStatus = 4 THEN '宸蹭綔搴�' ELSE '鍏跺畠鐘舵��' END AS 鍗曟嵁鐘舵��, + a.HSendMan AS 鍙戦�佷汉,a.HReceiveMan AS 鎺ユ敹浜�,a.HCopyMan AS 鎶勯�佷汉,a.HLevel AS 绱ф�ョ▼搴�,a.HContext AS 涓婚,a.HDescription AS 鍐呭,a.HErrMsgBackTypeID,b.HName AS 寮傚父绫诲瀷, + a.HMaker AS 鍒跺崟浜�, a.HMakeDate AS 鍒跺崟鏃ユ湡,a.HChecker AS 瀹℃牳浜�, a.HCheckDate AS 瀹℃牳鏃ユ湡, a.HUpDater AS 淇敼浜�, a.HUpDateDate AS 淇敼鏃ユ湡, + a.HCloseMan AS 鍏抽棴浜�, a.HCloseDate AS 鍏抽棴鏃ユ湡, a.HDeleteMan AS 浣滃簾浜�, a.HDeleteDate AS 浣滃簾鏃ユ湡 + from ( + select HInterID,HDate,HBillType,HBillNo,HBillStatus,HMaker,HMakeDate,HChecker,HCheckDate,HUpDater,HUpDateDate,HCloseMan,HCloseDate,HDeleteMan,HDeleteDate,HCloseType,HSendMan,HReceiveMan,HCopyMan,HLevel,HContext,HDescription,HErrMsgBackTypeID from OA_ErrMsgBackBillMain where HInterID = {HInterID} UNION ALL + select HInterID,HDate,HBillType,HBillNo,HBillStatus,HMaker,HMakeDate,HChecker,HCheckDate,HUpDater,HUpDateDate,HCloseMan,HCloseDate,HDeleteMan,HDeleteDate,HCloseType,HSendMan,HReceiveMan,HCopyMan,HLevel,HContext,HDescription,HErrMsgBackTypeID from OA_ErrMsgBackReceiveBillMain where HMainSourceInterID = {HInterID} UNION ALL + select HInterID,HDate,HBillType,HBillNo,HBillStatus,HMaker,HMakeDate,HChecker,HCheckDate,HUpDater,HUpDateDate,HCloseMan,HCloseDate,HDeleteMan,HDeleteDate,HCloseType,HSendMan,HReceiveMan,HCopyMan,HLevel,HContext,HDescription,HErrMsgBackTypeID from OA_ErrMsgBackSignBillMain where HErrMsgBackInterID = {HInterID} UNION ALL + select HInterID,HDate,HBillType,HBillNo,HBillStatus,HMaker,HMakeDate,HChecker,HCheckDate,HUpDater,HUpDateDate,HCloseMan,HCloseDate,HDeleteMan,HDeleteDate,HCloseType,HSendMan,HReceiveMan,HCopyMan,HLevel,HContext,HDescription,HErrMsgBackTypeID from OA_ErrMsgBackHandleBillMain where HErrMsgBackInterID = {HInterID} UNION ALL + select HInterID,HDate,HBillType,HBillNo,HBillStatus,HMaker,HMakeDate,HChecker,HCheckDate,HUpDater,HUpDateDate,HCloseMan,HCloseDate,HDeleteMan,HDeleteDate,HCloseType,HSendMan,HReceiveMan,HCopyMan,HLevel,HContext,HDescription,HErrMsgBackTypeID from OA_ErrMsgBackCheckBillMain where HErrMsgBackInterID = {HInterID} + )as a,Xt_BillType as x,Gy_ErrMsgBackType as b + where a.HBillType = x.HNumber and a.HErrMsgBackTypeID = b.HItemID + ORDER BY '鏃ユ湡' ASC;", "OA_ErrMsgBackBillResume"); + + //娣诲姞鍔ㄦ�佸垪淇℃伅 + 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));//鑾峰彇鍒癉ataColumn鍒楀璞$殑鍒楀悕 + } + + 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("Sc_MESTransFerWorkBill/GetErrMsgBackResumeList")] + [HttpGet] + public object GetErrMsgBackResumeList(string HInterID,string sWhere,string user) + { + try + { + List<object> columnNameList = new List<object>(); + if (!DBUtility.ClsPub.Security_Log("OA_ErrMsgBackBill_Query", 1, false, user)) + { + objJsonResult.code = "0"; + objJsonResult.count = 0; + objJsonResult.Message = "娌℃湁鏌ョ湅鏉冮檺"; + objJsonResult.data = null; + return objJsonResult; + } + + ds = oCN.RunProcReturn($@"select * from + (select a.HInterID,a.HDate '鏃ユ湡',a.HBillType,x.HName 鍗曟嵁绫诲瀷,a.HBillNo as '鍗曟嵁鍙�', + CASE WHEN a.HBillStatus <= 1 THEN '鍒涘缓' WHEN a.HBillStatus = 2 THEN '宸插鏍�' WHEN a.HBillStatus = 3 AND + a.HCloseType = 0 THEN '鑷姩鍏抽棴' WHEN a.HBillStatus = 3 AND + a.HCloseType = 1 THEN '鎵嬪姩鍏抽棴' WHEN a.HBillStatus = 4 THEN '宸蹭綔搴�' ELSE '鍏跺畠鐘舵��' END AS 鍗曟嵁鐘舵��, + a.HSendMan AS 鍙戦�佷汉,a.HReceiveMan AS 鎺ユ敹浜�,a.HCopyMan AS 鎶勯�佷汉,a.HLevel AS 绱ф�ョ▼搴�,a.HContext AS 涓婚,a.HDescription AS 鍐呭,a.HErrMsgBackTypeID,b.HName AS 寮傚父绫诲瀷, + a.HMaker AS 鍒跺崟浜�, a.HMakeDate AS 鍒跺崟鏃ユ湡,a.HChecker AS 瀹℃牳浜�, a.HCheckDate AS 瀹℃牳鏃ユ湡, a.HUpDater AS 淇敼浜�, a.HUpDateDate AS 淇敼鏃ユ湡, + a.HCloseMan AS 鍏抽棴浜�, a.HCloseDate AS 鍏抽棴鏃ユ湡, a.HDeleteMan AS 浣滃簾浜�, a.HDeleteDate AS 浣滃簾鏃ユ湡 + from ( + select HInterID,HDate,HBillType,HBillNo,HBillStatus,HMaker,HMakeDate,HChecker,HCheckDate,HUpDater,HUpDateDate,HCloseMan,HCloseDate,HDeleteMan,HDeleteDate,HCloseType,HSendMan,HReceiveMan,HCopyMan,HLevel,HContext,HDescription,HErrMsgBackTypeID from OA_ErrMsgBackBillMain where HInterID = {HInterID} UNION ALL + select HInterID,HDate,HBillType,HBillNo,HBillStatus,HMaker,HMakeDate,HChecker,HCheckDate,HUpDater,HUpDateDate,HCloseMan,HCloseDate,HDeleteMan,HDeleteDate,HCloseType,HSendMan,HReceiveMan,HCopyMan,HLevel,HContext,HDescription,HErrMsgBackTypeID from OA_ErrMsgBackReceiveBillMain where HMainSourceInterID = {HInterID} UNION ALL + select HInterID,HDate,HBillType,HBillNo,HBillStatus,HMaker,HMakeDate,HChecker,HCheckDate,HUpDater,HUpDateDate,HCloseMan,HCloseDate,HDeleteMan,HDeleteDate,HCloseType,HSendMan,HReceiveMan,HCopyMan,HLevel,HContext,HDescription,HErrMsgBackTypeID from OA_ErrMsgBackSignBillMain where HErrMsgBackInterID = {HInterID} UNION ALL + select HInterID,HDate,HBillType,HBillNo,HBillStatus,HMaker,HMakeDate,HChecker,HCheckDate,HUpDater,HUpDateDate,HCloseMan,HCloseDate,HDeleteMan,HDeleteDate,HCloseType,HSendMan,HReceiveMan,HCopyMan,HLevel,HContext,HDescription,HErrMsgBackTypeID from OA_ErrMsgBackHandleBillMain where HErrMsgBackInterID = {HInterID} UNION ALL + select HInterID,HDate,HBillType,HBillNo,HBillStatus,HMaker,HMakeDate,HChecker,HCheckDate,HUpDater,HUpDateDate,HCloseMan,HCloseDate,HDeleteMan,HDeleteDate,HCloseType,HSendMan,HReceiveMan,HCopyMan,HLevel,HContext,HDescription,HErrMsgBackTypeID from OA_ErrMsgBackCheckBillMain where HErrMsgBackInterID = {HInterID} + )as a,Xt_BillType as x,Gy_ErrMsgBackType as b + where a.HBillType = x.HNumber and a.HErrMsgBackTypeID = b.HItemID ) AS a where 1=1 " + sWhere + + @" ORDER BY 鏃ユ湡 ASC;", "OA_ErrMsgBackBillResume"); + + //娣诲姞鍔ㄦ�佸垪淇℃伅 + 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));//鑾峰彇鍒癉ataColumn鍒楀璞$殑鍒楀悕 + } + + 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 } } \ No newline at end of file -- Gitblit v1.9.1