|
|
@ -6,7 +6,11 @@ import com.itextpdf.io.font.PdfEncodings; |
|
|
|
import com.itextpdf.kernel.pdf.PdfDocument; |
|
|
|
import com.itextpdf.kernel.pdf.PdfDocument; |
|
|
|
import com.itextpdf.kernel.pdf.PdfWriter; |
|
|
|
import com.itextpdf.kernel.pdf.PdfWriter; |
|
|
|
import com.itextpdf.layout.font.FontProvider; |
|
|
|
import com.itextpdf.layout.font.FontProvider; |
|
|
|
|
|
|
|
import com.palnet.biz.api.acnt.jwt.utils.JwtTokenUtil; |
|
|
|
import com.palnet.biz.api.bas.dos.model.*; |
|
|
|
import com.palnet.biz.api.bas.dos.model.*; |
|
|
|
|
|
|
|
import com.palnet.biz.api.comn.coordinate.model.BoundaryModel; |
|
|
|
|
|
|
|
import com.palnet.biz.api.comn.coordinate.model.SearchDepartmentBoundaryRS; |
|
|
|
|
|
|
|
import com.palnet.biz.api.comn.coordinate.service.ComnCoordinateService; |
|
|
|
import com.palnet.biz.api.comn.file.model.ValidPdfModel; |
|
|
|
import com.palnet.biz.api.comn.file.model.ValidPdfModel; |
|
|
|
import com.palnet.biz.api.external.model.ApprovalCd; |
|
|
|
import com.palnet.biz.api.external.model.ApprovalCd; |
|
|
|
import com.palnet.biz.api.external.model.DosApprovalResult; |
|
|
|
import com.palnet.biz.api.external.model.DosApprovalResult; |
|
|
@ -18,10 +22,7 @@ import com.palnet.biz.jpa.entity.type.ReviewedType; |
|
|
|
import com.palnet.biz.jpa.repository.dos.*; |
|
|
|
import com.palnet.biz.jpa.repository.dos.*; |
|
|
|
import com.palnet.comn.code.ErrorCode; |
|
|
|
import com.palnet.comn.code.ErrorCode; |
|
|
|
import com.palnet.comn.exception.CustomException; |
|
|
|
import com.palnet.comn.exception.CustomException; |
|
|
|
import com.palnet.comn.utils.AirspaceUtils; |
|
|
|
import com.palnet.comn.utils.*; |
|
|
|
import com.palnet.comn.utils.AreaUtils; |
|
|
|
|
|
|
|
import com.palnet.comn.utils.HttpUtils; |
|
|
|
|
|
|
|
import com.palnet.comn.utils.PdfUtils; |
|
|
|
|
|
|
|
import kr.dogfoot.hwpxlib.object.HWPXFile; |
|
|
|
import kr.dogfoot.hwpxlib.object.HWPXFile; |
|
|
|
import kr.dogfoot.hwpxlib.object.content.section_xml.SectionXMLFile; |
|
|
|
import kr.dogfoot.hwpxlib.object.content.section_xml.SectionXMLFile; |
|
|
|
import kr.dogfoot.hwpxlib.object.content.section_xml.paragraph.Run; |
|
|
|
import kr.dogfoot.hwpxlib.object.content.section_xml.paragraph.Run; |
|
|
@ -40,6 +41,9 @@ import org.apache.poi.xssf.usermodel.XSSFFont; |
|
|
|
import org.apache.poi.xssf.usermodel.XSSFWorkbook; |
|
|
|
import org.apache.poi.xssf.usermodel.XSSFWorkbook; |
|
|
|
import org.locationtech.jts.geom.Coordinate; |
|
|
|
import org.locationtech.jts.geom.Coordinate; |
|
|
|
import org.locationtech.jts.geom.Geometry; |
|
|
|
import org.locationtech.jts.geom.Geometry; |
|
|
|
|
|
|
|
import org.locationtech.jts.geom.GeometryFactory; |
|
|
|
|
|
|
|
import org.locationtech.jts.geom.Point; |
|
|
|
|
|
|
|
import org.springframework.cache.annotation.Cacheable; |
|
|
|
import org.springframework.core.io.ClassPathResource; |
|
|
|
import org.springframework.core.io.ClassPathResource; |
|
|
|
import org.springframework.http.MediaType; |
|
|
|
import org.springframework.http.MediaType; |
|
|
|
import org.springframework.stereotype.Service; |
|
|
|
import org.springframework.stereotype.Service; |
|
|
@ -69,8 +73,10 @@ public class BasDosService { |
|
|
|
private final DosFltPlanDroneRepository dosFltPlanDroneRepository; |
|
|
|
private final DosFltPlanDroneRepository dosFltPlanDroneRepository; |
|
|
|
private final DosFltPlanPilotRepository dosFltPlanPilotRepository; |
|
|
|
private final DosFltPlanPilotRepository dosFltPlanPilotRepository; |
|
|
|
private final DronOneStopService dronOneStopService; |
|
|
|
private final DronOneStopService dronOneStopService; |
|
|
|
|
|
|
|
private final ComnCoordinateService comnCoordinateService; |
|
|
|
private final AreaUtils areaUtils; |
|
|
|
private final AreaUtils areaUtils; |
|
|
|
private final PdfUtils pdfUtils; |
|
|
|
private final PdfUtils pdfUtils; |
|
|
|
|
|
|
|
private final JwtTokenUtil jwtTokenUtil; |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
/** |
|
|
|
* 드론원스톱 비행계획 조회 |
|
|
|
* 드론원스톱 비행계획 조회 |
|
|
@ -94,6 +100,7 @@ public class BasDosService { |
|
|
|
List<DosFltPlanResult> resultList = dosFltPlanResultRepository.findByPlanSnoIn(planSnoList); |
|
|
|
List<DosFltPlanResult> resultList = dosFltPlanResultRepository.findByPlanSnoIn(planSnoList); |
|
|
|
|
|
|
|
|
|
|
|
List<BasDosPlanRs> rs = new ArrayList<>(); |
|
|
|
List<BasDosPlanRs> rs = new ArrayList<>(); |
|
|
|
|
|
|
|
List<Geometry> boundary = null; |
|
|
|
|
|
|
|
|
|
|
|
for (DosFltPlanBas bas : planBasList) { |
|
|
|
for (DosFltPlanBas bas : planBasList) { |
|
|
|
Long planSno = bas.getPlanSno(); |
|
|
|
Long planSno = bas.getPlanSno(); |
|
|
@ -139,6 +146,34 @@ public class BasDosService { |
|
|
|
continue; |
|
|
|
continue; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// 사용자 부서에 따른 필터 관제과(DF0002), 운항과(DF0002-1)
|
|
|
|
|
|
|
|
String cptAuthCode = jwtTokenUtil.getCptAuthCodeByToken(); |
|
|
|
|
|
|
|
if (cptAuthCode != null) { |
|
|
|
|
|
|
|
Coordinate centerPoint = new Coordinate(area.getLon(), area.getLat()); |
|
|
|
|
|
|
|
if("DF0002".equals(cptAuthCode)) { |
|
|
|
|
|
|
|
// 관제과(9.3km)
|
|
|
|
|
|
|
|
AirspaceUtils airspaceUtils = AirspaceUtils.getInstance(); |
|
|
|
|
|
|
|
List<AirspaceUtils.FeatureInfo> airspaces = airspaceUtils.getAirspaces(AirspaceUtils.AirspaceType.GIMPO); |
|
|
|
|
|
|
|
GeometryFactory geometryFactory = new GeometryFactory(); |
|
|
|
|
|
|
|
Point point = geometryFactory.createPoint(centerPoint); |
|
|
|
|
|
|
|
boolean isContain = airspaces.stream().anyMatch(airspace -> { |
|
|
|
|
|
|
|
Geometry airspaceGeometry = airspace.getGeometry(); |
|
|
|
|
|
|
|
return airspaceGeometry.contains(point); |
|
|
|
|
|
|
|
}); |
|
|
|
|
|
|
|
if(!isContain) continue; |
|
|
|
|
|
|
|
}else if("DF0002-1".equals(cptAuthCode)) { |
|
|
|
|
|
|
|
// TODO 운항과(김항소 관리 전역)
|
|
|
|
|
|
|
|
// if(boundary == null) {
|
|
|
|
|
|
|
|
// boundary = comnCoordinateService.getDeptGeometry("F0002");
|
|
|
|
|
|
|
|
// }
|
|
|
|
|
|
|
|
//// log.info("boundary : {}", boundary);
|
|
|
|
|
|
|
|
// GeometryFactory geometryFactory = new GeometryFactory();
|
|
|
|
|
|
|
|
// Point point = geometryFactory.createPoint(centerPoint);
|
|
|
|
|
|
|
|
// boolean isContain = boundary.stream().anyMatch(geometry -> geometry.contains(point));
|
|
|
|
|
|
|
|
// if(!isContain) continue;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
List<Map<String, Double>> bufferCoordList = null; |
|
|
|
List<Map<String, Double>> bufferCoordList = null; |
|
|
|
if (type == PlanSelectType.LIST) { |
|
|
|
if (type == PlanSelectType.LIST) { |
|
|
@ -839,4 +874,5 @@ public class BasDosService { |
|
|
|
return null; |
|
|
|
return null; |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|