package incheon.ags.dtm.service;


import java.io.File;
import java.util.List;
import java.util.Map;

import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpSession;

import org.springframework.core.io.Resource;
import org.springframework.http.ResponseEntity;
import org.springframework.web.multipart.MultipartFile;

import incheon.ags.dtm.vo.DmapDownloadVO;
import incheon.ags.dtm.vo.DtmAddressVO;
import incheon.ags.dtm.vo.DtmApplyItemVO;
import incheon.ags.dtm.vo.DtmApplyListVO;
import incheon.ags.dtm.vo.DtmApplySearchVO;
import incheon.ags.dtm.vo.DtmApproveVO;
import incheon.ags.dtm.vo.DtmComboVO;
import incheon.ags.dtm.vo.DtmDmapDtVO;
import incheon.ags.dtm.vo.DtmDmapHistDtVO;
import incheon.cmm.g2f.layer.vo.TaskLayerSearchRequestDTO;
import incheon.cmm.g2f.layer.vo.TaskLayerVO;

public interface DtmService {


    List<TaskLayerVO> getLayerList(TaskLayerSearchRequestDTO request) throws Exception;

    List<DtmDmapDtVO> selectDmapDtList(DtmDmapDtVO dtmDmapDtVO) throws Exception;
    List<DtmDmapDtVO> selectDmapDtListBySig(DtmDmapDtVO dtmDmapDtVO) throws Exception;
    List<DtmDmapDtVO> selectDmapDtListByEmd(DtmDmapDtVO dtmDmapDtVO) throws Exception;
    List<DtmDmapHistDtVO> searchDmapDtDetail(DtmDmapDtVO dtmDmapDtVO) throws Exception;
    List<DtmDmapDtVO> selectApplyDmapDtList(DtmDmapDtVO dtmDmapDtVO) throws Exception;

    /* 사업명 */
    List<DtmComboVO> selectBizList();
    
    void downloadFile(HttpServletResponse response) throws Exception;

    ResponseEntity<Resource> downLoadExcel(List<Map<String, Object>> data, Map<String, String> columnMap, String fileName);
    List<DtmAddressVO> getAddrCodeByPoi(DtmAddressVO filterVO); 
    
    /* ===============================
     * 수치지형도 신청 기능 (추가)
     * =============================== */

    /**
     * 수치지형도 신청 등록
     *
     * cmt_dmapreq_dt       : 신청 마스터
     * cmt_dmapreq_list_dt  : 신청 도엽 리스트
     *
     * @param reqVO   신청 마스터 정보
     * @param reqList 체크된 도엽 목록
     * @param file    첨부파일
     * @param session 
     */
	void insertApply(String reqUse, String pubYn, String appfileType, List<DtmApplyItemVO> items,
			List<MultipartFile> file, HttpSession session) throws Exception;
    
    /* ===============================
     * 수치지형도신청 리스트 조회 (추가)
     * =============================== */
    List<DtmApplyListVO> selectApplyList(DtmApplySearchVO vo, HttpSession session);
    
    /* ===============================
     * 관리자 인수증 업로드 (추가)
     * =============================== */
    void uploadCertFile(MultipartFile file, String aplySn, String reqYear) throws Exception;
    
    /* ===============================
     * 관리자 승인 (추가)
     * =============================== */
    void approveDigitalMap(DtmApproveVO vo, String basePath ,HttpSession session) throws Exception;
    
    /* ===============================
     * 관리자 신청 취소(반려)
     * =============================== */
    void applyCancel(DtmApproveVO vo ,HttpSession session);
    
    /* ===============================
     * 관리자 수치지형도 다운로드
     * =============================== */
    DmapDownloadVO selectDownloadInfo(long aplySn) throws Exception;
    
    /* ===============================
     * 신청서 ZIP 생성
     * 파일명: REQ_신청번호.zip
     * =============================== */
	File createRequestZip(long aplySn, String reqYear) throws Exception; 

}