diff --git a/src/containers/laanc/LaancPlanContainer.js b/src/containers/laanc/LaancPlanContainer.js index d5132751..4b0b9179 100644 --- a/src/containers/laanc/LaancPlanContainer.js +++ b/src/containers/laanc/LaancPlanContainer.js @@ -163,6 +163,20 @@ export default function LaancPlanContainer({ desc: '비행일자를 확인해주세요.' }); return false; + } else if (schFltStDt.format('A h:mm') === 'PM 11:00') { + setModal2({ + isOpen: true, + title: '특별 비행', + desc: '야간 비행은 특별 비행에 해당됩니다. 특별 비행의 경우 드론원스톱을 통해서 신청해주시기 바랍니다.' + }); + return false; + } else if (schFltStDt.format('A h:mm') === 'PM 5:00') { + setModal2({ + isOpen: true, + title: '비행구역 및 비행일자 중복', + desc: '설정하신 비행구역 및 비행시간에 이미 승인완료된 신청건이 있습니다. 다시 설정 부탁드립니다.' + }); + return false; } else if (!detailData.fltPurpose) { setModal2({ isOpen: true, @@ -178,6 +192,14 @@ export default function LaancPlanContainer({ desc: '고도를 입력해 주세요.' }); + return false; + } else if (parseInt(detailData.areaList[0].fltElev, 10) > 150) { + setModal2({ + isOpen: true, + title: '고도 재설정', + desc: '설정하신 고도가 150m를 초과하였습니다. 150m 이하로 설정 부탁드립니다.' + }); + return false; } else if (!detailData.areaList[0].bufferZone) { setModal2({ diff --git a/src/modules/laanc/actions/laancActions.ts b/src/modules/laanc/actions/laancActions.ts index 0cd2d910..732de150 100644 --- a/src/modules/laanc/actions/laancActions.ts +++ b/src/modules/laanc/actions/laancActions.ts @@ -4,7 +4,8 @@ import { ActionType, createAction, createAsyncAction } from 'typesafe-actions'; import { LaancFlightData, LaancApproval, - FlightPlanData + FlightPlanData, + LaancPdf } from '../models/laancModels'; // laanc 공문 pdf 다운로드 @@ -40,7 +41,7 @@ export const LAANC_FLIGHT_CREATE = createAsyncAction( LAANC_FLIGHT_CREATE_REQUEST, LAANC_FLIGHT_CREATE_SUCCESS, LAANC_FLIGHT_CREATE_FAILURE -)(); +)(); const actions = { laancPdfAction, diff --git a/src/modules/laanc/models/laancModels.ts b/src/modules/laanc/models/laancModels.ts index cc6a1e51..6d35cf4a 100644 --- a/src/modules/laanc/models/laancModels.ts +++ b/src/modules/laanc/models/laancModels.ts @@ -3,6 +3,7 @@ import moment from 'moment'; export interface laancState { detail: FlightPlanData | undefined; laancApply: LaancApproval | undefined; + laancPdf: LaancPdf | undefined; } // laanc계획서 초기값 @@ -207,6 +208,10 @@ export const LaancFlightData = { } }; +export interface LaancPdf { + address: string; + pdfUrl: string; +} // laanc 승인 model export interface LaancApproval { validatedRs: { @@ -225,15 +230,15 @@ export interface LaancApproval { ]; valid: boolean; // laanc 실질적인 true / false arcrftWeight: boolean; // 25kg 이하 true - report: boolean; // 신고 대상 - 상업적이면서 기체 중량 2kg 이상일 경우 - True + report: boolean; // 신고 대상 - 상업적 or 기체 중량 2kg 이상일 경우 - True elev: boolean; // 150m 이하 ture arcrftInsurance: boolean; // 항공기 보험 여부 flightArea: boolean; // 비행 가능 여부 pilotQlfc: boolean; // 자격 여부 - arcrftDuplicated: boolean; // 기체 중복 여부 - evaluatedTargetArea: boolean; // 평가대상지역여부 - 공역과 겹칠때만 True - planAreaDuplicatd: boolean; // 비행 구역 중복 여부 - flight: boolean; // laanc 신청 필요 없음 + arcrftDuplicated: boolean; // 기체 중복 여부 시간대로만 true 이면 중복 + evaluatedTargetArea: boolean; // 평가대상지역여부 - 공역 구역이면 true + planAreaDuplicatd: boolean; // 비행 구역 중복 여부 시간 중복 + flight: boolean; // 무조건 날 수 있음 }; } @@ -347,6 +352,7 @@ export interface FlightPlanArcrftData { export interface FlightPlanArcrftDataList extends Array {} export const laancControlData = { + laancPdf: undefined, laancApply: undefined, detail: { planSno: 0, diff --git a/src/modules/laanc/reducers/laancReducers.ts b/src/modules/laanc/reducers/laancReducers.ts index 9a4247fd..5f010160 100644 --- a/src/modules/laanc/reducers/laancReducers.ts +++ b/src/modules/laanc/reducers/laancReducers.ts @@ -16,13 +16,21 @@ import { export const laancReducer = createReducer( laancControlData -).handleAction(Actions.LAANC_FLIGHT_Approval.success, (state, action) => - produce(state, draft => { - const data = action.payload; - draft.laancApply = data; - // draft.detail = initFlightBas.initDetail; - }) -); +) + .handleAction(Actions.LAANC_FLIGHT_Approval.success, (state, action) => + produce(state, draft => { + const data = action.payload; + draft.laancApply = data; + // draft.detail = initFlightBas.initDetail; + }) + ) + .handleAction(Actions.LAANC_FLIGHT_CREATE.success, (state, action) => + produce(state, draft => { + const data = action.payload; + draft.laancPdf = data; + // draft.detail = initFlightBas.initDetail; + }) + ); // handleAction(Actions.laancFlightApproval.success, (state, action) => // produce(state, draft => { diff --git a/src/views/laanc/LaacnStep3.js b/src/views/laanc/LaacnStep3.js index 6414e744..5e620484 100644 --- a/src/views/laanc/LaacnStep3.js +++ b/src/views/laanc/LaacnStep3.js @@ -52,7 +52,6 @@ export default function LaacnStep3({ const [numPages, setNumPages] = useState(null); // total const [pageNum, setPageNum] = useState(1); const { user } = useSelector(state => state.authState); - const handlerClose = () => { setFormModal(!formModal); }; diff --git a/src/views/laanc/LaancStep1.js b/src/views/laanc/LaancStep1.js index 1b8c3af6..5fc1548b 100644 --- a/src/views/laanc/LaancStep1.js +++ b/src/views/laanc/LaancStep1.js @@ -58,6 +58,16 @@ export default function LaancStep1({ if (!currentParm) setCenteredModal(mapParam != 'true' ? false : true); }, [location]); + useEffect(() => { + if ( + data.commercial === 'COMMERCIAL' || + data.arcrftList[0].arcrftWdth == '11' || + data.arcrftList[0].arcrftWdth == '10' || + data.arcrftList[0].arcrftWdth == '9' + ) { + console.log('>>>>>SDfsdfsd'); + } + }, [data]); const handleInputClick = type => { // Input 요소가 포커스될 때 커서를 맨 뒤로 이동 if (fltElevRef.current && type === 'fltElev') { diff --git a/src/views/laanc/LaancStep2.js b/src/views/laanc/LaancStep2.js index f1376f6e..cb4544ec 100644 --- a/src/views/laanc/LaancStep2.js +++ b/src/views/laanc/LaancStep2.js @@ -185,25 +185,61 @@ export default function LaancStep2({ {/* 사전 결과 승인 대상일때 color=success */}
- {data.arcrftList[0].idntfNum === 'PA0001' ? ( - - ) : ( - - )} - {data.arcrftList[0].idntfNum === 'PA0001' ? ( - 검토 결과 승인 대상입니다. + {laancApply?.report && laancApply?.evaluatedTargetArea ? ( + laancApply?.valid ? ( + <> + + 검토 결과 승인 대상입니다. + + ) : ( + <> + + + 검토 결과 미 승인 대상입니다. + + {laancApply.planAreaDuplicatd || + laancApply.arcrftDuplicated ? ( + + 설정하신 비행구역 및 비행시간에 이미 승인완료된
+ 신청건이 있습니다. 다시 설정 부탁드립니다. +
+ ) : null} + + ) ) : ( <> + 검토 결과 미 승인 대상입니다. - + {!laancApply?.planAreaDuplicatd || + (!laancApply?.report && + !laancApply?.evaluatedTargetArea) ? ( + + 제출하신 비행계획상의 비행구역과 비행시간이 별도의 + 승인을 +
+ 필요로 하지 않지만, 아래 조종자 준수사항에 유의하여 +
비행하시기 바랍니다. +
+ ) : ( + + 제출하신 비행계획상의 비행시간이 다른 계획서와 +
+ 겹치는 비행시간 입니다. +
+ )} + {/* 유효성 검사에 실패하였습니다.
다시 검사해주시기 바랍니다. -
+
*/} )}