2 Commits

Author SHA1 Message Date
DESKTOP-G961P6V\Zhh b72836017f 预约 1 year ago
DESKTOP-G961P6V\Zhh 79a5ce65fd 预约 1 year ago
  1. 65
      Shentun.WebPeis.Plugins/ColumnReferences/ColumnReferencePlugIns.cs
  2. 143
      Shentun.WebPeis.Plugins/ColumnReferences/ColumnReferencePlugInsBase.cs
  3. 43
      Shentun.WebPeis.Plugins/ColumnReferences/ColumnReferencePlugInsDbBase.cs
  4. 14
      Shentun.WebPeis.Plugins/LoginInputDto.cs
  5. 22
      Shentun.WebPeis.Plugins/LoginOutDto.cs
  6. 330
      Shentun.WebPeis.Plugins/PlugInsBase.cs
  7. 29
      Shentun.WebPeis.Plugins/Shentun.WebPeis.Plugins.csproj
  8. 92
      Shentun.WebPeis.Plugins/ThirdPlugInsBase.cs
  9. 21
      Shentun.WebPeis.Plugins/WebPeisPlugInsModule.cs
  10. 9
      Shentun.WebPeis.sln
  11. 33
      src/Shentun.WebPeis.Application/AppointPatientRegisters/AppointPatientRegisterAppService.cs
  12. 3
      src/Shentun.WebPeis.Application/Persons/PersonAppService.cs
  13. 2
      src/Shentun.WebPeis.Domain/AppointPatientRegisters/AppointPatientRegisterManager.cs

65
Shentun.WebPeis.Plugins/ColumnReferences/ColumnReferencePlugIns.cs

@ -0,0 +1,65 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Shentun.WebPeis.PlugIns.ColumnReferences
{
interface IColumnReferencePlugIns
{
public List<ColumnReferenceColumn> GetAppColumns();
public string GetAppFilterColumnName();
public List<ColumnReferenceColumn> GetInterfaceColumns();
public Task<List<ColumnReferenceCodeValue>> GetAppCodeValuesAsync();
public Task<List<ColumnReferenceFilterCodeValue>> GetAppFilterCodeValuesAsync();
public Task<List<ColumnReferenceCodeValue>> GetInterfaceCodeValuesAsync();
}
public class ColumnReferenceCodeValue
{
public string CodeValue { get; set; }
public string DisplayName { get; set; }
public string Exter1 { get; set; }
public string Exter2 { get; set; }
public string Exter3 { get; set; }
public string Exter4 { get; set; }
public string Exter5 { get; set; }
public string SimpleCode { get; set; }
public string FilterCodeValue { get; set; }
public int DisplayOrder { get; set; }
}
public class ColumnReferenceFilterCodeValue
{
public string CodeValue { get; set; }
public string DiaplayName { get; set; }
public int DisplayOrder { get; set; }
}
public class ColumnReferenceInterfaceCodeValue
{
public string InterfaceCodeValue { get; set; }
public string DisplayName { get; set; }
public string Exter1 { get; set; }
public string Exter2 { get; set; }
public string Exter3 { get; set; }
public string Exter4 { get; set; }
public string Exter5 { get; set; }
}
public class ColumnReferenceColumn
{
public string Column { get; set; }
public string Name { get; set; }
}
public class ColumnReferenceTable
{
public string TableName { get; set; }
public string CodeColumn { get; set; }
public string NameColumn { get; set; }
public string SimpleCodeColumn { get; set; }
public string DisplayOrderColumn { get; set; }
}
}

143
Shentun.WebPeis.Plugins/ColumnReferences/ColumnReferencePlugInsBase.cs

