Commit 28115718 by 纪旭 韦

提取绩效修复,二次分配查看详情修复

parent f69cbd46
......@@ -20,11 +20,13 @@ public class PersonController : Controller
{
private readonly PersonService personService;
private readonly ClaimService claimService;
private readonly DapperService dapperService;
public PersonController(PersonService personService, ClaimService claimService)
public PersonController(PersonService personService, ClaimService claimService, DapperService dapperService)
{
this.personService = personService;
this.claimService = claimService;
this.dapperService = dapperService;
}
/// <summary>
......@@ -135,7 +137,7 @@ public IActionResult DownloadCurrentCalculationTable([FromRoute] int allotId)
[HttpPost]
public ApiResponse GetDepartments(int allotId)
{
var list = personService.GetDepartments(allotId);
var list = dapperService.GetDepartments(allotId);
return new ApiResponse(ResponseType.OK, list);
}
......
......@@ -4,9 +4,9 @@ https://go.microsoft.com/fwlink/?LinkID=208121.
-->
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<DeleteExistingFiles>False</DeleteExistingFiles>
<ExcludeApp_Data>False</ExcludeApp_Data>
<LaunchSiteAfterPublish>True</LaunchSiteAfterPublish>
<DeleteExistingFiles>true</DeleteExistingFiles>
<ExcludeApp_Data>false</ExcludeApp_Data>
<LaunchSiteAfterPublish>true</LaunchSiteAfterPublish>
<LastUsedBuildConfiguration>Release</LastUsedBuildConfiguration>
<LastUsedPlatform>Any CPU</LastUsedPlatform>
<PublishProvider>FileSystem</PublishProvider>
......
......@@ -7,7 +7,7 @@
},
"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=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;"
"PerformanceConnectionString": "server=192.168.18.166;database=db_beiliu2;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=116.62.245.55;database=db_performance;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;"
},
"Application": {
......
......@@ -67,7 +67,7 @@ public AutoMapperConfigs()
CreateMap<PerData, im_data>()
.ForMember(dest => dest.IsFactor, opt => opt.MapFrom(src => src.IsFactor ? 1 : 2))
.ForMember(dest => dest.UnitType, opt => opt.MapFrom(src => EnumHelper.GetItems<UnitType>().FirstOrDefault(t => t.Name == src.UnitType).Value));
.ForMember(dest => dest.UnitType, opt => opt.MapFrom(src => EnumHelper.GetItems<UnitType>().FirstOrDefault(t => t.Name == src.UnitType.Replace("行政后勤", "行政工勤")).Value));
CreateMap<im_header, PerHeader>()
.ForMember(dest => dest.IsMerge, opt => opt.MapFrom(src => src.IsMerge == 1 ? true : false));
......@@ -107,7 +107,7 @@ public AutoMapperConfigs()
//CreateMap<PerDataAccountBaisc, im_accountbasic>();
//CreateMap<im_accountbasic, PerDataAccountBaisc>();
CreateMap<PerDataAccountBaisc, im_accountbasic>()
.ForMember(dest => dest.UnitType, opt => opt.MapFrom(src => EnumHelper.GetItems<UnitType>().First(t => t.Name == src.UnitType).Value))
.ForMember(dest => dest.UnitType, opt => opt.MapFrom(src => EnumHelper.GetItems<UnitType>().First(t => t.Name == src.UnitType.Replace("行政后勤", "行政工勤")).Value))
.ForMember(dest => dest.DoctorAccountingUnit, opt => opt.MapFrom(src => src.AccountingUnit))
//.ForMember(dest => dest.Department, opt => opt.MapFrom(src => src.Department))
//.ForMember(dest => dest.DoctorDirectorNumber, opt => opt.MapFrom(src => src.ManagerNumber))
......@@ -148,7 +148,7 @@ public AutoMapperConfigs()
CreateMap<res_account, PerDataAccountBaisc>()
.ForMember(dest => dest.UnitType, opt => opt.MapFrom(src => src.UnitType.HasValue ? ((UnitType)src.UnitType).ToString() : ""));
CreateMap<PerDataAccountBaisc, res_account>()
.ForMember(dest => dest.UnitType, opt => opt.MapFrom(src => string.IsNullOrEmpty(src.UnitType) ? -1 : EnumHelper.GetItems<UnitType>().First(t => t.Name == src.UnitType).Value));
.ForMember(dest => dest.UnitType, opt => opt.MapFrom(src => string.IsNullOrEmpty(src.UnitType) ? -1 : EnumHelper.GetItems<UnitType>().First(t => t.Name == src.UnitType.Replace("行政后勤", "行政工勤")).Value));
//CreateMap<PerDataAccountBaisc, res_accountnurse>();
//CreateMap<res_accountdoctor, ComputeSource>();
......
//-----------------------------------------------------------------------
// <copyright file=" per_dept_dic.cs">
// * FileName: per_dept_dic.cs
// </copyright>
//-----------------------------------------------------------------------
using Performance.EntityModels;
using System.Collections.Generic;
namespace Performance.Repository
{
/// <summary>
/// per_dept_dic Repository
/// </summary>
public partial class PerforPerdeptdicRepository : PerforRepository<per_dept_dic>
{
public IEnumerable<per_dept_dic> GetAccountBasicAccountingUnit(int hospitalId)
{
string sql = @"select * from
(
select distinct
unittype,
ifnull
(
max(case when source = '门诊' then accountingunit end),
max(case when source = '住院' then accountingunit end)
) accountingunit
from per_dept_dic
where hospitalid = @hospitalId
group by unittype,department,hisdeptname
) t
where ifnull(accountingunit, '无')<>'无'
order by unittype,accountingunit;";
return DapperQuery<per_dept_dic>(sql, new { hospitalId });
}
}
}
......@@ -708,13 +708,7 @@ public List<DeptResponse> GetAdminPerformance(int allotId)
result.AddRange(hideOtherResult);
#endregion
var enumItems = EnumHelper.GetItems<UnitType>();
enumItems.ForEach(t =>
{
t.Value = UnitTypeUtil.Is(t.Name, UnitType.护理组.ToString()) ? t.Value + 2 : t.Value;
t.Name = t.Name == "行政后勤" ? UnitType.行政工勤.ToString() : t.Name;
});
var enumItems = UnitTypeUtil.GetUnitTypeFromEnum();
result = result.OrderBy(t => enumItems.FirstOrDefault(e => e.Name == t.UnitName)?.Value).ThenBy(t => t.AccountingUnit).ToList();
return result;
}
......@@ -1747,7 +1741,7 @@ public ag_secondallot GetAccountId(int secondId, out int accountId)
var second = _perforAgsecondallotRepository.GetEntity(t => t.Id == secondId);
if (second != null)
{
var unitType = EnumHelper.GetItems<UnitType>().FirstOrDefault(t => t.Name == second.UnitType);
var unitType = UnitTypeUtil.GetUnitTypeFromEnum(second.UnitType);
var account = perforResaccountRepository.GetEntity(t => t.AllotID == second.AllotId && t.UnitType == unitType.Value && t.AccountingUnit == second.Department);
if (account == null && second.UnitType != UnitType.特殊核算组.ToString())
throw new PerformanceException("科室信息错误");
......
......@@ -609,7 +609,7 @@ public HandsonTableBase GetBatchAccountingStructrue(int AllotId)
if (column.Data == "核算组别")
{
column.Type = "autocomplete";
column.Source = EnumHelper.GetItems<UnitType>().Select(w => w.Description).ToArray();
column.Source = UnitTypeUtil.GetUnitTypeFromEnum().Select(w => w.Description).ToArray();
column.Strict = true;
}
if (column.Data == "核算单元编码")
......@@ -628,7 +628,7 @@ public ApiResponse BatchSaveAccounting(int allotId, SaveCollectData request)
if (dicData == null || !dicData.Any()) throw new PerformanceException("未提交数据");
var getAccounts = _cofaccountingRepository.GetEntities(t => t.AllotId == allotId) ?? new List<cof_accounting>();
var unitType = EnumHelper.GetItems<UnitType>().Select(w => w.Description).ToArray();
var unitType = UnitTypeUtil.GetUnitTypeFromEnum().Select(w => w.Description).ToArray();
var json = JsonHelper.Serialize(dicData);
var accounts = JsonHelper.Deserialize<List<cof_accounting>>(json)
......@@ -1354,7 +1354,7 @@ public HandsonTableBase QueryHandsCustom(CustomPagingRequest request)
if (dicCustom.FirstOrDefault(t => t.Comment.Equals(column.Data)).Name.ToLower() == "unittype")
{
column.Type = "autocomplete";
column.Source = EnumHelper.GetItems<UnitType>().Select(w => w.Description).ToArray();
column.Source = UnitTypeUtil.GetUnitTypeFromEnum().Select(w => w.Description).ToArray();
column.Strict = true;
}
......
using Dapper;
using Microsoft.Extensions.Options;
using MySql.Data.MySqlClient;
using Performance.DtoModels;
using Performance.DtoModels.AppSettings;
using Performance.EntityModels;
using System;
using System.Collections.Generic;
using System.Data;
using System.Linq;
using System.Threading.Tasks;
namespace Performance.Services
......@@ -119,5 +123,90 @@ public void SyncDataToResult(int allotId)
}
}
}
#region 数据提取
public IEnumerable<per_dept_dic> GetAccountBasicAccountingUnit(int hospitalId)
{
using (var connection = new MySqlConnection(_options.Value.PerformanceConnectionString))
{
if (connection.State != ConnectionState.Open) connection.Open();
try
{
string sql = @"select * from
(
select distinct
unittype,
ifnull
(
max(case when source = '门诊' then accountingunit end),
max(case when source = '住院' then accountingunit end)
) accountingunit
from per_dept_dic
where hospitalid = @hospitalId
group by unittype,department,hisdeptname
) t
where ifnull(accountingunit, '无')<>'无'
order by unittype,accountingunit;";
return connection.Query<per_dept_dic>(sql, new { hospitalId }, commandTimeout: 60 * 60);
}
catch (Exception)
{
throw;
}
}
}
public IEnumerable<DeptdicResponse> GetDepartments(int allotId)
{
using (var connection = new MySqlConnection(_options.Value.PerformanceConnectionString))
{
if (connection.State != ConnectionState.Open) connection.Open();
try
{
var depts = connection.Query<per_dept_dic>("select * from per_dept_dic where allotid = @allotid", new { allotId }, commandTimeout: 60 * 60);
if (depts == null || !depts.Any()) return null;
var allot = connection.QueryFirstOrDefault<per_allot>("select * from per_allot where id = @allotid", new { allotId }, commandTimeout: 60 * 60);
if (allot == null || !depts.Any()) return null;
Deptdic GetDeptdic(List<per_dept_dic> dics, string department, string hISDeptName, UnitType unitType, string source = "")
{
var dic = dics.FirstOrDefault(group => group.Department == department && group.HISDeptName == hISDeptName && group.UnitType == unitType.ToString() && group.Source == source);
if (dic == null)
dic = dics.FirstOrDefault(group => group.Department == department && group.HISDeptName == hISDeptName && group.UnitType == unitType.ToString());
if (dic == null) return new Deptdic() { IsVerify = 1 };
return new Deptdic { Id = dic.Id, AccountingUnit = dic.AccountingUnit, IsVerify = dic.IsVerify ?? 1, VerifyMessage = dic.VerifyMessage, };
}
var result = depts
.GroupBy(t => new { t.HISDeptName, t.Department })
.Select(t => new DeptdicResponse
{
HospitalId = allot.HospitalId,
HISDeptName = t.Key.HISDeptName,
Department = t.Key.Department,
OutDoctorAccounting = GetDeptdic(t.ToList(), t.Key.Department, t.Key.HISDeptName, UnitType.医生组, "门诊"),
OutNurseAccounting = GetDeptdic(t.ToList(), t.Key.Department, t.Key.HISDeptName, UnitType.护理组, "门诊"),
OutTechnicAccounting = GetDeptdic(t.ToList(), t.Key.Department, t.Key.HISDeptName, UnitType.医技组, "门诊"),
InpatDoctorAccounting = GetDeptdic(t.ToList(), t.Key.Department, t.Key.HISDeptName, UnitType.医生组, "住院"),
InpatNurseAccounting = GetDeptdic(t.ToList(), t.Key.Department, t.Key.HISDeptName, UnitType.护理组, "住院"),
InpatTechnicAccounting = GetDeptdic(t.ToList(), t.Key.Department, t.Key.HISDeptName, UnitType.医技组, "住院"),
LogisticsAccounting = GetDeptdic(t.ToList(), t.Key.Department, t.Key.HISDeptName, UnitType.行政工勤),
SpecialAccounting = GetDeptdic(t.ToList(), t.Key.Department, t.Key.HISDeptName, UnitType.特殊核算组),
CreateTime = t.Max(group => group.CreateTime),
IsVerify = t.Min(w => w.IsVerify) ?? 1,
});
return result.OrderBy(w => w.IsVerify).ThenByDescending(t => t.CreateTime).ThenBy(t => t.Department);
}
catch (Exception)
{
throw;
}
}
}
#endregion
}
}
......@@ -1230,7 +1230,7 @@ public ComparisonResponse<DtoModels.Comparison<view_check_emp>> GetComparison(Co
result.Datas = peremployeeRepository.CheckAccountingUnitRealGiveFeeDiff(request);
result.Datas.Datas.ForEach(t =>
{
t.UnitTypeId = EnumHelper.GetItems<UnitType>().FirstOrDefault(e => e.Name == t.UnitType).Value;
t.UnitTypeId = UnitTypeUtil.GetUnitTypeFromEnum(t.UnitType).Value;
});
}
else if (request.ViewName == "view_check_emp")
......
......@@ -33,6 +33,7 @@ public class ExtractService : IAutoInjection
private readonly PerforPerdeptdicRepository perdeptdicRepository;
private readonly PerforCofdrugtypefactorRepository drugtypefactorRepository;
private readonly PerforExresultRepository exresultRepository;
private readonly DapperService dapperService;
public ExtractService(
ILogger<ExtractService> logger,
......@@ -51,7 +52,8 @@ public class ExtractService : IAutoInjection
PerforPeremployeeRepository peremployeeRepository,
PerforPerdeptdicRepository perdeptdicRepository,
PerforCofdrugtypefactorRepository drugtypefactorRepository,
PerforExresultRepository exresultRepository
PerforExresultRepository exresultRepository,
DapperService dapperService
)
{
this.logger = logger;
......@@ -71,6 +73,7 @@ PerforExresultRepository exresultRepository
this.perdeptdicRepository = perdeptdicRepository;
this.drugtypefactorRepository = drugtypefactorRepository;
this.exresultRepository = exresultRepository;
this.dapperService = dapperService;
}
/// <summary>
......@@ -270,7 +273,7 @@ private object GetDataBySheetType(int hospitalId, SheetType sheetType, List<Extr
return employeeDict;
case SheetType.AccountBasic:
return perdeptdicRepository.GetAccountBasicAccountingUnit(hospitalId);
return dapperService.GetAccountBasicAccountingUnit(hospitalId);
default:
return extractDto;
......@@ -296,7 +299,7 @@ private List<ExtractTransDto> StandDataFormat(int hospitalId, int allotId, List<
var types = extypeRepository.GetEntities(w => w.HospitalId == hospitalId) ?? new List<ex_type>();
var dict = personService.GetDepartments(allotId)?.ToList();
var dict = dapperService.GetDepartments(allotId)?.ToList();
if (dict == null || !dict.Any())
{
return results.GroupBy(t => new { t.Department, t.Category, t.Source }).Select(t => new ExtractTransDto
......
......@@ -229,7 +229,7 @@ public List<TitleValue> Accounting(int allotId)
/// <returns></returns>
public List<EnumItem> UnitType()
{
return EnumHelper.GetItems<UnitType>();
return UnitTypeUtil.GetUnitTypeFromEnum();
}
}
}
......@@ -159,7 +159,7 @@ private List<HistoryData> ReadExcelData(int hospitalid, string path)
var departmentDict = perdeptdicRepository.GetEntities(t => t.HospitalId == hospitalid);
if (departmentDict != null && departmentDict.Any())
{
var unittype = EnumHelper.GetItems<UnitType>();
var unittype = UnitTypeUtil.GetUnitTypeFromEnum();
entities.ForEach(t =>
{
var accountingUnits = departmentDict.Where(w => w.Department == t.Department && w.Source == t.SourceType);
......
......@@ -197,7 +197,7 @@ private bool EditAccountBasic(int userId, OriginalRequest request)
if (request.Cell.FieldName == "核算单元类型")
{
var cellvalue = EnumHelper.GetItems<UnitType>().FirstOrDefault(t => t.Name == request.Cell.CellValue.ToString());
var cellvalue = UnitTypeUtil.GetUnitTypeFromEnum().FirstOrDefault(t => t.Name == request.Cell.CellValue.ToString());
if (cellvalue == null) return false;
if (cellvalue.Value == basic.UnitType) return true;
request.Cell.CellValue = cellvalue.Value;
......
......@@ -52,7 +52,7 @@ public PerSheet MergeCompute(PerExcel excel, List<EntityModels.cof_income> incom
//判断是否创建头部
if (!isHasData && dataList != null && dataList.Count() > 0)
isHasData = true;
foreach (var item in EnumHelper.GetItems<UnitType>().Where(t => t.Value <= 3))
foreach (var item in UnitTypeUtil.GetUnitTypeFromEnum().Where(t => t.Value <= 3))
{
var group = dataList.Where(t => t.UnitType == item.Name);
......@@ -161,7 +161,7 @@ public PerSheet OnceCompute(PerSheet sheet)
var typeClass = dataList.Where(t => header.Children.Select(s => s.CellValue).Contains(t.TypeName));
int pointcell = 0;
foreach (var item in EnumHelper.GetItems<UnitType>().Where(t => t.Value <= 3))
foreach (var item in UnitTypeUtil.GetUnitTypeFromEnum().Where(t => t.Value <= 3))
{
pointcell++;
var group = typeClass.Where(t => t.UnitType == item.Name);
......
......@@ -258,7 +258,7 @@ public ApiResponse CreatePerson(PerEmployeeResponse request)
if (employee != null)
throw new PerformanceException($"员工工号为{request.PersonnelNumber}的数据已存在!");
var unittype = EnumHelper.GetItems<UnitType>().Select(t => t.Description).ToList();
var unittype = UnitTypeUtil.GetUnitTypeFromEnum().Select(t => t.Description).ToList();
unittype.AddRange(EnumHelper.GetItems<AccountUnitType>().Select(t => t.Description));
if (!unittype.Contains(request.UnitType))
......@@ -323,7 +323,7 @@ public ApiResponse UpdatePerson(PerEmployeeResponse request)
if (employees.Count() > 1)
throw new PerformanceException($"工号为“{request.PersonnelNumber}”存在多条数据,请删除多余数据!");
var unittype = EnumHelper.GetItems<UnitType>().Select(t => t.Description).ToList();
var unittype = UnitTypeUtil.GetUnitTypeFromEnum().Select(t => t.Description).ToList();
unittype.AddRange(EnumHelper.GetItems<AccountUnitType>().Select(t => t.Description));
if (!unittype.Contains(request.UnitType))
......@@ -388,6 +388,8 @@ public bool DeleteAllPerson(int allotId)
return peremployeeRepository.RemoveRange(employees.ToArray());
}
#region 弃用
///// <summary>
///// 检查核算单元是否已存在
///// </summary>
......@@ -415,44 +417,44 @@ public bool DeleteAllPerson(int allotId)
/// </summary>
/// <param name="allotId"></param>
/// <returns></returns>
public IEnumerable<DeptdicResponse> GetDepartments(int allotId)
{
var depts = perdeptdicRepository.GetEntities(t => t.AllotId == allotId);
if (depts == null || !depts.Any()) return null;
//public IEnumerable<DeptdicResponse> GetDepartments(int allotId)
//{
// var depts = perdeptdicRepository.GetEntities(t => t.AllotId == allotId);
// if (depts == null || !depts.Any()) return null;
var allot = perallotRepository.GetEntity(t => t.ID == allotId);
if (allot == null || !depts.Any()) return null;
// var allot = perallotRepository.GetEntity(t => t.ID == allotId);
// if (allot == null || !depts.Any()) return null;
Deptdic GetDeptdic(List<per_dept_dic> dics, string department, string hISDeptName, UnitType unitType, string source = "")
{
var dic = dics.FirstOrDefault(group => group.Department == department && group.HISDeptName == hISDeptName && group.UnitType == unitType.ToString() && group.Source == source);
if (dic == null)
dic = dics.FirstOrDefault(group => group.Department == department && group.HISDeptName == hISDeptName && group.UnitType == unitType.ToString());
if (dic == null) return new Deptdic() { IsVerify = 1 };
return new Deptdic { Id = dic.Id, AccountingUnit = dic.AccountingUnit, IsVerify = dic.IsVerify ?? 1, VerifyMessage = dic.VerifyMessage, };
}
var result = depts
.GroupBy(t => new { t.HISDeptName, t.Department })
.Select(t => new DeptdicResponse
{
HospitalId = allot.HospitalId,
HISDeptName = t.Key.HISDeptName,
Department = t.Key.Department,
OutDoctorAccounting = GetDeptdic(t.ToList(), t.Key.Department, t.Key.HISDeptName, UnitType.医生组, "门诊"),
OutNurseAccounting = GetDeptdic(t.ToList(), t.Key.Department, t.Key.HISDeptName, UnitType.护理组, "门诊"),
OutTechnicAccounting = GetDeptdic(t.ToList(), t.Key.Department, t.Key.HISDeptName, UnitType.医技组, "门诊"),
InpatDoctorAccounting = GetDeptdic(t.ToList(), t.Key.Department, t.Key.HISDeptName, UnitType.医生组, "住院"),
InpatNurseAccounting = GetDeptdic(t.ToList(), t.Key.Department, t.Key.HISDeptName, UnitType.护理组, "住院"),
InpatTechnicAccounting = GetDeptdic(t.ToList(), t.Key.Department, t.Key.HISDeptName, UnitType.医技组, "住院"),
LogisticsAccounting = GetDeptdic(t.ToList(), t.Key.Department, t.Key.HISDeptName, UnitType.行政工勤),
SpecialAccounting = GetDeptdic(t.ToList(), t.Key.Department, t.Key.HISDeptName, UnitType.特殊核算组),
CreateTime = t.Max(group => group.CreateTime),
IsVerify = t.Min(w => w.IsVerify) ?? 1,
});
// Deptdic GetDeptdic(List<per_dept_dic> dics, string department, string hISDeptName, UnitType unitType, string source = "")
// {
// var dic = dics.FirstOrDefault(group => group.Department == department && group.HISDeptName == hISDeptName && group.UnitType == unitType.ToString() && group.Source == source);
// if (dic == null)
// dic = dics.FirstOrDefault(group => group.Department == department && group.HISDeptName == hISDeptName && group.UnitType == unitType.ToString());
// if (dic == null) return new Deptdic() { IsVerify = 1 };
// return new Deptdic { Id = dic.Id, AccountingUnit = dic.AccountingUnit, IsVerify = dic.IsVerify ?? 1, VerifyMessage = dic.VerifyMessage, };
// }
return result.OrderBy(w => w.IsVerify).ThenByDescending(t => t.CreateTime).ThenBy(t => t.Department);
}
// var result = depts
// .GroupBy(t => new { t.HISDeptName, t.Department })
// .Select(t => new DeptdicResponse
// {
// HospitalId = allot.HospitalId,
// HISDeptName = t.Key.HISDeptName,
// Department = t.Key.Department,
// OutDoctorAccounting = GetDeptdic(t.ToList(), t.Key.Department, t.Key.HISDeptName, UnitType.医生组, "门诊"),
// OutNurseAccounting = GetDeptdic(t.ToList(), t.Key.Department, t.Key.HISDeptName, UnitType.护理组, "门诊"),
// OutTechnicAccounting = GetDeptdic(t.ToList(), t.Key.Department, t.Key.HISDeptName, UnitType.医技组, "门诊"),
// InpatDoctorAccounting = GetDeptdic(t.ToList(), t.Key.Department, t.Key.HISDeptName, UnitType.医生组, "住院"),
// InpatNurseAccounting = GetDeptdic(t.ToList(), t.Key.Department, t.Key.HISDeptName, UnitType.护理组, "住院"),
// InpatTechnicAccounting = GetDeptdic(t.ToList(), t.Key.Department, t.Key.HISDeptName, UnitType.医技组, "住院"),
// LogisticsAccounting = GetDeptdic(t.ToList(), t.Key.Department, t.Key.HISDeptName, UnitType.行政工勤),
// SpecialAccounting = GetDeptdic(t.ToList(), t.Key.Department, t.Key.HISDeptName, UnitType.特殊核算组),
// CreateTime = t.Max(group => group.CreateTime),
// IsVerify = t.Min(w => w.IsVerify) ?? 1,
// });
// return result.OrderBy(w => w.IsVerify).ThenByDescending(t => t.CreateTime).ThenBy(t => t.Department);
//}
//private (string dept, string[] unittype) GetDeptByUser(int userId)
//{
......@@ -472,6 +474,8 @@ Deptdic GetDeptdic(List<per_dept_dic> dics, string department, string hISDeptNam
// return ("", new string[] { });
//}
#endregion
/// <summary>
/// 创建科室核算信息
/// </summary>
......@@ -755,7 +759,7 @@ public HandsonTableBase GetBatchPersonStructrue(int allotId)
if (column.Data == "核算组别")
{
column.Type = "autocomplete";
column.Source = EnumHelper.GetItems<UnitType>().Select(w => w.Description).ToArray();
column.Source = UnitTypeUtil.GetUnitTypeFromEnum().Select(w => w.Description).ToArray();
column.Strict = true;
}
else if (new[] { "出勤天数", "预留比例" }.Contains(column.Data))
......
......@@ -1573,7 +1573,7 @@ private List<ag_secondallot> SecondList(per_allot allot, List<res_account> accou
Status = 1,
};
});
var enums = EnumHelper.GetItems<UnitType>();
var enums = UnitTypeUtil.GetUnitTypeFromEnum();
return result.Where(w => w.RealGiveFee.HasValue && w.RealGiveFee != 0)
.OrderBy(t => t.Status == 4 ? 2 : t.Status)
.ThenBy(t => enums.FirstOrDefault(f => f.Name == t.UnitType)?.Value)
......
using Performance.DtoModels;
using Performance.Infrastructure;
using System;
using System.Collections.Generic;
using System.Linq;
......@@ -92,6 +93,22 @@ public static bool Is(string unit, params string[] types)
{
return !string.IsNullOrEmpty(unit) && types.Any(w => IsEqualsUnitType(w, unit));
}
public static EnumItem GetUnitTypeFromEnum(string unitType)
{
unitType = unitType.Replace("行政后勤", "行政工勤");
return EnumHelper.GetItems<UnitType>().FirstOrDefault(t => t.Name == unitType);
}
public static List<EnumItem> GetUnitTypeFromEnum( )
{
var enumItems = EnumHelper.GetItems<UnitType>() ;
enumItems.ForEach(t =>
{
t.Value = Is(t.Name, UnitType.护理组.ToString()) ? t.Value + 2 : t.Value;
t.Name = t.Name == "行政后勤" ? UnitType.行政工勤.ToString() : t.Name;
});
return enumItems;
}
}
public class AccountTypeUnit
......
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