|
|
|
|
using DS.Module.Core;
|
|
|
|
|
using DS.Module.Core.Data;
|
|
|
|
|
using DS.WMS.Core.Code.Dtos;
|
|
|
|
|
using DS.WMS.Core.Code.Interface;
|
|
|
|
|
using DS.WMS.Core.Sys.Dtos;
|
|
|
|
|
using DS.WMS.Core.Sys.Interface;
|
|
|
|
|
using Microsoft.AspNetCore.Mvc;
|
|
|
|
|
|
|
|
|
|
namespace DS.WMS.MainApi.Controllers;
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// 基础数据权限模板模块
|
|
|
|
|
/// </summary>
|
|
|
|
|
public class CodeDataRuleTemplateController : ApiController
|
|
|
|
|
{
|
|
|
|
|
private readonly IDataRuleTemplateService _invokeService;
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// 构造函数
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <param name="invokeService"></param>
|
|
|
|
|
public CodeDataRuleTemplateController(IDataRuleTemplateService invokeService)
|
|
|
|
|
{
|
|
|
|
|
_invokeService = invokeService;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// 列表
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <param name="request"></param>
|
|
|
|
|
/// <returns></returns>
|
|
|
|
|
[HttpPost]
|
|
|
|
|
[Route("GetDataRuleTemplateList")]
|
|
|
|
|
public async Task<DataResult<List<CodeDataRuleTemplateRes>>> GetDataRuleTemplateList([FromBody] PageRequest request)
|
|
|
|
|
{
|
|
|
|
|
var res =await _invokeService.GetListByPage(request);
|
|
|
|
|
return res;
|
|
|
|
|
}
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// 根据权限id获取数据权限模板
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <param name="id"></param>
|
|
|
|
|
/// <param name="ruleType"></param>
|
|
|
|
|
/// <returns></returns>
|
|
|
|
|
[HttpPost]
|
|
|
|
|
[Route("GetDataRuleTemplateSelectList")]
|
|
|
|
|
public async Task<DataResult<List<CodeDataRuleTemplateRes>>> GetDataRuleTemplateSelectList([FromQuery] string id, string ruleType)
|
|
|
|
|
{
|
|
|
|
|
var res = await _invokeService.GetDataRuleTemplateSelectList(id,ruleType);
|
|
|
|
|
return res;
|
|
|
|
|
}
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// 编辑
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <param name="req"></param>
|
|
|
|
|
/// <returns></returns>
|
|
|
|
|
[HttpPost]
|
|
|
|
|
[Route("EditDataRuleTemplate")]
|
|
|
|
|
public async Task<DataResult> EditDataRuleTemplate([FromBody] CodeDataRuleTemplateReq req)
|
|
|
|
|
{
|
|
|
|
|
var res = await _invokeService.EditDataRuleTemplate(req);
|
|
|
|
|
return res;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// 详情
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <param name="id"></param>
|
|
|
|
|
/// <returns></returns>
|
|
|
|
|
[HttpGet]
|
|
|
|
|
[Route("GetDataRuleTemplateInfo")]
|
|
|
|
|
public async Task<DataResult<CodeDataRuleTemplateRes>> GetDataRuleTemplateInfo([FromQuery] string id)
|
|
|
|
|
{
|
|
|
|
|
var res = await _invokeService.GetDataRuleTemplateInfo(id);
|
|
|
|
|
return res;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// 批量删除
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <param name="req">req</param>
|
|
|
|
|
/// <returns></returns>
|
|
|
|
|
[HttpPost]
|
|
|
|
|
[Route("BatchDelDataRuleTemplate")]
|
|
|
|
|
public async Task<DataResult> BatchDelDataRuleTemplate([FromBody] IdModel req)
|
|
|
|
|
{
|
|
|
|
|
var res =await _invokeService.BatchDelDataRuleTemplate(req);
|
|
|
|
|
return res;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// 批量复制
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <param name="req">Ids</param>
|
|
|
|
|
/// <returns></returns>
|
|
|
|
|
[HttpPost]
|
|
|
|
|
[Route("BatchCopyDataRuleTemplate")]
|
|
|
|
|
public async Task<DataResult> BatchCopyDataRuleTemplate([FromBody] IdModel req)
|
|
|
|
|
{
|
|
|
|
|
var res = await _invokeService.BatchCopyDataRuleTemplate(req);
|
|
|
|
|
return res;
|
|
|
|
|
}
|
|
|
|
|
}
|