From 700803fd20b76337243250dcb2bd33b3ccee861c Mon Sep 17 00:00:00 2001 From: dzl <863620989@qq.com> Date: Tue, 6 May 2025 18:01:02 +0800 Subject: [PATCH] =?UTF-8?q?=E6=8E=A5=E5=8F=A3=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../impl/EbikeOperationRegionServiceImpl.java | 21 ++++++++++--------- 1 file changed, 11 insertions(+), 10 deletions(-) diff --git a/ebike-operate/src/main/java/com/cdzy/ebikeoperate/service/impl/EbikeOperationRegionServiceImpl.java b/ebike-operate/src/main/java/com/cdzy/ebikeoperate/service/impl/EbikeOperationRegionServiceImpl.java index 7190d97f..f192aa2a 100644 --- a/ebike-operate/src/main/java/com/cdzy/ebikeoperate/service/impl/EbikeOperationRegionServiceImpl.java +++ b/ebike-operate/src/main/java/com/cdzy/ebikeoperate/service/impl/EbikeOperationRegionServiceImpl.java @@ -37,6 +37,7 @@ import org.springframework.beans.BeanUtils; import org.springframework.data.geo.Point; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; +import org.springframework.util.StringUtils; import java.time.LocalDateTime; import java.util.*; @@ -93,8 +94,8 @@ public class EbikeOperationRegionServiceImpl extends ServiceImpl pageOperationRegion(PageParam pageParam, String simpleName, String regionName, Integer inOperation) { QueryWrapper queryWrapper = QueryWrapper.create() - .where(EBIKE_OPERATION_REGION.SIMPLE_NAME.eq(simpleName, !simpleName.isBlank())) - .where(EBIKE_OPERATION_REGION.OPERATION_REGION_NAME.eq(regionName, !regionName.isBlank())) + .where(EBIKE_OPERATION_REGION.SIMPLE_NAME.eq(simpleName, !StringUtils.isEmpty(simpleName))) + .where(EBIKE_OPERATION_REGION.OPERATION_REGION_NAME.eq(regionName, !StringUtils.isEmpty(regionName))) .where(EBIKE_OPERATION_REGION.IN_OPERATION.eq(inOperation, Objects::nonNull)); return this.mapper.paginate(pageParam.getPage(), queryWrapper); } @@ -122,8 +123,8 @@ public class EbikeOperationRegionServiceImpl extends ServiceImpl ebikeOperationRegions = this.mapper.selectListByIds(delRegionDto.getIds()); - ebikeOperationRegions.forEach(region->{ - delPoints(region.getOrgId(),region.getOperationRegionId()); + ebikeOperationRegions.forEach(region -> { + delPoints(region.getOrgId(), region.getOperationRegionId()); }); this.mapper.deleteBatchByIds(delRegionDto.getIds()); } @@ -135,7 +136,7 @@ public class EbikeOperationRegionServiceImpl extends ServiceImpl map = new HashMap<>(); + Map map = new HashMap<>(); for (RedisPoint redisPoint : redisPoints) { map.put(redisPoint.getMember(), redisPoint); } List strings = redisPoints.stream().map(RedisPoint::getMember).toList(); ReqEcuSnDto ecuSnDto = new ReqEcuSnDto(strings); JsonResult> result = maintenanceFeignClient.getBikeByEcuSn(ecuSnDto); - if (result.getCode() != 200){ + if (result.getCode() != 200) { throw new RuntimeException("获取车辆信息失败"); } List bikeInfos = result.getData(); @@ -211,7 +212,7 @@ public class EbikeOperationRegionServiceImpl extends ServiceImpl points, Long orgId, Long operateRegionId) { @@ -250,7 +251,7 @@ public class EbikeOperationRegionServiceImpl extends ServiceImpl jsonResult = staffFeignClient.getInfoByToken(tokenValue); StaffFeign staffFeign = jsonResult.getData();