mirror of
https://codeup.aliyun.com/67c68d4e484ca2f0a13ac3c1/ydc/jsowell-charger-web.git
synced 2026-04-20 11:05:18 +08:00
优化登录认证逻辑
This commit is contained in:
@@ -138,50 +138,47 @@ public class LoginRequestHandler extends AbstractHandler{
|
||||
|
||||
if (pileInfoVO != null) {
|
||||
flag = Constants.zeroByteArray;
|
||||
|
||||
// 登录成功,保存桩号和channel的关系
|
||||
PileChannelEntity.put(pileSn, channel);
|
||||
|
||||
// 更改桩和该桩下的枪口状态分别为 在线、空闲 公共方法修改状态
|
||||
pileBasicInfoService.updateStatus(BytesUtil.bcd2Str(ykcDataProtocol.getFrameType()), pileSn, null, null, null);
|
||||
}
|
||||
|
||||
// 充电桩使用的sim卡,把信息存库
|
||||
if (StringUtils.equals("00", internetConnection)) {
|
||||
try {
|
||||
pileBasicInfoService.updatePileSimInfo(pileSn, iccid);
|
||||
} catch (Exception e) {
|
||||
log.error("更新充电桩sim卡信息失败", e);
|
||||
// 充电桩使用的sim卡,把信息存库
|
||||
if (StringUtils.equals("00", internetConnection)) {
|
||||
try {
|
||||
pileBasicInfoService.updatePileSimInfo(pileSn, iccid);
|
||||
} catch (Exception e) {
|
||||
log.error("更新充电桩sim卡信息失败", e);
|
||||
}
|
||||
}
|
||||
|
||||
CompletableFuture.runAsync(() -> {
|
||||
try {
|
||||
Thread.sleep(200);
|
||||
} catch (InterruptedException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
// 对时
|
||||
ProofreadTimeCommand command = ProofreadTimeCommand.builder().pileSn(pileSn).build();
|
||||
ykcPushCommandService.pushProofreadTimeCommand(command);
|
||||
});
|
||||
|
||||
// log.info("下面进行下发二维码 pileSn:{}, thread:{}", pileSn, Thread.currentThread().getName());
|
||||
CompletableFuture.runAsync(() -> {
|
||||
try {
|
||||
Thread.sleep(600);
|
||||
} catch (InterruptedException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
// 下发二维码
|
||||
IssueQRCodeCommand issueQRCodeCommand = IssueQRCodeCommand.builder().pileSn(pileSn).build();
|
||||
ykcPushCommandService.pushIssueQRCodeCommand(issueQRCodeCommand);
|
||||
});
|
||||
}
|
||||
|
||||
// 保存报文
|
||||
// 保存报文 TODO 没有登录认证通过还要不要保存报文?
|
||||
String jsonMsg = JSONObject.toJSONString(loginRequestData);
|
||||
pileMsgRecordService.save(pileSn, pileSn, type, jsonMsg, ykcDataProtocol.getHEXString());
|
||||
|
||||
CompletableFuture.runAsync(() -> {
|
||||
try {
|
||||
Thread.sleep(200);
|
||||
} catch (InterruptedException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
// 对时
|
||||
ProofreadTimeCommand command = ProofreadTimeCommand.builder().pileSn(pileSn).build();
|
||||
ykcPushCommandService.pushProofreadTimeCommand(command);
|
||||
});
|
||||
|
||||
// log.info("下面进行下发二维码 pileSn:{}, thread:{}", pileSn, Thread.currentThread().getName());
|
||||
CompletableFuture.runAsync(() -> {
|
||||
try {
|
||||
Thread.sleep(600);
|
||||
} catch (InterruptedException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
// 下发二维码
|
||||
IssueQRCodeCommand issueQRCodeCommand = IssueQRCodeCommand.builder().pileSn(pileSn).build();
|
||||
ykcPushCommandService.pushIssueQRCodeCommand(issueQRCodeCommand);
|
||||
});
|
||||
|
||||
// 消息体
|
||||
byte[] messageBody = Bytes.concat(pileSnByte, flag);
|
||||
return getResult(ykcDataProtocol, messageBody);
|
||||
|
||||
Reference in New Issue
Block a user