Browse Source

职业病

master
wxd 2 months ago
parent
commit
14f91844bc
  1. 7
      src/Shentun.Peis.Application/MyUser/MyUserAppService.cs
  2. 22
      src/Shentun.Peis.Application/PrintReports/PrintReportAppService.cs
  3. 46
      src/Shentun.Peis.Domain/CacheService.cs
  4. 6
      src/Shentun.Peis.Domain/PatientOccupationalHistorys/PatientOccupationalHistory.cs
  5. 16377
      src/Shentun.Peis.EntityFrameworkCore/Migrations/20250827091748_patient_occupational_history_update_length.Designer.cs
  6. 81
      src/Shentun.Peis.EntityFrameworkCore/Migrations/20250827091748_patient_occupational_history_update_length.cs
  7. 14
      src/Shentun.Peis.EntityFrameworkCore/Migrations/PeisDbContextModelSnapshot.cs
  8. 14
      src/Shentun.Peis.HttpApi.Host/appsettings.json

7
src/Shentun.Peis.Application/MyUser/MyUserAppService.cs

@ -19,6 +19,7 @@ using Shentun.Utilities;
using SqlSugar;
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Linq;
using System.Net;
using System.Net.Http;
@ -544,6 +545,8 @@ namespace Shentun.Peis.MyUser
public async Task<UserLoginDto> UserLogin(UserLoginRequestDto input)
{
Stopwatch stopwatch = Stopwatch.StartNew();
UserLoginDto msg;
@ -618,6 +621,10 @@ namespace Shentun.Peis.MyUser
throw new UserFriendlyException("用户不存在");
}
stopwatch.Stop(); // 停止Stopwatch
var gg = stopwatch.ElapsedMilliseconds;
return msg;
}

22
src/Shentun.Peis.Application/PrintReports/PrintReportAppService.cs

