DESKTOP-G961P6V\Zhh 1 year ago
parent
commit
d58089734c
  1. 14
      src/Shentun.Peis.Application.Contracts/MyUser/IdentityUserCreateNoEmailDto.cs
  2. 6
      src/Shentun.Peis.Application.Contracts/MyUser/IdentityUserUpdateInputDto.cs
  3. 6
      src/Shentun.Peis.Application.Contracts/MyUser/IdentityUserWithExtensionDto.cs
  4. 31
      src/Shentun.Peis.Application.Contracts/MyUser/ListByOperatorTypeDto.cs
  5. 14
      src/Shentun.Peis.Application.Contracts/MyUser/OperatorTypeIuputDto.cs
  6. 32
      src/Shentun.Peis.Application/MyUser/MyUserAppService.cs
  7. 36
      src/Shentun.Peis.Domain.Shared/Enums/UserOperatorTypeFlag.cs
  8. 10
      src/Shentun.Peis.EntityFrameworkCore/EntityFrameworkCore/PeisEfCoreEntityExtensionMappings.cs
  9. 14286
      src/Shentun.Peis.EntityFrameworkCore/Migrations/20240515100759_init20240515001.Designer.cs
  10. 27
      src/Shentun.Peis.EntityFrameworkCore/Migrations/20240515100759_init20240515001.cs
  11. 6
      src/Shentun.Peis.EntityFrameworkCore/Migrations/PeisDbContextModelSnapshot.cs
  12. 11
      src/Shentun.Peis.HttpApi.Host/PeisHttpApiHostModule.cs

14
src/Shentun.Peis.Application.Contracts/MyUser/IdentityUserCreateNoEmailDto.cs

@ -1,4 +1,5 @@
using System;
using Shentun.Peis.Enums;
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.Text;
@ -11,9 +12,9 @@ namespace Shentun.Peis.MyUser
public class IdentityUserCreateNoEmailDto
{
/// <summary>
/// 账号
/// </summary>
/// <summary>
/// 账号
/// </summary>
public string UserName { get; set; }
public string Name { get; set; }
@ -60,5 +61,10 @@ namespace Shentun.Peis.MyUser
/// 照片
/// </summary>
public string UserPhoto { get; set; }
/// <summary>
/// 用户操作类别 0-操作员,1-医生,2-总检医生,3-医生和总检医生
/// </summary>
public char OperatorType { get; set; } = UserOperatorTypeFlag.Operator;
}
}

6
src/Shentun.Peis.Application.Contracts/MyUser/IdentityUserUpdateInputDto.cs

@ -17,5 +17,11 @@ namespace Shentun.Peis.MyUser
/// 照片
/// </summary>
public string UserPhoto { get; set; }
/// <summary>
/// 用户操作类别 0-操作员,1-医生,2-总检医生,3-医生和总检医生
/// </summary>
public char OperatorType { get; set; }
}
}

6
src/Shentun.Peis.Application.Contracts/MyUser/IdentityUserWithExtensionDto.cs

@ -17,6 +17,12 @@ namespace Shentun.Peis.MyUser
/// </summary>
public string UserPhoto { get; set; }
/// <summary>
/// 用户操作类别 0-操作员,1-医生,2-总检医生,3-医生和总检医生
/// </summary>
public char OperatorType { get; set; }
/// <summary>
/// 快捷码
/// </summary>

31
src/Shentun.Peis.Application.Contracts/MyUser/ListByOperatorTypeDto.cs

@ -0,0 +1,31 @@
using System;
using System.Collections.Generic;
using System.Text;
namespace Shentun.Peis.MyUser
{
public class ListByOperatorTypeDto
{
/// <summary>
/// ID
/// </summary>
public Guid Id { get; set; }
/// <summary>
/// 账号
/// </summary>
public string UserName { get; set; }
/// <summary>
/// 姓名
/// </summary>
public string Surname { get; set; }
/// <summary>
/// 快捷码
/// </summary>
public string SimpleCode { get; set; }
}
}

