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.

113 lines
2.9 KiB
C#

using DS.Module.Core;
using DS.Module.Core.Data;
using DS.WMS.Core.Code.Dtos;
using DS.WMS.Core.Code.Interface;
using Microsoft.AspNetCore.Mvc;
namespace DS.WMS.MainApi.Controllers;
/// <summary>
/// 商品服务
/// </summary>
public class CodeGoodsController : ApiController
{
private readonly ICodeGoodsService _invokeService;
/// <summary>
/// 构造函数
/// </summary>
/// <param name="invokeService"></param>
public CodeGoodsController(ICodeGoodsService invokeService)
{
_invokeService = invokeService;
}
/// <summary>
/// 列表
/// </summary>
/// <param name="request"></param>
/// <returns></returns>
[HttpPost]
[Route("GetCodeGoodsList")]
public DataResult<List<CodeGoodsRes>> GetCodeGoodsList([FromBody] PageRequest request)
{
var res = _invokeService.GetClientListByPage(request);
return res;
}
/// <summary>
/// 编辑
/// </summary>
/// <param name="model"></param>
/// <returns></returns>
[HttpPost]
[Route("EditCodeGoods")]
public DataResult EditCodeGoods([FromBody] CodeGoodsReq model)
{
var res = _invokeService.EditClientCodeGoods(model);
return res;
}
/// <summary>
/// 详情
/// </summary>
/// <param name="id"></param>
/// <returns></returns>
[HttpGet]
[Route("GetCodeGoodsInfo")]
public DataResult<CodeGoodsRes> GetCodeGoodsInfo([FromQuery] string id)
{
var res = _invokeService.GetClientCodeGoodsInfo(id);
return res;
}
/// <summary>
/// 获取商品列表-基础库
/// </summary>
/// <param name="request"></param>
/// <returns></returns>
[HttpPost]
[Route("GetBasicsCodeGoodsList")]
public DataResult<List<CodeGoodsRes>> GetBasicsCodeGoodsList([FromBody] PageRequest request)
{
var res = _invokeService.GetCodeGoodsList(request);
return res;
}
/// <summary>
/// 导入商品类型-基础库
/// </summary>
/// <param name="req"></param>
/// <returns></returns>
[HttpPost]
[Route("ImportCodeGoods")]
public DataResult ImportCodeGoods([FromBody] IdModel req)
{
var res = _invokeService.ImportCodeGoods(req);
return res;
}
/// <summary>
/// 获取当前租户已有的商品
/// </summary>
/// <returns></returns>
[HttpGet]
[Route("GetExistCodeGoodsList")]
public DataResult<List<string>> GetExistCodeGoodsList()
{
var res = _invokeService.GetExistCodeGoodsList();
return res;
}
4 months ago
/// <summary>
/// 批量删除
/// </summary>
/// <param name="req">主表Ids</param>
/// <returns></returns>
[HttpPost]
[Route("BatchDelCodeGoods")]
public DataResult BatchDelCodeGoods([FromBody] IdModel req)
{
var res = _invokeService.BatchDelCodeGoods(req);
return res;
}
}