lingling
2025-03-18 69fd468746d430cbdb5c63424f6e13a4f98a91fc
添加日志
6个文件已添加
3个文件已修改
457 ■■■■■ 已修改文件
LifePayment/LifePayment.Application.Contracts/Setting/IOperateHistoryService.cs 17 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
LifePayment/LifePayment.Application.Contracts/Setting/OperateHistoryDto.cs 74 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
LifePayment/LifePayment.Application/Setting/OperateHistoryService.cs 75 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
LifePayment/LifePayment.Domain.Shared/Enum/OperateHistory/OperateHistoryTypeEnum.cs 153 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
LifePayment/LifePayment.Domain/Common/OperateHistory.cs 35 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
LifePayment/LifePayment.EntityFrameworkCore/LifePaymentServicesDbContext.cs 3 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
LifePayment/LifePayment.Host/LifePaymentService.HttpApi.xml 14 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
LifePayment/LifePayment.Host/LifePaymentServices.Application.Contracts.xml 40 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
LifePayment/LifePayment.HttpApi/LifePay/OperateHistoryController.cs 46 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
LifePayment/LifePayment.Application.Contracts/Setting/IOperateHistoryService.cs
New file
@@ -0,0 +1,17 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Volo.Abp.Application.Services;
using ZeroD.Util;
namespace LifePayment.Application.Contracts
{
    public interface IOperateHistoryService : IApplicationService
    {
        Task<PageOutput<OperateHistoryDto>> GetOperateHistoryByRelationId(GetOperateHistoryInput input);
        Task<PageOutput<OperateHistoryDto>> GetOperateHistoryByType(QueryOperateHistoryByTypeInput input);
    }
}
LifePayment/LifePayment.Application.Contracts/Setting/OperateHistoryDto.cs
New file
@@ -0,0 +1,74 @@
using LifePayment.Domain.Shared;
using System;
using ZeroD.Util;
namespace LifePayment.Application.Contracts
{
    public class OperateHistoryDto
    {
        /// <summary>
        /// 关联关系ID
        /// </summary>
        public Guid RelationId { get; set; }
        /// <summary>
        /// 表名
        /// </summary>
        public int? TableType { get; set; }
        /// <summary>
        /// 操作
        /// </summary>
        public string OperateName { get; set; }
        /// <summary>
        /// 操作内容
        /// </summary>
        public string OperateContent { get; set; }
        /// <summary>
        /// 操作人
        /// </summary>
        public string CreatorName { get; set; }
        /// <summary>
        /// 操作时间
        /// </summary>
        public DateTime CreationTime { get; set; }
        /// <summary>
        /// 操作细节
        /// </summary>
        public string OperateDetail { get; set; }
    }
    public class GetOperateHistoryInput : PageInput
    {
        public Guid RelationId { get; set; }
        public string OperateName { get; set; }
    }
    public class QueryOperateHistoryByTypeInput : PageInput
    {
        public Guid TypeId { get; set; }
        public OperateHistoryTypeEnum OperateHistoryType { get; set; }
    }
    public class CreateOperateHistoryInput
    {
        /// <summary>
        /// 关联关系ID
        /// </summary>
        public Guid RelationId { get; set; }
        public int? TableType { get; set; }
        public string OperateName { get; set; }
        public string OperateContent { get; set; }
        public string CreatorName { get; set; }
    }
}
LifePayment/LifePayment.Application/Setting/OperateHistoryService.cs
New file
@@ -0,0 +1,75 @@
using LifePayment.Application.Contracts;
using LifePayment.Domain.Models;
using LifePayment.Domain.Shared;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Linq.Dynamic.Core;
using System.Threading.Tasks;
using Volo.Abp.Application.Services;
using Volo.Abp.Domain.Repositories;
using ZeroD.Util;
namespace LifePayment.Application
{
    public class OperateHistoryService : ApplicationService, IOperateHistoryService
    {
        private readonly IRepository<OperateHistory, Guid> _operateHistory;
        public OperateHistoryService(
               IRepository<OperateHistory, Guid> operateHistory)
        {
            _operateHistory = operateHistory;
        }
        public async Task<PageOutput<OperateHistoryDto>> GetOperateHistoryByRelationId(GetOperateHistoryInput input)
        {
            var query = _operateHistory.Where(r => r.RelationId == input.RelationId)
                                       .WhereIf(input.OperateName.IsNotNullOrEmpty(), r => r.OperateName == input.OperateName)
                                       .Select(r => new OperateHistoryDto
                                       {
                                           OperateName = r.OperateName,
                                           RelationId = r.RelationId,
                                           CreationTime = r.CreationTime,
                                           CreatorName = r.CreatorName,
                                           OperateContent = r.OperateContent,
                                           TableType = r.TableType
                                       });
            var result = await query.GetPageResult(input.PageModel);
            return result;
        }
        public async Task<PageOutput<OperateHistoryDto>> GetOperateHistoryByType(QueryOperateHistoryByTypeInput input)
        {
            var query = _operateHistory.AsQueryable();
            switch (input.OperateHistoryType)
            {
                case OperateHistoryTypeEnum.AccountManage:
                    query = query.Where(x => x.UserId == input.TypeId
                                          && LifePaymentConstant.LogsSpecies.AccountManageOperateNameList.Contains(x.OperateName));
                    break;
                default:
                    query = query.Where(x => x.RelationId == input.TypeId);
                    break;
            }
            var result = await query.Select(r =>
                                            new OperateHistoryDto
                                            {
                                                OperateName = r.OperateName,
                                                RelationId = r.RelationId,
                                                CreationTime = r.CreationTime,
                                                CreatorName = r.CreatorName,
                                                OperateContent = r.OperateContent,
                                                TableType = r.TableType
                                            })
                                    .GetPageResult(input.PageModel);
            return result;
        }
    }
}
LifePayment/LifePayment.Domain.Shared/Enum/OperateHistory/OperateHistoryTypeEnum.cs
New file
@@ -0,0 +1,153 @@
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace LifePayment.Domain.Shared;
public enum OperateHistoryTypeEnum
{
    /// <summary>
    /// 认证用户日志
    /// </summary>
    [Description("认证用户日志")]
    CertifiedUser = 10,
    /// <summary>
    /// 平台用户日志
    /// </summary>
    [Description("平台用户日志")]
    PlatformUser = 11,
    /// <summary>
    /// 用户认证审核日志
    /// </summary>
    [Description("用户认证审核日志")]
    UserCertificationAudit = 12,
    /// <summary>
    /// 公告日志
    /// </summary>
    [Description("公告日志")]
    SystemNotice = 13,
    /// <summary>
    /// 资讯管理日志
    /// </summary>
    [Description("资讯管理日志")]
    InformationForManage = 14,
    /// <summary>
    /// 资讯审核日志
    /// </summary>
    [Description("资讯审核日志")]
    InformationWaitForCheck = 15,
    /// <summary>
    /// 钱包开户日志
    /// </summary>
    [Description("钱包开户日志")]
    WalletAccountOpen = 16,
    /// <summary>
    /// 转账审核对单日志
    /// </summary>
    [Description("转账审核对单日志")]
    WalletSingleTransfer = 17,
    /// <summary>
    /// 充值审核
    /// </summary>
    [Description("充值审核日志")]
    WalletRecharge = 18,
    /// <summary>
    /// 账户管理
    /// </summary>
    [Description("账户管理")]
    AccountManage = 19,
    /// <summary>
    /// 认证管理
    /// </summary>
    [Description("认证管理")]
    UserCertificationManage = 20,
    /// <summary>
    /// 批量转账审核日志
    /// </summary>
    [Description("批量转账审核日志")]
    AuditWalletBatchTransfer = 21,
    /// <summary>
    /// 行业机构审核日志
    /// </summary>
    [Description("行业机构审核日志")]
    IndustryBodyAudit = 22,
    /// <summary>
    /// 行业配套审核日志
    /// </summary>
    [Description("行业配套审核日志")]
    IndustryMatingAudit = 23,
    /// <summary>
    /// 甲方企业审核日志
    /// </summary>
    [Description("甲方企业审核日志")]
    FirstPartyCompanyAudit = 24,
    /// <summary>
    /// 人资公司审核日志
    /// </summary>
    [Description("人资公司审核日志")]
    ParkOrHRAudit = 25,
    /// <summary>
    /// 行业机构管理日志
    /// </summary>
    [Description("行业机构管理日志")]
    IndustryBodyManage = 26,
    /// <summary>
    /// 行业配套管理日志
    /// </summary>
    [Description("行业配套管理日志")]
    IndustryMatingManage = 27,
    /// <summary>
    /// 甲方企业管理日志
    /// </summary>
    [Description("甲方企业管理日志")]
    FirstPartyCompanyManage = 28,
    /// <summary>
    /// 人资公司管理日志
    /// </summary>
    [Description("人资公司管理日志")]
    ParkOrHRManage = 29,
    /// <summary>
    /// 客户管理日志
    /// </summary>
    [Description("客户管理日志")]
    CustomerManage = 30,
    /// <summary>
    /// 奖励配置日志
    /// </summary>
    [Description("奖励配置日志")]
    ParkRewardManage = 31,
    /// <summary>
    /// 客户模板操作日志
    /// </summary>
    [Description("客户模板操作日志")]
    CustomerContractTemplate = 32,
    LifePayOrder = 40,
    LifePayChannles = 42,
}
LifePayment/LifePayment.Domain/Common/OperateHistory.cs
New file
@@ -0,0 +1,35 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Volo.Abp.Domain.Entities.Auditing;
namespace LifePayment.Domain.Models
{
    public class OperateHistory : CreationAuditedEntity<Guid>
    {
        /// <summary>
        /// 关联关系ID
        /// </summary>
        public Guid RelationId { get; set; }
        public int? TableType { get; set; }
        public string OperateName { get; set; }
        public string OperateContent { get; set; }
        public string CreatorName { get; set; }
        /// <summary>
        /// 操作细节
        /// </summary>
        public string OperateDetail { get; set; }
        /// <summary>
        /// 用户id
        /// </summary>
        public Guid? UserId { get; set; }
    }
}
LifePayment/LifePayment.EntityFrameworkCore/LifePaymentServicesDbContext.cs
@@ -28,8 +28,11 @@
        public virtual DbSet<Role> Roles { get; set; }
        public virtual DbSet<UserRole> UserRoles { get; set; }
        public virtual DbSet<OperateHistory> OperateHistory { get; set; }
        public virtual DbSet<LifePayChannles> LifePayChannles { get; set; }
        public virtual DbSet<LifePayAccount> LifePayAccount { get; set; }
