009_DI-Elec/Learun.Application.Web/AppApi/LookupTableApiController.cs

106 lines
3.0 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.Data.Entity.Core.Metadata.Edm;
using System.IO;
using System.Linq;
using System.Security.Cryptography;
using System.Text;
using System.Web;
using System.Web.Http;
using Common.Logging;
using DocumentFormat.OpenXml.Spreadsheet;
using Learun.Application.Base.SystemModule;
using Learun.Application.Organization;
using Learun.Application.TwoDevelopment.ZZDT_EC;
using Learun.Application.TwoDevelopment.ZZDT_EC.ec_lookup;
using Learun.Loger;
using Learun.Util;
using Learun.Util.Operat;
using Learun.Util.SqlSugar;
using log4net.Config;
using NPOI.SS.Formula.Functions;
using Pipelines.Sockets.Unofficial.Arenas;
namespace Learun.Application.Web.AppApi
{
/// <summary>
/// 通知消息的接口By YuXH
/// </summary>
[RoutePrefix("api/LookupTableApi")]
[HandlerApiLogin(FilterMode.Enforce)]
public class LookupTableApiController : WebApiControllerBase
{
ec_REFLOOKUPTABLEBLL bll = new ec_REFLOOKUPTABLEBLL();
public LookupTableApiController()
{
}
/// <summary>
///
/// </summary>
/// <param name="ProjectId"></param>
/// <returns></returns>
[HttpGet]
public IHttpActionResult GetAll(string ProjectId)
{
var res = bll.GetList(ProjectId);
return Success(res);
}
/// <summary>
///
/// </summary>
/// <param name="ProjectId"></param>
/// <returns></returns>
[HttpPost]
public IHttpActionResult AddLookupTable(string ProjectId)
{
var asyncContent = Request.Content.ReadAsStringAsync().Result;
var entity = asyncContent.ToObject<EC_REFLOOKUPTABLE>();
var res = bll.AddLookupTable(ProjectId, entity);
return Success(res);
}
/// <summary>
///
/// </summary>
/// <param name="ProjectId"></param>
/// <returns></returns>
[HttpPost]
public IHttpActionResult AddLookupTableData(string ProjectId)
{
var asyncContent = Request.Content.ReadAsStringAsync().Result;
var entity = asyncContent.ToObject<List<ec_REFLOOKUPTABLEData>>();
var res = bll.AddLookupTableData(ProjectId, entity);
return Success(res);
}
/// <summary>
///
/// </summary>
/// <param name="ProjectId"></param>
/// <returns></returns>
[HttpGet]
public IHttpActionResult GetStructure(string ProjectId, string lookupTableId)
{
var res = bll.GetLookupTableStructure(ProjectId, lookupTableId);
return Success(res);
}
/// <summary>
///
/// </summary>
/// <param name="ProjectId"></param>
/// <returns></returns>
[HttpGet]
public IHttpActionResult GetData(string ProjectId, string lookupTableId)
{
var res = bll.GetLookupDataRecord(ProjectId, lookupTableId);
return Success(res);
}
}
}