Commit fdcbd814 by lcx

生成绩效结束后,调用存储过程

parent 6d0fa74c
...@@ -30,6 +30,21 @@ public bool UpdateAllotStates(int allotId, int states, string remark, int genera ...@@ -30,6 +30,21 @@ public bool UpdateAllotStates(int allotId, int states, string remark, int genera
} }
/// <summary> /// <summary>
/// 执行存储过程
/// </summary>
/// <param name="execsql"></param>
/// <param name="param"></param>
/// <returns></returns>
public bool ExecProc(string execsql, object param)
{
using (var connection = context.Database.GetDbConnection())
{
Execute(execsql, param);
}
return true;
}
/// <summary>
/// 只支持EXCEL抽取报表数据 /// 只支持EXCEL抽取报表数据
/// </summary> /// </summary>
/// <param name="import"></param> /// <param name="import"></param>
......
...@@ -442,9 +442,11 @@ public void Generate(per_allot allot, string mail) ...@@ -442,9 +442,11 @@ public void Generate(per_allot allot, string mail)
perforCofdirectorRepository.SupplementaryData(allot.ID); perforCofdirectorRepository.SupplementaryData(allot.ID);
logManageService.WriteMsg("正在生成报表数据", "正在生成报表数据", 1, allot.ID, "ReceiveMessage", true); logManageService.WriteMsg("正在生成报表数据", "正在生成报表数据", 1, allot.ID, "ReceiveMessage", true);
var res = reportService.ImportData(allot); //var res = reportService.ImportData(allot);
var flag = reportService.UpdateData(allot); //var flag = reportService.UpdateData(allot);
logManageService.WriteMsg("正在生成报表数据", $"报表数据生成完成;受影响:{res}行", 1, allot.ID, "ReceiveMessage", true); //logManageService.WriteMsg("正在生成报表数据", $"报表数据生成完成;受影响:{res}行", 1, allot.ID, "ReceiveMessage", true);
reportService.ExecProc("call proc_report_performance(@hospitalid, @year, @month);", new { allot.HospitalId, allot.Year, allot.Month });
////发送邮件 ////发送邮件
//logManageService.WriteMsg("正在发送邮件", "正在发送邮件", 1, allot.ID, "ReceiveMessage", true); //logManageService.WriteMsg("正在发送邮件", "正在发送邮件", 1, allot.ID, "ReceiveMessage", true);
......
using Microsoft.Extensions.Logging; using Microsoft.Extensions.Logging;
using Performance.DtoModels; using Performance.DtoModels;
using Performance.EntityModels; using Performance.EntityModels;
using Performance.Infrastructure;
using Performance.Repository; using Performance.Repository;
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
...@@ -384,5 +385,22 @@ public List<PerReport> MenuReport(ReportRequest request) ...@@ -384,5 +385,22 @@ public List<PerReport> MenuReport(ReportRequest request)
return report; return report;
} }
/// <summary>
/// 执行存储过程
/// </summary>
/// <param name="allot"></param>
/// <returns></returns>
public void ExecProc(string execsql, object param)
{
try
{
perforPerallotRepository.Execute(execsql, param);
}
catch (Exception ex)
{
logger.LogError($"执行存储过程时发生异常,sql:{execsql};参数:{JsonHelper.Serialize(param)};异常:{ex.Message};");
}
}
} }
} }
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment