|
|
|
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;
|
|
|
|
}
|
|
|
|
|
|
|
|
/// <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;
|
|
|
|
}
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
/// 回写商品信息
|
|
|
|
/// </summary>
|
|
|
|
/// <param name="model"></param>
|
|
|
|
/// <returns></returns>
|
|
|
|
[HttpPost]
|
|
|
|
[Route("WriteBackGoods")]
|
|
|
|
public async Task<DataResult> WriteBackGoods([FromBody] CodeGoodsWriteBackReq model)
|
|
|
|
{
|
|
|
|
var res = await _invokeService.WriteBackGoods(model);
|
|
|
|
return res;
|
|
|
|
}
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
/// 回写商品信息检测
|
|
|
|
/// </summary>
|
|
|
|
/// <param name="model"></param>
|
|
|
|
/// <returns></returns>
|
|
|
|
[HttpPost]
|
|
|
|
[Route("CheckGoods")]
|
|
|
|
public async Task<DataResult> CheckGoods([FromBody] CodeGoodsWriteBackReq model)
|
|
|
|
{
|
|
|
|
var res = await _invokeService.CheckGoods(model);
|
|
|
|
return res;
|
|
|
|
}
|
|
|
|
}
|