| | |
| | | IRepository<DictionaryCategory> repDictionaryCategory |
| | | ) : |
| | | IRequestHandler<SaveDictionaryDataCommand, Guid>, |
| | | IRequestHandler<SetDictionaryDataIsDisabledCommand, int> |
| | | IRequestHandler<SetDictionaryDataIsDisabledCommand, int>, |
| | | IRequestHandler<SyncHumanResourcesAreaDictionaryDataCommand, int> |
| | | |
| | | { |
| | | private readonly IRepository<DictionaryData> rep = rep; |
| | |
| | | { |
| | | return request.SetIsDisabled<DictionaryData>(cancellationToken: cancellationToken); |
| | | } |
| | | |
| | | public async Task<int> Handle(SyncHumanResourcesAreaDictionaryDataCommand request, CancellationToken cancellationToken) |
| | | { |
| | | var rep = Db.GetRepository<BaseArea, HumanResourcesDbContextLocator>(); |
| | | var areas = await rep.AsQueryable().AsNoTracking() |
| | | .Take(10) |
| | | .ToListAsync(); |
| | | Console.WriteLine(); |
| | | return 1; |
| | | } |
| | | } |
| | | } |
New file |
| | |
| | | using Furion.DatabaseAccessor; |
| | | using System; |
| | | using System.Collections.Generic; |
| | | using System.Linq; |
| | | using System.Text; |
| | | using System.Threading.Tasks; |
| | | |
| | | namespace FlexJobApi.Core |
| | | { |
| | | /// <summary> |
| | | /// 人力资源数据库上下文定位器 |
| | | /// </summary> |
| | | public class HumanResourcesDbContextLocator : IDbContextLocator |
| | | { |
| | | } |
| | | } |
| | |
| | | namespace FlexJobApi.Core |
| | | { |
| | | /// <summary> |
| | | /// 日志数据库 |
| | | /// 日志数据库定位器 |
| | | /// </summary> |
| | | public sealed class LogDbContextLocator : IDbContextLocator |
| | | { |
New file |
| | |
| | | using Furion.DatabaseAccessor; |
| | | using System; |
| | | using System.Collections.Generic; |
| | | using System.Linq; |
| | | using System.Text; |
| | | using System.Threading.Tasks; |
| | | |
| | | namespace FlexJobApi.Core |
| | | { |
| | | /// <summary> |
| | | /// 地区 |
| | | /// </summary> |
| | | public class BaseArea : EntityBase<Guid, HumanResourcesDbContextLocator> |
| | | { |
| | | /// <summary> |
| | | /// 上级地区编号 |
| | | /// </summary> |
| | | public int? ParentId { get; set; } |
| | | |
| | | /// <summary> |
| | | /// 地区编号 |
| | | /// </summary> |
| | | public int AreaCode { get; set; } |
| | | |
| | | /// <summary> |
| | | /// 地区名称 |
| | | /// </summary> |
| | | public string AreaName { get; set; } |
| | | |
| | | /// <summary> |
| | | /// 快捷查询 |
| | | /// </summary> |
| | | public string QuickQuery { get; set; } |
| | | |
| | | /// <summary> |
| | | /// 描述 |
| | | /// </summary> |
| | | public string Description { get; set; } |
| | | |
| | | /// <summary> |
| | | /// 层级 |
| | | /// </summary> |
| | | public int Layer { get; set; } |
| | | |
| | | /// <summary> |
| | | /// 排序 |
| | | /// </summary> |
| | | public int? Sort { get; set; } |
| | | |
| | | /// <summary> |
| | | /// 简拼 |
| | | /// </summary> |
| | | public string SimpleSpelling { get; set; } |
| | | |
| | | /// <summary> |
| | | /// 是否启用 |
| | | /// </summary> |
| | | public bool IsEnable { get; set; } |
| | | } |
| | | } |
| | |
| | | <name>FlexJobApi.Core</name> |
| | | </assembly> |
| | | <members> |
| | | <member name="T:FlexJobApi.Core.HumanResourcesDbContextLocator"> |
| | | <summary> |
| | | 人力资源数据库上下文定位器 |
| | | </summary> |
| | | </member> |
| | | <member name="T:FlexJobApi.Core.LogDbContextLocator"> |
| | | <summary> |
| | | 日志数据库 |
| | | 日志数据库定位器 |
| | | </summary> |
| | | </member> |
| | | <member name="P:FlexJobApi.Core.CommonEntity`1.Sort"> |
| | |
| | | <member name="P:FlexJobApi.Core.Resource.IsExpired"> |
| | | <summary> |
| | | 是否已过期 |
| | | </summary> |
| | | </member> |
| | | <member name="T:FlexJobApi.Core.BaseArea"> |
| | | <summary> |
| | | 地区 |
| | | </summary> |
| | | </member> |
| | | <member name="P:FlexJobApi.Core.BaseArea.ParentId"> |
| | | <summary> |
| | | 上级地区编号 |
| | | </summary> |
| | | </member> |
| | | <member name="P:FlexJobApi.Core.BaseArea.AreaCode"> |
| | | <summary> |
| | | 地区编号 |
| | | </summary> |
| | | </member> |
| | | <member name="P:FlexJobApi.Core.BaseArea.AreaName"> |
| | | <summary> |
| | | 地区名称 |
| | | </summary> |
| | | </member> |
| | | <member name="P:FlexJobApi.Core.BaseArea.QuickQuery"> |
| | | <summary> |
| | | 快捷查询 |
| | | </summary> |
| | | </member> |
| | | <member name="P:FlexJobApi.Core.BaseArea.Description"> |
| | | <summary> |
| | | 描述 |
| | | </summary> |
| | | </member> |
| | | <member name="P:FlexJobApi.Core.BaseArea.Layer"> |
| | | <summary> |
| | | 层级 |
| | | </summary> |
| | | </member> |
| | | <member name="P:FlexJobApi.Core.BaseArea.Sort"> |
| | | <summary> |
| | | 排序 |
| | | </summary> |
| | | </member> |
| | | <member name="P:FlexJobApi.Core.BaseArea.SimpleSpelling"> |
| | | <summary> |
| | | 简拼 |
| | | </summary> |
| | | </member> |
| | | <member name="P:FlexJobApi.Core.BaseArea.IsEnable"> |
| | | <summary> |
| | | 是否启用 |
| | | </summary> |
| | | </member> |
| | | <member name="T:FlexJobApi.Core.ConsoleLog"> |
| | |
| | | 设置数据字典是否禁用 |
| | | </summary> |
| | | </member> |
| | | <member name="T:FlexJobApi.Core.SyncHumanResourcesAreaDictionaryDataCommand"> |
| | | <summary> |
| | | 同步人力资源地区字典数据 |
| | | </summary> |
| | | </member> |
| | | <member name="T:FlexJobApi.Core.GetDictionaryCategoriesQuery"> |
| | | <summary> |
| | | 获取数据字典类别分页列表数据 |
New file |
| | |
| | | using MediatR; |
| | | using System; |
| | | using System.Collections.Generic; |
| | | using System.Linq; |
| | | using System.Text; |
| | | using System.Threading.Tasks; |
| | | |
| | | namespace FlexJobApi.Core |
| | | { |
| | | /// <summary> |
| | | /// 同步人力资源地区字典数据 |
| | | /// </summary> |
| | | [Resource([EnumResourceController.Dictionary])] |
| | | public class SyncHumanResourcesAreaDictionaryDataCommand : IRequest<int> |
| | | { |
| | | } |
| | | } |
New file |
| | |
| | | using FlexJobApi.Core; |
| | | using Furion.DatabaseAccessor; |
| | | using Microsoft.EntityFrameworkCore; |
| | | using Microsoft.EntityFrameworkCore.Diagnostics; |
| | | using System; |
| | | using System.Collections.Generic; |
| | | using System.Linq; |
| | | using System.Text; |
| | | using System.Threading.Tasks; |
| | | |
| | | namespace FlexJobApi.EntityFramework.Core |
| | | { |
| | | /// <summary> |
| | | /// 人力资源数据库上下文 |
| | | /// </summary> |
| | | [AppDbContext("HumanResources", DbProvider.SqlServer)] |
| | | public class HumanResourcesDbContext : AppDbContext<HumanResourcesDbContext, HumanResourcesDbContextLocator> |
| | | { |
| | | public HumanResourcesDbContext(DbContextOptions<HumanResourcesDbContext> options) : base(options) |
| | | { |
| | | } |
| | | |
| | | /// <summary> |
| | | /// 地区 |
| | | /// </summary> |
| | | public DbSet<BaseArea> BaseArea { get; set; } |
| | | } |
| | | } |
| | |
| | | { |
| | | options.AddDbPool<DefaultDbContext>(); |
| | | options.AddDbPool<LogDbContext, LogDbContextLocator>(); |
| | | options.AddDbPool<HumanResourcesDbContext, HumanResourcesDbContextLocator>(); |
| | | }, "FlexJobApi.Database.Migrations"); |
| | | } |
| | | } |
| | |
| | | "$schema": "https://gitee.com/dotnetchina/Furion/raw/v4/schemas/v4/furion-schema.json", |
| | | "ConnectionStrings": { |
| | | "FlexJobApi": "Server=120.26.58.240; Database=Dev_FlexJobApi; User=bole;Password=Bole1472589;Encrypt=false;", |
| | | "FlexJobApiLog": "Server=120.26.58.240; Database=Dev_FlexJobApiLog; User=bole;Password=Bole1472589;Encrypt=false;" |
| | | "FlexJobApiLog": "Server=120.26.58.240; Database=Dev_FlexJobApiLog; User=bole;Password=Bole1472589;Encrypt=false;", |
| | | "HumanResources": "Server=120.26.58.240; Database=Dev_12333; User=bole;Password=Bole1472589;Encrypt=false;" |
| | | }, |
| | | "Consul": { |
| | | "Address": "http://localhost:8500/", |