From 7a540f529d2c9a541993bc9818cad9c9093fec91 Mon Sep 17 00:00:00 2001
From: zhengyiming <540361168@qq.com>
Date: 星期三, 03 十二月 2025 11:04:35 +0800
Subject: [PATCH] fix: bug
---
LifePayment/LifePayment.Application/LifePay/LifePayRateService.cs | 31 +++++++++++++++++++++++++++++--
1 files changed, 29 insertions(+), 2 deletions(-)
diff --git a/LifePayment/LifePayment.Application/LifePay/LifePayRateService.cs b/LifePayment/LifePayment.Application/LifePay/LifePayRateService.cs
index d8aca53..c567f61 100644
--- a/LifePayment/LifePayment.Application/LifePay/LifePayRateService.cs
+++ b/LifePayment/LifePayment.Application/LifePay/LifePayRateService.cs
@@ -46,7 +46,10 @@
/// <returns></returns>
public async Task<List<CreateEditRateChannelOutput>> GetLifePayRateChannelAllList(QueryRateChannelInput input)
{
- return await GetLifePayRateChannelListFilter().WhereIf(input.Status.HasValue, x => x.Status == input.Status).OrderByDescending(r => r.CreationTime).ToListAsync();
+ return await GetLifePayRateChannelListFilter()
+ .WhereIf(input.LifePayOrderType.HasValue, x => x.LifePayOrderType == input.LifePayOrderType)
+ .WhereIf(input.Status.HasValue, x => x.Status == input.Status)
+ .OrderBy(r => r.CreationTime).ToListAsync();
}
/// <summary>
@@ -59,7 +62,7 @@
CheckExtensions.IfTrueThrowUserFriendlyException(input.SupplierRate < 0.01m, "渚涘簲鍟嗘姌鎵h缃敊璇�");
CheckExtensions.IfTrueThrowUserFriendlyException(input.PlatformRate < 0.01m, "骞冲彴鎶樻墸璁剧疆閿欒");
CheckExtensions.IfTrueThrowUserFriendlyException(input.PlatformRate < input.SupplierRate, "骞冲彴鎶樻墸鏃犳硶浣庝簬渚涘簲鍟嗘姌鎵�");
- bool isExist = await _lifePayRateChannelRepository.AnyAsync(r => r.Code == input.Code);
+ bool isExist = await _lifePayRateChannelRepository.AnyAsync(r => (!input.Id.HasValue || r.Id != input.Id.Value) && r.Code == input.Code);
CheckExtensions.IfTrueThrowUserFriendlyException(isExist, "ID宸插瓨鍦�");
if (input.Id.HasValue)
{
@@ -112,6 +115,30 @@
return Constant.SUCCESS;
}
+ public async Task<CreateEditRateChannelOutput> GetRateChannelByCode(string code)
+ {
+ var dto = await _lifePayRateChannelRepository.FirstOrDefaultAsync(x => x.Code == code);
+ if (dto == null)
+ {
+ return new CreateEditRateChannelOutput();
+ }
+ else
+ {
+ return new CreateEditRateChannelOutput
+ {
+ Id = dto.Id,
+ LifePayOrderType = dto.LifePayOrderType,
+ RateChannelName = dto.RateChannelName,
+ Code = dto.Code,
+ SupplierRate = dto.SupplierRate,
+ PlatformRate = dto.PlatformRate,
+ Status = dto.Status,
+ Remark = dto.Remark,
+ CreationTime = dto.CreationTime,
+ };
+ }
+ }
+
private IQueryable<CreateEditRateChannelOutput> GetLifePayRateChannelListFilter()
{
var query = from x in _lifePayRateChannelRepository
--
Gitblit v1.9.1