zhengyuxuan
2025-03-27 72ed026e6dc651e7bd1f77f41face93a7a9f49cb
fix:新增在线客服配置、户号编辑功能优化、用户列表更新
6个文件已修改
3个文件已添加
193 ■■■■■ 已修改文件
LifePayment/LifePayment.Application.Contracts/LifePay/LifePayOutput.cs 8 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
LifePayment/LifePayment.Application.Contracts/Setting/ICommonService.cs 15 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
LifePayment/LifePayment.Application/LifePay/LifePayService.cs 44 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
LifePayment/LifePayment.Application/Setting/CommonService.cs 50 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
LifePayment/LifePayment.Domain/Common/OnlineService.cs 14 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
LifePayment/LifePayment.EntityFrameworkCore/LifePaymentServicesDbContext.cs 3 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
LifePayment/LifePayment.Host/LifePaymentService.HttpApi.xml 13 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
LifePayment/LifePayment.Host/LifePaymentServices.Application.Contracts.xml 17 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
LifePayment/LifePayment.HttpApi/LifePay/LifePayController.cs 29 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
LifePayment/LifePayment.Application.Contracts/LifePay/LifePayOutput.cs
@@ -1100,4 +1100,12 @@
public class ChannelRateOutput
{
    public decimal ChannlesRate { get; set; }
}
public class OnlineServiceInput
{
    /// <summary>
    /// 在线客服链接
    /// </summary>
    public string Link { get; set; }
}
LifePayment/LifePayment.Application.Contracts/Setting/ICommonService.cs
New file
@@ -0,0 +1,15 @@
using System.Collections.Generic;
using System.Threading.Tasks;
using Volo.Abp.Application.Services;
namespace LifePayment.Application.Contracts
{
    public interface ICommonService : IApplicationService
    {
        Task<string> GetOnlineService();
        Task UpdateOnlineService(OnlineServiceInput input);
    }
}
LifePayment/LifePayment.Application/LifePay/LifePayService.cs
@@ -1537,7 +1537,7 @@
            var userAccount = await _lifePayAccount.Where(x => x.UserId == input.UserId && x.Id == input.Id)
                                            .FirstOrDefaultAsync();
            CheckExtensions.IfTrueThrowUserFriendlyException(userAccount == null, "户号不存在");
            var repeatAccountContent = await _lifePayAccount.Where(x => x.UserId == input.UserId && x.LifePayType == input.LifePayType && x.Content == input.Content && x.Id != input.Id)
            var repeatAccountContent = await _lifePayAccount.Where(x => x.UserId == input.UserId && x.LifePayType == input.LifePayType && x.Content == input.Content && x.Id != input.Id && x.IsDeleted == false)
                                            .FirstOrDefaultAsync();
            CheckExtensions.IfTrueThrowUserFriendlyException(repeatAccountContent != null, "户号已存在");
@@ -1551,22 +1551,36 @@
        }
        else
        {
            var repeatAccountContent = await _lifePayAccount.Where(x => x.UserId == input.UserId && x.LifePayType == input.LifePayType && x.Content == input.Content)
            var repeatAccountContent = await _lifePayAccount.Where(x => x.UserId == input.UserId && x.LifePayType == input.LifePayType && x.Content == input.Content && x.IsDeleted == false)
                                            .FirstOrDefaultAsync();
            CheckExtensions.IfTrueThrowUserFriendlyException(repeatAccountContent != null, "户号已存在");
            var userAccount = new LifePayAccount
            /// CheckExtensions.IfTrueThrowUserFriendlyException(repeatAccountContent != null, "户号已存在");
            if (repeatAccountContent != null)
            {
                Id = Guid.NewGuid(),
                UserId = input.UserId,
                Content = input.Content,
                Province = input.Province,
                LifePayType = input.LifePayType,
                City = input.City,
                Remark = input.Remark,
                Operators = input.Operators,
                ExtraProperties = input.ExtraProperties,
            };
            await _lifePayAccount.InsertAsync(userAccount);
                repeatAccountContent.LifePayType = input.LifePayType;
                repeatAccountContent.Content = input.Content;
                repeatAccountContent.Province = input.Province;
                repeatAccountContent.City = input.City;
                repeatAccountContent.Remark = input.Remark;
                repeatAccountContent.Operators = input.Operators;
                repeatAccountContent.ExtraProperties = input.ExtraProperties;
            }
            else
            {
                var userAccount = new LifePayAccount
                {
                    Id = Guid.NewGuid(),
                    UserId = input.UserId,
                    Content = input.Content,
                    Province = input.Province,
                    LifePayType = input.LifePayType,
                    City = input.City,
                    Remark = input.Remark,
                    Operators = input.Operators,
                    ExtraProperties = input.ExtraProperties,
                };
                await _lifePayAccount.InsertAsync(userAccount);
            }
        }
        if (input.LifePayType == LifePayOrderTypeEnum.话费订单)
