报销单功能模块

dev
douhandong 4 weeks ago
parent 1752f89777
commit 364b394760

@ -489,10 +489,16 @@ namespace DS.Module.Core
#region 报销审核 #region 报销审核
/// <summary> /// <summary>
/// 工作流报销审核 /// 报销审核
/// </summary> /// </summary>
[Description("工作流报销审核")] [Description("报销单审核")]
ReimbursementApproval =1101 ReimbursementApproval =1101,
/// <summary>
/// 报销单审核
/// </summary>
[Description("报销单审核")]
Reimbursement_REJECTED = -1101
#endregion #endregion
} }

@ -13,7 +13,7 @@ namespace DS.WMS.Core.Fee.Entity
/// 报销单 /// 报销单
/// </summary> /// </summary>
[SugarTable("fee_reimbursement", TableDescription = "报销单主表")] [SugarTable("fee_reimbursement", TableDescription = "报销单主表")]
public class Reimbursement : BaseModel<long> public class FeeReimbursement : BaseModel<long>
{ {
/// <summary> /// <summary>
/// 报销用户Id /// 报销用户Id
@ -40,6 +40,11 @@ namespace DS.WMS.Core.Fee.Entity
/// </summary> /// </summary>
public ReimbursementTypeEnums Status { get; set; } public ReimbursementTypeEnums Status { get; set; }
/// <summary>
/// 驳回理由
/// </summary>
public string RejectReason { get; set; }
/// <summary> /// <summary>
/// 部门 /// 部门
/// </summary> /// </summary>

@ -13,7 +13,7 @@ namespace DS.WMS.Core.Fee.Entity
/// <summary> /// <summary>
/// 报销单详情 /// 报销单详情
/// </summary> /// </summary>
[SugarTable("fee_reimbursementDetail", TableDescription = "报销单详情表")] [SugarTable("fee_reimbursement_detail", TableDescription = "报销单详情表")]
public class FeeReimbursementDetail : BaseModel<long> public class FeeReimbursementDetail : BaseModel<long>
{ {
@ -39,8 +39,13 @@ namespace DS.WMS.Core.Fee.Entity
/// <summary> /// <summary>
/// 状态(未提交,审核中,审核通过,审核驳回,撤销) //与主表同步 /// 状态(未提交,审核中,审核通过,审核驳回,撤销) 与主表
/// </summary> /// </summary>
public ReimbursementTypeEnums Status { get; set; } public ReimbursementTypeEnums Status { get; set; }
/// <summary>
/// 驳回理由 (与主表同步)
/// </summary>
public string RejectReason { get; set; }
} }
} }

@ -1,4 +1,5 @@
using DS.Module.Core.Data; using DS.Module.Core.Data;
using DS.Module.Core.Enums;
using SqlSugar; using SqlSugar;
namespace DS.WMS.Core.Fee.Entity namespace DS.WMS.Core.Fee.Entity
@ -163,7 +164,7 @@ namespace DS.WMS.Core.Fee.Entity
/// <summary> /// <summary>
/// 报销状态 bxzt /// 报销状态 bxzt
/// </summary> /// </summary>
public string? ReimbursementStatus { get; set; } public ReimbursementTypeEnums ReimbursementType { get; set; }
/// <summary> /// <summary>
/// 购方银行账号 gfyhzh /// 购方银行账号 gfyhzh

