|
@@ -1152,16 +1152,20 @@ public class TAdminController {
|
|
|
if (StringUtils.isEmpty(adminId) || StringUtils.isEmpty(onOffNotice)) {
|
|
|
return R.fail(ResponseCodesEnum.A0001);
|
|
|
}
|
|
|
+ TAdmin admin = tAdminService.getById(adminId);
|
|
|
// 查询是否有绑定微信
|
|
|
if (onOffNotice.equals("1")) {
|
|
|
- LambdaQueryWrapper<TWechat> wrapper = new LambdaQueryWrapper<>();
|
|
|
- wrapper.eq(TWechat::getAdminId, adminId);
|
|
|
- TWechat wechat = wechatService.getOne(wrapper);
|
|
|
- if (wechat == null) {
|
|
|
- return R.fail(ResponseCodesEnum.A0001, "请先绑定微信");
|
|
|
+ // 如果是国内用户才需要查询
|
|
|
+ if (StringUtils.isNotEmpty(admin.getIfForeign()) && admin.getIfForeign().equals("0")) {
|
|
|
+ LambdaQueryWrapper<TWechat> wrapper = new LambdaQueryWrapper<>();
|
|
|
+ wrapper.eq(TWechat::getAdminId, adminId);
|
|
|
+ TWechat wechat = wechatService.getOne(wrapper);
|
|
|
+ if (wechat == null) {
|
|
|
+ return R.fail(ResponseCodesEnum.A0001, "请先绑定微信");
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
- TAdmin admin = tAdminService.getById(adminId);
|
|
|
+
|
|
|
admin.setOnOffNotice(onOffNotice);
|
|
|
tAdminService.updateById(admin);
|
|
|
return R.ok();
|