| New file |
| | |
| | | using System; |
| | | using System.Collections.Generic; |
| | | using Newtonsoft.Json; |
| | | using Newtonsoft.Json.Linq; |
| | | using Pub_Class; |
| | | using System; |
| | | using System.Collections; |
| | | using System.Collections.Generic; |
| | | using System.Data; |
| | | using System.Data.SqlClient; |
| | | using System.IO; |
| | | using System.Web.Http; |
| | | using WebAPI.DLL; |
| | | using WebAPI.Models; |
| | | using WebAPI.Service; |
| | | using Kingdee.BOS.WebApi.Client; |
| | | using System.Linq; |
| | | |
| | | namespace WebAPI.Controllers.åºç¡èµæ.åºç¡èµæ |
| | | { |
| | | |
| | | |
| | | public class Gy_MultipleCode_ReportController : ApiController |
| | | { |
| | | private json objJsonResult = new json(); |
| | | public DataSet ds = new DataSet(); |
| | | public SQLHelper.ClsCN oCN = new SQLHelper.ClsCN(); |
| | | [Route("Gy_MultipleCode_ReportController/getList")] |
| | | [HttpGet] |
| | | public object getList(string sWhere, string HBeginDate, string HEndDate) |
| | | { |
| | | List<object> columnNameList = new List<object>(); |
| | | try |
| | | { |
| | | // éªè¯æ¥æ |
| | | if (!DateTime.TryParse(HBeginDate, out DateTime beginDate) || !DateTime.TryParse(HEndDate, out DateTime endDate)) |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "æ¥ææ ¼å¼ä¸æ£ç¡®"; |
| | | return objJsonResult; |
| | | |
| | | } |
| | | if(sWhere!=null) |
| | | ds = oCN.RunProcReturn($"select * from h_v_Gy_MultipleCodes_onOne where æ¥æ<='{HEndDate}' and æ¥æ>='{HBeginDate}' {sWhere}", "h_v_Gy_MultipleCodes_onOne"); |
| | | else |
| | | ds = oCN.RunProcReturn($"select * from h_v_Gy_MultipleCodes_onOne where æ¥æ<='{HEndDate}' and æ¥æ>='{HBeginDate}'", "h_v_Gy_MultipleCodes_onOne"); |
| | | // æ·»å åå |
| | | 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)); |
| | | } |
| | | |
| | | objJsonResult.code = "1"; |
| | | objJsonResult.count = ds.Tables[0].Rows.Count; |
| | | objJsonResult.Message = "Successï¼"; |
| | | 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; |
| | | } |
| | | |
| | | |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | } |
| | | } |