命令下发兼容处理
This commit is contained in:
parent
5c0dc11d5d
commit
89e38d7a38
@ -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()))
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user