LifePayment/LifePayment.Host/LifePaymentService.HttpApi.xml
@@ -278,6 +278,20 @@
            <param name="input"></param>
            <returns></returns>
        </member>
        <member name="M:LifePayment.HttpApi.OperateHistoryController.GetOperateHistoryByRelationId(LifePayment.Application.Contracts.GetOperateHistoryInput)">
            <summary>
            查询日志
            </summary>
            <param name="input"></param>
            <returns></returns>
        </member>
        <member name="M:LifePayment.HttpApi.OperateHistoryController.GetOperateHistoryByType(LifePayment.Application.Contracts.QueryOperateHistoryByTypeInput)">
            <summary>
            根据type查询日志
            </summary>
            <param name="input"></param>
            <returns></returns>
        </member>
        <member name="M:LifePayment.HttpApi.UserRoleController.CreateBackClientUser(LifePayment.Application.Contracts.CreateBackClientUserInput)">
            <summary>
            新增后台管理账户
LifePayment/LifePayment.Host/LifePaymentServices.Application.Contracts.xml
@@ -1298,6 +1298,46 @@
            线下支付汇款最晚时间
            </summary>
        </member>
        <member name="P:LifePayment.Application.Contracts.OperateHistoryDto.RelationId">
            <summary>
            关联关系ID
            </summary>
        </member>
        <member name="P:LifePayment.Application.Contracts.OperateHistoryDto.TableType">
            <summary>
            表名
            </summary>
        </member>
        <member name="P:LifePayment.Application.Contracts.OperateHistoryDto.OperateName">
            <summary>
            操作
            </summary>
        </member>
        <member name="P:LifePayment.Application.Contracts.OperateHistoryDto.OperateContent">
            <summary>
            操作内容
            </summary>
        </member>
        <member name="P:LifePayment.Application.Contracts.OperateHistoryDto.CreatorName">
            <summary>
            操作人
            </summary>
        </member>
        <member name="P:LifePayment.Application.Contracts.OperateHistoryDto.CreationTime">
            <summary>
            操作时间
            </summary>
        </member>
        <member name="P:LifePayment.Application.Contracts.OperateHistoryDto.OperateDetail">
            <summary>
            操作细节
            </summary>
        </member>
        <member name="P:LifePayment.Application.Contracts.CreateOperateHistoryInput.RelationId">
            <summary>
            关联关系ID
            </summary>
        </member>
        <member name="P:LifePayment.Application.Contracts.CreateBackClientUserInput.Name">
            <summary>
            名称
