From 312f05ed3b742fd612245676e7a48c3fdfc6c668 Mon Sep 17 00:00:00 2001 From: Lemon Date: Mon, 11 Nov 2024 10:42:41 +0800 Subject: [PATCH] =?UTF-8?q?bugfix=20=20=E5=AE=81=E6=B3=A2=E5=B9=B3?= =?UTF-8?q?=E5=8F=B0query=5Fstation=5Fstatus=E5=88=86=E9=A1=B5=E9=94=99?= =?UTF-8?q?=E8=AF=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/test/java/SpringBootTestController.java | 14 ++++++++++++++ .../impl/ZhongDianLianPlatformServiceImpl.java | 16 ++++++++-------- 2 files changed, 22 insertions(+), 8 deletions(-) diff --git a/jsowell-admin/src/test/java/SpringBootTestController.java b/jsowell-admin/src/test/java/SpringBootTestController.java index e1f1015fb..eea75b1d7 100644 --- a/jsowell-admin/src/test/java/SpringBootTestController.java +++ b/jsowell-admin/src/test/java/SpringBootTestController.java @@ -76,6 +76,7 @@ import com.jsowell.thirdparty.common.NotificationService; import com.jsowell.thirdparty.huawei.HuaWeiService; import com.jsowell.thirdparty.lianlian.service.LianLianService; import com.jsowell.thirdparty.lutongyunting.service.LTYTService; +import com.jsowell.thirdparty.platform.service.ThirdPartyPlatformService; import com.jsowell.thirdparty.platform.util.Cryptos; import com.jsowell.thirdparty.platform.util.Encodes; import com.jsowell.thirdparty.platform.util.GBSignUtils; @@ -91,6 +92,7 @@ import org.junit.runner.RunWith; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.beans.factory.annotation.Qualifier; import org.springframework.boot.test.context.SpringBootTest; import org.springframework.test.context.ActiveProfiles; import org.springframework.test.context.junit4.SpringRunner; @@ -268,6 +270,18 @@ public class SpringBootTestController { @Autowired private CarCouponRecordService carCouponRecordService; + @Autowired + @Qualifier("zhongDianLianPlatformServiceImpl") + private ThirdPartyPlatformService platformLogic; + + @Test + public void queryStationStatus() { + QueryStationInfoDTO dto = new QueryStationInfoDTO(); + dto.setStationIds(Lists.newArrayList("19")); + Map map = platformLogic.queryStationStatus(dto); + System.out.println(map); + } + @Test public void batchSelectConnectorList() { ArrayList stationIds = Lists.newArrayList("19", "2", "14"); diff --git a/jsowell-thirdparty/src/main/java/com/jsowell/thirdparty/platform/service/impl/ZhongDianLianPlatformServiceImpl.java b/jsowell-thirdparty/src/main/java/com/jsowell/thirdparty/platform/service/impl/ZhongDianLianPlatformServiceImpl.java index 888f7b47b..9aa2cc150 100644 --- a/jsowell-thirdparty/src/main/java/com/jsowell/thirdparty/platform/service/impl/ZhongDianLianPlatformServiceImpl.java +++ b/jsowell-thirdparty/src/main/java/com/jsowell/thirdparty/platform/service/impl/ZhongDianLianPlatformServiceImpl.java @@ -449,19 +449,19 @@ public class ZhongDianLianPlatformServiceImpl implements ThirdPartyPlatformServi StationStatusInfos.add(stationStatusInfo); } // 将 StationStatusInfos 分页 - int pageNum = 1; - int pageSize = 10; - List collect = StationStatusInfos.stream() - .skip((pageNum - 1) * pageSize) - .limit(pageSize) - .collect(Collectors.toList()); + // int pageNum = 1; + // int pageSize = 10; + // List collect = StationStatusInfos.stream() + // .skip((pageNum - 1) * pageSize) + // .limit(pageSize) + // .collect(Collectors.toList()); int total = StationStatusInfos.size(); - int pages = PageUtil.totalPage(total, pageSize); + // int pages = PageUtil.totalPage(total, pageSize); Map map = new LinkedHashMap<>(); map.put("Total", total); - map.put("StationStatusInfos", collect); + map.put("StationStatusInfos", StationStatusInfos); return ThirdPartyPlatformUtils.generateResultMap(map, ningBoSecretInfoVO); }