package com.madeu.service.web.webcategory.impl;

import com.madeu.constants.Constants;
import com.madeu.dao.web.webauthmenurelation.WebAuthMenuRelationSqlMapDAO;
import com.madeu.dao.web.webcategory.WebCategorySqlMapDAO;
import com.madeu.dao.web.webmember.WebMemberSqlMapDAO;
import com.madeu.service.common.file.FileService;
import com.madeu.service.web.webcategory.WebCategoryService;
import com.madeu.util.ValidationCheckUtil;
import lombok.extern.slf4j.Slf4j;
import org.json.simple.JSONArray;
import org.json.simple.JSONObject;
import org.json.simple.parser.JSONParser;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Propagation;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.web.multipart.MultipartFile;

import java.nio.file.Files;
import java.nio.file.Path;
import java.nio.file.Paths;
import java.text.SimpleDateFormat;
import java.util.*;

@Slf4j
@Service("WebCategoryService")
public class WebCategoryServiceImpl implements WebCategoryService{
    
    @Autowired
    private WebCategorySqlMapDAO webCategorySqlMapDAO;

    @Autowired
    private WebMemberSqlMapDAO webMemberSqlMapDAO;

    @Autowired
    private WebAuthMenuRelationSqlMapDAO webAuthMenuRelationSqlMapDAO;

    @Autowired
    private FileService fileService;

    /**
     * 병원 기타설정 화면으로 이동.
     *
     *
     * @param paramMap
     * @return
     * @throws Exception
     */
    @Override
    public HashMap<String, Object> selectCategoryListIntro(
            HashMap<String, Object> paramMap) throws Exception {
        log.debug("WebCategoryServiceImpl selectCategoryListIntro START");

        HashMap<String, Object> map = new HashMap<String, Object>();

        log.debug("loginMemberId       :"+paramMap.get("loginMemberId"));

        log.debug("menuClass           :"+paramMap.get("menuClass"));

        try{
            boolean check  = true;

            String menuClass    = String.valueOf(paramMap.get("menuClass"));

            // 정렬
            if(true != ValidationCheckUtil.emptyCheck(menuClass)){
                check = false;
                map.put("msgCode", Constants.FAIL);
                map.put("msgDesc","메뉴 정보가 없습니다.");
            }

            if(true == check){
                // 사용자 확인
                List<Map<String, Object>> userListMap = webMemberSqlMapDAO.checkMember(paramMap);
                int userListMapSize = userListMap.size();

                if(1==userListMapSize){
                    paramMap.put("menuClassAuthId", userListMap.get(0).get("muAuthId"));
                }
                else {
                    check = false;
                    map.put("msgCode", Constants.FAIL);
                    map.put("msgDesc", "사용자 정보가 올바르지 않습니다.");
                }
            }

            if(true == check){
                // 권한 조회
                HashMap<String, Object> authCheckParamMap = new HashMap<String, Object>();
                authCheckParamMap.put("menuClass",paramMap.get("menuClass"));
                authCheckParamMap.put("muAuthId",paramMap.get("menuClassAuthId"));
                List<Map<String, Object>> authMenuRelationlistMap = webAuthMenuRelationSqlMapDAO.selectAuthMenuRelation(authCheckParamMap);
                int authMenuRelationlistMapSize = authMenuRelationlistMap.size();

                if(1==authMenuRelationlistMapSize){
                    map.put("msgCode", Constants.OK);
                    map.put("success","true");

                    map.put("selectUseYn", authMenuRelationlistMap.get(0).get("selectUseYn"));
                    map.put("insertUseYn", authMenuRelationlistMap.get(0).get("insertUseYn"));
                    map.put("updateUseYn", authMenuRelationlistMap.get(0).get("updateUseYn"));
                    map.put("deleteUseYn", authMenuRelationlistMap.get(0).get("deleteUseYn"));
                    map.put("downloadUseYn", authMenuRelationlistMap.get(0).get("downloadUseYn"));
                }
                else {
                    map.put("msgCode", Constants.FAIL);
                    map.put("msgDesc", "권한 정보가 없습니다.");
                }
            }
        }
        catch(Exception e){
            e.printStackTrace();
            throw e;
        }

        log.debug("WebCategoryServiceImpl selectCategoryListIntro END");
        return map;
    }

