From 93b4a9bc91331c611ee9fec13f5002c802e81f79 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=A2=81=E7=90=A6=E6=B6=9B?= Date: Mon, 13 Mar 2023 14:08:05 +0800 Subject: [PATCH] =?UTF-8?q?=E3=80=90fix=20sonar=E3=80=91OnlAuthRelationSer?= =?UTF-8?q?viceImpl=E6=96=87=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../impl/OnlAuthRelationServiceImpl.java | 31 ++++++++++--------- 1 file changed, 16 insertions(+), 15 deletions(-) diff --git a/jero-boot/jero-boot-base/jero-boot-base-generater/src/main/java/com/jero/generater/modules/online/auth/service/impl/OnlAuthRelationServiceImpl.java b/jero-boot/jero-boot-base/jero-boot-base-generater/src/main/java/com/jero/generater/modules/online/auth/service/impl/OnlAuthRelationServiceImpl.java index 1004f60e..76233ea0 100644 --- a/jero-boot/jero-boot-base/jero-boot-base-generater/src/main/java/com/jero/generater/modules/online/auth/service/impl/OnlAuthRelationServiceImpl.java +++ b/jero-boot/jero-boot-base/jero-boot-base-generater/src/main/java/com/jero/generater/modules/online/auth/service/impl/OnlAuthRelationServiceImpl.java @@ -1,35 +1,36 @@ 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 java.util.ArrayList; -import java.util.List; - import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; 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.service.IOnlAuthRelationService; import org.springframework.stereotype.Service; +import java.util.ArrayList; +import java.util.List; -@Service("OnlAuthRelationServiceImpl") + +@Service("onlAuthRelationServiceImpl") public class OnlAuthRelationServiceImpl extends ServiceImpl implements IOnlAuthRelationService { + + @Override public void saveRoleAuth(String roleId, String cgformId, int type, List authIds) { - LambdaQueryWrapper lambdaQueryWrapper = new LambdaQueryWrapper(); + LambdaQueryWrapper lambdaQueryWrapper = new LambdaQueryWrapper<>(); lambdaQueryWrapper.eq(OnlAuthRelation::getCgformId, cgformId) - .eq(OnlAuthRelation::getType, Integer.valueOf(type)) + .eq(OnlAuthRelation::getType, type) .eq(OnlAuthRelation::getRoleId, roleId); - this.baseMapper.delete((Wrapper)lambdaQueryWrapper); + this.baseMapper.delete(lambdaQueryWrapper); - ArrayList arrayList = new ArrayList(); + ArrayList arrayList = new ArrayList<>(); for (String str : authIds) { - OnlAuthRelation onlAuthRelation = new OnlAuthRelation(); - onlAuthRelation.setAuthId(str); - onlAuthRelation.setCgformId(cgformId); - onlAuthRelation.setRoleId(roleId); - onlAuthRelation.setType(Integer.valueOf(type)); - arrayList.add(onlAuthRelation); + OnlAuthRelation onlAuthRelation = new OnlAuthRelation(); + onlAuthRelation.setAuthId(str); + onlAuthRelation.setCgformId(cgformId); + onlAuthRelation.setRoleId(roleId); + onlAuthRelation.setType(type); + arrayList.add(onlAuthRelation); } saveBatch(arrayList);