Browse Source

0121

master
wxd 3 months ago
parent
commit
6addd42073
  1. 16
      src/Shentun.WebPeis.Application.Contracts/Persons/GetCheckPacsInfoDto.cs
  2. 19
      src/Shentun.WebPeis.Application.Contracts/Persons/GetCheckPacsInfoInputDto.cs
  3. 13
      src/Shentun.WebPeis.Application.Contracts/Persons/GetPatientRegisterByIdNoInputDto.cs
  4. 16
      src/Shentun.WebPeis.Application.Contracts/Persons/PersonMedicalTimesDto.cs
  5. 58
      src/Shentun.WebPeis.Application.Contracts/Persons/RegisterAsbitemExpendDto.cs
  6. 5
      src/Shentun.WebPeis.Application.Contracts/Questions/QuestionDto.cs
  7. 2
      src/Shentun.WebPeis.Application/CompanyIntroductions/CompanyIntroductionAppService.cs
  8. 332
      src/Shentun.WebPeis.Application/Persons/PersonAppService.cs
  9. 125
      src/Shentun.WebPeis.Application/QuestionRegisters/QuestionRegisterAppService.cs
  10. 1
      src/Shentun.WebPeis.Application/QueueRegisters/QueueRegisterAppService.cs
  11. 6
      src/Shentun.WebPeis.Domain/Models/Question.cs
  12. 8
      src/Shentun.WebPeis.EntityFrameworkCore/Configures/QuestionConfigure.cs
  13. 2
      src/Shentun.WebPeis.EntityFrameworkCore/Configures/SumSuggestionHeaderConfigure.cs
  14. 8420
      src/Shentun.WebPeis.EntityFrameworkCore/Migrations/20251223011631_update_suggestion_header_update_suggestion_title_length_200.Designer.cs
  15. 42
      src/Shentun.WebPeis.EntityFrameworkCore/Migrations/20251223011631_update_suggestion_header_update_suggestion_title_length_200.cs
  16. 4
      src/Shentun.WebPeis.EntityFrameworkCore/Migrations/WebPeisDbContextModelSnapshot.cs
  17. 2
      src/Shentun.WebPeis.HttpApi.Host/Controllers/WeChatController.cs
  18. 17
      src/Shentun.WebPeis.HttpApi.Host/appsettings.json

16
src/Shentun.WebPeis.Application.Contracts/Persons/GetCheckPacsInfoDto.cs

@ -0,0 +1,16 @@
using System;
using System.Collections.Generic;
using System.Text;
namespace Shentun.WebPeis.Persons
{
public class GetCheckPacsInfoDto
{
/// <summary>
/// 是否正确
/// </summary>
public char IsPass { get; set; }
public string Message { get; set; }
}
}

19
src/Shentun.WebPeis.Application.Contracts/Persons/GetCheckPacsInfoInputDto.cs

@ -0,0 +1,19 @@
using System;
using System.Collections.Generic;
using System.Text;
namespace Shentun.WebPeis.Persons
{
public class GetCheckPacsInfoInputDto
{
/// <summary>
/// 姓名
/// </summary>
public string PatientName { get; set; }
/// <summary>
/// 条码号
/// </summary>
public string CheckRequestNo { get; set; }
}
}

13
src/Shentun.WebPeis.Application.Contracts/Persons/GetPatientRegisterByIdNoInputDto.cs

@ -0,0 +1,13 @@
using System;
using System.Collections.Generic;
using System.Text;
namespace Shentun.WebPeis.Persons
{
public class GetPatientRegisterByIdNoInputDto
{
public string IdNo { get; set; }
public string MobileTelephone { get; set; }
}
}

16
src/Shentun.WebPeis.Application.Contracts/Persons/PersonMedicalTimesDto.cs

@ -1,14 +1,28 @@
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Text; using System.Text;
using System.Text.Json.Serialization;
namespace Shentun.WebPeis.Persons namespace Shentun.WebPeis.Persons
{ {
public class PersonMedicalTimesDto public class PersonMedicalTimesDto
{ {
public Guid PatientRegisterId { get; set; }
public string PatientRegisterId { get; set; }
public string PersonName { get; set; } public string PersonName { get; set; }
public DateTime MedicalStartDate { get; set; } public DateTime MedicalStartDate { get; set; }
public char IsOld { get; set; } = 'N';
/// <summary>
/// 老数据
/// </summary>
public string Summary { get; set; }
/// <summary>
/// 老数据
/// </summary>
public string Suggestion { get; set; }
} }
} }

58
src/Shentun.WebPeis.Application.Contracts/Persons/RegisterAsbitemExpendDto.cs