@ -246,7 +246,7 @@ namespace Shentun.Peis.PrintReports
PatientRegisterId = a.Id,
CustomerOrgGroupName = ac.DisplayName,
CustomerOrgName = _cacheService.GetTopCustomerOrgNameAsync(a.CustomerOrgId).GetAwaiter().GetResult(),
CustomerOrgShortName = _cacheService.GetTopCustomerOrgAsync(a.CustomerOrgId).GetAwaiter().GetResult().ShortName,
CustomerOrgShortName = _cacheService.GetTopCustomerOrgShortNameAsync(a.CustomerOrgId, "1").GetAwaiter().GetResult(),
DepartmentName = _cacheService.GetAllDepartmentNameAsync(a.CustomerOrgId).GetAwaiter().GetResult(),
IdNo = e.IdNo,
JobCardNo = a.JobCardNo,
@ -390,7 +390,7 @@ namespace Shentun.Peis.PrintReports
SampleContainerRemark = (o.sampleContainerHaveEmpty == null) ? "" : o.sampleContainerHaveEmpty.ContainerRemark,
SampleTypeName = (o.sampleTypeHaveEmpty == null) ? "" : o.sampleTypeHaveEmpty.DisplayName,
SexName = o.sex.DisplayName,
CustomerOrgName = _cacheService.GetTopCustomerOrgShortNameAsync(o.patientRegister.CustomerOrgId).Result,
CustomerOrgName = _cacheService.GetTopCustomerOrgShortNameAsync(o.patientRegister.CustomerOrgId, "1").Result,
DepartmentName = _cacheService.GetAllDepartmentNameAsync(o.patientRegister.CustomerOrgId).Result,
IsPrint = o.lisRequest.IsPrint,
IsSignIn = o.lisRequest.IsSignIn,
@ -512,6 +512,10 @@ namespace Shentun.Peis.PrintReports
public async Task<Rpt0002Dto> GetLisRequestReportByPatientRegisterIdConvertToReportAsync(PatientRegisterIdInputDto input)
{
var oldDto = await GetLisRequestReportByPatientRegisterIdAsync(input);
if (!oldDto.Any())
{
return null;
}
var entDto = await ConvertToReport.ToLisRequestReportDataAsync(oldDto);
return entDto;
}
@ -588,7 +592,7 @@ namespace Shentun.Peis.PrintReports
ContainerColor = lisRequestInfo.sampleContainer.ContainerColor,
SampleContainerRemark = lisRequestInfo.sampleContainer.ContainerRemark,
AsbitemNames = string.Join(",", list.OrderBy(o => o.asbitem.DisplayOrder).Select(o => o.asbitem.DisplayName).Distinct()),
CustomerOrgName = _cacheService.GetTopCustomerOrgShortNameAsync(lisRequestInfo.patientRegister.CustomerOrgId).Result,
CustomerOrgName = _cacheService.GetTopCustomerOrgShortNameAsync(lisRequestInfo.patientRegister.CustomerOrgId, "1").Result,
DepartmentName = _cacheService.GetAllDepartmentNameAsync(lisRequestInfo.patientRegister.CustomerOrgId).Result,
SampleGroupName = lisRequestInfo.sampleGroupName,
MobileTelephone = lisRequestInfo.patient.MobileTelephone,
@ -906,7 +910,7 @@ namespace Shentun.Peis.PrintReports
PatientName = s.FirstOrDefault().PatientName,
PatientRegisterNo = s.FirstOrDefault().PatientRegisterNo,
SexName = s.FirstOrDefault().SexName,
CustomerOrgName = _cacheService.GetTopCustomerOrgShortNameAsync(s.FirstOrDefault().CustomerOrgId).Result,
CustomerOrgName = _cacheService.GetTopCustomerOrgShortNameAsync(s.FirstOrDefault().CustomerOrgId, "1").Result,
DepartmentName = _cacheService.GetAllDepartmentNameAsync(s.FirstOrDefault().CustomerOrgId).Result,
MobileTelephone = s.FirstOrDefault().MobileTelephone,
DeviceCheckRequestPrintTimes = s.FirstOrDefault().DeviceCheckRequestPrintTimes
@ -923,7 +927,7 @@ namespace Shentun.Peis.PrintReports
PatientName = s.FirstOrDefault().PatientName,
PatientRegisterNo = s.FirstOrDefault().PatientRegisterNo,
SexName = s.FirstOrDefault().SexName,
CustomerOrgName = _cacheService.GetTopCustomerOrgShortNameAsync(s.FirstOrDefault().CustomerOrgId).Result,
CustomerOrgName = _cacheService.GetTopCustomerOrgShortNameAsync(s.FirstOrDefault().CustomerOrgId, "1").Result,
DepartmentName = _cacheService.GetAllDepartmentNameAsync(s.FirstOrDefault().CustomerOrgId).Result,
MobileTelephone = s.FirstOrDefault().MobileTelephone,
DeviceCheckRequestPrintTimes = s.FirstOrDefault().DeviceCheckRequestPrintTimes
@ -947,6 +951,10 @@ namespace Shentun.Peis.PrintReports
{
var oldDto = await GetPacsNoReportAsync(input);
if (!oldDto.Any())
{
return null;
}
var entDto = await ConvertToReport.ToExamRequestReportDataAsync(oldDto);
return entDto;
}
@ -1004,7 +1012,7 @@ namespace Shentun.Peis.PrintReports
PatientName = queryGroup.FirstOrDefault().PatientName,
PatientRegisterNo = queryGroup.FirstOrDefault().PatientRegisterNo,
SexName = queryGroup.FirstOrDefault().SexName,
CustomerOrgName = _cacheService.GetTopCustomerOrgShortNameAsync(queryGroup.FirstOrDefault().CustomerOrgId).Result,
CustomerOrgName = _cacheService.GetTopCustomerOrgShortNameAsync(queryGroup.FirstOrDefault().CustomerOrgId, "1").Result,
DepartmentName = _cacheService.GetAllDepartmentNameAsync(queryGroup.FirstOrDefault().CustomerOrgId).Result
};
}
@ -1018,7 +1026,7 @@ namespace Shentun.Peis.PrintReports
PatientName = queryGroup.FirstOrDefault().PatientName,
PatientRegisterNo = queryGroup.FirstOrDefault().PatientRegisterNo,
SexName = queryGroup.FirstOrDefault().SexName,
CustomerOrgName = _cacheService.GetTopCustomerOrgShortNameAsync(queryGroup.FirstOrDefault().CustomerOrgId).Result,
CustomerOrgName = _cacheService.GetTopCustomerOrgShortNameAsync(queryGroup.FirstOrDefault().CustomerOrgId, "1").Result,
DepartmentName = _cacheService.GetAllDepartmentNameAsync(queryGroup.FirstOrDefault().CustomerOrgId).Result
};
}

