移动系统liao
2025-08-07 3ad8babb3a5929eadc18d3518563b6355a800681
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;
        }
        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;
        // 经办人
        if (tab.OperatorIdCard != InParam.OperatorIdCard)
@@ -359,7 +380,48 @@
        }
       
        return await _fBS_CusExtendRep.UpdateAsync(tab);
      await   _fBS_CusExtendRep.AsTenant().BeginTranAsync();
        try
        {
            if((!isChangeData)&&tab.steps== CusExtendStep.Change)
            {
                //是更改,需要工改cer的值
             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;
    }