Browse Source

관제 비행구역 caching

feature/auth
노승철 2 years ago
parent
commit
bf20933259
  1. 7
      src/main/java/com/palnet/Application.java
  2. 33
      src/main/java/com/palnet/biz/api/bas/flight/service/BasFlightService.java
  3. 4
      src/main/java/com/palnet/biz/api/ctr/cntrl/service/CtrCntrlService.java

7
src/main/java/com/palnet/Application.java

@ -3,6 +3,7 @@ package com.palnet;
import com.fasterxml.jackson.databind.ObjectMapper; import com.fasterxml.jackson.databind.ObjectMapper;
import org.springframework.boot.SpringApplication; import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication; import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.cache.annotation.EnableCaching;
import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Bean;
import org.springframework.scheduling.annotation.EnableAsync; import org.springframework.scheduling.annotation.EnableAsync;
import org.springframework.scheduling.annotation.EnableScheduling; import org.springframework.scheduling.annotation.EnableScheduling;
@ -10,15 +11,11 @@ import org.springframework.scheduling.annotation.EnableScheduling;
@SpringBootApplication @SpringBootApplication
@EnableScheduling @EnableScheduling
@EnableAsync @EnableAsync
@EnableCaching
public class Application { public class Application {
public static void main(String[] args) { public static void main(String[] args) {
SpringApplication.run(Application.class, args); SpringApplication.run(Application.class, args);
} }
// @Bean
// public ObjectMapper objectMapper() {
// return new ObjectMapper();
// }
} }

33
src/main/java/com/palnet/biz/api/bas/flight/service/BasFlightService.java

@ -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;

4
src/main/java/com/palnet/biz/api/ctr/cntrl/service/CtrCntrlService.java

@ -23,6 +23,8 @@ import org.locationtech.jts.geom.Coordinate;
import org.slf4j.Logger; import org.slf4j.Logger;
import org.slf4j.LoggerFactory; import org.slf4j.LoggerFactory;
import org.springframework.cache.annotation.Cacheable;
import org.springframework.cache.annotation.Caching;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import com.palnet.biz.jpa.repository.ctr.CtrCntrlQueryRepository; import com.palnet.biz.jpa.repository.ctr.CtrCntrlQueryRepository;
@ -269,7 +271,7 @@ public class CtrCntrlService {
* @param idntfNum * @param idntfNum
* @return * @return
*/ */
@Cacheable(value = "flight-plan")
public List<BasFlightPlanModel> getFlightPlan(String idntfNum) { public List<BasFlightPlanModel> getFlightPlan(String idntfNum) {
List<BasFlightPlanModel> rs = new ArrayList<>(); List<BasFlightPlanModel> rs = new ArrayList<>();

Loading…
Cancel
Save