update 电单车

This commit is contained in:
Guoqs
2024-09-13 16:12:26 +08:00
parent 09a8709618
commit 871b8bea77
2 changed files with 20 additions and 32 deletions

View File

@@ -150,7 +150,8 @@ public class EBikeMessageCmd06 extends AbsEBikeMessage {
startIndex += length;
length = 2;
this.totalUsedElectricity = BytesUtil.bytesToIntLittle(BytesUtil.copyBytes(dataBytes, startIndex, length)) * 0.01 + "";
this.totalUsedElectricity = new BigDecimal(BytesUtil.bytesToIntLittle(BytesUtil.copyBytes(dataBytes, startIndex, length)))
.multiply(new BigDecimal("0.01")).toString();
startIndex += length;
length = 1;
@@ -158,19 +159,23 @@ public class EBikeMessageCmd06 extends AbsEBikeMessage {
startIndex += length;
length = 2;
this.realTimePower = BytesUtil.bytesToIntLittle(BytesUtil.copyBytes(dataBytes, startIndex, length)) * 0.1 + "";
this.realTimePower = new BigDecimal(BytesUtil.bytesToIntLittle(BytesUtil.copyBytes(dataBytes, startIndex, length)))
.multiply(new BigDecimal("0.1")).toString();
startIndex += length;
length = 2;
this.maxPower = BytesUtil.bytesToIntLittle(BytesUtil.copyBytes(dataBytes, startIndex, length)) * 0.1 + "";
this.maxPower = new BigDecimal(BytesUtil.bytesToIntLittle(BytesUtil.copyBytes(dataBytes, startIndex, length)))
.multiply(new BigDecimal("0.1")).toString();
startIndex += length;
length = 2;
this.minPower = BytesUtil.bytesToIntLittle(BytesUtil.copyBytes(dataBytes, startIndex, length)) * 0.1 + "";
this.minPower = new BigDecimal(BytesUtil.bytesToIntLittle(BytesUtil.copyBytes(dataBytes, startIndex, length)))
.multiply(new BigDecimal("0.1")).toString();
startIndex += length;
length = 2;
this.avgPower = BytesUtil.bytesToIntLittle(BytesUtil.copyBytes(dataBytes, startIndex, length)) * 0.1 + "";
this.avgPower = new BigDecimal(BytesUtil.bytesToIntLittle(BytesUtil.copyBytes(dataBytes, startIndex, length)))
.multiply(new BigDecimal("0.1")).toString();
startIndex += length;
length = 16;
@@ -182,7 +187,8 @@ public class EBikeMessageCmd06 extends AbsEBikeMessage {
startIndex += length;
length = 2;
this.peakPower = BytesUtil.bytesToIntLittle(BytesUtil.copyBytes(dataBytes, startIndex, length)) + "";
this.peakPower = new BigDecimal(BytesUtil.bytesToIntLittle(BytesUtil.copyBytes(dataBytes, startIndex, length)))
.multiply(new BigDecimal("0.1")).toString();
startIndex += length;
length = 2;
@@ -196,11 +202,13 @@ public class EBikeMessageCmd06 extends AbsEBikeMessage {
startIndex += length;
length = 1;
this.ambientTemperature = BytesUtil.bytesToIntLittle(BytesUtil.copyBytes(dataBytes, startIndex, length)) + "";
this.ambientTemperature = new BigDecimal(BytesUtil.bytesToIntLittle(BytesUtil.copyBytes(dataBytes, startIndex, length)))
.subtract(new BigDecimal("65")).toString();
startIndex += length;
length = 1;
this.portTemperature = BytesUtil.bytesToIntLittle(BytesUtil.copyBytes(dataBytes, startIndex, length)) + "";
this.portTemperature = new BigDecimal(BytesUtil.bytesToIntLittle(BytesUtil.copyBytes(dataBytes, startIndex, length)))
.subtract(new BigDecimal("65")).toString();
startIndex += length;
length = 2;

View File

@@ -32,15 +32,14 @@ import com.jsowell.pile.vo.base.ThirdPartyStationRelationVO;
import com.jsowell.pile.vo.huawei.QueryStartChargeVO;
import com.jsowell.pile.vo.web.PileStationVO;
import com.jsowell.thirdparty.huawei.HuaweiServiceV2;
import com.jsowell.thirdparty.lianlian.service.LianLianService;
import com.jsowell.thirdparty.lutongyunting.service.LTYTService;
import com.jsowell.thirdparty.nanrui.service.NRService;
import com.jsowell.thirdparty.platform.service.impl.DianXingPlatformServiceImpl;
import com.jsowell.thirdparty.platform.service.impl.HaiNanPlatformServiceImpl;
import com.jsowell.thirdparty.huawei.HuaWeiService;
import com.jsowell.thirdparty.lianlian.service.LianLianService;
import com.jsowell.thirdparty.platform.service.impl.NingXiaPlatformServiceImpl;
import com.jsowell.thirdparty.platform.service.impl.QingHaiPlatformServiceImpl;
import com.jsowell.thirdparty.platform.util.HttpRequestUtil;
import com.jsowell.thirdparty.lutongyunting.service.LTYTService;
import com.jsowell.thirdparty.nanrui.service.NRService;
import com.jsowell.thirdparty.ruanjie.service.RJService;
import com.jsowell.thirdparty.service.ThirdpartySecretInfoService;
import com.jsowell.thirdparty.xindiantu.service.XDTService;
@@ -109,9 +108,6 @@ public class CommonService {
@Autowired
private RJService rjService;
@Autowired
private HuaWeiService huaWeiService;
@Autowired
private HuaweiServiceV2 huaweiServiceV2;
@@ -230,21 +226,8 @@ public class CommonService {
// 推送第三方平台,先通过桩编号查出站点信息 pushToThirdPartyPlatforms
PileBasicInfo pileBasicInfo = pileBasicInfoService.selectPileBasicInfoBySN(pileSn);
// Map<String, String> pileStatusMap = pileConnectorInfoService.getPileStatus(Lists.newArrayList(pileSn));
// String pileStatus = pileStatusMap.get(pileSn);
// if (StringUtils.equals(connectorStatus, pileStatus)) {
// return null;
// }
// 状态不一样,传给第三方平台
// ThirdPartyStationRelation relation = new ThirdPartyStationRelation();
// if (StringUtils.isBlank(String.valueOf(pileBasicInfo.getStationId()))) {
// return;
// }
// relation.setStationId(pileBasicInfo.getStationId());
// 查询该站点是否推送第三方平台
List<ThirdPartyStationRelationVO> list = thirdPartyStationRelationService.getRelationInfoList(String.valueOf(pileBasicInfo.getStationId()));
// ThirdPartyStationRelationVO relationInfo = thirdPartyStationRelationService.selectRelationInfo(relation);
if (CollectionUtils.isEmpty(list)) {
return;
}
@@ -263,10 +246,7 @@ public class CommonService {
if (StringUtils.equals(ThirdPlatformTypeEnum.LIAN_LIAN_PLATFORM.getTypeCode(), thirdPartyType)) {
// 联联
OrderBasicInfo orderInfo = orderBasicInfoService.getOrderInfoByTransactionCode(transactionCode);
// if (orderInfo == null) {
// return;
// }
// log.info("推送联联平台实时数据 params: orderBasicInfo:{}", JSON.toJSONString(orderInfo));
// 设备状态变化推送 notification_stationStatus
dto.setThirdPartyType(ThirdPlatformTypeEnum.LIAN_LIAN_PLATFORM.getTypeCode());
lianLianService.pushConnectorStatus(dto);