Commit 579b37c8 by lcx

Merge branch '读取excel抽取' into 20200618合并分支

# Conflicts:
#	performance/Performance.Api/appsettings.Development.json
#	performance/Performance.Api/appsettings.Localhost.json
parents 06d1887e 6ba8fc88
......@@ -24,8 +24,7 @@ namespace Performance.Api.Controllers
public class TemplateController : Controller
{
private readonly TemplateService templateService;
private readonly ExtractService extractService;
private readonly NewExtractService newExtractService;
private readonly DFExtractService extractService;
private HospitalService hospitalService;
private IHostingEnvironment env;
private ClaimService claim;
......@@ -36,8 +35,7 @@ public class TemplateController : Controller
public TemplateController(TemplateService templateService,
HospitalService hospitalService,
ExtractService extractService,
NewExtractService newExtractService,
DFExtractService extractService,
IHostingEnvironment env,
ClaimService claim,
IOptions<Application> options,
......@@ -47,7 +45,6 @@ public class TemplateController : Controller
{
this.templateService = templateService;
this.extractService = extractService;
this.newExtractService = newExtractService;
this.hospitalService = hospitalService;
this.env = env;
this.claim = claim;
......@@ -145,66 +142,66 @@ public ApiResponse Import([FromForm] IFormCollection form)
}
#region 老版提取
/// <summary>
/// 提取绩效数据
/// </summary>
/// <param name="request"></param>
/// <returns></returns>
[Route("extractdata")]
[HttpPost]
public ApiResponse ExtractData([CustomizeValidator(RuleSet = "Template"), FromBody]AllotRequest request)
{
try
{
var allot = allotService.GetAllot(request.ID);
if (allot == null)
return new ApiResponse(ResponseType.Fail, "该绩效无效");
allot.IsExtracting = allot.IsExtracting ?? 0;
if (allot.IsExtracting == 1)
return new ApiResponse(ResponseType.Fail, "正在提取数据,请稍等。");
///// <summary>
///// 提取绩效数据
///// </summary>
///// <param name="request"></param>
///// <returns></returns>
//[Route("extractdata")]
//[HttpPost]
//public ApiResponse ExtractData([CustomizeValidator(RuleSet = "Template"), FromBody]AllotRequest request)
//{
// try
// {
// var allot = allotService.GetAllot(request.ID);
// if (allot == null)
// return new ApiResponse(ResponseType.Fail, "该绩效无效");
// allot.IsExtracting = allot.IsExtracting ?? 0;
// if (allot.IsExtracting == 1)
// return new ApiResponse(ResponseType.Fail, "正在提取数据,请稍等。");
var hospital = hospitalService.GetHopital(request.HospitalId.Value);
if (hospital == null)
return new ApiResponse(ResponseType.Fail, "医院无效");
// var hospital = hospitalService.GetHopital(request.HospitalId.Value);
// if (hospital == null)
// return new ApiResponse(ResponseType.Fail, "医院无效");
var email = claim.GetUserClaim(JwtClaimTypes.Mail);
allot.IsExtracting = 1;
allotService.Update(allot);
string path = extractService.GetFilepath(hospital.ID, out int type);
if (!string.IsNullOrEmpty(path) && type != 0)
{
//发送请求,返回路径
string retJson = HttpHelper.HttpClient(url.ImportFirst + $"?type={type}&hospitalId={hospital.ID}&year={allot.Year}&month={allot.Month}", path);
var ret = JsonHelper.Deserialize<ApiResponse>(retJson);
if ((int)ret.State != 1)
return new ApiResponse(ResponseType.Fail, "首次模板地址无效!");
path = ret.Message;
}
// var email = claim.GetUserClaim(JwtClaimTypes.Mail);
// allot.IsExtracting = 1;
// allotService.Update(allot);
// string path = extractService.GetFilepath(hospital.ID, out int type);
// if (!string.IsNullOrEmpty(path) && type != 0)
// {
// //发送请求,返回路径
// string retJson = HttpHelper.HttpClient(url.ImportFirst + $"?type={type}&hospitalId={hospital.ID}&year={allot.Year}&month={allot.Month}", path);
// var ret = JsonHelper.Deserialize<ApiResponse>(retJson);
// if ((int)ret.State != 1)
// return new ApiResponse(ResponseType.Fail, "首次模板地址无效!");
// path = ret.Message;
// }
string param = JsonHelper.Serialize(new
{
id = request.ID,
hospitalId = hospital.ID,
mail = email,
path = path
});
// string param = JsonHelper.Serialize(new
// {
// id = request.ID,
// hospitalId = hospital.ID,
// mail = email,
// path = path
// });
HttpHelper.HttpPostNoRequest(url.ExtractData, param, true);
//extractService.ExtractData(request.ID, user.Mail, hospital);
//BackgroundJob.Enqueue(() => extractService.ExtractData(request.ID, user.Mail, hospital));
return new ApiResponse(ResponseType.OK, "HIS绩效数据提取任务正在执行,稍后我们将以邮件的通知您!");
}
catch (Exception ex)
{
var allot = allotService.GetAllot(request.ID);
if (allot != null)
{
allot.IsExtracting = 3;
allotService.Update(allot);
}
throw ex;
}
}
// HttpHelper.HttpPostNoRequest(url.ExtractData, param, true);
// //extractService.ExtractData(request.ID, user.Mail, hospital);
// //BackgroundJob.Enqueue(() => extractService.ExtractData(request.ID, user.Mail, hospital));
// return new ApiResponse(ResponseType.OK, "HIS绩效数据提取任务正在执行,稍后我们将以邮件的通知您!");
// }
// catch (Exception ex)
// {
// var allot = allotService.GetAllot(request.ID);
// if (allot != null)
// {
// allot.IsExtracting = 3;
// allotService.Update(allot);
// }
// throw ex;
// }
//}
#endregion
#region 新版提取
......@@ -223,7 +220,7 @@ public ApiResponse NewExtractData([CustomizeValidator, FromBody]ExtractRequest r
// 判断是那种抽取
try
{
string message = newExtractService.Judge(request.AllotId, request.HospitalId, request.UseScheme, out string filePath);
string message = extractService.Judge(request.AllotId, request.HospitalId, request.UseScheme, out string filePath);
if (!string.IsNullOrEmpty(message))
return new ApiResponse(ResponseType.Fail, message);
......
......@@ -22,13 +22,15 @@
"DirectorRole": "4",
//特殊科室二次绩效管理员
"SpecialRole": "9",
// 抽取结果Excel文件保存地址
"AbsolutePath": "E:\\wwwroot\\testjx.suvalue.com",
// 抽取结果Excel文件保存地址 更替的 网络地址
"HttpPath": "http://testjx.suvalue.com:81"
},
"WebapiUrl": {
"ImportFirst": "http://localhost:50997/api/extract/import",
"ExtractData": "http://localhost:50997/api/extract/index",
// 抽取结果保存地址
"ImportFile": "http://localhost:5001/api/template/savefile",
// 抽取uri
"HttpPost": "http://localhost:50997/api"
}
}
......@@ -23,14 +23,16 @@
"DirectorRole": "4",
//特殊科室二次绩效管理员
"SpecialRole": "9",
// 抽取结果Excel文件保存地址
"AbsolutePath": "E:\\wwwroot\\testjx.suvalue.com",
// 抽取结果Excel文件保存地址 更替的 网络地址
"HttpPath": "http://testjx.suvalue.com:81",
"SwaggerEndpoint": "/swagger/v1/swagger.json"
},
"WebapiUrl": {
"ImportFirst": "http://localhost:50997/api/extract/import",
"ExtractData": "http://localhost:50997/api/extract/index",
// 抽取结果保存地址
"ImportFile": "http://localhost:5001/api/template/savefile",
// 抽取uri
"HttpPost": "http://localhost:50997/api"
}
}
......@@ -38,14 +38,16 @@
"SpecialRole": "9",
//邮件指定接收人
"Receiver": [ "chengxiang.li@suvalue.com", "486035085@qq.com" ],
// 抽取结果Excel文件保存地址
"AbsolutePath": "E:\\wwwroot\\testjx.suvalue.com",
// 抽取结果Excel文件保存地址 更替的 网络地址
"HttpPath": "http://testjx.suvalue.com:81",
"SwaggerEndpoint": "/api/swagger/v1/swagger.json"
},
"WebapiUrl": {
"ImportFirst": "http://localhost:50997/api/extract/import",
"ExtractData": "http://localhost:50997/api/extract/index",
// 抽取结果保存地址
"ImportFile": "http://localhost:5001/api/template/savefile",
// 抽取uri
"HttpPost": "http://localhost:50997/api"
}
}
......@@ -6,15 +6,15 @@ namespace Performance.DtoModels.AppSettings
{
public class WebapiUrl
{
/// <summary>
/// 上传首次模板文件
/// </summary>
public string ImportFirst { get; set; }
///// <summary>
///// 上传首次模板文件
///// </summary>
//public string ImportFirst { get; set; }
/// <summary>
/// 抽取数据地址
/// </summary>
public string ExtractData { get; set; }
///// <summary>
///// 抽取数据地址
///// </summary>
//public string ExtractData { get; set; }
/// <summary>
/// 上传文件地址
......
......@@ -30,7 +30,7 @@ public class ItemListRequest
public Nullable<int> ModuleId { get; set; }
/// <summary> 新增项 </summary>
public List<mod_item> Items { get; set; }
public List<ex_item> Items { get; set; }
}
}
......@@ -13,7 +13,7 @@ public class ModModuleRequest
/// <summary> 医院Id </summary>
public Nullable<int> HospitalId { get; set; }
public Nullable<int> ExtractId { get; set; }
public Nullable<int> TypeId { get; set; }
/// <summary>
/// 数据库地址
......
......@@ -21,6 +21,6 @@ public class SpecialListRequest
public int HospitalId { get; set; }
/// <summary> 特殊考核项 </summary>
public List<mod_special> Items { get; set; }
public List<ex_special> Items { get; set; }
}
}
//-----------------------------------------------------------------------
// <copyright file=" ex_item.cs">
// * FileName: .cs
// </copyright>
//-----------------------------------------------------------------------
using System;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
namespace Performance.EntityModels
{
/// <summary>
///
/// </summary>
[Table("ex_item")]
public class ex_item
{
/// <summary>
///
/// </summary>
[Key]
public int Id { get; set; }
/// <summary>
///
/// </summary>
public Nullable<int> ModuleId { get; set; }
/// <summary>
/// 绩效考核项
/// </summary>
public string ItemName { get; set; }
/// <summary>
/// 默认系数或医生系数
/// </summary>
public Nullable<decimal> FactorValue1 { get; set; }
/// <summary>
/// 护理系数
/// </summary>
public Nullable<decimal> FactorValue2 { get; set; }
/// <summary>
/// 医技系数
/// </summary>
public Nullable<decimal> FactorValue3 { get; set; }
/// <summary>
///
/// </summary>
public Nullable<int> TypeId { get; set; }
/// <summary>
/// 数据库地址
/// </summary>
public Nullable<int> ConfigId { get; set; }
/// <summary>
/// 只读 0、否 1、是
/// </summary>
public Nullable<int> ReadOnly { get; set; }
}
}
//-----------------------------------------------------------------------
// <copyright file=" ex_module.cs">
// * FileName: .cs
// </copyright>
//-----------------------------------------------------------------------
using System;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
namespace Performance.EntityModels
{
/// <summary>
///
/// </summary>
[Table("ex_module")]
public class ex_module
{
/// <summary>
///
/// </summary>
[Key]
public int Id { get; set; }
/// <summary>
///
/// </summary>
public Nullable<int> HospitalId { get; set; }
/// <summary>
///
/// </summary>
public Nullable<int> SheetType { get; set; }
/// <summary>
///
/// </summary>
public string ModuleName { get; set; }
/// <summary>
///
/// </summary>
public string Description { get; set; }
/// <summary>
///
/// </summary>
public Nullable<int> TypeId { get; set; }
/// <summary>
/// 数据库地址
/// </summary>
public Nullable<int> ConfigId { get; set; }
/// <summary>
/// 只读 0、否 1、是
/// </summary>
public Nullable<int> ReadOnly { get; set; }
}
}
//-----------------------------------------------------------------------
// <copyright file=" ex_result.cs">
// * FileName: .cs
// </copyright>
//-----------------------------------------------------------------------
using System;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
namespace Performance.EntityModels
{
/// <summary>
///
/// </summary>
[Table("ex_result")]
public class ex_result
{
/// <summary>
///
/// </summary>
[Key]
public int Id { get; set; }
/// <summary>
///
/// </summary>
public int AllotId { get; set; }
/// <summary>
/// 科室
/// </summary>
public string Department { get; set; }
/// <summary>
/// 费用类型
/// </summary>
public string Category { get; set; }
/// <summary>
/// 费用
/// </summary>
public Nullable<decimal> Fee { get; set; }
/// <summary>
/// 来源
/// </summary>
public string Source { get; set; }
/// <summary>
/// 数据库类型1、Sql Server 2、Orcale
/// </summary>
public int DatabaseType { get; set; }
/// <summary>
/// 数据库配置Id
/// </summary>
public int ConfigId { get; set; }
}
}
//-----------------------------------------------------------------------
// <copyright file=" ex_script.cs">
// * FileName: .cs
// </copyright>
//-----------------------------------------------------------------------
using System;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
namespace Performance.EntityModels
{
/// <summary>
///
/// </summary>
[Table("ex_script")]
public class ex_script
{
/// <summary>
///
/// </summary>
[Key]
public int Id { get; set; }
/// <summary>
/// 执行sql
/// </summary>
public string ExecScript { get; set; }
/// <summary>
/// 数据库类型1、Sql Server 2、Orcale
/// </summary>
public int DatabaseType { get; set; }
/// <summary>
/// ExTypeId
/// </summary>
public int TypeId { get; set; }
/// <summary>
/// 是否可用 1 可用 2 不可用
/// </summary>
public int IsEnable { get; set; }
}
}
//-----------------------------------------------------------------------
// <copyright file=" ex_special.cs">
// * FileName: .cs
// </copyright>
//-----------------------------------------------------------------------
using System;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
namespace Performance.EntityModels
{
/// <summary>
///
/// </summary>
[Table("ex_special")]
public class ex_special
{
/// <summary>
///
/// </summary>
[Key]
public int Id { get; set; }
/// <summary>
///
/// </summary>
public Nullable<int> HospitalId { get; set; }
/// <summary>
/// 科室
/// </summary>
public string Department { get; set; }
/// <summary>
/// 量化指标
/// </summary>
public string Target { get; set; }
/// <summary>
/// 量化指标绩效分值
/// </summary>
public Nullable<decimal> TargetFactor { get; set; }
/// <summary>
/// 调节系数
/// </summary>
public Nullable<decimal> AdjustFactor { get; set; }
/// <summary>
/// 抽取绩效值SQL
/// </summary>
public Nullable<int> TypeId { get; set; }
/// <summary>
/// 数据库地址
/// </summary>
public Nullable<int> ConfigId { get; set; }
}
}
//-----------------------------------------------------------------------
// <copyright file=" ex_type.cs">
// * FileName: .cs
// </copyright>
//-----------------------------------------------------------------------
using System;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
namespace Performance.EntityModels
{
/// <summary>
///
/// </summary>
[Table("ex_type")]
public class ex_type
{
/// <summary>
///
/// </summary>
[Key]
public int Id { get; set; }
/// <summary>
/// 医院Id
/// </summary>
public int HospitalId { get; set; }
/// <summary>
/// 名称
/// </summary>
public string EName { get; set; }
/// <summary>
/// 描述
/// </summary>
public string Description { get; set; }
/// <summary>
/// 来源
/// </summary>
public int Source { get; set; }
}
}
//-----------------------------------------------------------------------
// <copyright file=" mod_extract.cs">
// * FileName: 医院数据提取脚本.cs
// </copyright>
//-----------------------------------------------------------------------
using System;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
////-----------------------------------------------------------------------
//// <copyright file=" mod_extract.cs">
//// * FileName: 医院数据提取脚本.cs
//// </copyright>
////-----------------------------------------------------------------------
//using System;
//using System.ComponentModel.DataAnnotations;
//using System.ComponentModel.DataAnnotations.Schema;
namespace Performance.EntityModels
{
/// <summary>
/// 医院数据提取脚本
/// </summary>
[Table("mod_extract")]
public class mod_extract
{
/// <summary>
///
/// </summary>
[Key]
public int Id { get; set; }
//namespace Performance.EntityModels
//{
// /// <summary>
// /// 医院数据提取脚本
// /// </summary>
// [Table("mod_extract")]
// public class mod_extract
// {
// /// <summary>
// ///
// /// </summary>
// [Key]
// public int Id { get; set; }
/// <summary>
/// 医院ID
/// </summary>
public Nullable<int> HospitalId { get; set; }
// /// <summary>
// /// 医院ID
// /// </summary>
// public Nullable<int> HospitalId { get; set; }
/// <summary>
/// 当前脚本提取内容名称
/// </summary>
public string EName { get; set; }
// /// <summary>
// /// 当前脚本提取内容名称
// /// </summary>
// public string EName { get; set; }
/// <summary>
/// 执行脚本
/// </summary>
public string ExecuteScript { get; set; }
// /// <summary>
// /// 执行脚本
// /// </summary>
// public string ExecuteScript { get; set; }
/// <summary>
/// 当前脚本类型 1 收入整表 2 单项数据提取
/// </summary>
public Nullable<int> ExecuteType { get; set; }
// /// <summary>
// /// 当前脚本类型 1 收入整表 2 单项数据提取
// /// </summary>
// public Nullable<int> ExecuteType { get; set; }
/// <summary>
/// 数据库来源类型 1 标准库 2 绩效库
/// </summary>
public Nullable<int> SourceType { get; set; }
// /// <summary>
// /// 数据库来源类型 1 标准库 2 绩效库
// /// </summary>
// public Nullable<int> SourceType { get; set; }
/// <summary>
/// 描述
/// </summary>
public string Description { get; set; }
// /// <summary>
// /// 描述
// /// </summary>
// public string Description { get; set; }
/// <summary>
/// 是否可用 1 可用 2 不可用
/// </summary>
public Nullable<int> IsEnable { get; set; }
}
}
// /// <summary>
// /// 是否可用 1 可用 2 不可用
// /// </summary>
// public Nullable<int> IsEnable { get; set; }
// }
//}
//-----------------------------------------------------------------------
// <copyright file=" mod_item.cs">
// * FileName: .cs
// </copyright>
//-----------------------------------------------------------------------
using System;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
////-----------------------------------------------------------------------
//// <copyright file=" mod_item.cs">
//// * FileName: .cs
//// </copyright>
////-----------------------------------------------------------------------
//using System;
//using System.ComponentModel.DataAnnotations;
//using System.ComponentModel.DataAnnotations.Schema;
namespace Performance.EntityModels
{
/// <summary>
///
/// </summary>
[Table("mod_item")]
public class mod_item
{
/// <summary>
///
/// </summary>
[Key]
public int Id { get; set; }
//namespace Performance.EntityModels
//{
// /// <summary>
// ///
// /// </summary>
// [Table("mod_item")]
// public class mod_item
// {
// /// <summary>
// ///
// /// </summary>
// [Key]
// public int Id { get; set; }
/// <summary>
///
/// </summary>
public Nullable<int> ModuleId { get; set; }
// /// <summary>
// ///
// /// </summary>
// public Nullable<int> ModuleId { get; set; }
/// <summary>
/// 绩效考核项
/// </summary>
public string ItemName { get; set; }
// /// <summary>
// /// 绩效考核项
// /// </summary>
// public string ItemName { get; set; }
/// <summary>
/// 默认系数或医生系数
/// </summary>
public Nullable<decimal> FactorValue1 { get; set; }
// /// <summary>
// /// 默认系数或医生系数
// /// </summary>
// public Nullable<decimal> FactorValue1 { get; set; }
/// <summary>
/// 护理系数
/// </summary>
public Nullable<decimal> FactorValue2 { get; set; }
// /// <summary>
// /// 护理系数
// /// </summary>
// public Nullable<decimal> FactorValue2 { get; set; }
/// <summary>
/// 医技系数
/// </summary>
public Nullable<decimal> FactorValue3 { get; set; }
// /// <summary>
// /// 医技系数
// /// </summary>
// public Nullable<decimal> FactorValue3 { get; set; }
/// <summary>
/// 抽取绩效值SQL
/// </summary>
public Nullable<int> ExtractId { get; set; }
// /// <summary>
// /// 抽取绩效值SQL
// /// </summary>
// public Nullable<int> ExtractId { get; set; }
/// <summary>
/// 数据库地址
/// </summary>
public Nullable<int> ConfigId { get; set; }
// /// <summary>
// /// 数据库地址
// /// </summary>
// public Nullable<int> ConfigId { get; set; }
/// <summary>
/// 用户选定抽取范围
/// </summary>
public string SelectionRange { get; set; }
// /// <summary>
// /// 用户选定抽取范围
// /// </summary>
// public string SelectionRange { get; set; }
/// <summary>
/// 只读 0、否 1、是
/// </summary>
public Nullable<int> ReadOnly { get; set; }
}
}
// /// <summary>
// /// 只读 0、否 1、是
// /// </summary>
// public Nullable<int> ReadOnly { get; set; }
// }
//}
//-----------------------------------------------------------------------
// <copyright file=" mod_module.cs">
// * FileName: .cs
// </copyright>
//-----------------------------------------------------------------------
using System;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
////-----------------------------------------------------------------------
//// <copyright file=" mod_module.cs">
//// * FileName: .cs
//// </copyright>
////-----------------------------------------------------------------------
//using System;
//using System.ComponentModel.DataAnnotations;
//using System.ComponentModel.DataAnnotations.Schema;
namespace Performance.EntityModels
{
/// <summary>
///
/// </summary>
[Table("mod_module")]
public class mod_module
{
/// <summary>
///
/// </summary>
[Key]
public int Id { get; set; }
//namespace Performance.EntityModels
//{
// /// <summary>
// ///
// /// </summary>
// [Table("mod_module")]
// public class mod_module
// {
// /// <summary>
// ///
// /// </summary>
// [Key]
// public int Id { get; set; }
/// <summary>
///
/// </summary>
public Nullable<int> HospitalId { get; set; }
// /// <summary>
// ///
// /// </summary>
// public Nullable<int> HospitalId { get; set; }
/// <summary>
///
/// </summary>
public Nullable<int> SheetType { get; set; }
// /// <summary>
// ///
// /// </summary>
// public Nullable<int> SheetType { get; set; }
/// <summary>
///
/// </summary>
public string ModuleName { get; set; }
// /// <summary>
// ///
// /// </summary>
// public string ModuleName { get; set; }
/// <summary>
///
/// </summary>
public string Description { get; set; }
// /// <summary>
// ///
// /// </summary>
// public string Description { get; set; }
/// <summary>
/// 提取脚本ID
/// </summary>
public Nullable<int> ExtractId { get; set; }
// /// <summary>
// /// 提取脚本ID
// /// </summary>
// public Nullable<int> ExtractId { get; set; }
/// <summary>
/// 数据库地址
/// </summary>
public Nullable<int> ConfigId { get; set; }
// /// <summary>
// /// 数据库地址
// /// </summary>
// public Nullable<int> ConfigId { get; set; }
/// <summary>
/// 只读 0、否 1、是
/// </summary>
public Nullable<int> ReadOnly { get; set; }
// /// <summary>
// /// 只读 0、否 1、是
// /// </summary>
// public Nullable<int> ReadOnly { get; set; }
/// <summary>
/// 是否生成Item 0、否 1、是
/// </summary>
public Nullable<int> IsGenerated { get; set; }
}
}
// /// <summary>
// /// 是否生成Item 0、否 1、是
// /// </summary>
// public Nullable<int> IsGenerated { get; set; }
// }
//}
//-----------------------------------------------------------------------
// <copyright file=" mod_special.cs">
// * FileName: .cs
// </copyright>
//-----------------------------------------------------------------------
using System;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
////-----------------------------------------------------------------------
//// <copyright file=" mod_special.cs">
//// * FileName: .cs
//// </copyright>
////-----------------------------------------------------------------------
//using System;
//using System.ComponentModel.DataAnnotations;
//using System.ComponentModel.DataAnnotations.Schema;
namespace Performance.EntityModels
{
/// <summary>
///
/// </summary>
[Table("mod_special")]
public class mod_special
{
/// <summary>
///
/// </summary>
[Key]
public int Id { get; set; }
//namespace Performance.EntityModels
//{
// /// <summary>
// ///
// /// </summary>
// [Table("mod_special")]
// public class mod_special
// {
// /// <summary>
// ///
// /// </summary>
// [Key]
// public int Id { get; set; }
/// <summary>
///
/// </summary>
public Nullable<int> HospitalId { get; set; }
// /// <summary>
// ///
// /// </summary>
// public Nullable<int> HospitalId { get; set; }
/// <summary>
/// 科室
/// </summary>
public string Department { get; set; }
// /// <summary>
// /// 科室
// /// </summary>
// public string Department { get; set; }
/// <summary>
/// 量化指标
/// </summary>
public string Target { get; set; }
// /// <summary>
// /// 量化指标
// /// </summary>
// public string Target { get; set; }
/// <summary>
/// 量化指标绩效分值
/// </summary>
public Nullable<decimal> TargetFactor { get; set; }
// /// <summary>
// /// 量化指标绩效分值
// /// </summary>
// public Nullable<decimal> TargetFactor { get; set; }
/// <summary>
/// 调节系数
/// </summary>
public Nullable<decimal> AdjustFactor { get; set; }
// /// <summary>
// /// 调节系数
// /// </summary>
// public Nullable<decimal> AdjustFactor { get; set; }
/// <summary>
/// 抽取绩效值SQL
/// </summary>
public Nullable<int> ExtractId { get; set; }
// /// <summary>
// /// 抽取绩效值SQL
// /// </summary>
// public Nullable<int> ExtractId { get; set; }
/// <summary>
/// 数据库地址
/// </summary>
public Nullable<int> ConfigId { get; set; }
}
}
// /// <summary>
// /// 数据库地址
// /// </summary>
// public Nullable<int> ConfigId { get; set; }
// }
//}
......@@ -82,7 +82,7 @@ public class per_allot
public Nullable<int> IsExtracting { get; set; }
/// <summary>
/// 1、人事科提交重新生成
/// 1、人事科提交重新生成 2、生成成功 3、原始数据修改
/// </summary>
public int Generate { get; set; }
......
......@@ -21,24 +21,18 @@ namespace Performance.Extract.Api.Controllers
[Route("api/[controller]")]
public class ExtractController : Controller
{
private readonly ExtractService extractService;
private readonly NewExtractService newExtractService;
private readonly DFExtractService dfExtractService;
private readonly DFExtractService extractService;
private readonly HospitalService hospitalService;
private readonly WebapiUrl url;
private readonly ILogger<ExtractController> logger;
private readonly IHostingEnvironment evn;
public ExtractController(ExtractService extractService,
NewExtractService newExtractService,
DFExtractService dfExtractService,
public ExtractController(DFExtractService extractService,
HospitalService hospitalService,
IOptions<WebapiUrl> url,
ILogger<ExtractController> logger,
IHostingEnvironment evn)
{
this.extractService = extractService;
this.newExtractService = newExtractService;
this.dfExtractService = dfExtractService;
this.hospitalService = hospitalService;
this.url = url.Value;
this.logger = logger;
......@@ -80,34 +74,34 @@ public ApiResponse Import([FromForm] IFormCollection form, int type, int hospita
return new ApiResponse(ResponseType.Error, "获取首次文件失败!");
}
/// <summary>
/// 提取数据
/// </summary>
/// <param name="request"></param>
[HttpPost]
[Route("index")]
public void Index([FromBody]AllotRequest request)
{
var token = Guid.NewGuid().ToString("N");
logger.LogInformation(token + ",开始提取数据,请求参数:" + JsonHelper.Serialize(request));
var hospital = hospitalService.GetHopital(request.HospitalId.Value);
var filepath = extractService.ExtractData(request.ID, request.Mail, hospital, request.Path);
if (!string.IsNullOrEmpty(filepath) && FileHelper.IsExistFile(filepath))
{
int i = 1;
while (i <= 5)
{
string retJson = HttpHelper.HttpClient(url.ImportFile + $"?allotId={request.ID}&hospitalId={hospital.ID}", filepath);
logger.LogInformation(retJson);
var ret = JsonHelper.Deserialize<ApiResponse>(retJson);
if ((int)ret.State == 1)
break;
i++;
}
}
logger.LogInformation(token + ",提取结束,请求参数:" + JsonHelper.Serialize(request));
}
///// <summary>
///// 提取数据
///// </summary>
///// <param name="request"></param>
//[HttpPost]
//[Route("index")]
//public void Index([FromBody]AllotRequest request)
//{
// var token = Guid.NewGuid().ToString("N");
// logger.LogInformation(token + ",开始提取数据,请求参数:" + JsonHelper.Serialize(request));
// var hospital = hospitalService.GetHopital(request.HospitalId.Value);
// var filepath = extractService.ExtractData(request.ID, request.Mail, hospital, request.Path);
// if (!string.IsNullOrEmpty(filepath) && FileHelper.IsExistFile(filepath))
// {
// int i = 1;
// while (i <= 5)
// {
// string retJson = HttpHelper.HttpClient(url.ImportFile + $"?allotId={request.ID}&hospitalId={hospital.ID}", filepath);
// logger.LogInformation(retJson);
// var ret = JsonHelper.Deserialize<ApiResponse>(retJson);
// if ((int)ret.State == 1)
// break;
// i++;
// }
// }
// logger.LogInformation(token + ",提取结束,请求参数:" + JsonHelper.Serialize(request));
//}
#region 新版提取
......@@ -155,7 +149,7 @@ public void ExtractData([FromForm] IFormCollection form, int allotId, int hospit
#endregion
//string filePath = newExtractService.ExtractData(allotId, request.Email, hospitalId);
string filePath = dfExtractService.ExtractData(allotId, email, hospitalId, path); //抽取
string filePath = extractService.ExtractData(allotId, email, hospitalId, path); //抽取
#region 保存文件到网站下
......
......@@ -15,13 +15,13 @@ namespace Performance.Extract.Api.Controllers
public class ModExtractController : Controller
{
private readonly ILogger<ModExtractController> logger;
private ModExtractService modExtractService;
private ExConfigService service;
public ModExtractController(
ILogger<ModExtractController> logger,
ModExtractService modExtractService)
ExConfigService service)
{
this.logger = logger;
this.modExtractService = modExtractService;
this.service = service;
}
/// <summary>
......@@ -37,7 +37,7 @@ public ApiResponse Extract([CustomizeValidator(RuleSet = "Query"), FromBody]ModM
if (request.ExecuteType == null || !request.ExecuteType.Any())
return new ApiResponse(ResponseType.ParameterError, "ExecuteType 不存在,请重新选择!");
var list = modExtractService.ExtractScheme(request.HospitalId.Value, request.ExecuteType);
var list = service.ExtractScheme(request.HospitalId.Value, request.ExecuteType);
return new ApiResponse(ResponseType.OK, list);
}
......@@ -49,7 +49,7 @@ public ApiResponse Extract([CustomizeValidator(RuleSet = "Query"), FromBody]ModM
[HttpPost]
public ApiResponse FeeType()
{
var list = modExtractService.FeeType();
var list = service.FeeType();
return new ApiResponse(ResponseType.OK, list);
}
......@@ -65,7 +65,7 @@ public ApiResponse FeeSource([FromBody]ModModuleRequest request)
return new ApiResponse(ResponseType.ParameterError, "HospitalId 参数错误!");
logger.LogInformation($"请求参数绩效考核项费用来源:{JsonHelper.Serialize(request)}");
var list = modExtractService.FeeSource(request);
var list = service.FeeSource(request);
return new ApiResponse(ResponseType.OK, list);
}
......@@ -78,7 +78,7 @@ public ApiResponse FeeSource([FromBody]ModModuleRequest request)
public ApiResponse Items([FromBody]ModItemRequest request)
{
logger.LogInformation($"绩效收入模板配置项列表:{JsonHelper.Serialize(request)}");
modExtractService.AddItems(request.ModuleId.Value);
service.AddItems(request.ModuleId.Value);
return new ApiResponse(ResponseType.OK);
}
}
......
......@@ -6,6 +6,7 @@
<ItemGroup>
<PackageReference Include="Microsoft.AspNetCore.Http" Version="2.2.2" />
<PackageReference Include="Microsoft.AspNetCore.Mvc.Abstractions" Version="2.2.0" />
<PackageReference Include="Microsoft.Extensions.Logging.Abstractions" Version="2.2.0" />
<PackageReference Include="Microsoft.Extensions.Options" Version="2.2.0" />
<PackageReference Include="Newtonsoft.Json" Version="12.0.1" />
......
//-----------------------------------------------------------------------
// <copyright file=" ex_item.cs">
// * FileName: ex_item.cs
// </copyright>
//-----------------------------------------------------------------------
using System;
using Performance.EntityModels;
namespace Performance.Repository
{
/// <summary>
/// ex_item Repository
/// </summary>
public partial class PerforExitemRepository : PerforRepository<ex_item>
{
public PerforExitemRepository(PerformanceDbContext context) : base(context)
{
}
}
}
//-----------------------------------------------------------------------
// <copyright file=" ex_module.cs">
// * FileName: ex_module.cs
// </copyright>
//-----------------------------------------------------------------------
using System;
using Performance.EntityModels;
namespace Performance.Repository
{
/// <summary>
/// ex_module Repository
/// </summary>
public partial class PerforExmoduleRepository : PerforRepository<ex_module>
{
public PerforExmoduleRepository(PerformanceDbContext context) : base(context)
{
}
}
}
//-----------------------------------------------------------------------
// <copyright file=" ex_result.cs">
// * FileName: ex_result.cs
// </copyright>
//-----------------------------------------------------------------------
using System;
using Performance.EntityModels;
namespace Performance.Repository
{
/// <summary>
/// ex_result Repository
/// </summary>
public partial class PerforExresultRepository : PerforRepository<ex_result>
{
public PerforExresultRepository(PerformanceDbContext context) : base(context)
{
}
}
}
//-----------------------------------------------------------------------
// <copyright file=" ex_script.cs">
// * FileName: ex_script.cs
// </copyright>
//-----------------------------------------------------------------------
using System;
using Performance.EntityModels;
namespace Performance.Repository
{
/// <summary>
/// ex_script Repository
/// </summary>
public partial class PerforExscriptRepository : PerforRepository<ex_script>
{
public PerforExscriptRepository(PerformanceDbContext context) : base(context)
{
}
}
}
//-----------------------------------------------------------------------
// <copyright file=" ex_special.cs">
// * FileName: ex_special.cs
// </copyright>
//-----------------------------------------------------------------------
using System;
using Performance.EntityModels;
namespace Performance.Repository
{
/// <summary>
/// ex_special Repository
/// </summary>
public partial class PerforExspecialRepository : PerforRepository<ex_special>
{
public PerforExspecialRepository(PerformanceDbContext context) : base(context)
{
}
}
}
//-----------------------------------------------------------------------
// <copyright file=" ex_type.cs">
// * FileName: ex_type.cs
// </copyright>
//-----------------------------------------------------------------------
using System;
using Performance.EntityModels;
namespace Performance.Repository
{
/// <summary>
/// ex_type Repository
/// </summary>
public partial class PerforExtypeRepository : PerforRepository<ex_type>
{
public PerforExtypeRepository(PerformanceDbContext context) : base(context)
{
}
}
}
//-----------------------------------------------------------------------
// <copyright file=" mod_extract.cs">
// * FileName: mod_extract.cs
// </copyright>
//-----------------------------------------------------------------------
using System;
using Performance.EntityModels;
////-----------------------------------------------------------------------
//// <copyright file=" mod_extract.cs">
//// * FileName: mod_extract.cs
//// </copyright>
////-----------------------------------------------------------------------
//using System;
//using Performance.EntityModels;
namespace Performance.Repository
{
/// <summary>
/// mod_extract Repository
/// </summary>
public partial class PerforModextractRepository : PerforRepository<mod_extract>
{
public PerforModextractRepository(PerformanceDbContext context) : base(context)
{
}
}
}
//namespace Performance.Repository
//{
// /// <summary>
// /// mod_extract Repository
// /// </summary>
// public partial class PerforModextractRepository : PerforRepository<mod_extract>
// {
// public PerforModextractRepository(PerformanceDbContext context) : base(context)
// {
// }
// }
//}
//-----------------------------------------------------------------------
// <copyright file=" mod_item.cs">
// * FileName: mod_item.cs
// </copyright>
//-----------------------------------------------------------------------
using System;
using Performance.EntityModels;
////-----------------------------------------------------------------------
//// <copyright file=" mod_item.cs">
//// * FileName: mod_item.cs
//// </copyright>
////-----------------------------------------------------------------------
//using System;
//using Performance.EntityModels;
namespace Performance.Repository
{
/// <summary>
/// mod_item Repository
/// </summary>
public partial class PerforModitemRepository : PerforRepository<mod_item>
{
public PerforModitemRepository(PerformanceDbContext context) : base(context)
{
}
}
}
//namespace Performance.Repository
//{
// /// <summary>
// /// mod_item Repository
// /// </summary>
// public partial class PerforModitemRepository : PerforRepository<mod_item>
// {
// public PerforModitemRepository(PerformanceDbContext context) : base(context)
// {
// }
// }
//}
//-----------------------------------------------------------------------
// <copyright file=" mod_module.cs">
// * FileName: mod_module.cs
// </copyright>
//-----------------------------------------------------------------------
using System;
using Performance.EntityModels;
////-----------------------------------------------------------------------
//// <copyright file=" mod_module.cs">
//// * FileName: mod_module.cs
//// </copyright>
////-----------------------------------------------------------------------
//using System;
//using Performance.EntityModels;
namespace Performance.Repository
{
/// <summary>
/// mod_module Repository
/// </summary>
public partial class PerforModmoduleRepository : PerforRepository<mod_module>
{
public PerforModmoduleRepository(PerformanceDbContext context) : base(context)
{
}
}
}
//namespace Performance.Repository
//{
// /// <summary>
// /// mod_module Repository
// /// </summary>
// public partial class PerforModmoduleRepository : PerforRepository<mod_module>
// {
// public PerforModmoduleRepository(PerformanceDbContext context) : base(context)
// {
// }
// }
//}
//-----------------------------------------------------------------------
// <copyright file=" mod_special.cs">
// * FileName: mod_special.cs
// </copyright>
//-----------------------------------------------------------------------
using System;
using Performance.EntityModels;
////-----------------------------------------------------------------------
//// <copyright file=" mod_special.cs">
//// * FileName: mod_special.cs
//// </copyright>
////-----------------------------------------------------------------------
//using System;
//using Performance.EntityModels;
namespace Performance.Repository
{
/// <summary>
/// mod_special Repository
/// </summary>
public partial class PerforModspecialRepository : PerforRepository<mod_special>
{
public PerforModspecialRepository(PerformanceDbContext context) : base(context)
{
}
}
}
//namespace Performance.Repository
//{
// /// <summary>
// /// mod_special Repository
// /// </summary>
// public partial class PerforModspecialRepository : PerforRepository<mod_special>
// {
// public PerforModspecialRepository(PerformanceDbContext context) : base(context)
// {
// }
// }
//}
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
......@@ -27,7 +27,6 @@ public List<IPerData> ReadData(ISheet sheet, List<PerHeader> perHeader)
string[] headers = new string[]
{
"核算单元",
"核算单元",
"人员工号",
"医生姓名",
"职务分类",
......
......@@ -17,29 +17,29 @@ public class PerSheetDataReadExpend : IPerSheetDataRead
{
HeaderFirstRowNum = 4,
HeaderLastRowNum = 4,
HeaderFirstCellNum = 0,
HeaderFirstCellNum = 3,
DataFirstRowNum = 5,
AccountingUnit = new List<AccountingUnit>
{
new AccountingUnit
{
AccountingUnitCellNum = 0,
AccountingUnitCellNum = 3,
UnitType = "医技组",
DeptCellNum = 3,
DeptCellNum = 6,
FactorRow = 3,
},
new AccountingUnit
{
AccountingUnitCellNum = 1,
AccountingUnitCellNum = 4,
UnitType = "医生组",
DeptCellNum = 3,
DeptCellNum = 6,
FactorRow = 2,
},
new AccountingUnit
{
AccountingUnitCellNum = 2,
AccountingUnitCellNum = 5,
UnitType = "护理组",
DeptCellNum = 3,
DeptCellNum = 6,
FactorRow = 1,
},
}
......
......@@ -17,32 +17,32 @@ public class PerSheetDataReadIncome : IPerSheetDataRead
{
HeaderFirstRowNum = 4,
HeaderLastRowNum = 4,
HeaderFirstCellNum = 0,
HeaderFirstCellNum = 3,
DataFirstRowNum = 5,
AccountingUnit = new List<AccountingUnit>
{
//核算单元(医技组)
new AccountingUnit
{
AccountingUnitCellNum = 0,
AccountingUnitCellNum = 3,
UnitType = "医技组",
DeptCellNum = 3,
DeptCellNum = 6,
FactorRow = 3,
},
//核算单元(医生组)
new AccountingUnit
{
AccountingUnitCellNum = 1,
AccountingUnitCellNum = 4,
UnitType = "医生组",
DeptCellNum = 3,
DeptCellNum = 6,
FactorRow = 2,
},
//核算单元(护理组)
new AccountingUnit
{
AccountingUnitCellNum = 2,
AccountingUnitCellNum = 5,
UnitType = "护理组",
DeptCellNum = 3,
DeptCellNum = 6,
FactorRow = 1,
}
}
......
......@@ -17,32 +17,32 @@ public class PerSheetDataReadOtherIncome : IPerSheetDataRead
{
HeaderFirstRowNum = 4,
HeaderLastRowNum = 4,
HeaderFirstCellNum = 0,
HeaderFirstCellNum = 3,
DataFirstRowNum = 5,
AccountingUnit = new List<AccountingUnit>
{
//核算单元(医技组)
new AccountingUnit
{
AccountingUnitCellNum = 0,
AccountingUnitCellNum = 3,
UnitType = "医技组",
DeptCellNum = 3,
DeptCellNum = 6,
FactorRow = 3,
},
//核算单元(医生组)
new AccountingUnit
{
AccountingUnitCellNum = 1,
AccountingUnitCellNum = 4,
UnitType = "医生组",
DeptCellNum = 3,
DeptCellNum = 6,
FactorRow = 2,
},
//核算单元(护理组)
new AccountingUnit
{
AccountingUnitCellNum = 2,
AccountingUnitCellNum = 5,
UnitType = "护理组",
DeptCellNum = 3,
DeptCellNum = 6,
FactorRow = 1,
}
}
......
......@@ -17,14 +17,14 @@ public class PerSheetDataReadWorkload : IPerSheetDataRead
{
HeaderFirstRowNum = 1,
HeaderLastRowNum = 1,
HeaderFirstCellNum = 0,
HeaderFirstCellNum = 1,
DataFirstRowNum = 3,
AccountingUnit = new List<AccountingUnit>
{
new AccountingUnit
{
AccountingUnitCellNum = 0,
DeptCellNum = 1,
AccountingUnitCellNum = 1,
DeptCellNum = 2,
FactorRow = 2
}
}
......
......@@ -107,6 +107,25 @@ public SheetExportResponse SheetExport(int sheetID)
else
{
CommonExport(sheetID, response);
if (new int[] { (int)SheetType.Income, (int)SheetType.OtherIncome, (int)SheetType.Expend, (int)SheetType.Workload }.Contains(sheet.SheetType.Value))
{
var point = 0;
if (new int[] { (int)SheetType.Income, (int)SheetType.OtherIncome, (int)SheetType.Expend }.Contains(sheet.SheetType.Value))
point = -3;
else
point = -1;
response.Header.ForEach(t => t.Data.ForEach(data =>
{
if (data.PointCell != 0)
data.PointCell += point;
}));
response.Row.ForEach(t => t.Data.ForEach(data =>
{
if (data.PointCell != 0)
data.PointCell += point;
}));
}
}
if (response.Row != null && response.Row.Any())
......
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