@ -0,0 +1,58 @@
using System;
using System.Collections.Generic;
using System.Text;
namespace Shentun.WebPeis.Persons
{
public class RegisterAsbitemExpendDto
{
public int ResultShowMode { get; set; } = 0;
public ICollection<string> ImagesBase64 { get; set; }
/// <summary>
/// 条码号
/// </summary>
public string CheckRequestNo { get; set; }
/// <summary>
/// 是否pacs检查
/// </summary>
public char IsPacsCheck { get; set; } = 'N';
/// <summary>
/// 项目描述
/// </summary>
public string PacsDesc { get; set; }
/// <summary>
/// 云胶片使用
/// </summary>
public string StudyInstanceUID { get; set; }
public long PatientRegisterId { get; set; }
public string AsbitemId { get; set; }
public string AsbitemName { get; set; }
public string Summary { get; set; }
public string CheckDoctor { get; set; }
public DateTime CheckDate { get; set; }
public virtual ICollection<RegisterAsbitemExpendRegisterItemDto> RegisterItem { get; set; }
}
public partial class RegisterAsbitemExpendRegisterItemDto
{
public long PatientRegisterId { get; set; }
public string AsbitemId { get; set; }
public string ItemId { get; set; }
public string ItemName { get; set; }
public string Result { get; set; }
public string Unit { get; set; }
public string ReferenceRangeValue { get; set; }
public string ReportPrompt { get; set; }
public int? ResultFontColor { get; set; }
}
}

5
src/Shentun.WebPeis.Application.Contracts/Questions/QuestionDto.cs

@ -51,5 +51,10 @@ namespace Shentun.WebPeis.Questions
public string SimpleCode { get; set; } = null!; public string SimpleCode { get; set; } = null!;
public int DisplayOrder { get; set; } public int DisplayOrder { get; set; }
/// <summary>
/// 适用性别
/// </summary>
public char ForSexId { get; set; }
} }
} }

2
src/Shentun.WebPeis.Application/CompanyIntroductions/CompanyIntroductionAppService.cs

