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.

134 lines
3.5 KiB
C#

using DS.Module.Core;
using DS.WMS.Core.BaseInfo.Dtos;
using DS.WMS.Core.BaseInfo.Interface;
using DS.WMS.Core.ContractModule.Dtos;
using DS.WMS.Core.ContractModule.Entity;
using DS.WMS.Core.ContractModule.Interface;
using Microsoft.AspNetCore.Mvc;
namespace DS.WMS.WebApi.Controllers;
/// <summary>
/// 合同管理
/// </summary>
public class ContractController : ApiController
{
private readonly IContractService _invokeService;
/// <summary>
/// 构造函数
/// </summary>
/// <param name="invokeService"></param>
public ContractController(IContractService invokeService)
{
_invokeService = invokeService;
}
/// <summary>
/// 列表
/// </summary>
/// <param name="request"></param>
/// <returns></returns>
[HttpPost]
[Route("GetContractList")]
public DataResult<List<ContractListPageModel>> GetListByPage([FromBody] PageRequest request)
{
var res = _invokeService.GetListByPage(request);
return res;
}
/// <summary>
/// 获取信息
/// </summary>
/// <param name="id"></param>
/// <returns></returns>
[HttpGet]
[Route("GetContractInfo")]
public DataResult<ContractViewModel> GetContractInfo([FromQuery]string id)
{
var res = _invokeService.GetContractInfo(id);
return res;
}
/// <summary>
/// 编辑
/// </summary>
/// <param name="model"></param>
/// <returns></returns>
[HttpPost]
[Route("EditContract")]
public DataResult EditContract([FromBody] ContractInput model)
{
var res = _invokeService.EditContract(model);
return res;
}
/// <summary>
/// 获取未处理合同报警数
/// </summary>
/// <returns></returns>
[HttpGet]
[Route("GetContractWarningCount")]
public DataResult<int> GetContractWarningCount()
{
var res = _invokeService.GetContractWarningCount();
return res;
}
/// <summary>
/// 启用预警
/// </summary>
/// <param name="id"></param>
/// <returns></returns>
[HttpGet]
[Route("EnableAlarmDetail")]
public DataResult EnableAlarmDetail([FromQuery]string id)
{
var res = _invokeService.EnableAlarmDetail(id);
return res;
}
/// <summary>
/// 禁用预警
/// </summary>
/// <param name="id"></param>
/// <returns></returns>
[HttpGet]
[Route("DisableAlarmDetail")]
public DataResult DisableAlarmDetail([FromQuery]string id)
{
var res = _invokeService.DisableAlarmDetail(id);
return res;
}
/// <summary>
/// 删除预警
/// </summary>
/// <param name="id"></param>
/// <returns></returns>
[HttpGet]
[Route("DelAlarmDetail")]
public DataResult DelAlarmDetail([FromQuery]string id)
{
var res = _invokeService.DelAlarmDetail(id);
return res;
}
[HttpPost]
[Route("GetContractAlarmDetail")]
public DataResult<List<AlarmDetailViewModel>> GetContractAlarmDetail([FromBody]PageRequest request)
{
var res = _invokeService.GetContractAlarmDetail(request);
return res;
}
/// <summary>
/// 预警编辑保存
/// </summary>
/// <param name="model"></param>
/// <returns></returns>
[HttpPost]
[Route("SaveAlarmDetail")]
public DataResult SaveAlarmDetail([FromBody] AlarmDetailEditInput model)
{
var res = _invokeService.SaveAlarmDetail(model);
return res;
}
}