Test.EIImageViewer
he 2023-02-13 11:15:27 +08:00
parent d5f72ca7de
commit dcd9121e4c
6 changed files with 205 additions and 1 deletions

View File

@ -0,0 +1,55 @@
//--------------------------------------------------------------------
// 此代码由T4模板自动生成 byzhouhang 20210918
// 生成时间 2023-02-13 10:38:12
// 对此文件的更改可能会导致不正确的行为,并且如果重新生成代码,这些更改将会丢失。
//--------------------------------------------------------------------
using System;
using IRaCIS.Core.Domain.Share;
using System.Collections.Generic;
namespace IRaCIS.Core.Application.ViewModel
{
/// <summary> DefaultShortcutKeyView 列表视图模型 </summary>
public class DefaultShortcutKeyView
{
public Guid Id { get; set; }
public string Keyboardkey { get; set; }
public int ShortcutKeyEnum { get; set; }
public int ImageToolType { get; set; }
public DateTime CreateTime { get; set; }
public Guid CreateUserId { get; set; }
}
public class SetDefaultShortcutKey
{
public int ImageToolType { get; set; }
public List<DefaultShortcutKeyItem> ShortcutKeyList { get; set; }
}
public class DefaultShortcutKeyItem
{
public string Keyboardkey { get; set; }
public int ShortcutKeyEnum { get; set; }
}
///<summary>DefaultShortcutKeyQuery 列表查询参数模型</summary>
public class DefaultShortcutKeyQuery
{
public int ImageToolType { get; set; }
}
///<summary> DefaultShortcutKeyAddOrEdit 列表查询参数模型</summary>
public class DefaultShortcutKeyAddOrEdit
{
public Guid Id { get; set; }
public string Keyboardkey { get; set; }
public int ShortcutKeyEnum { get; set; }
public int ImageToolType { get; set; }
}
}

View File

@ -0,0 +1,100 @@
//--------------------------------------------------------------------
// 此代码由T4模板自动生成 byzhouhang 20210918
// 生成时间 2023-02-13 10:33:22
// 对此文件的更改可能会导致不正确的行为,并且如果重新生成代码,这些更改将会丢失。
//--------------------------------------------------------------------
using IRaCIS.Core.Domain.Models;
using Microsoft.AspNetCore.Mvc;
using IRaCIS.Core.Application.Interfaces;
using IRaCIS.Core.Application.ViewModel;
namespace IRaCIS.Core.Application.Service
{
/// <summary>
/// 快捷键服务
/// </summary>
[ApiExplorerSettings(GroupName = "Reading")]
public class ShortcutKeyService: BaseService
{
private readonly IRepository<Dictionary> _dictionaryRepository;
private readonly IRepository<DefaultShortcutKey> _defaultShortcutKeyRepository;
public ShortcutKeyService(
IRepository<Dictionary> DictionaryRepository,
IRepository<DefaultShortcutKey> defaultShortcutKeyRepository
)
{
_dictionaryRepository = DictionaryRepository;
_defaultShortcutKeyRepository = defaultShortcutKeyRepository;
}
/// <summary>
/// 获取默认快捷键
/// </summary>
/// <param name="inQuery"></param>
/// <returns></returns>
[HttpPost]
public async Task<List<DefaultShortcutKeyView>> GetDefaultShortcutKeyList(DefaultShortcutKeyQuery inQuery)
{
var defaultShortcutKey = await _defaultShortcutKeyRepository.Where(x => x.ImageToolType == inQuery.ImageToolType).ToListAsync();
var shortcutKeydic = await _dictionaryRepository.Where(x => x.Parent.Code == "ShortcutKey").ToListAsync();
var result = shortcutKeydic.OrderBy(x=>x.ShowOrder).Select(x => new DefaultShortcutKeyView()
{
Id = x.Id,
ImageToolType = inQuery.ImageToolType,
ShortcutKeyEnum = int.Parse(x.Code),
Keyboardkey = defaultShortcutKey.Where(y => y.ShortcutKeyEnum == int.Parse(x.Code)).Select(y => y.Keyboardkey).FirstOrDefault() ?? string.Empty,
}).ToList();
return result;
}
/// <summary>
/// 获取医生快捷键
/// </summary>
/// <param name="inQuery"></param>
/// <returns></returns>
[HttpPost]
public async Task<List<DefaultShortcutKeyView>> GetDoctorShortcutKey(DefaultShortcutKeyQuery inQuery)
{
var defaultShortcutKey = await _defaultShortcutKeyRepository.Where(x => x.ImageToolType == inQuery.ImageToolType).ToListAsync();
var shortcutKeydic = await _dictionaryRepository.Where(x => x.Parent.Code == "ShortcutKey").ToListAsync();
var result = shortcutKeydic.OrderBy(x => x.ShowOrder).Select(x => new DefaultShortcutKeyView()
{
Id = x.Id,
ImageToolType = inQuery.ImageToolType,
ShortcutKeyEnum = int.Parse(x.Code),
Keyboardkey = defaultShortcutKey.Where(y => y.ShortcutKeyEnum == int.Parse(x.Code)).Select(y => y.Keyboardkey).FirstOrDefault() ?? string.Empty,
}).ToList();
return result;
}
/// <summary>
/// 设置默认快捷键
/// </summary>
/// <param name="inDto"></param>
/// <returns></returns>
[HttpPost]
public async Task<bool> SetDefaultShortcutKey(SetDefaultShortcutKey inDto)
{
await _defaultShortcutKeyRepository.BatchDeleteNoTrackingAsync(x => x.ImageToolType == inDto.ImageToolType);
await _defaultShortcutKeyRepository.AddRangeAsync(inDto.ShortcutKeyList.Select(x => new DefaultShortcutKey()
{
ImageToolType = inDto.ImageToolType,
Keyboardkey = x.Keyboardkey,
ShortcutKeyEnum = x.ShortcutKeyEnum
}));
return await _defaultShortcutKeyRepository.SaveChangesAsync();
}
}
}

