12 changed files with 8925 additions and 5 deletions
-
32src/Shentun.WebPeis.Application.Contracts/CompanyIntroductions/BatchCreateCompanyIntroductionDto.cs
-
29src/Shentun.WebPeis.Application.Contracts/CompanyIntroductions/CompanyIntroductionDto.cs
-
11src/Shentun.WebPeis.Application.Contracts/CompanyIntroductions/CompanyIntroductionIdInputDto.cs
-
61src/Shentun.WebPeis.Application.Contracts/CompanyIntroductions/GetMiniProgramConfigureDto.cs
-
187src/Shentun.WebPeis.Application/CompanyIntroductions/CompanyIntroductionAppService.cs
-
12src/Shentun.WebPeis.Application/SysParms/SysParmAppService.cs
-
41src/Shentun.WebPeis.Domain/Models/CompanyIntroduction.cs
-
36src/Shentun.WebPeis.EntityFrameworkCore/Configures/CompanyIntroductionConfigure.cs
-
3src/Shentun.WebPeis.EntityFrameworkCore/EntityFrameworkCore/WebPeisDbContext.cs
-
8420src/Shentun.WebPeis.EntityFrameworkCore/Migrations/20251126081556_create_company_introduction.Designer.cs
-
42src/Shentun.WebPeis.EntityFrameworkCore/Migrations/20251126081556_create_company_introduction.cs
-
56src/Shentun.WebPeis.EntityFrameworkCore/Migrations/WebPeisDbContextModelSnapshot.cs
@ -0,0 +1,32 @@ |
|||
using System; |
|||
using System.Collections.Generic; |
|||
using System.Text; |
|||
|
|||
namespace Shentun.WebPeis.CompanyIntroductions |
|||
{ |
|||
public class BatchCreateCompanyIntroductionDto |
|||
{ |
|||
public List<CreateCompanyIntroductionDetail> details { get; set; } = new List<CreateCompanyIntroductionDetail>(); |
|||
} |
|||
|
|||
public class CreateCompanyIntroductionDetail |
|||
{ |
|||
/// <summary>
|
|||
/// 内容类型 0-标题 1-段落内容
|
|||
/// </summary>
|
|||
public char ContentType { get; set; } |
|||
|
|||
/// <summary>
|
|||
/// 内容
|
|||
/// </summary>
|
|||
public string Content { get; set; } |
|||
|
|||
/// <summary>
|
|||
/// 排序
|
|||
/// </summary>
|
|||
public int DisplayOrder { get; set; } |
|||
} |
|||
|
|||
|
|||
|
|||
} |
|||
@ -0,0 +1,29 @@ |
|||
using System; |
|||
using System.Collections.Generic; |
|||
using System.Text; |
|||
|
|||
namespace Shentun.WebPeis.CompanyIntroductions |
|||
{ |
|||
/// <summary>
|
|||
///
|
|||
/// </summary>
|
|||
public class CompanyIntroductionDto: AuditedEntityDtoName |
|||
{ |
|||
public Guid CompanyIntroductionId { get; set; } |
|||
|
|||
/// <summary>
|
|||
/// 内容类型 0-标题 1-段落内容
|
|||
/// </summary>
|
|||
public char ContentType { get; set; } |
|||
|
|||
/// <summary>
|
|||
/// 内容
|
|||
/// </summary>
|
|||
public string Content { get; set; } |
|||
|
|||
/// <summary>
|
|||
/// 排序
|
|||
/// </summary>
|
|||
public int DisplayOrder { get; set; } |
|||
} |
|||
} |
|||
@ -0,0 +1,11 @@ |
|||
using System; |
|||
using System.Collections.Generic; |
|||
using System.Text; |
|||
|
|||
namespace Shentun.WebPeis.CompanyIntroductions |
|||
{ |
|||
public class CompanyIntroductionIdInputDto |
|||
{ |
|||
public Guid CompanyIntroductionId { get; set; } |
|||
} |
|||
} |
|||
@ -0,0 +1,61 @@ |
|||
using System; |
|||
using System.Collections.Generic; |
|||
using System.Text; |
|||
|
|||
namespace Shentun.WebPeis.CompanyIntroductions |
|||
{ |
|||
public class GetMiniProgramConfigureDto |
|||
{ |
|||
/// <summary>
|
|||
/// 是否套餐预约 0-不开启 1-开启
|
|||
/// </summary>
|
|||
public char IsMedicalPackageAppointment { get; set; } = '0'; |
|||
|
|||
/// <summary>
|
|||
/// 是否个人预约 0-不开启 1-开启 2-带问卷开启
|
|||
/// </summary>
|
|||
public char IsPersonAppointment { get; set; } = '0'; |
|||
|
|||
|
|||
/// <summary>
|
|||
/// 是否团队预约 0-不开启 1-开启 2-带问卷开启
|
|||
/// </summary>
|
|||
public char IsTeamAppointment { get; set; } = '0'; |
|||
|
|||
/// <summary>
|
|||
/// 是否开启检后服务 0-不开启 1-开启 备注 控制健康评估报告问卷跟人员列表上的健康评估报告
|
|||
/// </summary>
|
|||
public char IsPostInspection { get; set; } = '0'; |
|||
|
|||
/// <summary>
|
|||
/// 是否开启云胶片 0-不开启 1-首页 2-报告详情页
|
|||
/// </summary>
|
|||
public char IsCloudFilm { get; set; } = '0'; |
|||
|
|||
|
|||
/// <summary>
|
|||
/// 电话
|
|||
/// </summary>
|
|||
public string TelPhone { get; set; } |
|||
|
|||
/// <summary>
|
|||
/// 地址
|
|||
/// </summary>
|
|||
public string Address { get; set; } |
|||
|
|||
/// <summary>
|
|||
/// 体检中心名称
|
|||
/// </summary>
|
|||
public string MedicalCenterName { get; set; } |
|||
|
|||
/// <summary>
|
|||
/// 机构类型
|
|||
/// </summary>
|
|||
public string InstitutionType { get; set; } |
|||
|
|||
/// <summary>
|
|||
/// Logo base64
|
|||
/// </summary>
|
|||
public string LogoBase64 { get; set; } |
|||
} |
|||
} |
|||
@ -0,0 +1,187 @@ |
|||
using Microsoft.AspNetCore.Authorization; |
|||
using Microsoft.AspNetCore.Mvc; |
|||
using Shentun.Utilities; |
|||
using Shentun.WebPeis.Models; |
|||
using Shentun.WebPeis.SysParmValues; |
|||
using System; |
|||
using System.Collections.Generic; |
|||
using System.ComponentModel.DataAnnotations.Schema; |
|||
using System.Linq; |
|||
using System.Text; |
|||
using System.Threading.Tasks; |
|||
using Volo.Abp; |
|||
using Volo.Abp.Application.Services; |
|||
using Volo.Abp.Domain.Repositories; |
|||
|
|||
namespace Shentun.WebPeis.CompanyIntroductions |
|||
{ |
|||
/// <summary>
|
|||
/// 企业信息
|
|||
/// </summary>
|
|||
[ApiExplorerSettings(GroupName = "Work")] |
|||
[Authorize] |
|||
public class CompanyIntroductionAppService : ApplicationService |
|||
{ |
|||
private readonly IRepository<CompanyIntroduction> _companyIntroductionRepository; |
|||
private readonly CacheService _cacheService; |
|||
private readonly SysParmValueManager _sysParmValueManager; |
|||
|
|||
public CompanyIntroductionAppService( |
|||
IRepository<CompanyIntroduction> companyIntroductionRepository, |
|||
CacheService cacheService, |
|||
SysParmValueManager sysParmValueManager) |
|||
{ |
|||
_companyIntroductionRepository = companyIntroductionRepository; |
|||
_cacheService = cacheService; |
|||
_sysParmValueManager = sysParmValueManager; |
|||
} |
|||
|
|||
/// <summary>
|
|||
/// 获取列表
|
|||
/// </summary>
|
|||
/// <returns></returns>
|
|||
[HttpPost("api/app/CompanyIntroduction/GetList")] |
|||
public async Task<List<CompanyIntroductionDto>> GetListAsync() |
|||
{ |
|||
var entlist = await _companyIntroductionRepository.GetQueryableAsync(); |
|||
|
|||
var entdto = entlist.ToList().Select(s => new CompanyIntroductionDto |
|||
{ |
|||
CreationTime = s.CreationTime, |
|||
CreatorId = s.CreatorId, |
|||
DisplayOrder = s.DisplayOrder, |
|||
LastModificationTime = s.LastModificationTime, |
|||
LastModifierId = s.LastModifierId, |
|||
CompanyIntroductionId = s.CompanyIntroductionId, |
|||
Content = s.Content, |
|||
ContentType = s.ContentType, |
|||
CreatorName = _cacheService.GetSurnameAsync(s.CreatorId).Result, |
|||
LastModifierName = _cacheService.GetSurnameAsync(s.LastModifierId).Result |
|||
}).OrderBy(o => o.DisplayOrder).ToList(); |
|||
|
|||
return entdto; |
|||
|
|||
|
|||
} |
|||
|
|||
|
|||
/// <summary>
|
|||
/// 获取企业信息 根据ID
|
|||
/// </summary>
|
|||
/// <param name="input"></param>
|
|||
/// <returns></returns>
|
|||
[HttpPost("api/app/CompanyIntroduction/GetCompanyIntroduction")] |
|||
[RemoteService(false)] |
|||
public async Task<CompanyIntroductionDto> GetCompanyIntroductionAsync(CompanyIntroductionIdInputDto input) |
|||
{ |
|||
var companyIntroductionEntity = await _companyIntroductionRepository.GetAsync(f => f.CompanyIntroductionId == input.CompanyIntroductionId); |
|||
var resultDto = ObjectMapper.Map<CompanyIntroduction, CompanyIntroductionDto>(companyIntroductionEntity); |
|||
resultDto.CreatorName = await _cacheService.GetSurnameAsync(resultDto.CreatorId); |
|||
resultDto.LastModifierName = await _cacheService.GetSurnameAsync(resultDto.LastModifierId); |
|||
|
|||
return resultDto; |
|||
} |
|||
|
|||
|
|||
|
|||
/// <summary>
|
|||
/// 创建
|
|||
/// </summary>
|
|||
/// <returns></returns>
|
|||
[HttpPost("api/app/CompanyIntroduction/BatchCreate")] |
|||
public async Task BatchCreateAsync(BatchCreateCompanyIntroductionDto input) |
|||
{ |
|||
var oldList = await _companyIntroductionRepository.GetListAsync(); |
|||
|
|||
await _companyIntroductionRepository.DeleteManyAsync(oldList); |
|||
|
|||
if (input.details.Any()) |
|||
{ |
|||
List<CompanyIntroduction> insertList = new List<CompanyIntroduction>(); |
|||
foreach (var item in input.details) |
|||
{ |
|||
var ent = new CompanyIntroduction |
|||
{ |
|||
CompanyIntroductionId = GuidGenerator.Create(), |
|||
Content = item.Content, |
|||
DisplayOrder = item.DisplayOrder, |
|||
ContentType = item.ContentType |
|||
}; |
|||
|
|||
insertList.Add(ent); |
|||
} |
|||
|
|||
await _companyIntroductionRepository.InsertManyAsync(insertList); |
|||
} |
|||
|
|||
|
|||
} |
|||
|
|||
|
|||
|
|||
/// <summary>
|
|||
/// 获取小程序配置
|
|||
/// </summary>
|
|||
/// <returns></returns>
|
|||
[HttpPost("api/app/CompanyIntroduction/GetMiniProgramConfigure")] |
|||
public async Task<GetMiniProgramConfigureDto> GetMiniProgramConfigureAsync() |
|||
{ |
|||
var resultDto = new GetMiniProgramConfigureDto(); |
|||
|
|||
var isMedicalPackageAppointment = await _sysParmValueManager.GetSysParmValueAsync(Guid.Empty, "is_medical_package_appointment"); |
|||
var isPersonAppointment = await _sysParmValueManager.GetSysParmValueAsync(Guid.Empty, "is_person_appointment"); |
|||
var isTeamAppointment = await _sysParmValueManager.GetSysParmValueAsync(Guid.Empty, "is_team_appointment"); |
|||
var isPostInspection = await _sysParmValueManager.GetSysParmValueAsync(Guid.Empty, "is_post_inspection"); |
|||
var isCloudFilm = await _sysParmValueManager.GetSysParmValueAsync(Guid.Empty, "is_cloud_film"); |
|||
|
|||
|
|||
if (!string.IsNullOrWhiteSpace(isMedicalPackageAppointment)) |
|||
{ |
|||
resultDto.IsMedicalPackageAppointment = Convert.ToChar(isMedicalPackageAppointment); |
|||
} |
|||
|
|||
if (!string.IsNullOrWhiteSpace(isPersonAppointment)) |
|||
{ |
|||
resultDto.IsPersonAppointment = Convert.ToChar(isPersonAppointment); |
|||
} |
|||
|
|||
if (!string.IsNullOrWhiteSpace(isTeamAppointment)) |
|||
{ |
|||
resultDto.IsTeamAppointment = Convert.ToChar(isTeamAppointment); |
|||
} |
|||
|
|||
if (!string.IsNullOrWhiteSpace(isPostInspection)) |
|||
{ |
|||
resultDto.IsPostInspection = Convert.ToChar(isPostInspection); |
|||
} |
|||
|
|||
if (!string.IsNullOrWhiteSpace(isCloudFilm)) |
|||
{ |
|||
resultDto.IsCloudFilm = Convert.ToChar(isCloudFilm); |
|||
} |
|||
|
|||
resultDto.TelPhone = await _sysParmValueManager.GetSysParmValueAsync(Guid.Empty, "medical_center_consult_telphone"); |
|||
resultDto.InstitutionType = await _sysParmValueManager.GetSysParmValueAsync(Guid.Empty, "medical_center_institution_type"); |
|||
resultDto.Address = await _sysParmValueManager.GetSysParmValueAsync(Guid.Empty, "medical_center_address"); |
|||
resultDto.MedicalCenterName = await _sysParmValueManager.GetSysParmValueAsync(Guid.Empty, "medical_center_name"); |
|||
var logoUrl = await _sysParmValueManager.GetSysParmValueAsync(Guid.Empty, "medical_center_logo"); |
|||
if (!string.IsNullOrWhiteSpace(logoUrl)) |
|||
{ |
|||
try |
|||
{ |
|||
resultDto.LogoBase64 = FileHelper.ToBase64(logoUrl); |
|||
} |
|||
catch (Exception ex) |
|||
{ |
|||
resultDto.LogoBase64 = ""; |
|||
} |
|||
} |
|||
|
|||
return resultDto; |
|||
|
|||
|
|||
} |
|||
|
|||
|
|||
} |
|||
} |
|||
@ -0,0 +1,41 @@ |
|||
using System; |
|||
using System.Collections.Generic; |
|||
using System.Linq; |
|||
using System.Text; |
|||
using System.Threading.Tasks; |
|||
using Volo.Abp.Domain.Entities.Auditing; |
|||
using Volo.Abp.Domain.Entities; |
|||
|
|||
namespace Shentun.WebPeis.Models |
|||
{ |
|||
/// <summary>
|
|||
/// 企业介绍
|
|||
/// </summary>
|
|||
public class CompanyIntroduction : AuditedEntity, IHasConcurrencyStamp |
|||
{ |
|||
public Guid CompanyIntroductionId { get; set; } |
|||
|
|||
/// <summary>
|
|||
/// 内容类型 0-标题 1-段落内容
|
|||
/// </summary>
|
|||
public char ContentType { get; set; } |
|||
|
|||
/// <summary>
|
|||
/// 内容
|
|||
/// </summary>
|
|||
public string Content { get; set; } |
|||
|
|||
/// <summary>
|
|||
/// 排序
|
|||
/// </summary>
|
|||
public int DisplayOrder { get; set; } |
|||
|
|||
|
|||
public string ConcurrencyStamp { get; set; } |
|||
|
|||
public override object?[] GetKeys() |
|||
{ |
|||
return [CompanyIntroductionId]; |
|||
} |
|||
} |
|||
} |
|||
@ -0,0 +1,36 @@ |
|||
using Microsoft.EntityFrameworkCore.Metadata.Builders; |
|||
using Microsoft.EntityFrameworkCore; |
|||
using System; |
|||
using System.Collections.Generic; |
|||
using System.Linq; |
|||
using System.Text; |
|||
using System.Threading.Tasks; |
|||
using Shentun.WebPeis.Models; |
|||
|
|||
namespace Shentun.WebPeis.Configures |
|||
{ |
|||
internal class CompanyIntroductionConfigure : IEntityTypeConfiguration<CompanyIntroduction> |
|||
{ |
|||
public void Configure(EntityTypeBuilder<CompanyIntroduction> entity) |
|||
{ |
|||
entity.ToTable("company_introduction", tb => tb.HasComment("企业介绍")); |
|||
|
|||
|
|||
entity.Property(e => e.CompanyIntroductionId).ValueGeneratedNever().HasColumnName("company_introduction_id"); |
|||
entity.Property(e => e.ConcurrencyStamp).HasMaxLength(40).HasColumnName("concurrency_stamp"); |
|||
|
|||
entity.Property(e => e.Content).HasMaxLength(4000).HasComment("内容").HasColumnName("content"); |
|||
entity.Property(e => e.ContentType).HasMaxLength(1).HasDefaultValueSql("'0'::bpchar").HasComment("内容类型 0-标题 1-段落内容").HasColumnName("content_type"); |
|||
entity.Property(e => e.DisplayOrder).HasColumnName("display_order"); |
|||
|
|||
entity.Property(e => e.CreationTime) |
|||
.HasColumnType("timestamp without time zone") |
|||
.HasColumnName("creation_time"); |
|||
entity.Property(e => e.CreatorId).HasColumnName("creator_id"); |
|||
entity.Property(e => e.LastModificationTime) |
|||
.HasColumnType("timestamp without time zone") |
|||
.HasColumnName("last_modification_time"); |
|||
entity.Property(e => e.LastModifierId).HasColumnName("last_modifier_id"); |
|||
} |
|||
} |
|||
} |
|||
8420
src/Shentun.WebPeis.EntityFrameworkCore/Migrations/20251126081556_create_company_introduction.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,42 @@ |
|||
using System; |
|||
using Microsoft.EntityFrameworkCore.Migrations; |
|||
|
|||
#nullable disable |
|||
|
|||
namespace Shentun.WebPeis.Migrations |
|||
{ |
|||
/// <inheritdoc />
|
|||
public partial class create_company_introduction : Migration |
|||
{ |
|||
/// <inheritdoc />
|
|||
protected override void Up(MigrationBuilder migrationBuilder) |
|||
{ |
|||
migrationBuilder.CreateTable( |
|||
name: "company_introduction", |
|||
columns: table => new |
|||
{ |
|||
company_introduction_id = table.Column<Guid>(type: "uuid", nullable: false), |
|||
content_type = table.Column<char>(type: "character(1)", maxLength: 1, nullable: false, defaultValueSql: "'0'::bpchar", comment: "内容类型 0-标题 1-段落内容"), |
|||
content = table.Column<string>(type: "character varying(4000)", maxLength: 4000, nullable: false, comment: "内容"), |
|||
display_order = table.Column<int>(type: "integer", nullable: false), |
|||
concurrency_stamp = table.Column<string>(type: "character varying(40)", maxLength: 40, nullable: false), |
|||
creation_time = table.Column<DateTime>(type: "timestamp without time zone", nullable: false), |
|||
creator_id = table.Column<Guid>(type: "uuid", nullable: true), |
|||
last_modification_time = table.Column<DateTime>(type: "timestamp without time zone", nullable: true), |
|||
last_modifier_id = table.Column<Guid>(type: "uuid", nullable: true) |
|||
}, |
|||
constraints: table => |
|||
{ |
|||
table.PrimaryKey("pk_company_introduction", x => x.company_introduction_id); |
|||
}, |
|||
comment: "企业介绍"); |
|||
} |
|||
|
|||
/// <inheritdoc />
|
|||
protected override void Down(MigrationBuilder migrationBuilder) |
|||
{ |
|||
migrationBuilder.DropTable( |
|||
name: "company_introduction"); |
|||
} |
|||
} |
|||
} |
|||
Write
Preview
Loading…
Cancel
Save
Reference in new issue