@ -1,8 +1,12 @@
using DS.Module.Core; using DS.Module.Core;
using DS.WMS.Core.Fee.Dtos; using DS.WMS.Core.Fee.Dtos;
using DS.WMS.Core.Flow.Dtos;
namespace DS.WMS.Core.Fee.Interface namespace DS.WMS.Core.Fee.Interface
{ {
/// <summary>
/// 报销模块
/// </summary>
public interface IReimbursementService public interface IReimbursementService
{ {
@ -19,7 +23,7 @@ namespace DS.WMS.Core.Fee.Interface
/// </summary> /// </summary>
/// <param name="model"></param> /// <param name="model"></param>
/// <returns></returns> /// <returns></returns>
DataResult AddReimbursement(ReimbursementReq model); Task< DataResult> AddReimbursement(ReimbursementReq model);
/// <summary> /// <summary>
/// 获取详情 /// 获取详情
@ -33,20 +37,29 @@ namespace DS.WMS.Core.Fee.Interface
/// </summary> /// </summary>
/// <param name="id"></param> /// <param name="id"></param>
/// <returns></returns> /// <returns></returns>
DataResult ReimbursementRevoked(string id); Task< DataResult> ReimbursementRevoked(string id);
/// <summary> /// <summary>
/// 报销单审批通过 /// 根据审批结果更新审批状态
/// </summary> /// </summary>
/// <param name="id"></param> ///<param name="callback">回调信息</param>
/// <returns></returns> /// <returns></returns>
DataResult ReimbursementApproved(string id); Task<DataResult> UpdateStatusAsync(FlowCallback callback);
/// <summary> /// <summary>
/// 报销单审批驳回 /// 通知审批执行人变更
/// </summary> /// </summary>
/// <param name="id"></param> /// <param name="callback">回调信息</param>
/// <returns></returns> /// <returns></returns>
DataResult ReimbursementRejected(string id); Task MarkerChangedAsync(MarkerChangedCallback callback);
/// <summary>
/// 报销单审核
/// </summary>
/// <param name="request"></param>
/// <returns></returns>
Task<DataResult> AuditAsync(AuditRequest request);
} }
} }

