Browse Source

드론 원스톱 전송 api 추가

master
김장현 2 weeks ago
parent
commit
d352163a06
  1. 14
      src/components/flight/ControlApprovalsTable.js
  2. 35
      src/components/flight/OperationApprovalsTable.js
  3. 4
      src/configs/constants.ts
  4. 5
      src/redux/features/laanc/laancState.ts
  5. 22
      src/redux/features/laanc/laancThunk.ts

14
src/components/flight/ControlApprovalsTable.js

@ -555,7 +555,7 @@ export default function ControlApprovalsTable(props) {
e.stopPropagation(); e.stopPropagation();
}} }}
> >
{reviewedProcType === 'W' ? '검토대기' : '검토완료'} 검토대기
</Button> </Button>
) : ( ) : (
'검토완료' '검토완료'
@ -573,11 +573,15 @@ export default function ControlApprovalsTable(props) {
상태 상태
</> </>
), ),
dataIndex: 'reviewedProcType', dataIndex: 'sendProcStatus',
width: '100px', width: '100px',
align: 'center', align: 'center',
render: reviewedProcType => { render: sendProcStatus => {
return reviewedProcType === 'W' ? '미전송' : '전송'; return sendProcStatus
? sendProcStatus === 'S'
: '전송'
? '미전송'
: '미전송';
} }
} }
]; ];
@ -1006,7 +1010,7 @@ export default function ControlApprovalsTable(props) {
setModal={setModal} setModal={setModal}
handlerConfirm={() => handlerConfirm={() =>
modal.type === 'review' modal.type === 'review'
? updateReviewedType('P', currentPlanAreaSno) ? updateReviewedType('S', currentPlanAreaSno)
: handleSave(modal.row) : handleSave(modal.row)
} }
handleCancel={handleCancel} handleCancel={handleCancel}

35
src/components/flight/OperationApprovalsTable.js

@ -7,7 +7,8 @@ import { Form, Input, Select, Table } from 'antd';
import { import {
updateLaancAprv, updateLaancAprv,
getLaancAprvList, getLaancAprvList,
updateLaancAprvReview updateLaancAprvReview,
updateDronOneStopSend
} from '@src/redux/features/laanc/laancThunk'; } from '@src/redux/features/laanc/laancThunk';
import { ERROR_MESSAGE, ERROR_TITLE } from '@src/configs/msgConst'; import { ERROR_MESSAGE, ERROR_TITLE } from '@src/configs/msgConst';
import OperationModal from './OperationModal'; import OperationModal from './OperationModal';
@ -256,7 +257,7 @@ export default function OperationApprovalsTable(props) {
case 'C': case 'C':
text = '검토취소'; text = '검토취소';
break; break;
case 'P': case 'S':
text = '검토완료'; text = '검토완료';
break; break;
@ -562,8 +563,8 @@ export default function OperationApprovalsTable(props) {
if (reviewedType === 'U') { if (reviewedType === 'U') {
reviewedType = 'W'; reviewedType = 'W';
} else if (reviewedType === 'S') { } else if (reviewedType === 'P') {
reviewedType = 'P'; reviewedType = 'S';
} }
return ( return (
@ -596,7 +597,7 @@ export default function OperationApprovalsTable(props) {
<option key={6} value={'R'}> <option key={6} value={'R'}>
재검토요청 재검토요청
</option> */} </option> */}
<option key={7} value={'P'}> <option key={7} value={'S'}>
검토완료 검토완료
</option> </option>
</Select> </Select>
@ -637,11 +638,11 @@ export default function OperationApprovalsTable(props) {
상태 상태
</> </>
), ),
dataIndex: 'planAreaSno', dataIndex: 'sendStatus',
width: '100px', width: '100px',
align: 'center', align: 'center',
render: planAreaSno => { render: sendStatus => {
return '미전송'; return sendStatus ? (sendStatus === 'S' ? '전송' : '미전송') : '미전송';
} }
}, },
{ {
@ -822,7 +823,8 @@ export default function OperationApprovalsTable(props) {
A: item => { A: item => {
return ( return (
!(item.reviewedType === 'P' || item.reviewedType === 'S') && !(item.reviewedType === 'P' || item.reviewedType === 'S') &&
!(item?.reviewedProcType === 'P' || item?.reviewedProcType === 'S') !(item?.reviewedProcType === 'P' || item?.reviewedProcType === 'S') &&
!(item?.sendStatus === 'N')
); );
}, },
Q: item => item.reviewedType !== 'W', Q: item => item.reviewedType !== 'W',
@ -845,8 +847,19 @@ export default function OperationApprovalsTable(props) {
// 요청 성공 시 액션 핸들러 // 요청 성공 시 액션 핸들러
const actionHandlers = { const actionHandlers = {
A: () => { A: () => {
try {
setCheckData(res); setCheckData(res);
setIsCheckBoxModal(true);
const planAreaSnoList = res.map(i => i.planAreaSno);
dispatch(updateDronOneStopSend(planAreaSnoList));
} catch (error) {
return handlerErrorModal(
'전송 실패',
'전송 요청을 실패하였습니다. 다시 시도해주세요.',
false
);
}
}, },
Q: async () => { Q: async () => {
try { try {
@ -900,7 +913,7 @@ export default function OperationApprovalsTable(props) {
} }
// 요청 성공 시 액션 핸들러 실행 // 요청 성공 시 액션 핸들러 실행
// await actionHandlers[type](); await actionHandlers[type]();
}; };
return ( return (

4
src/configs/constants.ts

@ -240,14 +240,14 @@ export const FlightCategory = {
Control: { Control: {
: '관제통신과', : '관제통신과',
W: '검토대기', W: '검토대기',
P: '검토완료' S: '검토완료'
// R: '재검토', // R: '재검토',
// C: '검토취소', // C: '검토취소',
// P: '요청처리' // P: '요청처리'
}, },
Operation: { Operation: {
: '안전운항과', : '안전운항과',
P: '검토완료', S: '검토완료',
W: '검토대기', W: '검토대기',
Q: '검토요청' Q: '검토요청'
// R: '재검토요청', // R: '재검토요청',

5
src/redux/features/laanc/laancState.ts

@ -737,3 +737,8 @@ export interface ILaancApprovalReviewdRq {
planAreaSnoList: []; planAreaSnoList: [];
reviewedType: string; reviewedType: string;
} }
// 운항과 드론원스톱 전송
export interface ILaancApprovalSendRq {
planAreaSnoList: number[];
}

22
src/redux/features/laanc/laancThunk.ts

@ -18,7 +18,8 @@ import {
ILaancAprvListRs, ILaancAprvListRs,
ILaancAprvListRq, ILaancAprvListRq,
ILaancAprvUpdateRq, ILaancAprvUpdateRq,
ILaancApprovalReviewdRq ILaancApprovalReviewdRq,
ILaancApprovalSendRq
} from './laancState'; } from './laancState';
import { createAsyncThunk } from '@reduxjs/toolkit'; import { createAsyncThunk } from '@reduxjs/toolkit';
import { openModal } from '../comn/message/messageSlice'; import { openModal } from '../comn/message/messageSlice';
@ -391,3 +392,22 @@ export const updateLaancCAprvReview = createAsyncThunk(
} }
} }
); );
// 관제과 검토 수정 API
export const updateDronOneStopSend = createAsyncThunk(
'laanc/updateDronOneStopSend',
async (rq: ILaancApprovalSendRq, thunkAPI) => {
try {
const data: { undefined } = await axios.post(`/api/bas/dos/send`, {
planAreaSnoList: rq
});
console.log(data);
// return data;
} catch (error) {
openModal({
header: ERROR_TITLE,
body: ERROR_MESSAGE
});
}
}
);

Loading…
Cancel
Save