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.

296 lines
7.8 KiB
C#

using DS.Module.Core;
using DS.WMS.Core.BaseInfo.Dtos;
using DS.WMS.Core.BaseInfo.Entity;
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;
namespace DS.WMS.WebApi.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>
/// 登出
/// </summary>
/// <returns></returns>
[HttpPost]
[Route("Logout")]
public DataResult<string> Logout()
{
return DataResult<string>.Success("");
}
/// <summary>
/// 版本升级
/// </summary>
/// <param name="appVersion">版本号</param>
/// <returns></returns>
[HttpGet]
[Route("AppUpdate")]
public JsonResult AppUpdate([FromQuery] string appVersion)
{
var res = _invokeService.AppUpdate(appVersion);
return Json(res);
}
/// <summary>
/// 查询用户拥有的菜单权限
/// </summary>
/// <returns></returns>
[HttpGet]
[Route("GetUserPermissionByToken")]
public DataResult<List<RouteItem>> GetUserPermissionByToken()
{
var res = _invokeService.GetUserPermissionByToken();
return res;
}
/// <summary>
/// 获取字典下拉明细
/// </summary>
/// <param name="code"></param>
/// <returns></returns>
[HttpGet]
[Route("GetDictTypeDropDown")]
public DataResult GetDictTypeDropDown([FromQuery] string code)
{
var res = _invokeService.GetDictTypeDropDown(code);
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;
}
/// <summary>
/// 企业用户注册
/// </summary>
/// <param name="model"></param>
/// <returns></returns>
[HttpPost]
[AllowAnonymous]
[Route("CompanyRegister")]
public DataResult CompanyRegister([FromBody] CompanyRegisterInput model)
{
var res = _invokeService.CompanyRegister(model);
return res;
}
/// <summary>
/// 获取商品分类列表
/// </summary>
/// <param name="request"></param>
/// <returns></returns>
[HttpPost]
[Route("GetGoodsTypeList")]
public DataResult<List<code_goodsType>> GetGoodsTypeList([FromBody] PageRequest request)
{
var res = _invokeService.GetGoodsTypeList(request);
return res;
}
/// <summary>
/// 获取商品计费大类列表
/// </summary>
/// <param name="request"></param>
/// <returns></returns>
[HttpPost]
[Route("GetGoodsFeeTypeList")]
public DataResult<List<OP_WMS_GOODSFEETYPE>> GetGoodsFeeTypeList([FromBody] PageRequest request)
{
var res = _invokeService.GetGoodsFeeTypeList(request);
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("GetSecurityUserTypeList")]
public DataResult<List<ApiSelectViewModel>> GetSecurityUserTypeList()
{
var res = _invokeService.GetSecurityUserTypeList();
return res;
}
/// <summary>
/// 获取商品下拉列表
/// </summary>
/// <param name="code"></param>
/// <returns></returns>
[HttpGet]
[Route("GetGoodsList")]
public DataResult GetGoodsList([FromQuery]string code)
{
var res = _invokeService.GetGoodsList(code);
return res;
}
/// <summary>
/// 获取仓库列表
/// </summary>
/// <param name="request"></param>
/// <returns></returns>
[HttpPost]
[Route("GetStoreHouseList")]
public DataResult<List<StoreHouseViewModel>> GetStoreHouseList([FromBody] PageRequest request)
{
var res = _invokeService.GetStoreHouseList(request);
return res;
}
/// <summary>
/// 获取仓库库位列表
/// </summary>
/// <param name="code"></param>
/// <returns></returns>
[HttpGet]
[Route("GetStoreHouseAreaList")]
public DataResult GetStoreHouseAreaList([FromQuery]string code)
{
var res = _invokeService.GetStoreHouseAreaList(code);
return res;
}
/// <summary>
/// 获取客户列表
/// </summary>
/// <param name="request"></param>
/// <returns></returns>
[HttpPost]
[Route("GetInfoClientList")]
public DataResult<List<InfoClientViewModel>> GetInfoClientList([FromBody] PageRequest request)
{
var res = _invokeService.GetInfoClientList(request);
return res;
}
/// <summary>
/// 获取费用列表
/// </summary>
/// <param name="code"></param>
/// <returns></returns>
[HttpGet]
[Route("GetFeeList")]
public DataResult GetFeeList([FromQuery] string code)
{
var res = _invokeService.GetFeeList(code);
return res;
}
/// <summary>
/// 获取仓库选择
/// </summary>
/// <returns></returns>
[HttpGet]
[Route("GetStoreHouseSelect")]
public DataResult<List<ApiSelectViewModel>> GetStoreHouseSelect()
{
var res = _invokeService.GetStoreHouseSelect();
return res;
}
/// <summary>
/// 获取集合提醒统计
/// </summary>
/// <returns></returns>
[HttpGet]
[Route("GetCollectWarningCount")]
public DataResult<CollectWarningCount> GetCollectWarningCount()
{
var res = _invokeService.GetCollectWarningCount();
return res;
}
/// <summary>
/// 获取已审批客户列表
/// </summary>
/// <param name="request"></param>
/// <returns></returns>
[HttpPost]
[Route("GetCompanyList")]
public DataResult<List<OP_YARD_COMPANY>> GetCompanyList([FromBody] PageRequest request)
{
var res = _invokeService.GetCompanyList(request);
return res;
}
/// <summary>
/// 修改密码
/// </summary>
/// <param name="model"></param>
/// <returns></returns>
[HttpPost]
[Route("ChangePassword")]
public DataResult ChangePassword([FromBody] ChangePasswordInput model)
{
var res = _invokeService.ChangePassword(model);
return res;
}
}