Commit e7ee7bcb by 纪旭 韦

getCheckBase接口

parent 97ba3478
......@@ -503,6 +503,19 @@ public ApiResponse Issued([FromBody] AllotRequest request)
}
/// <summary>
/// 查询CheckBase
/// </summary>
/// <param name="allotId"></param>
/// <returns></returns>
[Route("getCheckBase")]
[HttpGet]
public ApiResponse GetCheckBase([FromQuery]int allotId)
{
var res = _allotService.GetCheckBase(allotId);
return new ApiResponse(ResponseType.OK, res);
}
/// <summary>
/// 绩效详情计算公式显示/隐藏
/// </summary>
/// <param name="request"></param>
......
......@@ -240,6 +240,12 @@
<param name="request"></param>
<returns></returns>
</member>
<member name="M:Performance.Api.Controllers.AllotController.GetCheckBase(System.Int32)">
<summary>
查询CheckBase
</summary>
<returns></returns>
</member>
<member name="M:Performance.Api.Controllers.AllotController.UpdateAllotShowFormula(Performance.DtoModels.AllotRequest)">
<summary>
绩效详情计算公式显示/隐藏
......
......@@ -484,6 +484,23 @@ public void Generate(per_allot allot)
}
}
public Dictionary<string, object> GetCheckBase(int allotid)
{
var views = new[] { "view_check_base_emp", "view_check_base_dept" };
var names = new[] { "CheckEmp", "CheckDept" };
var dics = new Dictionary<string, object>();
for (int i = 0; i < views.Length; i++)
{
var dic = new Dictionary<string, object>()
{
{ "body",_service.QueryView(views[i],allotid)},
{ "columns",_service.QueryTableStructure(views[i])}
};
dics.Add(names[i], dic);
}
return dics;
}
/// <summary>
/// 绩效生成报表
/// </summary>
......
......@@ -302,5 +302,15 @@ public IEnumerable<dynamic> QueryTableStructure(string tableName)
return connection.Query(sql, new { tableName }, commandTimeout: 60 * 60);
}
}
public IEnumerable<dynamic> QueryView(string viewName,int allotID)
{
using (var connection = new MySqlConnection(_options.Value.PerformanceConnectionString))
{
if (connection.State != ConnectionState.Open) connection.Open();
string sql = $@"select * from {viewName} where allotID = @allotID";
return connection.Query(sql,new { allotID }, commandTimeout: 60 * 60);
}
}
}
}
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