2025-09-25 14:37:10 +08:00
|
|
|
|
/*
|
|
|
|
|
*接口编写处...
|
|
|
|
|
*如果接口需要做Action的权限验证,请在Action上使用属性
|
|
|
|
|
*如: [ApiActionPermission("HR_EmployeeSync",Enums.ActionPermissionOptions.Search)]
|
|
|
|
|
*/
|
2025-10-09 15:46:01 +08:00
|
|
|
|
using Azure.Core;
|
|
|
|
|
using Confluent.Kafka;
|
|
|
|
|
using Microsoft.AspNetCore.Authorization;
|
2025-09-25 14:37:10 +08:00
|
|
|
|
using Microsoft.AspNetCore.Http;
|
|
|
|
|
using Microsoft.AspNetCore.Mvc;
|
|
|
|
|
using Microsoft.Extensions.DependencyInjection;
|
2025-10-09 15:46:01 +08:00
|
|
|
|
//using Quartz.Logging;
|
2025-09-25 14:37:10 +08:00
|
|
|
|
using System;
|
|
|
|
|
using System.Collections.Generic;
|
|
|
|
|
using System.Threading.Tasks;
|
|
|
|
|
using VOL.Core.Filters;
|
2025-10-09 15:46:01 +08:00
|
|
|
|
using VOL.Core.Services;
|
2025-09-30 08:59:35 +08:00
|
|
|
|
using VOL.DingTalk.Models.Biz;
|
2025-09-25 14:37:10 +08:00
|
|
|
|
using VOL.Entity.DomainModels;
|
|
|
|
|
using VOL.HR.IServices;
|
|
|
|
|
|
|
|
|
|
namespace VOL.HR.Controllers
|
|
|
|
|
{
|
|
|
|
|
public partial class HR_EmployeeSyncController
|
|
|
|
|
{
|
|
|
|
|
private readonly IHttpContextAccessor _httpContextAccessor;
|
2025-09-30 08:59:35 +08:00
|
|
|
|
private readonly IHR_EmployeeSyncService _service;//访问业务代码
|
2025-09-25 14:37:10 +08:00
|
|
|
|
[ActivatorUtilitiesConstructor]
|
|
|
|
|
public HR_EmployeeSyncController(
|
|
|
|
|
IHR_EmployeeSyncService service,
|
|
|
|
|
IHttpContextAccessor httpContextAccessor
|
|
|
|
|
)
|
|
|
|
|
: base(service)
|
|
|
|
|
{
|
|
|
|
|
_service = service;
|
|
|
|
|
_httpContextAccessor = httpContextAccessor;
|
|
|
|
|
}
|
2025-09-26 13:35:45 +08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
2025-09-30 08:59:35 +08:00
|
|
|
|
///
|
2025-09-26 13:35:45 +08:00
|
|
|
|
/// </summary>
|
|
|
|
|
/// <param name="value"></param>
|
|
|
|
|
/// <returns></returns>
|
2025-09-30 08:59:35 +08:00
|
|
|
|
[HttpPost, Route("GenEmpSystemShip")]
|
|
|
|
|
public async Task<IActionResult> GenEmpSystemShip()
|
2025-09-26 13:35:45 +08:00
|
|
|
|
{
|
2025-09-30 08:59:35 +08:00
|
|
|
|
await Service.GenEmpSystemShip();
|
|
|
|
|
return Json(new { });
|
2025-09-26 13:35:45 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
///
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <param name="value"></param>
|
|
|
|
|
/// <returns></returns>
|
|
|
|
|
[HttpPost, Route("/api/HR_DingTalkEmployees/getPageData")]
|
|
|
|
|
public async Task<IActionResult> GetAllDingTalkEmployees()
|
|
|
|
|
{
|
|
|
|
|
var emps = await Service.GetAllDingTalkEmployees();
|
|
|
|
|
return Json(emps);
|
|
|
|
|
}
|
|
|
|
|
|
2025-09-30 08:59:35 +08:00
|
|
|
|
/// <summary>
|
|
|
|
|
///
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <param name="value"></param>
|
|
|
|
|
/// <returns></returns>
|
|
|
|
|
[HttpPost, Route("/api/HR_YSEmployees/getPageData")]
|
|
|
|
|
public async Task<IActionResult> GetYSAllEmployees()
|
|
|
|
|
{
|
|
|
|
|
var emps = await Service.GetAllYSEmployees();
|
|
|
|
|
return Json(emps);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
2025-09-26 13:35:45 +08:00
|
|
|
|
/// <summary>
|
|
|
|
|
///
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <param name="value"></param>
|
|
|
|
|
/// <returns></returns>
|
2025-09-30 08:59:35 +08:00
|
|
|
|
[HttpPost, Route("UpdateEmpInfo")]
|
|
|
|
|
public async Task<IActionResult> UpdateEmpInfo(DingTalkEmployeeUpdate updateInfo)
|
2025-09-26 13:35:45 +08:00
|
|
|
|
{
|
2025-09-30 08:59:35 +08:00
|
|
|
|
await Service.UpdateEmpInfo(updateInfo);
|
2025-09-26 13:35:45 +08:00
|
|
|
|
return Json(new { });
|
|
|
|
|
}
|
2025-09-30 08:59:35 +08:00
|
|
|
|
/// <summary>
|
|
|
|
|
///
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <param name="value"></param>
|
|
|
|
|
/// <returns></returns>
|
|
|
|
|
[HttpPost, Route("SyncYSEmpToDingTalk")]
|
|
|
|
|
public async Task<IActionResult> SyncYSEmpToDingTalk([FromBody] string ysEmpId)
|
|
|
|
|
{
|
|
|
|
|
var result = await Service.SyncYSEmpToDingTalk(ysEmpId);
|
|
|
|
|
return Json(new { success=result });
|
|
|
|
|
}
|
2025-10-09 15:46:01 +08:00
|
|
|
|
/// <summary>
|
|
|
|
|
///
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <param name="value"></param>
|
|
|
|
|
/// <returns></returns>
|
|
|
|
|
[HttpPost, Route("/iuap-api-gateway/yonbip/digitalModel/product/integration/querylist"), AllowAnonymous]
|
|
|
|
|
public async Task<IActionResult> ErpApiTest( object obj)
|
|
|
|
|
{
|
|
|
|
|
Logger.Info(obj.ToString());
|
|
|
|
|
//var result = await Service.SyncYSEmpToDingTalk(ysEmpId);
|
|
|
|
|
return Json(new { message = "",code = 200 ,data=new { recordList = new List<Dictionary<string,object>>() } });
|
|
|
|
|
}
|
|
|
|
|
/// <summary>
|
|
|
|
|
///
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <param name="value"></param>
|
|
|
|
|
/// <returns></returns>
|
|
|
|
|
[HttpGet, Route("/iuap-api-auth/open-auth/selfAppAuth/getAccessToken"), AllowAnonymous]
|
|
|
|
|
public async Task<IActionResult> ErpApiTestgetAccessToken( string appKey, string timestamp,string signature)
|
|
|
|
|
{
|
|
|
|
|
//Logger.Info(obj.ToString());
|
|
|
|
|
//var result = await Service.SyncYSEmpToDingTalk(ysEmpId);
|
|
|
|
|
return Json(new { message = "00000",
|
|
|
|
|
code = "00000",
|
|
|
|
|
data=new {
|
|
|
|
|
access_token = "1111111111312",
|
|
|
|
|
expire = 60 * 60,
|
|
|
|
|
timeOutMills = DateTime.Now.AddSeconds(60*60).Microsecond } });
|
|
|
|
|
}
|
|
|
|
|
/// <summary>
|
|
|
|
|
///
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <param name="value"></param>
|
|
|
|
|
/// <returns></returns>
|
|
|
|
|
[HttpPost, Route("/iuap-api-gateway/yonbip/digitalModel/product/batchsave"), AllowAnonymous]
|
|
|
|
|
public async Task<IActionResult> ErpApiTestbatchsave(string access_token,[FromBody] object body)
|
|
|
|
|
{
|
|
|
|
|
//string body;
|
|
|
|
|
//using (var reader = new System.IO.StreamReader(Request.Body))
|
|
|
|
|
//{
|
|
|
|
|
// body = await reader.ReadToEndAsync();
|
|
|
|
|
//}
|
|
|
|
|
Logger.Info($"access_token:{access_token}");
|
|
|
|
|
Logger.Info($"body:{body}");
|
|
|
|
|
|
|
|
|
|
//Logger.Info(obj.ToString());
|
|
|
|
|
//var result = await Service.SyncYSEmpToDingTalk(ysEmpId);
|
|
|
|
|
return Json(new
|
|
|
|
|
{
|
|
|
|
|
message = "",
|
|
|
|
|
code = 200,
|
|
|
|
|
data = new
|
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
}
|
2025-09-25 14:37:10 +08:00
|
|
|
|
}
|
|
|
|
|
}
|