From 1901fceb6ddaa56a57f3131191454554c3e77e68 Mon Sep 17 00:00:00 2001 From: guohongjin <guohongjin@test.com> Date: 星期三, 01 五月 2024 13:56:51 +0800 Subject: [PATCH] Merge branch 'master' of http://120.76.84.145:10101/gitblit/r/java/PsychologicalCounseling --- roses/kernel-s-customer/customer-business/src/main/java/cn/stylefeng/roses/kernel/customer/modular/service/impl/CustomerServiceImpl.java | 33 ++++++++++++++++++++++++++++++++- 1 files changed, 32 insertions(+), 1 deletions(-) diff --git a/roses/kernel-s-customer/customer-business/src/main/java/cn/stylefeng/roses/kernel/customer/modular/service/impl/CustomerServiceImpl.java b/roses/kernel-s-customer/customer-business/src/main/java/cn/stylefeng/roses/kernel/customer/modular/service/impl/CustomerServiceImpl.java index c26fbff..c090c4c 100644 --- a/roses/kernel-s-customer/customer-business/src/main/java/cn/stylefeng/roses/kernel/customer/modular/service/impl/CustomerServiceImpl.java +++ b/roses/kernel-s-customer/customer-business/src/main/java/cn/stylefeng/roses/kernel/customer/modular/service/impl/CustomerServiceImpl.java @@ -13,7 +13,6 @@ import cn.stylefeng.roses.kernel.auth.api.context.LoginContext; import cn.stylefeng.roses.kernel.auth.api.exception.AuthException; import cn.stylefeng.roses.kernel.auth.api.exception.enums.AuthExceptionEnum; -import cn.stylefeng.roses.kernel.auth.api.expander.AuthConfigExpander; import cn.stylefeng.roses.kernel.auth.api.password.PasswordStoredEncryptApi; import cn.stylefeng.roses.kernel.auth.api.pojo.auth.LoginRequest; import cn.stylefeng.roses.kernel.auth.api.pojo.auth.LoginResponse; @@ -736,4 +735,36 @@ return postIds; } + + @Override + public Boolean userBindClassConsultWorkerId(Long customerId, String workerNo) { + // 幸福顾问 + PostIdEnum post11Enum = PostIdEnum.PO_11; + // 咨询顾问 + PostIdEnum post21Enum = PostIdEnum.PO_21; + + // 获取绑定顾问岗位ID + String[] bindWorkerPostIds = this.getBindWorkerPostIds(workerNo, post11Enum, post21Enum); + Customer workerByNo = this.getOne( + Wrappers.<Customer>lambdaUpdate().eq(Customer::getWorkerNo, workerNo).last("LIMIT 1") + ); + + Customer newCustomer = new Customer(); + newCustomer.setCustomerId(customerId); + for (String postId : bindWorkerPostIds) { + if (postId.equals(post11Enum.getCode().toString())) { + newCustomer.setClassWorkerId(workerByNo.getCustomerId()); + } else if (postId.equals(post21Enum.getCode().toString())) { + newCustomer.setConsultWorkerId(workerByNo.getCustomerId()); + } + } + + Boolean update = false; + if (customerId != null && (newCustomer.getClassWorkerId() != null || newCustomer.getConsultWorkerId() != null)) { + // 修改用户信息 + update = this.updateCustomerRemoveCache(newCustomer); + } + + return update; + } } -- Gitblit v1.7.1