using Microsoft.AspNetCore.Mvc;
using YLErp.Modules.SwapModule;
namespace YLErp.Web.Controllers
{
public class SwapEventEmailController : BaseController
{
[MyAuthorize("结算管理-资金提示邮件")]
public ActionResult Index()
{
var swapSettlementConfgValue = AppManager.GetAppConfigValue(ConsGlobal.SwapSettlementConfigGroup,ConsGlobal.SwapSettlementConfigEmail);
ViewBag.SettlementEmail = swapSettlementConfgValue;
return View();
}
///
/// 推送列表查询json
///
///
///
[HttpPost]
public JsonResult SearchList(SwapEventEmailRequest req)
{
var eventEmailService = new SwapEventEmailService(CurUser);
var sList = eventEmailService.SearchList(req);
return Json(sList);
}
///
/// 结算岗邮件保存
///
///
///
[HttpPost]
public JsonResult SaveSettlementEmail(SaveSettlementEmailRequest req)
{
AppManager.SetAppConfigValue(ConsGlobal.SwapSettlementConfigGroup, ConsGlobal.SwapSettlementConfigEmail, req.Email, "资金提示结算岗邮件地址管理");
return JsonSuccess("保存成功");
}
[HttpPost]
public JsonResult SendEmail(SendSwapEventEmailRequest request)
{
new SwapEventEmailService(CurUser).SendEmail(request);
return JsonSuccess("发送邮件成功");
}
}
}