mirror of
https://codeup.aliyun.com/67c68d4e484ca2f0a13ac3c1/ydc/jsowell-charger-web.git
synced 2026-04-20 11:05:18 +08:00
update 电单车协议
This commit is contained in:
@@ -164,11 +164,23 @@ public class PileService {
|
||||
throw new BusinessException(ReturnCodeEnum.CODE_PARAM_NOT_NULL_ERROR);
|
||||
}
|
||||
String pileSn;
|
||||
if (param.length() == 16) {
|
||||
pileSn = StringUtils.substring(param, 0, param.length() - 2);
|
||||
// param长度大于10是汽车桩, 否则是电单车桩
|
||||
if (param.length() > 10) {
|
||||
// 汽车桩, 桩编号14位, 枪口号2位
|
||||
if (param.length() == 16) {
|
||||
pileSn = StringUtils.substring(param, 0, param.length() - 2);
|
||||
} else {
|
||||
pileSn = param;
|
||||
}
|
||||
} else {
|
||||
pileSn = param;
|
||||
// 电单车桩, 桩编号8位, 枪口号2位
|
||||
if (param.length() == 10) {
|
||||
pileSn = StringUtils.substring(param, 0, param.length() - 2);
|
||||
} else {
|
||||
pileSn = param;
|
||||
}
|
||||
}
|
||||
|
||||
// 查询充电桩信息
|
||||
PileInfoVO pileInfoVO = pileBasicInfoService.selectPileInfoBySn(pileSn);
|
||||
if (pileInfoVO == null) {
|
||||
@@ -230,9 +242,12 @@ public class PileService {
|
||||
if (pileConnectorDetailVO == null) {
|
||||
return null;
|
||||
}
|
||||
// 枪口状态不为2:占用(未充电)
|
||||
if (!StringUtils.equals(PileConnectorDataBaseStatusEnum.OCCUPIED_NOT_CHARGED.getValue(), pileConnectorDetailVO.getConnectorStatus())) {
|
||||
throw new BusinessException(ReturnCodeEnum.CODE_PILE_CONNECTOR_STATUS_ERROR);
|
||||
// 不是电单车的桩, 需要判断插枪状态
|
||||
if (!StringUtils.equals(Constants.THREE, pileConnectorDetailVO.getChargePortType())) {
|
||||
// 枪口状态不为2:占用(未充电)
|
||||
if (!StringUtils.equals(PileConnectorDataBaseStatusEnum.OCCUPIED_NOT_CHARGED.getValue(), pileConnectorDetailVO.getConnectorStatus())) {
|
||||
throw new BusinessException(ReturnCodeEnum.CODE_PILE_CONNECTOR_STATUS_ERROR);
|
||||
}
|
||||
}
|
||||
String pileSn = pileConnectorDetailVO.getPileSn();
|
||||
AppletPileDetailVO resultVO = getPileDetailByPileSn(pileSn);
|
||||
|
||||
Reference in New Issue
Block a user