@ -0,0 +1,143 @@
using System;
using System.Collections;
using System.Collections.Generic;
using System.Data.Common;
using System.Linq;
using System.Text;
using System.Text.Json;
using System.Threading.Tasks;
using Dapper;
using Microsoft.Extensions.Configuration;
using Npgsql;
using Shentun.Utilities;
namespace Shentun.WebPeis.PlugIns.ColumnReferences
{
public class ColumnReferencePlugInsBase : PlugInsBase, IColumnReferencePlugIns
{
protected string AppSql;
private List<ColumnReferenceColumn> _columns;
private List<ColumnReferenceColumn> _interfaceColumns;
public ColumnReferencePlugInsBase(string parmValue) : base(parmValue)
{
AppSql = InterfaceConfig.GetSection("App").GetSection("Sql").Value;
var columns = InterfaceConfig.GetSection("App").GetSection("Columns").Value;
string[]? columnArry;
if (columns != null)
{
columns = columns.Replace(",", ",");
columnArry = columns.Split(',');
_columns = new List<ColumnReferenceColumn>();
foreach (var column in columnArry)
{
var singleColumns = column.Split('=');
if (singleColumns.Length == 2)
{
_columns.Add(new ColumnReferenceColumn()
{
Column = singleColumns[0],
Name = singleColumns[1]
});
}
}
}
columns = InterfaceConfig.GetSection("Interface").GetSection("Columns").Value;
if (columns != null)
{
columns = columns.Replace(",", ",");
columnArry = columns.Split(',');
_interfaceColumns = new List<ColumnReferenceColumn>();
foreach (var columnName in columnArry)
{
var singleColumns = columnName.Split('=');
if (singleColumns.Length == 2)
{
_interfaceColumns.Add(new ColumnReferenceColumn()
{
Column = singleColumns[0],
Name = singleColumns[1]
});
}
}
}
}
public virtual List<ColumnReferenceColumn> GetAppColumns()
{
if (_columns == null || _columns.Count() == 0)
{
return new List<ColumnReferenceColumn>()
{
new ColumnReferenceColumn()
{
Column = "Code",
Name = "编码"
},
new ColumnReferenceColumn()
{
Column = "DisplayName",
Name = "名称"
}
};
}
return _columns;
}
public virtual List<ColumnReferenceColumn> GetInterfaceColumns()
{
if (_interfaceColumns == null || _interfaceColumns.Count() == 0)
{
return new List<ColumnReferenceColumn>()
{
new ColumnReferenceColumn()
{
Column = "Code",
Name = "编码"
},
new ColumnReferenceColumn()
{
Column = "DisplayName",
Name = "名称"
}
};
}
return _interfaceColumns;
}
public virtual async Task<List<ColumnReferenceCodeValue>> GetAppCodeValuesAsync()
{
using (DbConnection conn = new NpgsqlConnection(AppConnctionStr))
{
var list = (await conn.QueryAsync<ColumnReferenceCodeValue>(AppSql)).ToList();
return list;
}
}
public virtual async Task<List<ColumnReferenceCodeValue>> GetInterfaceCodeValuesAsync()
{
return new List<ColumnReferenceCodeValue>()
{
};
}
public virtual async Task<List<ColumnReferenceFilterCodeValue>> GetAppFilterCodeValuesAsync()
{
throw new NotImplementedException();
}
public virtual string GetAppFilterColumnName()
{
return null;
}
}
}

43
Shentun.WebPeis.Plugins/ColumnReferences/ColumnReferencePlugInsDbBase.cs

@ -0,0 +1,43 @@
using Dapper;
using Microsoft.Data.SqlClient;
using Npgsql;
using Oracle.ManagedDataAccess.Client;
using Shentun.Utilities;
using System;
using System.Collections.Generic;
using System.Data.Common;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Shentun.WebPeis.PlugIns.ColumnReferences
{
public class ColumnReferencePlugInsDbBase : ColumnReferencePlugInsBase
{
public ColumnReferencePlugInsDbBase(string parmValue) : base(parmValue)
{
InterfaceSql = InterfaceConfig.GetSection("Interface").GetSection("Sql").Value;
InterfaceDbType = InterfaceConfig.GetSection("Interface").GetSection("DbType").Value;
InterfaceConnctionStr = InterfaceConfig.GetSection("Interface").GetSection("ConnectionStrings").Value;
}
public override async Task<List<ColumnReferenceCodeValue>> GetInterfaceCodeValuesAsync()
{
using (DbConnection conn = CreateInterfaceDbConnect())
{
var list = (await conn.QueryAsync<ColumnReferenceCodeValue>(InterfaceSql)).ToList();
foreach (var item in list)
{
if(string.IsNullOrWhiteSpace(item.SimpleCode))
{
item.SimpleCode = LanguageConverter.GetPYSimpleCode(item.DisplayName);
}
}
return list;
}
}
}
}

