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:
@@ -1,5 +1,8 @@
|
||||
package com.jsowell.common.enums.ebike;
|
||||
|
||||
import com.jsowell.common.constant.Constants;
|
||||
import com.jsowell.common.util.StringUtils;
|
||||
|
||||
/**
|
||||
* 电单车端口状态
|
||||
*/
|
||||
@@ -64,4 +67,20 @@ public enum PortStatusEnum {
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* 电单车协议状态转换为数据库状态
|
||||
* @param eBikeStatus
|
||||
* @return
|
||||
*/
|
||||
public static String eBikeStatusTransformDBStatus(String eBikeStatus) {
|
||||
String dbStatus = Constants.ZERO; // 默认0-离网
|
||||
if (StringUtils.isNotBlank(eBikeStatus)) {
|
||||
PortStatusEnum enumByValue = PortStatusEnum.getEnumByValue(Integer.parseInt(eBikeStatus));
|
||||
if (enumByValue != null) {
|
||||
dbStatus = enumByValue.getDbStatus();
|
||||
}
|
||||
}
|
||||
return dbStatus;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user