@ -41,6 +41,7 @@ namespace Shentun.WebPeis.CompanyIntroductions
/// </summary> /// </summary>
/// <returns></returns> /// <returns></returns>
[HttpPost("api/app/CompanyIntroduction/GetList")] [HttpPost("api/app/CompanyIntroduction/GetList")]
[AllowAnonymous]
public async Task<List<CompanyIntroductionDto>> GetListAsync() public async Task<List<CompanyIntroductionDto>> GetListAsync()
{ {
var entlist = await _companyIntroductionRepository.GetQueryableAsync(); var entlist = await _companyIntroductionRepository.GetQueryableAsync();
@ -124,6 +125,7 @@ namespace Shentun.WebPeis.CompanyIntroductions
/// </summary> /// </summary>
/// <returns></returns> /// <returns></returns>
[HttpPost("api/app/CompanyIntroduction/GetMiniProgramConfigure")] [HttpPost("api/app/CompanyIntroduction/GetMiniProgramConfigure")]
[AllowAnonymous]
public async Task<GetMiniProgramConfigureDto> GetMiniProgramConfigureAsync() public async Task<GetMiniProgramConfigureDto> GetMiniProgramConfigureAsync()
{ {
var resultDto = new GetMiniProgramConfigureDto(); var resultDto = new GetMiniProgramConfigureDto();

332
src/Shentun.WebPeis.Application/Persons/PersonAppService.cs

@ -1,48 +1,49 @@
using Shentun.WebPeis.Models;
using IdentityModel;
using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Identity;
using Microsoft.AspNetCore.Mvc;
using Microsoft.Extensions.Caching.Distributed;
using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.Logging;
using NPOI.SS.Formula.Functions;
using OpenIddict.Abstractions;
using Scriban.Parsing;
using Scriban.Syntax;
using Shentun.Sms.Client;
using Shentun.Utilities;
using Shentun.Utilities.Enums;
using Shentun.WebPeis.CustomerOrgs;
using Shentun.WebPeis.Enums;
using Shentun.WebPeis.Models;
using Shentun.WebPeis.PatientRegisters;
using Shentun.WebPeis.SysParmValues;
using Shentun.WebPeis.Wechats;
using SqlSugar;
using System; using System;
using System.Collections;
using System.Collections.Generic; using System.Collections.Generic;
using System.Data;
using System.IdentityModel.Tokens.Jwt;
using System.IO;
using System.Linq; using System.Linq;
using System.Linq.Dynamic.Core.Tokenizer;
using System.Net;
using System.Net.Http;
using System.Net.Http.Headers;
using System.Text; using System.Text;
using System.Text.Json;
using System.Threading.Tasks; using System.Threading.Tasks;
using Volo.Abp;
using Volo.Abp.Application.Services; using Volo.Abp.Application.Services;
using Volo.Abp.Caching;
using Volo.Abp.Domain.Entities; using Volo.Abp.Domain.Entities;
using Volo.Abp.Domain.Repositories; using Volo.Abp.Domain.Repositories;
using Volo.Abp.Users;
using Shentun.WebPeis.Wechats;
using Microsoft.Extensions.Configuration;
using System.Net.Http;
using System.Net;
using System.Text.Json;
using Volo.Abp.Identity; using Volo.Abp.Identity;
using Volo.Abp;
using Shentun.WebPeis.Enums;
using System.Net.Http.Headers;
using Microsoft.AspNetCore.Mvc;
using OpenIddict.Abstractions;
using Microsoft.AspNetCore.Identity;
using Volo.Abp.ObjectMapping; using Volo.Abp.ObjectMapping;
using Microsoft.AspNetCore.Authorization;
using Volo.Abp.Caching;
using NPOI.SS.Formula.Functions;
using System.Linq.Dynamic.Core.Tokenizer;
using Microsoft.Extensions.Caching.Distributed;
using Volo.Abp.Uow; using Volo.Abp.Uow;
using Scriban.Parsing;
using System.IdentityModel.Tokens.Jwt;
using Shentun.WebPeis.PatientRegisters;
using Microsoft.AspNetCore.Http;
using System.IO;
using Shentun.WebPeis.CustomerOrgs;
using Shentun.Utilities.Enums;
using Shentun.Sms.Client;
using Shentun.Utilities;
using IdentityModel;
using Shentun.WebPeis.SysParmValues;
using Scriban.Syntax;
using Volo.Abp.Users;
using static SKIT.FlurlHttpClient.Wechat.TenpayV3.Models.DepositMarketingMemberCardOpenCardCodesResponse.Types; using static SKIT.FlurlHttpClient.Wechat.TenpayV3.Models.DepositMarketingMemberCardOpenCardCodesResponse.Types;
using System.Data;
using SqlSugar;
namespace Shentun.WebPeis.Persons namespace Shentun.WebPeis.Persons
{ {
/// <summary> /// <summary>
@ -525,7 +526,7 @@ namespace Shentun.WebPeis.Persons
} }
/// <summary> /// <summary>
/// 获取体检次数列表 显示报告的列表
/// 获取体检次数列表 显示报告的列表 增加查询老系统数据
/// </summary> /// </summary>
/// <param name="input"></param> /// <param name="input"></param>
/// <returns></returns> /// <returns></returns>
@ -545,10 +546,54 @@ namespace Shentun.WebPeis.Persons
orderby patientRegister.MedicalStartDate orderby patientRegister.MedicalStartDate
select new PersonMedicalTimesDto() select new PersonMedicalTimesDto()
{ {
PatientRegisterId = patientRegister.PatientRegisterId,
PatientRegisterId = patientRegister.PatientRegisterId.ToString(),
PersonName = patient.PatientName, PersonName = patient.PatientName,
MedicalStartDate = patientRegister.MedicalStartDate, MedicalStartDate = patientRegister.MedicalStartDate,
IsOld = 'N'
}).ToList(); }).ToList();
var isOldReport = _configuration.GetValue("Report:IsOldReport", "N");
if (isOldReport == "Y")
{
var oldApiBaseUrl = _configuration.GetValue("Report:OldApiBaseUrl", "");
var patientInfo = (from user in await _identityUserRepository.GetQueryableAsync()
join person in await _repository.GetQueryableAsync()
on user.Id equals person.PersonId
where user.Id == input.PersonId
select new
{
user.PhoneNumber,
person.IdNo
}).FirstOrDefault();
if (patientInfo != null)
{
var inputParm = new GetPatientRegisterByIdNoInputDto
{
IdNo = patientInfo.IdNo,
MobileTelephone = patientInfo.PhoneNumber
};
var oldList = await CallAppServiceAsync<GetPatientRegisterByIdNoInputDto, List<PersonMedicalTimesDto>>(oldApiBaseUrl, $"{oldApiBaseUrl}/api/PatientExamResult/GetPatientRegisterByIdNo", inputParm, "post");
if (oldList != null && oldList.Count > 0)
{
foreach (var item in oldList)
{
var isCz = entityList.FirstOrDefault(f => f.MedicalStartDate == item.MedicalStartDate);
if (isCz == null)
{
entityList.Add(item);
}
}
}
}
}
entityList = entityList.OrderBy(o => o.MedicalStartDate).ToList();
return entityList; return entityList;
} }
@ -765,7 +810,6 @@ namespace Shentun.WebPeis.Persons
/// <param name="input"></param> /// <param name="input"></param>
/// <returns></returns> /// <returns></returns>
[HttpPost("api/app/Person/GetMedicalReportDetailByPatientRegisterId")] [HttpPost("api/app/Person/GetMedicalReportDetailByPatientRegisterId")]
[AllowAnonymous]
public async Task<MedicalReportDetailDto> GetMedicalReportDetailByPatientRegisterIdAsync(PatientRegisterIdInputDto input) public async Task<MedicalReportDetailDto> GetMedicalReportDetailByPatientRegisterIdAsync(PatientRegisterIdInputDto input)
{ {
var result = new MedicalReportDetailDto(); var result = new MedicalReportDetailDto();
@ -784,7 +828,7 @@ namespace Shentun.WebPeis.Persons
/// <returns></returns> /// <returns></returns>
private async Task<List<MedicalReportRegisterCheckDto>> GetMedicalReportRegisterChecks(PatientRegisterIdInputDto input) private async Task<List<MedicalReportRegisterCheckDto>> GetMedicalReportRegisterChecks(PatientRegisterIdInputDto input)
{ {
var peisBaseUrl = _configuration.GetValue("Peis:PeisBaseUrl", ""); var peisBaseUrl = _configuration.GetValue("Peis:PeisBaseUrl", "");
var barCodeMode = _configuration.GetValue("Pacs:BarCodeMode", "0"); //检测条码模式 0-人员条码 1-检测条码 默认-0 var barCodeMode = _configuration.GetValue("Pacs:BarCodeMode", "0"); //检测条码模式 0-人员条码 1-检测条码 默认-0
@ -830,7 +874,7 @@ namespace Shentun.WebPeis.Persons
var registerCheckIds = registerChecklist.Select(o => o.registerCheck.RegisterCheckId).Distinct().ToList(); var registerCheckIds = registerChecklist.Select(o => o.registerCheck.RegisterCheckId).Distinct().ToList();
foreach (var registerCheckId in registerCheckIds) foreach (var registerCheckId in registerCheckIds)
{ {
var registerCheckRows = registerChecklist.Where(o => o.registerCheck.RegisterCheckId == registerCheckId).ToList(); var registerCheckRows = registerChecklist.Where(o => o.registerCheck.RegisterCheckId == registerCheckId).ToList();
@ -1039,7 +1083,7 @@ namespace Shentun.WebPeis.Persons
// }); // });
// var isPacsCheckAsbitemList = oldDb.Ado.GetDataTable("select b.check_request_no,c.old_asbitem_id,max(d.parent_study_id) as parent_study_id " + // var isPacsCheckAsbitemList = oldDb.Ado.GetDataTable("select b.check_request_no,c.old_asbitem_id,max(d.parent_study_id) as parent_study_id " +
// " from patient_register as a " + // " from patient_register as a " +
// " left join register_check as b on a.id=b.patient_register_id " + // " left join register_check as b on a.id=b.patient_register_id " +
@ -1083,8 +1127,180 @@ namespace Shentun.WebPeis.Persons
// return result; // return result;
//} //}
/// <summary>
/// 校验身份 Y=通过 N=未通过
/// </summary>
/// <param name="input"></param>
/// <returns></returns>
[HttpPost("api/PatientRegister/GetCheckPacsInfo")]
[AllowAnonymous]
public GetCheckPacsInfoDto GetPacsCheckAsbitemByPatientRegisterIdAsync(GetCheckPacsInfoInputDto input)
{
GetCheckPacsInfoDto entDto = new GetCheckPacsInfoDto
{
IsPass = 'N'
};
var pacsDatabase = _configuration.GetValue("Pacs:PacsDatabase", "");
SqlSugarClient oldDb = new SqlSugarClient(new ConnectionConfig()
{
ConnectionString = pacsDatabase,
DbType = SqlSugar.DbType.PostgreSQL,
IsAutoCloseConnection = true
});
if (string.IsNullOrWhiteSpace(input.PatientName))
{
entDto.IsPass = 'N';
entDto.Message = "姓名不能为空";
return entDto;
}
if (string.IsNullOrWhiteSpace(input.CheckRequestNo))
{
entDto.IsPass = 'N';
entDto.Message = "条码号不能为空";
return entDto;
}
string oldSql = @$"select patient_name,b.check_request_no from patient_register as a
left join register_check as b on a.id=b.patient_register_id
where b.check_request_no='{input.CheckRequestNo}' and patient_name='{input.PatientName}'";
var patientList = oldDb.Ado.GetDataTable(oldSql);
if (patientList.Rows.Count > 0)
{
entDto.IsPass = 'Y';
entDto.Message = "验证成功";
}
else
{
entDto.IsPass = 'N';
entDto.Message = "验证失败";
}
return entDto;
}
#endregion #endregion
#region 老系统报告明细
/// <summary>
/// 调试用 增加老数据
/// </summary>
/// <param name="input"></param>
/// <returns></returns>
[HttpPost("api/app/Person/GetMedicalTimesListByPersonIdAndOld")]
public async Task<List<PersonMedicalTimesDto>> GetMedicalTimesListByPersonIdAndOldAsync(PersonIdInputDto input)
{
var entityList = (from user in await _identityUserRepository.GetQueryableAsync()
join person in await _repository.GetQueryableAsync()
on user.Id equals person.PersonId
join patient in await _patientRepository.GetQueryableAsync()
on new { idNo = person.IdNo, phone = user.PhoneNumber } equals new { idNo = patient.IdNo, phone = patient.MobileTelephone }
join patientRegister in await _patientRegisterRepository.GetQueryableAsync()
on patient.PatientId equals patientRegister.PatientId
where user.Id == input.PersonId &&
(patientRegister.CompleteFlag == PatientRegisterCompleteFlag.SumCheck) &&
!string.IsNullOrWhiteSpace(patientRegister.ReportFile)
orderby patientRegister.MedicalStartDate
select new PersonMedicalTimesDto()
{
PatientRegisterId = patientRegister.PatientRegisterId.ToString(),
PersonName = patient.PatientName,
MedicalStartDate = patientRegister.MedicalStartDate,
IsOld = 'N'
}).ToList();
var oldApiBaseUrl = _configuration.GetValue("Report:OldApiBaseUrl", "");
var patientInfo = (from user in await _identityUserRepository.GetQueryableAsync()
join person in await _repository.GetQueryableAsync()
on user.Id equals person.PersonId
where user.Id == input.PersonId
select new
{
user.PhoneNumber,
person.IdNo
}).FirstOrDefault();
if (patientInfo != null)
{
var inputParm = new GetPatientRegisterByIdNoInputDto
{
IdNo = patientInfo.IdNo,
MobileTelephone = patientInfo.PhoneNumber
};
var oldList = await CallAppServiceAsync<GetPatientRegisterByIdNoInputDto, List<PersonMedicalTimesDto>>(oldApiBaseUrl, $"{oldApiBaseUrl}/api/PatientExamResult/GetPatientRegisterByIdNo", inputParm, "post");
if (oldList != null && oldList.Count > 0)
{
foreach (var item in oldList)
{
var isCz = entityList.FirstOrDefault(f => f.MedicalStartDate == item.MedicalStartDate);
if (isCz == null)
{
entityList.Add(item);
}
}
}
}
entityList = entityList.OrderBy(o => o.MedicalStartDate).ToList();
return entityList;
}
[HttpGet("api/app/Person/GetOldImages")]
public async Task<object> GetOldImages(long patientRegisterId, string asbitemId)
{
var oldApiBaseUrl = _configuration.GetValue("Report:OldApiBaseUrl", "");
var oldList = await CallAppServiceNoInputGetAsync<object>(oldApiBaseUrl, $"{oldApiBaseUrl}/api/PatientExamResult/GetImages?patientRegisterId={patientRegisterId}&asbitemId={asbitemId}");
return oldList;
}
[HttpGet("api/app/Person/GetOldPdfReport")]
public async Task<object> GetOldPdfReport(long patientRegisterId)
{
var oldApiBaseUrl = _configuration.GetValue("Report:OldApiBaseUrl", "");
var oldList = await CallAppServiceNoInputGetAsync<object>(oldApiBaseUrl, $"{oldApiBaseUrl}/api/PatientExamResult/GetPdfReport?patientRegisterId={patientRegisterId}");
return oldList;
}
[HttpGet("api/app/Person/GetOldRegisterAsbitems")]
public async Task<ActionResult<List<RegisterAsbitemExpendDto>>> GetOldRegisterAsbitems(long patientRegisterId)
{
var oldApiBaseUrl = _configuration.GetValue("Report:OldApiBaseUrl", "");
var oldList = await CallAppServiceNoInputGetAsync<List<RegisterAsbitemExpendDto>>(oldApiBaseUrl, $"{oldApiBaseUrl}/api/PatientExamResult/GetRegisterAsbitems?patientRegisterId={patientRegisterId}");
return oldList;
}
#endregion
/// <summary> /// <summary>
/// 获取校验码 /// 获取校验码
@ -1344,7 +1560,45 @@ namespace Shentun.WebPeis.Persons
} }
} }
private async static Task<TOut> CallAppServiceNoInputGetAsync<TOut>(string baseAddress, string url)
{
using (var httpClientHandler = new HttpClientHandler())
{
using (var httpClient = new HttpClient(httpClientHandler))
{
httpClient.BaseAddress = new Uri(baseAddress);
httpClient.DefaultRequestHeaders.Accept.Add(
new MediaTypeWithQualityHeaderValue("application/json"));//设置accept标头,告诉JSON是可接受的响应类型
var jsonOptions = new JsonSerializerOptions
{
WriteIndented = true, // 设置为true以便于可读性更好的JSON输出
PropertyNamingPolicy = JsonNamingPolicy.CamelCase,
// 如果你想要对日期进行格式化,可以使用JsonConverter
Converters = { new JsonDateTimeConverter("yyyy-MM-dd HH:mm:ss") }
};
HttpResponseMessage response = await httpClient.GetAsync(url);
string result;
if (!response.IsSuccessStatusCode)
{
result = response.Content.ReadAsStringAsync().Result;
throw new Exception("http通信错误:" + response.StatusCode + ",结果:" + result);
}
result = await response.Content.ReadAsStringAsync();
var resultDto = System.Text.Json.JsonSerializer.Deserialize<TOut>(result, jsonOptions);
return resultDto;
}
}
}
#region 注册信息列表 #region 注册信息列表

125
src/Shentun.WebPeis.Application/QuestionRegisters/QuestionRegisterAppService.cs

@ -93,8 +93,16 @@ namespace Shentun.WebPeis.QuestionRegisters
.OrderByDescending(o => o.CreationTime) .OrderByDescending(o => o.CreationTime)
.FirstOrDefault(); .FirstOrDefault();
var personEntity = await _personRepository.FirstOrDefaultAsync(f => f.PersonId == input.PersonId);
if (personEntity == null)
{
throw new UserFriendlyException("人员不存在");
}
QuestionRegisterDto questionRegisterDto; QuestionRegisterDto questionRegisterDto;
questionRegisterDto = await GetBasicDataAsync(input);
questionRegisterDto = await GetBasicDataAsync(input, personEntity.SexId);
if (questionRegister == null) if (questionRegister == null)
{ {
return questionRegisterDto; return questionRegisterDto;
@ -238,7 +246,7 @@ namespace Shentun.WebPeis.QuestionRegisters
} }
//超重信息 //超重信息
var isOverweight = await _personManager.IsOverweight(input.PersonId);
var isOverweight = await _personManager.IsOverweight(input.PersonId);
if (isOverweight) if (isOverweight)
{ {
//危险因素编码是03 //危险因素编码是03
@ -408,7 +416,7 @@ namespace Shentun.WebPeis.QuestionRegisters
}).ToList(); }).ToList();
//超重信息 //超重信息
var isOverweight = await _personManager.IsOverweight(input.PersonId);
var isOverweight = await _personManager.IsOverweight(input.PersonId);
QuestionAnswer overweightQuestionAnswer = null; QuestionAnswer overweightQuestionAnswer = null;
if (isOverweight) if (isOverweight)
{ {
@ -539,7 +547,7 @@ namespace Shentun.WebPeis.QuestionRegisters
//超重信息 //超重信息
var isOverweight = await _personManager.IsOverweight(input.PersonId);
var isOverweight = await _personManager.IsOverweight(input.PersonId);
QuestionAnswer overweightQuestionAnswer = null; QuestionAnswer overweightQuestionAnswer = null;
if (isOverweight) if (isOverweight)
{ {
@ -801,12 +809,15 @@ namespace Shentun.WebPeis.QuestionRegisters
} }
await _repository.UpdateAsync(questionRegister); await _repository.UpdateAsync(questionRegister);
} }
/// <summary> /// <summary>
/// 获取问卷所有题目 /// 获取问卷所有题目
/// </summary> /// </summary>
/// <param name="input"></param> /// <param name="input"></param>
/// <param name="sexId"></param>
/// <returns></returns> /// <returns></returns>
private async Task<QuestionRegisterDto> GetBasicDataAsync(PersonIdInputDto input)
private async Task<QuestionRegisterDto> GetBasicDataAsync(PersonIdInputDto input, char sexId)
{ {
var questions = (await _questionRepository.GetListAsync(o => o.IsActive == 'Y')).OrderBy(o => o.DisplayOrder); var questions = (await _questionRepository.GetListAsync(o => o.IsActive == 'Y')).OrderBy(o => o.DisplayOrder);
@ -819,73 +830,89 @@ namespace Shentun.WebPeis.QuestionRegisters
//问卷 //问卷
foreach (var question in questions) foreach (var question in questions)
{ {
var questionRegisterItem = new QuestionRegisterItemDto()
bool isDisplay = false;
if (question.ForSexId == ForSexFlag.All)
{ {
QuestionRegisterItemId = GuidGenerator.Create(),
QuestionId = question.QuestionId,
QuestionName = question.QuestionName,
AnswerType = question.AnswerType,
DisplayOrder = question.DisplayOrder,
ParentId = question.ParentId,
PathCode = question.PathCode,
};
//一级答案
var firstLevelQuestionAnswers = questionAnswers.Where(o => o.QuestionId == question.QuestionId &&
o.PathCode.Length == 5).OrderBy(o => o.DisplayOrder).ToList();
foreach (var questionAnswer in firstLevelQuestionAnswers)
isDisplay = true;
}
else
{ {
var questionRegisterAnswer = new QuestionRegisterAnswerDto()
if (question.ForSexId == sexId)
{ {
QuestionRegisterAnswerId = GuidGenerator.Create(),
isDisplay = true;
}
}
if (isDisplay)
{
var questionRegisterItem = new QuestionRegisterItemDto()
{
QuestionRegisterItemId = GuidGenerator.Create(),
QuestionId = question.QuestionId, QuestionId = question.QuestionId,
QuestionAnswerId = questionAnswer.QuestionAnswerId,
QuestionAnswerName = questionAnswer.QuestionAnswerName,
ChildAnswerType = questionAnswer.ChildAnswerType,
AnswerResultType = questionAnswer.AnswerResultType,
IsSelected = 'N',
ChildAnswerTitle = questionAnswer.ChildAnswerTitle,
IsNone = questionAnswer.IsNone,
DisplayOrder = questionAnswer.DisplayOrder,
ParentId = questionAnswer.ParentId,
PathCode = questionAnswer.PathCode,
QuestionName = question.QuestionName,
AnswerType = question.AnswerType,
DisplayOrder = question.DisplayOrder,
ParentId = question.ParentId,
PathCode = question.PathCode,
}; };
//级答案
var childQuestionAnswers = questionAnswers.Where(o =>
o.ParentId == questionAnswer.QuestionAnswerId).OrderBy(o => o.DisplayOrder).ToList();
foreach (var ChilduestionAnswer in childQuestionAnswers)
//一级答案
var firstLevelQuestionAnswers = questionAnswers.Where(o => o.QuestionId == question.QuestionId &&
o.PathCode.Length == 5).OrderBy(o => o.DisplayOrder).ToList();
foreach (var questionAnswer in firstLevelQuestionAnswers)
{ {
var childQuestionRegisterAnswer = new QuestionRegisterAnswerDto()
var questionRegisterAnswer = new QuestionRegisterAnswerDto()
{ {
QuestionRegisterAnswerId = GuidGenerator.Create(), QuestionRegisterAnswerId = GuidGenerator.Create(),
QuestionId = question.QuestionId, QuestionId = question.QuestionId,
QuestionAnswerId = ChilduestionAnswer.QuestionAnswerId,
QuestionAnswerName = ChilduestionAnswer.QuestionAnswerName,
ChildAnswerType = ChilduestionAnswer.ChildAnswerType,
AnswerResultType = ChilduestionAnswer.AnswerResultType,
QuestionAnswerId = questionAnswer.QuestionAnswerId,
QuestionAnswerName = questionAnswer.QuestionAnswerName,
ChildAnswerType = questionAnswer.ChildAnswerType,
AnswerResultType = questionAnswer.AnswerResultType,
IsSelected = 'N', IsSelected = 'N',
ChildAnswerTitle = questionAnswer.ChildAnswerTitle, ChildAnswerTitle = questionAnswer.ChildAnswerTitle,
IsNone = questionAnswer.IsNone, IsNone = questionAnswer.IsNone,
DisplayOrder = ChilduestionAnswer.DisplayOrder,
ParentId = ChilduestionAnswer.ParentId,
PathCode = ChilduestionAnswer.PathCode,
DisplayOrder = questionAnswer.DisplayOrder,
ParentId = questionAnswer.ParentId,
PathCode = questionAnswer.PathCode,
}; };
questionRegisterAnswer.Childs.Add(childQuestionRegisterAnswer);
//二级答案
var childQuestionAnswers = questionAnswers.Where(o =>
o.ParentId == questionAnswer.QuestionAnswerId).OrderBy(o => o.DisplayOrder).ToList();
foreach (var ChilduestionAnswer in childQuestionAnswers)
{
var childQuestionRegisterAnswer = new QuestionRegisterAnswerDto()
{
QuestionRegisterAnswerId = GuidGenerator.Create(),
QuestionId = question.QuestionId,
QuestionAnswerId = ChilduestionAnswer.QuestionAnswerId,
QuestionAnswerName = ChilduestionAnswer.QuestionAnswerName,
ChildAnswerType = ChilduestionAnswer.ChildAnswerType,
AnswerResultType = ChilduestionAnswer.AnswerResultType,
IsSelected = 'N',
ChildAnswerTitle = questionAnswer.ChildAnswerTitle,
IsNone = questionAnswer.IsNone,
DisplayOrder = ChilduestionAnswer.DisplayOrder,
ParentId = ChilduestionAnswer.ParentId,
PathCode = ChilduestionAnswer.PathCode,
};
questionRegisterAnswer.Childs.Add(childQuestionRegisterAnswer);
}
questionRegisterItem.QuestionRegisterAnswers.Add(questionRegisterAnswer);
} }
questionRegisterItem.QuestionRegisterAnswers.Add(questionRegisterAnswer);
questionRegisterDto.QuestionRegisterItems.Add(questionRegisterItem);
} }
questionRegisterDto.QuestionRegisterItems.Add(questionRegisterItem);
} }
return questionRegisterDto; return questionRegisterDto;
} }
} }
} }