LifePayment/LifePayment.Application/Setting/CommonService.cs
New file
@@ -0,0 +1,50 @@
using LifePayment.Application.Contracts;
using LifePayment.Domain.Common;
using LifePayment.Domain.Models;
using LifePayment.Domain.Shared;
using Microsoft.EntityFrameworkCore;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using Volo.Abp.Application.Services;
using Volo.Abp.Domain.Repositories;
namespace LifePayment.Application
{
    public class CommonService : ApplicationService, ICommonService
    {
        private readonly IRepository<OnlineService, Guid> _onlineServiceRepository;
        public CommonService(
               IRepository<OnlineService, Guid> onlineServiceRepository)
        {
            _onlineServiceRepository = onlineServiceRepository;
        }
        public async Task<string> GetOnlineService()
        {
            var query = await _onlineServiceRepository.FirstOrDefaultAsync();
            return query.Link;
        }
        public async Task UpdateOnlineService(OnlineServiceInput input)
        {
            var area = await _onlineServiceRepository.FirstOrDefaultAsync();
            if (area != null)
            {
                area.Link = input.Link;
            }
            else
            {
                OnlineService onlineService = new OnlineService()
                {
                    Id = Guid.NewGuid(),
                    Link = input
                };
                await _onlineServiceRepository.InsertAsync(onlineService);
            }
        }
    }
}
LifePayment/LifePayment.Domain/Common/OnlineService.cs
New file
@@ -0,0 +1,14 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Volo.Abp.Domain.Entities;
namespace LifePayment.Domain.Common
{
    public class OnlineService : Entity<Guid>, IAggregateRoot<Guid>
    {
        public string Link { get; set; }
    }
}
LifePayment/LifePayment.EntityFrameworkCore/LifePaymentServicesDbContext.cs
@@ -1,4 +1,5 @@
using LifePayment.Domain;
using LifePayment.Domain.Common;
using LifePayment.Domain.LifePay;
using LifePayment.Domain.Models;
using Microsoft.EntityFrameworkCore;
@@ -30,6 +31,8 @@
        public virtual DbSet<Role> Roles { get; set; }
        public virtual DbSet<OnlineService> OnlineService { get; set; }
        public virtual DbSet<LifePayIntroInfo> LifePayIntroInfo { get; set; }
        public virtual DbSet<UserRole> UserRoles { get; set; }
LifePayment/LifePayment.Host/LifePaymentService.HttpApi.xml
@@ -122,6 +122,12 @@
            </summary>
            <returns></returns>
        </member>
        <member name="M:LifePayment.HttpApi.LifePayController.GetOnlineService">
            <summary>
            获取在线客服
            </summary>
            <returns></returns>
        </member>
        <member name="M:LifePayment.HttpApi.LifePayController.GetUserPage(LifePayment.Application.Contracts.QueryUserPageInput)">
            <summary>
            获取用户分页数据
@@ -348,6 +354,13 @@
            <param name="input"></param>
            <returns></returns>
        </member>
        <member name="M:LifePayment.HttpApi.LifePayController.UpdateOnlineService(System.String)">
            <summary>
            在线客服配置
            </summary>
            <param name="input"></param>
            <returns></returns>
        </member>
        <member name="M:LifePayment.HttpApi.LifePayController.SetLifePayOrderPayType(LifePayment.Domain.Shared.SetLifePayOrderPayTypeInput)">
            <summary>
            设置生活缴费支付类型
LifePayment/LifePayment.Host/LifePaymentServices.Application.Contracts.xml
@@ -645,7 +645,22 @@
        </member>
        <member name="P:LifePayment.Application.Contracts.QueryUserPageInput.CreationTimeBegin">
            <summary>
            注册时间
            注册开始时间
            </summary>
        </member>
        <member name="P:LifePayment.Application.Contracts.QueryUserPageInput.CreationTimeEnd">
            <summary>
            注册结束时间
            </summary>
        </member>
        <member name="P:LifePayment.Application.Contracts.QueryUserPageInput.LoginTimeBegin">
            <summary>
            登录开始时间
            </summary>
        </member>
        <member name="P:LifePayment.Application.Contracts.QueryUserPageInput.LoginTimeEnd">
            <summary>
            登录结束时间
            </summary>
        </member>
        <member name="P:LifePayment.Application.Contracts.OrderPriceReturn.PlatformPrice">
LifePayment/LifePayment.HttpApi/LifePay/LifePayController.cs
@@ -1,4 +1,5 @@
using LifePayment.Application.Contracts;
using LifePayment.Domain.Common;
using LifePayment.Domain.Shared;
using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Mvc;
@@ -22,17 +23,20 @@
        private readonly ILifePayService _lifePayService;
        private readonly IStatisticsService _statisticsService;
        private readonly IWebClientInfoProvider _webClientInfoProvider;
        private readonly ICommonService _commonService;
        private readonly ILogger<LifePayController> _logger;
        public LifePayController(
              ILifePayService lifePayService,
              IStatisticsService statisticsService,
              IWebClientInfoProvider webClientInfoProvider
              IWebClientInfoProvider webClientInfoProvider,
              ICommonService commonService
            , ILogger<LifePayController> logger
              )
        {
            _lifePayService = lifePayService;
            _statisticsService = statisticsService;
            _webClientInfoProvider = webClientInfoProvider;
            _commonService = commonService;
            _logger = logger;
        }
@@ -182,6 +186,16 @@
            return await _lifePayService.GetIntroInfo(type);
        }
        /// <summary>
        /// 获取在线客服
        /// </summary>
        /// <returns></returns>
        [HttpGet]
        [AllowAnonymous]
        public async Task<string> GetOnlineService()
        {
            return await _commonService.GetOnlineService();
        }
        /// <summary>
        /// 获取用户分页数据
@@ -596,6 +610,19 @@
        }
        /// <summary>
        /// 在线客服配置
        /// </summary>
        /// <param name="input"></param>
        /// <returns></returns>
        [HttpPost]
        public async Task<int> UpdateOnlineService(OnlineServiceInput input)
        {
            await _commonService.UpdateOnlineService(input);
            return Constant.SUCCESS;
        }
        /// <summary>
        /// 设置生活缴费支付类型
        /// </summary>
        /// <param name="input"></param>