| | |
| | | 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; |
| | |
| | | synchronized (SESSION_OPERATE_LOCK) { |
| | | // 缓存用户信息,创建会话 |
| | | sessionManagerApi.createSession(jwtToken, loginUser, loginRequest.getCreateCookie()); |
| | | |
| | | System.err.println("已修改"); |
| | | // 如果开启了单账号单端在线,则踢掉已经上线的该用户 |
| | | if (AuthConfigExpander.getSingleAccountLoginFlag()) { |
| | | // if (AuthConfigExpander.getSingleAccountLoginFlag()) { |
| | | sessionManagerApi.removeSessionExcludeToken(jwtToken); |
| | | } |
| | | // } |
| | | } |
| | | |
| | | // 更新用户ip和登录时间 |
| | |
| | | } |
| | | |
| | | @Override |
| | | public Long randomWorkerIdByLineStatusAndPostNeWorkerId(String lineStatus, Integer postType, Integer postId, Integer workStatus, List<Long> eqWorkerIdList, List<Long> neWorkerIdList) { |
| | | public Long randomWorkerIdByLineStatusAndPostNeWorkerId(String lineStatus, Integer postType, Integer postId, Integer workStatus, Integer mentalAnalysisStatus, List<Long> eqWorkerIdList, List<Long> neWorkerIdList) { |
| | | // 获取指定在线状态,指定岗位的工作人员ID |
| | | List<Customer> list = this.baseMapper.randomWorkerByLineStatusAndPostNeWorkerId(lineStatus, postType, postId, workStatus, eqWorkerIdList, neWorkerIdList); |
| | | List<Long> list = this.baseMapper.randomWorkerByLineStatusAndPostNeWorkerId(lineStatus, postType, postId, workStatus, mentalAnalysisStatus, eqWorkerIdList, neWorkerIdList); |
| | | if (CollUtil.isNotEmpty(list)) { |
| | | // 随机一个工作人员ID |
| | | return list.get(RandomUtil.randomInt(list.size())).getCustomerId(); |
| | | return list.get(RandomUtil.randomInt(list.size())); |
| | | } |
| | | return null; |
| | | } |
| | |
| | | |
| | | 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; |
| | | } |
| | | } |