From 3ad8babb3a5929eadc18d3518563b6355a800681 Mon Sep 17 00:00:00 2001
From: 移动系统liao <liaoxujun@qq.com>
Date: 星期四, 07 八月 2025 12:59:24 +0800
Subject: [PATCH] no message

---
 Web/src/api/base/index.ts                                                         |    2 
 Admin.NET/FZCTB.NET.API.Application/User/CustomerService.cs                       |   74 ++++++++++++++++++++++--
 Admin.NET/FZCTB.NET.API.Application/User/DTO/DTOS.cs                              |    6 ++
 Web/src/api/Customer/fBS_EnterpriseType.ts                                        |   15 ++++-
 Admin.NET/FZCZTB.Net.CustomerSYSTem/Service/FBS_CusExtend/FBS_CusExtendService.cs |   28 ++++++++-
 5 files changed, 112 insertions(+), 13 deletions(-)

diff --git a/Admin.NET/FZCTB.NET.API.Application/User/CustomerService.cs b/Admin.NET/FZCTB.NET.API.Application/User/CustomerService.cs
index f157c21..9635626 100644
--- a/Admin.NET/FZCTB.NET.API.Application/User/CustomerService.cs
+++ b/Admin.NET/FZCTB.NET.API.Application/User/CustomerService.cs
@@ -310,7 +310,11 @@
             throw Oops.Oh("娌℃湁瀹屾垚淇℃伅褰曞叆");
         }
 
-
+        bool  isChangeData = false;
+        if (tab.steps== CusExtendStep.Change)
+        {
+            isChangeData = true;
+        }
 
 
 
@@ -339,14 +343,31 @@
             //閲嶆柊瀹℃牳?
             tab.steps = CusExtendStep.Change;
         }
-        tab.EnterpriseType = InParam.EnterpriseType;
+        if (tab.EnterpriseType != InParam.EnterpriseType)
+        {
+            tab.EnterpriseType = InParam.EnterpriseType;
+            tab.steps = CusExtendStep.Change;
+        }
 
         //鑱旂郴鐢佃瘽
         tab.EnterprisePhone = InParam.EnterprisePhone;
         tab.EnterpriseEmail = InParam.EnterpriseEmail;
+
+        if (tab.BankAccount != InParam.BankAccount)
+        {
+            //鑱旂郴鐢佃瘽
+            tab.BankAccount = InParam.BankAccount;
+            tab.steps = CusExtendStep.Change;
+
+        }
+        if (tab.BankName != InParam.BankName)
+        {
+            tab.BankName = InParam.BankName;
+            tab.steps = CusExtendStep.Change;
+        }
         //閾惰鏄惁闇�瑕佷慨鏀�
-        tab.BankAccount = InParam.BankAccount;
-        tab.BankName = InParam.BankName;
+        //tab.BankAccount = InParam.BankAccount;
+        //tab.BankName = InParam.BankName;
 
         // 缁忓姙浜�
         if (tab.OperatorIdCard != InParam.OperatorIdCard)
@@ -357,9 +378,50 @@
             tab.OperatorName = InParam.OperatorName;
             tab.OperatorPhone = InParam.OperatorPhone;
         }
-       
 
-        return await _fBS_CusExtendRep.UpdateAsync(tab);
+
+      await   _fBS_CusExtendRep.AsTenant().BeginTranAsync();
+        try
+        {
+            if((!isChangeData)&&tab.steps== CusExtendStep.Change)
+            {
+                //鏄洿鏀癸紝闇�瑕佸伐鏀筩er鐨勫��
+             var exrolerep=     await   _fBS_CustomerExRoleRep.GetFirstAsync(x=>x.ExRoleId== rols.Id&&x.CustomerId==tab.CustomerId);
+                if(exrolerep!=null)
+                {
+                    if (exrolerep.HasFlsh != false)
+                    {
+                        exrolerep.HasFlsh = false;
+                       
+                        //鏀瑰彉鐘舵��
+                        await _fBS_CustomerExRoleRep.UpdateAsync(exrolerep);
+                    };
+
+
+                }
+                else
+                {
+                    await _fBS_CustomerExRoleRep.InsertAsync(new FBS_CoutomerExRole
+                    {
+                        CustomerId = tab.CustomerId,
+                        ExRoleId = rols.Id,
+                        HasFlsh = false
+
+                    });
+                }
+               
+            }
+            await _fBS_CusExtendRep.UpdateAsync(tab);
+            await  _fBS_CusExtendRep.AsTenant().CommitTranAsync();
+
+        }
+        catch (Exception)
+        {
+            await _fBS_CusExtendRep.AsTenant().RollbackTranAsync();
+            throw;
+        }
+
+        return true;
 
     }
 
diff --git a/Admin.NET/FZCTB.NET.API.Application/User/DTO/DTOS.cs b/Admin.NET/FZCTB.NET.API.Application/User/DTO/DTOS.cs
index a272786..0711ba7 100644
--- a/Admin.NET/FZCTB.NET.API.Application/User/DTO/DTOS.cs
+++ b/Admin.NET/FZCTB.NET.API.Application/User/DTO/DTOS.cs
@@ -5,6 +5,7 @@
 // 涓嶅緱鍒╃敤鏈」鐩粠浜嬪嵄瀹冲浗瀹跺畨鍏ㄣ�佹壈涔辩ぞ浼氱З搴忋�佷镜鐘粬浜哄悎娉曟潈鐩婄瓑娉曞緥娉曡绂佹鐨勬椿鍔紒浠讳綍鍩轰簬鏈」鐩簩娆″紑鍙戣�屼骇鐢熺殑涓�鍒囨硶寰嬬籂绾峰拰璐d换锛屾垜浠笉鎵挎媴浠讳綍璐d换锛�
 
 using FZCZTB.NET.MD.ConfigMd;
