更新远程更新桩程序

This commit is contained in:
panshuling321 2022-08-01 17:39:13 +08:00
parent a11070cd04
commit bfce06b561
2 changed files with 4 additions and 4 deletions

View File

@ -305,7 +305,7 @@ public class PileController {
} }
int runFlag = charging ? 2: 1; int runFlag = charging ? 2: 1;
try { try {
String rsmsg = RemoteUpgradeDataLogic.translate(pileNo, "0094", String rsmsg = RemoteUpgradeDataLogic.translate(pileNo,
"0", 0L, "0", 0L,
"0", "0", "0", "0", "0", "0",
runFlag); runFlag);

View File

@ -44,7 +44,7 @@ public class RemoteUpgradeDataLogic implements ServiceLogic {
return new ServiceResult(null, ServiceResult.FAIL, json); return new ServiceResult(null, ServiceResult.FAIL, json);
} }
String resultStr = translate(pileNo, "0094", "0", 0L, "0", "0", "0", 2); String resultStr = translate(pileNo, "0", 0L, "0", "0", "0", 2);
String remark = "充电桩主动下发远程更新"; String remark = "充电桩主动下发远程更新";
XhpcDeviceMessage deviceMessage = new XhpcDeviceMessage(); XhpcDeviceMessage deviceMessage = new XhpcDeviceMessage();
@ -57,14 +57,14 @@ public class RemoteUpgradeDataLogic implements ServiceLogic {
return new ServiceResult(HexUtils.toBytes(resultStr), ServiceResult.OK); return new ServiceResult(HexUtils.toBytes(resultStr), ServiceResult.OK);
} }
public static String translate(String pileNo, String svc, String remoteHost, Long port, String ftpUserName, String ftpPassword, String upgradeUrl, int runFlag) { public static String translate(String pileNo, String remoteHost, Long port, String ftpUserName, String ftpPassword, String upgradeUrl, int runFlag) {
String skey = "pile:".concat(pileNo).concat(".seqhex"); String skey = "pile:".concat(pileNo).concat(".seqhex");
Map<String, Object> cachePile = REDIS.getCacheMap("pile:".concat(pileNo)); Map<String, Object> cachePile = REDIS.getCacheMap("pile:".concat(pileNo));
Long pileType = Long.parseLong(cachePile.get("equipmentType") + ""); // 桩型号01-直流, 02-交流 Long pileType = Long.parseLong(cachePile.get("equipmentType") + ""); // 桩型号01-直流, 02-交流
Long pilePower = new Double((double)cachePile.get("power")).longValue(); // 桩功率 Long pilePower = new Double((double)cachePile.get("power")).longValue(); // 桩功率
String resultStr = "6862".concat(seqHex(skey)).concat(svc) String resultStr = "6862".concat(seqHex(skey)).concat("0094")
.concat(pileNo).concat(String.format("%02X", pileType)).concat(String.format("%04X", pilePower)) .concat(pileNo).concat(String.format("%02X", pileType)).concat(String.format("%04X", pilePower))
.concat(stringToAscii(remoteHost, 16)).concat(String.format("%02X", port)) .concat(stringToAscii(remoteHost, 16)).concat(String.format("%02X", port))
.concat(stringToAscii(ftpUserName, 16)).concat(stringToAscii(ftpPassword, 16)) .concat(stringToAscii(ftpUserName, 16)).concat(stringToAscii(ftpPassword, 16))