Browse Source

1127

master
wxd 3 weeks ago
parent
commit
5ad01d12df
  1. 32
      src/Shentun.WebPeis.Application.Contracts/CompanyIntroductions/BatchCreateCompanyIntroductionDto.cs
  2. 29
      src/Shentun.WebPeis.Application.Contracts/CompanyIntroductions/CompanyIntroductionDto.cs
  3. 11
      src/Shentun.WebPeis.Application.Contracts/CompanyIntroductions/CompanyIntroductionIdInputDto.cs
  4. 61
      src/Shentun.WebPeis.Application.Contracts/CompanyIntroductions/GetMiniProgramConfigureDto.cs
  5. 187
      src/Shentun.WebPeis.Application/CompanyIntroductions/CompanyIntroductionAppService.cs
  6. 10
      src/Shentun.WebPeis.Application/SysParms/SysParmAppService.cs
  7. 41
      src/Shentun.WebPeis.Domain/Models/CompanyIntroduction.cs
  8. 36
      src/Shentun.WebPeis.EntityFrameworkCore/Configures/CompanyIntroductionConfigure.cs
  9. 3
      src/Shentun.WebPeis.EntityFrameworkCore/EntityFrameworkCore/WebPeisDbContext.cs
  10. 8420
      src/Shentun.WebPeis.EntityFrameworkCore/Migrations/20251126081556_create_company_introduction.Designer.cs
  11. 42
      src/Shentun.WebPeis.EntityFrameworkCore/Migrations/20251126081556_create_company_introduction.cs
  12. 56
      src/Shentun.WebPeis.EntityFrameworkCore/Migrations/WebPeisDbContextModelSnapshot.cs

32
src/Shentun.WebPeis.Application.Contracts/CompanyIntroductions/BatchCreateCompanyIntroductionDto.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; }
}
}

29
src/Shentun.WebPeis.Application.Contracts/CompanyIntroductions/CompanyIntroductionDto.cs

@ -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; }
}
}

11
src/Shentun.WebPeis.Application.Contracts/CompanyIntroductions/CompanyIntroductionIdInputDto.cs

@ -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; }
}
}

61
src/Shentun.WebPeis.Application.Contracts/CompanyIntroductions/GetMiniProgramConfigureDto.cs

@ -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; }
}
}

187
src/Shentun.WebPeis.Application/CompanyIntroductions/CompanyIntroductionAppService.cs

@ -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;
}
}
}

10
src/Shentun.WebPeis.Application/SysParms/SysParmAppService.cs

@ -47,12 +47,14 @@ namespace Shentun.WebPeis.SysParms
List<GetListInSysParmValueNameDto> entlist = new List<GetListInSysParmValueNameDto>(); List<GetListInSysParmValueNameDto> entlist = new List<GetListInSysParmValueNameDto>();
var query = from sysParm in await _sysParmRepository.GetQueryableAsync() var query = from sysParm in await _sysParmRepository.GetQueryableAsync()
join sysParmValue in await _sysParmValueRepository.GetQueryableAsync() on sysParm.SysParmId equals sysParmValue.SysParmId
join sysParmValue in await _sysParmValueRepository.GetQueryableAsync() on sysParm.SysParmId equals sysParmValue.SysParmId into sysParmValueTemp
from sysParmValueEmptyHave in sysParmValueTemp.DefaultIfEmpty()
where sysParm.SysParmTypeId == input.SysParmTypeId where sysParm.SysParmTypeId == input.SysParmTypeId
select new select new
{ {
sysParm, sysParm,
sysParmValue
sysParmValueName=sysParmValueEmptyHave!=null? sysParmValueEmptyHave.ParmValue:"",
valueRemark= sysParmValueEmptyHave != null ? sysParmValueEmptyHave.Remark : "",
}; };
@ -70,8 +72,8 @@ namespace Shentun.WebPeis.SysParms
SimpleCode = "", SimpleCode = "",
ValueType = item.Key.ValueType, ValueType = item.Key.ValueType,
SysParmTypeId = item.Key.SysParmTypeId, SysParmTypeId = item.Key.SysParmTypeId,
SysParmValueName = item.FirstOrDefault().sysParmValue.ParmValue,
ValueRemark = item.FirstOrDefault().sysParmValue.Remark
SysParmValueName = item.FirstOrDefault().sysParmValueName,
ValueRemark = item.FirstOrDefault().valueRemark
}); });
} }

