sunpengfei
2025-08-13 42e2cbfcdffa8e4da24681bbd7ad11ea998799de
feat:开发
1个文件已添加
4个文件已修改
85 ■■■■ 已修改文件
FlexJobApi.Core/FlexJobApi.Core.xml 5 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
FlexJobApi.Core/Models/UserServer/EnterpriseEmployees/Commands/EditEnterpriseEmployeeCommand.cs 7 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
FlexJobApi.UserServer.Application/EnterpriseEmployees/Commands/EnterpriseEmployeesCommandHandler.cs 53 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
FlexJobApi.UserServer.Application/FlexJobApi.UserServer.Application.xml 18 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
FlexJobApi.UserServer.Application/UserResumes/Queries/UserResumeQueryHandler.cs 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
FlexJobApi.Core/FlexJobApi.Core.xml
@@ -5662,11 +5662,6 @@
            编辑灵工信息
            </summary>
        </member>
        <member name="P:FlexJobApi.Core.EditEnterpriseEmployeeCommand.Id">
            <summary>
            灵工Id
            </summary>
        </member>
        <member name="P:FlexJobApi.Core.EditEnterpriseEmployeeCommand.Name">
            <summary>
            姓名
FlexJobApi.Core/Models/UserServer/EnterpriseEmployees/Commands/EditEnterpriseEmployeeCommand.cs
@@ -11,13 +11,8 @@
    /// 编辑灵工信息
    /// </summary>
    [Resource([EnumResourceController.EnterpriseEmployee])]
    public class EditEnterpriseEmployeeCommand : IRequest<Guid>
    public class EditEnterpriseEmployeeCommand : SaveDataCommand
    {
        /// <summary>
        /// 灵工Id
        /// </summary>
        public Guid Id { get; set; }
        /// <summary>
        /// 姓名
        /// </summary>
FlexJobApi.UserServer.Application/EnterpriseEmployees/Commands/EnterpriseEmployeesCommandHandler.cs
New file
@@ -0,0 +1,53 @@
using FlexJobApi.Core;
using Furion.DatabaseAccessor;
using Furion.FriendlyException;
using Mapster;
using MediatR;
using Microsoft.EntityFrameworkCore;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace FlexJobApi.UserServer.Application
{
    /// <summary>
    /// 灵工命令处理器
    /// </summary>
    public class EnterpriseEmployeesCommandHandler(
            IRepository<EnterpriseEmployee> rep
        ) :
        IRequestHandler<ImportEnterpriseEmployeesCommand, int>,
        IRequestHandler<EditEnterpriseEmployeeCommand, Guid>
    {
        private readonly IRepository<EnterpriseEmployee> rep = rep;
        public Task<int> Handle(ImportEnterpriseEmployeesCommand request, CancellationToken cancellationToken)
        {
            throw new NotImplementedException();
        }
        /// <summary>
        /// 编辑灵工信息
        /// </summary>
        /// <param name="request"></param>
        /// <param name="cancellationToken"></param>
        /// <returns></returns>
        public Task<Guid> Handle(EditEnterpriseEmployeeCommand request, CancellationToken cancellationToken)
        {
            return request.SaveData<EnterpriseEmployee, EditEnterpriseEmployeeCommand>(
                null,
                null,
                (entity) =>
                {
                    if (request.Id.HasValue && entity.UserId.HasValue)
                    {
                        throw Oops.Oh(EnumErrorCodeType.s510, "该灵工已报名无法修改信息");
                    }
                    request.Adapt(entity);
                },
                cancellationToken);
        }
    }
}
FlexJobApi.UserServer.Application/FlexJobApi.UserServer.Application.xml
@@ -156,6 +156,24 @@
            <param name="all"></param>
            <param name="roleMenuIds"></param>
        </member>
        <member name="T:FlexJobApi.UserServer.Application.EnterpriseEmployeesCommandHandler">
            <summary>
            灵工命令处理器
            </summary>
        </member>
        <member name="M:FlexJobApi.UserServer.Application.EnterpriseEmployeesCommandHandler.#ctor(Furion.DatabaseAccessor.IRepository{FlexJobApi.Core.EnterpriseEmployee})">
            <summary>
            灵工命令处理器
            </summary>
        </member>
        <member name="M:FlexJobApi.UserServer.Application.EnterpriseEmployeesCommandHandler.Handle(FlexJobApi.Core.EditEnterpriseEmployeeCommand,System.Threading.CancellationToken)">
            <summary>
            编辑灵工信息
            </summary>
            <param name="request"></param>
            <param name="cancellationToken"></param>
            <returns></returns>
        </member>
        <member name="T:FlexJobApi.UserServer.Application.EnterpriseEmployeeQueryHandler">
            <summary>
            灵工查询处理器
FlexJobApi.UserServer.Application/UserResumes/Queries/UserResumeQueryHandler.cs
@@ -126,7 +126,7 @@
            if (logier.Type == EnumUserType.Enterprise)
            {
                model.IsCollected = await rep.Change<EnterpriseUserCollect>().AsQueryable().AsNoTracking()
                    .Where(it => it.EnterpriseId == logier.EnterpriseId)
                    .Where(it => it.EnterpriseId == logier.EnterpriseId && it.UserId == model.Id)
                    .Select(it => it.IsCollected)
                    .FirstOrDefaultAsync();
            }