14
Shentun.WebPeis.Plugins/LoginInputDto.cs

@ -0,0 +1,14 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Shentun.WebPeis.PlugIns
{
public class LoginInputDto
{
public string UserName { get; set; }
public string Password { get; set; }
}
}

22
Shentun.WebPeis.Plugins/LoginOutDto.cs

@ -0,0 +1,22 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Shentun.WebPeis.PlugIns
{
//public class LoginOutDto: WebApiOutDtoBase
//{
// public LoginOutDataDto Data { get; set; }
//}
public class LoginOutDataDto
{
public string peis_id { get; set; }
public string access_token { get; set; }
public string token_type { get; set; }
public int expires_in { get; set; }
public string refresh_token { get; set; }
}
}

330
Shentun.WebPeis.Plugins/PlugInsBase.cs

@ -0,0 +1,330 @@
using Microsoft.Data.SqlClient;
using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.Logging;
using Newtonsoft.Json;
using Newtonsoft.Json.Converters;
using Npgsql;
using Oracle.ManagedDataAccess.Client;
using Shentun.Utilities;
using System;
using System.Collections.Generic;
using System.Data.Common;
using System.IdentityModel.Tokens.Jwt;
using System.Linq;
using System.Linq.Dynamic.Core.Tokenizer;
using System.Net.Http.Headers;
using System.Text;
using System.Threading.Tasks;
namespace Shentun.WebPeis.PlugIns
{
public class PlugInsBase
{
protected IConfiguration? AppConfig;
protected IConfiguration? InterfaceConfig;
protected string? AppConnctionStr;
private string? _appBaseAddress;
private static string? _accesToken;
protected string? AppUser;
protected string? AppPassword;
protected string? InterfaceSql;
protected string? InterfaceSqlKeyColumn;
protected string? InterfaceDbType;
protected string? InterfaceConnctionStr;
protected string? InterfaceWebApiUrl;
protected Guid ItemColumnReferenceId;
protected Guid AsbitemColumnReferenceId;
protected Guid DepartmentColumnReferenceId;
protected Guid UserColumnReferenceId;
protected ILogger<PlugInsBase> Logger;
static PlugInsBase()
{
Dapper.DefaultTypeMap.MatchNamesWithUnderscores = true;
}
public PlugInsBase()
{
Init();
}
public PlugInsBase(string parmValue)
{
Init();
Init(parmValue);
}
public void Init()
{
AppConfig = new ConfigurationBuilder()
.SetBasePath(DirectoryHelper.GetAppDirectory()) // 设置基础路径为当前目录
.AddJsonFile("appsettings.json", optional: true, reloadOnChange: true)
.Build();
AppConnctionStr = AppConfig.GetSection("ConnectionStrings")
.GetSection("Default").Value;
_appBaseAddress = AppConfig.GetSection("App")
.GetSection("SelfUrl").Value;
AppUser = AppConfig.GetSection("App")
.GetSection("SelfUser").Value;
AppPassword = AppConfig.GetSection("App")
.GetSection("SelfPassword").Value;
using var loggerFactory = LoggerFactory.Create(builder =>
{
});
Logger = loggerFactory.CreateLogger<PlugInsBase>();
}
public void Init(string parmValue)
{
var configurationBuilder = new ConfigurationBuilder()
.AddJsonStream(new MemoryStream(System.Text.Encoding.UTF8.GetBytes(parmValue)));
InterfaceConfig = configurationBuilder.Build();
//如果接口配置里面配置了用户名密码,则用接口中的覆盖本地配置
var appUser = InterfaceConfig.GetSection("App").GetSection("User").Value;
if(!string.IsNullOrWhiteSpace(appUser))
{
AppUser = appUser;
}
var appPassword = InterfaceConfig.GetSection("App").GetSection("Password").Value;
if (!string.IsNullOrWhiteSpace(appPassword))
{
AppPassword = appPassword;
}
//设置接口有关配置
InterfaceSql = InterfaceConfig.GetSection("Interface").GetSection("Sql").Value;
InterfaceSqlKeyColumn = InterfaceConfig.GetSection("Interface").GetSection("SqlKeyColumn").Value;
InterfaceDbType = InterfaceConfig.GetSection("Interface").GetSection("DbType").Value;
InterfaceWebApiUrl = InterfaceConfig.GetSection("Interface").GetSection("WebApiUrl").Value;
InterfaceConnctionStr = InterfaceConfig.GetSection("Interface").GetSection("ConnectionStrings").Value;
var itemColumnReferenceIdStr = InterfaceConfig.GetSection("Interface")
.GetSection("ItemColumnReferenceId").Value;
if (!string.IsNullOrWhiteSpace(itemColumnReferenceIdStr))
{
ItemColumnReferenceId = new Guid(itemColumnReferenceIdStr);
}
var asbItemColumnReferenceIdStr = InterfaceConfig.GetSection("Interface")
.GetSection("AsbitemColumnReferenceId").Value;
if (!string.IsNullOrWhiteSpace(asbItemColumnReferenceIdStr))
{
AsbitemColumnReferenceId = new Guid(asbItemColumnReferenceIdStr);
}
var departmentColumnReferenceIdStr = InterfaceConfig.GetSection("Interface")
.GetSection("DepartmentColumnReferenceId").Value;
if (!string.IsNullOrWhiteSpace(departmentColumnReferenceIdStr))
{
DepartmentColumnReferenceId = new Guid(departmentColumnReferenceIdStr);
}
var userColumnReferenceIdStr = InterfaceConfig.GetSection("Interface")
.GetSection("UserColumnReferenceId").Value;
if (!string.IsNullOrWhiteSpace(userColumnReferenceIdStr))
{
UserColumnReferenceId = new Guid(userColumnReferenceIdStr);
}
}
protected DbConnection CreateInterfaceDbConnect()
{
DbConnection conn;
if (string.IsNullOrWhiteSpace(InterfaceConnctionStr))
{
throw new ArgumentException("数据连接设置中的DbType不能为空");
}
InterfaceDbType = InterfaceDbType.ToLower();
//Logger.LogInformation("数据库类型:" + InterfaceDbType);
if (InterfaceDbType == "sqlserver")
{
//Logger.LogInformation("调用sqlserver:" + InterfaceDbType);
conn = new SqlConnection(InterfaceConnctionStr);
}
else if (InterfaceDbType == "postgres")
{
//Logger.LogInformation("调用postgres:" + InterfaceDbType);
conn = new NpgsqlConnection(InterfaceConnctionStr);
}
else if (InterfaceDbType == "oracle")
{
//Logger.LogInformation("调用oracle:" + InterfaceDbType);
conn = new OracleConnection(InterfaceConnctionStr);
}
else
{
throw new ArgumentException("数据连接设置中的DbType不支持");
}
return conn;
}
public async Task<TOut> CallAppServiceAsync<TInput, TOut>(string url, TInput data, string method = "post")
{
if(string.IsNullOrWhiteSpace(_appBaseAddress))
{
throw new Exception("_appBaseAddress不能为空");
}
string baseAddress = _appBaseAddress;
await CheckLoginAsync();
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是可接受的响应类型
httpClient.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", _accesToken);
IsoDateTimeConverter timeFormat = new IsoDateTimeConverter();
timeFormat.DateTimeFormat = "yyyy-MM-dd HH:mm:ss";
var sendData = JsonConvert.SerializeObject(data, Newtonsoft.Json.Formatting.Indented, timeFormat);
using (HttpContent httpContent = new StringContent(sendData))
{
httpContent.Headers.ContentType = new MediaTypeHeaderValue("application/json");
HttpResponseMessage response = null;
if (method == "post")
{
response = await httpClient.PostAsync(url, httpContent);
}
else
{
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 = JsonConvert.DeserializeObject< WebApiOutDto<TOut>>(result);
if (resultDto.Code == -1)
{
throw new Exception($"调用WebApi失败,返回-1,消息:" + resultDto.Message);
}
return resultDto.Data;
}
}
}
}
public virtual async Task DoWorkAsync()
{
}
public virtual Task DoWork()
{
return Task.CompletedTask;
}
public async virtual Task<WebApiOutDto<LoginOutDataDto>> LoginAsync()
{
if(string.IsNullOrWhiteSpace(AppUser))
{
throw new Exception("SelfUser不能为空");
}
if (string.IsNullOrWhiteSpace(AppPassword))
{
throw new Exception("SelfPassword不能为空");
}
var relult = await LoginAsync(AppUser, AppPassword);
return relult;
}
public async Task<WebApiOutDto<LoginOutDataDto>> LoginAsync(string userId, string password)
{
if (string.IsNullOrWhiteSpace(userId))
{
throw new Exception("用户ID不能为空");
}
if (string.IsNullOrWhiteSpace(password))
{
throw new Exception("密码不能为空");
}
using (var httpClientHandler = new HttpClientHandler())
{
using (var httpClient = new HttpClient(httpClientHandler))
{
httpClient.BaseAddress = new Uri(_appBaseAddress);
httpClient.DefaultRequestHeaders.Accept.Add(
new MediaTypeWithQualityHeaderValue("application/json"));//设置accept标头,告诉JSON是可接受的响应类型
var url = "api/identity/users/login";
var loginUser = new LoginInputDto()
{
UserName = userId,
Password = password
};
var sendData = JsonConvert.SerializeObject(loginUser);
using (HttpContent httpContent = new StringContent(sendData))
{
httpContent.Headers.ContentType = new MediaTypeHeaderValue("application/json");
HttpResponseMessage response = await httpClient.PostAsync(url, httpContent);
string result;
if (!response.IsSuccessStatusCode)
{
result = response.Content.ReadAsStringAsync().Result;
throw new Exception("http通信错误:" + response.StatusCode + ",结果:" + result);
}
result = await response.Content.ReadAsStringAsync();
var restultDto = JsonConvert.DeserializeObject<WebApiOutDto<LoginOutDataDto>>(result);
if (restultDto == null)
{
throw new Exception("返回结果是空");
}
if (restultDto.Code != 1)
{
throw new Exception($"登录失败{restultDto.Message}");
}
_accesToken = restultDto.Data.access_token;
return restultDto;
}
}
}
}
private async Task CheckLoginAsync()
{
if (string.IsNullOrWhiteSpace(_accesToken))
{
await LoginAsync();
}
else
{
var handler = new JwtSecurityTokenHandler();
var payload = handler.ReadJwtToken(_accesToken).Payload;
var claims = payload.Claims;
var exp = claims.First(claim => claim.Type == "exp").Value;
if (exp == null)
{
await LoginAsync();
}
else
{
if (long.TryParse(exp, out var expires))
{
var expireTime = DateTimeOffset.FromUnixTimeSeconds(expires).LocalDateTime;
if (expireTime <= DateTime.Now)
{
await LoginAsync();
}
}
else
{
await LoginAsync();
}
}
}
}
}
}

