【fix sonar】OnlAuthRelationServiceImpl文件
This commit is contained in:
+16
-15
@@ -1,35 +1,36 @@
|
|||||||
package com.jero.generater.modules.online.auth.service.impl;
|
package com.jero.generater.modules.online.auth.service.impl;
|
||||||
|
|
||||||
import com.baomidou.mybatisplus.core.conditions.Wrapper;
|
|
||||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||||
import java.util.ArrayList;
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||||
import com.jero.generater.modules.online.auth.entity.OnlAuthRelation;
|
import com.jero.generater.modules.online.auth.entity.OnlAuthRelation;
|
||||||
import com.jero.generater.modules.online.auth.mapper.OnlAuthRelationMapper;
|
import com.jero.generater.modules.online.auth.mapper.OnlAuthRelationMapper;
|
||||||
import com.jero.generater.modules.online.auth.service.IOnlAuthRelationService;
|
import com.jero.generater.modules.online.auth.service.IOnlAuthRelationService;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
@Service("OnlAuthRelationServiceImpl")
|
|
||||||
|
@Service("onlAuthRelationServiceImpl")
|
||||||
public class OnlAuthRelationServiceImpl extends ServiceImpl<OnlAuthRelationMapper, OnlAuthRelation> implements IOnlAuthRelationService {
|
public class OnlAuthRelationServiceImpl extends ServiceImpl<OnlAuthRelationMapper, OnlAuthRelation> implements IOnlAuthRelationService {
|
||||||
|
|
||||||
|
@Override
|
||||||
public void saveRoleAuth(String roleId, String cgformId, int type, List<String> authIds) {
|
public void saveRoleAuth(String roleId, String cgformId, int type, List<String> authIds) {
|
||||||
LambdaQueryWrapper<OnlAuthRelation> lambdaQueryWrapper = new LambdaQueryWrapper();
|
LambdaQueryWrapper<OnlAuthRelation> lambdaQueryWrapper = new LambdaQueryWrapper<>();
|
||||||
lambdaQueryWrapper.eq(OnlAuthRelation::getCgformId, cgformId)
|
lambdaQueryWrapper.eq(OnlAuthRelation::getCgformId, cgformId)
|
||||||
.eq(OnlAuthRelation::getType, Integer.valueOf(type))
|
.eq(OnlAuthRelation::getType, type)
|
||||||
.eq(OnlAuthRelation::getRoleId, roleId);
|
.eq(OnlAuthRelation::getRoleId, roleId);
|
||||||
|
|
||||||
this.baseMapper.delete((Wrapper)lambdaQueryWrapper);
|
this.baseMapper.delete(lambdaQueryWrapper);
|
||||||
|
|
||||||
ArrayList<OnlAuthRelation> arrayList = new ArrayList();
|
ArrayList<OnlAuthRelation> arrayList = new ArrayList<>();
|
||||||
for (String str : authIds) {
|
for (String str : authIds) {
|
||||||
OnlAuthRelation onlAuthRelation = new OnlAuthRelation();
|
OnlAuthRelation onlAuthRelation = new OnlAuthRelation();
|
||||||
onlAuthRelation.setAuthId(str);
|
onlAuthRelation.setAuthId(str);
|
||||||
onlAuthRelation.setCgformId(cgformId);
|
onlAuthRelation.setCgformId(cgformId);
|
||||||
onlAuthRelation.setRoleId(roleId);
|
onlAuthRelation.setRoleId(roleId);
|
||||||
onlAuthRelation.setType(Integer.valueOf(type));
|
onlAuthRelation.setType(type);
|
||||||
arrayList.add(onlAuthRelation);
|
arrayList.add(onlAuthRelation);
|
||||||
}
|
}
|
||||||
|
|
||||||
saveBatch(arrayList);
|
saveBatch(arrayList);
|
||||||
|
|||||||
Reference in New Issue
Block a user