Browse Source

青藏铁路

bjmzak
DESKTOP-G961P6V\Zhh 2 years ago
parent
commit
a6dfc2806f
  1. 50
      ThirdPlugIns/Shentun.Peis.PlugIns.Gem/PatientRegisters/Qztl/ImportPatientRegisterPlugInsQztl.cs
  2. 2
      ThirdPlugIns/Shentun.Peis.PlugIns.Gem/test/Shentun.Peis.PlugIns.Gem.Test/ImportPatientRegisterPlugInsHzcyTest.cs
  3. 31
      src/Shentun.ColumnReferencePlugIns/PatientRegisters/ImportPatientRegisterPlugInsBase.cs
  4. 34
      src/Shentun.Peis.Application/CustomerOrgGroups/CustomerOrgGroupAppService.cs

50
ThirdPlugIns/Shentun.Peis.PlugIns.Gem/PatientRegisters/Qztl/ImportPatientRegisterPlugInsQztl.cs

@ -28,7 +28,7 @@ namespace Shentun.Peis.PlugIns.Extensions.PatientRegisters.Qztl
{
public class ImportPatientRegisterPlugInsQztl : ImportPatientRegisterPlugInsBase
{
private Guid _importCustomerOrgId;
private string _hospitalId;
private string _aesKEY;
private string _year;
@ -36,7 +36,7 @@ namespace Shentun.Peis.PlugIns.Extensions.PatientRegisters.Qztl
private CustomerOrgRegisterDto _customerOrgRegisterDto;
private List<PersonnelTypeDto> _personnelTypes;
private List<CustomerOrgGroupDto> _customerOrgGroupDtos;
private Guid _customerOrgRegisterId;
private string _answerWebApiUrl;
public ImportPatientRegisterPlugInsQztl(Guid thirdInterfaceId) : base(thirdInterfaceId)
@ -49,10 +49,10 @@ namespace Shentun.Peis.PlugIns.Extensions.PatientRegisters.Qztl
}
public override async Task<List<string>> ImportAsync(Guid customerOrgRegisterId)
public override async Task<List<string>> ImportPatientRegisterByCustomerOrgRegisterIdAsync(Guid customerOrgRegisterId)
{
_customerOrgRegisterId = customerOrgRegisterId;
if(_customerOrgRegisterId == Guid.Empty)
CustomerOrgRegisterId = customerOrgRegisterId;
if(CustomerOrgRegisterId == Guid.Empty)
{
throw new Exception("customerOrgRegisterId参数不能为空");
}
@ -168,7 +168,7 @@ namespace Shentun.Peis.PlugIns.Extensions.PatientRegisters.Qztl
}
var customerOrgDtos = await CallAppServiceAsync<CustomerOrgIdInputDto, List<CustomerOrgDto>>(
"api/app/CustomerOrg/GetChildCustomerOrgsById",
new CustomerOrgIdInputDto() { CustomerOrgId = _importCustomerOrgId });
new CustomerOrgIdInputDto() { CustomerOrgId = _customerOrgDto.Id });
CustomerOrgDto customerOrgDto = null;
if (customerOrgDtos != null && customerOrgDtos.Any())
{
@ -180,7 +180,7 @@ namespace Shentun.Peis.PlugIns.Extensions.PatientRegisters.Qztl
"api/app/customerorg/create", new CreateCustomerOrgDto()
{
MedicalCenterId = _customerOrgDto.MedicalCenterId,
ParentId = _importCustomerOrgId,
ParentId = _customerOrgDto.Id,
DisplayName = orgName,
ShortName = orgName,
IsActive = 'Y',
@ -192,9 +192,9 @@ namespace Shentun.Peis.PlugIns.Extensions.PatientRegisters.Qztl
{
//复检
//加载单位分组信息
_customerOrgGroupDtos = await CallAppServiceAsync<Guid, List<CustomerOrgGroupDto>>(
"api/app/customer-org-group/in-customer-org-id/" + _importCustomerOrgId.ToString()
, Guid.Empty, "get");
_customerOrgGroupDtos = await CallAppServiceAsync<CustomerOrgRegisterIdInputDto, List<CustomerOrgGroupDto>>(
"api/app/CustomerOrgGroup/GetListByCustomerOrgRegisterId"
, new CustomerOrgRegisterIdInputDto() { CustomerOrgRegisterId = CustomerOrgRegisterId});
customerOrgGroupDto = _customerOrgGroupDtos.Where(o => o.DisplayName == "复检").FirstOrDefault();
if (customerOrgGroupDto == null)
{
@ -386,7 +386,7 @@ namespace Shentun.Peis.PlugIns.Extensions.PatientRegisters.Qztl
public async Task InitAsync()
{
if (_customerOrgRegisterId == Guid.Empty)
if (CustomerOrgRegisterId == Guid.Empty)
{
throw new Exception("customerOrgRegisterId参数不能为空");
}
@ -399,10 +399,7 @@ namespace Shentun.Peis.PlugIns.Extensions.PatientRegisters.Qztl
return;
}
if (!Guid.TryParse(customerOrgIdStr, out _importCustomerOrgId))
{
throw new Exception("单位编号不正确");
}
if (string.IsNullOrWhiteSpace(_hospitalId))
{
throw new Exception("HospitalId参数不能为空");
@ -411,6 +408,7 @@ namespace Shentun.Peis.PlugIns.Extensions.PatientRegisters.Qztl
{
throw new Exception("_aesKEY参数不能为空");
}
Guid customerOrgId;
using (DbConnection conn = new NpgsqlConnection(AppConnctionStr))
{
string sql;
@ -424,7 +422,7 @@ namespace Shentun.Peis.PlugIns.Extensions.PatientRegisters.Qztl
customer_org_register.id = @CustomerOrgRegisterId
";
var customerOrgForPlugInss = (await conn.QueryAsync<CustomerOrgForPlugIns>(sql,
new { CustomerOrgRegisterId = _customerOrgRegisterId })).FirstOrDefault();
new { CustomerOrgRegisterId = CustomerOrgRegisterId })).FirstOrDefault();
if (customerOrgForPlugInss == null)
{
@ -444,19 +442,19 @@ namespace Shentun.Peis.PlugIns.Extensions.PatientRegisters.Qztl
}
_year = year;
_importCustomerOrgId = customerOrgForPlugInss.CustomerOrgId;
customerOrgId = customerOrgForPlugInss.CustomerOrgId;
}
//加载单位信息
_customerOrgDto = await CallAppServiceAsync<CustomerOrgIdInputDto, CustomerOrgDto>(
"api/app/CustomerOrg/GetById", new CustomerOrgIdInputDto()
{
CustomerOrgId = _importCustomerOrgId,
CustomerOrgId = customerOrgId,
});
//加载单位登记信息
_customerOrgRegisterDto = await CallAppServiceAsync<CustomerOrgRegisterIdInputDto, CustomerOrgRegisterDto>(
"api/app/CustomerOrgRegister/GetById", new CustomerOrgRegisterIdInputDto()
{
CustomerOrgRegisterId = _customerOrgRegisterId,
CustomerOrgRegisterId = CustomerOrgRegisterId,
});
//加载人员类别列表
_personnelTypes = await CallAppServiceAsync<string, List<PersonnelTypeDto>>("api/app/PersonnelType/GetAll", "");
@ -726,9 +724,9 @@ namespace Shentun.Peis.PlugIns.Extensions.PatientRegisters.Qztl
groupName += sexName;
}
_customerOrgGroupDtos = await CallAppServiceAsync<Guid, List<CustomerOrgGroupDto>>(
"api/app/customer-org-group/in-customer-org-id/" + _importCustomerOrgId.ToString()
, Guid.Empty, "get");
_customerOrgGroupDtos = await CallAppServiceAsync<CustomerOrgRegisterIdInputDto, List<CustomerOrgGroupDto>>(
"api/app/CustomerOrgGroup/GetListByCustomerOrgRegisterId"
, new CustomerOrgRegisterIdInputDto() { CustomerOrgRegisterId = CustomerOrgRegisterId});
var customerOrgGroup = _customerOrgGroupDtos.Where(o => o.DisplayName == groupName).FirstOrDefault();
if (customerOrgGroup != null)
{
@ -741,7 +739,7 @@ namespace Shentun.Peis.PlugIns.Extensions.PatientRegisters.Qztl
var createCustomerOrgGroupWithDetailDto = new CreateCustomerOrgGroupWithDetailDto()
{
IsMaxMedicalTimes = 'Y',
CustomerOrgId = _importCustomerOrgId,
CustomerOrgId = _customerOrgDto.Id,
DisplayName = groupName,
ForSexId = sexId,
AgeLowerLimit = 0,
@ -766,9 +764,9 @@ namespace Shentun.Peis.PlugIns.Extensions.PatientRegisters.Qztl
existGroupName = goupNames[i];
}
_customerOrgGroupDtos = await CallAppServiceAsync<Guid, List<CustomerOrgGroupDto>>(
"api/app/customerorgregister/getlistincustomerorgid?CustomerOrgId=" + _importCustomerOrgId.ToString()
, Guid.Empty, "get");
_customerOrgGroupDtos = await CallAppServiceAsync<CustomerOrgRegisterIdInputDto, List<CustomerOrgGroupDto>>(
"api/app/CustomerOrgGroup/GetListByCustomerOrgRegisterId"
, new CustomerOrgRegisterIdInputDto() { CustomerOrgRegisterId = CustomerOrgRegisterId});
customerOrgGroup = _customerOrgGroupDtos.Where(o => o.DisplayName == existGroupName).FirstOrDefault();
if (customerOrgGroup == null)
{

2
ThirdPlugIns/Shentun.Peis.PlugIns.Gem/test/Shentun.Peis.PlugIns.Gem.Test/ImportPatientRegisterPlugInsHzcyTest.cs

@ -27,7 +27,7 @@ namespace Shentun.Peis.PlugIns.Extensions.Test
configParm = File.ReadAllText(filePath);
var input = new ImportPatientRegisterPlugInsQztl(new Guid("7f2b453c-e45c-44bf-ba6b-9ef192a3cf88"));
var errorList = await input.ImportAsync(new Guid("3a126b36-b71a-e626-e8be-17d47216f927"));
var errorList = await input.ImportPatientRegisterByCustomerOrgRegisterIdAsync(new Guid("3a126b36-b71a-e626-e8be-17d47216f927"));
foreach ( var item in errorList )
{
_output.WriteLine(item);

31
src/Shentun.ColumnReferencePlugIns/PatientRegisters/ImportPatientRegisterPlugInsBase.cs

@ -8,6 +8,7 @@ namespace Shentun.Peis.PlugIns.PatientRegisters
{
public class ImportPatientRegisterPlugInsBase : ThirdPlugInsBase
{
protected Guid CustomerOrgRegisterId;
public ImportPatientRegisterPlugInsBase(Guid thirdInterfaceId) : base(thirdInterfaceId)
{
@ -16,9 +17,37 @@ namespace Shentun.Peis.PlugIns.PatientRegisters
{
}
public virtual async Task<List<string>> ImportAsync(Guid customerOrgRegisterId)
public virtual async Task<List<string>> ImportPatientRegisterByCustomerOrgRegisterIdAsync(Guid customerOrgRegisterId)
{
throw new NotImplementedException();
}
public override Task DoWork()
{
//var loginResult = LoginAsync().Result;
var queryDaysStr = InterfaceConfig.GetSection("Interface").GetSection("Scheduler").GetSection("QueryDays").Value;
var customerOrgRegisterIdStr = InterfaceConfig.GetSection("Interface").GetSection("CustomerOrgRegisterId").Value;
if(!Guid.TryParse(customerOrgRegisterIdStr, out CustomerOrgRegisterId))
{
return Task.CompletedTask;
}
if (string.IsNullOrWhiteSpace(queryDaysStr))
{
queryDaysStr = "1";
}
if (!int.TryParse(queryDaysStr, out int days))
{
days = 1;
}
try
{
var result = ImportPatientRegisterByCustomerOrgRegisterIdAsync(CustomerOrgRegisterId).Result;
}
catch (Exception ex)
{
}
return Task.CompletedTask;
}
}
}

34
src/Shentun.Peis.Application/CustomerOrgGroups/CustomerOrgGroupAppService.cs

@ -408,8 +408,42 @@ namespace Shentun.Peis.CustomerOrgGroups
}
return new List<CustomerOrgGroupDto>();
}
/// <summary>
/// 获取体检分组列表 按单位登记ID
/// </summary>
/// <param name="input"></param>
/// <returns></returns>
[HttpPut("api/app/CustomerOrgGroup/GetListByCustomerOrgRegisterId")]
public async Task<List<CustomerOrgGroupDto>> GetListByCustomerOrgRegisterIdAsync(CustomerOrgRegisterIdInputDto input)
{
var entlist = await Repository.GetListAsync(m => m.CustomerOrgRegisterId == input.CustomerOrgRegisterId);
var entdto = entlist.Select(s => new CustomerOrgGroupDto
{
CreationTime = s.CreationTime,
CreatorId = s.CreatorId,
DisplayName = s.DisplayName,
DisplayOrder = s.DisplayOrder,
Id = s.Id,
LastModificationTime = s.LastModificationTime,
LastModifierId = s.LastModifierId,
Price = s.Price,
ForSexId = s.ForSexId,
Remark = s.Remark,
MaritalStatusId = s.MaritalStatusId,
JobTitle = s.JobTitle,
JobPost = s.JobPost,
AgeUpperLimit = s.AgeUpperLimit,
AgeLowerLimit = s.AgeLowerLimit,
CreatorName = _cacheService.GetSurnameAsync(s.CreatorId).Result,
LastModifierName = _cacheService.GetSurnameAsync(s.LastModifierId).Result,
CustomerOrgRegisterId = input.CustomerOrgRegisterId
}).ToList();
return entdto;
return new List<CustomerOrgGroupDto>();
}
/// <summary>
/// 复制上次分组
/// </summary>

Loading…
Cancel
Save