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.

106 lines
3.6 KiB
C#

using DS.Module.Core;
using DS.WMS.Core.Fee.Dtos;
using DS.WMS.Core.Fee.Interface;
using DS.WMS.Core.Flow.Dtos;
using DS.WMS.Core.Flow.Interface;
using Microsoft.AspNetCore.Mvc;
namespace DS.WMS.FeeApi.Controllers
{
/// <summary>
/// 费用审核服务
/// </summary>
public class FeeAuditController : ApiController
{
readonly IFeeAuditService _auditService;
readonly IFeeRecordService _feeService;
readonly IClientFlowInstanceService _flowService;
public FeeAuditController(IFeeAuditService auditService, IFeeRecordService feeService, IClientFlowInstanceService flowService)
{
_auditService = auditService;
_feeService = feeService;
_flowService = flowService;
}
/// <summary>
6 months ago
/// 获取待审核列表
/// </summary>
/// <param name="request"></param>
/// <returns></returns>
[HttpPost, Route("GetList")]
public DataResult<List<FeeAuditBusiness>> List([FromBody] PageRequest request)
{
6 months ago
return _auditService.GetList(request);
}
/// <summary>
/// 获取整票待审核列表
/// </summary>
/// <param name="request"></param>
/// <returns></returns>
[HttpPost, Route("GetBizList")]
public DataResult<List<FeeAuditBusiness>> BizList([FromBody] PageRequest request)
{
return _auditService.GetBizList(request);
}
/// <summary>
/// 批量费用审核
/// </summary>
/// <param name="request"></param>
/// <returns></returns>
[HttpPost, Route("Audit")]
public DataResult Audit(FeeAuditRequest request)
{
if (request == null || request.Ids.Length == 0 || (request.Result != 1 && request.Result != 2))
return DataResult.Failed("参数无效", MultiLanguageConst.IllegalRequest);
return _auditService.Audit(request.Result, request.Remark, request.Ids);
}
6 months ago
/// <summary>
/// 本票审核(一键审核当前登录用户的所有待审核项)
/// </summary>
/// <param name="status">审批结果: 1=通过 2=驳回</param>
/// <param name="remark">审批备注</param>
/// <returns></returns>
[HttpPost, Route("OneClickAudit")]
6 months ago
public DataResult OneClickAudit(int status, string remark)
6 months ago
{
if (status != 1 && status != 2)
return DataResult.Failed("参数无效", MultiLanguageConst.IllegalRequest);
return _auditService.Audit(status, remark);
6 months ago
}
/// <summary>
/// 整单费用状态审核
/// </summary>
/// <param name="request"></param>
/// <returns></returns>
[HttpPost, Route("AuditBusiness")]
6 months ago
public DataResult AuditBusiness(FeeBizAuditRequest request)
{
6 months ago
if (request == null || (request.Result != 1 && request.Result != 2) || request.Items == null || !request.Items.Any())
return DataResult.Failed("参数无效", MultiLanguageConst.IllegalRequest);
6 months ago
return _auditService.AuditBusiness(request);
}
/// <summary>
/// 变更费用审批状态
/// </summary>
/// <param name="callback">回调信息</param>
/// <returns></returns>
[HttpPost, Route("ChangeStatus")]
public DataResult ChangeStatus([FromBody] FlowCallback callback)
{
if (callback == null)
return DataResult.Failed("参数无效", MultiLanguageConst.IllegalRequest);
return _auditService.UpdateAuditStatus(callback);
}
}
}