18 changed files with 32618 additions and 73 deletions
-
16src/Shentun.Peis.Application.Contracts/CustomerOrgGroups/CustomerOrgGroupSimpleDto.cs
-
18src/Shentun.Peis.Application.Contracts/ThirdBookingPushs/DecryptBaseDto.cs
-
73src/Shentun.Peis.Application.Contracts/ThirdBookingPushs/PushMedicalReportInputDto.cs
-
19src/Shentun.Peis.Application.Contracts/ThirdBookingPushs/PushReportDecryptDto.cs
-
20src/Shentun.Peis.Application.Contracts/ThirdBookingPushs/PushReportFileInputDto.cs
-
306src/Shentun.Peis.Application/ThirdBookingPushs/ThirdBookingPushAppService.cs
-
6src/Shentun.Peis.Application/ThirdBookings/ThirdBookingAppService.cs
-
52src/Shentun.Peis.Application/ThirdMedicalCenters/ThirdMedicalCenterAppService.cs
-
119src/Shentun.Peis.Domain/AesHelper.cs
-
2src/Shentun.Peis.Domain/PatientRegisters/PatientRegister.cs
-
2src/Shentun.Peis.Domain/ThirdBookings/ThirdBooking.cs
-
2src/Shentun.Peis.Domain/ThirdInterfaces/ThirdInterface.cs
-
70src/Shentun.Peis.Domain/newRsaHelper.cs
-
15959src/Shentun.Peis.EntityFrameworkCore/Migrations/20240928015112_update_third_interface_parm_value_length.Designer.cs
-
37src/Shentun.Peis.EntityFrameworkCore/Migrations/20240928015112_update_third_interface_parm_value_length.cs
-
15959src/Shentun.Peis.EntityFrameworkCore/Migrations/20240928035619_update_patient_register_zimu.Designer.cs
-
25src/Shentun.Peis.EntityFrameworkCore/Migrations/20240928035619_update_patient_register_zimu.cs
-
6src/Shentun.Peis.EntityFrameworkCore/Migrations/PeisDbContextModelSnapshot.cs
@ -0,0 +1,16 @@ |
|||
using System; |
|||
using System.Collections.Generic; |
|||
using System.Text; |
|||
|
|||
namespace Shentun.Peis.CustomerOrgGroups |
|||
{ |
|||
public class CustomerOrgGroupSimpleDto |
|||
{ |
|||
public Guid Id { get; set; } |
|||
|
|||
/// <summary>
|
|||
/// 分组名称
|
|||
/// </summary>
|
|||
public string DisplayName { get; set; } |
|||
} |
|||
} |
|||
@ -0,0 +1,18 @@ |
|||
using System; |
|||
using System.Collections.Generic; |
|||
using System.Text; |
|||
|
|||
namespace Shentun.Peis.ThirdBookingPushs |
|||
{ |
|||
public class DecryptBaseDto |
|||
{ |
|||
/// <summary>
|
|||
/// 0:接收成功
|
|||
/// 1:(体检预约类型:体检人员信息匹配失败、上门体检类型:信息已接收,不可变更)
|
|||
/// 2:系统异常
|
|||
/// </summary>
|
|||
public int STATUS { get; set; } |
|||
|
|||
public string MESSAGE { get; set; } |
|||
} |
|||
} |
|||
@ -0,0 +1,73 @@ |
|||
using System; |
|||
using System.Collections.Generic; |
|||
using System.Text; |
|||
|
|||
namespace Shentun.Peis.ThirdBookingPushs |
|||
{ |
|||
public class PushMedicalReportInputDto |
|||
{ |
|||
/// <summary>
|
|||
/// 体检年度
|
|||
/// </summary>
|
|||
public string YEAR { get; set; } |
|||
|
|||
/// <summary>
|
|||
/// 客户来源
|
|||
/// </summary>
|
|||
public string SOURCE { get; set; } |
|||
|
|||
/// <summary>
|
|||
/// 体检机构
|
|||
/// </summary>
|
|||
public string ORGCODE { get; set; } |
|||
|
|||
/// <summary>
|
|||
/// 第三方报告ID
|
|||
/// </summary>
|
|||
public string BUSINESSID { get; set; } |
|||
|
|||
/// <summary>
|
|||
/// 姓名
|
|||
/// </summary>
|
|||
public string NAME { get; set; } |
|||
|
|||
/// <summary>
|
|||
/// 证件类型
|
|||
/// </summary>
|
|||
public string IDTYPE { get; set; } |
|||
|
|||
/// <summary>
|
|||
/// 证件号
|
|||
/// </summary>
|
|||
public string IDNO { get; set; } |
|||
|
|||
|
|||
|
|||
/// <summary>
|
|||
/// 体检套餐编码
|
|||
/// </summary>
|
|||
public string EXAMPACKAGECODE { get; set; } |
|||
|
|||
|
|||
/// <summary>
|
|||
/// 推送时间
|
|||
/// </summary>
|
|||
public string PUSHTIME { get; set; } |
|||
|
|||
/// <summary>
|
|||
/// 体检报告pdf文件base64
|
|||
/// </summary>
|
|||
public string PDFBASE64 { get; set; } |
|||
|
|||
/// <summary>
|
|||
/// 体检报告pdf文件ID
|
|||
/// </summary>
|
|||
public string PDFFILEID { get; set; } |
|||
|
|||
/// <summary>
|
|||
/// 体检报告json数据
|
|||
/// </summary>
|
|||
public string JSONBASE64 { get; set; } |
|||
|
|||
} |
|||
} |
|||
@ -0,0 +1,19 @@ |
|||
using System; |
|||
using System.Collections.Generic; |
|||
using System.Text; |
|||
|
|||
namespace Shentun.Peis.ThirdBookingPushs |
|||
{ |
|||
public class PushReportDecryptDto |
|||
{ |
|||
/// <summary>
|
|||
/// 接口调用状态
|
|||
/// </summary>
|
|||
public bool FLAG { get; set; } |
|||
|
|||
/// <summary>
|
|||
/// 接口调用结果信息
|
|||
/// </summary>
|
|||
public string MESSAGE { get; set; } |
|||
} |
|||
} |
|||
@ -0,0 +1,20 @@ |
|||
using System; |
|||
using System.Collections.Generic; |
|||
using System.Text; |
|||
|
|||
namespace Shentun.Peis.ThirdBookingPushs |
|||
{ |
|||
public class PushReportFileInputDto |
|||
{ |
|||
/// <summary>
|
|||
/// 人员id
|
|||
/// </summary>
|
|||
public Guid PatientRegisterId { get; set; } |
|||
|
|||
/// <summary>
|
|||
/// 报告base64
|
|||
/// </summary>
|
|||
public string ReportBase64 { get; set; } |
|||
|
|||
} |
|||
} |
|||
@ -0,0 +1,119 @@ |
|||
using Microsoft.EntityFrameworkCore.Metadata.Internal; |
|||
using System; |
|||
using System.Collections.Generic; |
|||
using System.Linq; |
|||
using System.Text; |
|||
using System.Threading.Tasks; |
|||
using System.Security.Cryptography; |
|||
using System.IO; |
|||
using Org.BouncyCastle.Crypto.Parameters; |
|||
using Org.BouncyCastle.Crypto; |
|||
using Org.BouncyCastle.Security; |
|||
using Org.BouncyCastle.Utilities; |
|||
|
|||
namespace Shentun.Peis |
|||
{ |
|||
public class AesHelper |
|||
{ |
|||
private static readonly byte[] Key = Encoding.UTF8.GetBytes("1234567812345678"); // 16字节密钥
|
|||
private static readonly byte[] Iv = Encoding.UTF8.GetBytes("1234567812345678"); // 16字节初始化向量
|
|||
|
|||
/// <summary>
|
|||
/// MD5加密
|
|||
/// </summary>
|
|||
/// <param name="input"></param>
|
|||
/// <returns></returns>
|
|||
public static string GetMD5Hash(string input) |
|||
{ |
|||
using (MD5 md5 = MD5.Create()) |
|||
{ |
|||
byte[] inputBytes = Encoding.UTF8.GetBytes(input); |
|||
byte[] hashBytes = md5.ComputeHash(inputBytes); |
|||
|
|||
// Convert byte array to a hexadecimal string
|
|||
StringBuilder sb = new StringBuilder(); |
|||
for (int i = 0; i < hashBytes.Length; i++) |
|||
{ |
|||
sb.Append(hashBytes[i].ToString("x2")); |
|||
} |
|||
return sb.ToString(); |
|||
} |
|||
} |
|||
|
|||
/// <summary>
|
|||
/// 解密
|
|||
/// </summary>
|
|||
/// <param name="strinput"></param>
|
|||
/// <param name="strkey"></param>
|
|||
/// <returns></returns>
|
|||
public static string AESDecrypt(string strinput, string strkey) |
|||
{ |
|||
try |
|||
{ |
|||
//string dummyData = strinput.Trim().Replace("%", "").Replace(",", "").Replace(" ", "+").Replace("_", "/").Replace("-", "+");
|
|||
//if (dummyData.Length % 4 > 0)
|
|||
//{
|
|||
// dummyData = dummyData.PadRight(dummyData.Length + 4 - dummyData.Length % 4, '=');
|
|||
//}
|
|||
byte[] inputArray = Convert.FromBase64String(strinput); |
|||
byte[] key = Encoding.UTF8.GetBytes(strkey); |
|||
|
|||
IBufferedCipher cipher = CipherUtilities.GetCipher("AES/ECB/PKCS5Padding"); |
|||
|
|||
cipher.Init(false, AesKey(strkey)); |
|||
// cipher.Init(false, new ParametersWithIV(new DesParameters(key), key)); 带IV向量的算法可以用到。
|
|||
byte[] rv = new byte[cipher.GetOutputSize(inputArray.Length)]; |
|||
int tam = cipher.ProcessBytes(inputArray, 0, inputArray.Length, rv, 0); |
|||
cipher.DoFinal(rv, tam); |
|||
return Encoding.UTF8.GetString(rv); |
|||
|
|||
} |
|||
catch (Exception ex) |
|||
{ |
|||
|
|||
return ""; |
|||
|
|||
} |
|||
|
|||
} |
|||
|
|||
/// <summary>
|
|||
/// 加密
|
|||
/// </summary>
|
|||
/// <param name="inputArray"></param>
|
|||
/// <param name="strkey"></param>
|
|||
/// <returns></returns>
|
|||
public static string AESEncrypt(byte[] inputArray, string strkey) |
|||
{ |
|||
try |
|||
{ |
|||
//byte[] inputArray = Encoding.UTF8.GetBytes(strinput);
|
|||
byte[] key = Encoding.UTF8.GetBytes(strkey); |
|||
|
|||
IBufferedCipher cipher = CipherUtilities.GetCipher("AES/ECB/PKCS5Padding"); |
|||
//cipher.Init(true, new ParametersWithIV(new DesParameters(key), key));
|
|||
cipher.Init(true, AesKey(strkey)); |
|||
byte[] rv = new byte[cipher.GetOutputSize(inputArray.Length)]; |
|||
int tam = cipher.ProcessBytes(inputArray, 0, inputArray.Length, rv, 0); |
|||
cipher.DoFinal(rv, tam); |
|||
return Convert.ToBase64String(rv); |
|||
|
|||
} |
|||
catch (Exception ex) |
|||
{ |
|||
return ""; |
|||
} |
|||
} |
|||
|
|||
|
|||
public static KeyParameter AesKey(String key) |
|||
{ |
|||
byte[] bs = Encoding.Default.GetBytes(key); |
|||
if (bs.Length != 16) |
|||
{ |
|||
bs = Arrays.CopyOf(bs, 16);// 处理数组长度为16(不足16位,不空;超过16位取前16位)
|
|||
} |
|||
return new KeyParameter(bs); |
|||
} |
|||
} |
|||
} |
|||
15959
src/Shentun.Peis.EntityFrameworkCore/Migrations/20240928015112_update_third_interface_parm_value_length.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,37 @@ |
|||
using Microsoft.EntityFrameworkCore.Migrations; |
|||
|
|||
#nullable disable |
|||
|
|||
namespace Shentun.Peis.Migrations |
|||
{ |
|||
public partial class update_third_interface_parm_value_length : Migration |
|||
{ |
|||
protected override void Up(MigrationBuilder migrationBuilder) |
|||
{ |
|||
migrationBuilder.AlterColumn<string>( |
|||
name: "parm_value", |
|||
table: "third_interface", |
|||
type: "character varying(6000)", |
|||
maxLength: 6000, |
|||
nullable: true, |
|||
oldClrType: typeof(string), |
|||
oldType: "character varying(2000)", |
|||
oldMaxLength: 2000, |
|||
oldNullable: true); |
|||
} |
|||
|
|||
protected override void Down(MigrationBuilder migrationBuilder) |
|||
{ |
|||
migrationBuilder.AlterColumn<string>( |
|||
name: "parm_value", |
|||
table: "third_interface", |
|||
type: "character varying(2000)", |
|||
maxLength: 2000, |
|||
nullable: true, |
|||
oldClrType: typeof(string), |
|||
oldType: "character varying(6000)", |
|||
oldMaxLength: 6000, |
|||
oldNullable: true); |
|||
} |
|||
} |
|||
} |
|||
15959
src/Shentun.Peis.EntityFrameworkCore/Migrations/20240928035619_update_patient_register_zimu.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,25 @@ |
|||
using Microsoft.EntityFrameworkCore.Migrations; |
|||
|
|||
#nullable disable |
|||
|
|||
namespace Shentun.Peis.Migrations |
|||
{ |
|||
public partial class update_patient_register_zimu : Migration |
|||
{ |
|||
protected override void Up(MigrationBuilder migrationBuilder) |
|||
{ |
|||
migrationBuilder.RenameColumn( |
|||
name: "Third_Booking_Id", |
|||
table: "patient_register", |
|||
newName: "third_booking_id"); |
|||
} |
|||
|
|||
protected override void Down(MigrationBuilder migrationBuilder) |
|||
{ |
|||
migrationBuilder.RenameColumn( |
|||
name: "third_booking_id", |
|||
table: "patient_register", |
|||
newName: "Third_Booking_Id"); |
|||
} |
|||
} |
|||
} |
|||
Write
Preview
Loading…
Cancel
Save
Reference in new issue