    /**
     * 병원 기타설정 카테고리별 아이템리스트 (List)
     *
     *
     * @param paramMap
     * @return
     * @throws Exception
     */
    @Override
    public HashMap<String, Object> selectCategoryItemList(
            HashMap<String, Object> paramMap) throws Exception {
        log.debug("WebCategoryServiceImpl selectCategoryItemList START");

        HashMap<String, Object> map = new HashMap<String, Object>();

        log.debug("loginMemberId       :"+paramMap.get("loginMemberId"));

        log.debug("menuClass           :"+paramMap.get("menuClass"));

        try{
            boolean check  = true;

            if(true == check){
                // 사용자 확인
                List<Map<String, Object>> userListMap = webMemberSqlMapDAO.checkMember(paramMap);
                int userListMapSize = userListMap.size();

                if(1==userListMapSize){
                    paramMap.put("menuClassAuthId", userListMap.get(0).get("muAuthId"));
                }
                else {
                    check = false;
                    map.put("msgCode", Constants.FAIL);
                    map.put("msgDesc", "사용자 정보가 올바르지 않습니다.");
                }
            }
            if(true == check){
                // 권한 조회
                HashMap<String, Object> authCheckParamMap = new HashMap<String, Object>();
                authCheckParamMap.put("menuClass",paramMap.get("menuClass"));
                authCheckParamMap.put("muAuthId",paramMap.get("menuClassAuthId"));
                List<Map<String, Object>> authMenuRelationlistMap = webAuthMenuRelationSqlMapDAO.selectAuthMenuRelation(authCheckParamMap);
                int authMenuRelationlistMapSize = authMenuRelationlistMap.size();

                if(1==authMenuRelationlistMapSize){

                    if(("Y").equals(authMenuRelationlistMap.get(0).get("selectUseYn"))) {

                    }
                    else {
                        check = false;
                        map.put("msgCode", Constants.FAIL);
                        map.put("msgDesc", "조회 권한 정보가 없습니다.");
                    }
                }
                else {
                    check = false;
                    map.put("msgCode", Constants.FAIL);
                    map.put("msgDesc", "권한 정보가 없습니다.");
                }
            }

            if(true == check){
                List<Map<String, Object>> hospitalListMap = webCategorySqlMapDAO.selectCategoryItemList(paramMap);
                Map<String, List<Map<String, Object>>> categorizedMaps = new HashMap<>();

                for (Map<String, Object> row : hospitalListMap) {
                    // 타입을 키로 사용
                    String categoryCode = (String) row.get("categoryCode");
                    List<Map<String, Object>> categoryList = categorizedMaps.computeIfAbsent(categoryCode, k -> new ArrayList<>());

                    Map<String, Object> categoryItems = new HashMap<>();
                    categoryItems.put("muCategoryItemId", row.get("muCategoryItemId"));
                    categoryItems.put("categoryCode", row.get("categoryCode"));
                    categoryItems.put("categoryName", row.get("categoryName"));
                    categoryItems.put("categoryItemCode", row.get("categoryItemCode"));
                    categoryItems.put("categoryItemName", row.get("categoryItemName"));
                    categoryItems.put("filePath", row.get("filePath"));
                    categoryItems.put("fileName", row.get("fileName"));
                    categoryItems.put("originalFileName", row.get("originalFileName"));
                    categoryItems.put("etc", row.get("etc"));
                    categoryItems.put("orderNumber", row.get("orderNumber"));

                    // 리스트에 세부 정보 추가
                    categoryList.add(categoryItems);
                }

                map.put("msgCode", Constants.OK);
                map.put("success","true");
                map.put("rows",categorizedMaps);

            }

        }
        catch(Exception e){
            e.printStackTrace();
            throw e;
        }
        log.debug("WebCategoryServiceImpl selectHospital END");
        return map;
    }
    /**
     * 병원 기타설정 카테고리별 아이템리스트 (option)
     *
     *
     * @param paramMap
     * @return
     * @throws Exception
     */
    @Override
    public HashMap<String, Object> selectCategoryItem(
            HashMap<String, Object> paramMap) throws Exception {
        log.debug("WebCategoryServiceImpl selectCategoryItem START");

        HashMap<String, Object> map = new HashMap<String, Object>();

        log.debug("loginMemberId       :"+paramMap.get("loginMemberId"));

        log.debug("menuClass           :"+paramMap.get("menuClass"));

        try{
            boolean check  = true;

            if(true == check){
                // 사용자 확인
                List<Map<String, Object>> userListMap = webMemberSqlMapDAO.checkMember(paramMap);
                int userListMapSize = userListMap.size();

                if(1==userListMapSize){
                    paramMap.put("menuClassAuthId", userListMap.get(0).get("muAuthId"));
                }
                else {
                    check = false;
                    map.put("msgCode", Constants.FAIL);
                    map.put("msgDesc", "사용자 정보가 올바르지 않습니다.");
                }
            }

            if(true == check){
                List<Map<String, Object>> categoryItems = webCategorySqlMapDAO.selectCategoryItem(paramMap);
                map.put("msgCode", Constants.OK);
                map.put("success","true");
                map.put("rows",categoryItems);

            }

        }
        catch(Exception e){
            e.printStackTrace();
            throw e;
        }
        log.debug("WebCategoryServiceImpl selectHospital END");
        return map;
    }

