This commit is contained in:
tiger_zhou 2023-05-30 16:39:06 +08:00
parent 33dbc54fd9
commit 25fbd9a715
1 changed files with 14 additions and 13 deletions

View File

@ -17,24 +17,25 @@ import javax.annotation.Resource;
public class TrainPositionService {
@Resource
TrainPositionTimeOverService timeOverService;
@Resource
TrainPositionTimeOverService timeOverService;
/**
* 初始化或更新列车的位置
* @param mapName
* @param json
*/
/**
* 初始化或更新列车的位置
*
* @param mapName
* @param json
*/
public void initTrainOrUpdate(String mapName,String json){
TrainPosition tp = JsonUtils.read(json, TrainPosition.class);
tp.setReceiveTime(System.currentTimeMillis());
log.debug(json);
public void initTrainOrUpdate(String mapName, String json) {
TrainPosition tp = JsonUtils.read(json, TrainPosition.class);
tp.setReceiveTime(System.currentTimeMillis());
log.info(json);
// SocketMessageVO<TrainPosition> vo = SocketMessageFactory.buildBasic(WebSocketMessageType.YJDDZH_TRAIN_POSITION,tp);
// this.messageService.send(vo);
this.timeOverService.addTrainAccept(mapName,tp);
this.timeOverService.addTrainAccept(mapName, tp);
}
}
}