You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

241 lines
6.8 KiB
C#

11 months ago
using Common.Utilities;
11 months ago
using djy.IService.Afr;
using djy.Model.AmsDto;
11 months ago
using djy_AfrApi.Attributes;
using Microsoft.AspNetCore.Authorization;
11 months ago
using Microsoft.AspNetCore.Mvc;
using System;
using System.Collections.Generic;
namespace djy_AfrApi.Controllers.Common
{
11 months ago
[Route("api/[controller]")]
[ApiController]
[Authorize]
11 months ago
public class CommonController
{
11 months ago
private readonly IAfrService ser;
public CommonController(IAfrService service)
{
this.ser = service;
}
11 months ago
#region 下拉接口
/// <summary>
/// 下拉获取国家
/// </summary>
/// <returns></returns>
[HttpGet("GetCountry")]
11 months ago
[RedisCaching]
11 months ago
public Response<List<CommonCNEN>> GetCountry(string strlink = "", int page = 0, int limit = 0)
{
var result = new Response<List<CommonCNEN>>();
try
{
result.Result = ser.GetCountry(strlink, page, limit);
}
catch (Exception ex)
{
result.Code = 500;
result.Message = ex.InnerException?.Message ?? ex.Message;
}
return result;
}
/// <summary>
/// 下拉获取船公司
/// </summary>
/// <returns></returns>
[HttpGet("GetCARRIER")]
11 months ago
[RedisCaching]
11 months ago
public Response<List<CommonMappiCode>> GetCARRIER()
{
var result = new Response<List<CommonMappiCode>>();
try
{
result.Result = ser.GetCARRIER();
}
catch (Exception ex)
{
result.Code = 500;
result.Message = ex.InnerException?.Message ?? ex.Message;
}
return result;
}
/// <summary>
/// 下拉获取箱型
/// </summary>
/// <returns></returns>
[HttpGet("GetCTNALL")]
11 months ago
[RedisCaching]
11 months ago
public Response<List<CommonCodeValue>> GetCTNALL()
{
var result = new Response<List<CommonCodeValue>>();
try
{
result.Result = ser.GetCTNALL();
}
catch (Exception ex)
{
result.Code = 500;
result.Message = ex.InnerException?.Message ?? ex.Message;
}
return result;
}
/// <summary>
/// 下拉获取包装单位
/// </summary>
/// <returns></returns>
[HttpGet("GetPackage")]
11 months ago
[RedisCaching]
11 months ago
public Response<List<CommonCodeValue>> GetPackage()
{
var result = new Response<List<CommonCodeValue>>();
try
{
result.Result = ser.GetPackage();
}
catch (Exception ex)
{
result.Code = 500;
result.Message = ex.InnerException?.Message ?? ex.Message;
}
return result;
}
/// <summary>
/// 下拉获取危品等级及 CODE
/// </summary>
/// <returns></returns>
[HttpGet("GetDangerousGoods")]
11 months ago
[RedisCaching]
11 months ago
public Response<List<CodeDangerGradeDto>> GetDangerousGoods(string strlink = "",int page = 0, int limit = 0)
{
var result = new Response<List<CodeDangerGradeDto>>();
try
{
result.Result = ser.GetDangerousGoods(strlink);
}
catch (Exception ex)
{
result.Code = 500;
result.Message = ex.InnerException?.Message ?? ex.Message;
}
return result;
}
///// <summary>
///// 下拉获取起运港口
///// </summary>
///// <returns></returns>
//[HttpGet("GetCodePortLoad")]
//public Response<List<CommonCodeValue>> GetCodePortLoad()
//{
// var result = new Response<List<CommonCodeValue>>();
// try
// {
// result.Result = ser.GetCodePortLoad();
// }
// catch (Exception ex)
// {
// result.Code = 500;
// result.Message = ex.InnerException?.Message ?? ex.Message;
// }
// return result;
//}
/// <summary>
/// 下拉获取港口
/// </summary>
/// <returns></returns>
[HttpGet("GetPort")]
11 months ago
[RedisCaching]
11 months ago
public Response<List<CommonCodeValue>> GetPort(string strlink = "", int page = 0, int limit = 0)
{
var result = new Response<List<CommonCodeValue>>();
try
{
result.Result = ser.GetPort(strlink, page, limit);
}
catch (Exception ex)
{
result.Code = 500;
result.Message = ex.InnerException?.Message ?? ex.Message;
}
return result;
}
/// <summary>
/// 下拉获取船名
/// </summary>
/// <returns></returns>
[HttpGet("GetVessel")]
11 months ago
[RedisCaching]
11 months ago
public Response<List<CommonCodeValue>> GetVessel(string strlink = "", int page = 0,int limit =0)
{
var result = new Response<List<CommonCodeValue>>();
try
{
result.Result = ser.GetVessel(strlink, page,limit);
}
catch (Exception ex)
{
result.Code = 500;
result.Message = ex.InnerException?.Message ?? ex.Message;
}
return result;
}
///// <summary>
///// 下拉获取省份
///// </summary>
///// <returns></returns>
//[HttpGet("GetCodeProvince")]
//public Response<List<CommonCodeValue>> GetCodeProvince(string code)
//{
// var result = new Response<List<CommonCodeValue>>();
// try
// {
// result.Result = ser.GetCodeProvince(code);
// }
// catch (Exception ex)
// {
// result.Code = 500;
// result.Message = ex.InnerException?.Message ?? ex.Message;
// }
// return result;
//}
///// <summary>
///// 下拉获取城市 邮编
///// </summary>
///// <returns></returns>
//[HttpGet("GetCodeCity")]
//public Response<List<CodeCityDto>> GetCodeCity(string provinceCode)
//{
// var result = new Response<List<CodeCityDto>>();
// try
// {
// result.Result = ser.GetCodeCity(provinceCode);
// }
// catch (Exception ex)
// {
// result.Code = 500;
// result.Message = ex.InnerException?.Message ?? ex.Message;
// }
// return result;
//}
#endregion
}
}