| | |
| | | public void updateCustomer(String autoAnswer, String remarks, int status, String id,String operator) { |
| | | Customer customer = getById(id); |
| | | if (customer == null) { |
| | | throw new YamiShopBindException("参数错误!"); |
| | | throw new YamiShopBindException("Invalid parameters!"); |
| | | } |
| | | SysUser sysUser = sysUserService.getByUserName(customer.getUserName()); |
| | | if (sysUser == null) { |
| | | throw new YamiShopBindException("客服不存在!"); |
| | | throw new YamiShopBindException("Customer service agent does not exist!"); |
| | | } |
| | | sysUser.setStatus(status); |
| | | sysUser.setRemarks(remarks); |
| | |
| | | |
| | | Customer customer = getById(id); |
| | | if (customer == null) { |
| | | throw new YamiShopBindException("参数错误!"); |
| | | throw new YamiShopBindException("Invalid parameters!"); |
| | | } |
| | | SysUser sysUser = sysUserService.getByUserName(customer.getUserName()); |
| | | SysUser userDB = BeanUtil.copyProperties(sysUser, SysUser.class); |
| | | if (sysUser == null) { |
| | | throw new YamiShopBindException("客服不存在!"); |
| | | throw new YamiShopBindException("Customer service agent does not exist!"); |
| | | } |
| | | sysUser.setPassword(passwordEncoder.encode(password)); |
| | | updateById(customer); |
| | |
| | | public void updateCustomerSafePassword(String safePassword, String id) { |
| | | Customer customer = getById(id); |
| | | if (customer == null) { |
| | | throw new YamiShopBindException("参数错误!"); |
| | | throw new YamiShopBindException("Invalid parameters!"); |
| | | } |
| | | SysUser sysUser = sysUserService.getByUserName(customer.getUserName()); |
| | | if (sysUser == null) { |
| | | throw new YamiShopBindException("客服不存在!"); |
| | | throw new YamiShopBindException("Customer service agent does not exist!"); |
| | | } |
| | | sysUser.setSafePassword(passwordEncoder.encode(safePassword)); |
| | | sysUserService.updateById(sysUser); |
| | |
| | | public void forceOffline(String id) { |
| | | Customer customer = getById(id); |
| | | if (customer == null) { |
| | | throw new YamiShopBindException("参数错误!"); |
| | | throw new YamiShopBindException("Invalid parameters!"); |
| | | } |
| | | SysUser sysUser = sysUserService.getByUserName(customer.getUserName()); |
| | | if (sysUser == null) { |
| | | throw new YamiShopBindException("客服不存在!"); |
| | | throw new YamiShopBindException("Customer service agent does not exist!"); |
| | | } |
| | | customer.setOnlineState(0); |
| | | customer.setLastOfflineTime(new Date()); |
| | |
| | | Date now = new Date(); |
| | | SysUser sysUser = sysUserService.getByUserName(userName); |
| | | if (null != sysUser) { |
| | | throw new YamiShopBindException("系统存在相同[系统登录名]!"); |
| | | throw new YamiShopBindException("A user with the same system login name already exists!"); |
| | | } |
| | | sysUser = new SysUser(); |
| | | sysUser.setUsername(userName); |
| | |
| | | sysUser.setPassword(passwordEncoder.encode(password)); |
| | | //sysUser.setPassword(password); |
| | | sysUser.setStatus(status); |
| | | sysUser.setGoogleAuthBind(true); |
| | | sysUser.setSafePassword(passwordEncoder.encode(safePassword)); |
| | | sysUser.setGoogleAuthSecret("AAAAAAAAAAA"); |
| | | sysUserService.save(sysUser); |
| | | String ip = IPHelper.getIpAddr(); |
| | | |
| | |
| | | public void offline(String username) { |
| | | Customer customer = cacheByUsername(username); |
| | | if(customer==null) { |
| | | throw new YamiShopBindException("客服不存在"); |
| | | throw new YamiShopBindException("Customer service agent does not exist"); |
| | | } |
| | | customer.setOnlineState(0); |
| | | customer.setLastOfflineTime(new Date()); |
| | |
| | | public void online(String username) { |
| | | Customer customer = cacheByUsername(username); |
| | | if(customer==null) { |
| | | throw new YamiShopBindException("客服不存在"); |
| | | throw new YamiShopBindException("Customer service agent does not exist"); |
| | | } |
| | | customer.setOnlineState(1); |
| | | customer.setLastOnlineTime(new Date()); |
| | |
| | | // this.adminSystemUserService.update(user,newPassword,type,operatorUsername,loginSafeword,code,ip,superGoogleAuthCode); |
| | | Customer customer = cacheByUsername(user.getUsername()); |
| | | if (customer==null){ |
| | | throw new YamiShopBindException("客服不存在!"); |
| | | throw new YamiShopBindException("Customer service agent does not exist!"); |
| | | } |
| | | String sourceAutoAnswer = customer.getAutoAnswer(); |
| | | customer.setAutoAnswer(autoAnswer); |