This commit is contained in:
Lemon
2023-09-15 15:40:38 +08:00
parent bed6b82c6e
commit 3aa4481484

View File

@@ -30,7 +30,7 @@ import java.util.concurrent.CompletableFuture;
@Slf4j @Slf4j
@Component @Component
public class LoginRequestHandler extends AbstractHandler{ public class LoginRequestHandler extends AbstractHandler {
@Autowired @Autowired
private IPileBasicInfoService pileBasicInfoService; private IPileBasicInfoService pileBasicInfoService;
@@ -199,15 +199,6 @@ public class LoginRequestHandler extends AbstractHandler{
PileChannelEntity.put(pileSn, channel); PileChannelEntity.put(pileSn, channel);
// 更改桩和该桩下的枪口状态分别为 在线、空闲 公共方法修改状态 // 更改桩和该桩下的枪口状态分别为 在线、空闲 公共方法修改状态
pileBasicInfoService.updateStatus(BytesUtil.bcd2Str(ykcDataProtocol.getFrameType()), pileSn, null, null, null); pileBasicInfoService.updateStatus(BytesUtil.bcd2Str(ykcDataProtocol.getFrameType()), pileSn, null, null, null);
// 充电桩使用的sim卡把信息存库
if (StringUtils.equals("00", internetConnection)) {
try {
pileBasicInfoService.updatePileSimInfo(pileSn, iccid);
// pileBasicInfoService.updatePileSimInfoV2(pileSn, iccid);
} catch (Exception e) {
log.error("更新充电桩sim卡信息失败", e);
}
}
CompletableFuture.runAsync(() -> { CompletableFuture.runAsync(() -> {
try { try {
@@ -231,6 +222,19 @@ public class LoginRequestHandler extends AbstractHandler{
IssueQRCodeCommand issueQRCodeCommand = IssueQRCodeCommand.builder().pileSn(pileSn).build(); IssueQRCodeCommand issueQRCodeCommand = IssueQRCodeCommand.builder().pileSn(pileSn).build();
ykcPushCommandService.pushIssueQRCodeCommand(issueQRCodeCommand); ykcPushCommandService.pushIssueQRCodeCommand(issueQRCodeCommand);
}); });
if (StringUtils.equals("00", internetConnection)) {
CompletableFuture.runAsync(() -> {
// 充电桩使用的sim卡把信息存库
try {
// pileBasicInfoService.updatePileSimInfo(pileSn, iccid);
pileBasicInfoService.updatePileSimInfoV2(pileSn, iccid);
} catch (Exception e) {
log.error("更新充电桩sim卡信息失败", e);
}
});
}
} }
// 保存报文 TODO 没有登录认证通过还要不要保存报文? // 保存报文 TODO 没有登录认证通过还要不要保存报文?