    /**
     * 병원 기타설정 카테고리 조회 (Option)
     *
     *
     * @param paramMap
     * @return
     * @throws Exception
     */
    @Override
    public HashMap<String, Object> selectCategoryList(
            HashMap<String, Object> paramMap) throws Exception {
        log.debug("WebCategoryServiceImpl selectCategoryList START");

        HashMap<String, Object> map = new HashMap<String, Object>();

        log.debug("loginMemberId       :"+paramMap.get("loginMemberId"));

        log.debug("menuClass           :"+paramMap.get("menuClass"));

        try{
            boolean check  = true;

            if(true == check){
                // 사용자 확인
                List<Map<String, Object>> userListMap = webMemberSqlMapDAO.checkMember(paramMap);
                int userListMapSize = userListMap.size();

                if(1==userListMapSize){
                    paramMap.put("menuClassAuthId", userListMap.get(0).get("muAuthId"));
                }
                else {
                    check = false;
                    map.put("msgCode", Constants.FAIL);
                    map.put("msgDesc", "사용자 정보가 올바르지 않습니다.");
                }
            }
//            if(true == check){
//                // 권한 조회
//                HashMap<String, Object> authCheckParamMap = new HashMap<String, Object>();
//                authCheckParamMap.put("menuClass",paramMap.get("menuClass"));
//                authCheckParamMap.put("muAuthId",paramMap.get("menuClassAuthId"));
//                List<Map<String, Object>> authMenuRelationlistMap = webAuthMenuRelationSqlMapDAO.selectAuthMenuRelation(authCheckParamMap);
//                int authMenuRelationlistMapSize = authMenuRelationlistMap.size();
//
//                if(1==authMenuRelationlistMapSize){
//
//                    if(("Y").equals(authMenuRelationlistMap.get(0).get("selectUseYn"))) {
//
//                    }
//                    else {
//                        check = false;
//                        map.put("msgCode", Constants.FAIL);
//                        map.put("msgDesc", "조회 권한 정보가 없습니다.");
//                    }
//                }
//                else {
//                    check = false;
//                    map.put("msgCode", Constants.FAIL);
//                    map.put("msgDesc", "권한 정보가 없습니다.");
//                }
//            }
            if(true == check){
                List<Map<String, Object>> categoryListMap = webCategorySqlMapDAO.selectCategoryList(paramMap);

                map.put("msgCode", Constants.OK);
                map.put("success","true");
                map.put("rows",categoryListMap);
            }

        }
        catch(Exception e){
            e.printStackTrace();
            throw e;
        }
        log.debug("WebCategoryServiceImpl selectHospital END");
        return map;
    }

