|
|
|
using DS.Module.Core;
|
|
|
|
using DS.Module.Core.Extensions;
|
|
|
|
using DS.WMS.Core.Code.Dtos;
|
|
|
|
using DS.WMS.Core.System.Dtos;
|
|
|
|
using DS.WMS.Core.System.Entity;
|
|
|
|
using DS.WMS.Core.System.Interface;
|
|
|
|
using Microsoft.AspNetCore.Authorization;
|
|
|
|
using Microsoft.AspNetCore.Mvc;
|
|
|
|
using SqlSugar;
|
|
|
|
|
|
|
|
namespace DS.WMS.AdminApi.Controllers;
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
/// 公共模块
|
|
|
|
/// </summary>
|
|
|
|
public class CommonController : ApiController
|
|
|
|
{
|
|
|
|
private readonly ICommonService _invokeService;
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
/// 构造函数
|
|
|
|
/// </summary>
|
|
|
|
/// <param name="invokeService"></param>
|
|
|
|
public CommonController(ICommonService invokeService)
|
|
|
|
{
|
|
|
|
_invokeService = invokeService;
|
|
|
|
}
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
/// 用户登录-管理端
|
|
|
|
/// </summary>
|
|
|
|
/// <param name="model"></param>
|
|
|
|
/// <returns></returns>
|
|
|
|
[HttpPost]
|
|
|
|
[AllowAnonymous]
|
|
|
|
[Route("Login")]
|
|
|
|
public DataResult<string> Login([FromBody] UserLoginModel model)
|
|
|
|
{
|
|
|
|
var res = _invokeService.UserLogin(model);
|
|
|
|
return res;
|
|
|
|
}
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
/// 获取用户-管理端
|
|
|
|
/// </summary>
|
|
|
|
/// <returns></returns>
|
|
|
|
[HttpGet]
|
|
|
|
[Route("GetUserInfo")]
|
|
|
|
public DataResult<CurrentUserViewModel> GetUserInfo()
|
|
|
|
{
|
|
|
|
var res = _invokeService.GetUserInfo();
|
|
|
|
return res;
|
|
|
|
}
|
|
|
|
/// <summary>
|
|
|
|
/// 后台端刷新Token
|
|
|
|
/// </summary>
|
|
|
|
/// <returns></returns>
|
|
|
|
[HttpGet]
|
|
|
|
[Route("UserRefreshToken")]
|
|
|
|
public DataResult<RefreshTokenRes> UserRefreshToken()
|
|
|
|
{
|
|
|
|
var res = _invokeService.UserRefreshToken();
|
|
|
|
return res;
|
|
|
|
}
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
/// 登出
|
|
|
|
/// </summary>
|
|
|
|
/// <returns></returns>
|
|
|
|
[HttpPost]
|
|
|
|
[Route("Logout")]
|
|
|
|
public DataResult<string> Logout()
|
|
|
|
{
|
|
|
|
return DataResult<string>.Success("");
|
|
|
|
}
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
/// 查询用户拥有的菜单权限-管理端
|
|
|
|
/// </summary>
|
|
|
|
/// <returns></returns>
|
|
|
|
[HttpGet]
|
|
|
|
[Route("GetUserPermissionByToken")]
|
|
|
|
public DataResult<List<RouteItem>> GetUserPermissionByToken()
|
|
|
|
{
|
|
|
|
var res = _invokeService.GetUserPermissionByToken();
|
|
|
|
return res;
|
|
|
|
}
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
/// 获取服务器信息
|
|
|
|
/// </summary>
|
|
|
|
/// <returns></returns>
|
|
|
|
[HttpGet]
|
|
|
|
[Route("GetServerInfo")]
|
|
|
|
public DataResult<dynamic> GetServerInfo()
|
|
|
|
{
|
|
|
|
var res = _invokeService.GetServerInfo();
|
|
|
|
return res;
|
|
|
|
}
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
/// 获取角色下拉选项
|
|
|
|
/// </summary>
|
|
|
|
/// <returns></returns>
|
|
|
|
[HttpGet]
|
|
|
|
[Route("GetRoleList")]
|
|
|
|
public DataResult<List<ApiSelectViewModel>> GetRoleList()
|
|
|
|
{
|
|
|
|
var res = _invokeService.GetRoleList();
|
|
|
|
return res;
|
|
|
|
}
|
|
|
|
/// <summary>
|
|
|
|
/// 获取用户下拉选项
|
|
|
|
/// </summary>
|
|
|
|
/// <returns></returns>
|
|
|
|
[HttpGet]
|
|
|
|
[Route("GetUserList")]
|
|
|
|
public DataResult<List<ApiSelectViewModel>> GetUserList()
|
|
|
|
{
|
|
|
|
var res = _invokeService.GetUserList();
|
|
|
|
return res;
|
|
|
|
}
|
|
|
|
/// <summary>
|
|
|
|
/// 获取商品类型下拉选项
|
|
|
|
/// </summary>
|
|
|
|
/// <returns></returns>
|
|
|
|
[HttpGet]
|
|
|
|
[Route("GetGoodsTypeList")]
|
|
|
|
public DataResult<List<ApiSelectViewModel>> GetGoodsTypeList()
|
|
|
|
{
|
|
|
|
var res = _invokeService.GetGoodsTypeList();
|
|
|
|
return res;
|
|
|
|
}
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
/// 获取国家信息下拉选项
|
|
|
|
/// </summary>
|
|
|
|
/// <returns></returns>
|
|
|
|
[HttpGet]
|
|
|
|
[Route("GetCountrySelectList")]
|
|
|
|
public DataResult<List<CodeCountrySelectRes>> GetCountrySelectList()
|
|
|
|
{
|
|
|
|
var res = _invokeService.GetCountrySelectList();
|
|
|
|
return res;
|
|
|
|
}
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
/// 获取航线信息下拉选项
|
|
|
|
/// </summary>
|
|
|
|
/// <returns></returns>
|
|
|
|
[HttpGet]
|
|
|
|
[Route("GetLanesSelectList")]
|
|
|
|
public DataResult<List<CodeLanesSelectRes>> GetLanesSelectList()
|
|
|
|
{
|
|
|
|
var res = _invokeService.GetLanesSelectList();
|
|
|
|
return res;
|
|
|
|
}
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
/// 获取港口信息下拉选项
|
|
|
|
/// </summary>
|
|
|
|
/// <returns></returns>
|
|
|
|
[HttpGet]
|
|
|
|
[Route("GetPortSelectList")]
|
|
|
|
public DataResult<List<CodePortSelectRes>> GetPortSelectList()
|
|
|
|
{
|
|
|
|
var res = _invokeService.GetPortSelectList();
|
|
|
|
return res;
|
|
|
|
}
|
|
|
|
/// <summary>
|
|
|
|
/// 修改密码
|
|
|
|
/// </summary>
|
|
|
|
/// <param name="model"></param>
|
|
|
|
/// <returns></returns>
|
|
|
|
[HttpPost]
|
|
|
|
[Route("ChangePassword")]
|
|
|
|
public DataResult ChangePassword([FromBody] ChangePasswordReq model)
|
|
|
|
{
|
|
|
|
var res = _invokeService.ChangePassword(model);
|
|
|
|
return res;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
/// 获取权限树列表-客户端
|
|
|
|
/// </summary>
|
|
|
|
/// <returns></returns>
|
|
|
|
[HttpGet]
|
|
|
|
[Route("GetClientPermissionTreeList")]
|
|
|
|
public DataResult<List<PermissionTreeList>> GetClientPermissionTreeList()
|
|
|
|
{
|
|
|
|
var res = _invokeService.GetClientPermissionTreeList();
|
|
|
|
return res;
|
|
|
|
}
|
|
|
|
/// <summary>
|
|
|
|
/// 获取数据权限字段
|
|
|
|
/// </summary>
|
|
|
|
/// <param name="permissionId"></param>
|
|
|
|
/// <returns></returns>
|
|
|
|
[HttpGet]
|
|
|
|
[AllowAnonymous]
|
|
|
|
[Route("GetDataRuleEntityFields")]
|
|
|
|
public DataResult<List<EntityFieldProperty>> GetDataRuleEntityFields([FromQuery] string permissionId)
|
|
|
|
{
|
|
|
|
var res = _invokeService.GetDataRuleEntityFields(permissionId);
|
|
|
|
return res;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
/// 获取数据库表及视图名
|
|
|
|
/// </summary>
|
|
|
|
/// <returns></returns>
|
|
|
|
[HttpGet]
|
|
|
|
[Route("GetTables")]
|
|
|
|
public DataResult<List<DbTableInfo>> GetTables()
|
|
|
|
{
|
|
|
|
var res = _invokeService.GetTables();
|
|
|
|
return res;
|
|
|
|
}
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
/// 获取数据库表及视图名
|
|
|
|
/// </summary>
|
|
|
|
/// <returns></returns>
|
|
|
|
[HttpGet]
|
|
|
|
[Route("GetColumns")]
|
|
|
|
public DataResult<List<DbColumnInfo>> GetColumns([FromQuery] string tableViewName)
|
|
|
|
{
|
|
|
|
var res = _invokeService.GetColumns(tableViewName);
|
|
|
|
return res;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
/// 获取用户字段设置
|
|
|
|
/// </summary>
|
|
|
|
/// <param name="permissionId"></param>
|
|
|
|
/// <returns></returns>
|
|
|
|
[HttpGet]
|
|
|
|
[Route("GetUserFieldSet")]
|
|
|
|
public DataResult<SysUserFieldSet> GetUserFieldSet([FromQuery] string permissionId)
|
|
|
|
{
|
|
|
|
var res = _invokeService.GetUserFieldSet(permissionId);
|
|
|
|
return res;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
/// 更新用户字段设置
|
|
|
|
/// </summary>
|
|
|
|
/// <param name="req"></param>
|
|
|
|
/// <returns></returns>
|
|
|
|
[HttpPost]
|
|
|
|
[Route("UpdateUserFieldSet")]
|
|
|
|
public DataResult UpdateUserFieldSet([FromBody] UserFieldSetUpdateReq req)
|
|
|
|
{
|
|
|
|
var res = _invokeService.UpdateUserFieldSet(req);
|
|
|
|
return res;
|
|
|
|
}
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
/// 获取字典下拉明细
|
|
|
|
/// </summary>
|
|
|
|
/// <param name="model"></param>
|
|
|
|
/// <returns></returns>
|
|
|
|
[HttpPost]
|
|
|
|
[Route("GetDictTypeDropDown")]
|
|
|
|
public DataResult GetDictTypeDropDown([FromBody] DropDownDictTypeInput model)
|
|
|
|
{
|
|
|
|
var res = _invokeService.GetDictTypeDropDown(model);
|
|
|
|
return res;
|
|
|
|
}
|
|
|
|
/// <summary>
|
|
|
|
/// 批量获取字典值
|
|
|
|
/// </summary>
|
|
|
|
/// <param name="model"></param>
|
|
|
|
/// <returns></returns>
|
|
|
|
[HttpPost]
|
|
|
|
[Route("GetDictOptions")]
|
|
|
|
public DataResult<List<DictOptions>> GetDictOptions([FromBody] DropDownDictTypeInput model)
|
|
|
|
{
|
|
|
|
var res = _invokeService.GetDictOptions(model);
|
|
|
|
return res;
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|