@ -1,8 +1,4 @@
using AngleSharp.Dom; using DS.Module.Core;
using AngleSharp.Svg.Dom;
using Autofac.Core;
using DS.Module.Core;
using DS.Module.Core.Data;
using DS.Module.Core.Enums; using DS.Module.Core.Enums;
using DS.Module.Core.Extensions; using DS.Module.Core.Extensions;
using DS.Module.SqlSugar; using DS.Module.SqlSugar;
@ -11,12 +7,11 @@ using DS.WMS.Core.Fee.Dtos;
using DS.WMS.Core.Fee.Entity; using DS.WMS.Core.Fee.Entity;
using DS.WMS.Core.Fee.Interface; using DS.WMS.Core.Fee.Interface;
using DS.WMS.Core.Flow.Dtos; using DS.WMS.Core.Flow.Dtos;
using DS.WMS.Core.Flow.Entity; using DS.WMS.Core.Flow.Interface;
using DS.WMS.Core.Invoice.Dtos;
using DS.WMS.Core.TaskInteraction.Dtos; using DS.WMS.Core.TaskInteraction.Dtos;
using DS.WMS.Core.TaskInteraction.Method; using DS.WMS.Core.TaskInteraction.Interface;
using LanguageExt.Common;
using Mapster; using Mapster;
using Masuit.Tools.Systems;
using Microsoft.Extensions.DependencyInjection; using Microsoft.Extensions.DependencyInjection;
using SqlSugar; using SqlSugar;
@ -33,7 +28,9 @@ namespace DS.WMS.Core.Fee.Method
private readonly ISaasDbService saasService; private readonly ISaasDbService saasService;
private readonly ISqlSugarClient db; private readonly ISqlSugarClient db;
private readonly IUser user; private readonly IUser user;
readonly ITaskService taskService;
Lazy<ITaskService> taskService2;
Lazy<IClientFlowInstanceService> flowService;
/// <summary> /// <summary>
/// ///
@ -45,6 +42,9 @@ namespace DS.WMS.Core.Fee.Method
saasService = _serviceProvider.GetRequiredService<ISaasDbService>(); saasService = _serviceProvider.GetRequiredService<ISaasDbService>();
db = _serviceProvider.GetRequiredService<ISqlSugarClient>(); db = _serviceProvider.GetRequiredService<ISqlSugarClient>();
user = _serviceProvider.GetRequiredService<IUser>(); user = _serviceProvider.GetRequiredService<IUser>();
taskService = serviceProvider.GetRequiredService<ITaskService>();
taskService2 = new Lazy<ITaskService>(serviceProvider.GetRequiredService<ITaskService>());
flowService = new Lazy<IClientFlowInstanceService>(serviceProvider.GetRequiredService<IClientFlowInstanceService>());
} }
/// <summary> /// <summary>
@ -58,7 +58,7 @@ namespace DS.WMS.Core.Fee.Method
var whereList = db.ConfigQuery.Context.Utilities.JsonToConditionalModels(request.QueryCondition); var whereList = db.ConfigQuery.Context.Utilities.JsonToConditionalModels(request.QueryCondition);
var tenantDb = saasService.GetBizDbScopeById(user.TenantId); var tenantDb = saasService.GetBizDbScopeById(user.TenantId);
var data = tenantDb.Queryable<Reimbursement>() var data = tenantDb.Queryable<FeeReimbursement>()
.Where(whereList) .Where(whereList)
.Select<ReimbursementRes>().ToQueryPage(request.PageCondition); .Select<ReimbursementRes>().ToQueryPage(request.PageCondition);
return data; return data;
@ -68,7 +68,7 @@ namespace DS.WMS.Core.Fee.Method
/// </summary> /// </summary>
/// <param name="req"></param> /// <param name="req"></param>
/// <returns></returns> /// <returns></returns>
public DataResult AddReimbursement(ReimbursementReq req) public async Task<DataResult> AddReimbursement(ReimbursementReq req)
{ {
var tenantDb = saasService.GetBizDbScopeById(user.TenantId); var tenantDb = saasService.GetBizDbScopeById(user.TenantId);
@ -83,38 +83,59 @@ namespace DS.WMS.Core.Fee.Method
} }
//发票报销状态 校验 待完善 //发票报销状态 校验 待完善
//if (inviceinfo.ReimbursementType == (int)ReimbursementTypeEnums.UnderReview) //报销中 if (inviceinfo.ReimbursementType == ReimbursementTypeEnums.UnderReview) //报销中
//{ {
// return DataResult.Failed($"提交失败,发票号{item.InvoiceNumber}正在报销,请检查"); return DataResult.Failed($"提交失败,发票号{item.InvoiceNumber}正在报销,请检查");
//} }
//if (inviceinfo.ReimbursementType == (int)ReimbursementTypeEnums.Approved) //已报销 if (inviceinfo.ReimbursementType == ReimbursementTypeEnums.Approved) //已报销
//{ {
// return DataResult.Failed($"提交失败,发票号{item.InvoiceNumber}已报销,请检查"); return DataResult.Failed($"提交失败,发票号{item.InvoiceNumber}已报销,请检查");
//} }
} }
#endregion #endregion
//添加主表信息 //添加主表信息
var data = req.Adapt<Reimbursement>(); var data = req.Adapt<FeeReimbursement>();
data.UserId = user.UserId; data.UserId = user.UserId;
data.ReimbursementId = "23"; //报销单编号.
var info = tenantDb.Insertable(data).ExecuteReturnEntity(); var info = tenantDb.Insertable(data).ExecuteReturnEntity();
//添加子表信息 //添加子表信息
foreach (var item in req.Data) foreach (var item in req.Data)
{ {
var dataDetail = req.Adapt<FeeReimbursementDetail>(); var dataDetail = item.Adapt<FeeReimbursementDetail>();
dataDetail.Status = ReimbursementTypeEnums.NotSubmitted; dataDetail.Status = ReimbursementTypeEnums.NotSubmitted;
dataDetail.PId = info.Id; dataDetail.PId = info.Id;
tenantDb.Insertable(dataDetail).ExecuteReturnEntity(); tenantDb.Insertable(dataDetail).ExecuteReturnEntity();
} }
var entity = tenantDb.Insertable(data).ExecuteReturnEntity();
#region 增加审批任务
var taskReq = new TaskCreationRequest()
{
BusinessId = info.Id,
TaskTypeName = TaskBaseTypeEnum.ReimbursementApproval.ToString(),
TaskTitle = $"【{TaskBaseTypeEnum.ReimbursementApproval.GetDescription()}】{user.UserName}提交的报销单审核",
TaskDescription = $"【{TaskBaseTypeEnum.ReimbursementApproval.GetDescription()}】共包含发票{req.Data.Count()}张,报销金额{req.Data.Sum(t=>t.Amount)}元",
};
var result = await taskService.CreateTaskAsync(taskReq, false);
if (!result.Succeeded)
{
return await Task.FromResult(DataResult.Failed(result.Message));
}
else
{
return DataResult.Successed("添加成功!"); return await Task.FromResult(DataResult.Successed(result.Message));
}
#endregion
} }
/// <summary> /// <summary>
@ -125,7 +146,7 @@ namespace DS.WMS.Core.Fee.Method
public DataResult<ReimbursementRes> GetReimbursementInfo(string id) public DataResult<ReimbursementRes> GetReimbursementInfo(string id)
{ {
var tenantDb = saasService.GetBizDbScopeById(user.TenantId); var tenantDb = saasService.GetBizDbScopeById(user.TenantId);
var data = tenantDb.Queryable<Reimbursement>() var data = tenantDb.Queryable<FeeReimbursement>()
.Where(a => a.Id == long.Parse(id)) .Where(a => a.Id == long.Parse(id))
.Select<ReimbursementRes>() .Select<ReimbursementRes>()
.First(); .First();
@ -140,13 +161,13 @@ namespace DS.WMS.Core.Fee.Method
/// </summary> /// </summary>
/// <param name="id"></param> /// <param name="id"></param>
/// <returns></returns> /// <returns></returns>
public DataResult ReimbursementRevoked(string id) public async Task<DataResult> ReimbursementRevoked(string id)
{ {
//查询当前报销单 //查询当前报销单
var tenantDb = saasService.GetBizDbScopeById(user.TenantId); var tenantDb = saasService.GetBizDbScopeById(user.TenantId);
var data = tenantDb.Queryable<Reimbursement>() var data = tenantDb.Queryable<FeeReimbursement>()
.Where(a => a.Id == long.Parse(id)) .Where(a => a.Id == long.Parse(id))
.Select<Reimbursement>() .Select<FeeReimbursement>()
.First(); .First();
if (data.Status != ReimbursementTypeEnums.NotSubmitted) if (data.Status != ReimbursementTypeEnums.NotSubmitted)
@ -159,7 +180,7 @@ namespace DS.WMS.Core.Fee.Method
var dataDetail = tenantDb.Queryable<FeeReimbursementDetail>() var dataDetail = tenantDb.Queryable<FeeReimbursementDetail>()
.Where(a => a.PId == long.Parse(id)) .Where(a => a.PId == long.Parse(id))
.Select<Reimbursement>() .Select<FeeReimbursement>()
.ToList(); .ToList();
foreach (var item in dataDetail) foreach (var item in dataDetail)
{ {
@ -167,71 +188,132 @@ namespace DS.WMS.Core.Fee.Method
db.Updateable(item).ExecuteCommand(); db.Updateable(item).ExecuteCommand();
} }
return DataResult.Success; //撤销审批任务
var tsreq = new TaskRequest
{
BusinessId = data.Id,
TaskTypeName = TaskBaseTypeEnum.ReimbursementApproval.ToString(),
};
var result = await taskService.WithdrawAsync(tsreq);
if (!result.Succeeded)
{
return await Task.FromResult(DataResult.Failed(result.Message));
}
else
{
return await Task.FromResult(DataResult.Successed(result.Message));
}
} }
/// <summary> /// <summary>
/// 审批通过 /// 根据审批结果更新申请单状态
/// </summary> /// </summary>
/// <param name="id"></param> /// <param name="callback">回调信息</param>
/// <returns></returns> /// <returns></returns>
public DataResult ReimbursementApproved(string id) public async Task<DataResult> UpdateStatusAsync(FlowCallback callback)
{ {
//查询当前报销单
var tenantDb = saasService.GetBizDbScopeById(user.TenantId); var tenantDb = saasService.GetBizDbScopeById(user.TenantId);
var data = tenantDb.Queryable<Reimbursement>()
.Where(a => a.Id == long.Parse(id))
.Select<Reimbursement>()
.First();
if (callback.AuditType != TaskBaseTypeEnum.ReimbursementApproval)
return DataResult.FailedWithDesc(nameof(MultiLanguageConst.NoAuditItems));
var info = await tenantDb.Queryable<FeeReimbursement>().Where(x => x.Id == callback.BusinessId).FirstAsync();
if (info.IsNull())
return await Task.FromResult(DataResult.Failed("不存在的报销单信息!"));
//审核通过
if (callback.FlowStatus == FlowStatusEnum.Approve)
{
data.Status = ReimbursementTypeEnums.Approved; info.Status = ReimbursementTypeEnums.Approved;
db.Updateable(data).ExecuteCommand(); tenantDb.Updateable(info).ExecuteCommand();
var dataDetail = tenantDb.Queryable<FeeReimbursementDetail>() var dtllist = tenantDb.Queryable<FeeReimbursementDetail>().Where(t => t.PId == info.Id).ToList();
.Where(a => a.PId == long.Parse(id)) foreach (var item in dtllist)
.Select<Reimbursement>()
.ToList();
foreach (var item in dataDetail)
{ {
item.Status = ReimbursementTypeEnums.Approved; item.Status = ReimbursementTypeEnums.Approved;
db.Updateable(item).ExecuteCommand(); tenantDb.Updateable(item).ExecuteCommand();
}
}
if (callback.FlowStatus == FlowStatusEnum.Reject)
{
info.Status = ReimbursementTypeEnums.Rejected;
info.RejectReason = callback.RejectReason;
tenantDb.Updateable(info).ExecuteCommand();
var dtllist = tenantDb.Queryable<FeeReimbursementDetail>().Where(t => t.PId == info.Id).ToList();
foreach (var item in dtllist)
{
item.Status = ReimbursementTypeEnums.Approved;
item.RejectReason = callback.RejectReason;
tenantDb.Updateable(item).ExecuteCommand();
}
} }
return DataResult.Success; return DataResult.Success;
//return rows > 0 ? DataResult.Success : DataResult.FailedWithDesc(nameof(MultiLanguageConst.Operation_Failed));
} }
/// <summary> /// <summary>
/// 审批驳回 /// 通知审批执行人变更
/// </summary> /// </summary>
/// <param name="id"></param> /// <param name="callback">回调信息</param>
/// <returns></returns> /// <returns></returns>
public DataResult ReimbursementRejected(string id) /// <exception cref="ArgumentNullException"><paramref name="callback"/>为null时引发</exception>
public virtual async Task MarkerChangedAsync(MarkerChangedCallback callback)
{ {
//查询当前报销单 //同步到钉钉
var tenantDb = saasService.GetBizDbScopeById(user.TenantId); }
var data = tenantDb.Queryable<Reimbursement>()
.Where(a => a.Id == long.Parse(id))
.Select<Reimbursement>()
.First();
/// <summary>
/// 报销单审核
/// </summary>
/// <param name="request"></param>
/// <returns></returns>
public async Task<DataResult> AuditAsync(AuditRequest request)
{
if (await taskService2.Value.HasAuthorizedAsync())
{
return await taskService2.Value.AuditAsync(new TaskAuditRequest
{
Ids = request.Ids,
Remark = request.Remark,
Result = request.Result,
TaskTypeName = TaskBaseTypeEnum.ReimbursementApproval.ToString()
});
}
data.Status = ReimbursementTypeEnums.Rejected; var list = await flowService.Value.GetInstanceByBSIdAsync(TaskBaseTypeEnum.ReimbursementApproval, ids: request.Ids);
db.Updateable(data).ExecuteCommand(); if (list.Count != request.Ids.Length)
return DataResult.FailedWithDesc(nameof(MultiLanguageConst.NotInAudit));
var dataDetail = tenantDb.Queryable<FeeReimbursementDetail>() foreach (var item in list)
.Where(a => a.PId == long.Parse(id))
.Select<Reimbursement>()
.ToList();
foreach (var item in dataDetail)
{ {
item.Status = ReimbursementTypeEnums.Rejected; var result = await flowService.Value.AuditAsync(new FlowAuditInfo
db.Updateable(item).ExecuteCommand(); {
AuditNote = request.Remark,
Status = request.Result,
Instance = item
});
if (!result.Succeeded)
return result;
} }
return DataResult.Success; return DataResult.Success;
}
}
} }
} }