29
Shentun.WebPeis.Plugins/Shentun.WebPeis.Plugins.csproj

@ -0,0 +1,29 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>net8.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
</PropertyGroup>
<ItemGroup>
<Folder Include="SyncAppointToPeis\" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="Dapper" Version="2.1.35" />
<PackageReference Include="Microsoft.Data.SqlClient" Version="5.2.1" />
<PackageReference Include="Microsoft.Extensions.Configuration" Version="8.0.0" />
<PackageReference Include="Newtonsoft.Json" Version="13.0.3" />
<PackageReference Include="Npgsql" Version="8.0.3" />
<PackageReference Include="Oracle.ManagedDataAccess.Core" Version="23.4.0" />
<PackageReference Include="Volo.Abp.Core" Version="8.1.4" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\src\Shentun.Utilities\Shentun.Utilities.csproj" />
<ProjectReference Include="..\src\Shentun.WebPeis.Application.Contracts\Shentun.WebPeis.Application.Contracts.csproj" />
<ProjectReference Include="..\src\Shentun.WebPeis.HttpApi.Client\Shentun.WebPeis.HttpApi.Client.csproj" />
</ItemGroup>
</Project>

92
Shentun.WebPeis.Plugins/ThirdPlugInsBase.cs

@ -0,0 +1,92 @@
using Dapper;
using Microsoft.Extensions.Configuration;
using Npgsql;
using Shentun.Utilities;
using Shentun.WebPeis.PlugIns.ColumnReferences;
using Shentun.WebPeis.ThirdInterfaces;
using System;
using System.Collections.Generic;
using System.Data.Common;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Shentun.WebPeis.PlugIns
{
public class ThirdPlugInsBase: PlugInsBase
{
//private Guid _thirdInterfaceId;
protected ThirdInterfaceDto _thirdInterfaceDto;
public ThirdPlugInsBase(Guid thirdInterfaceId):base()
{
using (DbConnection conn = new NpgsqlConnection(AppConnctionStr))
{
string sql;
sql = @"
SELECT *
from third_interface
where id =@ThirdInterfaceId
";
_thirdInterfaceDto = ( conn.Query<ThirdInterfaceDto>(sql,
new { ThirdInterfaceId = thirdInterfaceId })).Single();
Init(_thirdInterfaceDto.ParmValue);
}
}
public ThirdPlugInsBase(string parmValue):base(parmValue)
{
}
public async Task<List<ColumnReferenceInterfaceCodeValue>> GetColumnReferenceInterfaceCodeValuesAsync(Guid columnReferenceId,
string appCodeValue)
{
using (DbConnection conn = new NpgsqlConnection(AppConnctionStr))
{
string sql;
sql = @"
SELECT
column_reference_interface.interface_code_value
from column_reference
join column_reference_code on column_reference.id = column_reference_code.column_reference_id
join column_reference_interface on column_reference_code.id = column_reference_interface.column_reference_code_id
where column_reference.id = @ColumnReferenceId and
column_reference_code.code_value = @CodeValue
";
var columnReferenceInterfaceCodeValues = (await conn.QueryAsync<ColumnReferenceInterfaceCodeValue>(sql,
new { ColumnReferenceId = columnReferenceId, CodeValue =appCodeValue })).ToList();
return columnReferenceInterfaceCodeValues;
}
}
public async Task<List<ColumnReferenceCodeValue>> GetColumnReferenceCodeValuesAsync(Guid columnReferenceId,
string interfaceCodeValue)
{
if(string.IsNullOrWhiteSpace(interfaceCodeValue))
{
throw new Exception("第三方编码不能为空");
}
interfaceCodeValue = interfaceCodeValue.Trim();
using (DbConnection conn = new NpgsqlConnection(AppConnctionStr))
{
string sql;
sql = @"
SELECT
column_reference_code.code_value
from column_reference
join column_reference_code on column_reference.id = column_reference_code.column_reference_id
join column_reference_interface on column_reference_code.id = column_reference_interface.column_reference_code_id
where column_reference.id = @ColumnReferenceId and
column_reference_interface.interface_code_value = @InterfaceCodeValue
";
var columnReferenceCodeValues = (await conn.QueryAsync<ColumnReferenceCodeValue>(sql,
new { ColumnReferenceId = columnReferenceId, InterfaceCodeValue = interfaceCodeValue })).ToList();
//if(columnReferenceCodeValues.Count == 0)
//{
// throw new Exception($"{interfaceCodeValue}没有找到对照");
//}
return columnReferenceCodeValues;
}
}
}
}