    /**
     * 병원 기타설정 등록
     *
     * @param paramMap
     * @return
     * @throws Exception
     */
    @Override
    @Transactional(rollbackFor={Exception.class}, propagation = Propagation.REQUIRES_NEW)
    public HashMap<String, Object> insertHospitalOther(
            HashMap<String, Object> paramMap) throws Exception{
        log.debug("WebCategoryServiceImpl insertHospitalOther START");

        HashMap<String, Object> map = new HashMap<String, Object>();

        log.debug("loginMemberId          :"+paramMap.get("loginMemberId"));

        log.debug("menuClass              :"+paramMap.get("menuClass"));

        log.debug("categoryName           :"+paramMap.get("categoryName"));

        log.debug("categoryCode           :"+paramMap.get("categoryCode"));
        log.debug("categoryItemName       :"+paramMap.get("categoryItemName"));
        log.debug("orderNumber    		  :"+paramMap.get("orderNumber"));
        log.debug("file                   :"+paramMap.get("file"));
        log.debug("etc                    :"+paramMap.get("etc"));


        try{
            boolean check  = true;

            String tId = String.valueOf(System.currentTimeMillis());
            SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
            Calendar c1 = Calendar.getInstance();
            String tDate = sdf.format(c1.getTime());

            if(true == check){
                // 사용자 확인
                List<Map<String, Object>> userListMap = webMemberSqlMapDAO.checkMember(paramMap);
                int userListMapSize = userListMap.size();

                if(1==userListMapSize){
                    paramMap.put("menuClassAuthId", userListMap.get(0).get("muAuthId"));
                }
                else {
                    check = false;
                    map.put("msgCode", Constants.FAIL);
                    map.put("msgDesc", "사용자 정보가 올바르지 않습니다.");
                }
            }

            if(true == check){
                // 권한 조회
                HashMap<String, Object> authCheckParamMap = new HashMap<String, Object>();
                authCheckParamMap.put("menuClass",paramMap.get("menuClass"));
                authCheckParamMap.put("muAuthId",paramMap.get("menuClassAuthId"));
                List<Map<String, Object>> authMenuRelationlistMap = webAuthMenuRelationSqlMapDAO.selectAuthMenuRelation(authCheckParamMap);
                int authMenuRelationlistMapSize = authMenuRelationlistMap.size();

                if(1==authMenuRelationlistMapSize){

                    if(("Y").equals(authMenuRelationlistMap.get(0).get("insertUseYn"))) {

                    }
                    else {
                        check = false;
                        map.put("msgCode", Constants.FAIL);
                        map.put("msgDesc", "수정 권한 정보가 없습니다.");
                    }
                }
                else {
                    check = false;
                    map.put("msgCode", Constants.FAIL);
                    map.put("msgDesc", "권한 정보가 없습니다.");
                }
            }

            if(true == check){
                if(null!=paramMap.get("file")&&!("").equals(paramMap.get("file"))) {
                    MultipartFile fileData = (MultipartFile) paramMap.get("file");

                    if (null != fileData && !fileData.isEmpty()) {
                        HashMap<String, Object> uploadFileMap = new HashMap<String, Object>();
                        uploadFileMap.put("type", "CI");
                        uploadFileMap.put("fileType", "P");
                        uploadFileMap.put("fileName", fileData.getOriginalFilename());
                        HashMap<String, Object> fileMap = fileService.uploadFile(uploadFileMap, fileData);
                        String cdnUrl       = String.valueOf(fileMap.get("cdnUrl"));
                        String filePath     = String.valueOf(fileMap.get("filePath"));
                        String fileName     = String.valueOf(fileMap.get("fileName"));
                        String chgFileNmae  = fileData.getOriginalFilename();
                        paramMap.put("cdnUrl", cdnUrl);
                        paramMap.put("filePath", filePath);
                        paramMap.put("fileName", fileName);
                        paramMap.put("originalFileName", chgFileNmae);
                    }
                }
                String id = ("CI").concat(String.valueOf(System.currentTimeMillis()));
                paramMap.put("id", id);
                paramMap.put("regId", paramMap.get("regId"));
                paramMap.put("modId", paramMap.get("modId"));
                paramMap.put("tId", tId);
                paramMap.put("tDate", tDate);

                webCategorySqlMapDAO.insertHospitalOther(paramMap);
                webCategorySqlMapDAO.updateCategoryItemOrderNumber(paramMap);
                map.put("msgCode", Constants.OK);
                map.put("msgDesc", "등록 되었습니다.");
            }
        }
        catch (Exception e) {
            e.printStackTrace();
            throw e;
        }
        log.debug("WebCategoryServiceImpl updateHospital END");
        return map;
    }

