登陆成功后异步发送0x58下发计费模板

This commit is contained in:
Lemon
2024-10-14 14:48:03 +08:00
parent 5da00e52b0
commit 1acb03f56e

View File

@@ -15,9 +15,12 @@ import com.jsowell.netty.factory.YKCOperateFactory;
import com.jsowell.pile.domain.PileBasicInfo;
import com.jsowell.pile.domain.ykcCommond.IssueQRCodeCommand;
import com.jsowell.pile.domain.ykcCommond.ProofreadTimeCommand;
import com.jsowell.pile.domain.ykcCommond.PublishPileBillingTemplateCommand;
import com.jsowell.pile.service.PileBasicInfoService;
import com.jsowell.pile.service.PileBillingTemplateService;
import com.jsowell.pile.service.PileMsgRecordService;
import com.jsowell.pile.service.YKCPushCommandService;
import com.jsowell.pile.vo.web.BillingTemplateVO;
import io.netty.channel.ChannelHandlerContext;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
@@ -42,6 +45,9 @@ public class LoginRequestHandler extends AbstractYkcHandler {
@Autowired
private PileMsgRecordService pileMsgRecordService;
@Autowired
private PileBillingTemplateService pileBillingTemplateService;
private List<String> newProgramVersionList = Lists.newArrayList("c6-30");
// 引入线程池
@@ -232,6 +238,18 @@ public class LoginRequestHandler extends AbstractYkcHandler {
ykcPushCommandService.pushIssueQRCodeCommand(issueQRCodeCommand);
}, executor);
// 异步发送0x58
CompletableFuture.runAsync(() -> {
// 查询计费模板
BillingTemplateVO billingTemplateVO = pileBillingTemplateService.selectBillingTemplateDetailByPileSn(pileSn);
PublishPileBillingTemplateCommand command = PublishPileBillingTemplateCommand.builder()
.pileSn(pileSn)
.billingTemplateVO(billingTemplateVO)
.build();
// 发送请求
ykcPushCommandService.pushPublishPileBillingTemplate(command);
}, executor);
if (StringUtils.equals("00", internetConnection)) {
CompletableFuture.runAsync(() -> {
// 充电桩使用的sim卡把信息存库