21
Shentun.WebPeis.Plugins/WebPeisPlugInsModule.cs

@ -0,0 +1,21 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Volo.Abp;
using Volo.Abp.Modularity;
namespace Shentun.WebPeis.Plugins
{
public class WebPeisPlugInsModule : AbpModule
{
public override void OnApplicationInitialization(ApplicationInitializationContext context)
{
//var myService = context.ServiceProvider
// .GetRequiredService<MyService>();
//myService.Initialize();
}
}
}

9
Shentun.WebPeis.sln

@ -39,7 +39,9 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Shentun.Utilities", "src\Sh
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Shentun.WebApi.Service", "src\Shentun.WebApi.Service\Shentun.WebApi.Service.csproj", "{6625C4ED-DAF2-41BA-8499-58655E4C1D3C}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Shentun.Sms.Client", "Shentun.Sms.Client\Shentun.Sms.Client.csproj", "{B45965B5-7A87-4163-9904-2A2EEC84EEDC}"
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Shentun.Sms.Client", "Shentun.Sms.Client\Shentun.Sms.Client.csproj", "{B45965B5-7A87-4163-9904-2A2EEC84EEDC}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Shentun.WebPeis.Plugins", "Shentun.WebPeis.Plugins\Shentun.WebPeis.Plugins.csproj", "{FCAFD220-0BD5-4A92-AC22-4585F493DAC5}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
@ -115,6 +117,10 @@ Global
{B45965B5-7A87-4163-9904-2A2EEC84EEDC}.Debug|Any CPU.Build.0 = Debug|Any CPU
{B45965B5-7A87-4163-9904-2A2EEC84EEDC}.Release|Any CPU.ActiveCfg = Release|Any CPU
{B45965B5-7A87-4163-9904-2A2EEC84EEDC}.Release|Any CPU.Build.0 = Release|Any CPU
{FCAFD220-0BD5-4A92-AC22-4585F493DAC5}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{FCAFD220-0BD5-4A92-AC22-4585F493DAC5}.Debug|Any CPU.Build.0 = Debug|Any CPU
{FCAFD220-0BD5-4A92-AC22-4585F493DAC5}.Release|Any CPU.ActiveCfg = Release|Any CPU
{FCAFD220-0BD5-4A92-AC22-4585F493DAC5}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
@ -137,6 +143,7 @@ Global
{99FB7F67-8EB4-4448-A831-39EE7E5F59F7} = {CA9AC87F-097E-4F15-8393-4BC07735A5B0}
{6625C4ED-DAF2-41BA-8499-58655E4C1D3C} = {CA9AC87F-097E-4F15-8393-4BC07735A5B0}
{B45965B5-7A87-4163-9904-2A2EEC84EEDC} = {CA9AC87F-097E-4F15-8393-4BC07735A5B0}
{FCAFD220-0BD5-4A92-AC22-4585F493DAC5} = {CA9AC87F-097E-4F15-8393-4BC07735A5B0}
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {28315BFD-90E7-4E14-A2EA-F3D23AF4126F}

