😎增加高德行政区划同步
This commit is contained in:
parent
800225501f
commit
a9491ea08b
@ -77,7 +77,7 @@ public class ConfigConst
|
||||
public const string SysValidationLog = "sys_validation_log";
|
||||
|
||||
/// <summary>
|
||||
/// 行政区域同步层级 1-省级,2-市级,3-区县级,4-街道级,5-村级
|
||||
/// 行政区划同步层级 1-省级,2-市级,3-区县级,4-街道级,5-村级
|
||||
/// </summary>
|
||||
public const string SysRegionSyncLevel = "sys_region_sync_level";
|
||||
|
||||
|
||||
@ -32,7 +32,7 @@ public class SysConfigSeedData : ISqlSugarEntitySeedData<SysConfig>
|
||||
new SysConfig{ Id=1300000000201, Name="发送异常日志邮件", Code=ConfigConst.SysErrorMail, Value="False", SysFlag=YesNoEnum.Y, Remark="是否发送异常日志邮件", OrderNo=110, GroupCode=ConfigConst.SysDefaultGroup, CreateTime=DateTime.Parse("2022-02-10 00:00:00") },
|
||||
new SysConfig{ Id=1300000000211, Name="域登录验证", Code=ConfigConst.SysDomainLogin, Value="False", SysFlag=YesNoEnum.Y, Remark="是否开启域登录验证", OrderNo=120, GroupCode=ConfigConst.SysDefaultGroup, CreateTime=DateTime.Parse("2022-02-10 00:00:00") },
|
||||
new SysConfig{ Id=1300000000221, Name="数据校验日志", Code=ConfigConst.SysValidationLog, Value="True", SysFlag=YesNoEnum.Y, Remark="是否数据校验日志", OrderNo=130, GroupCode=ConfigConst.SysDefaultGroup, CreateTime=DateTime.Parse("2022-02-10 00:00:00") },
|
||||
new SysConfig{ Id=1300000000231, Name="行政区域同步层级", Code=ConfigConst.SysRegionSyncLevel, Value="3", SysFlag=YesNoEnum.Y, Remark="行政区域同步层级 1-省级,2-市级,3-区县级,4-街道级,5-村级", OrderNo=140, GroupCode=ConfigConst.SysDefaultGroup, CreateTime=DateTime.Parse("2022-02-10 00:00:00") },
|
||||
new SysConfig{ Id=1300000000231, Name="行政区划同步层级", Code=ConfigConst.SysRegionSyncLevel, Value="3", SysFlag=YesNoEnum.Y, Remark="行政区划同步层级 1-省级,2-市级,3-区县级,4-街道级,5-村级", OrderNo=140, GroupCode=ConfigConst.SysDefaultGroup, CreateTime=DateTime.Parse("2022-02-10 00:00:00") },
|
||||
new SysConfig{ Id=1300000000241, Name="开启强制修改密码", Code=ConfigConst.SysForceChangePassword, Value="False", SysFlag=YesNoEnum.Y, Remark="开启强制修改密码", OrderNo=150, GroupCode=ConfigConst.SysDefaultGroup, CreateTime=DateTime.Parse("2022-02-10 00:00:00") },
|
||||
// 新业务系统记得更改密匙,通过接口(http://localhost:5005/api/sysCommon/smKeyPair)获取
|
||||
new SysConfig{ Id=1300000000251, Name="国密SM2密匙", Code=ConfigConst.SysSM2Key, Value="04851D329AA3E38C2E7670AFE70E6E70E92F8769CA27C8766B12209A0FFBA4493B603EF7A0B9B1E16F0E8930C0406EA0B179B68DF28E25334BDEC4AE76D907E9E9;3A61D1D30C6302DABFF36201D936D0143EEF0C850AF28C5CA6D5C045AF8C5C8A", SysFlag=YesNoEnum.Y, Remark="国密SM2密匙", OrderNo=160, GroupCode=ConfigConst.SysDefaultGroup, CreateTime=DateTime.Parse("2024-11-21 00:00:00") },
|
||||
|
||||
@ -134,7 +134,7 @@ public class SysMenuSeedData : ISqlSugarEntitySeedData<SysMenu>
|
||||
new SysMenu{ Id=1310000000373, Pid=1310000000371, Title="删除", Permission="sysCache/delete", Type=MenuTypeEnum.Btn, CreateTime=DateTime.Parse("2022-02-10 00:00:00"), OrderNo=100 },
|
||||
new SysMenu{ Id=1310000000374, Pid=1310000000371, Title="清空", Permission="sysCache/clear", Type=MenuTypeEnum.Btn, CreateTime=DateTime.Parse("2022-02-10 00:00:00"), OrderNo=100 },
|
||||
|
||||
new SysMenu{ Id=1310000000381, Pid=1310000000301, Title="行政区域", Path="/platform/region", Name="sysRegion", Component="/system/region/index", Icon="ele-LocationInformation", Type=MenuTypeEnum.Menu, CreateTime=DateTime.Parse("2022-02-10 00:00:00"), OrderNo=170 },
|
||||
new SysMenu{ Id=1310000000381, Pid=1310000000301, Title="行政区划", Path="/platform/region", Name="sysRegion", Component="/system/region/index", Icon="ele-LocationInformation", Type=MenuTypeEnum.Menu, CreateTime=DateTime.Parse("2022-02-10 00:00:00"), OrderNo=170 },
|
||||
new SysMenu{ Id=1310000000382, Pid=1310000000381, Title="查询", Permission="sysRegion/page", Type=MenuTypeEnum.Btn, CreateTime=DateTime.Parse("2022-02-10 00:00:00"), OrderNo=100 },
|
||||
new SysMenu{ Id=1310000000383, Pid=1310000000381, Title="编辑", Permission="sysRegion/update", Type=MenuTypeEnum.Btn, CreateTime=DateTime.Parse("2022-02-10 00:00:00"), OrderNo=100 },
|
||||
new SysMenu{ Id=1310000000384, Pid=1310000000381, Title="增加", Permission="sysRegion/add", Type=MenuTypeEnum.Btn, CreateTime=DateTime.Parse("2022-02-10 00:00:00"), OrderNo=100 },
|
||||
|
||||
@ -118,7 +118,7 @@ public class SysRoleMenuSeedData : ISqlSugarEntitySeedData<SysRoleMenu>
|
||||
new SysRoleMenu{ Id=1300000000272, RoleId=1300000000101, MenuId=1310000000372 },
|
||||
new SysRoleMenu{ Id=1300000000273, RoleId=1300000000101, MenuId=1310000000373 },
|
||||
new SysRoleMenu{ Id=1300000000274, RoleId=1300000000101, MenuId=1310000000374 },
|
||||
// 行政区域
|
||||
// 行政区划
|
||||
new SysRoleMenu{ Id=1300000000281, RoleId=1300000000101, MenuId=1310000000381 },
|
||||
new SysRoleMenu{ Id=1300000000282, RoleId=1300000000101, MenuId=1310000000382 },
|
||||
new SysRoleMenu{ Id=1300000000283, RoleId=1300000000101, MenuId=1310000000383 },
|
||||
|
||||
23
Admin.NET/Admin.NET.Core/Service/Region/Dto/GDResponse.cs
Normal file
23
Admin.NET/Admin.NET.Core/Service/Region/Dto/GDResponse.cs
Normal file
@ -0,0 +1,23 @@
|
||||
// Admin.NET 项目的版权、商标、专利和其他相关权利均受相应法律法规的保护。使用本项目应遵守相关法律法规和许可证的要求。
|
||||
//
|
||||
// 本项目主要遵循 MIT 许可证和 Apache 许可证(版本 2.0)进行分发和使用。许可证位于源代码树根目录中的 LICENSE-MIT 和 LICENSE-APACHE 文件。
|
||||
//
|
||||
// 不得利用本项目从事危害国家安全、扰乱社会秩序、侵犯他人合法权益等法律法规禁止的活动!任何基于本项目二次开发而产生的一切法律纠纷和责任,我们不承担任何责任!
|
||||
|
||||
namespace Admin.NET.Core.Service;
|
||||
|
||||
public class GDResponse<T>
|
||||
{
|
||||
public string info { get; set; }
|
||||
public string status { get; set; }
|
||||
public T districts { get; set; }
|
||||
}
|
||||
|
||||
public class GDRegionResponse
|
||||
{
|
||||
public string adcode { get; set; }
|
||||
public string name { get; set; }
|
||||
public string center { get; set; }
|
||||
public string level { get; set; }
|
||||
public List<GDRegionResponse> districts { get; set; }
|
||||
}
|
||||
@ -4,23 +4,21 @@
|
||||
//
|
||||
// 不得利用本项目从事危害国家安全、扰乱社会秩序、侵犯他人合法权益等法律法规禁止的活动!任何基于本项目二次开发而产生的一切法律纠纷和责任,我们不承担任何责任!
|
||||
|
||||
using AngleSharp;
|
||||
using AngleSharp.Html.Dom;
|
||||
using NewLife.Remoting;
|
||||
|
||||
namespace Admin.NET.Core.Service;
|
||||
|
||||
/// <summary>
|
||||
/// 系统行政区域服务 🧩
|
||||
/// 系统行政区划服务 🧩
|
||||
/// </summary>
|
||||
[ApiDescriptionSettings(Order = 310, Description = "行政区域")]
|
||||
[ApiDescriptionSettings(Order = 310, Description = "行政区划")]
|
||||
public class SysRegionService : IDynamicApiController, ITransient
|
||||
{
|
||||
private readonly SqlSugarRepository<SysRegion> _sysRegionRep;
|
||||
private readonly SysConfigService _sysConfigService;
|
||||
|
||||
// Url地址-国家统计局行政区域2023年
|
||||
private readonly string _url = "http://www.stats.gov.cn/sj/tjbz/tjyqhdmhcxhfdm/2023/index.html";
|
||||
// Url地址-高德
|
||||
private readonly string _url = "https://restapi.amap.com/v3/config/district?subdistrict";
|
||||
|
||||
public SysRegionService(SqlSugarRepository<SysRegion> sysRegionRep, SysConfigService sysConfigService)
|
||||
{
|
||||
@ -29,11 +27,11 @@ public class SysRegionService : IDynamicApiController, ITransient
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 获取行政区域分页列表 🔖
|
||||
/// 获取行政区划分页列表 🔖
|
||||
/// </summary>
|
||||
/// <param name="input"></param>
|
||||
/// <returns></returns>
|
||||
[DisplayName("获取行政区域分页列表")]
|
||||
[DisplayName("获取行政区划分页列表")]
|
||||
public async Task<SqlSugarPagedList<SysRegion>> Page(PageRegionInput input)
|
||||
{
|
||||
return await _sysRegionRep.AsQueryable()
|
||||
@ -44,24 +42,24 @@ public class SysRegionService : IDynamicApiController, ITransient
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 获取行政区域列表 🔖
|
||||
/// 获取行政区划列表 🔖
|
||||
/// </summary>
|
||||
/// <param name="input"></param>
|
||||
/// <returns></returns>
|
||||
[DisplayName("获取行政区域列表")]
|
||||
[DisplayName("获取行政区划列表")]
|
||||
public async Task<List<SysRegion>> GetList([FromQuery] RegionInput input)
|
||||
{
|
||||
return await _sysRegionRep.GetListAsync(u => u.Pid == input.Id);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 查询行政区域列表 🔖
|
||||
/// 查询行政区划列表 🔖
|
||||
/// post参数方便参数扩展,调用api不用大浮动修复,参数如果是对象不建议用[FromQuery]方式传参
|
||||
/// </summary>
|
||||
/// <param name="input"></param>
|
||||
/// <returns></returns>
|
||||
[ApiDescriptionSettings(Name = "Query"), HttpPost]
|
||||
[DisplayName("查询行政区域列表")]
|
||||
[DisplayName("查询行政区划列表")]
|
||||
public async Task<List<SysRegion>> QueryList(QueryRegionInput input)
|
||||
{
|
||||
return await _sysRegionRep.AsQueryable()
|
||||
@ -73,12 +71,12 @@ public class SysRegionService : IDynamicApiController, ITransient
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 增加行政区域 🔖
|
||||
/// 增加行政区划 🔖
|
||||
/// </summary>
|
||||
/// <param name="input"></param>
|
||||
/// <returns></returns>
|
||||
[ApiDescriptionSettings(Name = "Add"), HttpPost]
|
||||
[DisplayName("增加行政区域")]
|
||||
[DisplayName("增加行政区划")]
|
||||
public async Task<long> AddRegion(AddRegionInput input)
|
||||
{
|
||||
input.Code = input.Code.Trim();
|
||||
@ -104,12 +102,12 @@ public class SysRegionService : IDynamicApiController, ITransient
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 更新行政区域 🔖
|
||||
/// 更新行政区划 🔖
|
||||
/// </summary>
|
||||
/// <param name="input"></param>
|
||||
/// <returns></returns>
|
||||
[ApiDescriptionSettings(Name = "Update"), HttpPost]
|
||||
[DisplayName("更新行政区域")]
|
||||
[DisplayName("更新行政区划")]
|
||||
public async Task UpdateRegion(UpdateRegionInput input)
|
||||
{
|
||||
input.Code = input.Code.Trim();
|
||||
@ -151,12 +149,12 @@ public class SysRegionService : IDynamicApiController, ITransient
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 删除行政区域 🔖
|
||||
/// 删除行政区划 🔖
|
||||
/// </summary>
|
||||
/// <param name="input"></param>
|
||||
/// <returns></returns>
|
||||
[ApiDescriptionSettings(Name = "Delete"), HttpPost]
|
||||
[DisplayName("删除行政区域")]
|
||||
[DisplayName("删除行政区划")]
|
||||
public async Task DeleteRegion(DeleteRegionInput input)
|
||||
{
|
||||
var regionTreeList = await _sysRegionRep.AsQueryable().ToChildListAsync(u => u.Pid, input.Id, true);
|
||||
@ -165,131 +163,45 @@ public class SysRegionService : IDynamicApiController, ITransient
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 同步行政区域(国家统计局) 🔖
|
||||
/// 同步行政区划(高德) 🔖
|
||||
/// </summary>
|
||||
/// <param name="key"></param>
|
||||
/// <returns></returns>
|
||||
[DisplayName("同步行政区域(国家统计局)")]
|
||||
public async Task SyncRegionStats(SyncInput input)
|
||||
[DisplayName("同步行政区划(高德)")]
|
||||
public async Task SyncRegionGD(string key)
|
||||
{
|
||||
if (string.IsNullOrWhiteSpace(key) || key.Length < 30)
|
||||
throw Oops.Oh("请正确输入高德地图开发者 Key 值");
|
||||
|
||||
var syncLevel = await _sysConfigService.GetConfigValueByCode<int>(ConfigConst.SysRegionSyncLevel);
|
||||
if (syncLevel < 1 || syncLevel > 5)
|
||||
syncLevel = 3;//默认区县级
|
||||
syncLevel = 3; // 默认区县级
|
||||
|
||||
var context = BrowsingContext.New(AngleSharp.Configuration.Default.WithDefaultLoader());
|
||||
var dom = await context.OpenAsync(_url);
|
||||
var res = await $"{_url}{syncLevel}&key={key}".GetAsync();
|
||||
if (!res.IsSuccessStatusCode) return;
|
||||
|
||||
// 省级
|
||||
var itemList = dom.QuerySelectorAll("table.provincetable tr.provincetr td a");
|
||||
if (itemList.Length == 0)
|
||||
throw Oops.Oh(ErrorCodeEnum.R2005);
|
||||
var gdResponse = JSON.Deserialize<GDResponse<List<GDRegionResponse>>>(res.Content.ReadAsStringAsync().Result);
|
||||
if (gdResponse.info != "OK" || gdResponse.districts == null || gdResponse.districts.Count < 1) return;
|
||||
|
||||
await _sysRegionRep.DeleteAsync(u => u.Id > 0);
|
||||
|
||||
foreach (IHtmlAnchorElement item in itemList)
|
||||
var regionList = new List<SysRegion>();
|
||||
foreach (var item in gdResponse.districts)
|
||||
{
|
||||
if (!string.IsNullOrWhiteSpace(input.Province) && item.TextContent != input.Province) continue;
|
||||
var list = new List<SysRegion>();
|
||||
GetChildren(regionList, item.districts, 1, 0); // 排除一级目录(国家)
|
||||
}
|
||||
|
||||
var region = new SysRegion
|
||||
{
|
||||
//Id = YitIdHelper.NextId(),
|
||||
Pid = 0,
|
||||
Name = item.TextContent,
|
||||
Remark = item.Href,
|
||||
Level = 1,
|
||||
};
|
||||
list.Add(region);
|
||||
await _sysRegionRep.AsDeleteable().ExecuteCommandAsync();
|
||||
_sysRegionRep.Context.Fastest<SysRegion>().BulkCopy(regionList);
|
||||
}
|
||||
|
||||
////// 市级
|
||||
if (string.IsNullOrEmpty(item.Href)) continue;
|
||||
var dom1 = await context.OpenAsync(item.Href);
|
||||
var itemList1 = dom1.QuerySelectorAll("table.citytable tr.citytr td a");
|
||||
for (var i1 = 0; i1 < itemList1.Length; i1 += 2)
|
||||
{
|
||||
var item1 = (IHtmlAnchorElement)itemList1[i1 + 1];
|
||||
if (!string.IsNullOrWhiteSpace(input.City) && item1.TextContent != input.City) continue;
|
||||
private void GetChildren(List<SysRegion> regionList, List<GDRegionResponse> responses, int level, long pid)
|
||||
{
|
||||
foreach (var region in responses)
|
||||
{
|
||||
var sysRegion = new SysRegion { Id = YitIdHelper.NextId(), Pid = pid, Name = region.name, Code = region.adcode, CityCode = region.adcode, Level = level };
|
||||
regionList.Add(sysRegion);
|
||||
|
||||
string cityCode = itemList1[i1].TextContent;
|
||||
// 若URL中查询的一级行政区域缺少Code则通过二级区域填充
|
||||
if (list.Count == 1 && !string.IsNullOrEmpty(cityCode))
|
||||
{
|
||||
region.Code = cityCode.Substring(0, 2).PadRight(cityCode.Length, '0');
|
||||
region.Id = long.Parse(region.Code);
|
||||
}
|
||||
// 同步层级为“1-省级”退出
|
||||
if (syncLevel < 2)
|
||||
break;
|
||||
|
||||
var region1 = new SysRegion
|
||||
{
|
||||
Id = long.Parse(cityCode),
|
||||
Pid = region.Id,
|
||||
Name = item1.TextContent,
|
||||
Code = itemList1[i1].TextContent,
|
||||
Remark = item1.Href,
|
||||
Level = 2,
|
||||
};
|
||||
|
||||
list.Add(region1);
|
||||
|
||||
////// 区县级
|
||||
if (string.IsNullOrEmpty(item1.Href) || syncLevel <= 2) continue;
|
||||
var dom2 = await context.OpenAsync(item1.Href);
|
||||
var itemList2 = dom2.QuerySelectorAll("table.countytable tr.countytr td a");
|
||||
for (var i2 = 0; i2 < itemList2.Length; i2 += 2)
|
||||
{
|
||||
var item2 = (IHtmlAnchorElement)itemList2[i2 + 1];
|
||||
var region2 = new SysRegion
|
||||
{
|
||||
Id = long.Parse(itemList2[i2].TextContent),
|
||||
Pid = region1.Id,
|
||||
Name = item2.TextContent,
|
||||
Code = itemList2[i2].TextContent,
|
||||
Remark = item2.Href,
|
||||
Level = 3,
|
||||
};
|
||||
list.Add(region2);
|
||||
|
||||
////// 街道级
|
||||
if (string.IsNullOrEmpty(item2.Href) || syncLevel <= 3) continue;
|
||||
var dom3 = await context.OpenAsync(item2.Href);
|
||||
var itemList3 = dom3.QuerySelectorAll("table.towntable tr.towntr td a");
|
||||
for (var i3 = 0; i3 < itemList3.Length; i3 += 2)
|
||||
{
|
||||
var item3 = (IHtmlAnchorElement)itemList3[i3 + 1];
|
||||
var region3 = new SysRegion
|
||||
{
|
||||
Id = long.Parse(itemList3[i3].TextContent),
|
||||
Pid = region2.Id,
|
||||
Name = item3.TextContent,
|
||||
Code = itemList3[i3].TextContent,
|
||||
Remark = item3.Href,
|
||||
Level = 4,
|
||||
};
|
||||
list.Add(region3);
|
||||
|
||||
////// 村级
|
||||
if (string.IsNullOrEmpty(item3.Href) || syncLevel <= 4) continue;
|
||||
var dom4 = await context.OpenAsync(item3.Href);
|
||||
var itemList4 = dom4.QuerySelectorAll("table.villagetable tr.villagetr td");
|
||||
for (var i4 = 0; i4 < itemList4.Length; i4 += 3)
|
||||
{
|
||||
list.Add(new SysRegion
|
||||
{
|
||||
Id = long.Parse(itemList4[i4].TextContent),
|
||||
Pid = region3.Id,
|
||||
Name = itemList4[i4 + 2].TextContent,
|
||||
Code = itemList4[i4].TextContent,
|
||||
CityCode = itemList4[i4 + 1].TextContent,
|
||||
Level = 5,
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//按省份同步快速写入提升同步效率,全部一次性写入容易出现从统计局获取数据失败
|
||||
_sysRegionRep.Context.Fastest<SysRegion>().BulkCopy(list);
|
||||
if (region.districts.Count > 0)
|
||||
GetChildren(regionList, region.districts, level++, sysRegion.Id);
|
||||
}
|
||||
}
|
||||
|
||||
@ -348,11 +260,8 @@ public class SysRegionService : IDynamicApiController, ITransient
|
||||
|
||||
// 如果存在指定行政区划则删除
|
||||
if (await _sysRegionRep.IsAnyAsync(u => u.Id == code))
|
||||
{
|
||||
await DeleteRegion(new DeleteRegionInput { Id = code });
|
||||
}
|
||||
|
||||
await _sysRegionRep.AsDeleteable().ExecuteCommandAsync();
|
||||
return await _sysRegionRep.AsInsertable(areaList).ExecuteCommandAsync();
|
||||
}
|
||||
|
||||
@ -443,7 +352,7 @@ public class SysRegionService : IDynamicApiController, ITransient
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 根据层级获取行政区域数据
|
||||
/// 根据层级获取行政区划数据
|
||||
/// </summary>
|
||||
/// <param name="region"></param>
|
||||
/// <param name="level"></param>
|
||||
|
||||
@ -26,7 +26,6 @@ import { DeleteRegionInput } from '../models';
|
||||
import { GenOrgInput } from '../models';
|
||||
import { PageRegionInput } from '../models';
|
||||
import { QueryRegionInput } from '../models';
|
||||
import { SyncInput } from '../models';
|
||||
import { TiandituInput } from '../models';
|
||||
import { UpdateRegionInput } from '../models';
|
||||
/**
|
||||
@ -37,7 +36,7 @@ export const SysRegionApiAxiosParamCreator = function (configuration?: Configura
|
||||
return {
|
||||
/**
|
||||
*
|
||||
* @summary 增加行政区域 🔖
|
||||
* @summary 增加行政区划 🔖
|
||||
* @param {AddRegionInput} [body]
|
||||
* @param {*} [options] Override http request option.
|
||||
* @throws {RequiredError}
|
||||
@ -85,7 +84,7 @@ export const SysRegionApiAxiosParamCreator = function (configuration?: Configura
|
||||
},
|
||||
/**
|
||||
*
|
||||
* @summary 删除行政区域 🔖
|
||||
* @summary 删除行政区划 🔖
|
||||
* @param {DeleteRegionInput} [body]
|
||||
* @param {*} [options] Override http request option.
|
||||
* @throws {RequiredError}
|
||||
@ -181,7 +180,7 @@ export const SysRegionApiAxiosParamCreator = function (configuration?: Configura
|
||||
},
|
||||
/**
|
||||
*
|
||||
* @summary 获取行政区域列表 🔖
|
||||
* @summary 获取行政区划列表 🔖
|
||||
* @param {number} id 主键Id
|
||||
* @param {*} [options] Override http request option.
|
||||
* @throws {RequiredError}
|
||||
@ -233,7 +232,7 @@ export const SysRegionApiAxiosParamCreator = function (configuration?: Configura
|
||||
},
|
||||
/**
|
||||
*
|
||||
* @summary 获取行政区域分页列表 🔖
|
||||
* @summary 获取行政区划分页列表 🔖
|
||||
* @param {PageRegionInput} [body]
|
||||
* @param {*} [options] Override http request option.
|
||||
* @throws {RequiredError}
|
||||
@ -281,7 +280,7 @@ export const SysRegionApiAxiosParamCreator = function (configuration?: Configura
|
||||
},
|
||||
/**
|
||||
*
|
||||
* @summary 查询行政区域列表 🔖 post参数方便参数扩展,调用api不用大浮动修复,参数如果是对象不建议用[FromQuery]方式传参
|
||||
* @summary 查询行政区划列表 🔖 post参数方便参数扩展,调用api不用大浮动修复,参数如果是对象不建议用[FromQuery]方式传参
|
||||
* @param {QueryRegionInput} [body]
|
||||
* @param {*} [options] Override http request option.
|
||||
* @throws {RequiredError}
|
||||
@ -327,6 +326,55 @@ export const SysRegionApiAxiosParamCreator = function (configuration?: Configura
|
||||
options: localVarRequestOptions,
|
||||
};
|
||||
},
|
||||
/**
|
||||
*
|
||||
* @summary 同步行政区划(高德) 🔖
|
||||
* @param {string} key
|
||||
* @param {*} [options] Override http request option.
|
||||
* @throws {RequiredError}
|
||||
*/
|
||||
apiSysRegionSyncRegionGDKeyPost: async (key: string, options: AxiosRequestConfig = {}): Promise<RequestArgs> => {
|
||||
// verify required parameter 'key' is not null or undefined
|
||||
if (key === null || key === undefined) {
|
||||
throw new RequiredError('key','Required parameter key was null or undefined when calling apiSysRegionSyncRegionGDKeyPost.');
|
||||
}
|
||||
const localVarPath = `/api/sysRegion/syncRegionGD/{key}`
|
||||
.replace(`{${"key"}}`, encodeURIComponent(String(key)));
|
||||
// use dummy base URL string because the URL constructor only accepts absolute URLs.
|
||||
const localVarUrlObj = new URL(localVarPath, 'https://example.com');
|
||||
let baseOptions;
|
||||
if (configuration) {
|
||||
baseOptions = configuration.baseOptions;
|
||||
}
|
||||
const localVarRequestOptions :AxiosRequestConfig = { method: 'POST', ...baseOptions, ...options};
|
||||
const localVarHeaderParameter = {} as any;
|
||||
const localVarQueryParameter = {} as any;
|
||||
|
||||
// authentication Bearer required
|
||||
// http bearer authentication required
|
||||
if (configuration && configuration.accessToken) {
|
||||
const accessToken = typeof configuration.accessToken === 'function'
|
||||
? await configuration.accessToken()
|
||||
: await configuration.accessToken;
|
||||
localVarHeaderParameter["Authorization"] = "Bearer " + accessToken;
|
||||
}
|
||||
|
||||
const query = new URLSearchParams(localVarUrlObj.search);
|
||||
for (const key in localVarQueryParameter) {
|
||||
query.set(key, localVarQueryParameter[key]);
|
||||
}
|
||||
for (const key in options.params) {
|
||||
query.set(key, options.params[key]);
|
||||
}
|
||||
localVarUrlObj.search = (new URLSearchParams(query)).toString();
|
||||
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
|
||||
localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers};
|
||||
|
||||
return {
|
||||
url: localVarUrlObj.pathname + localVarUrlObj.search + localVarUrlObj.hash,
|
||||
options: localVarRequestOptions,
|
||||
};
|
||||
},
|
||||
/**
|
||||
*
|
||||
* @summary 同步行政区划数据(国家地名信息库,最多支持2级深度) 🔖
|
||||
@ -376,54 +424,6 @@ export const SysRegionApiAxiosParamCreator = function (configuration?: Configura
|
||||
options: localVarRequestOptions,
|
||||
};
|
||||
},
|
||||
/**
|
||||
*
|
||||
* @summary 同步行政区域(国家统计局) 🔖
|
||||
* @param {SyncInput} [body]
|
||||
* @param {*} [options] Override http request option.
|
||||
* @throws {RequiredError}
|
||||
*/
|
||||
apiSysRegionSyncRegionStatsPost: async (body?: SyncInput, options: AxiosRequestConfig = {}): Promise<RequestArgs> => {
|
||||
const localVarPath = `/api/sysRegion/syncRegionStats`;
|
||||
// use dummy base URL string because the URL constructor only accepts absolute URLs.
|
||||
const localVarUrlObj = new URL(localVarPath, 'https://example.com');
|
||||
let baseOptions;
|
||||
if (configuration) {
|
||||
baseOptions = configuration.baseOptions;
|
||||
}
|
||||
const localVarRequestOptions :AxiosRequestConfig = { method: 'POST', ...baseOptions, ...options};
|
||||
const localVarHeaderParameter = {} as any;
|
||||
const localVarQueryParameter = {} as any;
|
||||
|
||||
// authentication Bearer required
|
||||
// http bearer authentication required
|
||||
if (configuration && configuration.accessToken) {
|
||||
const accessToken = typeof configuration.accessToken === 'function'
|
||||
? await configuration.accessToken()
|
||||
: await configuration.accessToken;
|
||||
localVarHeaderParameter["Authorization"] = "Bearer " + accessToken;
|
||||
}
|
||||
|
||||
localVarHeaderParameter['Content-Type'] = 'application/json-patch+json';
|
||||
|
||||
const query = new URLSearchParams(localVarUrlObj.search);
|
||||
for (const key in localVarQueryParameter) {
|
||||
query.set(key, localVarQueryParameter[key]);
|
||||
}
|
||||
for (const key in options.params) {
|
||||
query.set(key, options.params[key]);
|
||||
}
|
||||
localVarUrlObj.search = (new URLSearchParams(query)).toString();
|
||||
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
|
||||
localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers};
|
||||
const needsSerialization = (typeof body !== "string") || localVarRequestOptions.headers['Content-Type'] === 'application/json';
|
||||
localVarRequestOptions.data = needsSerialization ? JSON.stringify(body !== undefined ? body : {}) : (body || "");
|
||||
|
||||
return {
|
||||
url: localVarUrlObj.pathname + localVarUrlObj.search + localVarUrlObj.hash,
|
||||
options: localVarRequestOptions,
|
||||
};
|
||||
},
|
||||
/**
|
||||
*
|
||||
* @summary 同步行政区划数据(天地图行政区划) 🔖
|
||||
@ -474,7 +474,7 @@ export const SysRegionApiAxiosParamCreator = function (configuration?: Configura
|
||||
},
|
||||
/**
|
||||
*
|
||||
* @summary 更新行政区域 🔖
|
||||
* @summary 更新行政区划 🔖
|
||||
* @param {UpdateRegionInput} [body]
|
||||
* @param {*} [options] Override http request option.
|
||||
* @throws {RequiredError}
|
||||
@ -531,7 +531,7 @@ export const SysRegionApiFp = function(configuration?: Configuration) {
|
||||
return {
|
||||
/**
|
||||
*
|
||||
* @summary 增加行政区域 🔖
|
||||
* @summary 增加行政区划 🔖
|
||||
* @param {AddRegionInput} [body]
|
||||
* @param {*} [options] Override http request option.
|
||||
* @throws {RequiredError}
|
||||
@ -545,7 +545,7 @@ export const SysRegionApiFp = function(configuration?: Configuration) {
|
||||
},
|
||||
/**
|
||||
*
|
||||
* @summary 删除行政区域 🔖
|
||||
* @summary 删除行政区划 🔖
|
||||
* @param {DeleteRegionInput} [body]
|
||||
* @param {*} [options] Override http request option.
|
||||
* @throws {RequiredError}
|
||||
@ -573,7 +573,7 @@ export const SysRegionApiFp = function(configuration?: Configuration) {
|
||||
},
|
||||
/**
|
||||
*
|
||||
* @summary 获取行政区域列表 🔖
|
||||
* @summary 获取行政区划列表 🔖
|
||||
* @param {number} id 主键Id
|
||||
* @param {*} [options] Override http request option.
|
||||
* @throws {RequiredError}
|
||||
@ -587,7 +587,7 @@ export const SysRegionApiFp = function(configuration?: Configuration) {
|
||||
},
|
||||
/**
|
||||
*
|
||||
* @summary 获取行政区域分页列表 🔖
|
||||
* @summary 获取行政区划分页列表 🔖
|
||||
* @param {PageRegionInput} [body]
|
||||
* @param {*} [options] Override http request option.
|
||||
* @throws {RequiredError}
|
||||
@ -601,7 +601,7 @@ export const SysRegionApiFp = function(configuration?: Configuration) {
|
||||
},
|
||||
/**
|
||||
*
|
||||
* @summary 查询行政区域列表 🔖 post参数方便参数扩展,调用api不用大浮动修复,参数如果是对象不建议用[FromQuery]方式传参
|
||||
* @summary 查询行政区划列表 🔖 post参数方便参数扩展,调用api不用大浮动修复,参数如果是对象不建议用[FromQuery]方式传参
|
||||
* @param {QueryRegionInput} [body]
|
||||
* @param {*} [options] Override http request option.
|
||||
* @throws {RequiredError}
|
||||
@ -613,6 +613,20 @@ export const SysRegionApiFp = function(configuration?: Configuration) {
|
||||
return axios.request(axiosRequestArgs);
|
||||
};
|
||||
},
|
||||
/**
|
||||
*
|
||||
* @summary 同步行政区划(高德) 🔖
|
||||
* @param {string} key
|
||||
* @param {*} [options] Override http request option.
|
||||
* @throws {RequiredError}
|
||||
*/
|
||||
async apiSysRegionSyncRegionGDKeyPost(key: string, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => Promise<AxiosResponse<void>>> {
|
||||
const localVarAxiosArgs = await SysRegionApiAxiosParamCreator(configuration).apiSysRegionSyncRegionGDKeyPost(key, options);
|
||||
return (axios: AxiosInstance = globalAxios, basePath: string = BASE_PATH) => {
|
||||
const axiosRequestArgs :AxiosRequestConfig = {...localVarAxiosArgs.options, url: basePath + localVarAxiosArgs.url};
|
||||
return axios.request(axiosRequestArgs);
|
||||
};
|
||||
},
|
||||
/**
|
||||
*
|
||||
* @summary 同步行政区划数据(国家地名信息库,最多支持2级深度) 🔖
|
||||
@ -627,20 +641,6 @@ export const SysRegionApiFp = function(configuration?: Configuration) {
|
||||
return axios.request(axiosRequestArgs);
|
||||
};
|
||||
},
|
||||
/**
|
||||
*
|
||||
* @summary 同步行政区域(国家统计局) 🔖
|
||||
* @param {SyncInput} [body]
|
||||
* @param {*} [options] Override http request option.
|
||||
* @throws {RequiredError}
|
||||
*/
|
||||
async apiSysRegionSyncRegionStatsPost(body?: SyncInput, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => Promise<AxiosResponse<void>>> {
|
||||
const localVarAxiosArgs = await SysRegionApiAxiosParamCreator(configuration).apiSysRegionSyncRegionStatsPost(body, options);
|
||||
return (axios: AxiosInstance = globalAxios, basePath: string = BASE_PATH) => {
|
||||
const axiosRequestArgs :AxiosRequestConfig = {...localVarAxiosArgs.options, url: basePath + localVarAxiosArgs.url};
|
||||
return axios.request(axiosRequestArgs);
|
||||
};
|
||||
},
|
||||
/**
|
||||
*
|
||||
* @summary 同步行政区划数据(天地图行政区划) 🔖
|
||||
@ -657,7 +657,7 @@ export const SysRegionApiFp = function(configuration?: Configuration) {
|
||||
},
|
||||
/**
|
||||
*
|
||||
* @summary 更新行政区域 🔖
|
||||
* @summary 更新行政区划 🔖
|
||||
* @param {UpdateRegionInput} [body]
|
||||
* @param {*} [options] Override http request option.
|
||||
* @throws {RequiredError}
|
||||
@ -680,7 +680,7 @@ export const SysRegionApiFactory = function (configuration?: Configuration, base
|
||||
return {
|
||||
/**
|
||||
*
|
||||
* @summary 增加行政区域 🔖
|
||||
* @summary 增加行政区划 🔖
|
||||
* @param {AddRegionInput} [body]
|
||||
* @param {*} [options] Override http request option.
|
||||
* @throws {RequiredError}
|
||||
@ -690,7 +690,7 @@ export const SysRegionApiFactory = function (configuration?: Configuration, base
|
||||
},
|
||||
/**
|
||||
*
|
||||
* @summary 删除行政区域 🔖
|
||||
* @summary 删除行政区划 🔖
|
||||
* @param {DeleteRegionInput} [body]
|
||||
* @param {*} [options] Override http request option.
|
||||
* @throws {RequiredError}
|
||||
@ -710,7 +710,7 @@ export const SysRegionApiFactory = function (configuration?: Configuration, base
|
||||
},
|
||||
/**
|
||||
*
|
||||
* @summary 获取行政区域列表 🔖
|
||||
* @summary 获取行政区划列表 🔖
|
||||
* @param {number} id 主键Id
|
||||
* @param {*} [options] Override http request option.
|
||||
* @throws {RequiredError}
|
||||
@ -720,7 +720,7 @@ export const SysRegionApiFactory = function (configuration?: Configuration, base
|
||||
},
|
||||
/**
|
||||
*
|
||||
* @summary 获取行政区域分页列表 🔖
|
||||
* @summary 获取行政区划分页列表 🔖
|
||||
* @param {PageRegionInput} [body]
|
||||
* @param {*} [options] Override http request option.
|
||||
* @throws {RequiredError}
|
||||
@ -730,7 +730,7 @@ export const SysRegionApiFactory = function (configuration?: Configuration, base
|
||||
},
|
||||
/**
|
||||
*
|
||||
* @summary 查询行政区域列表 🔖 post参数方便参数扩展,调用api不用大浮动修复,参数如果是对象不建议用[FromQuery]方式传参
|
||||
* @summary 查询行政区划列表 🔖 post参数方便参数扩展,调用api不用大浮动修复,参数如果是对象不建议用[FromQuery]方式传参
|
||||
* @param {QueryRegionInput} [body]
|
||||
* @param {*} [options] Override http request option.
|
||||
* @throws {RequiredError}
|
||||
@ -738,6 +738,16 @@ export const SysRegionApiFactory = function (configuration?: Configuration, base
|
||||
async apiSysRegionQueryPost(body?: QueryRegionInput, options?: AxiosRequestConfig): Promise<AxiosResponse<AdminResultListSysRegion>> {
|
||||
return SysRegionApiFp(configuration).apiSysRegionQueryPost(body, options).then((request) => request(axios, basePath));
|
||||
},
|
||||
/**
|
||||
*
|
||||
* @summary 同步行政区划(高德) 🔖
|
||||
* @param {string} key
|
||||
* @param {*} [options] Override http request option.
|
||||
* @throws {RequiredError}
|
||||
*/
|
||||
async apiSysRegionSyncRegionGDKeyPost(key: string, options?: AxiosRequestConfig): Promise<AxiosResponse<void>> {
|
||||
return SysRegionApiFp(configuration).apiSysRegionSyncRegionGDKeyPost(key, options).then((request) => request(axios, basePath));
|
||||
},
|
||||
/**
|
||||
*
|
||||
* @summary 同步行政区划数据(国家地名信息库,最多支持2级深度) 🔖
|
||||
@ -748,16 +758,6 @@ export const SysRegionApiFactory = function (configuration?: Configuration, base
|
||||
async apiSysRegionSyncRegionMcaCodePost(code: number, options?: AxiosRequestConfig): Promise<AxiosResponse<AdminResultInt32>> {
|
||||
return SysRegionApiFp(configuration).apiSysRegionSyncRegionMcaCodePost(code, options).then((request) => request(axios, basePath));
|
||||
},
|
||||
/**
|
||||
*
|
||||
* @summary 同步行政区域(国家统计局) 🔖
|
||||
* @param {SyncInput} [body]
|
||||
* @param {*} [options] Override http request option.
|
||||
* @throws {RequiredError}
|
||||
*/
|
||||
async apiSysRegionSyncRegionStatsPost(body?: SyncInput, options?: AxiosRequestConfig): Promise<AxiosResponse<void>> {
|
||||
return SysRegionApiFp(configuration).apiSysRegionSyncRegionStatsPost(body, options).then((request) => request(axios, basePath));
|
||||
},
|
||||
/**
|
||||
*
|
||||
* @summary 同步行政区划数据(天地图行政区划) 🔖
|
||||
@ -770,7 +770,7 @@ export const SysRegionApiFactory = function (configuration?: Configuration, base
|
||||
},
|
||||
/**
|
||||
*
|
||||
* @summary 更新行政区域 🔖
|
||||
* @summary 更新行政区划 🔖
|
||||
* @param {UpdateRegionInput} [body]
|
||||
* @param {*} [options] Override http request option.
|
||||
* @throws {RequiredError}
|
||||
@ -790,7 +790,7 @@ export const SysRegionApiFactory = function (configuration?: Configuration, base
|
||||
export class SysRegionApi extends BaseAPI {
|
||||
/**
|
||||
*
|
||||
* @summary 增加行政区域 🔖
|
||||
* @summary 增加行政区划 🔖
|
||||
* @param {AddRegionInput} [body]
|
||||
* @param {*} [options] Override http request option.
|
||||
* @throws {RequiredError}
|
||||
@ -801,7 +801,7 @@ export class SysRegionApi extends BaseAPI {
|
||||
}
|
||||
/**
|
||||
*
|
||||
* @summary 删除行政区域 🔖
|
||||
* @summary 删除行政区划 🔖
|
||||
* @param {DeleteRegionInput} [body]
|
||||
* @param {*} [options] Override http request option.
|
||||
* @throws {RequiredError}
|
||||
@ -823,7 +823,7 @@ export class SysRegionApi extends BaseAPI {
|
||||
}
|
||||
/**
|
||||
*
|
||||
* @summary 获取行政区域列表 🔖
|
||||
* @summary 获取行政区划列表 🔖
|
||||
* @param {number} id 主键Id
|
||||
* @param {*} [options] Override http request option.
|
||||
* @throws {RequiredError}
|
||||
@ -834,7 +834,7 @@ export class SysRegionApi extends BaseAPI {
|
||||
}
|
||||
/**
|
||||
*
|
||||
* @summary 获取行政区域分页列表 🔖
|
||||
* @summary 获取行政区划分页列表 🔖
|
||||
* @param {PageRegionInput} [body]
|
||||
* @param {*} [options] Override http request option.
|
||||
* @throws {RequiredError}
|
||||
@ -845,7 +845,7 @@ export class SysRegionApi extends BaseAPI {
|
||||
}
|
||||
/**
|
||||
*
|
||||
* @summary 查询行政区域列表 🔖 post参数方便参数扩展,调用api不用大浮动修复,参数如果是对象不建议用[FromQuery]方式传参
|
||||
* @summary 查询行政区划列表 🔖 post参数方便参数扩展,调用api不用大浮动修复,参数如果是对象不建议用[FromQuery]方式传参
|
||||
* @param {QueryRegionInput} [body]
|
||||
* @param {*} [options] Override http request option.
|
||||
* @throws {RequiredError}
|
||||
@ -854,6 +854,17 @@ export class SysRegionApi extends BaseAPI {
|
||||
public async apiSysRegionQueryPost(body?: QueryRegionInput, options?: AxiosRequestConfig) : Promise<AxiosResponse<AdminResultListSysRegion>> {
|
||||
return SysRegionApiFp(this.configuration).apiSysRegionQueryPost(body, options).then((request) => request(this.axios, this.basePath));
|
||||
}
|
||||
/**
|
||||
*
|
||||
* @summary 同步行政区划(高德) 🔖
|
||||
* @param {string} key
|
||||
* @param {*} [options] Override http request option.
|
||||
* @throws {RequiredError}
|
||||
* @memberof SysRegionApi
|
||||
*/
|
||||
public async apiSysRegionSyncRegionGDKeyPost(key: string, options?: AxiosRequestConfig) : Promise<AxiosResponse<void>> {
|
||||
return SysRegionApiFp(this.configuration).apiSysRegionSyncRegionGDKeyPost(key, options).then((request) => request(this.axios, this.basePath));
|
||||
}
|
||||
/**
|
||||
*
|
||||
* @summary 同步行政区划数据(国家地名信息库,最多支持2级深度) 🔖
|
||||
@ -865,17 +876,6 @@ export class SysRegionApi extends BaseAPI {
|
||||
public async apiSysRegionSyncRegionMcaCodePost(code: number, options?: AxiosRequestConfig) : Promise<AxiosResponse<AdminResultInt32>> {
|
||||
return SysRegionApiFp(this.configuration).apiSysRegionSyncRegionMcaCodePost(code, options).then((request) => request(this.axios, this.basePath));
|
||||
}
|
||||
/**
|
||||
*
|
||||
* @summary 同步行政区域(国家统计局) 🔖
|
||||
* @param {SyncInput} [body]
|
||||
* @param {*} [options] Override http request option.
|
||||
* @throws {RequiredError}
|
||||
* @memberof SysRegionApi
|
||||
*/
|
||||
public async apiSysRegionSyncRegionStatsPost(body?: SyncInput, options?: AxiosRequestConfig) : Promise<AxiosResponse<void>> {
|
||||
return SysRegionApiFp(this.configuration).apiSysRegionSyncRegionStatsPost(body, options).then((request) => request(this.axios, this.basePath));
|
||||
}
|
||||
/**
|
||||
*
|
||||
* @summary 同步行政区划数据(天地图行政区划) 🔖
|
||||
@ -889,7 +889,7 @@ export class SysRegionApi extends BaseAPI {
|
||||
}
|
||||
/**
|
||||
*
|
||||
* @summary 更新行政区域 🔖
|
||||
* @summary 更新行政区划 🔖
|
||||
* @param {UpdateRegionInput} [body]
|
||||
* @param {*} [options] Override http request option.
|
||||
* @throws {RequiredError}
|
||||
|
||||
@ -346,7 +346,6 @@ export * from './sql-sugar-paged-list-user-output';
|
||||
export * from './status-enum';
|
||||
export * from './struct-layout-attribute';
|
||||
export * from './swagger-submit-url-body';
|
||||
export * from './sync-input';
|
||||
export * from './sync-sys-ldap-input';
|
||||
export * from './sys-code-gen';
|
||||
export * from './sys-code-gen-config';
|
||||
|
||||
@ -1,38 +0,0 @@
|
||||
/* tslint:disable */
|
||||
/* eslint-disable */
|
||||
/**
|
||||
* Admin.NET 通用权限开发平台
|
||||
* 让 .NET 开发更简单、更通用、更流行。整合最新技术,模块插件式开发,前后端分离,开箱即用。<br/><u><b><font color='FF0000'> 👮不得利用本项目从事危害国家安全、扰乱社会秩序、侵犯他人合法权益等法律法规禁止的活动!任何基于本项目二次开发而产生的一切法律纠纷和责任,我们不承担任何责任!</font></b></u>
|
||||
*
|
||||
* OpenAPI spec version: 1.0.0
|
||||
*
|
||||
*
|
||||
* NOTE: This class is auto generated by the swagger code generator program.
|
||||
* https://github.com/swagger-api/swagger-codegen.git
|
||||
* Do not edit the class manually.
|
||||
*/
|
||||
|
||||
/**
|
||||
*
|
||||
*
|
||||
* @export
|
||||
* @interface SyncInput
|
||||
*/
|
||||
export interface SyncInput {
|
||||
|
||||
/**
|
||||
* 指定省
|
||||
*
|
||||
* @type {string}
|
||||
* @memberof SyncInput
|
||||
*/
|
||||
province?: string | null;
|
||||
|
||||
/**
|
||||
* 指定市
|
||||
*
|
||||
* @type {string}
|
||||
* @memberof SyncInput
|
||||
*/
|
||||
city?: string | null;
|
||||
}
|
||||
@ -85,6 +85,14 @@ export interface SysOAuthUser {
|
||||
*/
|
||||
isDelete?: boolean;
|
||||
|
||||
/**
|
||||
* 邮箱
|
||||
*
|
||||
* @type {string}
|
||||
* @memberof SysOAuthUser
|
||||
*/
|
||||
email?: string | null;
|
||||
|
||||
/**
|
||||
* 系统用户Id
|
||||
*
|
||||
@ -147,14 +155,6 @@ export interface SysOAuthUser {
|
||||
*/
|
||||
avatar?: string | null;
|
||||
|
||||
/**
|
||||
* 邮箱
|
||||
*
|
||||
* @type {string}
|
||||
* @memberof SysOAuthUser
|
||||
*/
|
||||
email?: string | null;
|
||||
|
||||
/**
|
||||
* 手机号码
|
||||
*
|
||||
|
||||
@ -9,25 +9,20 @@
|
||||
</template>
|
||||
<div style="color: red; padding: 10px 10px; background: #faecd8; margin-bottom: 10px">
|
||||
<el-icon style="transform: translateY(2px)"><ele-Bell /></el-icon>
|
||||
<span> 不建议不指定任何省市名称直接生成全国区划数据,数据超大! </span>
|
||||
<span> 此操作会更新行政区划表所有数据,请慎重操作!!! </span>
|
||||
</div>
|
||||
<el-form :model="state.ruleForm" ref="ruleFormRef" label-width="auto" label-position="top">
|
||||
<el-row :gutter="10">
|
||||
<el-col :xs="24" :sm="24" :md="24" :lg="24" :xl="24" class="mb20">
|
||||
<el-form-item label="省级名称">
|
||||
<el-input v-model="state.ruleForm.province" placeholder="指定省级名称" clearable />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :xs="24" :sm="24" :md="24" :lg="24" :xl="24" class="mb20">
|
||||
<el-form-item label="市级名称">
|
||||
<el-input v-model="state.ruleForm.city" placeholder="指定市级名称" clearable />
|
||||
<el-form-item label="高德地图开发者Key" prop="key" :rules="[{ required: true, message: '高德地图开发者Key不能为空', trigger: 'blur' }]">
|
||||
<el-input v-model="state.ruleForm.key" placeholder="高德地图开发者Key" clearable />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-form>
|
||||
<template #footer>
|
||||
<span class="dialog-footer">
|
||||
<a href="https://www.stats.gov.cn/sj/tjbz/tjyqhdmhcxhfdm/2023/index.html" target="_blank" style="float: left">查看区划名称:国家统计局</a>
|
||||
<a href="https://lbs.amap.com/" target="_blank" style="float: left">高德开发平台</a>
|
||||
<el-button @click="cancel">取 消</el-button>
|
||||
<el-button type="primary" :loading="state.loading" @click="submit">确 定</el-button>
|
||||
</span>
|
||||
@ -76,10 +71,11 @@ const submit = () => {
|
||||
ruleFormRef.value.validate(async (valid: boolean) => {
|
||||
if (!valid) return;
|
||||
|
||||
if (state.ruleForm.city && !state.ruleForm.province) {
|
||||
ElMessage.error('不能单独指定市级!');
|
||||
if (state.ruleForm.key == null || state.ruleForm.key == '' || state.ruleForm.key.length < 30) {
|
||||
ElMessage.error('请正确输入高德地图开发者 Key 值');
|
||||
return;
|
||||
}
|
||||
|
||||
ElNotification({
|
||||
title: '提示',
|
||||
message: '努力同步中...',
|
||||
@ -87,7 +83,7 @@ const submit = () => {
|
||||
position: 'bottom-right',
|
||||
});
|
||||
state.loading = true;
|
||||
await getAPI(SysRegionApi).apiSysRegionSyncRegionStatsPost(state.ruleForm);
|
||||
await getAPI(SysRegionApi).apiSysRegionSyncRegionGDKeyPost(state.ruleForm.key);
|
||||
closeDialog();
|
||||
|
||||
ElMessage.success('生成成功');
|
||||
@ -18,7 +18,7 @@
|
||||
</el-form>
|
||||
<template #footer>
|
||||
<span class="dialog-footer">
|
||||
<a href="https://www.stats.gov.cn/sj/tjbz/tjyqhdmhcxhfdm/2023/index.html" target="_blank" style="float: left">查看区划代码:国家统计局</a>
|
||||
<a href="https://dmfw.mca.gov.cn/interface.html" target="_blank" style="float: left">中国·国家地名信息库</a>
|
||||
<el-button @click="cancel">取 消</el-button>
|
||||
<el-button type="primary" :loading="state.loading" @click="submit">确 定</el-button>
|
||||
</span>
|
||||
|
||||
@ -33,7 +33,7 @@
|
||||
</el-form>
|
||||
<template #footer>
|
||||
<span class="dialog-footer">
|
||||
<a href="http://lbs.tianditu.gov.cn/server/administrative2.html" target="_blank" style="float: left">查看行政区划编码:天地图</a>
|
||||
<a href="http://lbs.tianditu.gov.cn/server/administrative2.html" target="_blank" style="float: left">天地图</a>
|
||||
<el-button @click="cancel">取 消</el-button>
|
||||
<el-button type="primary" :loading="state.loading" @click="submit">确 定</el-button>
|
||||
</span>
|
||||
|
||||
@ -42,9 +42,9 @@
|
||||
<el-button type="primary" icon="ele-Fold" @click="handleFold"> 全部折叠 </el-button>
|
||||
</el-button-group>
|
||||
|
||||
<el-button type="danger" icon="ele-Lightning" @click="syncRegionStats" v-auth="'sysRegion/add'"> 同步国家统计局 </el-button>
|
||||
<el-button type="danger" icon="ele-Lightning" @click="syncRegionMca" v-auth="'sysRegion/add'"> 同步国家地名信息库 </el-button>
|
||||
<el-button type="danger" icon="ele-Lightning" @click="syncRegionGD" v-auth="'sysRegion/add'"> 同步高德地图 </el-button>
|
||||
<el-button type="danger" icon="ele-Lightning" @click="syncRegionTianditu" v-auth="'sysRegion/add'"> 同步天地图 </el-button>
|
||||
<el-button type="danger" icon="ele-Lightning" @click="syncRegionMca" v-auth="'sysRegion/add'"> 同步国家地名信息库 </el-button>
|
||||
</template>
|
||||
<template #toolbar_tools> </template>
|
||||
<template #empty>
|
||||
@ -65,7 +65,7 @@
|
||||
</splitpanes>
|
||||
|
||||
<EditRegion ref="editRegionRef" :title="state.title" @handleQuery="handleQuery" />
|
||||
<SyncStatsParam ref="syncStatsParamRef" :title="state.title" @handleQuery="handleQuery" />
|
||||
<SyncGdParam ref="syncGdParamRef" :title="state.title" @handleQuery="handleQuery" />
|
||||
<SyncMcaParam ref="syncMcaParamRef" :title="state.title" @handleQuery="handleQuery" />
|
||||
<SyncTdtParam ref="syncTdtParamRef" :title="state.title" @handleQuery="handleQuery" />
|
||||
<GenOrgLevel ref="genOrgLevelRef" :title="state.title" @handleQuery="handleQuery" />
|
||||
@ -81,12 +81,12 @@ import { Local } from '/@/utils/storage';
|
||||
import { Splitpanes, Pane } from 'splitpanes';
|
||||
import 'splitpanes/dist/splitpanes.css';
|
||||
|
||||
import RegionTree from '/@/views/system/region/component/regionTree.vue';
|
||||
import EditRegion from '/@/views/system/region/component/editRegion.vue';
|
||||
import SyncStatsParam from '/@/views/system/region/component/syncStatsParam.vue';
|
||||
import SyncMcaParam from '/@/views/system/region/component/syncMcaParam.vue';
|
||||
import SyncTdtParam from '/@/views/system/region/component/syncTdtParam.vue';
|
||||
import GenOrgLevel from '/@/views/system/region/component/genOrgLevel.vue';
|
||||
import RegionTree from './component/regionTree.vue';
|
||||
import EditRegion from './component/editRegion.vue';
|
||||
import SyncGdParam from './component/syncGdParam.vue';
|
||||
import SyncMcaParam from './component/syncMcaParam.vue';
|
||||
import SyncTdtParam from './component/syncTdtParam.vue';
|
||||
import GenOrgLevel from './component/genOrgLevel.vue';
|
||||
|
||||
import { getAPI } from '/@/utils/axios-utils';
|
||||
import { SysRegionApi } from '/@/api-services/api';
|
||||
@ -94,7 +94,7 @@ import { SysRegion, PageRegionInput } from '/@/api-services/models';
|
||||
|
||||
const xGrid = ref<VxeGridInstance>();
|
||||
const editRegionRef = ref<InstanceType<typeof EditRegion>>();
|
||||
const syncStatsParamRef = ref<InstanceType<typeof SyncStatsParam>>();
|
||||
const syncGdParamRef = ref<InstanceType<typeof SyncGdParam>>();
|
||||
const syncMcaParamRef = ref<InstanceType<typeof SyncMcaParam>>();
|
||||
const syncTdtParamRef = ref<InstanceType<typeof SyncTdtParam>>();
|
||||
const genOrgLevelRef = ref<InstanceType<typeof GenOrgLevel>>();
|
||||
@ -234,10 +234,10 @@ const handleNodeChange = async (node: any) => {
|
||||
await handleQuery();
|
||||
};
|
||||
|
||||
// 同步国家统计局
|
||||
const syncRegionStats = async () => {
|
||||
state.title = '同步国家统计局';
|
||||
syncStatsParamRef.value?.openDialog();
|
||||
// 同步高德地图
|
||||
const syncRegionGD = async () => {
|
||||
state.title = '同步高德地图';
|
||||
syncGdParamRef.value?.openDialog();
|
||||
};
|
||||
|
||||
// 同步国家地名信息库
|
||||
|
||||
Loading…
Reference in New Issue
Block a user