Commit 3a2e7a19 by 钟博

修改百分比的属性、显示排序

parent e63d247c
...@@ -392,7 +392,7 @@ public HandsonTable GetDrugtypeHands(int allotId) ...@@ -392,7 +392,7 @@ public HandsonTable GetDrugtypeHands(int allotId)
} }
} }
var list = _drugtypeRepository.GetEntities(t => t.AllotID == allotId); var list = _drugtypeRepository.GetEntities(t => t.AllotID == allotId).OrderBy(c=>c.Charge);
if (list == null) return handson; if (list == null) return handson;
List<HandsonRowData> rowDatas = new List<HandsonRowData>(); List<HandsonRowData> rowDatas = new List<HandsonRowData>();
...@@ -428,11 +428,10 @@ public void SaveDrugtypeHands(int allotId, SaveConfigData request) ...@@ -428,11 +428,10 @@ public void SaveDrugtypeHands(int allotId, SaveConfigData request)
{ {
var json = JsonHelper.Serialize(item); var json = JsonHelper.Serialize(item);
var data = JsonHelper.Deserialize<cof_drugtype>(json); var data = JsonHelper.Deserialize<cof_drugtype>(json);
if (!string.IsNullOrEmpty(data.Charge) || !string.IsNullOrEmpty(data.ChargeType)) if (!string.IsNullOrEmpty(data.Charge))
{ {
drugs.Add(data); drugs.Add(data);
} }
} }
_drugtypeRepository.Execute("delete from cof_drugtype where allotid = @allotid", new { allotId }); _drugtypeRepository.Execute("delete from cof_drugtype where allotid = @allotid", new { allotId });
...@@ -539,7 +538,7 @@ public HandsonTable GetWorkItemHands(int allotId, int type) ...@@ -539,7 +538,7 @@ public HandsonTable GetWorkItemHands(int allotId, int type)
List<HandsonRowData> rowDatas = new List<HandsonRowData>(); List<HandsonRowData> rowDatas = new List<HandsonRowData>();
int i = 0; int i = 0;
foreach (var item in list) foreach (var item in list.OrderBy(c=>c.Item))
{ {
var json = JsonHelper.Serialize(item); var json = JsonHelper.Serialize(item);
...@@ -686,7 +685,7 @@ public HandsonTable GetDepttypeHands(int allotId) ...@@ -686,7 +685,7 @@ public HandsonTable GetDepttypeHands(int allotId)
Readnoly = 0 Readnoly = 0
}).ToList()); }).ToList());
var list = perforCofdepttypeRepository.GetEntities(t => t.AllotID == allotId); var list = perforCofdepttypeRepository.GetEntities(t => t.AllotID == allotId).OrderBy(c=>c.Charge);
if (list == null) return handson; if (list == null) return handson;
List<HandsonRowData> rowDatas = new List<HandsonRowData>(); List<HandsonRowData> rowDatas = new List<HandsonRowData>();
...@@ -727,7 +726,7 @@ public void SaveDepttypeHands(int allotId, SaveConfigData request) ...@@ -727,7 +726,7 @@ public void SaveDepttypeHands(int allotId, SaveConfigData request)
{ {
var json = JsonHelper.Serialize(item); var json = JsonHelper.Serialize(item);
var data = JsonHelper.Deserialize<cof_depttype>(json); var data = JsonHelper.Deserialize<cof_depttype>(json);
if (!string.IsNullOrEmpty(data.Charge) || !string.IsNullOrEmpty(data.ChargeType)) if (!string.IsNullOrEmpty(data.Charge))
{ {
depts.Add(data); depts.Add(data);
} }
......
...@@ -66,18 +66,8 @@ ILogger<ExConfigService> logger ...@@ -66,18 +66,8 @@ ILogger<ExConfigService> logger
#region Modules #region Modules
public List<ex_module> QueryModule(int hospitalId)
{
//首次添加费用字典默认值
DefaultModules(hospitalId);
var list = exmoduleRepository.GetEntities(t => t.HospitalId == hospitalId).OrderBy(t => t.ModuleName).ToList();
return list;
}
private void DefaultModules(int hospitalId) private readonly ex_module[] moduleList = new ex_module[]
{
var moduleList = new ex_module[]
{ {
new ex_module{ ModuleName = "1.0.1 额外收入", SheetType = (int)SheetType.OtherIncome }, new ex_module{ ModuleName = "1.0.1 额外收入", SheetType = (int)SheetType.OtherIncome },
new ex_module{ ModuleName = "1.1.1 门诊开单收入", SheetType = (int)SheetType.Income }, new ex_module{ ModuleName = "1.1.1 门诊开单收入", SheetType = (int)SheetType.Income },
...@@ -89,6 +79,18 @@ private void DefaultModules(int hospitalId) ...@@ -89,6 +79,18 @@ private void DefaultModules(int hospitalId)
new ex_module{ ModuleName = "3.2 护理组工作量绩效测算表", SheetType = (int)SheetType.Workload }, new ex_module{ ModuleName = "3.2 护理组工作量绩效测算表", SheetType = (int)SheetType.Workload },
}; };
public List<ex_module> QueryModule(int hospitalId)
{
//首次添加费用字典默认值
DefaultModules(hospitalId);
var list = exmoduleRepository.GetEntities(t => t.HospitalId == hospitalId).OrderBy(t => t.ModuleName).ToList();
return list;
}
private void DefaultModules(int hospitalId)
{
var data = exmoduleRepository.GetEntities(t => t.HospitalId == hospitalId); var data = exmoduleRepository.GetEntities(t => t.HospitalId == hospitalId);
var inexistence = data == null ? moduleList : moduleList.Where(t => !data.Select(p => p.ModuleName).ToArray().Contains(t.ModuleName)); var inexistence = data == null ? moduleList : moduleList.Where(t => !data.Select(p => p.ModuleName).ToArray().Contains(t.ModuleName));
...@@ -294,8 +296,13 @@ public void DelItem(int itemId) ...@@ -294,8 +296,13 @@ public void DelItem(int itemId)
public HandsonTable GetQueryItemHands(ModModuleRequest request) public HandsonTable GetQueryItemHands(ModModuleRequest request)
{ {
var DicType = new Dictionary<string, string>(); var DicType = new Dictionary<string, string>();
var module = exmoduleRepository.GetEntity(t => t.Id == request.ModuleId);
if (request.SheetType == (int)SheetType.Workload) if (request.SheetType == (int)SheetType.Workload)
DicType = WorkLoadDic; DicType = WorkLoadDic;
else if (request.SheetType==(int)SheetType.Income)
//else if (moduleList.Where(t=>t.SheetType == (int)SheetType.Income).Select(t=>t.ModuleName).Contains(module.ModuleName) )
DicType =OutDic;
else else
DicType = CostDic; DicType = CostDic;
...@@ -311,6 +318,19 @@ public HandsonTable GetQueryItemHands(ModModuleRequest request) ...@@ -311,6 +318,19 @@ public HandsonTable GetQueryItemHands(ModModuleRequest request)
{ {
foreach (var column in handson.Columns) foreach (var column in handson.Columns)
{ {
if (new[]{"医生系数","护理系数","医技系数"}.Contains(column.Data))
{
column.Type = "numeric";
column.NumericFormat=new NumericFormat(){Pattern = "%"};
column.Strict = false;
}
if (column.Data=="单元工作量绩效标准")
{
column.Type = "numeric";
column.Strict = false;
}
if (column.Data == "自动提取规则(无法提取的考核项请勿填写)") if (column.Data == "自动提取规则(无法提取的考核项请勿填写)")
{ {
column.Type = "autocomplete"; column.Type = "autocomplete";
...@@ -320,7 +340,7 @@ public HandsonTable GetQueryItemHands(ModModuleRequest request) ...@@ -320,7 +340,7 @@ public HandsonTable GetQueryItemHands(ModModuleRequest request)
} }
} }
var list = exitemRepository.GetEntities(t => t.ModuleId == request.ModuleId); var list = exitemRepository.GetEntities(t => t.ModuleId == request.ModuleId).OrderBy(c=>c.ItemName);
if (list == null) return handson; if (list == null) return handson;
List<HandsonRowData> rowDatas = new List<HandsonRowData>(); List<HandsonRowData> rowDatas = new List<HandsonRowData>();
...@@ -334,16 +354,7 @@ public HandsonTable GetQueryItemHands(ModModuleRequest request) ...@@ -334,16 +354,7 @@ public HandsonTable GetQueryItemHands(ModModuleRequest request)
firstDic["typeid"] = typeId.First().Title; firstDic["typeid"] = typeId.First().Title;
else else
firstDic["typeid"] = ""; firstDic["typeid"] = "";
if (request.SheetType != (int)SheetType.Workload)
{
var FactorValue1 = (item.FactorValue1 * 100).ToString();
var FactorValue2 = (item.FactorValue2 * 100).ToString();
var FactorValue3 = (item.FactorValue3 * 100).ToString();
firstDic["factorvalue1"] = FactorValue1.Remove(FactorValue1.IndexOf('.')) + "%";
firstDic["factorvalue2"] = FactorValue2.Remove(FactorValue2.IndexOf('.')) + "%";
firstDic["factorvalue3"] = FactorValue3.Remove(FactorValue3.IndexOf('.')) + "%";
}
var cells = (from conf in DicType var cells = (from conf in DicType
join fst in firstDic on conf.Key.ToUpper() equals fst.Key.ToUpper() join fst in firstDic on conf.Key.ToUpper() equals fst.Key.ToUpper()
select new HandsonCellData(conf.Value, fst.Value)).ToList(); select new HandsonCellData(conf.Value, fst.Value)).ToList();
...@@ -373,25 +384,9 @@ public void SaveItemHands(int ModuleId, SaveItemData request) ...@@ -373,25 +384,9 @@ public void SaveItemHands(int ModuleId, SaveItemData request)
if (dicValue.Any()) if (dicValue.Any())
item["TypeId"] = dicValue.First().Value; item["TypeId"] = dicValue.First().Value;
if (entity.SheetType!=(int)SheetType.Workload)
{
if (item["FactorValue1"]!=null)
{
item["FactorValue1"] = (Convert.ToInt32(item["FactorValue1"].TrimEnd('%')) * 0.01).ToString();
}
if (item["FactorValue2"] != null)
{
item["FactorValue2"] = (Convert.ToInt32(item["FactorValue2"].TrimEnd('%')) * 0.01).ToString();
}
if (item["FactorValue3"] != null)
{
item["FactorValue3"] = (Convert.ToInt32(item["FactorValue3"].TrimEnd('%')) * 0.01).ToString();
}
}
var json = JsonHelper.Serialize(item); var json = JsonHelper.Serialize(item);
var data = JsonHelper.Deserialize<ex_item>(json); var data = JsonHelper.Deserialize<ex_item>(json);
if (!string.IsNullOrEmpty(data.ItemName) || !string.IsNullOrEmpty(data.TypeId.ToString())) if (!string.IsNullOrEmpty(data.ItemName))
{ {
data.ModuleId = ModuleId; data.ModuleId = ModuleId;
if (string.IsNullOrEmpty(data.FactorValue1.ToString())) if (string.IsNullOrEmpty(data.FactorValue1.ToString()))
...@@ -459,6 +454,14 @@ public void SaveItemHands(int ModuleId, SaveItemData request) ...@@ -459,6 +454,14 @@ public void SaveItemHands(int ModuleId, SaveItemData request)
{ nameof(ex_item.TypeId), "自动提取规则(无法提取的考核项请勿填写)" } { nameof(ex_item.TypeId), "自动提取规则(无法提取的考核项请勿填写)" }
}; };
public static Dictionary<string, string> OutDic { get; } = new Dictionary<string, string>
{
{ nameof(ex_item.ItemName), "绩效考核项" },
{ nameof(ex_item.FactorValue1), "医生系数" },
{ nameof(ex_item.FactorValue2), "护理系数" },
{ nameof(ex_item.FactorValue3), "医技系数" }
};
public static Dictionary<string, string> WorkLoadDic { get; } = new Dictionary<string, string> public static Dictionary<string, string> WorkLoadDic { get; } = new Dictionary<string, string>
{ {
{ nameof(ex_item.ItemName), "绩效考核项" }, { nameof(ex_item.ItemName), "绩效考核项" },
......
...@@ -614,7 +614,7 @@ public HandsonTable GetDepartmentHands(int hospitalId) ...@@ -614,7 +614,7 @@ public HandsonTable GetDepartmentHands(int hospitalId)
} }
} }
var getDept = GetDepartments(hospitalId); var getDept = GetDepartments(hospitalId).OrderBy(c=>c.Department);
var rowDatas = DeptHandsonRowData(getDept); var rowDatas = DeptHandsonRowData(getDept);
handson.SetRowData(rowDatas, rowDatas != null); handson.SetRowData(rowDatas, rowDatas != null);
......
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