同步获取响应数据

This commit is contained in:
Guoqs
2024-08-01 15:38:33 +08:00
parent cd8ae84bdf
commit 201137bb9f
5 changed files with 16 additions and 20 deletions

View File

@@ -5,6 +5,7 @@ import com.jsowell.adapay.dto.BalancePaymentRequestDTO;
import com.jsowell.adapay.service.AdapayService;
import com.jsowell.common.annotation.Anonymous;
import com.jsowell.common.core.controller.BaseController;
import com.jsowell.common.core.domain.AjaxResult;
import com.jsowell.common.enums.ykc.ReturnCodeEnum;
import com.jsowell.common.exception.BusinessException;
import com.jsowell.common.response.RestApiResponse;
@@ -13,10 +14,7 @@ import com.jsowell.pile.domain.AdapayMemberAccount;
import com.jsowell.pile.domain.MemberPlateNumberRelation;
import com.jsowell.pile.domain.OrderBasicInfo;
import com.jsowell.pile.domain.ykcCommond.ReservationChargingCommand;
import com.jsowell.pile.dto.ApplyRefundDTO;
import com.jsowell.pile.dto.CarVinDTO;
import com.jsowell.pile.dto.QueryOrderDTO;
import com.jsowell.pile.dto.SettleOrderReportDTO;
import com.jsowell.pile.dto.*;
import com.jsowell.pile.service.*;
import com.jsowell.pile.service.programlogic.AbstractProgramLogic;
import com.jsowell.pile.service.programlogic.ProgramLogicFactory;
@@ -74,6 +72,16 @@ public class TempController extends BaseController {
@Autowired
private PileRemoteService pileRemoteService;
/**
* 对时
* http://localhost:8080/pile/remote/proofreadTimeTest
*/
@PostMapping("/proofreadTimeTest")
public AjaxResult proofreadTimeTest(@RequestBody QueryPileDTO queryPileDTO) {
pileRemoteService.proofreadTimeTest(queryPileDTO.getPileSn());
return AjaxResult.success();
}
/**
* 预约充电测试
* http://localhost:8080/temp/reservedChargingTest

View File

@@ -123,16 +123,6 @@ public class PileRemoteController extends BaseController {
return AjaxResult.success();
}
/**
* 对时
* http://localhost:8080/pile/remote/proofreadTimeTest
*/
@PostMapping("/proofreadTimeTest")
public AjaxResult proofreadTimeTest(@RequestBody QueryPileDTO queryPileDTO) {
pileRemoteService.proofreadTimeTest(queryPileDTO.getPileSn());
return AjaxResult.success();
}
/**
* 远程升级
* http://localhost:8080/pile/remote/updateFirmware

View File

@@ -9,7 +9,6 @@ import com.jsowell.common.enums.ykc.PileChannelEntity;
import com.jsowell.common.util.BytesUtil;
import com.jsowell.common.util.CRC16Util;
import com.jsowell.common.util.DateUtils;
import io.netty.channel.Channel;
import io.netty.channel.ChannelHandlerContext;
import org.springframework.beans.factory.InitializingBean;
import org.springframework.beans.factory.annotation.Autowired;
@@ -26,9 +25,9 @@ public abstract class AbstractHandler implements InitializingBean {
* 执行逻辑
* 有应答
*/
public byte[] supplyProcess(YKCDataProtocol ykcDataProtocol, Channel channel) {
throw new UnsupportedOperationException();
}
// public byte[] supplyProcess(YKCDataProtocol ykcDataProtocol, Channel channel) {
// throw new UnsupportedOperationException();
// }
public byte[] supplyProcess(YKCDataProtocol ykcDataProtocol, ChannelHandlerContext channel) {
throw new UnsupportedOperationException();

View File

@@ -7,7 +7,6 @@ import com.jsowell.common.core.domain.ykc.YKCFrameTypeCode;
import com.jsowell.common.util.BytesUtil;
import com.jsowell.common.util.YKCUtils;
import com.jsowell.netty.factory.YKCOperateFactory;
import io.netty.channel.Channel;
import io.netty.channel.ChannelHandlerContext;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Component;

View File

@@ -13,7 +13,7 @@ public class RpcResponseHandler extends SimpleChannelInboundHandler<RpcResponse>
if(syncPromise != null) {
// 设置响应结果
syncPromise.setRpcResponse(msg);
// syncPromise.setRpcResponse(msg);
// 唤醒外部线程
syncPromise.wake();