Commit 0fb6137d by lcx

新增自定义抽取

parent e52618b8
...@@ -8,7 +8,7 @@ ...@@ -8,7 +8,7 @@
}, },
"AppConnection": { "AppConnection": {
//"PerformanceConnectionString": "server=112.124.13.17;database=db_performance;uid=suvalue;pwd=suvalue2016;pooling=true;charset=utf8;convert zero datetime=true;port=3306;connection timeout=120;max pool size=512;allow user variables=true;", //"PerformanceConnectionString": "server=112.124.13.17;database=db_performance;uid=suvalue;pwd=suvalue2016;pooling=true;charset=utf8;convert zero datetime=true;port=3306;connection timeout=120;max pool size=512;allow user variables=true;",
"PerformanceConnectionString": "server=192.168.18.166;database=db_test_yuyao;uid=root;pwd=1234qwer;pooling=true;charset=utf8;convert zero datetime=true;port=3306;connection timeout=120;max pool size=512;allow user variables=true;", "PerformanceConnectionString": "server=192.168.18.166;database=db_performance_screen;uid=root;pwd=1234qwer;pooling=true;charset=utf8;convert zero datetime=true;port=3306;connection timeout=120;max pool size=512;allow user variables=true;",
"HangfireConnectionString": "server=192.168.18.166;database=db_hangfire;uid=root;pwd=1234qwer;port=3306;allow user variables=true;", "HangfireConnectionString": "server=192.168.18.166;database=db_hangfire;uid=root;pwd=1234qwer;port=3306;allow user variables=true;",
"RedisConnectionString": "116.62.245.55:6379,defaultDatabase=2" "RedisConnectionString": "116.62.245.55:6379,defaultDatabase=2"
}, },
......
...@@ -187,6 +187,10 @@ public enum SheetType ...@@ -187,6 +187,10 @@ public enum SheetType
/// <summary> 考核 </summary> /// <summary> 考核 </summary>
[Description("考核")] [Description("考核")]
Assess = 38, //该参数作用类似于 其他工作量 Assess = 38, //该参数作用类似于 其他工作量
/// <summary> 自定义抽取模板 </summary>
[Description("自定义抽取模板")]
Custom = 100,
} }
/// <summary> /// <summary>
......
...@@ -552,7 +552,8 @@ public List<TitleValue> FeeType() ...@@ -552,7 +552,8 @@ public List<TitleValue> FeeType()
(int)SheetType.Expend, (int)SheetType.Expend,
(int)SheetType.Workload, (int)SheetType.Workload,
(int)SheetType.SpecialUnit, (int)SheetType.SpecialUnit,
(int)SheetType.OtherWorkload (int)SheetType.OtherWorkload,
(int)SheetType.Custom
}.Contains(t.Value)); }.Contains(t.Value));
if (type != null && type.Any()) if (type != null && type.Any())
{ {
......
...@@ -125,7 +125,7 @@ private List<int> GetQueryScriptIds(int hospitalId, ref Dictionary<ExDataDict, o ...@@ -125,7 +125,7 @@ private List<int> GetQueryScriptIds(int hospitalId, ref Dictionary<ExDataDict, o
{ {
var extypeIds = new List<int>(); var extypeIds = new List<int>();
var modules = exmoduleRepository.GetEntities(t => t.HospitalId == hospitalId); var modules = exmoduleRepository.GetEntities(t => t.HospitalId == hospitalId && t.SheetType != (int)SheetType.Custom);
var items = new List<ex_item>(); var items = new List<ex_item>();
if (modules != null && modules.Any()) if (modules != null && modules.Any())
{ {
......
using NPOI.SS.UserModel;
using Performance.DtoModels;
using Performance.EntityModels;
using Performance.Repository;
using System;
using System.Collections.Generic;
using System.Linq;
namespace Performance.Services.ExtractExcelService.SheetDataWrite
{
public class CustomDataWrite
{
private readonly PerforHospitalconfigRepository hospitalconfigRepository;
public CustomDataWrite(PerforHospitalconfigRepository hospitalconfigRepository)
{
this.hospitalconfigRepository = hospitalconfigRepository;
}
public void WriteDataToCustom(IWorkbook workbook, per_allot allot)
{
var modules = new List<ex_module>();
var configs = hospitalconfigRepository.GetEntities(t => t.HospitalId == allot.HospitalId);
if (configs == null || !configs.Any()) throw new Exception("医院未配置绩效抽取信息");
foreach (var module in modules.Where(t => t.SheetType == (int)SheetType.Custom)?.OrderBy(t => t.ModuleName))
{
var sheet = workbook.GetSheet(module.ModuleName) ?? workbook.GetSheet(module.ModuleName.NoBlank());
if (sheet == null)
{
sheet = workbook.CreateSheet(module.ModuleName);
workbook.SetSheetOrder(sheet.SheetName, workbook.NumberOfSheets - 1);
}
}
IEnumerable<dynamic> data;
}
}
}
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