using DS.Module.Core;
using DS.WMS.Core.Code.Dtos;
using DS.WMS.Core.Code.Interface;
using DS.WMS.Core.Sys.Dtos;
using DS.WMS.Core.Sys.Entity;
using DS.WMS.Core.Sys.Interface;
using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Mvc;
namespace DS.WMS.MainApi.Controllers;
///
/// 基础编码模块
///
public class CodeSequenceController : ApiController
{
private readonly ICodeSequenceService _invokeService;
private readonly ICodeSequenceRuleService _sequenceRuleService;
///
/// 构造函数
///
///
public CodeSequenceController(ICodeSequenceService invokeService, ICodeSequenceRuleService SequenceRuleService)
{
_invokeService = invokeService;
_sequenceRuleService = SequenceRuleService;
}
///
/// 基础编码列表
///
///
///
[HttpPost]
[Route("GetSequenceTypeList")]
public DataResult> GetSequenceList([FromBody] PageRequest request)
{
var res = _invokeService.GetListByPage(request);
return res;
}
///
/// 编辑基础编码
///
///
///
[HttpPost]
[Route("EditSequence")]
public DataResult EditSequence([FromBody] CodeSequenceReq model)
{
var res = _invokeService.EditSequence(model);
return res;
}
///
/// 编码规则列表
///
///
///
[HttpPost]
[Route("GetSequenceRuleList")]
public DataResult> GetSequenceRuleList([FromBody] PageRequest request)
{
var res = _sequenceRuleService.GetListByPage(request);
return res;
}
///
/// 编辑 编码规则
///
///
///
[HttpPost]
[Route("EditSequenceRule")]
public DataResult EditSequenceRule([FromBody] CodeSequenceRuleReq model)
{
var res = _sequenceRuleService.EditSequenceRule(model);
return res;
}
///
/// 基础编码详情
///
///
///
[HttpGet]
[Route("GetSequenceInfo")]
public DataResult GetSequenceInfo([FromQuery] string id)
{
var res = _invokeService.GetSequenceInfo(id);
return res;
}
///
/// 编码规则详情
///
///
///
[HttpGet]
[Route("GetSequenceRuleInfo")]
public DataResult GetSequenceRuleInfo([FromQuery] string id)
{
var res = _sequenceRuleService.GetSequenceRuleInfo(id);
return res;
}
}