|
|
|
|
using DS.Module.Core;
|
|
|
|
|
using DS.Module.Core.Data;
|
|
|
|
|
using DS.WMS.Core.Fee.Dtos;
|
|
|
|
|
using DS.WMS.Core.Fee.Entity;
|
|
|
|
|
using DS.WMS.Core.Fee.Interface;
|
|
|
|
|
using Microsoft.AspNetCore.Mvc;
|
|
|
|
|
|
|
|
|
|
namespace DS.WMS.FeeApi.Controllers
|
|
|
|
|
{
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// 费用申请单API
|
|
|
|
|
/// </summary>
|
|
|
|
|
public class FeeApplicationController : ApiController
|
|
|
|
|
{
|
|
|
|
|
readonly IFeeApplicationService _service;
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// 初始化
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <param name="service"></param>
|
|
|
|
|
public FeeApplicationController(IFeeApplicationService service)
|
|
|
|
|
{
|
|
|
|
|
_service = service;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// 获取列表
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <param name="request"></param>
|
|
|
|
|
/// <returns></returns>
|
|
|
|
|
[HttpPost, Route("GetList")]
|
|
|
|
|
public async Task<DataResult<List<FeeApplicationDto>>> ListAsync([FromBody] PageRequest request)
|
|
|
|
|
{
|
|
|
|
|
return await _service.GetListAsync(request);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// 获取待审核列表
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <param name="request"></param>
|
|
|
|
|
/// <returns></returns>
|
|
|
|
|
[HttpPost, Route("GetBizList")]
|
|
|
|
|
public async Task<DataResult<List<FeeApplicationBiz>>> BizListAsync([FromBody] PageRequest request)
|
|
|
|
|
{
|
|
|
|
|
return await _service.GetBizListAsync(request);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// 提交申请单
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <param name="application">申请单</param>
|
|
|
|
|
/// <returns></returns>
|
|
|
|
|
[HttpPost, Route("Save")]
|
|
|
|
|
public async Task<DataResult> SaveAsync([FromBody] FeeApplication application)
|
|
|
|
|
{
|
|
|
|
|
return await _service.SaveAsync(application);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// 删除申请单
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <param name="model">申请单ID</param>
|
|
|
|
|
/// <returns></returns>
|
|
|
|
|
[HttpPost, Route("Delete")]
|
|
|
|
|
public async Task<DataResult> DeleteAsync(IdModel model)
|
|
|
|
|
{
|
|
|
|
|
if (model.Id == null || model.Ids.Length == 0)
|
|
|
|
|
return DataResult.Failed("参数无效", MultiLanguageConst.IllegalRequest);
|
|
|
|
|
|
|
|
|
|
return await _service.DeleteAsync(model.Ids);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// 发起审批
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <param name="model">申请单ID</param>
|
|
|
|
|
/// <returns></returns>
|
|
|
|
|
[HttpPost, Route("ApplyAudit")]
|
|
|
|
|
public async Task<DataResult> ApplyAuditAsync([FromBody] IdModel model)
|
|
|
|
|
{
|
|
|
|
|
if (model.Ids == null || model.Ids.Length == 0)
|
|
|
|
|
return DataResult.Failed("参数无效", MultiLanguageConst.IllegalRequest);
|
|
|
|
|
|
|
|
|
|
return await _service.SubmitForApprovalAsync(AuditType.PaidApplication, model.Remark, model.Ids);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// 撤销审批
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <param name="model">申请单ID</param>
|
|
|
|
|
/// <returns></returns>
|
|
|
|
|
[HttpPost, Route("Withdraw")]
|
|
|
|
|
public async Task<DataResult> WithdrawAsync(IdModel model)
|
|
|
|
|
{
|
|
|
|
|
if (model.Ids == null || model.Ids.Length == 0)
|
|
|
|
|
return DataResult.Failed("参数无效", MultiLanguageConst.IllegalRequest);
|
|
|
|
|
|
|
|
|
|
return await _service.WithdrawAsync(model.Ids);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|