修改导表和时间处理
continuous-integration/drone/push Build is passing
Details
continuous-integration/drone/push Build is passing
Details
parent
8ff23af18c
commit
f8e498b2e1
|
@ -74,15 +74,15 @@ public static class ExcelExportHelper
|
|||
{
|
||||
var itemDic = item.ConvertToDictionary();
|
||||
|
||||
//处理集合里面时间类型,根据当前语言将时间转变为字符串
|
||||
foreach (var itemValuePair in itemDic)
|
||||
{
|
||||
// 临床数据 1,1 会变成2024-01-01
|
||||
if (itemValuePair.Value?.ToString().Length > 8 && DateTime.TryParse(itemValuePair.Value?.ToString(), out DateTime result))
|
||||
{
|
||||
itemDic[itemValuePair.Key] = ExportExcelConverterDate.DateTimeInternationalToString(result);
|
||||
}
|
||||
}
|
||||
////处理集合里面时间类型,根据当前语言将时间转变为字符串
|
||||
//foreach (var itemValuePair in itemDic)
|
||||
//{
|
||||
// // 临床数据 1,1 会变成2024-01-01
|
||||
// if (itemValuePair.Value?.ToString().Length > 8 && DateTime.TryParse(itemValuePair.Value?.ToString(), out DateTime result))
|
||||
// {
|
||||
// itemDic[itemValuePair.Key] = ExportExcelConverterDate.DateTimeInternationalToString(result);
|
||||
// }
|
||||
//}
|
||||
|
||||
|
||||
foreach (var needTranslateProperty in needTranslatePropertyList)
|
||||
|
@ -335,14 +335,14 @@ public static class ExcelExportHelper
|
|||
//var itemDic = JsonConvert.DeserializeObject<IDictionary<string, object>>(item.ToJsonNotIgnoreNull());
|
||||
var itemDic = item.ConvertToDictionary();
|
||||
|
||||
//处理集合里面时间类型,根据当前语言将时间转变为字符串
|
||||
foreach (var itemValuePair in itemDic)
|
||||
{
|
||||
if (itemValuePair.Value?.ToString().Length > 8 && DateTime.TryParse(itemValuePair.Value?.ToString(), out DateTime result))
|
||||
{
|
||||
itemDic[itemValuePair.Key] = ExportExcelConverterDate.DateTimeInternationalToString(result);
|
||||
}
|
||||
}
|
||||
////处理集合里面时间类型,根据当前语言将时间转变为字符串
|
||||
//foreach (var itemValuePair in itemDic)
|
||||
//{
|
||||
// if (itemValuePair.Value?.ToString().Length > 8 && DateTime.TryParse(itemValuePair.Value?.ToString(), out DateTime result))
|
||||
// {
|
||||
// itemDic[itemValuePair.Key] = ExportExcelConverterDate.DateTimeInternationalToString(result);
|
||||
// }
|
||||
//}
|
||||
|
||||
foreach (var needTranslateProperty in needTranslatePropertyList)
|
||||
{
|
||||
|
|
|
@ -933,7 +933,7 @@
|
|||
<param name="_trialRepository"></param>
|
||||
<returns></returns>
|
||||
</member>
|
||||
<member name="M:IRaCIS.Core.Application.Service.Common.ExcelExportService.GetCommonJudgeRatioList_Export(IRaCIS.Core.Application.ViewModel.VisitTaskQuery,IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.CommonDocument},IRaCIS.Application.Interfaces.IDictionaryService,IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.Trial})">
|
||||
<member name="M:IRaCIS.Core.Application.Service.Common.ExcelExportService.GetCommonJudgeRatioList_Export(IRaCIS.Core.Application.ViewModel.VisitTaskQuery,IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.CommonDocument},IRaCIS.Application.Interfaces.IDictionaryService,IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.SubjectUser},IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.Trial})">
|
||||
<summary>
|
||||
裁判一致率导出
|
||||
</summary>
|
||||
|
|
|
@ -8,6 +8,7 @@ using IRaCIS.Core.Application.ViewModel;
|
|||
using IRaCIS.Core.Domain.Models;
|
||||
using IRaCIS.Core.Domain.Share;
|
||||
using IRaCIS.Core.Infra.EFCore.Common;
|
||||
using IRaCIS.Core.Infra.EFCore.Migrations;
|
||||
using Microsoft.AspNetCore.Authorization;
|
||||
using Microsoft.AspNetCore.Hosting;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
|
@ -2347,6 +2348,7 @@ namespace IRaCIS.Core.Application.Service.Common
|
|||
public async Task<IActionResult> GetCommonJudgeRatioList_Export(VisitTaskQuery inQuery,
|
||||
[FromServices] IRepository<CommonDocument> _commonDocumentRepository,
|
||||
[FromServices] IDictionaryService _dictionaryService,
|
||||
[FromServices] IRepository<SubjectUser> _subjectUserRepository,
|
||||
[FromServices] IRepository<Trial> _trialRepository)
|
||||
{
|
||||
//每次查询必须是单标准的
|
||||
|
@ -2555,17 +2557,33 @@ namespace IRaCIS.Core.Application.Service.Common
|
|||
}))
|
||||
.ToList();
|
||||
|
||||
exportInfo.DoctorSubjectStatList = filteredList.GroupBy(t => new { t.DoctorUserId, t.UserName, t.FullName }).Select(g => new DoctorJudgeRatio()
|
||||
|
||||
|
||||
//找到该标准的阅片人
|
||||
var armList = new List<Arm>() { Arm.SingleReadingArm, Arm.DoubleReadingArm1, Arm.DoubleReadingArm2 };
|
||||
|
||||
exportInfo.DoctorSubjectStatList = _subjectUserRepository.Where(t => t.TrialId == inQuery.TrialId && t.TrialReadingCriterionId == inQuery.TrialReadingCriterionId && armList.Contains(t.ArmEnum))
|
||||
.Select(t => new DoctorJudgeRatio()
|
||||
{
|
||||
DoctorUserId = g.Key.DoctorUserId,
|
||||
UserName = g.Key.UserName,
|
||||
FullName = g.Key.FullName,
|
||||
DoctorUserId = t.DoctorUserId,
|
||||
UserName = t.DoctorUser.UserName,
|
||||
FullName = t.DoctorUser.FullName,
|
||||
|
||||
TotalJudgeCount = g.Count(),
|
||||
TotalJudgeCount = 0,
|
||||
|
||||
JudgeAgreeCount = g.Count(t => t.JudgeResultTaskId == t.VisitTaskId)
|
||||
JudgeAgreeCount = 0
|
||||
|
||||
}).ToList();
|
||||
}).Distinct().ToList();
|
||||
|
||||
foreach (var doctor in exportInfo.DoctorSubjectStatList)
|
||||
{
|
||||
if (filteredList.Any(t => t.DoctorUserId == doctor.DoctorUserId))
|
||||
{
|
||||
doctor.TotalJudgeCount= filteredList.Where(t=>t.DoctorUserId==doctor.DoctorUserId).Count();
|
||||
|
||||
doctor.JudgeAgreeCount= filteredList.Where(t => t.DoctorUserId == doctor.DoctorUserId).Count(t => t.JudgeResultTaskId == t.VisitTaskId);
|
||||
}
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
|
|
|
@ -1,4 +1,5 @@
|
|||
using Newtonsoft.Json;
|
||||
using IRaCIS.Core.API._ServiceExtensions.NewtonsoftJson;
|
||||
using Newtonsoft.Json;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Reflection;
|
||||
|
@ -81,6 +82,15 @@ namespace IRaCIS.Core.Infrastructure.Extention
|
|||
{
|
||||
dictionary.Add(propertyName, (int)propertyValue);
|
||||
}
|
||||
// 检查属性是否是时间类型
|
||||
else if (property.PropertyType == typeof(DateTime) ||
|
||||
property.PropertyType == typeof(DateTime?) && propertyValue != null)
|
||||
{
|
||||
DateTime.TryParse(propertyValue.ToString(), out DateTime result);
|
||||
var dt = ExportExcelConverterDate.DateTimeInternationalToString(result);
|
||||
// 如果需要,可以对时间值进行特定的处理
|
||||
dictionary.Add(propertyName, dt);
|
||||
}
|
||||
else
|
||||
{
|
||||
dictionary.Add(propertyName, propertyValue);
|
||||
|
|
Loading…
Reference in New Issue