@ -1,4 +1,5 @@
using DS.WMS.Core.Fee.Entity; using DS.Module.Core.Enums;
using DS.WMS.Core.Fee.Entity;
using DS.WMS.Core.QuarztJobs.Dtos; using DS.WMS.Core.QuarztJobs.Dtos;
using DS.WMS.Core.QuarztJobs.Interface; using DS.WMS.Core.QuarztJobs.Interface;
using DS.WMS.Core.QuarztJobs.Other; using DS.WMS.Core.QuarztJobs.Other;
@ -113,7 +114,7 @@ namespace DS.WMS.Core.QuarztJobs.Method
inInvoice.Amount = Iinfo.data.je; inInvoice.Amount = Iinfo.data.je;
inInvoice.SellerName = Iinfo.data.xfmc; inInvoice.SellerName = Iinfo.data.xfmc;
inInvoice.SpecialElements = Iinfo.data.tdys; inInvoice.SpecialElements = Iinfo.data.tdys;
inInvoice.ReimbursementStatus = Iinfo.data.bxzt; inInvoice.ReimbursementType = ReimbursementTypeEnums.NotSubmitted;
inInvoice.BuyerBankAccountNumber = Iinfo.data.gfyhzh; inInvoice.BuyerBankAccountNumber = Iinfo.data.gfyhzh;
inInvoice.SpecialElementTypeCode = Iinfo.data.tdyslxDm; inInvoice.SpecialElementTypeCode = Iinfo.data.tdyslxDm;
inInvoice.OperatorCode = Iinfo.data.czydm; inInvoice.OperatorCode = Iinfo.data.czydm;