33
src/Shentun.WebPeis.Application/AppointPatientRegisters/AppointPatientRegisterAppService.cs

@ -316,7 +316,7 @@ namespace Shentun.WebPeis.AppointPatientRegisters
}
/// <summary>
/// 获取某人的预约列表,小程序使用
/// 获取某人的个人预约列表,小程序使用
/// </summary>
/// <param name="input"></param>
/// <returns></returns>
@ -345,7 +345,8 @@ namespace Shentun.WebPeis.AppointPatientRegisters
join customerOrg in await _customerOrgRepository.GetQueryableAsync()
on appointPatientRegister.CustomerOrgId equals customerOrg.CustomerOrgId
where appointPatientRegister.PersonId == input.PersonId &&
appointPatientRegister.CompleteFlag != AppointPatientRegisterCompleteFlag.CancelAppoint
appointPatientRegister.CompleteFlag != AppointPatientRegisterCompleteFlag.CancelAppoint &&
appointPatientRegister.CustomerOrgId != GuidFlag.PersonCustomerOrgId
orderby appointPatientRegister.AppointDate
select new
{
@ -424,7 +425,7 @@ namespace Shentun.WebPeis.AppointPatientRegisters
}
/// <summary>
/// 获取预约的组合项目
/// 获取预约的组合项目通过预约ID
/// </summary>
/// <param name="input"></param>
/// <returns></returns>
@ -491,6 +492,28 @@ namespace Shentun.WebPeis.AppointPatientRegisters
return appointRegisterAsbitemDtos;
}
/// <summary>
/// 获取预约的人员信息通过备单登记ID
/// </summary>
/// <param name="input"></param>
/// <returns></returns>
[AllowAnonymous]
[HttpPost("api/app/AppointPatientRegister/GetByPatientRegisterId")]
public async Task<AppointPatientRegisterDto> GetByPatientRegisterIdAsync(PatientRegisterIdInputDto input)
{
if (input == null) throw new UserFriendlyException("参数不能为空");
var appointRegister = await _repository.FindAsync(o => o.PatientRegisterId == input.PatientRegisterId && o.CompleteFlag == AppointPatientRegisterCompleteFlag.Appoint);
if (appointRegister == null)
{
throw new UserFriendlyException("没有预约的人员信息");
}
var AppointPatientRegisterDto = new AppointPatientRegisterDto()
{
AppointPatientRegisterId = appointRegister.AppointPatientRegisterId
};
return AppointPatientRegisterDto;
}
/// <summary>
/// 获取单位预约病人
/// </summary>
@ -930,7 +953,7 @@ namespace Shentun.WebPeis.AppointPatientRegisters
/// </summary>
/// <param name="input"></param>
/// <returns></returns>
private async Task<PersonDiseaseRiskLeveWithForbidlCheckDto> GetDiseaseRiskListByPersonIdAsync(Guid personId, int recommendId )
private async Task<PersonDiseaseRiskLeveWithForbidlCheckDto> GetDiseaseRiskListByPersonIdAsync(Guid personId, int recommendId)
{
var questionRegister = (await _questionRegisterRepository.GetQueryableAsync())
.Where(o => o.PersonId == personId)
@ -1183,7 +1206,7 @@ namespace Shentun.WebPeis.AppointPatientRegisters
{
if (personDiseaseRiskLevel.Asbitems.Where(o => o.AsbitemId == personDiseaseRiskLevel2.Asbitems[i].AsbitemId).Any())
{
if(!personDiseaseRiskLevel.DiseaseRiskName.Contains(personDiseaseRiskLevel2.DiseaseRiskName))
if (!personDiseaseRiskLevel.DiseaseRiskName.Contains(personDiseaseRiskLevel2.DiseaseRiskName))
{
personDiseaseRiskLevel.DiseaseRiskName += "," + personDiseaseRiskLevel2.DiseaseRiskName;
}

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

@ -439,7 +439,8 @@ namespace Shentun.WebPeis.Persons
join patientRegister in await _patientRegisterRepository.GetQueryableAsync()
on patient.PatientId equals patientRegister.PatientId
where user.Id == input.PersonId &&
(patientRegister.CompleteFlag == PatientRegisterCompleteFlag.SumCheck)
(patientRegister.CompleteFlag == PatientRegisterCompleteFlag.SumCheck) &&
!string.IsNullOrWhiteSpace(patientRegister.ReportFile)
orderby patientRegister.MedicalStartDate
select new PersonMedicalTimesDto()
{

2
src/Shentun.WebPeis.Domain/AppointPatientRegisters/AppointPatientRegisterManager.cs

@ -280,6 +280,8 @@ namespace Shentun.WebPeis.AppointPatientRegisters
{
throw new UserFriendlyException($"{asbitem.AsbitemName}支付类别错误");
}
//先强制设置为单位支付
appointRegisterAsbitem.PayTypeFlag = PayTypeFlag.OrgPay;
}
if (entity.PregnantFlag == PregnantFlag.PreparePregnancy && asbitem.ForPregnantFlag == ForPregnantFlag.PreparePregnancy)

Loading…
Cancel
Save