|
|
|
@ -21,6 +21,7 @@ import com.palnet.biz.api.bas.flight.model.BasFlightPlanAreaModel;
|
|
|
|
|
import com.palnet.biz.api.bas.flight.model.BasFlightPlanListRq; |
|
|
|
|
import com.palnet.biz.api.bas.flight.model.BasFlightPlanModel; |
|
|
|
|
import com.palnet.biz.api.bas.flight.model.BasFlightPlanPilotModel; |
|
|
|
|
import com.palnet.biz.api.bas.flight.model.BasFlightPlanResultMessageRq; |
|
|
|
|
import com.palnet.biz.jpa.entity.FltPlanArcrft; |
|
|
|
|
import com.palnet.biz.jpa.entity.FltPlanArea; |
|
|
|
|
import com.palnet.biz.jpa.entity.FltPlanAreaCoord; |
|
|
|
@ -66,11 +67,11 @@ public class BasFlightService {
|
|
|
|
|
|
|
|
|
|
// 비행계획서 상세 조회
|
|
|
|
|
public BasFlightPlanModel detailPlan(Integer planSno) { |
|
|
|
|
BasFlightPlanModel rs = new BasFlightPlanModel(); |
|
|
|
|
BasFlightPlanModel rs = new BasFlightPlanModel(); |
|
|
|
|
// 비행계획서
|
|
|
|
|
FltPlanBas planEntity = fltPlanBasRepository.findByPlanSnoAndDelYnNot(planSno, "Y").orElse(null); |
|
|
|
|
if(planEntity != null){ |
|
|
|
|
rs = BasFlightMapper.mapper.entityToModel(planEntity); |
|
|
|
|
rs = BasFlightMapper.mapper.entityToModel(planEntity); |
|
|
|
|
// 버퍼영역
|
|
|
|
|
List<FltPlanArea> areaEntityList = fltPlanAreaRepository.findByPlanSnoOrderByPlanAreaSnoAsc(planSno); |
|
|
|
|
if (areaEntityList != null && !areaEntityList.isEmpty()) { |
|
|
|
@ -115,18 +116,18 @@ public class BasFlightService {
|
|
|
|
|
List<BasFlightPlanArcrftModel> arcrftModelList = rq.getArcrftList(); |
|
|
|
|
List<BasFlightPlanAreaModel> areaModelList = rq.getAreaList(); |
|
|
|
|
for(int i = 0; i < arcrftModelList.size(); i++) { |
|
|
|
|
String idntfNum = arcrftModelList.get(i).getIdntfNum(); |
|
|
|
|
int size = fltPlanQueryRepository.arcrftCheck(rq, idntfNum).size(); |
|
|
|
|
if( size != 0) { |
|
|
|
|
BasFlightPlanResultMessageRq dateCheck = new BasFlightPlanResultMessageRq(); |
|
|
|
|
dateCheck.setDateCheck(false); |
|
|
|
|
String idntfNum = arcrftModelList.get(i).getIdntfNum(); |
|
|
|
|
int size = fltPlanQueryRepository.arcrftCheck(rq, idntfNum).size(); |
|
|
|
|
if( size != 0) { |
|
|
|
|
BasFlightPlanResultMessageRq dateCheck = new BasFlightPlanResultMessageRq(); |
|
|
|
|
dateCheck.setDateCheck(false); |
|
|
|
|
// return false;
|
|
|
|
|
// boolean dCheck = false;
|
|
|
|
|
// BasFlightPlanResultMessageRq dateCheck = dCheck;
|
|
|
|
|
// return dheck;
|
|
|
|
|
}else { |
|
|
|
|
}else { |
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
List<Coordinate> coordList = new ArrayList<>(); |
|
|
|
|
List<Coordinate> bufferCoord = new ArrayList<>(); |
|
|
|
@ -139,39 +140,39 @@ public class BasFlightService {
|
|
|
|
|
Coordinate queryCoord = null; |
|
|
|
|
Coordinate coord = null; |
|
|
|
|
for(int i = 0; i<arcrftModelList.size(); i++) { |
|
|
|
|
List<BasFlightPlanAreaCoordModel> coordModelList = areaModelList.get(i).getCoordList(); |
|
|
|
|
type = rq.getAreaList().get(i).getAreaType(); |
|
|
|
|
bufferZone = rq.getAreaList().get(i).getBufferZone(); |
|
|
|
|
Double lat; |
|
|
|
|
Double lon; |
|
|
|
|
List<BasFlightPlanAreaCoordModel> coordModelList = areaModelList.get(i).getCoordList(); |
|
|
|
|
type = rq.getAreaList().get(i).getAreaType(); |
|
|
|
|
bufferZone = rq.getAreaList().get(i).getBufferZone(); |
|
|
|
|
Double lat; |
|
|
|
|
Double lon; |
|
|
|
|
|
|
|
|
|
for(int j = 0; j<coordModelList.size(); j++) { |
|
|
|
|
lat = rq.getAreaList().get(i).getCoordList().get(j).getLat(); |
|
|
|
|
lon = rq.getAreaList().get(i).getCoordList().get(j).getLon(); |
|
|
|
|
coord = new Coordinate(lon , lat); |
|
|
|
|
coordList.add(coord); |
|
|
|
|
} |
|
|
|
|
if("POLYGON".equals(type)) { |
|
|
|
|
coord = new Coordinate(rq.getAreaList().get(i).getCoordList().get(0).getLon(),rq.getAreaList().get(i).getCoordList().get(0).getLat()); |
|
|
|
|
coordList.add(coord); |
|
|
|
|
} |
|
|
|
|
for(int j = 0; j<coordModelList.size(); j++) { |
|
|
|
|
lat = rq.getAreaList().get(i).getCoordList().get(j).getLat(); |
|
|
|
|
lon = rq.getAreaList().get(i).getCoordList().get(j).getLon(); |
|
|
|
|
coord = new Coordinate(lon , lat); |
|
|
|
|
coordList.add(coord); |
|
|
|
|
} |
|
|
|
|
if("POLYGON".equals(type)) { |
|
|
|
|
coord = new Coordinate(rq.getAreaList().get(i).getCoordList().get(0).getLon(),rq.getAreaList().get(i).getCoordList().get(0).getLat()); |
|
|
|
|
coordList.add(coord); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
List<Coordinate> transCoordList = areaUtils.transform(coordList, "EPSG:4326", "EPSG:5181"); |
|
|
|
|
if("LINE".equals(type)){ |
|
|
|
|
bufferCoord = areaUtils.buffer(transCoordList, bufferZone); |
|
|
|
|
} |
|
|
|
|
if("CIRCLE".equals(type)) { |
|
|
|
|
bufferCoord = areaUtils.createCircle(coord, bufferZone); |
|
|
|
|
} |
|
|
|
|
if("POLYGON".equals(type)) { |
|
|
|
|
Polygon polygon = geometryFactory.createPolygon(coordList.toArray(new Coordinate[] {})); |
|
|
|
|
Coordinate[] coords = polygon.getCoordinates(); |
|
|
|
|
bufferCoord.addAll(Arrays.asList(coords)); |
|
|
|
|
List<Coordinate> transCoordList = areaUtils.transform(coordList, "EPSG:4326", "EPSG:5181"); |
|
|
|
|
if("LINE".equals(type)){ |
|
|
|
|
bufferCoord = areaUtils.buffer(transCoordList, bufferZone); |
|
|
|
|
} |
|
|
|
|
if("CIRCLE".equals(type)) { |
|
|
|
|
bufferCoord = areaUtils.createCircle(coord, bufferZone); |
|
|
|
|
} |
|
|
|
|
if("POLYGON".equals(type)) { |
|
|
|
|
Polygon polygon = geometryFactory.createPolygon(coordList.toArray(new Coordinate[] {})); |
|
|
|
|
Coordinate[] coords = polygon.getCoordinates(); |
|
|
|
|
bufferCoord.addAll(Arrays.asList(coords)); |
|
|
|
|
} |
|
|
|
|
List<Coordinate> reverseBufferList = areaUtils.transform(bufferCoord, "EPSG:5181","EPSG:4326"); |
|
|
|
|
int k=0; |
|
|
|
|
for(int i = 0; i<queryCount.size(); i++) { |
|
|
|
|
List<Coordinate> queryBufferCoord = new ArrayList<>(); |
|
|
|
|
List<Coordinate> queryBufferCoord = new ArrayList<>(); |
|
|
|
|
List<Coordinate> queryCoordList = new ArrayList<>(); |
|
|
|
|
queryType = queryCount.get(i).getAreaType(); |
|
|
|
|
queryBufferZone = queryCount.get(i).getBufferZone(); |
|
|
|
|