46
src/Shentun.Peis.Domain/CacheService.cs

@ -513,14 +513,56 @@ namespace Shentun.Peis
return entity;
}
///// <summary>
///// 获取单位简称 一级单位 简称如果没有显示全称
///// </summary>
///// <param name="CustomerOrgId"></param>
///// <param name="CustomerMode">单位获取模式 0=正常取值 1=强制取第一级</param>
///// <returns></returns>
//public async Task<string> GetTopCustomerOrgShortNameAsync(Guid CustomerOrgId)
//{
// var customerOrgEnt = await GetTopCustomerOrgAsync(CustomerOrgId);
// if (string.IsNullOrWhiteSpace(customerOrgEnt.ShortName))
// return customerOrgEnt.DisplayName;
// else
// return customerOrgEnt.ShortName;
//}
/// <summary>
/// 获取单位简称 一级单位 简称如果没有显示全称
/// </summary>
/// <param name="CustomerOrgId"></param>
/// <param name="CustomerMode">单位获取模式 0=正常取值 1=强制取第一级</param>
/// <returns></returns>
public async Task<string> GetTopCustomerOrgShortNameAsync(Guid CustomerOrgId)
public async Task<string> GetTopCustomerOrgShortNameAsync(Guid CustomerOrgId, string CustomerMode = "0")
{
var customerOrgEnt = await GetTopCustomerOrgAsync(CustomerOrgId);
var customerOrgEnt = new CustomerOrg();
if (CustomerMode == "0")
{
customerOrgEnt = await GetTopCustomerOrgAsync(CustomerOrgId);
}
else
{
//强制取第一级
var entity = (CustomerOrg)_customerOrgCache.Get(CustomerOrgId);
if (entity == null)
{
entity = await _customerOrgRepository.GetAsync(o => o.Id == CustomerOrgId);
_customerOrgCache.Set(CustomerOrgId, entity);
}
if (entity.PathCode.Length > 5)
{
customerOrgEnt = await _customerOrgRepository.GetAsync(o => o.PathCode == entity.PathCode.Substring(0, 5));
}
else
{
customerOrgEnt = entity;
}
}
if (string.IsNullOrWhiteSpace(customerOrgEnt.ShortName))
return customerOrgEnt.DisplayName;
else

6
src/Shentun.Peis.Domain/PatientOccupationalHistorys/PatientOccupationalHistory.cs

@ -40,14 +40,14 @@ namespace Shentun.Peis.Models
/// 车间
/// </summary>
[Column("work_shop")]
[StringLength(10)]
[StringLength(50)]
public string? WorkShop { get; set; }
/// <summary>
/// 工种
/// </summary>
[Column("work_type")]
[StringLength(10)]
[StringLength(50)]
public string? WorkType { get; set; }
/// <summary>
@ -61,7 +61,7 @@ namespace Shentun.Peis.Models
/// 防护措施
/// </summary>
[Column("protective_measures")]
[StringLength(30)]
[StringLength(50)]
public string? ProtectiveMeasures { get; set; }
[Column("concurrency_stamp")]

16377
src/Shentun.Peis.EntityFrameworkCore/Migrations/20250827091748_patient_occupational_history_update_length.Designer.cs
File diff suppressed because it is too large
View File

81
src/Shentun.Peis.EntityFrameworkCore/Migrations/20250827091748_patient_occupational_history_update_length.cs

@ -0,0 +1,81 @@
using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
namespace Shentun.Peis.Migrations
{
public partial class patient_occupational_history_update_length : Migration
{
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.AlterColumn<string>(
name: "work_type",
table: "patient_occupational_history",
type: "character varying(50)",
maxLength: 50,
nullable: true,
oldClrType: typeof(string),
oldType: "character varying(10)",
oldMaxLength: 10,
oldNullable: true);
migrationBuilder.AlterColumn<string>(
name: "work_shop",
table: "patient_occupational_history",
type: "character varying(50)",
maxLength: 50,
nullable: true,
oldClrType: typeof(string),
oldType: "character varying(10)",
oldMaxLength: 10,
oldNullable: true);
migrationBuilder.AlterColumn<string>(
name: "protective_measures",
table: "patient_occupational_history",
type: "character varying(50)",
maxLength: 50,
nullable: true,
oldClrType: typeof(string),
oldType: "character varying(30)",
oldMaxLength: 30,
oldNullable: true);
}
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.AlterColumn<string>(
name: "work_type",
table: "patient_occupational_history",
type: "character varying(10)",
maxLength: 10,
nullable: true,
oldClrType: typeof(string),
oldType: "character varying(50)",
oldMaxLength: 50,
oldNullable: true);
migrationBuilder.AlterColumn<string>(
name: "work_shop",
table: "patient_occupational_history",
type: "character varying(10)",
maxLength: 10,
nullable: true,
oldClrType: typeof(string),
oldType: "character varying(50)",
oldMaxLength: 50,
oldNullable: true);
migrationBuilder.AlterColumn<string>(
name: "protective_measures",
table: "patient_occupational_history",
type: "character varying(30)",
maxLength: 30,
nullable: true,
oldClrType: typeof(string),
oldType: "character varying(50)",
oldMaxLength: 50,
oldNullable: true);
}
}
}

