feat:[REQ-3488] 修改sonar提示错误
This commit is contained in:
parent
4098a42052
commit
cc932426ae
@ -206,7 +206,6 @@ public class CooperateShipFoundationServiceImpl implements CooperateShipFoundati
|
||||
.updateBy(creator.getOperatorId())
|
||||
.path(Optional.ofNullable(parentCooperateShip).map(SaasCooperateShip::getPath).orElse(""))
|
||||
.build();
|
||||
|
||||
// 保存协同关系
|
||||
SaasCooperateShip savedCooperateShip = cooperateShipUpsertRepository.create(cooperateShip);
|
||||
|
||||
|
||||
@ -89,7 +89,7 @@ public class CooperateShipServiceImpl implements CooperateShipService {
|
||||
// 如果personId有值, 则先将nodeUser查询来, 作为筛选条件
|
||||
if (isFilterCurrentNodeByPerson) {
|
||||
List<NodeUserQueryRepository.NodeUserResp> nodeUsers = nodeUserQueryRepository.list(NodeUserQueryRepository.ListReq.builder()
|
||||
.selects(Arrays.asList(OrganizationalNodeUser::getTopNodeId))
|
||||
.selects(Collections.singletonList(OrganizationalNodeUser::getTopNodeId))
|
||||
.personId(req.getFilterByPersonId())
|
||||
.includeDeleted(req.getFilterIncludeExitPerson())
|
||||
.build());
|
||||
@ -185,9 +185,9 @@ public class CooperateShipServiceImpl implements CooperateShipService {
|
||||
/**
|
||||
* 校验空值
|
||||
*
|
||||
* @param suppliers
|
||||
* @param suppliers 需要校验的字段
|
||||
*/
|
||||
private final void checkAllNullValue(Supplier<?>... suppliers) {
|
||||
private void checkAllNullValue(Supplier<?>... suppliers) {
|
||||
// 入参空数组,则不做任何处理
|
||||
if (ArrayUtil.isEmpty(suppliers)) {
|
||||
return;
|
||||
@ -197,18 +197,20 @@ public class CooperateShipServiceImpl implements CooperateShipService {
|
||||
for (Supplier<?> supplier : suppliers) {
|
||||
Object value = supplier.get();
|
||||
|
||||
if (value != null) {
|
||||
if (value instanceof Collection) {
|
||||
if (CollUtil.isNotEmpty((Collection<?>) value)) {
|
||||
isAllNull = false;
|
||||
}
|
||||
}
|
||||
if (value == null) {
|
||||
continue;
|
||||
}
|
||||
|
||||
if (value instanceof Long) {
|
||||
Long longValue = Convert.toLong(value, 0L);
|
||||
if (longValue > 0) {
|
||||
isAllNull = false;
|
||||
}
|
||||
// 集合校验
|
||||
if (value instanceof Collection && CollUtil.isNotEmpty((Collection<?>) value)) {
|
||||
isAllNull = false;
|
||||
}
|
||||
|
||||
// Long类型校验
|
||||
if (value instanceof Long) {
|
||||
Long longValue = Convert.toLong(value, 0L);
|
||||
if (longValue > 0) {
|
||||
isAllNull = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user