Commit d976e60b by ruyun.zhang@suvalue.com

Merge branch 'v2020morge-rename' into v2020morge-job

parents b04b0dd6 7a606ea7
......@@ -142,29 +142,29 @@ public ApiResponse InpatFeeAvg([CustomizeValidator(RuleSet = "Query"), FromBody]
return new ApiResponse(ResponseType.OK, "", list);
}
/// <summary>
/// 科室药占比
/// </summary>
/// <returns></returns>
[Route("medicine")]
[HttpPost]
public ApiResponse Medicine([CustomizeValidator(RuleSet = "Query"), FromBody] ReportRequest request)
{
var list = reportService.Medicine(request.HospitalId, request.IsIndex);
return new ApiResponse(ResponseType.OK, "", list);
}
/// <summary>
/// 科室有效收入占比
/// </summary>
/// <returns></returns>
[Route("income")]
[HttpPost]
public ApiResponse Income([CustomizeValidator(RuleSet = "Query"), FromBody] ReportRequest request)
{
var list = reportService.Income(request.HospitalId, request.IsIndex);
return new ApiResponse(ResponseType.OK, "", list);
}
///// <summary>
///// 科室药占比
///// </summary>
///// <returns></returns>
//[Route("medicine")]
//[HttpPost]
//public ApiResponse Medicine([CustomizeValidator(RuleSet = "Query"), FromBody] ReportRequest request)
//{
// var list = reportService.Medicine(request.HospitalId, request.IsIndex);
// return new ApiResponse(ResponseType.OK, "", list);
//}
///// <summary>
///// 科室有效收入占比
///// </summary>
///// <returns></returns>
//[Route("income")]
//[HttpPost]
//public ApiResponse Income([CustomizeValidator(RuleSet = "Query"), FromBody] ReportRequest request)
//{
// var list = reportService.Income(request.HospitalId, request.IsIndex);
// return new ApiResponse(ResponseType.OK, "", list);
//}
/// <summary>
/// 月群体人均绩效
......
......@@ -1142,18 +1142,6 @@
</summary>
<returns></returns>
</member>
<member name="M:Performance.Api.Controllers.ReportController.Medicine(Performance.DtoModels.ReportRequest)">
<summary>
科室药占比
</summary>
<returns></returns>
</member>
<member name="M:Performance.Api.Controllers.ReportController.Income(Performance.DtoModels.ReportRequest)">
<summary>
科室有效收入占比
</summary>
<returns></returns>
</member>
<member name="M:Performance.Api.Controllers.ReportController.AvgPerfor(Performance.DtoModels.ReportRequest)">
<summary>
月群体人均绩效
......
......@@ -1175,7 +1175,7 @@
</member>
<member name="P:Performance.EntityModels.ag_secondallot.SubmitType">
<summary>
提交类型 1使用模板 2 其他类型数据
提交类型 1 使用模板 2 其他类型数据
</summary>
</member>
<member name="P:Performance.EntityModels.ag_secondallot.SubmitTime">
......@@ -1423,6 +1423,11 @@
</summary>
</member>
<member name="P:Performance.EntityModels.ag_workload_source.WorkTypeId">
<summary>
1、单项奖励 2、工作量占比 ..(自定义占比)
</summary>
</member>
<member name="T:Performance.EntityModels.ag_workload_type">
<summary>
......
......@@ -82,7 +82,7 @@ public class ag_secondallot
public Nullable<int> Status { get; set; }
/// <summary>
/// 提交类型 1使用模板 2 其他类型数据
/// 提交类型 1 使用模板 2 其他类型数据
/// </summary>
public Nullable<int> SubmitType { get; set; }
......
......@@ -55,5 +55,10 @@ public class ag_workload_source
///
/// </summary>
public Nullable<decimal> Value { get; set; }
/// <summary>
/// 1、单项奖励 2、工作量占比 ..(自定义占比)
/// </summary>
public Nullable<int> WorkTypeId { get; set; }
}
}
......@@ -213,7 +213,7 @@ public IEnumerable<ex_result> QueryIncomeData(int allotid, string source, string
WHERE t1.allotid = @allotid
AND t3.unittype = @unittype
AND t3.accountingunit = @accountingunit
AND t1.Source like '%{source}开单%'
AND (t1.Source like '%{source}开单%' OR t1.Source like '%{source}就诊%')
AND T1.IsDelete = 0
ORDER BY t1.doctorname,t1.Category;";
return connection.Query<ex_result>(clear, new { allotid, accountingunit, unittype, hospitalid }, commandTimeout: 60 * 60);
......
......@@ -59,33 +59,33 @@ public List<PerReport> InpatFeeAvg(int hospitalId, List<string> date)
return DapperQuery(sql, new { date, hospitalId }).ToList();
}
/// <summary>
/// 科室药占比
/// </summary>
/// <returns></returns>
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
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
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;";
return DapperQuery(sql, new { hospitalId, date }).ToList();
}
// /// <summary>
// /// 科室药占比
// /// </summary>
// /// <returns></returns>
// 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
// 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
// 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;";
// return DapperQuery(sql, new { hospitalId, date }).ToList();
// }
/// <summary>
/// 科室有效收入占比
/// </summary>
/// <returns></returns>
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
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 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;";
return DapperQuery(sql, new { hospitalId, date }).ToList();
}
// /// <summary>
// /// 科室有效收入占比
// /// </summary>
// /// <returns></returns>
// 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
// 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 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;";
// return DapperQuery(sql, new { hospitalId, date }).ToList();
// }
#region 首页报表
/// <summary>
......
......@@ -522,6 +522,7 @@ public void GenerateSecondAllot(per_allot allot)
List<ag_secondallot> tempSecond = new List<ag_secondallot>();
List<ag_secondallot> insSecond = new List<ag_secondallot>();
List<ag_secondallot> updSecond = new List<ag_secondallot>();
List<ag_secondallot> delSecond = new List<ag_secondallot>();
var types = new List<int> { (int)UnitType.行政高层, (int)UnitType.行政中层, (int)UnitType.行政后勤 };
//// 获取医院是否开启后勤二次分配
......@@ -612,11 +613,37 @@ public void GenerateSecondAllot(per_allot allot)
}
}
if (secondList != null && secondList.Any())
{
foreach (var item in secondList)
{
var second = tempSecond?.FirstOrDefault(f => f.UnitType == item.UnitType && f.Department == item.Department);
if (second == null)
{
delSecond.Add(item);
}
}
}
if (insSecond.Any())
perforAgsecondallotRepository.AddRange(insSecond.ToArray());
if (updSecond.Any())
{
perforAgsecondallotRepository.UpdateRange(updSecond.ToArray());
foreach (var item in updSecond.Where(w => w.Status == 4))
{
// 自动驳回,需要清空该科室历史数据
var histories = perforAgcomputeRepository.GetEntities(w => w.SecondId == item.Id);
if (histories != null && histories.Any())
perforAgcomputeRepository.RemoveRange(histories.ToArray());
}
}
if (delSecond.Any())
{
perforAgsecondallotRepository.RemoveRange(delSecond.ToArray());
}
}
}
}
......@@ -11,6 +11,7 @@
using System.Text.RegularExpressions;
using Performance.DtoModels.Request;
using Performance.DtoModels.Response;
using Performance.Services.ExtractExcelService;
namespace Performance.Services
{
......@@ -1043,6 +1044,20 @@ public DeptDataDetails<DetailModuleExtend> DeptDetail(int accountId)
var headers = _perforImheaderRepository.GetEntities(t => t.AllotID == account.AllotID);
var basicData = _perforImDataRepository.GetEntities(t => t.AllotID == account.AllotID && t.AccountingUnit == account.AccountingUnit);
Func<string, string> getShowKey = (name) =>
{
string _key = "开单";
if (string.IsNullOrEmpty(name)) return _key;
if (name.IndexOf("就诊") > -1)
_key = "就诊";
return _key;
};
string key = getShowKey.Invoke(persheet.FirstOrDefault(t => t.SheetName.NoBlank().StartsWith("1.1.1"))?.SheetName);
DeptDataDetails deptDetails = new DeptDataDetails
{
ShowFormula = allot.ShowFormula,
......@@ -1050,7 +1065,7 @@ public DeptDataDetails<DetailModuleExtend> DeptDetail(int accountId)
Detail = new List<DetailDtos>()
};
if (basicData == null || !basicData.Any()) return MergeDetails(deptDetails);
if (basicData == null || !basicData.Any()) return MergeDetails(deptDetails, key);
var sheetType = new List<int>
{
......@@ -1118,7 +1133,7 @@ public DeptDataDetails<DetailModuleExtend> DeptDetail(int accountId)
deptDetails.Pandect.MaterialsExtra = deptDetails.Detail?.FirstOrDefault(w => w.OriginalType == (int)SheetType.AccountMaterialsAssess)?.Amount ?? deptDetails.Pandect.MaterialsExtra;
deptDetails.Pandect.MedicineExtra = deptDetails.Detail?.FirstOrDefault(w => w.OriginalType == (int)SheetType.AccountDrugAssess)?.Amount ?? deptDetails.Pandect.MedicineExtra;
return MergeDetails(deptDetails);
return MergeDetails(deptDetails, key);
//return deptDetails;
}
......@@ -1243,7 +1258,7 @@ private List<DetailModule> CommonDetailItems(List<im_data> basicData, List<im_he
return items;
}
private DeptDataDetails<DetailModuleExtend> MergeDetails(DeptDataDetails details)
private DeptDataDetails<DetailModuleExtend> MergeDetails(DeptDataDetails details, string key)
{
if (details == null) return new DeptDataDetails<DetailModuleExtend>();
......@@ -1267,7 +1282,7 @@ private DeptDataDetails<DetailModuleExtend> MergeDetails(DeptDataDetails details
{
depts.AddRange(t.Items.Select(o => o.ItemName));
});
var billing = data.FirstOrDefault(t => t.ItemName.Replace("就诊", "开单").IndexOf("开单") > -1);
var billing = data.FirstOrDefault(t => t.ItemName.IndexOf(key) > -1);
var execute = data.FirstOrDefault(t => t.ItemName.IndexOf("执行") > -1);
foreach (var dept in depts.Distinct().OrderBy(t => t))
{
......@@ -1316,7 +1331,7 @@ private DeptDataDetails<DetailModuleExtend> MergeDetails(DeptDataDetails details
result.Detail.Add(new DetailDtos<DetailModuleExtend>
{
ItemName = data.FirstOrDefault(t => t.ItemName.IndexOf("执行") > -1) is null ? data.First().ItemName :
data.FirstOrDefault(t => t.ItemName.IndexOf("执行") > -1).ItemName?.Replace("执行", "开单/执行"),
data.FirstOrDefault(t => t.ItemName.IndexOf("执行") > -1).ItemName?.Replace("执行", $"{key}/执行"),
IncomeType = data.First()?.IncomeType ?? 0,
OriginalType = data.First()?.OriginalType ?? 0,
Amount = data.Sum(w => w.Amount),
......
This source diff could not be displayed because it is too large. You can view the blob instead.
......@@ -72,6 +72,7 @@ public List<ex_module> QueryModule(int hospitalId)
DefaultModules(hospitalId);
var list = exmoduleRepository.GetEntities(t => t.HospitalId == hospitalId).OrderBy(t => t.ModuleName).ToList();
list?.ForEach(t => t.ReadOnly = t.SheetType == (int)SheetType.Income ? 0 : 1);
return list;
}
......@@ -90,7 +91,7 @@ private void DefaultModules(int 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.Any(w => w.ModuleName.StartsWith(t.ModuleName.Split(' ')[0])));
if (inexistence != null && inexistence.Any())
{
......@@ -102,7 +103,7 @@ private void DefaultModules(int hospitalId)
HospitalId = hospitalId,
ModuleName = item.ModuleName,
SheetType = (int)item.SheetType,
ReadOnly = 1,
ReadOnly = item.SheetType == (int)SheetType.Income ? 0 : 1,
TypeId = null,
};
modules.Add(module);
......@@ -120,8 +121,7 @@ public ex_module AddModule(ModModuleRequest request)
string addname = "";
if (request.SheetType == (int)SheetType.Income)
{
string[] array = new string[] { "开单收入", "执行收入" };
if (request.ModuleName.IndexOf("开单收入") == -1 && request.ModuleName.IndexOf("执行收入") == -1)
if (request.ModuleName.IndexOf("开单收入") == -1 && request.ModuleName.IndexOf("就诊收入") == -1 && request.ModuleName.IndexOf("执行收入") == -1)
throw new PerformanceException("模块名称规则错误");
//if (!Regex.IsMatch(request.ModuleName, @"^[\u4e00-\u9fa5]+$"))
// throw new PerformanceException("模块名称规则错误,请使用全中文命名");
......@@ -132,7 +132,7 @@ public ex_module AddModule(ModModuleRequest request)
throw new PerformanceException("绩效模板已存在!");
var moduleList = exmoduleRepository.GetEntities(t => t.HospitalId == request.HospitalId && t.ModuleName.IndexOf("1.") != -1);
string name = request.ModuleName.Replace("开单收入", "").Replace("执行收入", "");
string name = request.ModuleName.Replace("开单收入", "").Replace("就诊收入", "").Replace("执行收入", "");
var exist = moduleList.Where(t => t.ModuleName.Contains(name));
if (exist != null && exist.Any())
{
......
......@@ -57,7 +57,7 @@ public static void CreateNotExistSheet(List<ex_module> modulesList, IWorkbook wo
var sheet = workbook.GetSheet(module.ModuleName) ?? workbook.GetSheet(module.ModuleName.NoBlank());
if (sheet == null)
{
string[] keyArray = new string[] { "开单", "执行" };
string[] keyArray = new string[] { "开单", "就诊", "执行" };
if (keyArray.Any(key => module.ModuleName.Contains(key)))
{
var item = pairs.Where(t => t.Key.StartsWith("1.")).OrderByDescending(t => t.Key).First();
......@@ -154,7 +154,7 @@ public static void ClearSheetTemplate(ISheet sheet, PerSheetPoint point, SheetTy
sheet.ShiftRows(point.DataFirstRowNum.Value, sheet.LastRowNum + 1, -1);
}
}
public static void CloseAutoFilter(string path)
{
try
......
......@@ -182,53 +182,53 @@ public List<PerReport> InpatFeeAvg(int hospitalId)
return perforReportRepository.InpatFeeAvg(hospitalId, date);
}
/// <summary>
/// 科室药占比
/// </summary>
/// <returns></returns>
public List<PerReport> Medicine(int hospitalId, int isIndex)
{
var states = new List<int>() { 6, 8 };
var allotList = perforPerallotRepository.GetEntities(t => t.HospitalId == hospitalId && states.Contains(t.States));
if (allotList == null || !allotList.Any())
throw new PerformanceException("用户未创建绩效!");
var date = new List<string>();
if (isIndex == 1)
{
var allot = allotList.OrderByDescending(t => t.Year).ThenByDescending(t => t.Month).FirstOrDefault();
date.Add(allot.Year + "-" + allot.Month.ToString().PadLeft(2, '0'));
}
else
{
date = allotList.OrderByDescending(t => t.Year).ThenByDescending(t => t.Month).Take(6).Select(t => t.Year + "-" + t.Month.ToString().PadLeft(2, '0')).ToList();
}
return perforReportRepository.Medicine(hospitalId, date);
}
/// <summary>
/// 科室有效收入占比
/// </summary>
/// <returns></returns>
public List<PerReport> Income(int hospitalId, int isIndex)
{
var states = new List<int>() { 6, 8 };
var allotList = perforPerallotRepository.GetEntities(t => t.HospitalId == hospitalId && states.Contains(t.States));
if (allotList == null || !allotList.Any())
throw new PerformanceException("用户未创建绩效!");
var date = new List<string>();
if (isIndex == 1)
{
var allot = allotList.OrderByDescending(t => t.Year).ThenByDescending(t => t.Month).FirstOrDefault();
date.Add(allot.Year + "-" + allot.Month.ToString().PadLeft(2, '0'));
}
else
{
date = allotList.OrderByDescending(t => t.Year).ThenByDescending(t => t.Month).Take(6).Select(t => t.Year + "-" + t.Month.ToString().PadLeft(2, '0')).ToList();
}
return perforReportRepository.Income(hospitalId, date);
}
///// <summary>
///// 科室药占比
///// </summary>
///// <returns></returns>
//public List<PerReport> Medicine(int hospitalId, int isIndex)
//{
// var states = new List<int>() { 6, 8 };
// var allotList = perforPerallotRepository.GetEntities(t => t.HospitalId == hospitalId && states.Contains(t.States));
// if (allotList == null || !allotList.Any())
// throw new PerformanceException("用户未创建绩效!");
// var date = new List<string>();
// if (isIndex == 1)
// {
// var allot = allotList.OrderByDescending(t => t.Year).ThenByDescending(t => t.Month).FirstOrDefault();
// date.Add(allot.Year + "-" + allot.Month.ToString().PadLeft(2, '0'));
// }
// else
// {
// date = allotList.OrderByDescending(t => t.Year).ThenByDescending(t => t.Month).Take(6).Select(t => t.Year + "-" + t.Month.ToString().PadLeft(2, '0')).ToList();
// }
// return perforReportRepository.Medicine(hospitalId, date);
//}
///// <summary>
///// 科室有效收入占比
///// </summary>
///// <returns></returns>
//public List<PerReport> Income(int hospitalId, int isIndex)
//{
// var states = new List<int>() { 6, 8 };
// var allotList = perforPerallotRepository.GetEntities(t => t.HospitalId == hospitalId && states.Contains(t.States));
// if (allotList == null || !allotList.Any())
// throw new PerformanceException("用户未创建绩效!");
// var date = new List<string>();
// if (isIndex == 1)
// {
// var allot = allotList.OrderByDescending(t => t.Year).ThenByDescending(t => t.Month).FirstOrDefault();
// date.Add(allot.Year + "-" + allot.Month.ToString().PadLeft(2, '0'));
// }
// else
// {
// date = allotList.OrderByDescending(t => t.Year).ThenByDescending(t => t.Month).Take(6).Select(t => t.Year + "-" + t.Month.ToString().PadLeft(2, '0')).ToList();
// }
// return perforReportRepository.Income(hospitalId, date);
//}
/// <summary>
/// 只支持EXCEL抽取报表数据
......
......@@ -133,7 +133,7 @@ public List<HeadItem> GetHeadItems(int hospitalId, int tempId, ag_secondallot se
var configHeaders = agworkloadRepository.GetEntities(w => w.HospitalId == hospitalId && w.Department == secondAllot.Department && w.UnitType == secondAllot.UnitType);
if (SecondAllotService.defaultValues != null && SecondAllotService.defaultValues.Any())
configHeaders = configHeaders.Where(w => !SecondAllotService.defaultValues.Select(t => t.Item1).Contains(w.ItemName)).ToList();
configHeaders = configHeaders?.Where(w => !SecondAllotService.defaultValues.Select(t => t.Item1).Contains(w.ItemName)).ToList();
// 初始化固定列
var headItems = Mapper.Map<List<HeadItem>>(fixedHeaders) ?? new List<HeadItem>();
......
......@@ -420,15 +420,19 @@ public dynamic GetWorkloadDict(int secondId)
private dynamic GetWorkloadDictAfterAudit(int secondId)
{
var bodysources = agbodysourceRepository.GetEntities(t => t.SecondId == secondId);
if (bodysources == null || !bodysources.Any()) return new string[] { };
var workloadsources = agworkloadsourceRepository.GetEntities(t => bodysources.Select(w => w.Id).Contains(t.BodyId));
if (workloadsources == null || !workloadsources.Any()) return new string[] { };
var dict = workloadsources.GroupBy(t => new { t.ItemId, t.ItemName, t.FactorValue }).Select(t => new
{
Title = t.Key.ItemId,
Value = t.Key.ItemName,
Factor = t.Key.FactorValue
});
var dict = workloadsources.GroupBy(t => new { t.ItemId, t.ItemName, t.FactorValue, t.Sort, t.WorkTypeId, t.WorkloadId })
.OrderBy(t => t.Key.WorkTypeId).ThenBy(t => t.Key.Sort)
.Select(t => new
{
Title = t.Key.ItemId,
Value = t.Key.ItemName,
Factor = t.Key.FactorValue
});
return dict;
}
......@@ -553,7 +557,8 @@ private void SaveSecondAllotBodyData(int hospitalId, ag_secondallot second, dyna
ItemName = workload.ItemName,
FactorValue = workload.FactorValue,
Sort = workload.Sort,
Value = ConvertHelper.To<decimal>(dict[key])
Value = ConvertHelper.To<decimal>(dict[key]),
WorkTypeId = workload.WorkTypeId
});
}
}
......
......@@ -1471,7 +1471,13 @@ public List<ag_secondallot> AuditList(int allotId)
if (allot == null)
throw new PerformanceException("所选绩效不存在!");
var accountUnit = resaccountRepository.GetEntities(t => t.AllotID == allotId && !new int[] { (int)UnitType.行政高层, (int)UnitType.行政中层 }.Contains(t.UnitType.Value));
var types = new List<int> { (int)UnitType.行政高层, (int)UnitType.行政中层, (int)UnitType.行政后勤 };
var accountUnit = resaccountRepository.GetEntities(t => t.AllotID == allot.ID && !types.Contains(t.UnitType.Value));
// 查询需要进行二次分配的行政后勤科室
var xzAccountUnit = resaccountRepository.GetEntities(t => t.AllotID == allot.ID && t.UnitType.Value == (int)UnitType.行政后勤 && t.NeedSecondAllot == "是");
if (xzAccountUnit != null && xzAccountUnit.Count > 0)
(accountUnit ?? new List<res_account>()).AddRange(xzAccountUnit);
var specialunit = resspecialunitRepository.GetEntities(t => t.AllotID == allot.ID);
return SecondList(allot, accountUnit, specialunit);
......@@ -1656,7 +1662,10 @@ public bool ConfirmAudit(int userId, SecondAuditRequest request)
return true;
var computes = new List<ag_compute>();
if (second.SubmitType == 1)
var (tempId, name) = GetUsingTempId(hospital.ID, second);
if (new int[] { (int)Temp.crosswise, (int)Temp.lengthways }.Contains(tempId))
{
var items = agfixatitemRepository.GetEntities(t => t.SecondId == request.SecondId);
if (items != null && items.Any())
......@@ -1686,7 +1695,7 @@ public bool ConfirmAudit(int userId, SecondAuditRequest request)
}
}
}
else if (second.SubmitType == 2)
else if (tempId == (int)Temp.other)
{
var others = agothersourceRepository.GetEntities(t => t.SecondId == request.SecondId);
if (others != null && others.Any())
......@@ -1710,6 +1719,30 @@ public bool ConfirmAudit(int userId, SecondAuditRequest request)
}
}
}
else
{
var bodys = agbodysourceRepository.GetEntities(t => t.SecondId == request.SecondId);
if (bodys != null && bodys.Any())
{
foreach (var item in bodys)
{
computes.Add(new ag_compute
{
AllotId = second.AllotId,
SecondId = second.Id,
UnitType = second.UnitType,
Department = second.Department,
WorkPost = item.Post,
JobNumber = item.WorkNumber,
PersonName = item.Name,
PerforSumFee = item.DistPerformance,
OthePerfor = item.OtherPerformance,
NightWorkPerfor = item.NightWorkPerformance,
RealGiveFee = item.RealAmount,
});
}
}
}
agcomputeRepository.AddRange(computes.ToArray());
}
......
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