prd env no test code

This commit is contained in:
ZZ 2022-04-20 10:32:10 +08:00
parent c511712501
commit a7111aa1cf
3 changed files with 124 additions and 122 deletions

View File

@ -27,45 +27,46 @@ public class BmsChargingDataLogic implements ServiceLogic {
public ServiceResult service(ServiceParameter sp) throws Exception { public ServiceResult service(ServiceParameter sp) throws Exception {
Map<String, Object> req = sp.getParameters(); Map<String, Object> req = sp.getParameters();
String hex = (String) req.get("hex"); //todo test only
int idxStart = 60; // String hex = (String) req.get("hex");
int hibsn = Integer.parseInt(hex.substring(idxStart, 2 + idxStart), 16);//BMS 最高单体动力蓄电池电压所在编号 // int idxStart = 60;
idxStart = 2 + idxStart; // int hibsn = Integer.parseInt(hex.substring(idxStart, 2 + idxStart), 16);//BMS 最高单体动力蓄电池电压所在编号
int hibtemp = Integer.parseInt(hex.substring(idxStart, 2 + idxStart), 16) - 50;//BMS 最高动力蓄电池温度 // idxStart = 2 + idxStart;
idxStart = 2 + idxStart; // int hibtemp = Integer.parseInt(hex.substring(idxStart, 2 + idxStart), 16) - 50;//BMS 最高动力蓄电池温度
int hibtempchkpt = Integer.parseInt(hex.substring(idxStart, 2 + idxStart), 16);//最高温度检测点编号 // idxStart = 2 + idxStart;
idxStart = 2 + idxStart; // int hibtempchkpt = Integer.parseInt(hex.substring(idxStart, 2 + idxStart), 16);//最高温度检测点编号
int lobtemp = Integer.parseInt(hex.substring(idxStart, 2 + idxStart), 16) - 50;//最低动力蓄电池温度 // idxStart = 2 + idxStart;
idxStart = 2 + idxStart; // int lobtemp = Integer.parseInt(hex.substring(idxStart, 2 + idxStart), 16) - 50;//最低动力蓄电池温度
int lobtempchkpt = Integer.parseInt(hex.substring(idxStart, 2 + idxStart), 16);//最低动力蓄电池温度检测点编号 // idxStart = 2 + idxStart;
idxStart = 2 + idxStart; // int lobtempchkpt = Integer.parseInt(hex.substring(idxStart, 2 + idxStart), 16);//最低动力蓄电池温度检测点编号
String flags1 = HexUtils.toBinaryString(hex.substring(idxStart, 2 + idxStart));//前4检测标识位 // idxStart = 2 + idxStart;
idxStart = 2 + idxStart; // String flags1 = HexUtils.toBinaryString(hex.substring(idxStart, 2 + idxStart));//前4检测标识位
String flags2 = HexUtils.toBinaryString(hex.substring(idxStart, 2 + idxStart));//后4检测标识位 // idxStart = 2 + idxStart;
idxStart = 0; // String flags2 = HexUtils.toBinaryString(hex.substring(idxStart, 2 + idxStart));//后4检测标识位
String flag = flags1.substring(idxStart, 2 + idxStart); // idxStart = 0;
idxStart = 2 + idxStart; // String flag = flags1.substring(idxStart, 2 + idxStart);
String sb = flag.equals("00") ? "正常" : (flag.equals("01") ? "过高" : "正常");//BMS 单体动力蓄电池电压过高/过低 // idxStart = 2 + idxStart;
flag = flags1.substring(idxStart, 2 + idxStart); // String sb = flag.equals("00") ? "正常" : (flag.equals("01") ? "过高" : "正常");//BMS 单体动力蓄电池电压过高/过低
idxStart = 2 + idxStart; // flag = flags1.substring(idxStart, 2 + idxStart);
String wb = flag.equals("00") ? "正常" : (flag.equals("01") ? "过高" : "正常");//BMS 整车动力蓄电池荷电状态SOC 过高/过低 // idxStart = 2 + idxStart;
flag = flags1.substring(idxStart, 2 + idxStart); // String wb = flag.equals("00") ? "正常" : (flag.equals("01") ? "过高" : "正常");//BMS 整车动力蓄电池荷电状态SOC 过高/过低
idxStart = 2 + idxStart; // flag = flags1.substring(idxStart, 2 + idxStart);
String pbovcurrency = flag.equals("00") ? "正常" : (flag.equals("01") ? "过流" : "不可信状态");//BMS 动力蓄电池充电过电流 // idxStart = 2 + idxStart;
flag = flags1.substring(idxStart, 2 + idxStart); // String pbovcurrency = flag.equals("00") ? "正常" : (flag.equals("01") ? "过流" : "不可信状态");//BMS 动力蓄电池充电过电流
String pbtemphi = flag.equals("00") ? "正常" : (flag.equals("01") ? "过高" : "不可信状态");//BMS 动力蓄电池温度过高 // flag = flags1.substring(idxStart, 2 + idxStart);
idxStart = 0; // String pbtemphi = flag.equals("00") ? "正常" : (flag.equals("01") ? "过高" : "不可信状态");//BMS 动力蓄电池温度过高
flag = flags1.substring(idxStart, 2 + idxStart); // idxStart = 0;
idxStart = 2 + idxStart; // flag = flags1.substring(idxStart, 2 + idxStart);
String pbinsulation = flag.equals("00") ? "正常" : (flag.equals("01") ? "不正常" : "不可信状态");//BMS 动力蓄电池绝缘状态 // idxStart = 2 + idxStart;
flag = flags2.substring(idxStart, 2 + idxStart); // String pbinsulation = flag.equals("00") ? "正常" : (flag.equals("01") ? "不正常" : "不可信状态");//BMS 动力蓄电池绝缘状态
idxStart = 2 + idxStart; // flag = flags2.substring(idxStart, 2 + idxStart);
String pboconn = flag.equals("00") ? "正常" : (flag.equals("01") ? "不正常" : "不可信状态");//BMS 动力蓄电池组输出连接器连接状态 // idxStart = 2 + idxStart;
flag = flags2.substring(idxStart, 2 + idxStart); // String pboconn = flag.equals("00") ? "正常" : (flag.equals("01") ? "不正常" : "不可信状态");//BMS 动力蓄电池组输出连接器连接状态
idxStart = 2 + idxStart; // flag = flags2.substring(idxStart, 2 + idxStart);
String chargingForbidden = flag.equals("00") ? "禁止" : "允许";//充电禁止 // idxStart = 2 + idxStart;
flag = flags2.substring(idxStart, 2 + idxStart); // String chargingForbidden = flag.equals("00") ? "禁止" : "允许";//充电禁止
String reserved = flag;//预留位 // flag = flags2.substring(idxStart, 2 + idxStart);
// String reserved = flag;//预留位
//682382A90025808360000100100122041109221317998083600001001001FF57FF56FF85F14D05 //682382A90025808360000100100122041109221317998083600001001001FF57FF56FF85F14D05
XhpcDeviceMessage deviceMessage = new XhpcDeviceMessage(); XhpcDeviceMessage deviceMessage = new XhpcDeviceMessage();

View File

@ -29,89 +29,89 @@ public class BmsErrorDataLogic implements ServiceLogic {
String remark = "充电桩与 BMS 充电错误报文"; String remark = "充电桩与 BMS 充电错误报文";
Map<String, Object> req = sp.getParameters(); Map<String, Object> req = sp.getParameters();
// todo test only
String hex = (String) req.get("hex"); // String hex = (String) req.get("hex");
int idxStart = 60; // int idxStart = 60;
String flags1 = HexUtils.toBinaryString(hex.substring(idxStart, 2 + idxStart));//每字节若干检测标识位 // String flags1 = HexUtils.toBinaryString(hex.substring(idxStart, 2 + idxStart));//每字节若干检测标识位
idxStart = 2 + idxStart; // idxStart = 2 + idxStart;
String flags2 = HexUtils.toBinaryString(hex.substring(idxStart, 2 + idxStart)); // String flags2 = HexUtils.toBinaryString(hex.substring(idxStart, 2 + idxStart));
idxStart = 2 + idxStart; // idxStart = 2 + idxStart;
String flags3 = HexUtils.toBinaryString(hex.substring(idxStart, 2 + idxStart)); // String flags3 = HexUtils.toBinaryString(hex.substring(idxStart, 2 + idxStart));
idxStart = 2 + idxStart; // idxStart = 2 + idxStart;
String flags4 = HexUtils.toBinaryString(hex.substring(idxStart, 2 + idxStart)); // String flags4 = HexUtils.toBinaryString(hex.substring(idxStart, 2 + idxStart));
idxStart = 2 + idxStart; // idxStart = 2 + idxStart;
String flags5 = HexUtils.toBinaryString(hex.substring(idxStart, 2 + idxStart)); // String flags5 = HexUtils.toBinaryString(hex.substring(idxStart, 2 + idxStart));
idxStart = 2 + idxStart; // idxStart = 2 + idxStart;
String flags6 = HexUtils.toBinaryString(hex.substring(idxStart, 2 + idxStart)); // String flags6 = HexUtils.toBinaryString(hex.substring(idxStart, 2 + idxStart));
idxStart = 2 + idxStart; // idxStart = 2 + idxStart;
String flags7 = HexUtils.toBinaryString(hex.substring(idxStart, 2 + idxStart)); // String flags7 = HexUtils.toBinaryString(hex.substring(idxStart, 2 + idxStart));
idxStart = 2 + idxStart; // idxStart = 2 + idxStart;
String flags8 = HexUtils.toBinaryString(hex.substring(idxStart, 2 + idxStart)); // String flags8 = HexUtils.toBinaryString(hex.substring(idxStart, 2 + idxStart));
idxStart = 0;//1 // idxStart = 0;//1
String flag = flags1.substring(idxStart, 2 + idxStart); // String flag = flags1.substring(idxStart, 2 + idxStart);
String spn2560x00 = flag.equals("00") ? "正常" : (flag.equals("01") ? "超时" : "不可信状态");//接收 SPN2560=0x00 的充电机辨识报文超时 // String spn2560x00 = flag.equals("00") ? "正常" : (flag.equals("01") ? "超时" : "不可信状态");//接收 SPN2560=0x00 的充电机辨识报文超时
idxStart = 2 + idxStart; // idxStart = 2 + idxStart;
flag = flags1.substring(idxStart, 2 + idxStart); // flag = flags1.substring(idxStart, 2 + idxStart);
String spn2560xAA = flag.equals("00") ? "正常" : (flag.equals("01") ? "超时" : "不可信状态");//接收 SPN2560=0xAA 的充电机辨识报文超时 // String spn2560xAA = flag.equals("00") ? "正常" : (flag.equals("01") ? "超时" : "不可信状态");//接收 SPN2560=0xAA 的充电机辨识报文超时
idxStart = 2 + idxStart; // idxStart = 2 + idxStart;
flag = flags1.substring(idxStart, 4 + idxStart); // flag = flags1.substring(idxStart, 4 + idxStart);
String reserved1 = flag;//预留位 // String reserved1 = flag;//预留位
idxStart = 0;//2 // idxStart = 0;//2
String rectsyncmax = flag.equals("00") ? "正常" : (flag.equals("01") ? "超时" : "不可信状态");//接收充电机的时间同步和充电机最大输出能力报文超时 // String rectsyncmax = flag.equals("00") ? "正常" : (flag.equals("01") ? "超时" : "不可信状态");//接收充电机的时间同步和充电机最大输出能力报文超时
idxStart = 2 + idxStart; // idxStart = 2 + idxStart;
flag = flags2.substring(idxStart, 2 + idxStart); // flag = flags2.substring(idxStart, 2 + idxStart);
String recchgprepcompl = flag.equals("00") ? "正常" : (flag.equals("01") ? "超时" : "不可信状态");//接收充电机完成充电准备报文超时 // String recchgprepcompl = flag.equals("00") ? "正常" : (flag.equals("01") ? "超时" : "不可信状态");//接收充电机完成充电准备报文超时
idxStart = 2 + idxStart; // idxStart = 2 + idxStart;
flag = flags2.substring(idxStart, 4 + idxStart); // flag = flags2.substring(idxStart, 4 + idxStart);
String reserved2 = flag;//预留位 // String reserved2 = flag;//预留位
idxStart = 0;//3 // idxStart = 0;//3
flag = flags3.substring(idxStart, 2 + idxStart); // flag = flags3.substring(idxStart, 2 + idxStart);
String recchgst = flag.equals("00") ? "正常" : (flag.equals("01") ? "超时" : "不可信状态");//接收充电机充电状态报文超时 // String recchgst = flag.equals("00") ? "正常" : (flag.equals("01") ? "超时" : "不可信状态");//接收充电机充电状态报文超时
idxStart = 2 + idxStart; // idxStart = 2 + idxStart;
flag = flags3.substring(idxStart, 2 + idxStart); // flag = flags3.substring(idxStart, 2 + idxStart);
String recchgstop = flag.equals("00") ? "正常" : (flag.equals("01") ? "超时" : "不可信状态");//接收充电机中止充电报文超时 // String recchgstop = flag.equals("00") ? "正常" : (flag.equals("01") ? "超时" : "不可信状态");//接收充电机中止充电报文超时
idxStart = 2 + idxStart; // idxStart = 2 + idxStart;
flag = flags3.substring(idxStart, 4 + idxStart); // flag = flags3.substring(idxStart, 4 + idxStart);
String reserved3 = flag;//预留位 // String reserved3 = flag;//预留位
idxStart = 0; // 4 // idxStart = 0; // 4
flag = flags4.substring(idxStart, 2 + idxStart); // flag = flags4.substring(idxStart, 2 + idxStart);
String recchgsum = flag.equals("00") ? "正常" : (flag.equals("01") ? "超时" : "不可信状态");//接收充电机充电统计报文超时 // String recchgsum = flag.equals("00") ? "正常" : (flag.equals("01") ? "超时" : "不可信状态");//接收充电机充电统计报文超时
idxStart = 2 + idxStart; // idxStart = 2 + idxStart;
flag = flags4.substring(idxStart, 6 + idxStart); // flag = flags4.substring(idxStart, 6 + idxStart);
String reserved4 = flag;//BMS 其他 // String reserved4 = flag;//BMS 其他
idxStart = 0; // 5 // idxStart = 0; // 5
flag = flags5.substring(idxStart, 2 + idxStart); // flag = flags5.substring(idxStart, 2 + idxStart);
String recbmsvid = flag.equals("00") ? "正常" : (flag.equals("01") ? "超时" : "不可信状态");//接收 BMS 和车辆的辨识报文超时 // String recbmsvid = flag.equals("00") ? "正常" : (flag.equals("01") ? "超时" : "不可信状态");//接收 BMS 和车辆的辨识报文超时
idxStart = 2 + idxStart; // idxStart = 2 + idxStart;
flag = flags5.substring(idxStart, 6 + idxStart); // flag = flags5.substring(idxStart, 6 + idxStart);
String reserved5 = flag;//BMS 其他 // String reserved5 = flag;//BMS 其他
idxStart = 0;//6 // idxStart = 0;//6
flag = flags6.substring(idxStart, 2 + idxStart); // flag = flags6.substring(idxStart, 2 + idxStart);
String recbatarg = flag.equals("00") ? "正常" : (flag.equals("01") ? "超时" : "不可信状态");//接收电池充电参数报文超时 // String recbatarg = flag.equals("00") ? "正常" : (flag.equals("01") ? "超时" : "不可信状态");//接收电池充电参数报文超时
idxStart = 2 + idxStart; // idxStart = 2 + idxStart;
flag = flags6.substring(idxStart, 2 + idxStart); // flag = flags6.substring(idxStart, 2 + idxStart);
String recbmsprecompl = flag.equals("00") ? "正常" : (flag.equals("01") ? "超时" : "不可信状态");//接收 BMS 完成充电准备报文超时 // String recbmsprecompl = flag.equals("00") ? "正常" : (flag.equals("01") ? "超时" : "不可信状态");//接收 BMS 完成充电准备报文超时
idxStart = 2 + idxStart; // idxStart = 2 + idxStart;
flag = flags3.substring(idxStart, 4 + idxStart); // flag = flags3.substring(idxStart, 4 + idxStart);
String reserved6 = flag;//预留位 // String reserved6 = flag;//预留位
idxStart = 0;//7 // idxStart = 0;//7
flag = flags7.substring(idxStart, 2 + idxStart); // flag = flags7.substring(idxStart, 2 + idxStart);
String recbatsumsts = flag.equals("00") ? "正常" : (flag.equals("01") ? "超时" : "不可信状态");//接收电池充电总状态报文超时 // String recbatsumsts = flag.equals("00") ? "正常" : (flag.equals("01") ? "超时" : "不可信状态");//接收电池充电总状态报文超时
idxStart = 2 + idxStart; // idxStart = 2 + idxStart;
flag = flags7.substring(idxStart, 2 + idxStart); // flag = flags7.substring(idxStart, 2 + idxStart);
String recbmschgreq = flag.equals("00") ? "正常" : (flag.equals("01") ? "超时" : "不可信状态");//接收电池充电要求报文超时 // String recbmschgreq = flag.equals("00") ? "正常" : (flag.equals("01") ? "超时" : "不可信状态");//接收电池充电要求报文超时
idxStart = 2 + idxStart; // idxStart = 2 + idxStart;
flag = flags7.substring(idxStart, 2 + idxStart); // flag = flags7.substring(idxStart, 2 + idxStart);
String recbmsstopchg = flag.equals("00") ? "正常" : (flag.equals("01") ? "超时" : "不可信状态");//接收 BMS 中止充电报文超时 // String recbmsstopchg = flag.equals("00") ? "正常" : (flag.equals("01") ? "超时" : "不可信状态");//接收 BMS 中止充电报文超时
idxStart = 2 + idxStart; // idxStart = 2 + idxStart;
flag = flags3.substring(idxStart, 2 + idxStart); // flag = flags3.substring(idxStart, 2 + idxStart);
String reserved7 = flag;//预留位 // String reserved7 = flag;//预留位
idxStart = 0;//8 // idxStart = 0;//8
flag = flags8.substring(idxStart, 2 + idxStart); // flag = flags8.substring(idxStart, 2 + idxStart);
String recbumssum = flag.equals("00") ? "正常" : (flag.equals("01") ? "超时" : "不可信状态");//接收 BMS 充电统计报文超时 // String recbumssum = flag.equals("00") ? "正常" : (flag.equals("01") ? "超时" : "不可信状态");//接收 BMS 充电统计报文超时
idxStart = 2 + idxStart; // idxStart = 2 + idxStart;
flag = flags3.substring(idxStart, 6 + idxStart); // flag = flags3.substring(idxStart, 6 + idxStart);
String reserved8 = flag;//预留位 // String reserved8 = flag;//预留位
XhpcDeviceMessage deviceMessage = new XhpcDeviceMessage(); XhpcDeviceMessage deviceMessage = new XhpcDeviceMessage();
deviceMessage.setType(StationDeviceEnum.PILE.getCode()); deviceMessage.setType(StationDeviceEnum.PILE.getCode());

View File

@ -106,6 +106,7 @@ public class OrderDataLogic implements ServiceLogic {
if (sr == null) { if (sr == null) {
final Integer stopReasonInt = Integer.valueOf(stopReason, 16); final Integer stopReasonInt = Integer.valueOf(stopReason, 16);
if (stopReasonInt <= 0x49) { if (stopReasonInt <= 0x49) {
// if (stopReasonInt >= 0x40 && stopReasonInt <= 0x49) { // todo wi lh 0x40?
sr = "充电完成(0X".concat(stopReason).concat(")"); sr = "充电完成(0X".concat(stopReason).concat(")");
} else if (stopReasonInt <= 0x69) { } else if (stopReasonInt <= 0x69) {
sr = "充电启动失败(0X".concat(stopReason).concat(")"); sr = "充电启动失败(0X".concat(stopReason).concat(")");