#EQD-6425 国联民生-衍生品系统移动审批(提交OA流程) - 审批节点支持配置“关联OA移动审批” - 创建OA流程并记录请求、requestId、状态及异常备注 - 支持OA轮询同步审批通过、退回和归档状态 - 本地通过、拒绝、撤回时同步强制归档未结束OA流程 - 增加审批列表OA备注展示及本地Mock联调接口 - 新增OA审批记录表和数据库升级脚本 - OA移动审批使用独立查询地址及isnextflow配置,不影响交易确认书OA
26 lines
1.1 KiB
C#
26 lines
1.1 KiB
C#
using System.Text.Json;
|
|
using YLErp.Helpers;
|
|
using YLErp.Model;
|
|
using YLErp.Modules.TradeModule;
|
|
|
|
namespace YLErp.Web.WebAPI.Controllers
|
|
{
|
|
/// <summary>国联民生衍生品移动审批轮询入口,由 PowerJob 等外部调度器调用。</summary>
|
|
[ApiController]
|
|
public class TradeApprovalOAJobController : ControllerBase
|
|
{
|
|
[HttpPost]
|
|
[Route("api/job/tradeApproval/syncOAStatus")]
|
|
public JsonResult SyncOAStatus([FromQuery] string requestId = null)
|
|
{
|
|
var configKey = AppManager.GetConfiguration()["JobConfig:ApiKey"];
|
|
if (!string.IsNullOrEmpty(configKey) && Request.Headers["X-Job-Api-Key"].FirstOrDefault() != configKey)
|
|
return new JsonResult(new { code = 401, msg = "Invalid API Key" });
|
|
|
|
var user = new OptUserInfo(0, "系统移动审批同步", OptUserFrom.System);
|
|
var messages = new TradeApprovalOAService(user).SyncPendingStatuses(requestId);
|
|
return new JsonResult(new { code = 0, data = new { total = messages.Count, details = messages } }, new JsonSerializerOptions { PropertyNamingPolicy = JsonNamingPolicy.CamelCase });
|
|
}
|
|
}
|
|
}
|