|
@@ -2,10 +2,12 @@ package com.fdkankan.manage.service.impl;
|
|
|
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
|
|
import com.fdkankan.manage.common.ResultCode;
|
|
|
+import com.fdkankan.manage.entity.JySceneAuth;
|
|
|
import com.fdkankan.manage.entity.JySceneUserAuth;
|
|
|
import com.fdkankan.manage.entity.JyUser;
|
|
|
import com.fdkankan.manage.exception.BusinessException;
|
|
|
import com.fdkankan.manage.mapper.IJySceneUserAuthMapper;
|
|
|
+import com.fdkankan.manage.service.IJySceneAuthService;
|
|
|
import com.fdkankan.manage.service.IJySceneUserAuthService;
|
|
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
|
|
import com.fdkankan.manage.service.IJyUserService;
|
|
@@ -30,9 +32,19 @@ public class JySceneUserAuthServiceImpl extends ServiceImpl<IJySceneUserAuthMapp
|
|
|
|
|
|
@Autowired
|
|
|
IJyUserService jyUserService;
|
|
|
+ @Autowired
|
|
|
+ IJySceneAuthService jySceneAuthService;
|
|
|
|
|
|
@Override
|
|
|
public Object getAuthList(String num) {
|
|
|
+ if(StringUtils.isBlank(num)){
|
|
|
+ throw new BusinessException(ResultCode.MISSING_REQUIRED_PARAMETERS);
|
|
|
+ }
|
|
|
+ JySceneAuth jySceneAuth = jySceneAuthService.getByNum(num);
|
|
|
+ if(jySceneAuth == null){
|
|
|
+ return new JySceneAuth(0);
|
|
|
+ }
|
|
|
+
|
|
|
LambdaQueryWrapper<JySceneUserAuth> wrapper = new LambdaQueryWrapper<>();
|
|
|
wrapper.eq(JySceneUserAuth::getNum,num);
|
|
|
wrapper.orderByDesc(JySceneUserAuth::getCreateTime);
|
|
@@ -49,12 +61,20 @@ public class JySceneUserAuthServiceImpl extends ServiceImpl<IJySceneUserAuthMapp
|
|
|
jySceneUserAuth.setRyNickName(jyUser.getRyNickName());
|
|
|
}
|
|
|
}
|
|
|
- return list;
|
|
|
+ jySceneAuth.setUserAuthList(list);
|
|
|
+ return jySceneAuth;
|
|
|
}
|
|
|
|
|
|
|
|
|
@Override
|
|
|
public void addAuth(JySceneUserAuth param) {
|
|
|
+ if(param.getAuthType() == null || StringUtils.isBlank(param.getNum())){
|
|
|
+ throw new BusinessException(ResultCode.MISSING_REQUIRED_PARAMETERS);
|
|
|
+ }
|
|
|
+ jySceneAuthService.updateAuthTypeByNum(param.getNum(),param.getAuthType());
|
|
|
+ if(param.getAuthType() == 1){
|
|
|
+ return;
|
|
|
+ }
|
|
|
if(StringUtils.isBlank(param.getRyId()) || StringUtils.isBlank(param.getNum()) ){
|
|
|
throw new BusinessException(ResultCode.MISSING_REQUIRED_PARAMETERS);
|
|
|
}
|