| | |
| | | IRepository<DictionaryCategory> repDictionaryCategory |
| | | ) : |
| | | IRequestHandler<SaveDictionaryDataCommand, Guid>, |
| | | IRequestHandler<SetDictionaryDataIsDisabledCommand, int> |
| | | IRequestHandler<SetDictionaryDataIsDisabledCommand, int>, |
| | | IRequestHandler<SyncHumanResourcesAreaDictionaryDataCommand, int> |
| | | |
| | | { |
| | | private readonly IRepository<DictionaryData> rep = rep; |
| | |
| | | .FirstOrDefaultAsync(); |
| | | if (category == null) throw Oops.Oh(EnumErrorCodeType.s404, "数据字典类别"); |
| | | request.CategoryId = category.Id; |
| | | if (!request.Code.StartsWith($"{request.CategoryCode}-")) throw Oops.Oh(EnumErrorCodeType.s400, "编号开头需要包含类别编号-"); |
| | | if (!request.Code.StartsWith($"{category.Code}-")) throw Oops.Oh(EnumErrorCodeType.s400, "编号开头需要包含类别编号-"); |
| | | return await request.SaveData<DictionaryData, SaveDictionaryDataCommand>( |
| | | null, |
| | | it => |
| | |
| | | { |
| | | 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; |
| | | } |
| | | } |
| | | } |