14
src/Shentun.Peis.Application.Contracts/MyUser/OperatorTypeIuputDto.cs

@ -0,0 +1,14 @@
using System;
using System.Collections.Generic;
using System.Text;
namespace Shentun.Peis.MyUser
{
public class OperatorTypeIuputDto
{
/// <summary>
/// 用户操作类别集合 0-操作员,1-医生,2-总检医生,3-医生和总检医生
/// </summary>
public List<char> OperatorTypes { get; set; }
}
}

32
src/Shentun.Peis.Application/MyUser/MyUserAppService.cs

@ -8,6 +8,7 @@ using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.Options;
using Newtonsoft.Json;
using NPOI.SS.Formula.Functions;
using NPOI.SS.UserModel;
using Shentun.Peis.Models;
using Shentun.Peis.MyUser;
using Shentun.Peis.OrganizationUnits;
@ -15,6 +16,7 @@ using Shentun.Peis.Permissions;
using Shentun.Peis.RegisterCheckPictures;
using Shentun.Peis.Sexs;
using Shentun.Utilities;
using SqlSugar;
using System;
using System.Collections.Generic;
using System.Linq;
@ -209,6 +211,7 @@ namespace Shentun.Peis.MyUser
user.SetProperty("user_photo", input.UserPhoto);
user.SetProperty("user_sign", input.UserSign);
user.SetProperty("operator_type", input.OperatorType);
newinput.MapExtraPropertiesTo(user);
@ -270,6 +273,7 @@ namespace Shentun.Peis.MyUser
{
UserSign = s.GetProperty<string>("user_sign"),
UserPhoto = s.GetProperty<string>("user_photo"),
OperatorType = s.GetProperty<char>("operator_type"),
ConcurrencyStamp = s.ConcurrencyStamp,
CreationTime = s.CreationTime,
CreatorId = s.CreatorId,
@ -292,11 +296,34 @@ namespace Shentun.Peis.MyUser
UserName = s.UserName,
OrganizationUnitId = OrganizationUnitId,
SimpleCode = LanguageConverter.GetPYSimpleCode(s.Surname)
}).ToList();
// var entlistdto = ObjectMapper.Map<List<IdentityUser>, List<IdentityUserDto>>(entlist);
return entlistdto;
}
/// <summary>
/// 获取列表 根据用户类别
/// </summary>
/// <param name="input"></param>
/// <returns></returns>
[Authorize(PeisPermissions.Users.Default)]
[HttpPost("api/identity/users/GetListByOperatorType")]
public async Task<List<ListByOperatorTypeDto>> GetListByOperatorTypeAsync(OperatorTypeIuputDto input)
{
var entlist = await _identityUserRepository.GetListAsync(m => m.IsDeleted == false);
var entlistDto = entlist.Where(m => input.OperatorTypes.Contains(m.GetProperty<char>("operator_type"))).Select(s => new ListByOperatorTypeDto
{
Id = s.Id,
SimpleCode = LanguageConverter.GetPYSimpleCode(s.Surname),
Surname = s.Surname,
UserName = s.UserName
}).ToList();
return entlistDto;
}
/// <summary>
/// 修改用户信息
/// </summary>
@ -333,7 +360,7 @@ namespace Shentun.Peis.MyUser
user.SetProperty("user_sign", input.UserSign);
user.SetProperty("user_photo", input.UserPhoto);
user.SetProperty("operator_type", input.OperatorType);
user.SetConcurrencyStampIfNotNull(input.ConcurrencyStamp);
(await UserManager.SetUserNameAsync(user, input.UserName)).CheckErrors();
@ -446,10 +473,11 @@ namespace Shentun.Peis.MyUser
var ent = await UserManager.GetByIdAsync(id);
var userSign = ent.GetProperty<string>("user_sign");
var userPhoto = ent.GetProperty<string>("user_photo");
var operatorType = ent.GetProperty<char>("operator_type");
var entDto = ObjectMapper.Map<IdentityUser, IdentityUserWithExtensionDto>(ent);
entDto.UserPhoto = userPhoto;
entDto.UserSign = userSign;
entDto.OperatorType = operatorType;
return entDto;
}

