Merge remote-tracking branch 'origin/main'

This commit is contained in:
jkcdev 2025-05-23 12:11:38 +08:00
commit fbc64c5e37

View File

@ -62,7 +62,7 @@ public class EbikeCoreHandler {
ReqEbikeBikeComDto reqEbikeBikeComDto = new ReqEbikeBikeComDto(String.valueOf(bikeId), String.valueOf(staffId), cmdCode, "1", "1"); ReqEbikeBikeComDto reqEbikeBikeComDto = new ReqEbikeBikeComDto(String.valueOf(bikeId), String.valueOf(staffId), cmdCode, "1", "1");
commandRecords.put(tid, reqEbikeBikeComDto); commandRecords.put(tid, reqEbikeBikeComDto);
} }
String command = getCommand(cmdCode, tid); String command = getCommand(cmdCode, tid,true);
cmdMsg.setCommand(command); cmdMsg.setCommand(command);
// 注册响应监听 // 注册响应监听
pendingRequests.put(tid, future); pendingRequests.put(tid, future);
@ -109,7 +109,7 @@ public class EbikeCoreHandler {
String tid = UUID.randomUUID().toString().replace("-", ""); String tid = UUID.randomUUID().toString().replace("-", "");
String command = getCommand(cmdCode, tid); String command = getCommand(cmdCode, tid,false);
cmdMsg.setCommand(command); cmdMsg.setCommand(command);
// 注册响应监听 // 注册响应监听
pendingRequests.put(tid, future); pendingRequests.put(tid, future);
@ -163,7 +163,7 @@ public class EbikeCoreHandler {
* @param tid 任务id * @param tid 任务id
* @return 命令json字符串 * @return 命令json字符串
*/ */
String getCommand(String cmdCode, String tid) { String getCommand(String cmdCode, String tid,boolean record) {
EbikeCmdMapper cmdMapper = SpringContextHolder.getBean(EbikeCmdMapper.class); EbikeCmdMapper cmdMapper = SpringContextHolder.getBean(EbikeCmdMapper.class);
EbikeParamMapper paramMapper = SpringContextHolder.getBean(EbikeParamMapper.class); EbikeParamMapper paramMapper = SpringContextHolder.getBean(EbikeParamMapper.class);
EbikeParamValueMapper paramValueMapper = SpringContextHolder.getBean(EbikeParamValueMapper.class); EbikeParamValueMapper paramValueMapper = SpringContextHolder.getBean(EbikeParamValueMapper.class);
@ -171,7 +171,9 @@ public class EbikeCoreHandler {
.where(EBIKE_CMD.CMD_CODE.eq(cmdCode)); .where(EBIKE_CMD.CMD_CODE.eq(cmdCode));
EbikeCmd ebikeCmd = cmdMapper.selectOneByQuery(queryWrapper); EbikeCmd ebikeCmd = cmdMapper.selectOneByQuery(queryWrapper);
if (record){
commandRecords.get(tid).setCom(ebikeCmd.getCmdName()); commandRecords.get(tid).setCom(ebikeCmd.getCmdName());
}
queryWrapper.clear(); queryWrapper.clear();
queryWrapper.where(EBIKE_PARAM.CMD_ID.eq(ebikeCmd.getCmdId())) queryWrapper.where(EBIKE_PARAM.CMD_ID.eq(ebikeCmd.getCmdId()))