duhe
2023-08-08 bb09ad7c389f6100f6d3b9882ec377ebb3dab9a1
WebAPI/Controllers/¹¤×ʹÜÀí/Pay_DuSubsidyItemBillController.cs
@@ -1369,5 +1369,51 @@
        }
        #endregion
        #endregion
        #region æ‰£è¡¥é¡¹ç›®è´¹ç”¨å•_费用横向显示 èŽ·å–æ‰£è¡¥é¡¹ç›®
        [Route("Pay_DuSubsidyItemBill_KS/getInitGrid_KS")]
        [HttpGet]
        public object getInitGrid_KS()
        {
            try
            {
                //获取未禁用的扣补项目
                string sql = "select * from Gy_DuSubsidyItem where HStopFlag = 0";
                ds = oCN.RunProcReturn(sql, "Gy_DuSubsidyItem");
                if (ds == null || ds.Tables[0].Rows.Count == 0)
                {
                    objJsonResult.code = "0";
                    objJsonResult.count = 0;
                    objJsonResult.Message = "未找到相关扣补项目!";
                    objJsonResult.data = null;
                    return objJsonResult;
                }
                //处理扣补项目
                List<object> columnNameList = new List<object>();
                for(int i = 0; i < ds.Tables[0].Rows.Count; i++)
                {
                    string field = ds.Tables[0].Rows[i]["HItemID"].ToString();
                    string title = ds.Tables[0].Rows[i]["HName"].ToString();
                    string dataType = "decimal(18,2)";
                    string ColmString = "{\"field\":\"" + field + "\",\"title\":\"" + title + "\",\"dataType\":\"" + dataType + "\"}";
                    columnNameList.Add(JsonConvert.DeserializeObject(ColmString));
                }
                objJsonResult.code = "1";
                objJsonResult.count = 1;
                objJsonResult.Message = "Sucess!";
                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
    }
}