13 changed files with 17784 additions and 13 deletions
-
24src/Shentun.Pacs.Application.Contracts/PacsBusiness/ImportPeisCheckDataByCheckRequestNoInputDto.cs
-
162src/Shentun.Pacs.Application/CollectItemTypes/CollectItemTypeAppService.cs
-
300src/Shentun.Pacs.Application/PacsBusiness/PacsBusinessAppService.cs
-
842src/Shentun.Pacs.Application/PacsDataMigrates/PacsDataMigrateAppService.cs
-
24src/Shentun.Pacs.Domain/PatientRegisters/PatientRegister.cs
-
2src/Shentun.Pacs.Domain/Patients/PatientManager.cs
-
7src/Shentun.Pacs.Domain/RegisterCheckAsbitems/RegisterCheckAsbitem.cs
-
7src/Shentun.Pacs.Domain/RegisterCheckItems/RegisterCheckItem.cs
-
3src/Shentun.Pacs.EntityFrameworkCore/DbMapping/PatientRegisters/PatientRegisterDbMapping.cs
-
16267src/Shentun.Pacs.EntityFrameworkCore/Migrations/20241213083723_update_patient_register_check.Designer.cs
-
119src/Shentun.Pacs.EntityFrameworkCore/Migrations/20241213083723_update_patient_register_check.cs
-
34src/Shentun.Pacs.EntityFrameworkCore/Migrations/PeisDbContextModelSnapshot.cs
-
6src/Shentun.Pacs.HttpApi.Host/appsettings.json
@ -0,0 +1,24 @@ |
|||||
|
using System; |
||||
|
using System.Collections.Generic; |
||||
|
using System.Text; |
||||
|
|
||||
|
namespace Shentun.Pacs.PacsBusiness |
||||
|
{ |
||||
|
public class ImportPeisCheckDataByCheckRequestNoInputDto |
||||
|
{ |
||||
|
/// <summary>
|
||||
|
/// 检查条码号
|
||||
|
/// </summary>
|
||||
|
public string CheckRequestNo { get; set; } |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 设备Id
|
||||
|
/// </summary>
|
||||
|
public string DeviceId { get; set; } |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 预检Aet
|
||||
|
/// </summary>
|
||||
|
public string ScheduledAet { get; set; } |
||||
|
} |
||||
|
} |
||||
@ -0,0 +1,162 @@ |
|||||
|
using AutoMapper.Internal.Mappers; |
||||
|
using Microsoft.AspNetCore.Authorization; |
||||
|
using Microsoft.AspNetCore.Mvc; |
||||
|
using Shentun.Pacs.HelperDto; |
||||
|
using Shentun.Pacs.Models; |
||||
|
using System; |
||||
|
using System.Collections.Generic; |
||||
|
using System.Linq; |
||||
|
using System.Text; |
||||
|
using System.Threading.Tasks; |
||||
|
using Volo.Abp.Application.Services; |
||||
|
using Volo.Abp.Domain.Repositories; |
||||
|
using Volo.Abp.Identity; |
||||
|
|
||||
|
namespace Shentun.Pacs.CollectItemTypes |
||||
|
{ |
||||
|
/// <summary>
|
||||
|
/// 汇总项目类别
|
||||
|
/// </summary>
|
||||
|
[ApiExplorerSettings(GroupName = "Work")] |
||||
|
[Authorize] |
||||
|
public class CollectItemTypeAppService : ApplicationService |
||||
|
{ |
||||
|
private readonly IRepository<CollectItemType, Guid> _collectItemTypeRepository; |
||||
|
private readonly CacheService _cacheService; |
||||
|
private readonly CollectItemTypeManager _manager; |
||||
|
private readonly IRepository<IdentityUser, Guid> _userRepository; |
||||
|
public CollectItemTypeAppService( |
||||
|
IRepository<CollectItemType, Guid> collectItemTypeRepository, |
||||
|
IRepository<IdentityUser, Guid> userRepository, |
||||
|
CollectItemTypeManager manager, |
||||
|
CacheService cacheService) |
||||
|
{ |
||||
|
_collectItemTypeRepository = collectItemTypeRepository; |
||||
|
_cacheService = cacheService; |
||||
|
_manager = manager; |
||||
|
_userRepository = userRepository; |
||||
|
} |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 根据ID查实体内容
|
||||
|
/// </summary>
|
||||
|
/// <param name="input"></param>
|
||||
|
/// <returns></returns>
|
||||
|
[HttpPost("api/app/CollectItemType/GetById")] |
||||
|
public async Task<CollectItemTypeDto> GetByIdAsync(CollectItemTypeIdInputDto input) |
||||
|
{ |
||||
|
var entity = await _collectItemTypeRepository.GetAsync(input.Id); |
||||
|
var entityDto = ObjectMapper.Map<CollectItemType, CollectItemTypeDto>(entity); |
||||
|
entityDto.CreatorName = _cacheService.GetSurnameAsync(entityDto.CreatorId).Result; |
||||
|
entityDto.LastModifierName = _cacheService.GetSurnameAsync(entityDto.LastModifierId).Result; |
||||
|
|
||||
|
return entityDto; |
||||
|
} |
||||
|
|
||||
|
|
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 查询列表
|
||||
|
/// </summary>
|
||||
|
/// <returns></returns>
|
||||
|
[HttpPost("api/app/CollectItemType/GetList")] |
||||
|
public async Task<List<CollectItemTypeDto>> GetListAsync() |
||||
|
{ |
||||
|
var userQueryable = await _userRepository.GetQueryableAsync(); |
||||
|
|
||||
|
var entlist = (from a in await _collectItemTypeRepository.GetQueryableAsync() |
||||
|
join b in userQueryable on a.CreatorId equals b.Id into bb |
||||
|
from ab in bb.DefaultIfEmpty() |
||||
|
join c in userQueryable on a.LastModifierId equals c.Id into cc |
||||
|
from ac in cc.DefaultIfEmpty() |
||||
|
select new |
||||
|
{ |
||||
|
a, |
||||
|
CreatorName = ab != null ? ab.Surname : "", |
||||
|
LastModifierName = ac != null ? ac.Surname : "" |
||||
|
|
||||
|
}) |
||||
|
.Select(s => new CollectItemTypeDto |
||||
|
{ |
||||
|
CreationTime = s.a.CreationTime, |
||||
|
CreatorId = s.a.CreatorId, |
||||
|
LastModifierId = s.a.LastModifierId, |
||||
|
Id = s.a.Id, |
||||
|
DisplayOrder = s.a.DisplayOrder, |
||||
|
DisplayName = s.a.DisplayName, |
||||
|
InvoiceItemTypeId = s.a.InvoiceItemTypeId, |
||||
|
SimpleCode = s.a.SimpleCode, |
||||
|
LastModificationTime = s.a.LastModificationTime, |
||||
|
CreatorName = s.CreatorName, |
||||
|
LastModifierName = s.LastModifierName |
||||
|
}).OrderBy(o => o.DisplayOrder).ToList(); |
||||
|
|
||||
|
return entlist; |
||||
|
} |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 创建
|
||||
|
/// </summary>
|
||||
|
/// <param name="input"></param>
|
||||
|
/// <returns></returns>
|
||||
|
[HttpPost("api/app/CollectItemType/Create")] |
||||
|
public async Task<CollectItemTypeDto> CreateAsync(CreateCollectItemTypeDto input) |
||||
|
{ |
||||
|
var createEntity = ObjectMapper.Map<CreateCollectItemTypeDto, CollectItemType>(input); |
||||
|
var entity = await _manager.CreateAsync(createEntity); |
||||
|
entity = await _collectItemTypeRepository.InsertAsync(entity); |
||||
|
var dto = ObjectMapper.Map<CollectItemType, CollectItemTypeDto>(entity); |
||||
|
return dto; |
||||
|
} |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 修改
|
||||
|
/// </summary>
|
||||
|
/// <param name="input"></param>
|
||||
|
/// <returns></returns>
|
||||
|
[HttpPost("api/app/CollectItemType/Update")] |
||||
|
public async Task<CollectItemTypeDto> UpdateAsync(UpdateCollectItemTypeDto input) |
||||
|
{ |
||||
|
var entity = await _collectItemTypeRepository.GetAsync(input.Id); |
||||
|
var sourceEntity = ObjectMapper.Map<UpdateCollectItemTypeDto, CollectItemType>(input); |
||||
|
await _manager.UpdateAsync(sourceEntity, entity); |
||||
|
entity = await _collectItemTypeRepository.UpdateAsync(entity); |
||||
|
return ObjectMapper.Map<CollectItemType, CollectItemTypeDto>(entity); |
||||
|
} |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 删除
|
||||
|
/// </summary>
|
||||
|
/// <param name="input"></param>
|
||||
|
/// <returns></returns>
|
||||
|
[HttpPost("api/app/CollectItemType/Delete")] |
||||
|
public async Task DeleteAsync(CollectItemTypeIdInputDto input) |
||||
|
{ |
||||
|
var entity = await _collectItemTypeRepository.GetAsync(input.Id); |
||||
|
await _manager.CheckAndDeleteAsync(entity); |
||||
|
} |
||||
|
|
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 修改排序 置顶,置底
|
||||
|
/// </summary>
|
||||
|
/// <param name="input"></param>
|
||||
|
/// <returns></returns>
|
||||
|
[HttpPost("api/app/CollectItemType/UpdateManySort")] |
||||
|
public async Task UpdateManySortAsync(UpdateManySortInput input) |
||||
|
{ |
||||
|
await _manager.UpdateManySortAsync(input.Id, input.SortType); |
||||
|
} |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 修改排序 拖拽
|
||||
|
/// </summary>
|
||||
|
/// <param name="input"></param>
|
||||
|
/// <returns></returns>
|
||||
|
[HttpPost("api/app/CollectItemType/UpdateSortMany")] |
||||
|
public async Task UpdateSortManyAsync(UpdateSortManyDto input) |
||||
|
{ |
||||
|
await _manager.UpdateSortManyAsync(input); |
||||
|
} |
||||
|
} |
||||
|
} |
||||
16267
src/Shentun.Pacs.EntityFrameworkCore/Migrations/20241213083723_update_patient_register_check.Designer.cs
File diff suppressed because it is too large
View File
File diff suppressed because it is too large
View File
@ -0,0 +1,119 @@ |
|||||
|
using System; |
||||
|
using Microsoft.EntityFrameworkCore.Migrations; |
||||
|
|
||||
|
#nullable disable |
||||
|
|
||||
|
namespace Shentun.Pacs.Migrations |
||||
|
{ |
||||
|
public partial class update_patient_register_check : Migration |
||||
|
{ |
||||
|
protected override void Up(MigrationBuilder migrationBuilder) |
||||
|
{ |
||||
|
migrationBuilder.DropIndex( |
||||
|
name: "fki_fk_patient_register_ororganization_unit", |
||||
|
table: "patient_register"); |
||||
|
|
||||
|
migrationBuilder.DropIndex( |
||||
|
name: "ix_patient_register", |
||||
|
table: "patient_register"); |
||||
|
|
||||
|
migrationBuilder.DropIndex( |
||||
|
name: "ix_patient_register_1", |
||||
|
table: "patient_register"); |
||||
|
|
||||
|
migrationBuilder.AddColumn<string>( |
||||
|
name: "old_item_id", |
||||
|
table: "register_check_item", |
||||
|
type: "character varying(50)", |
||||
|
maxLength: 50, |
||||
|
nullable: true); |
||||
|
|
||||
|
migrationBuilder.AddColumn<string>( |
||||
|
name: "old_asbitem_id", |
||||
|
table: "register_check_asbitem", |
||||
|
type: "character varying(50)", |
||||
|
maxLength: 50, |
||||
|
nullable: true); |
||||
|
|
||||
|
migrationBuilder.AddColumn<Guid>( |
||||
|
name: "device_id", |
||||
|
table: "patient_register", |
||||
|
type: "uuid", |
||||
|
nullable: false, |
||||
|
defaultValue: new Guid("00000000-0000-0000-0000-000000000000")); |
||||
|
|
||||
|
migrationBuilder.AddColumn<DateTime>( |
||||
|
name: "send_date", |
||||
|
table: "patient_register", |
||||
|
type: "timestamp without time zone", |
||||
|
nullable: true, |
||||
|
comment: "发送时间"); |
||||
|
|
||||
|
migrationBuilder.AddColumn<char>( |
||||
|
name: "send_flag", |
||||
|
table: "patient_register", |
||||
|
type: "character(1)", |
||||
|
nullable: false, |
||||
|
defaultValueSql: "'0'", |
||||
|
comment: "发送状态 0-未发送 1-发送"); |
||||
|
|
||||
|
migrationBuilder.CreateIndex( |
||||
|
name: "ix_patient_register", |
||||
|
table: "patient_register", |
||||
|
column: "patient_register_no"); |
||||
|
|
||||
|
migrationBuilder.CreateIndex( |
||||
|
name: "IX_patient_register_patient_id", |
||||
|
table: "patient_register", |
||||
|
column: "patient_id"); |
||||
|
} |
||||
|
|
||||
|
protected override void Down(MigrationBuilder migrationBuilder) |
||||
|
{ |
||||
|
migrationBuilder.DropIndex( |
||||
|
name: "ix_patient_register", |
||||
|
table: "patient_register"); |
||||
|
|
||||
|
migrationBuilder.DropIndex( |
||||
|
name: "IX_patient_register_patient_id", |
||||
|
table: "patient_register"); |
||||
|
|
||||
|
migrationBuilder.DropColumn( |
||||
|
name: "old_item_id", |
||||
|
table: "register_check_item"); |
||||
|
|
||||
|
migrationBuilder.DropColumn( |
||||
|
name: "old_asbitem_id", |
||||
|
table: "register_check_asbitem"); |
||||
|
|
||||
|
migrationBuilder.DropColumn( |
||||
|
name: "device_id", |
||||
|
table: "patient_register"); |
||||
|
|
||||
|
migrationBuilder.DropColumn( |
||||
|
name: "send_date", |
||||
|
table: "patient_register"); |
||||
|
|
||||
|
migrationBuilder.DropColumn( |
||||
|
name: "send_flag", |
||||
|
table: "patient_register"); |
||||
|
|
||||
|
migrationBuilder.CreateIndex( |
||||
|
name: "fki_fk_patient_register_ororganization_unit", |
||||
|
table: "patient_register", |
||||
|
column: "medical_center_id"); |
||||
|
|
||||
|
migrationBuilder.CreateIndex( |
||||
|
name: "ix_patient_register", |
||||
|
table: "patient_register", |
||||
|
column: "patient_register_no", |
||||
|
unique: true); |
||||
|
|
||||
|
migrationBuilder.CreateIndex( |
||||
|
name: "ix_patient_register_1", |
||||
|
table: "patient_register", |
||||
|
columns: new[] { "patient_id", "medical_times" }, |
||||
|
unique: true); |
||||
|
} |
||||
|
} |
||||
|
} |
||||
Write
Preview
Loading…
Cancel
Save
Reference in new issue