+using FZCZTB.NET.MD.CutomerMd.Extend;
 using SqlSugar;
 using System;
 using System.Collections.Generic;
@@ -196,5 +197,10 @@
     /// 浼佷笟閾惰璐﹀彿
     /// </summary>
     public string BankAccount { get; set; }
+
+    /// <summary>
+    /// 鐘舵��
+    /// </summary>
+    public CusExtendStep? steps { set; get; }
 }
   
\ No newline at end of file
diff --git a/Admin.NET/FZCZTB.Net.CustomerSYSTem/Service/FBS_CusExtend/FBS_CusExtendService.cs b/Admin.NET/FZCZTB.Net.CustomerSYSTem/Service/FBS_CusExtend/FBS_CusExtendService.cs
index d16d7a0..18d4555 100644
--- a/Admin.NET/FZCZTB.Net.CustomerSYSTem/Service/FBS_CusExtend/FBS_CusExtendService.cs
+++ b/Admin.NET/FZCZTB.Net.CustomerSYSTem/Service/FBS_CusExtend/FBS_CusExtendService.cs
@@ -226,9 +226,31 @@
     [ApiDescriptionSettings(Name = "Delete"), HttpPost]
     public async Task Delete(DeleteFBS_CusExtendInput input)
     {
-        var entity = await _fBS_CusExtendRep.GetFirstAsync(u => u.Id == input.Id) ?? throw Oops.Oh(ErrorCodeEnum.D1002);
-        //await _fBS_CusExtendRep.FakeDeleteAsync(entity);   //鍋囧垹闄�
-        await _fBS_CusExtendRep.DeleteAsync(entity);   //鐪熷垹闄�
+     await    _fBS_CusExtendRep.AsTenant().BeginTranAsync();
+        try
+        {
+            var entity = await _fBS_CusExtendRep.AsQueryable().Includes(x => x.TransactionRole).Where(x => x.Id == input.Id).FirstAsync() ?? throw Oops.Oh(ErrorCodeEnum.D1002);
+            if (entity != null)
+            {
+                var exrles = await _fBS_CoutomerExRoleRep.GetFirstAsync(x => x.CustomerId == entity.CustomerId && x.ExRoleId == entity.TransactionRole.Id);
+                if (exrles != null)
+                {
+                    await _fBS_CoutomerExRoleRep.DeleteAsync(exrles);
+                }
+
+                //await _fBS_CusExtendRep.FakeDeleteAsync(entity);   //鍋囧垹闄�
+
+                await _fBS_CusExtendRep.DeleteAsync(entity);   //鐪熷垹闄�
+            }
+
+          await   _fBS_CusExtendRep.AsTenant().CommitTranAsync();
+        }
+        catch (Exception)
+        {
+            await _fBS_CusExtendRep.AsTenant().RollbackTranAsync();
+            throw;
+        }
+    
     }
 
     /// <summary>
diff --git a/Web/src/api/Customer/fBS_EnterpriseType.ts b/Web/src/api/Customer/fBS_EnterpriseType.ts
index 6e74364..3f67d2f 100644
--- a/Web/src/api/Customer/fBS_EnterpriseType.ts
+++ b/Web/src/api/Customer/fBS_EnterpriseType.ts
@@ -1,5 +1,14 @@
-锘縤mport {useBaseApi} from '/@/api/base';
-import request from '/@/utils/request';
+锘�/*
+ * @FilePath: fBS_EnterpriseType.ts
+ * @Author: 灏忛渚�
+ * @Date: 2025-06-25 11:22:03
+ * @LastEditors: 
+ * @LastEditTime: 2025-08-04 11:09:37
+ * Copyright: 2025  MinTinge CO.,LTD. All Rights Reserved.
+ * @Descripttion: 鍐欏叆浣犵殑鎻忚堪
+ */
+import {useBaseApi} from '/@/api/base';
+
 
 // 浼佷笟绫婚厤缃〃鎺ュ彛鏈嶅姟
 export const useFBS_EnterpriseTypeApi = () => {
@@ -8,7 +17,7 @@
 		// 鍒嗛〉鏌ヨ浼佷笟绫婚厤缃〃
 		page: baseApi.page,
 		// 鏍戝舰鏌ヨ浼佷笟绫婚厤缃〃
-		tree:()=> {return request({
+		tree:()=> {return baseApi.request<FBS_EnterpriseType[]>({
 			url: "/api/fBS_EnterpriseType/treeData", 
 			method: 'Get'
 			
diff --git a/Web/src/api/base/index.ts b/Web/src/api/base/index.ts
index e554f78..5acad82 100644
--- a/Web/src/api/base/index.ts
+++ b/Web/src/api/base/index.ts
@@ -28,7 +28,7 @@
                 data: { id },
             }, cancel);
         },
-        dropdownData: function (data: any, cancel: boolean = false) {
+        dropdownData: function (data:any, cancel: boolean = false) {
             return request({
                 url: baseUrl + "dropdownData",
                 method: 'post',

--
Gitblit v1.9.1