1
src/Shentun.WebPeis.Application/QueueRegisters/QueueRegisterAppService.cs

@ -83,6 +83,7 @@ namespace Shentun.WebPeis.QueueRegisters
[HttpPost("api/app/QueueRegister/CreateNewAsbitemTriage")] [HttpPost("api/app/QueueRegister/CreateNewAsbitemTriage")]
public async Task CreateNewAsbitemTriageAsync(CreateNewAsbitemTriageInputDto input) public async Task CreateNewAsbitemTriageAsync(CreateNewAsbitemTriageInputDto input)
{ {
throw new UserFriendlyException("暂未开放");
var appQueueRegisterPlugIns = new AppQueueRegisterPlugIns(); var appQueueRegisterPlugIns = new AppQueueRegisterPlugIns();
await appQueueRegisterPlugIns.CreateNewAsbitemTriageAsync(input); await appQueueRegisterPlugIns.CreateNewAsbitemTriageAsync(input);
} }

6
src/Shentun.WebPeis.Domain/Models/Question.cs

@ -61,6 +61,12 @@ public partial class Question : AuditedEntity, IHasConcurrencyStamp, IDisplayOrd
public int DisplayOrder { get; set; } public int DisplayOrder { get; set; }
/// <summary>
/// 适用性别
/// </summary>
public char ForSexId { get; set; }
public string? ConcurrencyStamp { get; set; } public string? ConcurrencyStamp { get; set; }
public virtual ICollection<QuestionRegisterItem> QuestionRegisterItems { get; set; } = new List<QuestionRegisterItem>(); public virtual ICollection<QuestionRegisterItem> QuestionRegisterItems { get; set; } = new List<QuestionRegisterItem>();

