Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

感觉更新第三方账号表 逻辑有问题 #4147

Closed
zhangdaiscott opened this issue Oct 27, 2022 · 2 comments
Closed

感觉更新第三方账号表 逻辑有问题 #4147

zhangdaiscott opened this issue Oct 27, 2022 · 2 comments

Comments

@zhangdaiscott
Copy link
Member

版本号:3.4.3
前端版本:vue3版?还是 vue2版?

vue3

问题描述:

感觉更新第三方账号表 逻辑有问题!用thirdUserId查询,又去更新thirdUserId
(ThirdAppDingtalkServiceImpl)

截图&代码:
SysThirdAccount sysThirdAccount = sysThirdAccountService.getOneByThirdUserId(dtUserInfo.getUserid(), THIRD_TYPE);


@Override
    public SysThirdAccount getOneByThirdUserId(String thirdUserId, String thirdType) {
        LambdaQueryWrapper<SysThirdAccount> queryWrapper = new LambdaQueryWrapper<>();
        queryWrapper.eq(SysThirdAccount::getThirdUserId, thirdUserId);
        queryWrapper.eq(SysThirdAccount::getThirdType, thirdType);
        return super.getOne(queryWrapper);
    }

private void thirdAccountSaveOrUpdate(SysThirdAccount sysThirdAccount, String sysUserId, String dtUserId) {
        if (sysThirdAccount == null) {
            sysThirdAccount = new SysThirdAccount();
            sysThirdAccount.setSysUserId(sysUserId);
            sysThirdAccount.setStatus(1);
            sysThirdAccount.setDelFlag(0);
            sysThirdAccount.setThirdType(THIRD_TYPE);
        }
        sysThirdAccount.setThirdUserId(dtUserId);
        sysThirdAccountService.saveOrUpdate(sysThirdAccount);
    }

@zhangdaiscott
Copy link
Member Author

zhangdaiscott commented Oct 28, 2022

无问题

@sjlei
Copy link

sjlei commented Nov 3, 2022

逻辑没问题,通过thirdUserId查询出来,判断是否为null,再去决定是insert还是update,由于调用的是同一个方法,所以在该方法内set了thirdUserId,但update时是并没有更新的,只是为了兼顾insert时的逻辑。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants