mirror of
https://codeup.aliyun.com/67c68d4e484ca2f0a13ac3c1/ydc/jsowell-charger-web.git
synced 2026-06-12 19:29:52 +08:00
bugfix 宁波平台query_station_status分页错误
This commit is contained in:
@@ -76,6 +76,7 @@ import com.jsowell.thirdparty.common.NotificationService;
|
|||||||
import com.jsowell.thirdparty.huawei.HuaWeiService;
|
import com.jsowell.thirdparty.huawei.HuaWeiService;
|
||||||
import com.jsowell.thirdparty.lianlian.service.LianLianService;
|
import com.jsowell.thirdparty.lianlian.service.LianLianService;
|
||||||
import com.jsowell.thirdparty.lutongyunting.service.LTYTService;
|
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.Cryptos;
|
||||||
import com.jsowell.thirdparty.platform.util.Encodes;
|
import com.jsowell.thirdparty.platform.util.Encodes;
|
||||||
import com.jsowell.thirdparty.platform.util.GBSignUtils;
|
import com.jsowell.thirdparty.platform.util.GBSignUtils;
|
||||||
@@ -91,6 +92,7 @@ import org.junit.runner.RunWith;
|
|||||||
import org.slf4j.Logger;
|
import org.slf4j.Logger;
|
||||||
import org.slf4j.LoggerFactory;
|
import org.slf4j.LoggerFactory;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.beans.factory.annotation.Qualifier;
|
||||||
import org.springframework.boot.test.context.SpringBootTest;
|
import org.springframework.boot.test.context.SpringBootTest;
|
||||||
import org.springframework.test.context.ActiveProfiles;
|
import org.springframework.test.context.ActiveProfiles;
|
||||||
import org.springframework.test.context.junit4.SpringRunner;
|
import org.springframework.test.context.junit4.SpringRunner;
|
||||||
@@ -268,6 +270,18 @@ public class SpringBootTestController {
|
|||||||
@Autowired
|
@Autowired
|
||||||
private CarCouponRecordService carCouponRecordService;
|
private CarCouponRecordService carCouponRecordService;
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
@Qualifier("zhongDianLianPlatformServiceImpl")
|
||||||
|
private ThirdPartyPlatformService platformLogic;
|
||||||
|
|
||||||
|
@Test
|
||||||
|
public void queryStationStatus() {
|
||||||
|
QueryStationInfoDTO dto = new QueryStationInfoDTO();
|
||||||
|
dto.setStationIds(Lists.newArrayList("19"));
|
||||||
|
Map<String, String> map = platformLogic.queryStationStatus(dto);
|
||||||
|
System.out.println(map);
|
||||||
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void batchSelectConnectorList() {
|
public void batchSelectConnectorList() {
|
||||||
ArrayList<String> stationIds = Lists.newArrayList("19", "2", "14");
|
ArrayList<String> stationIds = Lists.newArrayList("19", "2", "14");
|
||||||
|
|||||||
@@ -449,19 +449,19 @@ public class ZhongDianLianPlatformServiceImpl implements ThirdPartyPlatformServi
|
|||||||
StationStatusInfos.add(stationStatusInfo);
|
StationStatusInfos.add(stationStatusInfo);
|
||||||
}
|
}
|
||||||
// 将 StationStatusInfos 分页
|
// 将 StationStatusInfos 分页
|
||||||
int pageNum = 1;
|
// int pageNum = 1;
|
||||||
int pageSize = 10;
|
// int pageSize = 10;
|
||||||
List<StationStatusInfo> collect = StationStatusInfos.stream()
|
// List<StationStatusInfo> collect = StationStatusInfos.stream()
|
||||||
.skip((pageNum - 1) * pageSize)
|
// .skip((pageNum - 1) * pageSize)
|
||||||
.limit(pageSize)
|
// .limit(pageSize)
|
||||||
.collect(Collectors.toList());
|
// .collect(Collectors.toList());
|
||||||
|
|
||||||
int total = StationStatusInfos.size();
|
int total = StationStatusInfos.size();
|
||||||
int pages = PageUtil.totalPage(total, pageSize);
|
// int pages = PageUtil.totalPage(total, pageSize);
|
||||||
|
|
||||||
Map<String, Object> map = new LinkedHashMap<>();
|
Map<String, Object> map = new LinkedHashMap<>();
|
||||||
map.put("Total", total);
|
map.put("Total", total);
|
||||||
map.put("StationStatusInfos", collect);
|
map.put("StationStatusInfos", StationStatusInfos);
|
||||||
|
|
||||||
return ThirdPartyPlatformUtils.generateResultMap(map, ningBoSecretInfoVO);
|
return ThirdPartyPlatformUtils.generateResultMap(map, ningBoSecretInfoVO);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user