8
src/Shentun.WebPeis.EntityFrameworkCore/Configures/QuestionConfigure.cs

@ -64,6 +64,14 @@ namespace Shentun.WebPeis.Configures
entity.Property(e => e.ConcurrencyStamp) entity.Property(e => e.ConcurrencyStamp)
.HasMaxLength(40) .HasMaxLength(40)
.HasColumnName("concurrency_stamp"); .HasColumnName("concurrency_stamp");
entity.Property(e => e.ForSexId)
.HasMaxLength(1)
.HasDefaultValueSql("'A'::bpchar")
.HasComment("适用性别,M-男,F-女,A-全部")
.HasColumnName("for_sex_id");
} }
} }
} }

2
src/Shentun.WebPeis.EntityFrameworkCore/Configures/SumSuggestionHeaderConfigure.cs

@ -42,7 +42,7 @@ namespace Shentun.WebPeis.Configures
.HasComment("建议标志") .HasComment("建议标志")
.HasColumnName("suggestion_flag"); .HasColumnName("suggestion_flag");
entity.Property(e => e.SuggestionTitle) entity.Property(e => e.SuggestionTitle)
.HasMaxLength(100)
.HasMaxLength(200)
.HasComment("建议标题") .HasComment("建议标题")
.HasColumnName("suggestion_title"); .HasColumnName("suggestion_title");

