2025-03-28 09:49:56 +08:00

631 lines
27 KiB
C#
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

using System;
using System.Collections.Generic;
using System.Web.Http;
using System.Web.Http.Description;
using ESCG = CodeBuilderApi.GeneralMethod;
using ESCM = CodeBuilderApi.Model;
using Newtonsoft.Json;
using HZQR.Common;
namespace CodeBuilderApi.Controllers
{
/// <summary>
/// 数据字典相关接口
/// </summary>
public class DictionaryController : BaseController
{
#region ->
#region
/// <summary>
/// 获取枚举类型列表
/// </summary>
/// <param name="searchModel">查询条件对象</param>
/// <returns></returns>
[Route("Dictionary/GetEXPLAINTYPEList")]
[AcceptVerbs("POST")]
[ResponseType(typeof(Models.JsonMsg<Models.JsonList<ESCM.EXPLAINTYPEModel>>))]
public IHttpActionResult GetEXPLAINTYPEList(ESCM.SearchModel<ESCM.EXPLAINTYPEModel> searchModel)
{
string Parameter = "入参信息:" + JsonConvert.SerializeObject(searchModel);
try
{
int TotalCount = 0;
//获取枚举类型列表
List<ESCM.EXPLAINTYPEModel> EXPLAINTYPEList = ESCG.EXPLAINTYPEHelper.GetEXPLAINTYPEList(
transaction, ref TotalCount, searchModel);
//转化json形式
Models.JsonList<ESCM.EXPLAINTYPEModel> jsonList = Models.JsonList<ESCM.EXPLAINTYPEModel>.Success(
EXPLAINTYPEList, TotalCount, searchModel.PageIndex, searchModel.PageSize);
return Ok(Models.JsonMsg<Models.JsonList<ESCM.EXPLAINTYPEModel>>.Success(jsonList, 100, "查询成功"));
}
catch (Exception ex)
{
//事务回滚
transaction.Rollback();
LogUtil.WriteLog(null, "查询失败!失败原因:" + ex.Message + "\r\n" + Parameter,
DateTime.Now.ToString("yyyyMMdd") + "_GetEXPLAINTYPEList");
return Ok(Method.Common.ReturnJson(999, "查询失败" + ex.Message));
}
}
#endregion
#region
/// <summary>
/// 获取枚举类型明细
/// </summary>
/// <param name="EXPLAINTYPEId">枚举类型内码</param>
/// <returns></returns>
[Route("Dictionary/GetEXPLAINTYPEDetail")]
[AcceptVerbs("GET")]
[ResponseType(typeof(Models.JsonMsg<ESCM.EXPLAINTYPEModel>))]
public IHttpActionResult GetEXPLAINTYPEDetail(int EXPLAINTYPEId)
{
string Parameter = "入参信息:枚举类型内码【" + EXPLAINTYPEId + "】";
try
{
//获取枚举类型明细
ESCM.EXPLAINTYPEModel explaintypeModel = ESCG.EXPLAINTYPEHelper.GetEXPLAINTYPEDetail(transaction, EXPLAINTYPEId);
return Ok(Models.JsonMsg<ESCM.EXPLAINTYPEModel>.Success(explaintypeModel, 100, "查询成功"));
}
catch (Exception ex)
{
//事务回滚
transaction.Rollback();
LogUtil.WriteLog(null, "查询失败!失败原因:" + ex.Message + "\r\n" + Parameter,
DateTime.Now.ToString("yyyyMMdd") + "_GetEXPLAINTYPEDetail");
return Ok(Method.Common.ReturnJson(999, "查询失败" + ex.Message));
}
}
#endregion
#region
/// <summary>
/// 同步枚举类型
/// </summary>
/// <param name="explaintypeModel"></param>
/// <returns></returns>
[Route("Dictionary/SynchroEXPLAINTYPE")]
[AcceptVerbs("POST")]
[ResponseType(typeof(Models.JsonMsg<ESCM.EXPLAINTYPEModel>))]
public IHttpActionResult SynchroEXPLAINTYPE(ESCM.EXPLAINTYPEModel explaintypeModel)
{
try
{
//新增枚举类型
bool SynchroFlag = ESCG.EXPLAINTYPEHelper.SynchroEXPLAINTYPE(transaction, explaintypeModel);
if (SynchroFlag)
{
return Ok(Method.Common.ReturnJson(100, "同步成功", explaintypeModel));
}
else
{
return Ok(Method.Common.ReturnJson(200, "更新失败,数据不存在!"));
}
}
catch (Exception ex)
{
//事务回滚
transaction.Rollback();
LogUtil.WriteLog(null, "同步失败!失败原因:" + ex.Message,
DateTime.Now.ToString("yyyyMMdd") + "_SynchroEXPLAINTYPE");
return Ok(Method.Common.ReturnJson(999, "同步失败" + ex.Message));
}
}
#endregion
#region
/// <summary>
/// 删除枚举类型
/// </summary>
/// <param name="EXPLAINTYPEId">枚举类型内码</param>
/// <returns></returns>
[Route("Dictionary/DeleteEXPLAINTYPE")]
[AcceptVerbs("GET", "POST")]
[ResponseType(typeof(Models.JsonMsg<string>))]
public IHttpActionResult DeleteEXPLAINTYPE(int EXPLAINTYPEId)
{
string Parameter = "入参信息:枚举类型内码【" + EXPLAINTYPEId + "】";
try
{
//删除枚举类型
bool DeleteFlag = ESCG.EXPLAINTYPEHelper.DeleteEXPLAINTYPE(transaction, EXPLAINTYPEId);
if (DeleteFlag)
{
return Ok(Method.Common.ReturnJson(100, "删除成功"));
}
else
{
return Ok(Method.Common.ReturnJson(200, "删除失败,数据不存在!"));
}
}
catch (Exception ex)
{
//事务回滚
transaction.Rollback();
LogUtil.WriteLog(null, "删除失败!失败原因:" + ex.Message + "\r\n" + Parameter,
DateTime.Now.ToString("yyyyMMdd") + "_DeleteEXPLAINTYPE");
return Ok(Method.Common.ReturnJson(999, "删除失败" + ex.Message));
}
}
#endregion
#region
/// <summary>
/// 获取枚举类型嵌套列表
/// </summary>
/// <param name="EXPLAINTYPE_PID">上级分类</param>
/// <param name="SearchKey">模糊查询内容</param>
/// <returns></returns>
[Route("Dictionary/GetNestingEXPLAINTYPEList")]
[AcceptVerbs("GET")]
[ResponseType(typeof(Models.JsonMsg<Models.JsonList<ESCM.NestingModel<ESCM.EXPLAINTYPEModel>>>))]
public IHttpActionResult GetNestingEXPLAINTYPEList(string EXPLAINTYPE_PID = null, string SearchKey = null)
{
string Parameter = "入参信息:上级分类【" + EXPLAINTYPE_PID + "】模糊查询内容【" + SearchKey + "】";
try
{
//获取枚举类型嵌套列表
List<ESCM.NestingModel<ESCM.EXPLAINTYPEModel>> EXPLAINTYPEList = ESCG.EXPLAINTYPEHelper.GetNestingEXPLAINTYPEList(
transaction, EXPLAINTYPE_PID, SearchKey);
//转化json形式
Models.JsonList<ESCM.NestingModel<ESCM.EXPLAINTYPEModel>> jsonList =
Models.JsonList<ESCM.NestingModel<ESCM.EXPLAINTYPEModel>>.Success(EXPLAINTYPEList);
return Ok(Models.JsonMsg<Models.JsonList<ESCM.NestingModel<ESCM.EXPLAINTYPEModel>>>.Success(jsonList, 100, "查询成功"));
}
catch (Exception ex)
{
//事务回滚
transaction.Rollback();
LogUtil.WriteLog(null, "查询失败!失败原因:" + ex.Message + "\r\n" + Parameter,
DateTime.Now.ToString("yyyyMMdd") + "_GetNestingEXPLAINTYPEList");
return Ok(Method.Common.ReturnJson(999, "查询失败" + ex.Message));
}
}
#endregion
#region
/// <summary>
/// 获取枚举类型嵌套树
/// </summary>
/// <param name="EXPLAINTYPE_PID">上级分类</param>
/// <param name="SearchKey">模糊查询内容</param>
/// <returns></returns>
[Route("Dictionary/GetNestingEXPLAINTYPETree")]
[AcceptVerbs("GET")]
[ResponseType(typeof(Models.JsonMsg<Models.JsonList<ESCM.NestingModel<ESCM.CommonTypeModel>>>))]
public IHttpActionResult GetNestingEXPLAINTYPETree(string EXPLAINTYPE_PID = null, string SearchKey = null)
{
string Parameter = "入参信息:上级分类【" + EXPLAINTYPE_PID + "】模糊查询内容【" + SearchKey + "】";
try
{
//获取枚举类型嵌套树
List<ESCM.NestingModel<ESCM.CommonTypeModel>> EXPLAINTYPETree = ESCG.EXPLAINTYPEHelper.GetNestingEXPLAINTYPETree(
transaction, EXPLAINTYPE_PID, SearchKey);
//转化json形式
Models.JsonList<ESCM.NestingModel<ESCM.CommonTypeModel>> jsonList =
Models.JsonList<ESCM.NestingModel<ESCM.CommonTypeModel>>.Success(EXPLAINTYPETree);
return Ok(Models.JsonMsg<Models.JsonList<ESCM.NestingModel<ESCM.CommonTypeModel>>>.Success(jsonList, 100, "查询成功"));
}
catch (Exception ex)
{
//事务回滚
transaction.Rollback();
LogUtil.WriteLog(null, "查询失败!失败原因:" + ex.Message + "\r\n" + Parameter,
DateTime.Now.ToString("yyyyMMdd") + "_GetNestingEXPLAINTYPETree");
return Ok(Method.Common.ReturnJson(999, "查询失败" + ex.Message));
}
}
#endregion
#endregion
#region ->
#region
/// <summary>
/// 获取字段类型列表
/// </summary>
/// <param name="searchModel">查询条件对象</param>
/// <returns></returns>
[Route("Dictionary/GetFIELDEXPLAINList")]
[AcceptVerbs("POST")]
[ResponseType(typeof(Models.JsonMsg<Models.JsonList<ESCM.FIELDEXPLAINModel>>))]
public IHttpActionResult GetFIELDEXPLAINList(ESCM.SearchModel<ESCM.FIELDEXPLAINModel> searchModel)
{
string Parameter = "入参信息:" + JsonConvert.SerializeObject(searchModel);
try
{
int TotalCount = 0;
//获取字段类型列表
List<ESCM.FIELDEXPLAINModel> FIELDEXPLAINList = ESCG.FIELDEXPLAINHelper.GetFIELDEXPLAINList(
transaction, ref TotalCount, searchModel);
//转化json形式
Models.JsonList<ESCM.FIELDEXPLAINModel> jsonList = Models.JsonList<ESCM.FIELDEXPLAINModel>.Success(
FIELDEXPLAINList, TotalCount, searchModel.PageIndex, searchModel.PageSize);
return Ok(Models.JsonMsg<Models.JsonList<ESCM.FIELDEXPLAINModel>>.Success(jsonList, 100, "查询成功"));
}
catch (Exception ex)
{
//事务回滚
transaction.Rollback();
LogUtil.WriteLog(null, "查询失败!失败原因:" + ex.Message + "\r\n" + Parameter,
DateTime.Now.ToString("yyyyMMdd") + "_GetFIELDEXPLAINList");
return Ok(Method.Common.ReturnJson(999, "查询失败" + ex.Message));
}
}
#endregion
#region
/// <summary>
/// 获取字段类型明细
/// </summary>
/// <param name="FIELDEXPLAINId">字段类型内码</param>
/// <param name="FieldExplain">枚举字段英文名称</param>
/// <returns></returns>
[Route("Dictionary/GetFIELDEXPLAINDetail")]
[AcceptVerbs("GET")]
[ResponseType(typeof(Models.JsonMsg<ESCM.FIELDEXPLAINModel>))]
public IHttpActionResult GetFIELDEXPLAINDetail(int? FIELDEXPLAINId, string FieldExplain = "")
{
string Parameter = "入参信息:字段类型内码【" + FIELDEXPLAINId + "】";
try
{
//获取字段类型明细
ESCM.FIELDEXPLAINModel fieldexplainModel = ESCG.FIELDEXPLAINHelper.GetFIELDEXPLAINDetail(transaction, FIELDEXPLAINId, FieldExplain);
return Ok(Models.JsonMsg<ESCM.FIELDEXPLAINModel>.Success(fieldexplainModel, 100, "查询成功"));
}
catch (Exception ex)
{
//事务回滚
transaction.Rollback();
LogUtil.WriteLog(null, "查询失败!失败原因:" + ex.Message + "\r\n" + Parameter,
DateTime.Now.ToString("yyyyMMdd") + "_GetFIELDEXPLAINDetail");
return Ok(Method.Common.ReturnJson(999, "查询失败" + ex.Message));
}
}
#endregion
#region
/// <summary>
/// 同步字段类型
/// </summary>
/// <param name="fieldexplainModel"></param>
/// <returns></returns>
[Route("Dictionary/SynchroFIELDEXPLAIN")]
[AcceptVerbs("POST")]
[ResponseType(typeof(Models.JsonMsg<ESCM.FIELDEXPLAINModel>))]
public IHttpActionResult SynchroFIELDEXPLAIN(ESCM.FIELDEXPLAINModel fieldexplainModel)
{
try
{
//新增字段类型
bool SynchroFlag = ESCG.FIELDEXPLAINHelper.SynchroFIELDEXPLAIN(transaction, fieldexplainModel);
if (SynchroFlag)
{
return Ok(Method.Common.ReturnJson(100, "同步成功", fieldexplainModel));
}
else
{
return Ok(Method.Common.ReturnJson(200, "更新失败,数据不存在!"));
}
}
catch (Exception ex)
{
//事务回滚
transaction.Rollback();
LogUtil.WriteLog(null, "同步失败!失败原因:" + ex.Message,
DateTime.Now.ToString("yyyyMMdd") + "_SynchroFIELDEXPLAIN");
return Ok(Method.Common.ReturnJson(999, "同步失败" + ex.Message));
}
}
#endregion
#region
/// <summary>
/// 删除字段类型
/// </summary>
/// <param name="FIELDEXPLAINId">字段类型内码</param>
/// <returns></returns>
[Route("Dictionary/DeleteFIELDEXPLAIN")]
[AcceptVerbs("GET", "POST")]
[ResponseType(typeof(Models.JsonMsg<string>))]
public IHttpActionResult DeleteFIELDEXPLAIN(int FIELDEXPLAINId)
{
string Parameter = "入参信息:字段类型内码【" + FIELDEXPLAINId + "】";
try
{
//删除字段类型
bool DeleteFlag = ESCG.FIELDEXPLAINHelper.DeleteFIELDEXPLAIN(transaction, FIELDEXPLAINId);
if (DeleteFlag)
{
return Ok(Method.Common.ReturnJson(100, "删除成功"));
}
else
{
return Ok(Method.Common.ReturnJson(200, "删除失败,数据不存在!"));
}
}
catch (Exception ex)
{
//事务回滚
transaction.Rollback();
LogUtil.WriteLog(null, "删除失败!失败原因:" + ex.Message + "\r\n" + Parameter,
DateTime.Now.ToString("yyyyMMdd") + "_DeleteFIELDEXPLAIN");
return Ok(Method.Common.ReturnJson(999, "删除失败" + ex.Message));
}
}
#endregion
#endregion
#region ->
#region
/// <summary>
/// 获取字段枚举列表
/// </summary>
/// <param name="searchModel">查询条件对象</param>
/// <returns></returns>
[Route("Dictionary/GetFIELDENUMList")]
[AcceptVerbs("POST")]
[ResponseType(typeof(Models.JsonMsg<Models.JsonList<ESCM.FIELDENUMModel>>))]
public IHttpActionResult GetFIELDENUMList(ESCM.SearchModel<ESCM.FIELDENUMModel> searchModel)
{
string Parameter = "入参信息:" + JsonConvert.SerializeObject(searchModel);
try
{
int TotalCount = 0;
//获取字段枚举列表
List<ESCM.FIELDENUMModel> FIELDENUMList = ESCG.FIELDENUMHelper.GetFIELDENUMList(
transaction, ref TotalCount, searchModel);
//转化json形式
Models.JsonList<ESCM.FIELDENUMModel> jsonList = Models.JsonList<ESCM.FIELDENUMModel>.Success(
FIELDENUMList, TotalCount, searchModel.PageIndex, searchModel.PageSize);
return Ok(Models.JsonMsg<Models.JsonList<ESCM.FIELDENUMModel>>.Success(jsonList, 100, "查询成功"));
}
catch (Exception ex)
{
//事务回滚
transaction.Rollback();
LogUtil.WriteLog(null, "查询失败!失败原因:" + ex.Message + "\r\n" + Parameter,
DateTime.Now.ToString("yyyyMMdd") + "_GetFIELDENUMList");
return Ok(Method.Common.ReturnJson(999, "查询失败" + ex.Message));
}
}
#endregion
#region
/// <summary>
/// 获取字段枚举明细
/// </summary>
/// <param name="FIELDENUMId">字段枚举内码</param>
/// <returns></returns>
[Route("Dictionary/GetFIELDENUMDetail")]
[AcceptVerbs("GET")]
[ResponseType(typeof(Models.JsonMsg<ESCM.FIELDENUMModel>))]
public IHttpActionResult GetFIELDENUMDetail(int FIELDENUMId)
{
string Parameter = "入参信息:字段枚举内码【" + FIELDENUMId + "】";
try
{
//获取字段枚举明细
ESCM.FIELDENUMModel fieldenumModel = ESCG.FIELDENUMHelper.GetFIELDENUMDetail(transaction, FIELDENUMId);
return Ok(Models.JsonMsg<ESCM.FIELDENUMModel>.Success(fieldenumModel, 100, "查询成功"));
}
catch (Exception ex)
{
//事务回滚
transaction.Rollback();
LogUtil.WriteLog(null, "查询失败!失败原因:" + ex.Message + "\r\n" + Parameter,
DateTime.Now.ToString("yyyyMMdd") + "_GetFIELDENUMDetail");
return Ok(Method.Common.ReturnJson(999, "查询失败" + ex.Message));
}
}
#endregion
#region
/// <summary>
/// 同步字段枚举
/// </summary>
/// <param name="fieldenumModel"></param>
/// <returns></returns>
[Route("Dictionary/SynchroFIELDENUM")]
[AcceptVerbs("POST")]
[ResponseType(typeof(Models.JsonMsg<ESCM.FIELDENUMModel>))]
public IHttpActionResult SynchroFIELDENUM(ESCM.FIELDENUMModel fieldenumModel)
{
try
{
//新增字段枚举
bool SynchroFlag = ESCG.FIELDENUMHelper.SynchroFIELDENUM(transaction, fieldenumModel);
if (SynchroFlag)
{
return Ok(Method.Common.ReturnJson(100, "同步成功", fieldenumModel));
}
else
{
return Ok(Method.Common.ReturnJson(200, "更新失败,数据不存在!"));
}
}
catch (Exception ex)
{
//事务回滚
transaction.Rollback();
LogUtil.WriteLog(null, "同步失败!失败原因:" + ex.Message,
DateTime.Now.ToString("yyyyMMdd") + "_SynchroFIELDENUM");
return Ok(Method.Common.ReturnJson(999, "同步失败" + ex.Message));
}
}
#endregion
#region
/// <summary>
/// 删除字段枚举
/// </summary>
/// <param name="FIELDENUMId">字段枚举内码</param>
/// <returns></returns>
[Route("Dictionary/DeleteFIELDENUM")]
[AcceptVerbs("GET", "POST")]
[ResponseType(typeof(Models.JsonMsg<string>))]
public IHttpActionResult DeleteFIELDENUM(int FIELDENUMId)
{
string Parameter = "入参信息:字段枚举内码【" + FIELDENUMId + "】";
try
{
//删除字段枚举
bool DeleteFlag = ESCG.FIELDENUMHelper.DeleteFIELDENUM(transaction, FIELDENUMId);
if (DeleteFlag)
{
return Ok(Method.Common.ReturnJson(100, "删除成功"));
}
else
{
return Ok(Method.Common.ReturnJson(200, "删除失败,数据不存在!"));
}
}
catch (Exception ex)
{
//事务回滚
transaction.Rollback();
LogUtil.WriteLog(null, "删除失败!失败原因:" + ex.Message + "\r\n" + Parameter,
DateTime.Now.ToString("yyyyMMdd") + "_DeleteFIELDENUM");
return Ok(Method.Common.ReturnJson(999, "删除失败" + ex.Message));
}
}
#endregion
#region
/// <summary>
/// 获取字段枚举嵌套列表
/// </summary>
/// <param name="FIELDEXPLAIN_ID">字段类型</param>
/// <param name="FIELDENUM_PID">上级枚举</param>
/// <param name="SearchKey">模糊查询内容</param>
/// <returns></returns>
[Route("Dictionary/GetNestingFIELDENUMList")]
[AcceptVerbs("GET")]
[ResponseType(typeof(Models.JsonMsg<Models.JsonList<ESCM.NestingModel<ESCM.FIELDENUMModel>>>))]
public IHttpActionResult GetNestingFIELDENUMList(string FIELDEXPLAIN_ID, string FIELDENUM_PID = null, string SearchKey = null)
{
string Parameter = "入参信息:上级枚举【" + FIELDENUM_PID + "】模糊查询内容【" + SearchKey + "】";
try
{
//获取字段枚举嵌套列表
List<ESCM.NestingModel<ESCM.FIELDENUMModel>> FIELDENUMList = ESCG.FIELDENUMHelper.GetNestingFIELDENUMList(
transaction, FIELDEXPLAIN_ID, FIELDENUM_PID, SearchKey);
//转化json形式
Models.JsonList<ESCM.NestingModel<ESCM.FIELDENUMModel>> jsonList =
Models.JsonList<ESCM.NestingModel<ESCM.FIELDENUMModel>>.Success(FIELDENUMList);
return Ok(Models.JsonMsg<Models.JsonList<ESCM.NestingModel<ESCM.FIELDENUMModel>>>.Success(jsonList, 100, "查询成功"));
}
catch (Exception ex)
{
//事务回滚
transaction.Rollback();
LogUtil.WriteLog(null, "查询失败!失败原因:" + ex.Message + "\r\n" + Parameter,
DateTime.Now.ToString("yyyyMMdd") + "_GetNestingFIELDENUMList");
return Ok(Method.Common.ReturnJson(999, "查询失败" + ex.Message));
}
}
#endregion
#region
/// <summary>
/// 获取字段枚举嵌套树
/// </summary>
/// <param name="FIELDEXPLAIN_ID">字段类型</param>
/// <param name="FIELDENUM_PID">上级枚举</param>
/// <param name="SearchKey">模糊查询内容</param>
/// <returns></returns>
[Route("Dictionary/GetNestingFIELDENUMTree")]
[AcceptVerbs("GET")]
[ResponseType(typeof(Models.JsonMsg<Models.JsonList<ESCM.NestingModel<ESCM.CommonTypeModel>>>))]
public IHttpActionResult GetNestingFIELDENUMTree(string FIELDEXPLAIN_ID, string FIELDENUM_PID = null, string SearchKey = null)
{
string Parameter = "入参信息:上级枚举【" + FIELDENUM_PID + "】模糊查询内容【" + SearchKey + "】";
try
{
//获取字段枚举嵌套树
List<ESCM.NestingModel<ESCM.CommonTypeModel>> FIELDENUMTree = ESCG.FIELDENUMHelper.GetNestingFIELDENUMTree(
transaction, FIELDEXPLAIN_ID, FIELDENUM_PID, SearchKey);
//转化json形式
Models.JsonList<ESCM.NestingModel<ESCM.CommonTypeModel>> jsonList =
Models.JsonList<ESCM.NestingModel<ESCM.CommonTypeModel>>.Success(FIELDENUMTree);
return Ok(Models.JsonMsg<Models.JsonList<ESCM.NestingModel<ESCM.CommonTypeModel>>>.Success(jsonList, 100, "查询成功"));
}
catch (Exception ex)
{
//事务回滚
transaction.Rollback();
LogUtil.WriteLog(null, "查询失败!失败原因:" + ex.Message + "\r\n" + Parameter,
DateTime.Now.ToString("yyyyMMdd") + "_GetNestingFIELDENUMTree");
return Ok(Method.Common.ReturnJson(999, "查询失败" + ex.Message));
}
}
#endregion
#endregion
#region
/// <summary>
/// 获取枚举字段嵌套树
/// </summary>
/// <param name="valueType">枚举字段值类型0【字典内码】1【字典英文】</param>
/// <param name="EXPLAINTYPE_PID">上级分类</param>
/// <param name="SearchKey">模糊查询内容</param>
/// <returns></returns>
[Route("Dictionary/GetFieldExplainDDL")]
[AcceptVerbs("GET")]
[ResponseType(typeof(Models.JsonMsg<Models.JsonList<ESCM.NestingModel<ESCM.CommonTypeTreeModel>>>))]
public IHttpActionResult GetFieldExplainDDL(int valueType, string EXPLAINTYPE_PID = "-1", string SearchKey = null)
{
string Parameter = "入参信息:枚举字段值类型【" + valueType + "】," +
"上级分类【" + EXPLAINTYPE_PID + "】模糊查询内容【" + SearchKey + "】";
try
{
//获取枚举类型嵌套树
List<ESCM.NestingModel<ESCM.CommonTypeTreeModel>> EXPLAINTYPETree = ESCG.EXPLAINTYPEHelper.GetFieldExplainDDL(
transaction, valueType, EXPLAINTYPE_PID, SearchKey);
//转化json形式
Models.JsonList<ESCM.NestingModel<ESCM.CommonTypeTreeModel>> jsonList =
Models.JsonList<ESCM.NestingModel<ESCM.CommonTypeTreeModel>>.Success(EXPLAINTYPETree);
return Ok(Models.JsonMsg<Models.JsonList<ESCM.NestingModel<ESCM.CommonTypeTreeModel>>>.Success(jsonList, 100, "查询成功"));
}
catch (Exception ex)
{
//事务回滚
transaction.Rollback();
LogUtil.WriteLog(null, "查询失败!失败原因:" + ex.Message + "\r\n" + Parameter,
DateTime.Now.ToString("yyyyMMdd") + "_GetFieldExplainDDL");
return Ok(Method.Common.ReturnJson(999, "查询失败" + ex.Message));
}
}
#endregion
}
}