|
@@ -11,7 +11,9 @@ import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.stereotype.Service;
|
|
import org.springframework.stereotype.Service;
|
|
|
import org.springframework.transaction.annotation.Transactional;
|
|
import org.springframework.transaction.annotation.Transactional;
|
|
|
|
|
|
|
|
|
|
+import java.util.ArrayList;
|
|
|
import java.util.List;
|
|
import java.util.List;
|
|
|
|
|
+import java.util.stream.Collectors;
|
|
|
|
|
|
|
|
/**
|
|
/**
|
|
|
* @author huiqing.jiang
|
|
* @author huiqing.jiang
|
|
@@ -28,7 +30,7 @@ public class WaylinePointServiceImpl implements IWaylinePointService {
|
|
|
|
|
|
|
|
|
|
|
|
|
@Override
|
|
@Override
|
|
|
- public void isnertPoint(List<WaylinePointDTO> list, String waylineId) {
|
|
|
|
|
|
|
+ public void insertPoint(List<WaylinePointDTO> list, String waylineId) {
|
|
|
for (WaylinePointDTO dto : list) {
|
|
for (WaylinePointDTO dto : list) {
|
|
|
WaylinePointEntity entity = dtoToEntity(dto);
|
|
WaylinePointEntity entity = dtoToEntity(dto);
|
|
|
entity.setWaylineId(waylineId);
|
|
entity.setWaylineId(waylineId);
|
|
@@ -43,6 +45,18 @@ public class WaylinePointServiceImpl implements IWaylinePointService {
|
|
|
mapper.delete(wrapper);
|
|
mapper.delete(wrapper);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+ @Override
|
|
|
|
|
+ public List<WaylinePointDTO> getPointByWaylineId(String waylineId) {
|
|
|
|
|
+ List<WaylinePointDTO> resultList = new ArrayList<>();
|
|
|
|
|
+ QueryWrapper<WaylinePointEntity> wrapper = new QueryWrapper<>();
|
|
|
|
|
+ wrapper.lambda().eq(WaylinePointEntity::getWaylineId ,waylineId)
|
|
|
|
|
+ .orderByAsc(WaylinePointEntity::getCreateTime);
|
|
|
|
|
+ List<WaylinePointEntity> list = mapper.selectList(wrapper);
|
|
|
|
|
+ resultList = list.stream().map(this::entityToDto)
|
|
|
|
|
+ .collect(Collectors.toList());
|
|
|
|
|
+ return resultList;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
private WaylinePointEntity dtoToEntity(WaylinePointDTO dto){
|
|
private WaylinePointEntity dtoToEntity(WaylinePointDTO dto){
|
|
|
WaylinePointEntity entity = new WaylinePointEntity();
|
|
WaylinePointEntity entity = new WaylinePointEntity();
|
|
|
entity.setPointIndex(dto.getPointIndex());
|
|
entity.setPointIndex(dto.getPointIndex());
|
|
@@ -51,4 +65,14 @@ public class WaylinePointServiceImpl implements IWaylinePointService {
|
|
|
entity.setLongitude(dto.getLongitude());
|
|
entity.setLongitude(dto.getLongitude());
|
|
|
return entity;
|
|
return entity;
|
|
|
}
|
|
}
|
|
|
|
|
+
|
|
|
|
|
+ private WaylinePointDTO entityToDto(WaylinePointEntity entity){
|
|
|
|
|
+ WaylinePointDTO dto = new WaylinePointDTO();
|
|
|
|
|
+ dto.setPointIndex(entity.getPointIndex());
|
|
|
|
|
+ dto.setLatitude(entity.getLatitude());
|
|
|
|
|
+ dto.setFolderId(entity.getFolderId());
|
|
|
|
|
+ dto.setLongitude(entity.getLongitude());
|
|
|
|
|
+ dto.setCreateTime(entity.getCreateTime());
|
|
|
|
|
+ return dto;
|
|
|
|
|
+ }
|
|
|
}
|
|
}
|