|
|
|
|
using DS.Module.Core;
|
|
|
|
|
using DS.Module.Core.Data;
|
|
|
|
|
using DS.WMS.Core.Application.Dtos;
|
|
|
|
|
using DS.WMS.Core.Application.Interface;
|
|
|
|
|
using DS.WMS.Core.Fee.Dtos;
|
|
|
|
|
using DS.WMS.Core.Flow.Dtos;
|
|
|
|
|
using Microsoft.AspNetCore.Mvc;
|
|
|
|
|
|
|
|
|
|
namespace DS.WMS.FeeApi.Controllers
|
|
|
|
|
{
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// 发票申请审核API
|
|
|
|
|
/// </summary>
|
|
|
|
|
public class InvoiceApplicationAuditController : ApiController
|
|
|
|
|
{
|
|
|
|
|
readonly IInvoiceApplicationAuditService _auditService;
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// 初始化
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <param name="auditService"></param>
|
|
|
|
|
public InvoiceApplicationAuditController(IInvoiceApplicationAuditService auditService)
|
|
|
|
|
{
|
|
|
|
|
_auditService = auditService;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// 获取待审核列表
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <param name="request"></param>
|
|
|
|
|
/// <returns></returns>
|
|
|
|
|
[HttpPost, Route("GetList")]
|
|
|
|
|
public async Task<DataResult<List<InvoiceApplicationDto>>> ListAsync([FromBody] PageRequest request)
|
|
|
|
|
{
|
|
|
|
|
return await _auditService.GetListAsync(request);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// 按申请单审核
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <param name="request"></param>
|
|
|
|
|
/// <returns></returns>
|
|
|
|
|
[HttpPost, Route("Audit")]
|
|
|
|
|
public async Task<DataResult> AuditAsync([FromBody] AuditRequest request)
|
|
|
|
|
{
|
|
|
|
|
if (request.Ids.Length == 0 || (request.Result != 1 && request.Result != 2))
|
|
|
|
|
return DataResult.Failed("参数无效", MultiLanguageConst.IllegalRequest);
|
|
|
|
|
|
|
|
|
|
return await _auditService.AuditAsync(request);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
///一键审核当前登录用户的所有待审核项
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <param name="status">审批结果: 1=通过 2=驳回</param>
|
|
|
|
|
/// <param name="remark">审批备注</param>
|
|
|
|
|
/// <returns></returns>
|
|
|
|
|
[HttpPost, Route("OneClickAudit")]
|
|
|
|
|
public async Task<DataResult> OneClickAuditAsync(int status, string remark)
|
|
|
|
|
{
|
|
|
|
|
if (status != 1 && status != 2)
|
|
|
|
|
return DataResult.Failed("参数无效", MultiLanguageConst.IllegalRequest);
|
|
|
|
|
|
|
|
|
|
return await _auditService.AuditAsync(status, remark);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// 将申请单重置为未打印状态
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <param name="model">申请单ID</param>
|
|
|
|
|
/// <returns></returns>
|
|
|
|
|
[HttpPost, Route("SetUnPrinted")]
|
|
|
|
|
public async Task<DataResult> SetUnPrinted(IdModel model)
|
|
|
|
|
{
|
|
|
|
|
if (model.Ids == null || model.Ids.Length == 0)
|
|
|
|
|
return DataResult.Failed("参数无效", MultiLanguageConst.IllegalRequest);
|
|
|
|
|
|
|
|
|
|
return await _auditService.SetUnPrinted(model.Ids);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// 变更申请单审批状态(用于工作流框架的回调)
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <param name="callback">回调信息</param>
|
|
|
|
|
/// <returns></returns>
|
|
|
|
|
[HttpPost, Route("ChangeStatus")]
|
|
|
|
|
public async Task<DataResult> ChangeStatusAsync([FromBody] FlowCallback callback)
|
|
|
|
|
{
|
|
|
|
|
if (callback == null)
|
|
|
|
|
return DataResult.Failed("参数无效", MultiLanguageConst.IllegalRequest);
|
|
|
|
|
|
|
|
|
|
return await _auditService.UpdateStatusAsync(callback);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|