|
|
|
|
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>
|
|
|
|
|
/// 获取列表
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <param name="request"></param>
|
|
|
|
|
/// <returns></returns>
|
|
|
|
|
[HttpPost, Route("GetList")]
|
|
|
|
|
public DataResult<List<FeeAuditBusiness>> List([FromBody] PageRequest request)
|
|
|
|
|
{
|
|
|
|
|
return _auditService.GetListByPage(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);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/// <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 _feeService.UpdateAuditStatus(callback);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|