8420
src/Shentun.WebPeis.EntityFrameworkCore/Migrations/20251223011631_update_suggestion_header_update_suggestion_title_length_200.Designer.cs
File diff suppressed because it is too large
View File

42
src/Shentun.WebPeis.EntityFrameworkCore/Migrations/20251223011631_update_suggestion_header_update_suggestion_title_length_200.cs

@ -0,0 +1,42 @@
using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
namespace Shentun.WebPeis.Migrations
{
/// <inheritdoc />
public partial class update_suggestion_header_update_suggestion_title_length_200 : Migration
{
/// <inheritdoc />
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.AlterColumn<string>(
name: "suggestion_title",
table: "sum_suggestion_header",
type: "character varying(200)",
maxLength: 200,
nullable: false,
comment: "建议标题",
oldClrType: typeof(string),
oldType: "character varying(100)",
oldMaxLength: 100,
oldComment: "建议标题");
}
/// <inheritdoc />
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.AlterColumn<string>(
name: "suggestion_title",
table: "sum_suggestion_header",
type: "character varying(100)",
maxLength: 100,
nullable: false,
comment: "建议标题",
oldClrType: typeof(string),
oldType: "character varying(200)",
oldMaxLength: 200,
oldComment: "建议标题");
}
}
}

4
src/Shentun.WebPeis.EntityFrameworkCore/Migrations/WebPeisDbContextModelSnapshot.cs

