|
|
@ -8,7 +8,6 @@ import java.net.HttpURLConnection; |
|
|
|
import java.net.MalformedURLException; |
|
|
|
import java.net.MalformedURLException; |
|
|
|
import java.net.URL; |
|
|
|
import java.net.URL; |
|
|
|
import java.util.ArrayList; |
|
|
|
import java.util.ArrayList; |
|
|
|
import java.util.Arrays; |
|
|
|
|
|
|
|
import java.util.List; |
|
|
|
import java.util.List; |
|
|
|
import java.util.Map; |
|
|
|
import java.util.Map; |
|
|
|
import java.util.stream.Collectors; |
|
|
|
import java.util.stream.Collectors; |
|
|
@ -17,9 +16,6 @@ import com.palnet.comn.code.ErrorCode; |
|
|
|
import com.palnet.comn.exception.CustomException; |
|
|
|
import com.palnet.comn.exception.CustomException; |
|
|
|
import org.apache.commons.lang3.StringUtils; |
|
|
|
import org.apache.commons.lang3.StringUtils; |
|
|
|
import org.locationtech.jts.geom.Coordinate; |
|
|
|
import org.locationtech.jts.geom.Coordinate; |
|
|
|
import org.locationtech.jts.geom.GeometryFactory; |
|
|
|
|
|
|
|
import org.locationtech.jts.geom.Point; |
|
|
|
|
|
|
|
import org.locationtech.jts.geom.Polygon; |
|
|
|
|
|
|
|
import org.springframework.stereotype.Service; |
|
|
|
import org.springframework.stereotype.Service; |
|
|
|
|
|
|
|
|
|
|
|
import com.palnet.biz.api.acnt.jwt.model.JwtGroupModel; |
|
|
|
import com.palnet.biz.api.acnt.jwt.model.JwtGroupModel; |
|
|
@ -48,15 +44,15 @@ import com.palnet.biz.jpa.repository.flt.FltPlanQueryRepository; |
|
|
|
import com.palnet.biz.jpa.repository.pty.PtyGroupQueryRepository; |
|
|
|
import com.palnet.biz.jpa.repository.pty.PtyGroupQueryRepository; |
|
|
|
import com.palnet.comn.utils.AreaUtils; |
|
|
|
import com.palnet.comn.utils.AreaUtils; |
|
|
|
import com.palnet.comn.utils.EncryptUtils; |
|
|
|
import com.palnet.comn.utils.EncryptUtils; |
|
|
|
import com.palnet.comn.utils.FlightUtils; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
import lombok.RequiredArgsConstructor; |
|
|
|
import lombok.RequiredArgsConstructor; |
|
|
|
import lombok.extern.log4j.Log4j2; |
|
|
|
import lombok.extern.log4j.Log4j2; |
|
|
|
|
|
|
|
import org.springframework.transaction.annotation.Transactional; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@Log4j2 |
|
|
|
@Log4j2 |
|
|
|
@RequiredArgsConstructor |
|
|
|
|
|
|
|
@Service |
|
|
|
@Service |
|
|
|
|
|
|
|
@Transactional(readOnly = true) |
|
|
|
public class BasFlightService { |
|
|
|
public class BasFlightService { |
|
|
|
|
|
|
|
|
|
|
|
private final FltPlanBasRepository fltPlanBasRepository; |
|
|
|
private final FltPlanBasRepository fltPlanBasRepository; |
|
|
@ -66,11 +62,28 @@ public class BasFlightService { |
|
|
|
private final FltPlanPilotRepository fltPlanPilotRepository; |
|
|
|
private final FltPlanPilotRepository fltPlanPilotRepository; |
|
|
|
private final FltPlanQueryRepository fltPlanQueryRepository; |
|
|
|
private final FltPlanQueryRepository fltPlanQueryRepository; |
|
|
|
private final PtyGroupQueryRepository ptyPlanQueryRepository; |
|
|
|
private final PtyGroupQueryRepository ptyPlanQueryRepository; |
|
|
|
private final ComArcrftBasRepository comArcrftBasRepository; |
|
|
|
|
|
|
|
private final JwtTokenUtil jwtTokenUtil; |
|
|
|
private final JwtTokenUtil jwtTokenUtil; |
|
|
|
private final AreaUtils areaUtils; |
|
|
|
private final AreaUtils areaUtils; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public BasFlightService(FltPlanBasRepository fltPlanBasRepository, |
|
|
|
|
|
|
|
FltPlanArcrftRepository fltPlanArcrftRepository, |
|
|
|
|
|
|
|
FltPlanAreaRepository fltPlanAreaRepository, |
|
|
|
|
|
|
|
FltPlanAreaCoordRepository fltPlanAreaCoordRepository, |
|
|
|
|
|
|
|
FltPlanPilotRepository fltPlanPilotRepository, |
|
|
|
|
|
|
|
FltPlanQueryRepository fltPlanQueryRepository, |
|
|
|
|
|
|
|
PtyGroupQueryRepository ptyPlanQueryRepository, |
|
|
|
|
|
|
|
JwtTokenUtil jwtTokenUtil, |
|
|
|
|
|
|
|
AreaUtils areaUtils) { |
|
|
|
|
|
|
|
this.fltPlanBasRepository = fltPlanBasRepository; |
|
|
|
|
|
|
|
this.fltPlanArcrftRepository = fltPlanArcrftRepository; |
|
|
|
|
|
|
|
this.fltPlanAreaRepository = fltPlanAreaRepository; |
|
|
|
|
|
|
|
this.fltPlanAreaCoordRepository = fltPlanAreaCoordRepository; |
|
|
|
|
|
|
|
this.fltPlanPilotRepository = fltPlanPilotRepository; |
|
|
|
|
|
|
|
this.fltPlanQueryRepository = fltPlanQueryRepository; |
|
|
|
|
|
|
|
this.ptyPlanQueryRepository = ptyPlanQueryRepository; |
|
|
|
|
|
|
|
this.jwtTokenUtil = jwtTokenUtil; |
|
|
|
|
|
|
|
this.areaUtils = areaUtils; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
// 비행계획서 조회
|
|
|
|
// 비행계획서 조회
|
|
|
|
public List<BasFlightPlanModel> listPlan(BasFlightPlanListRq rq) { |
|
|
|
public List<BasFlightPlanModel> listPlan(BasFlightPlanListRq rq) { |
|
|
@ -232,6 +245,7 @@ public class BasFlightService { |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
// 비행계획서 등록
|
|
|
|
// 비행계획서 등록
|
|
|
|
|
|
|
|
@Transactional |
|
|
|
public boolean createPlan(BasFlightPlanModel rq) { |
|
|
|
public boolean createPlan(BasFlightPlanModel rq) { |
|
|
|
|
|
|
|
|
|
|
|
// 비행계획서 유효성 검사.
|
|
|
|
// 비행계획서 유효성 검사.
|
|
|
@ -296,6 +310,7 @@ public class BasFlightService { |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
// 비행계획서 수정
|
|
|
|
// 비행계획서 수정
|
|
|
|
|
|
|
|
@Transactional |
|
|
|
public boolean updatePlan(BasFlightPlanModel rq) { |
|
|
|
public boolean updatePlan(BasFlightPlanModel rq) { |
|
|
|
|
|
|
|
|
|
|
|
// 비행계획서 유효성 검사.
|
|
|
|
// 비행계획서 유효성 검사.
|
|
|
@ -421,6 +436,7 @@ public class BasFlightService { |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
// 비행계획서 삭제
|
|
|
|
// 비행계획서 삭제
|
|
|
|
|
|
|
|
@Transactional |
|
|
|
public boolean deletePlan(Integer planSno) { |
|
|
|
public boolean deletePlan(Integer planSno) { |
|
|
|
FltPlanBas planEntity = fltPlanBasRepository.findById(planSno).orElseThrow(); |
|
|
|
FltPlanBas planEntity = fltPlanBasRepository.findById(planSno).orElseThrow(); |
|
|
|
planEntity.setDelYn("Y"); |
|
|
|
planEntity.setDelYn("Y"); |
|
|
@ -495,6 +511,7 @@ public class BasFlightService { |
|
|
|
return fltPlanQueryRepository.aprvList(rq, userAccount); |
|
|
|
return fltPlanQueryRepository.aprvList(rq, userAccount); |
|
|
|
} |
|
|
|
} |
|
|
|
// 비행계획서 승인/미승인
|
|
|
|
// 비행계획서 승인/미승인
|
|
|
|
|
|
|
|
@Transactional |
|
|
|
public int aprovePlan(BasFlightAprovRq rq) { |
|
|
|
public int aprovePlan(BasFlightAprovRq rq) { |
|
|
|
int cnt = fltPlanBasRepository.updateAprvlYnByPlanSnoIn(rq.getPlanSnoList(), rq.getAprvlYn()); |
|
|
|
int cnt = fltPlanBasRepository.updateAprvlYnByPlanSnoIn(rq.getPlanSnoList(), rq.getAprvlYn()); |
|
|
|
return cnt; |
|
|
|
return cnt; |
|
|
|