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 { /// /// 费用申请单API /// public class FeeApplicationController : ApiController { readonly IFeeApplicationService _service; /// /// 初始化 /// /// public FeeApplicationController(IFeeApplicationService service) { _service = service; } /// /// 获取列表 /// /// /// [HttpPost, Route("GetList")] public async Task>> ListAsync([FromBody] PageRequest request) { return await _service.GetListAsync(request); } /// /// 获取待审核列表 /// /// /// [HttpPost, Route("GetBizList")] public async Task>> BizListAsync([FromBody] PageRequest request) { return await _service.GetBizListAsync(request); } /// /// 提交申请单 /// /// 申请单 /// [HttpPost, Route("Save")] public async Task SaveAsync([FromBody] FeeApplication application) { return await _service.SaveAsync(application); } /// /// 删除申请单 /// /// 申请单ID /// [HttpPost, Route("Delete")] public async Task DeleteAsync(IdModel model) { if (model.Id == null || model.Ids.Length == 0) return DataResult.Failed("参数无效", MultiLanguageConst.IllegalRequest); return await _service.DeleteAsync(model.Ids); } /// /// 发起审批 /// /// 申请单ID /// [HttpPost, Route("ApplyAudit")] public async Task 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); } /// /// 撤销审批 /// /// 申请单ID /// [HttpPost, Route("Withdraw")] public async Task WithdrawAsync(IdModel model) { if (model.Ids == null || model.Ids.Length == 0) return DataResult.Failed("参数无效", MultiLanguageConst.IllegalRequest); return await _service.WithdrawAsync(model.Ids); } } }