41
src/Shentun.WebPeis.Domain/Models/CompanyIntroduction.cs

@ -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];
}
}
}

36
src/Shentun.WebPeis.EntityFrameworkCore/Configures/CompanyIntroductionConfigure.cs

@ -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");
}
}
}

3
src/Shentun.WebPeis.EntityFrameworkCore/EntityFrameworkCore/WebPeisDbContext.cs

@ -248,6 +248,9 @@ public partial class WebPeisDbContext : AbpDbContext<WebPeisDbContext>,
public virtual DbSet<WeChatOrderRefund> WeChatOrderRefunds { get; set; } public virtual DbSet<WeChatOrderRefund> WeChatOrderRefunds { get; set; }
public virtual DbSet<AppointScheduleExcludeCustomerOrg> AppointScheduleExcludeCustomerOrgs { get; set; } public virtual DbSet<AppointScheduleExcludeCustomerOrg> AppointScheduleExcludeCustomerOrgs { get; set; }
public virtual DbSet<CompanyIntroduction> CompanyIntroductions { get; set; }
protected override void OnConfiguring(DbContextOptionsBuilder optionsBuilder) protected override void OnConfiguring(DbContextOptionsBuilder optionsBuilder)
{ {
base.OnConfiguring(optionsBuilder); base.OnConfiguring(optionsBuilder);

8420
src/Shentun.WebPeis.EntityFrameworkCore/Migrations/20251126081556_create_company_introduction.Designer.cs
File diff suppressed because it is too large
View File

42
src/Shentun.WebPeis.EntityFrameworkCore/Migrations/20251126081556_create_company_introduction.cs

@ -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");
}
}
}

56
src/Shentun.WebPeis.EntityFrameworkCore/Migrations/WebPeisDbContextModelSnapshot.cs

@ -1168,6 +1168,62 @@ namespace Shentun.WebPeis.Migrations
}); });
}); });
modelBuilder.Entity("Shentun.WebPeis.Models.CompanyIntroduction", b =>
{
b.Property<Guid>("CompanyIntroductionId")
.HasColumnType("uuid")
.HasColumnName("company_introduction_id");
b.Property<string>("ConcurrencyStamp")
.IsRequired()
.HasMaxLength(40)
.HasColumnType("character varying(40)")
.HasColumnName("concurrency_stamp");
b.Property<string>("Content")
.IsRequired()
.HasMaxLength(4000)
.HasColumnType("character varying(4000)")
.HasColumnName("content")
.HasComment("内容");
b.Property<char>("ContentType")
.ValueGeneratedOnAdd()
.HasMaxLength(1)
.HasColumnType("character(1)")
.HasColumnName("content_type")
.HasDefaultValueSql("'0'::bpchar")
.HasComment("内容类型 0-标题 1-段落内容");
b.Property<DateTime>("CreationTime")
.HasColumnType("timestamp without time zone")
.HasColumnName("creation_time");
b.Property<Guid?>("CreatorId")
.HasColumnType("uuid")
.HasColumnName("creator_id");
b.Property<int>("DisplayOrder")
.HasColumnType("integer")
.HasColumnName("display_order");
b.Property<DateTime?>("LastModificationTime")
.HasColumnType("timestamp without time zone")
.HasColumnName("last_modification_time");
b.Property<Guid?>("LastModifierId")
.HasColumnType("uuid")
.HasColumnName("last_modifier_id");
b.HasKey("CompanyIntroductionId")
.HasName("pk_company_introduction");
b.ToTable("company_introduction", null, t =>
{
t.HasComment("企业介绍");
});
});
modelBuilder.Entity("Shentun.WebPeis.Models.CustomerOrg", b => modelBuilder.Entity("Shentun.WebPeis.Models.CustomerOrg", b =>
{ {
b.Property<Guid>("CustomerOrgId") b.Property<Guid>("CustomerOrgId")

Loading…
Cancel
Save