36
src/Shentun.Peis.Domain.Shared/Enums/UserOperatorTypeFlag.cs

@ -0,0 +1,36 @@
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Text;
namespace Shentun.Peis.Enums
{
public static class UserOperatorTypeFlag
{
/// <summary>
/// 操作员
/// </summary>
[Description("操作员")]
public const char Operator = '0';
/// <summary>
/// 医生
/// </summary>
[Description("医生")]
public const char Doctor = '1';
/// <summary>
/// 总检医生
/// </summary>
[Description("总检医生")]
public const char SumDoctor = '2';
/// <summary>
/// 医生和总检医生
/// </summary>
[Description("医生和总检医生")]
public const char DoctorAndSumDoctor = '3';
}
}

10
src/Shentun.Peis.EntityFrameworkCore/EntityFrameworkCore/PeisEfCoreEntityExtensionMappings.cs

@ -82,6 +82,16 @@ public static class PeisEfCoreEntityExtensionMappings
}
);
ObjectExtensionManager.Instance
.MapEfCoreProperty<IdentityUser, char>(
"operator_type",
(entityBuilder, propertyBuilder) =>
{
propertyBuilder.HasMaxLength(1);
propertyBuilder.HasDefaultValueSql("'0'");
}
);
//ObjectExtensionManager.Instance
//.MapEfCoreEntity<IdentityUser>(entityBuilder =>

14286
src/Shentun.Peis.EntityFrameworkCore/Migrations/20240515100759_init20240515001.Designer.cs
File diff suppressed because it is too large
View File

27
src/Shentun.Peis.EntityFrameworkCore/Migrations/20240515100759_init20240515001.cs

@ -0,0 +1,27 @@
using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
namespace Shentun.Peis.Migrations
{
public partial class init20240515001 : Migration
{
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.AddColumn<char>(
name: "operator_type",
table: "abp_users",
type: "character(1)",
maxLength: 1,
nullable: false,
defaultValueSql: "'0'");
}
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropColumn(
name: "operator_type",
table: "abp_users");
}
}
}

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

@ -11647,6 +11647,12 @@ namespace Shentun.Peis.Migrations
.HasColumnType("character varying(256)")
.HasColumnName("user_name");
b.Property<char>("operator_type")
.ValueGeneratedOnAdd()
.HasMaxLength(1)
.HasColumnType("character(1)")
.HasDefaultValueSql("'0'");
b.Property<string>("user_photo")
.HasMaxLength(200)
.HasColumnType("character varying(200)");

11
src/Shentun.Peis.HttpApi.Host/PeisHttpApiHostModule.cs

@ -75,8 +75,8 @@ namespace Shentun.Peis;
typeof(AbpAspNetCoreMvcUiLeptonXLiteThemeModule),
typeof(AbpAccountWebOpenIddictModule),
typeof(AbpAspNetCoreSerilogModule),
typeof(AbpSwashbuckleModule)
//typeof(AbpBackgroundWorkersHangfireModule)
typeof(AbpSwashbuckleModule),
typeof(AbpBackgroundWorkersHangfireModule)
)]
public class PeisHttpApiHostModule : AbpModule
{
@ -219,7 +219,7 @@ public class PeisHttpApiHostModule : AbpModule
*/
//后台计划任务
//ConfigureHangfire(context, configuration);
ConfigureHangfire(context, configuration);
}
/// <summary>
@ -485,7 +485,8 @@ public class PeisHttpApiHostModule : AbpModule
app.UseErrorPage();
}
app.UseHangfireDashboard();
app.UseCorrelationId();
@ -578,7 +579,7 @@ public class PeisHttpApiHostModule : AbpModule
app.UseConfiguredEndpoints();
//任务计划
//await StartScheduler(context);
await StartScheduler(context);
}
private async Task StartScheduler(ApplicationInitializationContext context)

Loading…
Cancel
Save