@ -1,7 +1,12 @@
using DS.Module.Core; using DS.Module.Core;
using DS.WMS.Core.Fee.Dtos; using DS.WMS.Core.Fee.Dtos;
using DS.WMS.Core.Fee.Interface; using DS.WMS.Core.Fee.Interface;
using DS.WMS.Core.Flow.Dtos;
using DS.WMS.Core.TaskPlat.Dtos;
using Microsoft.AspNetCore.Mvc; using Microsoft.AspNetCore.Mvc;
using Newtonsoft.Json;
using NLog;
using System.Net;
namespace DS.WMS.FeeApi.Controllers namespace DS.WMS.FeeApi.Controllers
{ {
@ -11,7 +16,7 @@ namespace DS.WMS.FeeApi.Controllers
public class ReimbursementController : ApiController public class ReimbursementController : ApiController
{ {
readonly IReimbursementService _service; readonly IReimbursementService _service;
private static readonly Logger _logger = LogManager.GetCurrentClassLogger();
/// <summary> /// <summary>
/// 初始化 /// 初始化
/// </summary> /// </summary>
@ -21,13 +26,31 @@ namespace DS.WMS.FeeApi.Controllers
_service = service; _service = service;
} }
//1获取当前登录人收款信息 /// <summary>
// ClientBank/GetClientBankList /// 获取报销单列表列表
/// </summary>
//2获取发票列表 /// <param name="request"></param>
// feeApi/InInvoicet/GetInInvoicet /// <returns></returns>
[HttpPost]
[Route("GetReimbursementList")]
public DataResult<List<ReimbursementRes>> GetReimbursementList([FromBody] PageRequest request)
{
var res = _service.GetListByPage(request);
return res;
}
//3新增报销单,并同步到钉钉 /// <summary>
/// 获取报销单详情
/// </summary>
/// <param name="id"></param>
/// <returns></returns>
[HttpGet]
[Route("GetReimbursementInfo")]
public DataResult<ReimbursementRes> GetReimbursementInfo([FromQuery] string id)
{
var res = _service.GetReimbursementInfo(id);
return res;
}
/// <summary> /// <summary>
/// 新增 /// 新增
@ -36,14 +59,12 @@ namespace DS.WMS.FeeApi.Controllers
/// <returns></returns> /// <returns></returns>
[HttpPost] [HttpPost]
[Route("AddReimbursement")] [Route("AddReimbursement")]
public DataResult AddReimbursement([FromBody] ReimbursementReq req) public async Task<DataResult> AddReimbursement([FromBody] ReimbursementReq req)
{ {
var res = _service.AddReimbursement(req); var res =await _service.AddReimbursement(req);
return res; return res;
} }
//4未审批的报销单撤销
/// <summary> /// <summary>
/// 未审批的报销单撤销 /// 未审批的报销单撤销
/// </summary> /// </summary>
@ -51,48 +72,51 @@ namespace DS.WMS.FeeApi.Controllers
/// <returns></returns> /// <returns></returns>
[HttpPost] [HttpPost]
[Route("ReimbursementRevoked")] [Route("ReimbursementRevoked")]
public DataResult ReimbursementRevoked([FromBody] string id) public async Task<DataResult> ReimbursementRevoked([FromBody] string id)
{ {
var res = _service.ReimbursementRevoked(id); var res = await _service.ReimbursementRevoked(id);
return res; return res;
} }
//5报销单审核通过
//6报销单审核驳回
//7获取报销单列表
/// <summary> /// <summary>
/// 列表 /// 按报销单审核
/// </summary> /// </summary>
/// <param name="request"></param> /// <param name="request"></param>
/// <returns></returns> /// <returns></returns>
[HttpPost] [HttpPost, Route("Audit")]
[Route("GetReimbursementList")] public async Task<DataResult> AuditAsync([FromBody] AuditRequest request)
public DataResult<List<ReimbursementRes>> GetReimbursementList([FromBody] PageRequest request)
{ {
var res = _service.GetListByPage(request); if (request.Ids.Length == 0 || (request.Result != 1 && request.Result != 2))
return res; return DataResult.Failed("参数无效", MultiLanguageConst.IllegalRequest);
return await _service.AuditAsync(request);
} }
/// <summary>
//8获取报销单详情 /// 回调变更申请单审批状态(用于工作流框架的回调)
/// </summary>
/// <param name="callback">回调信息</param>
/// <returns></returns>
[HttpPost, Route("ChangeStatus")]
public async Task<IActionResult> ChangeStatusAsync([FromBody] FlowCallback callback)
{
var str = JsonConvert.SerializeObject(callback);
_logger.Info($"变更申请单审批状态回调,请求参数为:{str}");
await _service.UpdateStatusAsync(callback);
return StatusCode((int)HttpStatusCode.NoContent);
}
/// <summary> /// <summary>
/// 详情 /// 回调通知审批执行人变更(无需客户端手动调用)
/// </summary> /// </summary>
/// <param name="id"></param> /// <param name="callback">回调信息</param>
/// <returns></returns> /// <returns></returns>
[HttpGet] [HttpPost, Route("MarkerChanged")]
[Route("GetReimbursementInfo")] public async Task<IActionResult> MarkerChangedAsync([FromBody] MarkerChangedCallback callback)
public DataResult<ReimbursementRes> GetReimbursementInfo([FromQuery] string id)
{ {
var res = _service.GetReimbursementInfo(id); var str = JsonConvert.SerializeObject(callback);
return res; _logger.Info($"通知审批执行人变更回调,请求参数为:{str}");
await _service.MarkerChangedAsync(callback);
return StatusCode((int)HttpStatusCode.NoContent);
} }
//9财务银企直连付款接口 //9财务银企直连付款接口
@ -103,8 +127,5 @@ namespace DS.WMS.FeeApi.Controllers
//11钉钉配置相关接口 //11钉钉配置相关接口
} }
} }

Loading…
Cancel
Save