Commit 95fdbc8b by 李承祥

员工编号,sheet名称修改:执行>开单,二次绩效驳回通过相关修改

parent 69849acc
...@@ -839,6 +839,11 @@ ...@@ -839,6 +839,11 @@
科室名称 科室名称
</summary> </summary>
</member> </member>
<member name="P:Performance.DtoModels.PerDataClinicEmployee.PersonnelNumber">
<summary>
人员工号
</summary>
</member>
<member name="P:Performance.DtoModels.PerDataClinicEmployee.DoctorName"> <member name="P:Performance.DtoModels.PerDataClinicEmployee.DoctorName">
<summary> <summary>
医生姓名 医生姓名
...@@ -929,6 +934,11 @@ ...@@ -929,6 +934,11 @@
科室类别(例如 医技科室 临床科室 其他科室) 科室类别(例如 医技科室 临床科室 其他科室)
</summary> </summary>
</member> </member>
<member name="P:Performance.DtoModels.PerDataEmployee.PersonnelNumber">
<summary>
人员工号
</summary>
</member>
<member name="P:Performance.DtoModels.PerDataEmployee.DoctorName"> <member name="P:Performance.DtoModels.PerDataEmployee.DoctorName">
<summary> <summary>
医生姓名 医生姓名
......
...@@ -290,6 +290,11 @@ ...@@ -290,6 +290,11 @@
科室 科室
</summary> </summary>
</member> </member>
<member name="P:Performance.EntityModels.ag_compute.WorkPost">
<summary>
职称
</summary>
</member>
<member name="P:Performance.EntityModels.ag_compute.PersonName"> <member name="P:Performance.EntityModels.ag_compute.PersonName">
<summary> <summary>
人员名称 人员名称
...@@ -1645,6 +1650,11 @@ ...@@ -1645,6 +1650,11 @@
绩效基数核算参考对象取值比例(如临床科室护士*95%) 绩效基数核算参考对象取值比例(如临床科室护士*95%)
</summary> </summary>
</member> </member>
<member name="P:Performance.EntityModels.im_employee.PersonnelNumber">
<summary>
人员工号
</summary>
</member>
<member name="P:Performance.EntityModels.im_employee.DoctorName"> <member name="P:Performance.EntityModels.im_employee.DoctorName">
<summary> <summary>
医生姓名 医生姓名
...@@ -1745,6 +1755,11 @@ ...@@ -1745,6 +1755,11 @@
科室名称 科室名称
</summary> </summary>
</member> </member>
<member name="P:Performance.EntityModels.im_employee_clinic.PersonnelNumber">
<summary>
人员工号
</summary>
</member>
<member name="P:Performance.EntityModels.im_employee_clinic.DoctorName"> <member name="P:Performance.EntityModels.im_employee_clinic.DoctorName">
<summary> <summary>
医生姓名 医生姓名
......
...@@ -22,6 +22,11 @@ public class PerDataClinicEmployee : IPerData ...@@ -22,6 +22,11 @@ public class PerDataClinicEmployee : IPerData
public string Department { get; set; } public string Department { get; set; }
/// <summary> /// <summary>
/// 人员工号
/// </summary>
public string PersonnelNumber { get; set; }
/// <summary>
/// 医生姓名 /// 医生姓名
/// </summary> /// </summary>
public string DoctorName { get; set; } public string DoctorName { get; set; }
......
...@@ -32,6 +32,11 @@ public class PerDataEmployee : IPerData ...@@ -32,6 +32,11 @@ public class PerDataEmployee : IPerData
public string AccountType { get; set; } public string AccountType { get; set; }
/// <summary> /// <summary>
/// 人员工号
/// </summary>
public string PersonnelNumber { get; set; }
/// <summary>
/// 医生姓名 /// 医生姓名
/// </summary> /// </summary>
public string DoctorName { get; set; } public string DoctorName { get; set; }
......
...@@ -37,6 +37,11 @@ public class ag_compute ...@@ -37,6 +37,11 @@ public class ag_compute
public string Department { get; set; } public string Department { get; set; }
/// <summary> /// <summary>
/// 职称
/// </summary>
public string WorkPost { get; set; }
/// <summary>
/// 人员名称 /// 人员名称
/// </summary> /// </summary>
public string PersonName { get; set; } public string PersonName { get; set; }
......
...@@ -62,6 +62,11 @@ public class im_employee ...@@ -62,6 +62,11 @@ public class im_employee
public Nullable<decimal> FitPeopleRatio { get; set; } public Nullable<decimal> FitPeopleRatio { get; set; }
/// <summary> /// <summary>
/// 人员工号
/// </summary>
public string PersonnelNumber { get; set; }
/// <summary>
/// 医生姓名 /// 医生姓名
/// </summary> /// </summary>
public string DoctorName { get; set; } public string DoctorName { get; set; }
......
...@@ -52,6 +52,11 @@ public class im_employee_clinic ...@@ -52,6 +52,11 @@ public class im_employee_clinic
public string Department { get; set; } public string Department { get; set; }
/// <summary> /// <summary>
/// 人员工号
/// </summary>
public string PersonnelNumber { get; set; }
/// <summary>
/// 医生姓名 /// 医生姓名
/// </summary> /// </summary>
public string DoctorName { get; set; } public string DoctorName { get; set; }
......
...@@ -68,7 +68,7 @@ public List<PerReport> Medicine(int hospitalId, List<string> date) ...@@ -68,7 +68,7 @@ public List<PerReport> Medicine(int hospitalId, List<string> date)
string sql = @"select accountingunit x,concat(year,'-',lpad(month,2,'0')) y,round((sum(if(cd.id is null,0,cellvalue)) / sum(cellvalue))*100,2) value string sql = @"select accountingunit x,concat(year,'-',lpad(month,2,'0')) y,round((sum(if(cd.id is null,0,cellvalue)) / sum(cellvalue))*100,2) value
from per_allot aot join per_sheet sht on aot.id=sht.allotid join im_data dt on dt.sheetid=sht.id from per_allot aot join per_sheet sht on aot.id=sht.allotid join im_data dt on dt.sheetid=sht.id
left join cof_drugtype cd on cd.allotid=dt.allotid and cd.charge=dt.TypeName and cd.chargetype in ('药品') where unittype=1 and sheettype=3 left join cof_drugtype cd on cd.allotid=dt.allotid and cd.charge=dt.TypeName and cd.chargetype in ('药品') where unittype=1 and sheettype=3
and sheetname like '%就诊收入' and ifnull(accountingunit,'') not in ('') and concat(year,'-',lpad(month,2,'0')) and sheetname like '%开单收入' and ifnull(accountingunit,'') not in ('') and concat(year,'-',lpad(month,2,'0'))
in @date and hospitalid = @hospitalId group by year,month,accountingunit order by y asc,value desc;"; in @date and hospitalid = @hospitalId group by year,month,accountingunit order by y asc,value desc;";
return DapperQuery(sql, new { hospitalId, date }).ToList(); return DapperQuery(sql, new { hospitalId, date }).ToList();
} }
...@@ -82,7 +82,7 @@ public List<PerReport> Income(int hospitalId, List<string> date) ...@@ -82,7 +82,7 @@ public List<PerReport> Income(int hospitalId, List<string> date)
string sql = @"select accountingunit x,concat(year,'-',lpad(month,2,'0')) y,round((sum(if(cd.id is null,cellvalue,0)) / sum(cellvalue))*100,2) value string sql = @"select accountingunit x,concat(year,'-',lpad(month,2,'0')) y,round((sum(if(cd.id is null,cellvalue,0)) / sum(cellvalue))*100,2) value
from per_allot aot join per_sheet sht on aot.id=sht.allotid join im_data dt on dt.sheetid=sht.id from per_allot aot join per_sheet sht on aot.id=sht.allotid join im_data dt on dt.sheetid=sht.id
left join cof_drugtype cd on cd.allotid=dt.allotid and cd.charge=dt.TypeName and cd.chargetype in ('药品','耗材') left join cof_drugtype cd on cd.allotid=dt.allotid and cd.charge=dt.TypeName and cd.chargetype in ('药品','耗材')
where unittype=1 and sheettype=3 and sheetname like '%就诊收入' and ifnull(accountingunit,'') not in ('') and concat(year,'-',lpad(month,2,'0')) where unittype=1 and sheettype=3 and sheetname like '%开单收入' and ifnull(accountingunit,'') not in ('') and concat(year,'-',lpad(month,2,'0'))
in @date and hospitalid = @hospitalId group by year,month,accountingunit order by y asc,value desc;"; in @date and hospitalid = @hospitalId group by year,month,accountingunit order by y asc,value desc;";
return DapperQuery(sql, new { hospitalId, date }).ToList(); return DapperQuery(sql, new { hospitalId, date }).ToList();
} }
......
...@@ -500,7 +500,7 @@ private List<CofDrugProp> GetDrugConfig(PerExcel excel, int allotid) ...@@ -500,7 +500,7 @@ private List<CofDrugProp> GetDrugConfig(PerExcel excel, int allotid)
//计算药占比 //计算药占比
List<CofDrugProp> cofs = new List<CofDrugProp>(); List<CofDrugProp> cofs = new List<CofDrugProp>();
var incomeSheet = excel.PerSheet.FirstOrDefault(t => t.SheetType == SheetType.Income && t.SheetName.Contains("门诊") && t.SheetName.Contains("就诊")); var incomeSheet = excel.PerSheet.FirstOrDefault(t => t.SheetType == SheetType.Income && t.SheetName.Contains("门诊") && t.SheetName.Contains("开单"));
var datalist = incomeSheet.PerData.Select(t => (PerData)t); var datalist = incomeSheet.PerData.Select(t => (PerData)t);
var drugtype = perforCofdrugtypeRepository.GetEntities(t => t.AllotID == allotid && t.ChargeType == "药品")?.Select(t => t.Charge).ToList(); var drugtype = perforCofdrugtypeRepository.GetEntities(t => t.AllotID == allotid && t.ChargeType == "药品")?.Select(t => t.Charge).ToList();
......
...@@ -25,6 +25,7 @@ public class ComputeService : IAutoInjection ...@@ -25,6 +25,7 @@ public class ComputeService : IAutoInjection
private readonly PerforResbaiscnormRepository perforResbaiscnormRepository; private readonly PerforResbaiscnormRepository perforResbaiscnormRepository;
private readonly PerforCofincomeRepository _perforCofincomeRepository; private readonly PerforCofincomeRepository _perforCofincomeRepository;
private readonly PerforAgsecondallotRepository _perforAgsecondallotRepository; private readonly PerforAgsecondallotRepository _perforAgsecondallotRepository;
private readonly PerforAgcomputeRepository _perforAgcomputeRepository;
public ComputeService(PerforResaccountRepository perforResaccountRepository, public ComputeService(PerforResaccountRepository perforResaccountRepository,
//PerforResaccountnurseRepository perforResAccountnurseRepository, //PerforResaccountnurseRepository perforResAccountnurseRepository,
...@@ -37,7 +38,8 @@ public class ComputeService : IAutoInjection ...@@ -37,7 +38,8 @@ public class ComputeService : IAutoInjection
PerforAgemployeeRepository perforAgemployeeRepository, PerforAgemployeeRepository perforAgemployeeRepository,
PerforResbaiscnormRepository perforResbaiscnormRepository, PerforResbaiscnormRepository perforResbaiscnormRepository,
PerforCofincomeRepository perforCofincomeRepository, PerforCofincomeRepository perforCofincomeRepository,
PerforAgsecondallotRepository perforAgsecondallotRepository) PerforAgsecondallotRepository perforAgsecondallotRepository,
PerforAgcomputeRepository perforAgcomputeRepository)
{ {
this.perforResaccountRepository = perforResaccountRepository; this.perforResaccountRepository = perforResaccountRepository;
//this._perforResAccountnurseRepository = perforResAccountnurseRepository; //this._perforResAccountnurseRepository = perforResAccountnurseRepository;
...@@ -51,6 +53,7 @@ public class ComputeService : IAutoInjection ...@@ -51,6 +53,7 @@ public class ComputeService : IAutoInjection
this.perforResbaiscnormRepository = perforResbaiscnormRepository; this.perforResbaiscnormRepository = perforResbaiscnormRepository;
this._perforCofincomeRepository = perforCofincomeRepository; this._perforCofincomeRepository = perforCofincomeRepository;
this._perforAgsecondallotRepository = perforAgsecondallotRepository; this._perforAgsecondallotRepository = perforAgsecondallotRepository;
this._perforAgcomputeRepository = perforAgcomputeRepository;
} }
/// <summary> /// <summary>
...@@ -234,26 +237,25 @@ public List<ComputeResponse> AllCompute(int allotId) ...@@ -234,26 +237,25 @@ public List<ComputeResponse> AllCompute(int allotId)
var allot = _perforRescomputeRepository.GetEntities(t => t.AllotID == allotId)?.OrderByDescending(t => t.AccountingUnit); var allot = _perforRescomputeRepository.GetEntities(t => t.AllotID == allotId)?.OrderByDescending(t => t.AccountingUnit);
list = Mapper.Map<List<ComputeResponse>>(allot); list = Mapper.Map<List<ComputeResponse>>(allot);
list?.ForEach(t => t.Source = "一次绩效"); list?.ForEach(t => t.Source = "一次绩效");
var employee = _perforAgemployeeRepository.GetEntities(t => t.AllotID == allotId); var again = _perforAgcomputeRepository.GetEntities(t => t.AllotId == allotId);
if (employee != null && employee.Count > 0) if (again != null && again.Any())
{ {
var again = _perforPeragainallotRepository.GetEntities(t => employee.Select(e => e.AgainAllotID).Contains(t.ID)); var group = again.GroupBy(t => new { t.Department, t.WorkPost, t.PersonName })
if (again != null) .Select(t => new
{ {
var data = _perforUserRepository.GetEntities(t => again.Select(a => a.CreateUser).Contains(t.ID) && t.States == 1); department = t.Key.Department,
var list1 = from e in employee jobtitle = t.Key.WorkPost,
join a in again on e.AgainAllotID equals a.ID name = t.Key.PersonName,
join user in data on a.CreateUser equals user.ID fee = t.Sum(g => g.RealGiveFee)
select new ComputeResponse });
list.AddRange(group.Select(t => new ComputeResponse
{ {
Source = "二次绩效", Source = "二次绩效",
AccountingUnit = a.Department, AccountingUnit = t.department,
EmployeeName = user.RealName, JobTitle = t.jobtitle,
JobTitle = e.JobTitle, EmployeeName = t.name,
RealGiveFee = e.RealGiveFee RealGiveFee = t.fee
}; }).OrderByDescending(t => t.AccountingUnit));
list = list.Union(list1?.OrderByDescending(t => t.AccountingUnit)).ToList();
}
} }
return list; return list;
} }
......
...@@ -306,7 +306,7 @@ private static void CreateNotExistSheet(List<mod_module> modulesList, IWorkbook ...@@ -306,7 +306,7 @@ private static void CreateNotExistSheet(List<mod_module> modulesList, IWorkbook
var sheet = workbook.GetSheet(module.ModuleName); var sheet = workbook.GetSheet(module.ModuleName);
if (sheet == null) if (sheet == null)
{ {
string[] keyArray = new string[] { "就诊", "执行" }; string[] keyArray = new string[] { "开单", "执行" };
if (keyArray.Any(key => module.ModuleName.Contains(key))) if (keyArray.Any(key => module.ModuleName.Contains(key)))
{ {
var item = pairs.Where(t => t.Key.StartsWith("1.")).OrderByDescending(t => t.Key).First(); var item = pairs.Where(t => t.Key.StartsWith("1.")).OrderByDescending(t => t.Key).First();
......
...@@ -76,8 +76,8 @@ public mod_module AddModule(ModModuleRequest request) ...@@ -76,8 +76,8 @@ public mod_module AddModule(ModModuleRequest request)
if (request.SheetType != (int)SheetType.Income) if (request.SheetType != (int)SheetType.Income)
throw new PerformanceException("模块类型错误,只支持收入模板配置"); throw new PerformanceException("模块类型错误,只支持收入模板配置");
string[] array = new string[] { "就诊收入", "执行收入" }; string[] array = new string[] { "开单收入", "执行收入" };
if (request.ModuleName.IndexOf("就诊收入") == -1 && request.ModuleName.IndexOf("执行收入") == -1) if (request.ModuleName.IndexOf("开单收入") == -1 && request.ModuleName.IndexOf("执行收入") == -1)
throw new PerformanceException("模块名称规则错误"); throw new PerformanceException("模块名称规则错误");
//if (!Regex.IsMatch(request.ModuleName, @"^[\u4e00-\u9fa5]+$")) //if (!Regex.IsMatch(request.ModuleName, @"^[\u4e00-\u9fa5]+$"))
// throw new PerformanceException("模块名称规则错误,请使用全中文命名"); // throw new PerformanceException("模块名称规则错误,请使用全中文命名");
...@@ -89,7 +89,7 @@ public mod_module AddModule(ModModuleRequest request) ...@@ -89,7 +89,7 @@ public mod_module AddModule(ModModuleRequest request)
string addname = ""; string addname = "";
var moduleList = perforModmoduleRepository.GetEntities(t => t.HospitalId == request.HospitalId && t.ModuleName.IndexOf("1.") != -1); var moduleList = perforModmoduleRepository.GetEntities(t => t.HospitalId == request.HospitalId && t.ModuleName.IndexOf("1.") != -1);
string name = request.ModuleName.Replace("就诊收入", "").Replace("执行收入", ""); string name = request.ModuleName.Replace("开单收入", "").Replace("执行收入", "");
var exist = moduleList.Where(t => t.ModuleName.Contains(name)); var exist = moduleList.Where(t => t.ModuleName.Contains(name));
if (exist != null && exist.Any()) if (exist != null && exist.Any())
{ {
...@@ -143,9 +143,9 @@ private void AddModule(int hospitalId) ...@@ -143,9 +143,9 @@ private void AddModule(int hospitalId)
var moduleList = new mod_module[] var moduleList = new mod_module[]
{ {
new mod_module{ ModuleName = "1.0.1 额外收入", SheetType = (int)SheetType.OtherIncome }, new mod_module{ ModuleName = "1.0.1 额外收入", SheetType = (int)SheetType.OtherIncome },
new mod_module{ ModuleName = "1.1.1 门诊就诊收入", SheetType = (int)SheetType.Income }, new mod_module{ ModuleName = "1.1.1 门诊开单收入", SheetType = (int)SheetType.Income },
new mod_module{ ModuleName = "1.1.2 门诊执行收入", SheetType = (int)SheetType.Income }, new mod_module{ ModuleName = "1.1.2 门诊执行收入", SheetType = (int)SheetType.Income },
new mod_module{ ModuleName = "1.2.1 住院就诊收入", SheetType = (int)SheetType.Income }, new mod_module{ ModuleName = "1.2.1 住院开单收入", SheetType = (int)SheetType.Income },
new mod_module{ ModuleName = "1.2.2 住院执行收入", SheetType = (int)SheetType.Income }, new mod_module{ ModuleName = "1.2.2 住院执行收入", SheetType = (int)SheetType.Income },
new mod_module{ ModuleName = "2.1 成本支出统计表", SheetType = (int)SheetType.Expend }, new mod_module{ ModuleName = "2.1 成本支出统计表", SheetType = (int)SheetType.Expend },
new mod_module{ ModuleName = "3.1 医生组工作量绩效测算表", SheetType = (int)SheetType.Workload }, new mod_module{ ModuleName = "3.1 医生组工作量绩效测算表", SheetType = (int)SheetType.Workload },
......
...@@ -199,7 +199,7 @@ private static void CreateNotExistSheet(List<mod_module> modulesList, IWorkbook ...@@ -199,7 +199,7 @@ private static void CreateNotExistSheet(List<mod_module> modulesList, IWorkbook
var sheet = workbook.GetSheet(module.ModuleName); var sheet = workbook.GetSheet(module.ModuleName);
if (sheet == null) if (sheet == null)
{ {
string[] keyArray = new string[] { "就诊", "执行" }; string[] keyArray = new string[] { "开单", "执行" };
if (keyArray.Any(key => module.ModuleName.Contains(key))) if (keyArray.Any(key => module.ModuleName.Contains(key)))
{ {
var item = pairs.Where(t => t.Key.StartsWith("1.")).OrderByDescending(t => t.Key).First(); var item = pairs.Where(t => t.Key.StartsWith("1.")).OrderByDescending(t => t.Key).First();
......
...@@ -33,6 +33,7 @@ public List<IPerData> ReadData(ISheet sheet, List<PerHeader> perHeader) ...@@ -33,6 +33,7 @@ public List<IPerData> ReadData(ISheet sheet, List<PerHeader> perHeader)
UnitType = row.GetCell(perHeader.FirstOrDefault(p => p.CellValue == "核算单元分类").PointCell)?.StringCellValue, UnitType = row.GetCell(perHeader.FirstOrDefault(p => p.CellValue == "核算单元分类").PointCell)?.StringCellValue,
AccountingUnit = row.GetCell(perHeader.FirstOrDefault(p => p.CellValue == "核算单元").PointCell)?.StringCellValue, AccountingUnit = row.GetCell(perHeader.FirstOrDefault(p => p.CellValue == "核算单元").PointCell)?.StringCellValue,
Department = row.GetCell(perHeader.FirstOrDefault(p => p.CellValue == "核算单元").PointCell)?.StringCellValue, Department = row.GetCell(perHeader.FirstOrDefault(p => p.CellValue == "核算单元").PointCell)?.StringCellValue,
PersonnelNumber = row.GetCell(perHeader.FirstOrDefault(p => p.CellValue == "人员工号").PointCell)?.StringCellValue,
DoctorName = row.GetCell(perHeader.FirstOrDefault(p => p.CellValue == "医生姓名").PointCell)?.StringCellValue, DoctorName = row.GetCell(perHeader.FirstOrDefault(p => p.CellValue == "医生姓名").PointCell)?.StringCellValue,
JobTitle = row.GetCell(perHeader.FirstOrDefault(p => p.CellValue == "职称").PointCell)?.StringCellValue, JobTitle = row.GetCell(perHeader.FirstOrDefault(p => p.CellValue == "职称").PointCell)?.StringCellValue,
PostCoefficient = ConvertHelper.To<decimal?>(row.GetCell(perHeader.FirstOrDefault(p => p.CellValue == "岗位系数").PointCell)?.NumericCellValue), PostCoefficient = ConvertHelper.To<decimal?>(row.GetCell(perHeader.FirstOrDefault(p => p.CellValue == "岗位系数").PointCell)?.NumericCellValue),
......
...@@ -35,6 +35,7 @@ public List<IPerData> ReadData(ISheet sheet, List<PerHeader> perHeader) ...@@ -35,6 +35,7 @@ public List<IPerData> ReadData(ISheet sheet, List<PerHeader> perHeader)
RowNumber = r, RowNumber = r,
AccountingUnit = row.GetCell(perHeader.FirstOrDefault(p => p.CellValue == "核算单元").PointCell)?.StringCellValue, AccountingUnit = row.GetCell(perHeader.FirstOrDefault(p => p.CellValue == "核算单元").PointCell)?.StringCellValue,
Department = row.GetCell(perHeader.FirstOrDefault(p => p.CellValue == "核算单元").PointCell)?.StringCellValue, Department = row.GetCell(perHeader.FirstOrDefault(p => p.CellValue == "核算单元").PointCell)?.StringCellValue,
PersonnelNumber = row.GetCell(perHeader.FirstOrDefault(p => p.CellValue == "人员工号").PointCell)?.StringCellValue,
DoctorName = row.GetCell(perHeader.FirstOrDefault(p => p.CellValue == "医生姓名").PointCell)?.StringCellValue, DoctorName = row.GetCell(perHeader.FirstOrDefault(p => p.CellValue == "医生姓名").PointCell)?.StringCellValue,
JobTitle = row.GetCell(perHeader.FirstOrDefault(p => p.CellValue == "职称").PointCell)?.StringCellValue, JobTitle = row.GetCell(perHeader.FirstOrDefault(p => p.CellValue == "职称").PointCell)?.StringCellValue,
FitPeople = row.GetCell(perHeader.FirstOrDefault(p => p.CellValue == "绩效基数核算参考对象").PointCell)?.StringCellValue, FitPeople = row.GetCell(perHeader.FirstOrDefault(p => p.CellValue == "绩效基数核算参考对象").PointCell)?.StringCellValue,
......
...@@ -3,6 +3,7 @@ ...@@ -3,6 +3,7 @@
using Performance.DtoModels; using Performance.DtoModels;
using Performance.DtoModels.AppSettings; using Performance.DtoModels.AppSettings;
using Performance.EntityModels; using Performance.EntityModels;
using Performance.Infrastructure;
using Performance.Repository; using Performance.Repository;
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
...@@ -604,7 +605,54 @@ public bool ConfirmAudit(int userId, SecondAuditRequest request) ...@@ -604,7 +605,54 @@ public bool ConfirmAudit(int userId, SecondAuditRequest request)
{ {
second.Remark = request.IsPass == 1 ? "审核通过" : "驳回"; second.Remark = request.IsPass == 1 ? "审核通过" : "驳回";
} }
return perforAgsecondallotRepository.Update(second); var result = perforAgsecondallotRepository.Update(second);
#region 添加至二次绩效汇总
if (result && request.IsPass == 1)
{
var computes = new List<ag_compute>();
var items = perforAgfixatitemRepository.GetEntities(t => t.SecondId == request.SecondId);
if (items != null && items.Any())
{
var rowNumbers = items.Select(t => t.RowNumber).Where(t => t > 0)?.Distinct();
if (rowNumbers != null && rowNumbers.Any())
{
foreach (var item in rowNumbers)
{
computes.Add(new ag_compute
{
AllotId = second.AllotId,
SecondId = second.Id,
Department = second.Department,
WorkPost = items.FirstOrDefault(t => t.RowNumber == item && t.ItemName == "岗位")?.ItemValue,
PersonName = items.FirstOrDefault(t => t.RowNumber == item && t.ItemName == "姓名")?.ItemValue,
RealGiveFee = ConvertHelper.TryDecimal(items.FirstOrDefault(t => t.RowNumber == item && t.ItemName == "实发绩效工资金额")?.ItemValue, 0),
});
}
}
}
var others = perforAgothersourceRepository.GetEntities(t => t.SecondId == request.SecondId);
if (others != null && others.Any())
{
foreach (var item in others)
{
computes.Add(new ag_compute
{
AllotId = second.AllotId,
SecondId = second.Id,
Department = item.Department,
WorkPost = item.WorkPost,
PersonName = item.Name,
RealGiveFee = item.Amount,
});
}
}
perforAgcomputeRepository.AddRange(computes.ToArray());
}
#endregion
return result;
} }
#endregion #endregion
......
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