LifePayment/LifePayment.HttpApi/LifePay/OperateHistoryController.cs
New file
@@ -0,0 +1,46 @@
using LifePayment.Application.Contracts;
using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Mvc;
using System.Threading.Tasks;
using Volo.Abp.AspNetCore.Mvc;
using Volo.Abp.Uow;
using ZeroD.Util;
namespace LifePayment.HttpApi
{
    [Route("api/[controller]/[action]")]
    [ApiController]
    [Authorize]
    public class OperateHistoryController : AbpController
    {
        private readonly IOperateHistoryService _operateHistoryService;
        public OperateHistoryController(
               IOperateHistoryService operateHistoryService)
        {
            _operateHistoryService = operateHistoryService;
        }
        /// <summary>
        /// 查询日志
        /// </summary>
        /// <param name="input"></param>
        /// <returns></returns>
        [HttpPost]
        [UnitOfWork(IsDisabled = true)]
        public async Task<PageOutput<OperateHistoryDto>> GetOperateHistoryByRelationId(GetOperateHistoryInput input)
        {
            return await _operateHistoryService.GetOperateHistoryByRelationId(input);
        }
        /// <summary>
        /// 根据type查询日志
        /// </summary>
        /// <param name="input"></param>
        /// <returns></returns>
        [HttpPost]
        [UnitOfWork(IsDisabled = true)]
        public async Task<PageOutput<OperateHistoryDto>> GetOperateHistoryByType(QueryOperateHistoryByTypeInput input)
        {
            return await _operateHistoryService.GetOperateHistoryByType(input);
        }
    }
}