opt:1.站点名称排序。2.添加外部API查询站点接口。
This commit is contained in:
16
nl-business-api/src/main/java/org/nl/api/map/api/MapAPI.java
Normal file
16
nl-business-api/src/main/java/org/nl/api/map/api/MapAPI.java
Normal file
@@ -0,0 +1,16 @@
|
|||||||
|
package org.nl.api.map.api;
|
||||||
|
|
||||||
|
import org.nl.response.WebResponse;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author dsh
|
||||||
|
* 2026/3/9
|
||||||
|
*/
|
||||||
|
public interface MapAPI {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取所有站点
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
WebResponse getAllStations();
|
||||||
|
}
|
||||||
@@ -46,4 +46,10 @@ public class ExternalTaskController {
|
|||||||
public ResponseEntity<Object> getTaskInfosById(@PathVariable String id){
|
public ResponseEntity<Object> getTaskInfosById(@PathVariable String id){
|
||||||
return new ResponseEntity<>(externalTaskService.getTaskInfosByTaskCode(id), HttpStatus.OK);
|
return new ResponseEntity<>(externalTaskService.getTaskInfosByTaskCode(id), HttpStatus.OK);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@GetMapping("/getAllStations")
|
||||||
|
@Log("外部API:查询全部站点")
|
||||||
|
public ResponseEntity<Object> getAllStations(){
|
||||||
|
return new ResponseEntity<>(externalTaskService.getAllStations(), HttpStatus.OK);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -35,4 +35,10 @@ public interface ExternalTaskService {
|
|||||||
* @return WebResponse
|
* @return WebResponse
|
||||||
*/
|
*/
|
||||||
WebResponse getTaskInfosByTaskCode(String task_code);
|
WebResponse getTaskInfosByTaskCode(String task_code);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 外部API 查询所有站点
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
WebResponse getAllStations();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -2,6 +2,7 @@ package org.nl.externalApi.task.service.impl;
|
|||||||
|
|
||||||
import cn.hutool.core.bean.BeanUtil;
|
import cn.hutool.core.bean.BeanUtil;
|
||||||
import jakarta.annotation.Resource;
|
import jakarta.annotation.Resource;
|
||||||
|
import org.nl.api.map.api.MapAPI;
|
||||||
import org.nl.api.task.api.TaskAPI;
|
import org.nl.api.task.api.TaskAPI;
|
||||||
import org.nl.api.task.core.TaskRequestParam;
|
import org.nl.api.task.core.TaskRequestParam;
|
||||||
import org.nl.enums.TaskSourceEnum;
|
import org.nl.enums.TaskSourceEnum;
|
||||||
@@ -20,6 +21,9 @@ public class ExternalTaskServiceImpl implements ExternalTaskService {
|
|||||||
@Resource
|
@Resource
|
||||||
private TaskAPI taskAPI;
|
private TaskAPI taskAPI;
|
||||||
|
|
||||||
|
@Resource
|
||||||
|
private MapAPI mapAPI;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public WebResponse createTask(CreateTaskParam createTaskParam) {
|
public WebResponse createTask(CreateTaskParam createTaskParam) {
|
||||||
TaskRequestParam taskRequestParam = BeanUtil.toBean(createTaskParam, TaskRequestParam.class);
|
TaskRequestParam taskRequestParam = BeanUtil.toBean(createTaskParam, TaskRequestParam.class);
|
||||||
@@ -40,4 +44,9 @@ public class ExternalTaskServiceImpl implements ExternalTaskService {
|
|||||||
public WebResponse getTaskInfosByTaskCode(String task_code) {
|
public WebResponse getTaskInfosByTaskCode(String task_code) {
|
||||||
return taskAPI.queryTaskInfoByTaskCode(task_code);
|
return taskAPI.queryTaskInfoByTaskCode(task_code);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public WebResponse getAllStations() {
|
||||||
|
return mapAPI.getAllStations();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -0,0 +1,25 @@
|
|||||||
|
package org.nl.map.provider;
|
||||||
|
|
||||||
|
import jakarta.annotation.Resource;
|
||||||
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
import org.nl.api.map.api.MapAPI;
|
||||||
|
import org.nl.map.station.service.MapStationService;
|
||||||
|
import org.nl.response.WebResponse;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author dsh
|
||||||
|
* 2026/3/9
|
||||||
|
*/
|
||||||
|
@Slf4j
|
||||||
|
@Service
|
||||||
|
public class MapAPIProvider implements MapAPI {
|
||||||
|
|
||||||
|
@Resource
|
||||||
|
private MapStationService mapStationService;
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public WebResponse getAllStations() {
|
||||||
|
return mapStationService.queryAllStation();
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -1,5 +1,6 @@
|
|||||||
package org.nl.map.station.service.impl;
|
package org.nl.map.station.service.impl;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||||
import jakarta.annotation.Resource;
|
import jakarta.annotation.Resource;
|
||||||
@@ -23,6 +24,6 @@ public class MapStationServiceImpl extends ServiceImpl<StationMapper, Station> i
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public WebResponse queryAllStation() {
|
public WebResponse queryAllStation() {
|
||||||
return WebResponse.requestParamOk(stationMapper.selectList(new QueryWrapper<>()));
|
return WebResponse.requestParamOk(stationMapper.selectList(new LambdaQueryWrapper<>(Station.class).orderByAsc(Station::getStation_name)));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user