diff --git a/jsowell-admin/src/test/java/SpringBootTestController.java b/jsowell-admin/src/test/java/SpringBootTestController.java index db78c6409..2ee3a6c9c 100644 --- a/jsowell-admin/src/test/java/SpringBootTestController.java +++ b/jsowell-admin/src/test/java/SpringBootTestController.java @@ -72,6 +72,7 @@ import java.nio.charset.StandardCharsets; import java.text.ParseException; import java.text.SimpleDateFormat; import java.util.*; +import java.util.concurrent.ExecutionException; @ActiveProfiles("dev") @SpringBootTest(classes = JsowellApplication.class, webEnvironment = SpringBootTest.WebEnvironment.RANDOM_PORT) @@ -173,9 +174,14 @@ public class SpringBootTestController { @Test public void testGetPileListByStationIdList() { - List stationIdList = Lists.newArrayList("2"); - Map> pileListByStationIdList = aMapService.getPileListByStationIdList(stationIdList); - System.out.println(pileListByStationIdList); + + // List stationIdList = Lists.newArrayList("2"); + // Map> pileListByStationIdList = aMapService.getPileListByStationIdList(stationIdList); + // System.out.println(pileListByStationIdList); + + GetStationInfoDTO dto = new GetStationInfoDTO(); + dto.setType("page"); + aMapService.getStationInfosV2(dto); } @Test diff --git a/jsowell-thirdparty/src/main/java/com/jsowell/thirdparty/amap/common/AMapCommonResult.java b/jsowell-thirdparty/src/main/java/com/jsowell/thirdparty/amap/common/AMapCommonResult.java index 08397f8c9..4248a6193 100644 --- a/jsowell-thirdparty/src/main/java/com/jsowell/thirdparty/amap/common/AMapCommonResult.java +++ b/jsowell-thirdparty/src/main/java/com/jsowell/thirdparty/amap/common/AMapCommonResult.java @@ -24,7 +24,7 @@ public class AMapCommonResult { */ public AMapCommonResult successResponse(Object responseData) { AMapResponse response = new AMapResponse(); - response.setCode("1000"); + response.setCode("10000"); response.setMsg("请求成功!"); response.setData(responseData); return new AMapCommonResult(response); diff --git a/jsowell-thirdparty/src/main/java/com/jsowell/thirdparty/amap/service/impl/AMapServiceImpl.java b/jsowell-thirdparty/src/main/java/com/jsowell/thirdparty/amap/service/impl/AMapServiceImpl.java index 412657bdc..dea9c084b 100644 --- a/jsowell-thirdparty/src/main/java/com/jsowell/thirdparty/amap/service/impl/AMapServiceImpl.java +++ b/jsowell-thirdparty/src/main/java/com/jsowell/thirdparty/amap/service/impl/AMapServiceImpl.java @@ -158,7 +158,7 @@ public class AMapServiceImpl implements AMapService { aMapInfo = new AMapStationInfo(); String stationId = String.valueOf(stationInfo.getId()); aMapInfo.setStationID(stationId); - aMapInfo.setOperatorID(String.valueOf(stationInfo.getMerchantId())); + aMapInfo.setOperatorID(Constants.OPERATORID_LIANLIAN); aMapInfo.setEquipmentOwnerID(Constants.OPERATORID_LIANLIAN); aMapInfo.setOperatorName(Constants.JSOWELL); aMapInfo.setStationName(stationInfo.getStationName()); @@ -403,8 +403,8 @@ public class AMapServiceImpl implements AMapService { for (String s : applyTime) { info = new AMapPriceChargingInfo(); info.setFeeTime(s); - info.setElectricityFee(billingDetailVO.getElectricityPrice()); - info.setServiceFee(billingDetailVO.getServicePrice()); + info.setElectricityFee(billingDetailVO.getElectricityPrice().setScale(4, BigDecimal.ROUND_HALF_UP)); + info.setServiceFee(billingDetailVO.getServicePrice().setScale(4, BigDecimal.ROUND_HALF_UP)); priceList.add(info); } } @@ -436,7 +436,7 @@ public class AMapServiceImpl implements AMapService { PileModelInfoVO modelInfo = pileModelInfoService.getPileModelInfoByModelId(pileBasicInfo.getModelId()); info.setEquipmentType(Integer.parseInt(modelInfo.getSpeedType())); - info.setPower(new BigDecimal(modelInfo.getRatedPower()).setScale(1, RoundingMode.HALF_UP)); + info.setPower(new BigDecimal(modelInfo.getRatedPower()).setScale(1, BigDecimal.ROUND_HALF_UP)); List aMapConnectorInfos = getConnectorListBySN(pileBasicInfo.getSn()); @@ -486,7 +486,7 @@ public class AMapServiceImpl implements AMapService { info.setEquipmentID(pileSn); info.setManufacturerName(Constants.JSOWELL); info.setEquipmentType(Integer.valueOf(pileInfoVO.getSpeedType())); - info.setPower(new BigDecimal(pileInfoVO.getRatedPower())); + info.setPower(new BigDecimal(pileInfoVO.getRatedPower()).setScale(1, BigDecimal.ROUND_HALF_UP)); connectorInfos = Lists.newArrayList(); for (PileInfoVO infoVO : value) { connectorInfo = new AMapConnectorInfo();