14
src/Shentun.Peis.EntityFrameworkCore/Migrations/PeisDbContextModelSnapshot.cs

@ -7314,18 +7314,18 @@ namespace Shentun.Peis.Migrations
.HasColumnName("poison");
b.Property<string>("ProtectiveMeasures")
.HasMaxLength(30)
.HasColumnType("character varying(30)")
.HasMaxLength(50)
.HasColumnType("character varying(50)")
.HasColumnName("protective_measures");
b.Property<string>("WorkShop")
.HasMaxLength(10)
.HasColumnType("character varying(10)")
.HasMaxLength(50)
.HasColumnType("character varying(50)")
.HasColumnName("work_shop");
b.Property<string>("WorkType")
.HasMaxLength(10)
.HasColumnType("character varying(10)")
.HasMaxLength(50)
.HasColumnType("character varying(50)")
.HasColumnName("work_type");
b.HasKey("Id");
@ -13023,7 +13023,7 @@ namespace Shentun.Peis.Migrations
.HasColumnName("method_name");
b.Property<string>("Parameters")
.HasMaxLength(50000)
.HasMaxLength(2000)
.HasColumnType("text")
.HasColumnName("parameters");

14
src/Shentun.Peis.HttpApi.Host/appsettings.json

@ -5,15 +5,15 @@
"CorsOrigins": "https://*.Peis.com,http://localhost:4200,http://localhost:9530,http://192.168.1.108:9530,http://localhost:8080,http://localhost:8081",
"RedirectAllowedUrls": "http://localhost:9530",
"SelfUser": "admin",
"SelfPassword": "Shentun!@#qwe123",
//"SelfPassword": "666666",
//"SelfPassword": "Shentun!@#qwe123",
"SelfPassword": "666666",
"LisUser": "admin",
"LisPassword": "Shentun!@#qwe123"
//"LisPassword": "666666"
//"LisPassword": "Shentun!@#qwe123"
"LisPassword": "666666"
},
"ConnectionStrings": {
//"Default": "Host=10.1.12.140;Port=5432;Database=ShentunPeis0508;User ID=postgres;Password=st123;"
"Default": "Host=140.143.162.39;Port=5432;Database=ShentunPeis240701;User ID=postgres;Password=shentun123;"
"Default": "Host=10.1.12.140;Port=5432;Database=ShentunPeis0508;User ID=postgres;Password=st123;"
//"Default": "Host=140.143.162.39;Port=5432;Database=ShentunPeis240701;User ID=postgres;Password=shentun123;"
//"Default": "Host=192.168.2.67;Port=5432;Database=ShentunPeis;User ID=postgres;Password=st123;"
},
"AuthServer": {
@ -61,7 +61,7 @@
"Hangfire": {
"IsEnabled": true,
"IsEnabledDashboard": true,
"ConnectionStrings": "127.0.0.1:6379,password=wxd123",
"ConnectionStrings": "10.1.12.140:6379,password=st123",
"Db": 3
},
"Pacs": {

Loading…
Cancel
Save