@ -4958,8 +4958,8 @@ namespace Shentun.WebPeis.Migrations
b.Property<string>("SuggestionTitle") b.Property<string>("SuggestionTitle")
.IsRequired() .IsRequired()
.HasMaxLength(100)
.HasColumnType("character varying(100)")
.HasMaxLength(200)
.HasColumnType("character varying(200)")
.HasColumnName("suggestion_title") .HasColumnName("suggestion_title")
.HasComment("建议标题"); .HasComment("建议标题");

2
src/Shentun.WebPeis.HttpApi.Host/Controllers/WeChatController.cs

@ -31,6 +31,7 @@ using Microsoft.AspNetCore.Identity;
using IdentityModel.Client; using IdentityModel.Client;
using static Volo.Abp.Identity.Settings.IdentitySettingNames; using static Volo.Abp.Identity.Settings.IdentitySettingNames;
using Volo.Abp.Uow; using Volo.Abp.Uow;
using Newtonsoft.Json;
namespace Shentun.WebPeis.Controllers namespace Shentun.WebPeis.Controllers
{ {
@ -100,6 +101,7 @@ namespace Shentun.WebPeis.Controllers
string jsCode = context.Request.GetParameter("jsCode").ToString(); string jsCode = context.Request.GetParameter("jsCode").ToString();
var wechatSession = await WeChatHelper.GetWechatSession(_configuration, jsCode); var wechatSession = await WeChatHelper.GetWechatSession(_configuration, jsCode);
var person = (await _personRepository.GetQueryableAsync()).Where(o => o.WechatOpenId == wechatSession.OpenId).FirstOrDefault(); var person = (await _personRepository.GetQueryableAsync()).Where(o => o.WechatOpenId == wechatSession.OpenId).FirstOrDefault();

17
src/Shentun.WebPeis.HttpApi.Host/appsettings.json

@ -22,7 +22,7 @@
}, },
"ConnectionStrings": { "ConnectionStrings": {
"Default": "Host=192.168.2.181;Port=5432;Database=WebPeis;User ID=postgres;Password=st123;"
"Default": "Host=140.143.162.39;Port=5432;Database=WebPeis;User ID=postgres;Password=shentun123;"
}, },
"AuthServer": { "AuthServer": {
"Authority": "https://localhost:44322", "Authority": "https://localhost:44322",
@ -37,14 +37,19 @@
}, },
"WeChat": { "WeChat": {
"SessionUrl": "https://api.weixin.qq.com/sns/jscode2session?", //访URL "SessionUrl": "https://api.weixin.qq.com/sns/jscode2session?", //访URL
"AppID": "wx6a8a4440a42c9466", //AppID
"AppSecret": "aae34bfef498906290a92318d0f7183d" //AppSecret
"AppID": "wx95ad21545fc76f09", //AppID
"AppSecret": "9828be06636f023ba5e32c17bb3d61c0" //AppSecret
}, },
"VirtualPaths": [ "VirtualPaths": [
{ {
"PhysicsPath": "F:\\testimg", // "PhysicsPath": "F:\\testimg", //
"RequestPath": "/Report", // "RequestPath": "/Report", //
"Alias": "Report" // "Alias": "Report" //
},
{
"PhysicsPath": "D:\\webpeis\\MedicalReportPdf", //
"RequestPath": "/OldReport", //
"Alias": "OldReport" //
} }
], ],
"Sms": { "Sms": {
@ -62,7 +67,7 @@
}, },
"Redis": { "Redis": {
"IsEnabled": "true", "IsEnabled": "true",
"Configuration": "192.168.2.181"
"Configuration": "140.143.162.39:6379,password=st123"
}, },
"MedicalHealthReport": { "MedicalHealthReport": {
"BaseAddress": "http://10.1.13.31", "BaseAddress": "http://10.1.13.31",
@ -90,5 +95,9 @@
"Pacs": { "Pacs": {
"PacsDatabase": "Host=192.168.0.188;Port=5432;Database=ShentunPacs1212;User ID=postgres;Password=St123456;", "PacsDatabase": "Host=192.168.0.188;Port=5432;Database=ShentunPacs1212;User ID=postgres;Password=St123456;",
"BarCodeMode": "0" "BarCodeMode": "0"
},
"Report": {
"IsOldReport": "N",
"OldApiBaseUrl": "https://ccjktj.cn:44322"
} }
} }
Loading…
Cancel
Save