feat: 提交配送中心点与门店地址映射全量变更
All checks were successful
Build and Deploy TenantApi / build-and-deploy (push) Successful in 42s

This commit is contained in:
2026-02-19 16:12:36 +08:00
parent d5b22a8d85
commit ad245078a2
10 changed files with 7899 additions and 0 deletions

View File

@@ -68,6 +68,10 @@ public sealed class PolygonZoneDto
/// Priority。
/// </summary>
public int Priority { get; set; }
/// <summary>
/// PolygonGeoJson。
/// </summary>
public string PolygonGeoJson { get; set; } = string.Empty;
}
/// <summary>
@@ -107,6 +111,14 @@ public sealed class StoreDeliverySettingsDto
/// </summary>
public string Mode { get; set; } = "radius";
/// <summary>
/// RadiusCenterLatitude。
/// </summary>
public decimal? RadiusCenterLatitude { get; set; }
/// <summary>
/// RadiusCenterLongitude。
/// </summary>
public decimal? RadiusCenterLongitude { get; set; }
/// <summary>
/// RadiusTiers。
/// </summary>
public List<RadiusTierDto> RadiusTiers { get; set; } = [];

View File

@@ -52,6 +52,31 @@ public sealed class MerchantDetailDto
/// </summary>
public string? RegisteredAddress { get; init; }
/// <summary>
/// 省份。
/// </summary>
public string? Province { get; init; }
/// <summary>
/// 城市。
/// </summary>
public string? City { get; init; }
/// <summary>
/// 区县。
/// </summary>
public string? District { get; init; }
/// <summary>
/// 经度。
/// </summary>
public double? Longitude { get; init; }
/// <summary>
/// 纬度。
/// </summary>
public double? Latitude { get; init; }
/// <summary>
/// 联系电话。
/// </summary>

View File

@@ -60,6 +60,11 @@ internal static class MerchantMapping
LicenseNumber = merchant.BusinessLicenseNumber,
LegalRepresentative = merchant.LegalPerson,
RegisteredAddress = merchant.Address,
Province = merchant.Province,
City = merchant.City,
District = merchant.District,
Longitude = merchant.Longitude,
Latitude = merchant.Latitude,
ContactPhone = merchant.ContactPhone,
ContactEmail = merchant.ContactEmail,
Status = merchant.Status,

View File

@@ -41,6 +41,31 @@ public sealed record StoreListItemDto
/// </summary>
public string Address { get; init; } = string.Empty;
/// <summary>
/// 省份。
/// </summary>
public string? Province { get; init; }
/// <summary>
/// 城市。
/// </summary>
public string? City { get; init; }
/// <summary>
/// 区县。
/// </summary>
public string? District { get; init; }
/// <summary>
/// 经度。
/// </summary>
public double? Longitude { get; init; }
/// <summary>
/// 纬度。
/// </summary>
public double? Latitude { get; init; }
/// <summary>
/// 门店封面图。
/// </summary>

View File

@@ -22,6 +22,11 @@ public static class StoreListMapping
ContactPhone = store.Phone ?? string.Empty,
ManagerName = store.ManagerName ?? string.Empty,
Address = ResolveAddress(store),
Province = store.Province,
City = store.City,
District = store.District,
Longitude = store.Longitude,
Latitude = store.Latitude,
CoverImage = string.IsNullOrWhiteSpace(store.CoverImageUrl) ? store.SignboardImageUrl : store.CoverImageUrl,
BusinessStatus = store.BusinessStatus,
AuditStatus = store.AuditStatus,

View File

@@ -42,4 +42,14 @@ public sealed class StoreDeliverySetting : MultiTenantEntityBase
/// 半径梯度配置 JSON。
/// </summary>
public string? RadiusTiersJson { get; set; }
/// <summary>
/// 半径配送中心点纬度。
/// </summary>
public decimal? RadiusCenterLatitude { get; set; }
/// <summary>
/// 半径配送中心点经度。
/// </summary>
public decimal? RadiusCenterLongitude { get; set; }
}

View File

@@ -1019,6 +1019,8 @@ public sealed class TakeoutAppDbContext(
builder.Property(x => x.FreeDeliveryThreshold).HasPrecision(10, 2);
builder.Property(x => x.MaxDeliveryDistance).HasPrecision(10, 2);
builder.Property(x => x.RadiusTiersJson).HasColumnType("text");
builder.Property(x => x.RadiusCenterLatitude).HasPrecision(10, 7);
builder.Property(x => x.RadiusCenterLongitude).HasPrecision(10, 7);
builder.HasIndex(x => new { x.TenantId, x.StoreId }).IsUnique();
}

View File

@@ -0,0 +1,44 @@
using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
namespace TakeoutSaaS.Infrastructure.Migrations
{
/// <inheritdoc />
public partial class AddStoreDeliveryRadiusCenter : Migration
{
/// <inheritdoc />
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.AddColumn<decimal>(
name: "RadiusCenterLatitude",
table: "store_delivery_settings",
type: "numeric(10,7)",
precision: 10,
scale: 7,
nullable: true,
comment: "半径配送中心点纬度。");
migrationBuilder.AddColumn<decimal>(
name: "RadiusCenterLongitude",
table: "store_delivery_settings",
type: "numeric(10,7)",
precision: 10,
scale: 7,
nullable: true,
comment: "半径配送中心点经度。");
}
/// <inheritdoc />
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropColumn(
name: "RadiusCenterLatitude",
table: "store_delivery_settings");
migrationBuilder.DropColumn(
name: "RadiusCenterLongitude",
table: "store_delivery_settings");
}
}
}

View File

@@ -5274,6 +5274,16 @@ namespace TakeoutSaaS.Infrastructure.Migrations
.HasColumnType("integer")
.HasComment("配送模式。");
b.Property<decimal?>("RadiusCenterLatitude")
.HasPrecision(10, 7)
.HasColumnType("numeric(10,7)")
.HasComment("半径配送中心点纬度。");
b.Property<decimal?>("RadiusCenterLongitude")
.HasPrecision(10, 7)
.HasColumnType("numeric(10,7)")
.HasComment("半径配送中心点经度。");
b.Property<string>("RadiusTiersJson")
.HasColumnType("text")
.HasComment("半径梯度配置 JSON。");