    /**
     * 병원 기타설정 수정
     *
     * @param paramMap
     * @return
     * @throws Exception
     */
    @Override
    @Transactional(rollbackFor={Exception.class}, propagation = Propagation.REQUIRES_NEW)
    public HashMap<String, Object> updateHospitalOther(
            HashMap<String, Object> paramMap) throws Exception{
        log.debug("WebCategoryServiceImpl updateHospitalOther START");

        HashMap<String, Object> map = new HashMap<String, Object>();

        log.debug("loginMemberId          :"+paramMap.get("loginMemberId"));

        log.debug("menuClass              :"+paramMap.get("menuClass"));

        log.debug("categoryName           :"+paramMap.get("categoryName"));

        log.debug("categoryCode           :"+paramMap.get("categoryCode"));
        log.debug("categoryItemName       :"+paramMap.get("categoryItemName"));
        log.debug("orderNumber    		  :"+paramMap.get("orderNumber"));
        log.debug("file                   :"+paramMap.get("file"));
        log.debug("etc                    :"+paramMap.get("etc"));


        try{
            boolean check  = true;

            String tId = String.valueOf(System.currentTimeMillis());
            SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
            Calendar c1 = Calendar.getInstance();
            String tDate = sdf.format(c1.getTime());

            if(true == check){
                // 사용자 확인
                List<Map<String, Object>> userListMap = webMemberSqlMapDAO.checkMember(paramMap);
                int userListMapSize = userListMap.size();

                if(1==userListMapSize){
                    paramMap.put("menuClassAuthId", userListMap.get(0).get("muAuthId"));
                }
                else {
                    check = false;
                    map.put("msgCode", Constants.FAIL);
                    map.put("msgDesc", "사용자 정보가 올바르지 않습니다.");
                }
            }

            if(true == check){
                // 권한 조회
                HashMap<String, Object> authCheckParamMap = new HashMap<String, Object>();
                authCheckParamMap.put("menuClass",paramMap.get("menuClass"));
                authCheckParamMap.put("muAuthId",paramMap.get("menuClassAuthId"));
                List<Map<String, Object>> authMenuRelationlistMap = webAuthMenuRelationSqlMapDAO.selectAuthMenuRelation(authCheckParamMap);
                int authMenuRelationlistMapSize = authMenuRelationlistMap.size();

                if(1==authMenuRelationlistMapSize){

                    if(("Y").equals(authMenuRelationlistMap.get(0).get("updateUseYn"))) {

                    }
                    else {
                        check = false;
                        map.put("msgCode", Constants.FAIL);
                        map.put("msgDesc", "수정 권한 정보가 없습니다.");
                    }
                }
                else {
                    check = false;
                    map.put("msgCode", Constants.FAIL);
                    map.put("msgDesc", "권한 정보가 없습니다.");
                }
            }

            if(true == check){
                if(null!=paramMap.get("file")&&!("").equals(paramMap.get("file"))) {
                    MultipartFile fileData = (MultipartFile) paramMap.get("file");
                    if (null != fileData && !fileData.isEmpty()) {
                        if (null != fileData && !fileData.isEmpty()) {
                            HashMap<String, Object> uploadFileMap = new HashMap<String, Object>();
                            uploadFileMap.put("type", "CI");
                            uploadFileMap.put("fileType", "P");
                            uploadFileMap.put("fileName", fileData.getOriginalFilename());
                            HashMap<String, Object> fileMap = fileService.uploadFile(uploadFileMap, fileData);
                            String cdnUrl       = String.valueOf(fileMap.get("cdnUrl"));
                            String filePath     = String.valueOf(fileMap.get("filePath"));
                            String fileName     = String.valueOf(fileMap.get("fileName"));
                            String chgFileNmae  = fileName;
                            paramMap.put("cdnUrl", cdnUrl);
                            paramMap.put("filePath", filePath);
                            paramMap.put("fileName", fileName);
                            paramMap.put("originalFileName", chgFileNmae);
                        }
                    }
                }
                String id = ("CI").concat(String.valueOf(System.currentTimeMillis()));
                paramMap.put("id", id);
                paramMap.put("regId", paramMap.get("regId"));
                paramMap.put("modId", paramMap.get("modId"));
                paramMap.put("tId", tId);
                paramMap.put("tDate", tDate);

                webCategorySqlMapDAO.updateHospitalOther(paramMap);
                webCategorySqlMapDAO.updateCategoryItemOrderNumber(paramMap);
                map.put("msgCode", Constants.OK);
                map.put("msgDesc", "수정 되었습니다.");
            }
        }
        catch (Exception e) {
            e.printStackTrace();
            throw e;
        }
        log.debug("WebCategoryServiceImpl updateHospitalOther END");
        return map;
    }

