Browse Source

单号

bjmzak
wxd 1 year ago
parent
commit
0b04337afb
  1. 7
      src/Shentun.Peis.Domain/LisRequests/LisRequestManager.cs
  2. 8
      src/Shentun.Peis.Domain/PatientRegisters/PatientRegisterManager.cs
  3. 7
      src/Shentun.Peis.Domain/RegisterChecks/RegisterCheckManager.cs
  4. 1
      src/Shentun.Peis.EntityFrameworkCore/DbMapping/PrimarykeyBuilders/PrimarykeyBuilderDbMapping.cs
  5. 14272
      src/Shentun.Peis.EntityFrameworkCore/Migrations/20240512114415_init20240502002.Designer.cs
  6. 43
      src/Shentun.Peis.EntityFrameworkCore/Migrations/20240512114415_init20240502002.cs
  7. 3
      src/Shentun.Peis.EntityFrameworkCore/Migrations/PeisDbContextModelSnapshot.cs
  8. 25
      test/Shentun.Peis.Domain.Tests/RegisterCheckAsbitemManagerTest.cs

7
src/Shentun.Peis.Domain/LisRequests/LisRequestManager.cs

@ -426,9 +426,14 @@ namespace Shentun.Peis.LisRequests
{
//新的日期 为1 maxnum
primarykeyBuilderEnt.DateString = date;
maxnum = "1";
}
else
{
maxnum = (Convert.ToInt32(primarykeyBuilderEnt.SerialNo) + 1).ToString();
}
maxnum = (Convert.ToInt32(primarykeyBuilderEnt.SerialNo) + 1).ToString();
primarykeyBuilderEnt.SerialNo = maxnum; //更新新的序列号
LisRequestNo = lis_request_no_rule_prefix + date + maxnum.PadLeft(Convert.ToInt32(lis_request_no_rule_tail_len), '0');

8
src/Shentun.Peis.Domain/PatientRegisters/PatientRegisterManager.cs

@ -823,9 +823,13 @@ namespace Shentun.Peis.PatientRegisters
{
//新的日期 为1 maxnum
primarykeyBuilderEnt.DateString = date;
maxnum = "1";
}
maxnum = (Convert.ToInt32(primarykeyBuilderEnt.SerialNo) + 1).ToString();
else
{
maxnum = (Convert.ToInt32(primarykeyBuilderEnt.SerialNo) + 1).ToString();
}
primarykeyBuilderEnt.SerialNo = maxnum; //更新新的序列号
PatientRegisterNo = patient_register_no_rule_prefix + date + maxnum.PadLeft(Convert.ToInt32(patient_register_no_rule_tail_len), '0');

7
src/Shentun.Peis.Domain/RegisterChecks/RegisterCheckManager.cs

@ -524,9 +524,14 @@ namespace Shentun.Peis.RegisterChecks
{
//新的日期 为1 maxnum
primarykeyBuilderEnt.DateString = date;
maxnum = "1";
}
else
{
maxnum = (Convert.ToInt32(primarykeyBuilderEnt.SerialNo) + 1).ToString();
}
maxnum = (Convert.ToInt32(primarykeyBuilderEnt.SerialNo) + 1).ToString();
primarykeyBuilderEnt.SerialNo = maxnum; //更新新的序列号
CheckRequestNo = check_request_no_rule_prefix + date + maxnum.PadLeft(Convert.ToInt32(check_request_no_rule_tail_len), '0');

1
src/Shentun.Peis.EntityFrameworkCore/DbMapping/PrimarykeyBuilders/PrimarykeyBuilderDbMapping.cs

@ -21,7 +21,6 @@ namespace Shentun.Peis.DbMapping
//entity.Property(e => e.Id).HasComment("主键编号");
entity.Property(e => e.DateString)
.IsFixedLength()
.HasComment("日期");
entity.Property(e => e.SerialNo).HasComment("序列号");

14272
src/Shentun.Peis.EntityFrameworkCore/Migrations/20240512114415_init20240502002.Designer.cs
File diff suppressed because it is too large
View File

43
src/Shentun.Peis.EntityFrameworkCore/Migrations/20240512114415_init20240502002.cs

@ -0,0 +1,43 @@
using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
namespace Shentun.Peis.Migrations
{
public partial class init20240502002 : Migration
{
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.AlterColumn<string>(
name: "date_string",
table: "primarykey_builder",
type: "character varying(8)",
maxLength: 8,
nullable: true,
comment: "日期",
oldClrType: typeof(string),
oldType: "character(8)",
oldFixedLength: true,
oldMaxLength: 8,
oldNullable: true,
oldComment: "日期");
}
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.AlterColumn<string>(
name: "date_string",
table: "primarykey_builder",
type: "character(8)",
fixedLength: true,
maxLength: 8,
nullable: true,
comment: "日期",
oldClrType: typeof(string),
oldType: "character varying(8)",
oldMaxLength: 8,
oldNullable: true,
oldComment: "日期");
}
}
}

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

@ -7428,9 +7428,8 @@ namespace Shentun.Peis.Migrations
b.Property<string>("DateString")
.HasMaxLength(8)
.HasColumnType("character(8)")
.HasColumnType("character varying(8)")
.HasColumnName("date_string")
.IsFixedLength()
.HasComment("日期");
b.Property<DateTime?>("LastModificationTime")

25
test/Shentun.Peis.Domain.Tests/RegisterCheckAsbitemManagerTest.cs

@ -1,7 +1,9 @@
using Shentun.Peis.Enums;
using Shentun.Peis.GuidTypes;
using Shentun.Peis.LisRequests;
using Shentun.Peis.Models;
using Shentun.Peis.RegisterAsbitems;
using Shentun.Peis.RegisterChecks;
using System;
using System.Collections.Generic;
using System.Linq;
@ -22,6 +24,8 @@ namespace Shentun.Peis
private readonly IRepository<RegisterCheckItem> _registerCheckItemRepository;
private readonly RegisterCheckAsbitemManager _manager;
private readonly RegisterCheckManager _registerCheckManager;
private readonly ITestOutputHelper _output;
private readonly IUnitOfWorkManager _unitOfWorkManager;
public RegisterCheckAsbitemManagerTest(ITestOutputHelper output)
@ -34,7 +38,8 @@ namespace Shentun.Peis
_manager = GetRequiredService<RegisterCheckAsbitemManager>();
_registerCheckManager = GetRequiredService<RegisterCheckManager>();
_unitOfWorkManager = GetRequiredService<IUnitOfWorkManager>();
}
@ -92,5 +97,23 @@ namespace Shentun.Peis
}
}
/// <summary>
///
/// </summary>
/// <returns></returns>
[Fact]
public async Task CreateCheckRequerstNoAsync()
{
using (var unitOfWork = _unitOfWorkManager.Begin())
{
Guid OrganizationUnitId = Guid.Parse("0de5b78a-731d-4f80-b262-655ebbf04581");
string ff = await _registerCheckManager.CreateCheckRequestNo(OrganizationUnitId);
await unitOfWork.CompleteAsync();
}
}
}
}
Loading…
Cancel
Save