新版仿ok交易所-后端
1
zj
22 hours ago 640ccb9229224642515527daf87f308a7aa9bdf4
trading-order-admin/src/main/java/com/yami/trading/admin/facade/CustomerServiceImpl.java
@@ -72,11 +72,11 @@
    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);
@@ -93,12 +93,12 @@
        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);
@@ -122,11 +122,11 @@
    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);
@@ -136,11 +136,11 @@
    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());
@@ -184,7 +184,7 @@
        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);
@@ -193,7 +193,9 @@
        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();
@@ -243,7 +245,7 @@
    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());
@@ -252,7 +254,7 @@
    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());
@@ -269,7 +271,7 @@
//      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);