    /**
     * 병원 기타설정 수정
     *
     * @param paramMap
     * @return
     * @throws Exception
     */
    @Override
    @Transactional(rollbackFor={Exception.class}, propagation = Propagation.REQUIRES_NEW)
    public HashMap<String, Object> deleteHospitalOther(
            HashMap<String, Object> paramMap) throws Exception{
        log.debug("WebCategoryServiceImpl deleteHospitalOther START");

        HashMap<String, Object> map = new HashMap<String, Object>();

        log.debug("loginMemberId          :"+paramMap.get("loginMemberId"));

        log.debug("menuClass              :"+paramMap.get("menuClass"));

        log.debug("categoryName           :"+paramMap.get("categoryName"));

        log.debug("categoryCode           :"+paramMap.get("categoryCode"));
        log.debug("categoryItemName       :"+paramMap.get("categoryItemName"));
        log.debug("orderNumber    		  :"+paramMap.get("orderNumber"));
        log.debug("file                   :"+paramMap.get("file"));
        log.debug("etc                    :"+paramMap.get("etc"));


        try{
            boolean check  = true;

            String tId = String.valueOf(System.currentTimeMillis());
            SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
            Calendar c1 = Calendar.getInstance();
            String tDate = sdf.format(c1.getTime());

            if(true == check){
                // 사용자 확인
                List<Map<String, Object>> userListMap = webMemberSqlMapDAO.checkMember(paramMap);
                int userListMapSize = userListMap.size();

                if(1==userListMapSize){
                    paramMap.put("menuClassAuthId", userListMap.get(0).get("muAuthId"));
                }
                else {
                    check = false;
                    map.put("msgCode", Constants.FAIL);
                    map.put("msgDesc", "사용자 정보가 올바르지 않습니다.");
                }
            }

            if(true == check){
                // 권한 조회
                HashMap<String, Object> authCheckParamMap = new HashMap<String, Object>();
                authCheckParamMap.put("menuClass",paramMap.get("menuClass"));
                authCheckParamMap.put("muAuthId",paramMap.get("menuClassAuthId"));
                List<Map<String, Object>> authMenuRelationlistMap = webAuthMenuRelationSqlMapDAO.selectAuthMenuRelation(authCheckParamMap);
                int authMenuRelationlistMapSize = authMenuRelationlistMap.size();

                if(1==authMenuRelationlistMapSize){

                    if(("Y").equals(authMenuRelationlistMap.get(0).get("deleteUseYn"))) {

                    }
                    else {
                        check = false;
                        map.put("msgCode", Constants.FAIL);
                        map.put("msgDesc", "삭제 권한 정보가 없습니다.");
                    }
                }
                else {
                    check = false;
                    map.put("msgCode", Constants.FAIL);
                    map.put("msgDesc", "권한 정보가 없습니다.");
                }
            }

            if(true == check){
                JSONParser jsonParser = new JSONParser();
                JSONArray jsonArray = (JSONArray) jsonParser.parse(String.valueOf(paramMap.get("deleteDataList")));
                for(Object object:jsonArray){
                    JSONObject jsonObject = (JSONObject) object;
                    String categoryCode = (String) jsonObject.get("categoryCode");
                    String categoryItemCode = (String) jsonObject.get("categoryItemCode");
                    HashMap<String, Object> removeDataMap = new HashMap<String, Object>();
                    removeDataMap.put("categoryCode",categoryCode );
                    removeDataMap.put("categoryItemCode",categoryItemCode);
                    removeDataMap.put("modId", paramMap.get("modId"));
                    removeDataMap.put("tId", tId);
                    removeDataMap.put("tDate", tDate);
                    webCategorySqlMapDAO.deleteHospitalOther(removeDataMap);

                }
                map.put("msgCode", Constants.OK);
                map.put("msgDesc", "삭제 되었습니다.");
            }
        }
        catch (Exception e) {
            e.printStackTrace();
            throw e;
        }
        log.debug("WebCategoryServiceImpl updateHospitalOther END");
        return map;
    }
}