View File

@ -16,6 +16,8 @@ namespace IRaCIS.Core.Application.Service
//是否英文环境
var isEn_Us=false;
CreateMap<DefaultShortcutKey, DefaultShortcutKeyView>();
CreateMap<ReadingPeriodSetAddOrEdit, ReadingPeriodSet>();
CreateMap<AddOrUpdateTumorAssessmentInDto, TumorAssessment>();

View File

@ -0,0 +1,46 @@
//--------------------------------------------------------------------
// 此代码由T4模板自动生成 byzhouhang 20210918
// 生成时间 2023-02-13 10:33:05
// 对此文件的更改可能会导致不正确的行为,并且如果重新生成代码,这些更改将会丢失。
using System;
using IRaCIS.Core.Domain.Share;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
namespace IRaCIS.Core.Domain.Models
{
///<summary>
///DefaultShortcutKey
///</summary>
[Table("DefaultShortcutKey")]
public class DefaultShortcutKey : Entity, IAuditUpdate, IAuditAdd
{
/// <summary>
/// 对应的键盘按键
/// </summary>
public string Keyboardkey { get; set; } = string.Empty;
/// <summary>
/// 按键枚举
/// </summary>
public int ShortcutKeyEnum { get; set; }
/// <summary>
/// 影像工具类型
/// </summary>
public int ImageToolType { get; set; }
/// <summary>
/// CreateTime
/// </summary>
public DateTime CreateTime { get; set; }
/// <summary>
/// CreateUserId
/// </summary>
public Guid CreateUserId { get; set; }
}
}

View File

@ -434,6 +434,7 @@ namespace IRaCIS.Core.Infra.EFCore
#endregion
public virtual DbSet<DefaultShortcutKey> DefaultShortcutKey { get; set; }
public virtual DbSet<EmailNoticeConfig> EmailNoticeConfig { get; set; }
public virtual DbSet<SystemBasicData> SystemBasicData { get; set; }

View File

@ -4,7 +4,7 @@
public static readonly string ConnectionString = "Server=123.56.94.154,1433\\MSSQLSERVER;Database=IRaCIS_New_Tet;User ID=sa;Password=dev123456DEV;TrustServerCertificate=true";
public static readonly string DbDatabase = "IRaCIS_New_Tet";
//表名称用字符串,拼接
public static readonly string TableName = "TrialCriterionDictionaryCode";
public static readonly string TableName = "DefaultShortcutKey";
//具体文件里面 例如service 可以配置是否分页
}
#>