liukangdong
2025-01-13 cb1794d34ab60176dd6e62c451a47774c5d9552f
server/system_service/src/main/java/com/doumee/service/system/impl/SystemLoginServiceImpl.java
@@ -286,8 +286,8 @@
                    .set(SystemUser::getOpenidHkDate,null)
                    .set(SystemUser::getOpenidHkInfo,null)
                    .set(SystemUser::getOpenidHkStatus,Constants.ZERO)
                    .ne(SystemUser::getType,Constants.memberType.gkuser)
                    .eq(SystemUser::getOpenid,openid)
//                    .eq(SystemUser::getType,user.getType())
            );
            systemUserMapper.update(null,new UpdateWrapper<SystemUser>().lambda()
                    .set(SystemUser::getOpenid,openid)
@@ -403,20 +403,20 @@
            throw new BusinessException(ResponseStatus.ACCOUNT_INCORRECT);
        }
        //注册司机
        if(!((Constants.equalsInteger(user.getType(),Constants.ZERO)
        if((Constants.equalsInteger(user.getType(),Constants.ZERO)
                ||Constants.equalsInteger(user.getType(),Constants.TWO))
                && Objects.nonNull(user.getMemberId()))){
//            if(Constants.equalsInteger(user.getType(),Constants.TWO)){
//                if(Objects.isNull(user.getCompanyId())){
//                    throw new BusinessException(ResponseStatus.NO_ALLOW_LOGIN);
//                }
//                Company company = companyMapper.selectById(user.getCompanyId());
//                if(Objects.isNull(company) || Constants.equalsInteger(company.getType(),Constants.ONE)){
//                    throw new BusinessException(ResponseStatus.NO_ALLOW_LOGIN);
//                }
//            }
//        }else{
                && Objects.nonNull(user.getMemberId())){
            if(Constants.equalsInteger(user.getType(),Constants.TWO)){
                if(Objects.isNull(user.getCompanyId())){
                    throw new BusinessException(ResponseStatus.NO_ALLOW_LOGIN.getCode(),"对不起,该账号不能登录司机端哦~");
                }
             /*   Company company = companyMapper.selectById(user.getCompanyId());
                if(Objects.isNull(company) || Constants.equalsInteger(company.getType(),Constants.ONE)){
            throw new BusinessException(ResponseStatus.NO_ALLOW_LOGIN);
                }*/
            }
        }else{
            throw new BusinessException(ResponseStatus.NO_ALLOW_LOGIN.getCode(),"对不起,该账号不能登录司机端哦!");
        }
        if(StringUtils.isNotBlank(password)){
            String pwd = Utils.Secure.encryptPassword(new String(password), user.getSalt());
@@ -473,7 +473,7 @@
        if (systemUser == null) {
            systemUser = autoRegisterUser(Constants.memberType.driver,param.getPhone(),param.getOpenid(),true);
        }else{
            if(!(Constants.equalsInteger(systemUser.getType(),Constants.memberType.driver)||Constants.equalsInteger(systemUser.getType(),Constants.memberType.internal))){
            if(!Constants.equalsInteger(systemUser.getType(),Constants.memberType.driver)){
                throw new BusinessException(ResponseStatus.NOT_ALLOWED.getCode(),"对不起,请使用正确的司机账号登陆!");
            }
        }