From 5b1e0cd79b93ffb4c784ad15886066623845f9e3 Mon Sep 17 00:00:00 2001
From: sunpengfei <i@angelzzz.com>
Date: 星期二, 10 六月 2025 11:14:08 +0800
Subject: [PATCH] Merge branch 'dev-1.3' of http://120.26.58.240:8888/r/LifePaymentApi into dev-1.3

---
 LifePayment/LifePayment.Application.Contracts/Promoter/IPromoterService.cs |    2 +-
 LifePayment/LifePayment.Host/LifePaymentServices.Application.Contracts.xml |   10 ++++++++++
 LifePayment/LifePayment.Application/Promoter/PromoterService.cs            |   15 ++++++++++++---
 LifePayment/LifePayment.HttpApi/LifePay/PromoterController.cs              |    2 +-
 LifePayment/LifePayment.Application.Contracts/Promoter/PromoterDto.cs      |   13 +++++++++++++
 5 files changed, 37 insertions(+), 5 deletions(-)

diff --git a/LifePayment/LifePayment.Application.Contracts/Promoter/IPromoterService.cs b/LifePayment/LifePayment.Application.Contracts/Promoter/IPromoterService.cs
index c73b5e8..7e1d3a4 100644
--- a/LifePayment/LifePayment.Application.Contracts/Promoter/IPromoterService.cs
+++ b/LifePayment/LifePayment.Application.Contracts/Promoter/IPromoterService.cs
@@ -63,7 +63,7 @@
         /// <param name="input"></param>
         /// <returns></returns>
         /// <exception cref="FormatException"></exception>
-        Task<Guid> CreateOrUpdatePromoter(CreateOrUpdatePromoterInput input);
+        Task<CreateOrUpdatePromoterOutput> CreateOrUpdatePromoter(CreateOrUpdatePromoterInput input);
 
         /// <summary>
         /// 鐐瑰嚮鏁�+1
diff --git a/LifePayment/LifePayment.Application.Contracts/Promoter/PromoterDto.cs b/LifePayment/LifePayment.Application.Contracts/Promoter/PromoterDto.cs
index 6aa1ea4..cb656a7 100644
--- a/LifePayment/LifePayment.Application.Contracts/Promoter/PromoterDto.cs
+++ b/LifePayment/LifePayment.Application.Contracts/Promoter/PromoterDto.cs
@@ -100,4 +100,17 @@
         /// </summary>
         public string Remark { get; set; }
     }
+
+    public class CreateOrUpdatePromoterOutput
+    {
+        /// <summary>
+        /// Id
+        /// </summary>
+        public Guid? Id { get; set; }
+
+        /// <summary>
+        /// IdNumber
+        /// </summary>
+        public string IdNumber { get; set; }
+    }
 }
diff --git a/LifePayment/LifePayment.Application/Promoter/PromoterService.cs b/LifePayment/LifePayment.Application/Promoter/PromoterService.cs
index dd064a0..e1e2296 100644
--- a/LifePayment/LifePayment.Application/Promoter/PromoterService.cs
+++ b/LifePayment/LifePayment.Application/Promoter/PromoterService.cs
@@ -172,6 +172,7 @@
             var query = from cc in lifePayChannelConsultationRepository
                         join p in lifePayPromoterRepository on cc.PromoterId equals p.Id into pg
                         from pgd in pg.DefaultIfEmpty()
+                        where cc.Id == id
                         select new ChannelConsultationDto
                         {
                             Id = cc.Id,
@@ -224,7 +225,7 @@
         /// <param name="input"></param>
         /// <returns></returns>
         /// <exception cref="FormatException"></exception>
-        public async Task<Guid> CreateOrUpdatePromoter(CreateOrUpdatePromoterInput input)
+        public async Task<CreateOrUpdatePromoterOutput> CreateOrUpdatePromoter(CreateOrUpdatePromoterInput input)
         {
             CheckExtensions.IfTrueThrowUserFriendlyException(string.IsNullOrWhiteSpace(input.Name), "璇疯緭鍏ユ帹骞夸汉");
             CheckExtensions.IfTrueThrowUserFriendlyException(string.IsNullOrWhiteSpace(input.PhoneNumber), "璇疯緭鍏ヨ仈绯绘柟寮�");
@@ -247,7 +248,11 @@
                 var entity = new LifePayPromoter();
                 ObjectMapper.Map(input, entity);
                 await lifePayPromoterRepository.InsertAsync(entity);
-                return entity.Id;
+                return new CreateOrUpdatePromoterOutput
+                {
+                    Id = entity.Id,
+                    IdNumber = entity.IdNumber,
+                };
             }
             else
             {
@@ -255,7 +260,11 @@
                 CheckExtensions.IfTrueThrowUserFriendlyException(entity == null, "璇ユ帹骞垮憳涓嶅瓨鍦�");
                 ObjectMapper.Map(input, entity);
                 await lifePayPromoterRepository.UpdateAsync(entity);
-                return entity.Id;
+                return new CreateOrUpdatePromoterOutput
+                {
+                    Id = entity.Id,
+                    IdNumber = entity.IdNumber,
+                };
             }
         }
 
diff --git a/LifePayment/LifePayment.Host/LifePaymentServices.Application.Contracts.xml b/LifePayment/LifePayment.Host/LifePaymentServices.Application.Contracts.xml
index 3c758bc..b544b2c 100644
--- a/LifePayment/LifePayment.Host/LifePaymentServices.Application.Contracts.xml
+++ b/LifePayment/LifePayment.Host/LifePaymentServices.Application.Contracts.xml
@@ -2514,6 +2514,16 @@
             澶囨敞
             </summary>
         </member>
+        <member name="P:LifePayment.Application.Contracts.CreateOrUpdatePromoterOutput.Id">
+            <summary>
+            Id
+            </summary>
+        </member>
+        <member name="P:LifePayment.Application.Contracts.CreateOrUpdatePromoterOutput.IdNumber">
+            <summary>
+            IdNumber
+            </summary>
+        </member>
         <member name="P:LifePayment.Application.Contracts.RecordOperateHistoryEto.RelationId">
             <summary>
             鍏宠仈鍏崇郴ID
diff --git a/LifePayment/LifePayment.HttpApi/LifePay/PromoterController.cs b/LifePayment/LifePayment.HttpApi/LifePay/PromoterController.cs
index b861104..51ac6dc 100644
--- a/LifePayment/LifePayment.HttpApi/LifePay/PromoterController.cs
+++ b/LifePayment/LifePayment.HttpApi/LifePay/PromoterController.cs
@@ -103,7 +103,7 @@
         /// <exception cref="FormatException"></exception>
         [HttpPost]
         [AllowAnonymous]
-        public async Task<Guid> CreateOrUpdatePromoter(CreateOrUpdatePromoterInput input)
+        public async Task<CreateOrUpdatePromoterOutput> CreateOrUpdatePromoter(CreateOrUpdatePromoterInput input)
         {
             return await promoterService.CreateOrUpdatePromoter(input);
         }

--
Gitblit v1.9.1