package itn.let.lett.service.impl; import java.io.File; import java.util.List; import javax.annotation.Resource; import org.springframework.stereotype.Service; import egovframework.rte.fdl.cmmn.EgovAbstractServiceImpl; import egovframework.rte.fdl.idgnr.EgovIdGnrService; import itn.com.cmm.service.FileVO; import itn.com.cmm.service.impl.FileManageDAO; import itn.let.lett.service.CateConfVO; import itn.let.lett.service.HashConfVO; import itn.let.lett.service.LetterService; import itn.let.lett.service.LetterVO; import itn.let.sym.ccm.cde.service.CateCode; import itn.let.uss.umt.service.UserDefaultVO; @Service("LetterService") public class LetterServiceImpl extends EgovAbstractServiceImpl implements LetterService { @Resource(name="LetterDAO") private LetterDAO letterDAO; @Resource(name = "FileManageDAO") private FileManageDAO fileMngDAO; @Resource(name = "egovLetterInfoIdGnrService") private EgovIdGnrService idgenService; public List selectLetterMessageCategoryList() throws Exception{ return letterDAO.selectLetterMessageCategoryList(); } public String insertLetterMessages(LetterVO letterVO) throws Exception{ // 문자등록 고유 아이디 생성하기 String letterId = idgenService.getNextStringId(); letterVO.setLetterId(letterId); letterDAO.insertLetterMessages(letterVO); return letterId; } public List selectLetterMessageList(UserDefaultVO userSearchVO) throws Exception{ return letterDAO.selectLetterMessageList(userSearchVO); } public void deleteLetterMessage(String checkedIdForDel) throws Exception{ String [] delId = checkedIdForDel.split(","); for (int i=0; i selectCateCodeTwoDptWithList(CateCode cateCode) throws Exception{ return letterDAO.selectCateCodeTwoDptWithList(cateCode); } public List selectCateCodeThrDptWithList(CateCode cateCode) throws Exception{ return letterDAO.selectCateCodeThrDptWithList(cateCode); } public List selectPhotoCateCodeWithList(CateCode cateCode) throws Exception{ return letterDAO.selectPhotoCateCodeWithList(cateCode); } public List selectCateConfWithList(String categoryType) throws Exception{ return letterDAO.selectCateConfWithList(categoryType); } public List selectCateConfWithList4Main(String categoryType) throws Exception{ return letterDAO.selectCateConfWithList4Main(categoryType); } public List selectCateConfTwoDepthWithList(String categoryType) throws Exception{ return letterDAO.selectCateConfTwoDepthWithList(categoryType); } public List selectCateConfThreeDepthWithList(CateCode cateCode) throws Exception{ return letterDAO.selectCateConfThreeDepthWithList(cateCode); } public List selectHashTagWithList(String msgType) throws Exception{ return letterDAO.selectHashTagWithList(msgType); } public String insertletterPhotosInfo(LetterVO letterVO) throws Exception{ // 문자등록 고유 아이디 생성하기 String letterId = idgenService.getNextStringId(); letterVO.setLetterId(letterId); letterDAO.insertletterPhotosInfo(letterVO); return letterId; } public List selectLetterPhotosList(UserDefaultVO userSearchVO) throws Exception{ return letterDAO.selectLetterPhotosList(userSearchVO); } public void deleteLetterPhotos(String checkedIdForDel) throws Exception{ // 장/단문 문자 삭제와 동일한 프로세스 처리 String [] delId = checkedIdForDel.split(","); LetterVO letterVO = new LetterVO(); for (int i=0; i selectPhotoCateCodeListWithId(String cateCode) throws Exception{ return letterDAO.selectPhotoCateCodeListWithId(cateCode); } public LetterVO selectPhotosDetail(LetterVO letterVO) throws Exception{ return letterDAO.selectPhotosDetail(letterVO); } public LetterVO selectPhotoFileList(String attchFileId) throws Exception{ return letterDAO.selectPhotoFileList(attchFileId); } public int updateLetterPhotosInfo(LetterVO letterVO) throws Exception{ return letterDAO.updateLetterPhotosInfo(letterVO); } // 문자 발송 카테고리 관리 // 문자 발송 카테고리 정보 저장하기 public int insertCategoryConf(CateConfVO cateConfVO) throws Exception{ return letterDAO.insertCategoryConf(cateConfVO); } public List selectCategoryConfList(UserDefaultVO userSearchVO) throws Exception{ return letterDAO.selectCategoryConfList(userSearchVO); } public CateConfVO categoryConfDetail(CateConfVO cateConfVO) throws Exception{ return letterDAO.categoryConfDetail(cateConfVO); } public void deleteCategoryConf(String checkedIdForDel) throws Exception{ String [] delId = checkedIdForDel.split(","); for (int i=0; i selectHashTagConfList(UserDefaultVO userSearchVO) throws Exception{ return letterDAO.selectHashTagConfList(userSearchVO); } public HashConfVO hashTagConfDetail(HashConfVO hashConfVO) throws Exception{ return letterDAO.hashTagConfDetail(hashConfVO); } public int updateHashTagConf(HashConfVO hashConfVO) throws Exception{ return letterDAO.updateHashTagConf(hashConfVO); } public void deleteHashTagConf(String checkedIdForDel) throws Exception{ String [] delId = checkedIdForDel.split(","); for (int i=0; i selectLetterPhotosCustomList(UserDefaultVO userSearchVO) throws Exception{ return letterDAO.selectLetterPhotosCustomList(userSearchVO); } // 문자 템플릿 사용 계 public int updateTemplateUseCount(String attachFileId) throws Exception{ return letterDAO.updateTemplateUseCount(attachFileId); } @Override public void updateLetterIdgen(int count) throws Exception { for(int i = 0 ; i < count ; i++) { idgenService.getNextStringId(); } } @Override public int updateChkAfterPriorityPlus(LetterVO letterVO) throws Exception { return letterDAO.updateChkAfterPriorityPlus(letterVO); } @Override public int updateChkListPriority(LetterVO letterVO) throws Exception { return letterDAO.updateChkListPriority(letterVO); } @Override public int updateOrderByPriority(LetterVO letterVO) throws Exception { return letterDAO.updateOrderByPriority(letterVO); } @Override public int updateNullPriority(LetterVO letterVO) throws Exception { return letterDAO.updateNullPriority(letterVO); } @Override public int updateChkCateAfterSortPlus(LetterVO letterVO) throws Exception { return letterDAO.updateChkCateAfterSortPlus(letterVO); } @Override public int updateChkCateListSort(LetterVO letterVO) throws Exception { return letterDAO.updateChkCateListSort(letterVO); } @Override public int updateCateOrderBySort(LetterVO letterVO) throws Exception { return letterDAO.updateCateOrderBySort(letterVO); } @Override public int updateCateNullSort(LetterVO letterVO) throws Exception { return letterDAO.updateCateNullSort(letterVO); } @Override public int updateChkTagAfterSortPlus(LetterVO letterVO) throws Exception { return letterDAO.updateChkTagAfterSortPlus(letterVO); } @Override public int updateChkTagListSort(LetterVO letterVO) throws Exception { return letterDAO.updateChkTagListSort(letterVO); } @Override public int updateTagOrderBySort(LetterVO letterVO) throws Exception { return letterDAO.updateTagOrderBySort(letterVO); } @Override public int updateTagNullSort(LetterVO letterVO) throws Exception { return letterDAO.updateTagNullSort(letterVO); } //검색어 욕설 및 금지 단어 검색 @Override public int selectSwearWordSearchCnt(String searchKeyWord) throws Exception{ return letterDAO.selectSwearWordSearchCnt(searchKeyWord); } @Override public int updateSmsTemplateViewCount(String letterId) throws Exception { return letterDAO.updateSmsTemplateViewCount(letterId); } // 제목, 해쉬태그 일괄변경 @Override public int updateHashTagList(LetterVO letterVO) throws Exception { int updateCnt = 0; for(int i = 0; i < letterVO.getLetterIds().size(); i++){ System.out.println(letterVO.getLetterIds().get(i)); letterVO.setLetterId(letterVO.getLetterIds().get(i)); letterVO.setLetterSj(letterVO.getLetterSjs().get(i)); letterVO.setHashTag(letterVO.getHashTags().get(i)); letterDAO.updateHashTagList(letterVO); updateCnt++; } return updateCnt; } // 메인태그 관리 @Override public List selectMainTagList(LetterVO letterVO) throws Exception{ return letterDAO.selectMainTagList(letterVO); } // 메인태그 상세 @Override public LetterVO selectMainTagDetail(LetterVO letterVO) throws Exception { return letterDAO.selectMainTagDetail(letterVO); } // 메인태그 등록 @Override public void insertMainTag(LetterVO letterVO) throws Exception { letterDAO.insertMainTag(letterVO); } // 메인태그 수정 @Override public void updateMainTag(LetterVO letterVO) throws Exception { letterDAO.updateMainTag(letterVO); } @Override public List selectMainTagWebList(LetterVO letterVO) throws Exception{ return letterDAO.selectMainTagWebList(letterVO); } @Override public LetterVO selectFrsKeyword(LetterVO letterVO) throws Exception { return letterDAO.selectFrsKeyword(letterVO); } }