From 3ecccf72402b67eeb8744f03b8da44620adf17bf Mon Sep 17 00:00:00 2001 From: Eunsol Lee <73922496+essol2@users.noreply.github.com> Date: Thu, 29 Apr 2021 22:56:17 +0900 Subject: [PATCH 1/6] =?UTF-8?q?[=EB=A7=88=EC=9D=B4=ED=8E=98=EC=9D=B4?= =?UTF-8?q?=EC=A7=80=20=EA=B3=B5=EC=A7=80=EC=82=AC=ED=95=AD=20=EC=A0=84?= =?UTF-8?q?=EB=A9=B4=EC=88=98=EC=A0=95]?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../admin/controller/AdminController.java | 14 +- .../kh/samdado/admin/model/vo/A_board.java | 2 +- .../mypage/controller/MypageController.java | 74 +++- .../samdado/mypage/model/dao/MypageDao.java | 21 + .../mypage/model/dao/MypageDaoImpl.java | 51 ++- .../mypage/model/service/MypageService.java | 21 + .../model/service/MypageServiceImpl.java | 42 ++ .../mypage/model/vo/MpBoardPagination.java | 24 + .../com/kh/samdado/user/model/vo/User.java | 1 + src/main/resources/mappers/mypage_mapper.xml | 68 ++- src/main/resources/mappers/user-mapper.xml | 4 + src/main/webapp/WEB-INF/views/common/main.jsp | 78 ++-- src/main/webapp/WEB-INF/views/common/navi.jsp | 67 ++- .../webapp/WEB-INF/views/common/naviWhite.jsp | 66 ++- .../WEB-INF/views/mypage/mp_UserInfo.jsp | 410 ++---------------- .../webapp/WEB-INF/views/mypage/mp_news.jsp | 172 ++++++-- 16 files changed, 629 insertions(+), 486 deletions(-) create mode 100644 src/main/java/com/kh/samdado/mypage/model/vo/MpBoardPagination.java diff --git a/src/main/java/com/kh/samdado/admin/controller/AdminController.java b/src/main/java/com/kh/samdado/admin/controller/AdminController.java index ccba1979..3559c2d3 100644 --- a/src/main/java/com/kh/samdado/admin/controller/AdminController.java +++ b/src/main/java/com/kh/samdado/admin/controller/AdminController.java @@ -518,13 +518,15 @@ public String sendAboard(A_board aboard, Model model) { int insertAboard = aService.insertAboard(aboard); // -- 은솔 : news에 새로운 공지사항 넣기 - // 1. bno 찾아오기 - int findBno = mService.findNewBno(aboard); +// // 1. bno 찾아오기 +// int findBno = mService.findNewBno(aboard); - aboard.setBno(findBno); - int insertNews = mService.insertNewBoard(aboard); - - if (insertAboard > 0 && insertNews > 0) { +// aboard.setBno(findBno); +// int insertNews = mService.insertNewBoard(aboard); + + int insertNewsUser = mService.updateNewUserNews(aboard); + + if (insertAboard > 0) { //System.out.println("insertAboard 결과 : " + insertAboard); model.addAttribute("msg", "공지글 등록에 성공하였습니다."); return "redirect:/admin/home"; diff --git a/src/main/java/com/kh/samdado/admin/model/vo/A_board.java b/src/main/java/com/kh/samdado/admin/model/vo/A_board.java index b1a1ad31..dae0c5ed 100644 --- a/src/main/java/com/kh/samdado/admin/model/vo/A_board.java +++ b/src/main/java/com/kh/samdado/admin/model/vo/A_board.java @@ -30,5 +30,5 @@ public class A_board { private String bstatus; private String usno; private String uspart; - + private int usnews; } diff --git a/src/main/java/com/kh/samdado/mypage/controller/MypageController.java b/src/main/java/com/kh/samdado/mypage/controller/MypageController.java index 45692dd0..1e9e274c 100644 --- a/src/main/java/com/kh/samdado/mypage/controller/MypageController.java +++ b/src/main/java/com/kh/samdado/mypage/controller/MypageController.java @@ -11,7 +11,6 @@ import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpSession; -import javax.websocket.Session; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.security.crypto.bcrypt.BCryptPasswordEncoder; @@ -29,6 +28,7 @@ import org.springframework.web.servlet.ModelAndView; import org.springframework.web.servlet.mvc.support.RedirectAttributes; +import com.kh.samdado.admin.model.vo.A_board; import com.kh.samdado.business.model.vo.Jjim; import com.kh.samdado.business.model.vo.Review; import com.kh.samdado.business.model.vo.business.Business; @@ -40,6 +40,7 @@ import com.kh.samdado.mypage.model.vo.ApplyPageInfo; import com.kh.samdado.mypage.model.vo.ApplyPagination; import com.kh.samdado.mypage.model.vo.Booking; +import com.kh.samdado.mypage.model.vo.MpBoardPagination; import com.kh.samdado.mypage.model.vo.Point; import com.kh.samdado.mypage.model.vo.QnA; import com.kh.samdado.mypage.model.vo.RouteMP; @@ -71,10 +72,36 @@ public int findNew(@RequestBody User u){ // --은솔 : 새로운 알림 있는지 확인하기 int newNews = mService.findNewNews(u); //System.out.println("mpcontroller newNews : " + newNews); + //int newBoardNews = mService.findNewUserNews(u); + int userNews = u.getUsnews(); + + //System.out.println(newNews); + //System.out.println(userNews); + + + if(newNews > 0 || userNews > 0) { + return 1; + } else { + return 0; + } + + + } + + @RequestMapping("/usernew") + @ResponseBody + public int findNewAlert(@RequestBody User u){ + + //System.out.println("User확인 : " + u); + // --은솔 : 새로운 알림 있는지 확인하기 + //int newNews = mService.findNewUserNews(u); + //System.out.println("mpcontroller newNews : " + newNews); + int newNews = u.getUsnews(); return newNews; } + // 제휴회원 마이페이지로 이동 @GetMapping("/buserinfo") public String mypageBuserFirstView() { @@ -351,12 +378,23 @@ public ModelAndView selectAlertList(ModelAndView mv, User u = (User) session.getAttribute("loginUser"); + // 공지사항 갯수 구하기 + int boardListCount = mService.selectBoardListCount(u.getUspart()); + //System.out.println("공지사항 전체 글 갯수 확인 : " + boardListCount); + + // 요청 페이지에 맞는 게시글 리스트 조회 + ApplyPageInfo api = MpBoardPagination.getApplyPageInfo(currentPage, boardListCount); + // DB에서 가져와야 할 알림 내역들 : 문의하기, 신고 받은 내역, 포인트 충전 알림, 배너광고 신청, 승인, 반려(사유), 포인트 얼마 안남음 // 안읽은 리스트 List alertNList = mService.selectAlertList(u); // 읽은 리스트 List alertYList = mService.selectYAlertList(u); + // 공지사항 + List alertBoard = mService.selectBoard(u, api); + mv.addObject("api", api); + mv.addObject("alertBoard", alertBoard); mv.addObject("alertNList", alertNList); mv.addObject("alertYList", alertYList); mv.setViewName("mypage/mp_news"); @@ -377,6 +415,7 @@ public List selectNewAlertList(@RequestBody User user, // 읽은 리스트 List alertYList = mService.selectYAlertList(u); + // 두개의 리스트 합치기 List newDataList = new ArrayList<>(); @@ -424,17 +463,10 @@ public ModelAndView mypageUserFirstView(ModelAndView mv, //System.out.println(user); - List alertNList = mService.selectAlertList(user); - // 읽은 리스트 - List alertYList = mService.selectYAlertList(user); - - //System.out.println(alertNList); - //System.out.println(alertYList); + // 공지사항 + List alertBoard = mService.selectUserBoard(user); - mv.addObject("alertNList", alertNList); - mv.addObject("alertYList", alertYList); - //mv.addObject("usno", user.getUsno()); - //mv.addObject("uspart",user.getUspart()); + mv.addObject("alertBoard", alertBoard); mv.setViewName("mypage/mp_UserInfo"); return mv; } @@ -1122,4 +1154,24 @@ public String saveFile(MultipartFile file, HttpServletRequest request) { return renameFileName; } + // 공지사항 디테일 가져오기 + @RequestMapping("/alertboardajax") + @ResponseBody + public A_board findBoardAjax(@RequestBody A_board aboard) { + //System.out.println("aboard 확인 : " + aboard); + A_board ab = mService.findThisBoard(aboard); + + int result = 0; + + if(aboard.getUsnews() > 0) { + result = mService.updateUserRead(aboard); + } + + if(ab != null && result > 0) { + return ab; + } else { + return ab; + } + + } } diff --git a/src/main/java/com/kh/samdado/mypage/model/dao/MypageDao.java b/src/main/java/com/kh/samdado/mypage/model/dao/MypageDao.java index 2a186ab6..9b646cc3 100644 --- a/src/main/java/com/kh/samdado/mypage/model/dao/MypageDao.java +++ b/src/main/java/com/kh/samdado/mypage/model/dao/MypageDao.java @@ -195,4 +195,25 @@ public interface MypageDao { // 후기 작성 후 비즈니스에 별점 update public int updateBusStar(Review r); + // 공지사항 등록 시 해당 user의 news +1 해주기 + public int updateNewUserNews(A_board aboard); + + // 내소식에 들어갈 공지사항 리스트 + public List selectBoard(User u, ApplyPageInfo api); + + // 특정 공지사항 가져오기 + public A_board findThisBoard(A_board aboard); + + // 일반회원 새로운 공지사항 있는지 확인 + public int findNewUserNews(User u); + + // 공지사항 읽으면 user -1 해주기 + public int updateUserRead(A_board aboard); + + // 공지사항 갯수 구하기 + public int selectBoardListCout(String uspart); + + // 일반회원 공지사항 가져오기 + public List selectUserBoard(User user); + } diff --git a/src/main/java/com/kh/samdado/mypage/model/dao/MypageDaoImpl.java b/src/main/java/com/kh/samdado/mypage/model/dao/MypageDaoImpl.java index b35f68e9..3e88c2d7 100644 --- a/src/main/java/com/kh/samdado/mypage/model/dao/MypageDaoImpl.java +++ b/src/main/java/com/kh/samdado/mypage/model/dao/MypageDaoImpl.java @@ -56,6 +56,7 @@ public Alert selectDetailAlert(Alert al) { // 알림 nstatus update @Override public int updateNstatus(Alert al) { +// sqlSession.update("mypageMapper.updateUserRead",al.getUsno()); return sqlSession.update("mypageMapper.updateNstatus", al); } @@ -209,6 +210,7 @@ public List selectChartList(AccountBook ab) { // 제휴회원 - QnA 새로운 알림 등록 @Override public int insertQnANews(Alert a) { + //sqlSession.update("mypageMapper.updateUserNewNews", a.getUsno()); return sqlSession.insert("mypageMapper.insertQnANews", a); } @@ -221,6 +223,7 @@ public int findAlno(Alliance a) { // 제휴회원 - Alliance 새로운 알림 등록 @Override public int insertAlliNews(Alert al) { + //sqlSession.update("mypageMapper.updateUserNewNews", al.getUsno()); return sqlSession.insert("mypageMapper.insertAlliNews", al); } @@ -233,6 +236,7 @@ public String findAlliUsno(Alliance alliance) { // 제휴회원 - Alliance 승인시 새로운 알림 등록 @Override public int insertNewApprove(Alert alert) { + //sqlSession.update("mypageMapper.updateUserNewNews", alert.getUsno()); return sqlSession.insert("mypageMapper.insertNewApprove", alert); } @@ -246,6 +250,7 @@ public int updatePbalance(Point po) { // 제휴회원 - Report 승인시 알림 등록 @Override public int insertNewReport(Alert a) { + //sqlSession.update("mypageMapper.updateUserNewNews", a.getUsno()); return sqlSession.insert("mypageMapper.insertNewReport", a); } @@ -270,7 +275,7 @@ public List selectCarBookList(String usno) { // 일반회원 - 내예약 취소 @Override public int deleteBooking(Booking b) { - System.out.println("dao까지는 잘 오니?"); + //System.out.println("dao까지는 잘 오니?"); return sqlSession.delete("mypageMapper.deleteBooking", b); } // 일반회원 - 후기등록 @@ -382,4 +387,48 @@ public int updateBusStar(Review r) { return sqlSession.update("mypageMapper.updateBusStar", r); } + // 공지사항 등록 시 해당 user의 news +1 해주기 + @Override + public int updateNewUserNews(A_board aboard) { + return sqlSession.update("mypageMapper.updateNewUserNews", aboard); + } + + // 내소식에 들어갈 공지사항 리스트 + @Override + public List selectBoard(User u, ApplyPageInfo api) { + int offset = (api.getCurrentPage()-1) * api.getBoardLimit(); + RowBounds rowBounds = new RowBounds(offset, api.getBoardLimit()); + return sqlSession.selectList("mypageMapper.selectBoard", u, rowBounds); + } + + // 특정 공지사항 가져오기 + @Override + public A_board findThisBoard(A_board aboard) { + return sqlSession.selectOne("mypageMapper.findThisBoard", aboard); + } + + // 일반회원 새로운 공지사항 있는지 확인 + @Override + public int findNewUserNews(User u) { + return sqlSession.selectOne("mypageMapper.findNewUserNews", u); + } + + // 공지사항 읽으면 user -1 해주기 + @Override + public int updateUserRead(A_board aboard) { + return sqlSession.update("mypageMapper.updateUserRead", aboard); + } + + // 공지사항 갯수 구하기 + @Override + public int selectBoardListCout(String uspart) { + return sqlSession.selectOne("mypageMapper.selectBoardListCout", uspart); + } + + // 일반회원 공지사항 가져오기 + @Override + public List selectUserBoard(User user) { + return sqlSession.selectList("mypageMapper.selectBoard", user); + } + } diff --git a/src/main/java/com/kh/samdado/mypage/model/service/MypageService.java b/src/main/java/com/kh/samdado/mypage/model/service/MypageService.java index 55ef8f46..782d78dc 100644 --- a/src/main/java/com/kh/samdado/mypage/model/service/MypageService.java +++ b/src/main/java/com/kh/samdado/mypage/model/service/MypageService.java @@ -195,5 +195,26 @@ public interface MypageService { // 후기 작성 후 비즈니스에 별점 update public int updateBusStar(Review r); + // 공지사항 등록 시 해당 user의 news +1 해주기 + public int updateNewUserNews(A_board aboard); + + // 내소식에 들어갈 공지사항 리스트 + public List selectBoard(User u, ApplyPageInfo api); + + // 특정 공지사항 가져오기 + public A_board findThisBoard(A_board aboard); + + // 일반회원 새로운 공지사항 있는지 확인 + public int findNewUserNews(User u); + + // 공지사항 읽으면 user -1 해주기 + public int updateUserRead(A_board aboard); + + // 공지사항 갯수 구하기 + public int selectBoardListCount(String uspart); + + // 일반회원 공지사항 가져오기 + public List selectUserBoard(User user); + } diff --git a/src/main/java/com/kh/samdado/mypage/model/service/MypageServiceImpl.java b/src/main/java/com/kh/samdado/mypage/model/service/MypageServiceImpl.java index 4e1af5a5..c1c5c1de 100644 --- a/src/main/java/com/kh/samdado/mypage/model/service/MypageServiceImpl.java +++ b/src/main/java/com/kh/samdado/mypage/model/service/MypageServiceImpl.java @@ -378,5 +378,47 @@ public int updateBusStar(Review r) { return mDao.updateBusStar(r); } + // 공지사항 등록 시 해당 user의 news +1 해주기 + @Override + public int updateNewUserNews(A_board aboard) { + return mDao.updateNewUserNews(aboard); + } + + // 내소식에 들어갈 공지사항 리스트 + @Override + public List selectBoard(User u,ApplyPageInfo api) { + return mDao.selectBoard(u, api); + } + + // 특정 공지사항 가져오기 + @Override + public A_board findThisBoard(A_board aboard) { + return mDao.findThisBoard(aboard); + } + + // 일반회원 새로운 공지사항 있는지 확인 + @Override + public int findNewUserNews(User u) { + return mDao.findNewUserNews(u); + } + + // 공지사항 읽으면 user -1 해주기 + @Override + public int updateUserRead(A_board aboard) { + return mDao.updateUserRead(aboard); + } + + // 공지사항 갯수 구하기 + @Override + public int selectBoardListCount(String uspart) { + return mDao.selectBoardListCout(uspart); + } + + // 일반회원 공지사항 가져오기 + @Override + public List selectUserBoard(User user) { + return mDao.selectUserBoard(user); + } + } diff --git a/src/main/java/com/kh/samdado/mypage/model/vo/MpBoardPagination.java b/src/main/java/com/kh/samdado/mypage/model/vo/MpBoardPagination.java new file mode 100644 index 00000000..3553f85c --- /dev/null +++ b/src/main/java/com/kh/samdado/mypage/model/vo/MpBoardPagination.java @@ -0,0 +1,24 @@ +package com.kh.samdado.mypage.model.vo; + +public class MpBoardPagination { + // PageInfo 객체를 리턴하는 static 메소드 + public static ApplyPageInfo getApplyPageInfo(int currentPage, int listCount) { + ApplyPageInfo api = null; // 페이지 정보를 담아 줄 PageInfo 참조변수 선언 + + int pageLimit = 3; // 한 페이지에 보여질 페이징바의 갯수 + int boardLimit = 2; // 한 페이지 보여질 게시글 개수 + + int maxPage = (int)Math.ceil((double)listCount / boardLimit); + int startPage = (currentPage - 1) / pageLimit * pageLimit + 1; + int endPage = startPage + pageLimit - 1; + + // 마지막 페이지가 총 페이지 수보다 클 경우 + if(maxPage < endPage) { + endPage = maxPage; + } + + api = new ApplyPageInfo(currentPage, listCount, pageLimit, maxPage, startPage, endPage, boardLimit); + + return api; + } +} diff --git a/src/main/java/com/kh/samdado/user/model/vo/User.java b/src/main/java/com/kh/samdado/user/model/vo/User.java index 03be8b81..eccf9a72 100644 --- a/src/main/java/com/kh/samdado/user/model/vo/User.java +++ b/src/main/java/com/kh/samdado/user/model/vo/User.java @@ -36,6 +36,7 @@ public class User { private String authKey; private int pbalance; private Date enrolldate; + private int usnews; private int upartcount; private String utodate; // 관리자 서치 날짜 포멧팅을 위한 컬럼 diff --git a/src/main/resources/mappers/mypage_mapper.xml b/src/main/resources/mappers/mypage_mapper.xml index 2b103852..2c0478de 100644 --- a/src/main/resources/mappers/mypage_mapper.xml +++ b/src/main/resources/mappers/mypage_mapper.xml @@ -16,6 +16,7 @@ PUBLIC "-//mybatis.org//DTD Mapepr 3.0//EN" + @@ -738,7 +739,7 @@ PUBLIC "-//mybatis.org//DTD Mapepr 3.0//EN" INSERT - INTO NEWS + INTO NEWS ( NNO , US_NO @@ -761,7 +762,7 @@ PUBLIC "-//mybatis.org//DTD Mapepr 3.0//EN" INSERT - INTO NEWS + INTO NEWS ( NNO , US_NO @@ -784,7 +785,7 @@ PUBLIC "-//mybatis.org//DTD Mapepr 3.0//EN" INSERT - INTO NEWS + INTO NEWS ( NNO , US_NO @@ -1228,4 +1229,65 @@ PUBLIC "-//mybatis.org//DTD Mapepr 3.0//EN" SET AVGSTAR = (SELECT AVG(RE_STAR) FROM REVIEW WHERE BUS_CODE = #{bus_code} GROUP BY BUS_CODE) WHERE BUS_CODE = #{bus_code} + + + + UPDATE "USER" + SET USNEWS = USNEWS + 1 + + + UPDATE "USER" + SET USNEWS = USNEWS + 1 + WHERE US_PART = '일반' + + + UPDATE "USER" + SET USNEWS = USNEWS + 1 + WHERE US_PART = '제휴' + + + + UPDATE "USER" + SET USNEWS = USNEWS + 1 + WHERE US_NO = #{usno} + + + UPDATE "USER" + SET USNEWS = USNEWS - 1 + WHERE US_NO = #{usno} + + + + + + + \ No newline at end of file diff --git a/src/main/resources/mappers/user-mapper.xml b/src/main/resources/mappers/user-mapper.xml index 75717ba9..01868c53 100644 --- a/src/main/resources/mappers/user-mapper.xml +++ b/src/main/resources/mappers/user-mapper.xml @@ -19,6 +19,7 @@ PUBLIC "-//mybatis.org//DTD Mapepr 3.0//EN" + @@ -37,6 +38,7 @@ PUBLIC "-//mybatis.org//DTD Mapepr 3.0//EN" , US_STOP , PBALANCE , ENROLL_DATE + , USNEWS FROM "USER" WHERE @@ -61,6 +63,7 @@ PUBLIC "-//mybatis.org//DTD Mapepr 3.0//EN" , US_STATUS , PBALANCE , ENROLL_DATE + , USNEWS ) VALUES ( @@ -76,6 +79,7 @@ PUBLIC "-//mybatis.org//DTD Mapepr 3.0//EN" , DEFAULT , DEFAULT , DEFAULT + , DEFAULT ) diff --git a/src/main/webapp/WEB-INF/views/common/main.jsp b/src/main/webapp/WEB-INF/views/common/main.jsp index a64d9ddd..d2b669cc 100644 --- a/src/main/webapp/WEB-INF/views/common/main.jsp +++ b/src/main/webapp/WEB-INF/views/common/main.jsp @@ -1200,33 +1200,59 @@ diff --git a/src/main/webapp/WEB-INF/views/common/navi.jsp b/src/main/webapp/WEB-INF/views/common/navi.jsp index fd794d50..995694a1 100644 --- a/src/main/webapp/WEB-INF/views/common/navi.jsp +++ b/src/main/webapp/WEB-INF/views/common/navi.jsp @@ -928,32 +928,57 @@ diff --git a/src/main/webapp/WEB-INF/views/common/naviWhite.jsp b/src/main/webapp/WEB-INF/views/common/naviWhite.jsp index 51797a22..7b7bdfba 100644 --- a/src/main/webapp/WEB-INF/views/common/naviWhite.jsp +++ b/src/main/webapp/WEB-INF/views/common/naviWhite.jsp @@ -934,31 +934,57 @@ diff --git a/src/main/webapp/WEB-INF/views/mypage/mp_UserInfo.jsp b/src/main/webapp/WEB-INF/views/mypage/mp_UserInfo.jsp index fc27f0bc..c4853874 100644 --- a/src/main/webapp/WEB-INF/views/mypage/mp_UserInfo.jsp +++ b/src/main/webapp/WEB-INF/views/mypage/mp_UserInfo.jsp @@ -520,56 +520,22 @@
- +
-

새로운 소식이 없습니다!

+

새로운 공지사항이 없습니다!

-

  공지사항

+

  공지사항

- - - - - - - - - - - - - - - - - - - - + + + + + - - - - - - - - - - - - - - - - - - -
new${ab.ntitle}신고접수문의답변포인트배너광고
${ b.bno }${ b.btitle }${ b.bdate}
${ay.nno}${ay.ntitle}신고접수문의답변포인트배너광고
@@ -723,17 +689,8 @@ location.href="${contextPath}/mypage/updateInfo?usno=" + ${loginUser.usno} + "&uspart" + uspart + "&usid=" + usid + "&usemail=" + usemail + "&usphone=" + usphone; } - function detailNAlert(nno){ - var datailList = findDetailAjax(nno); - $("#modalN").fadeIn(); - } - function backBtn(usno){ - var newData = newDataListAjax(usno); - $("#modalN").fadeOut(); - } - - function detailYAlert(nno){ - var datailList = findDetailAjax(nno); + function detailAlert(bno){ + var datailList = findDetailAjax(bno); $("#modalY").fadeIn(); } @@ -742,342 +699,51 @@ }); - function findDetailAjax(nno){ + function findDetailAjax(bno){ //console.log("아작스 전에 nno 확인 : " + nno); - var searchNno = new Object(); - searchNno.nno = nno; + var searchBno = new Object(); + searchBno.bno = bno; + searchBno.usno = ${loginUser.usno}; + searchBno.usnews = ${loginUser.usnews}; + + //console.log("usn = " + ${loginUser.usno}); + //console.log("usnews = " + ${loginUser.usnews}); $.ajax({ - url : "${contextPath}/mypage/detail", - data : JSON.stringify(searchNno), + url : "${contextPath}/mypage/alertboardajax", + data : JSON.stringify(searchBno), type : "post", contentType : "application/json; charset=utf-8", dataType : "json", - success : function(deAlert) { - - if(deAlert.nstatus == 'N'){ - table = $("#modalTable"); - } else if(deAlert.nstatus == 'Y'){ - table = $("#modalYTable"); - } + success : function(data) { + console.log(data); + table = $("#modalYTable"); table.html(""); var tr1 = $(""); var tnno = $("").text("번호 : "); - var tnnoData = $("").text(deAlert.nno); - - - if(deAlert.ncate == 'A' && deAlert.alstatus == 'RI'){ // 배너 광고신청 - 이미지 반려 - var tncate = $("").text("유형 : "); - var tncateData = $("").text(deAlert.ncate + "배너광고 신청 승인 거부 - 이미지"); - - var blankTr = $(""); - var blankTd = $("").text(" "); - - var tr2 = $(""); - var tcontent2 = $("").text("'" + deAlert.bus_name + "' 사업장에 대한 " +deAlert.almessage+"로 인한 배너광고 신청 반려입니다."); - - var tr3 = $(""); - var tcontent3 = $("").text("이는 1. 사진 규격이 일치하지 않거나, 2. 건강하지 못한 내용을 담은 배너 이미지 등록시 발생합니다."); - - var tr4 = $(""); - var tcontent4 = $("").text("배너 이미지 확인 후 다시 신청해주세요!"); - - tr1.append(tnno, tnnoData, tncate, tncateData); - tr2.append(tcontent2); - tr3.append(tcontent3); - tr4.append(tcontent4); - blankTr.append(blankTd); - table.append(tr1, blankTr, tr2, tr3, tr4); - } else if(deAlert.ncate == 'A' && deAlert.alstatus == 'RP'){ // 배너 광고신청 - 포인트 반려 - var tncate = $("").text("유형 : "); - var tncateData = $("").text(deAlert.ncate + "배너광고 신청 승인 거부 - 포인트"); - - var blankTr = $(""); - var blankTd = $("").text(" "); - - var tr2 = $(""); - var tcontent2 = $("").text("'" + deAlert.bus_name + "' 사업장에 대한 " + deAlert.almessage+"로 인한 배너광고 신청 반려입니다."); - - var tr3 = $(""); - var tcontent3 = $("").text("이는 포인트 잔액이 부족하여 발생합니다."); - - var tr4 = $(""); - var tcontent4 = $("").text("내 포인트에서 포인트 충전 후 다시 신청해주세요!"); - - tr1.append(tnno, tnnoData, tncate, tncateData); - tr2.append(tcontent2); - tr3.append(tcontent3); - tr4.append(tcontent4); - blankTr.append(blankTd); - table.append(tr1, blankTr, tr2, tr3, tr4); - } else if(deAlert.ncate == 'A' && deAlert.alstatus == 'Y'){ // 배너 광고신청 - 승인 - var tncate = $("").text("유형 : "); - var tncateData = $("").text(deAlert.ncate + "배너광고 신청 승인"); - - var blankTr = $(""); - var blankTd = $("").text(" "); - - var tr2 = $(""); - var tcontent2 = $("").text(deAlert.bus_name+"의 배너광고가 승인되었습니다!"); - - var asdateFormat = new Date(deAlert.alStartDate); - asdateFormat = getFormatDate(asdateFormat); - - var tr3 = $(""); - var tcontent3 = $("").text(asdateFormat + "에 배너광고가 시작됩니다."); - - var tr4 = $(""); - var tcontent4 = $("").text("삼다도와 함께 번창하세요!!"); - - tr1.append(tnno, tnnoData, tncate, tncateData); - tr2.append(tcontent2); - tr3.append(tcontent3); - tr4.append(tcontent4); - blankTr.append(blankTd); - table.append(tr1, blankTr, tr2, tr3, tr4); - } else if(deAlert.ncate == 'AA'){ // 배너 광고신청 - 신청완료 - var tncate = $("").text("유형 : "); - var tncateData = $("").text(deAlert.ncate + "배너광고 신청 완료"); - - var blankTr = $(""); - var blankTd = $("").text(" "); - - var tr2 = $(""); - var tcontent2 = $("").text("사업장 이름: '" + deAlert.bus_name+"'의 배너광고가 신청되었습니다!"); - - var tr3 = $(""); - var tcontent3 = $("").text("심사 후 결과 발표까지 약 3일 요소 되며 내 소식 페이지를 통해 알림으로 결과를 받으실 수 있습니다."); - - var tr4 = $(""); - var tcontent4 = $("").text("내 소식을 꼭 확인해주세요."); - - tr1.append(tnno, tnnoData, tncate, tncateData); - tr2.append(tcontent2); - tr3.append(tcontent3); - tr4.append(tcontent4); - blankTr.append(blankTd); - table.append(tr1, blankTr, tr2, tr3, tr4); - } else if(deAlert.ncate == 'Q'){ // 문의하기 답변 - var tncate = $("").text("유형 : "); - var tncateData = $("").text(deAlert.ncate + "문의하기"); - - var qdateFormat = new Date(deAlert.qdate); - qdateFormat = getFormatDate(qdateFormat); - - var tr2 = $(""); - var tqdate = $("").text("문의일 : "); - var tqdateData = $("").text(qdateFormat); - - var blankTr = $(""); - var blankTd = $("").text(" "); - - var tr3 = $(""); - var tqcontData = $("").text("문의주신 내용 : " + deAlert.qcont); - - var tr4 = $(""); - var tqreplyData = $("").text("답변 : " + deAlert.qreply); - - tr1.append(tnno, tnnoData, tncate, tncateData); - tr2.append(tqdate, tqdateData); - tr3.append(tqcontData); - tr4.append(tqreplyData); - blankTr.append(blankTd); - table.append(tr1, tr2, blankTr, tr3, tr4); - } else if(deAlert.ncate == 'R' && deAlert.rexdate == null){ // 신고하기 - 접수됨 - var tncate = $("").text("유형 : "); - var tncateData = $("").text(deAlert.ncate + "신고 접수"); - - var rdateFormat = new Date(deAlert.rdate); - rdateFormat = getFormatDate(rdateFormat); - - var tr2 = $(""); - var tqdate = $("").text("신고번호 : "); - var tqdateData = $("").text(deAlert.reno); - var tqcont = $("").text("신고일 : "); - var tqcontData = $("").text(rdateFormat); - - var blankTr = $(""); - var blankTr = $("").text(" "); - - var tr4 = $(""); - var tqreply = $("").text("신고내용 : " + deAlert.bus_code + " 사업장에 대한 신고가 들어왔습니다."); - - var tr5 = $(""); - var tqreplyData = $("").text("신고가 3번 등록되면 7일간 사업장이 정지됩니다. 주의 바랍니다."); - - var tr6 = $(""); - var trimg = $("") - var imgTd = $(""); - - tr1.append(tnno, tnnoData, tncate, tncateData); - tr2.append(tqdate, tqdateData, tqcont, tqcontData); - tr4.append(tqreply); - tr5.append(tqreplyData); - tr6.append(trimg, imgTd); - blankTr.append(blankTd2); - table.append(tr1, tr2, blankTr, tr4, tr5, tr6); - } else if(deAlert.ncate == 'R' && deAlert.rexdate != null){ // 신고하기 - block 됨 - var tncate = $("").text("유형 : "); - var tncateData = $("").text(deAlert.ncate + "사업장 정지"); - - var rdateFormat = new Date(deAlert.rdate); - rdateFormat = getFormatDate(rdateFormat); - - var tr2 = $(""); - var tqdate = $("").text("신고번호 : "); - var tqdateData = $("").text(deAlert.reno); - var tqcont = $("").text("신고일 : "); - var tqcontData = $("").text(rdateFormat); - - var redateFormat = new Date(deAlert.rexdate); - redateFormat = getFormatDate(redateFormat); - - var tr3 = $(""); - var trblockData = $("").text("정지 해제 예정일 : " + redateFormat); - - var blankTr2 = $(""); - var blankTd2 = $("").text(" "); - - var tr4 = $(""); - var tqreply = $("").text("신고내용 : " + deAlert.bus_code + " 사업장에 대한 신고가 들어왔습니다. "); - - var tr5 = $(""); - var tqreplyData = $("").text("신고가 3번 등록되어 해당 사업장은 7일간 정지됩니다. "); - - var tr6 = $(""); - var trimg = $(""); - var imgTd = $(""); - - tr1.append(tnno, tnnoData, tncate, tncateData); - tr2.append(tqdate, tqdateData, tqcont, tqcontData); - tr3.append(trblockData); - tr4.append(tqreply); - tr5.append(tqreplyData); - tr6.append(trimg, imgTd); - blankTr2.append(blankTd2); - table.append(tr1, tr2, blankTr2, tr3, tr4, tr5, tr6); - } else if(deAlert.ncate == 'P'){ // 포인트 얼마남지않음 - var tncate = $("").text("유형 : "); - var tncateData = $("").text(deAlert.ncate + "포인트"); - - var blankTr2 = $(""); - var blankTd2 = $("").text(" "); - - var tr3 = $(""); - var tqcont = $("").text("잔여 포인트는 " + deAlert.pbalance + "입니다."); - - var tr4 = $(""); - var tqreply = $("").text("배너광고를 지속하기 위해서는 포인트 충전이 필요합니다."); - - tr1.append(tnno, tnnoData, tncate, tncateData); - tr3.append(tqcont); - tr4.append(tqreply); - blankTr2.append(blankTd2); - table.append(tr1, blankTr2, tr3, tr4); - } else if(deAlert.ncate == 'B'){ // 공지사항 상세보기 - var tncate = $("").text("유형 : "); - var tncateData = $("").text("공지사항"); - - var blankTr2 = $(""); - var blankTd2 = $("").text(" "); - - var tr3 = $(""); - var tqcont = $("").text("제목 : " + daAlert.btitle); - - var tr4 = $(""); - var tqreply = $("").text(daAlert.bcontent); - - tr1.append(tnno, tnnoData, tncate, tncateData); - tr3.append(tqcont); - tr4.append(tqreply); - blankTr2.append(blankTd2); - table.append(tr1, blankTr2, tr3, tr4); - } - + var tnnoData = $("").text(data.bno); + var tncate = $("").text("유형 : "); + var tncateData = $("").text("공지사항"); - }, - error : function(e) { - alert("error code : " + e.status + "\n" - + "message : " + e.responseText); - } - }); - } - - - function newDataListAjax(usno){ - - var searchUsno = new Object(); - searchUsno.usno = usno; - - $.ajax({ - url : "${contextPath}/mypage/alertajax", - data : JSON.stringify(searchUsno), - type : "post", - contentType : "application/json; charset=utf-8", - dataType : "json", - success : function(data) { + var blankTr2 = $(""); + var blankTd2 = $("").text(" "); - console.log(data); - - table = $("#alertTable"); - table.html(""); + var tr3 = $(""); + var tqcont = $("").text("제목 : " + data.btitle); + var tr4 = $(""); + var tqreply = $("").text(data.bcontent); - for(var i in data){ - - var fNdate = new Date(data[i].ndate); - fNdate = getFormatDate(fNdate); - - - if(data[i].nstatus == 'N'){ - var tr1 = $(""); - var ajnno = $("").text("new"); - var ajntitle = $("").text(data[i].ntitle); - - if(data[i].ncate == 'Q'){ - var ajncate = $("").text("문의답변"); - } else if(data[i].ncate == 'R'){ - var ajncate = $("").text("신고접수"); - } else if(data[i].ncate == 'P'){ - var ajncate = $("").text("포인트"); - } else if(data[i] = 'B'){ - var ajncate = $("").text("공지사항"); - } else{ - var ajncate = $("").text("배너광고"); - } - - var ajndate = $("").text(fNdate); - - tr1.append(ajnno, ajntitle, ajncate, ajndate); - - } else if(data[i].nstatus == 'Y'){ - var tr2 = $(""); - var ajnno = $("").text(data[i].nno); - var ajntitle = $("").text(data[i].ntitle); - - if(data[i].ncate == 'Q'){ - var ajncate = $("").text("문의답변"); - } else if(data[i].ncate == 'R'){ - var ajncate = $("").text("신고접수"); - } else if(data[i].ncate == 'P'){ - var ajncate = $("").text("포인트"); - } else if(data[i] = 'B'){ - var ajncate = $("").text("공지사항"); - } else{ - var ajncate = $("").text("배너광고"); - } - - var ajndate = $("").text(fNdate); - - tr2.append(ajnno, ajntitle, ajncate, ajndate); - } - table.append(tr1, tr2); - } + tr1.append(tnno, tnnoData, tncate, tncateData); + tr3.append(tqcont); + tr4.append(tqreply); + blankTr2.append(blankTd2); + table.append(tr1, blankTr2, tr3, tr4); }, error : function(e) { alert("error code : " + e.status + "\n" @@ -1085,7 +751,7 @@ } }); - } + } diff --git a/src/main/webapp/WEB-INF/views/mypage/mp_news.jsp b/src/main/webapp/WEB-INF/views/mypage/mp_news.jsp index 78211c50..dbe87827 100644 --- a/src/main/webapp/WEB-INF/views/mypage/mp_news.jsp +++ b/src/main/webapp/WEB-INF/views/mypage/mp_news.jsp @@ -115,19 +115,19 @@ margin-left : 3%; } - #alertTable{ + .alertTable{ color : black; /* border : 1px solid blue; */ width : 95%; margin : 3%; } - #alertTable th{ + .alertTable th{ width : 10%; border-top : 1px solid lightgray; border-bottom : 1px solid lightgray; font-size: small; } - #alertTable td{ + .alertTable td{ border-top : 1px solid lightgray; border-bottom : 1px solid lightgray; padding : 3px; @@ -241,9 +241,24 @@ } #alertBox{ - height : 400px; + height : fit-content; + margin : 0; + } + + #userAlert{ + /* border : 1px solid black; */ + height : 200px; overflow : auto; } + + #thisTable{ + margin-top : 0px; + height : 300px + } + + #boardDiv{ + margin : 0; + } @@ -265,11 +280,75 @@
-

내 소식

- +
+

공지사항

+ +
+ + + + + + + + + + + + + + + + + + + + +
${ b.bno }${ b.btitle }${ b.bdate }
공지사항이 없습니다!
+ + + [이전]   + + + + + + [이전]   + + + + + ${ p }   + + + + + + ${ p }   + + + + + [다음] + + + + + + [다음] + +
+
+ + +
+

내 소식

+
+ + @@ -326,6 +405,7 @@
new
+
@@ -383,6 +463,12 @@ $("#modalY").fadeOut(); }); + function detailBAlert(bno){ + var datailList = findBoardDetailAjax(bno); + $("#modalY").fadeIn(); + } + + function findDetailAjax(nno){ @@ -620,25 +706,7 @@ tr4.append(tqreply); blankTr2.append(blankTd2); table.append(tr1, blankTr2, tr3, tr4); - } else if(deAlert.ncate == 'B'){ // 공지사항 상세보기 - var tncate = $("").text("유형 : "); - var tncateData = $("").text("공지사항"); - - var blankTr2 = $(""); - var blankTd2 = $("").text(" "); - - var tr3 = $(""); - var tqcont = $("").text("제목 : " + deAlert.btitle); - - var tr4 = $(""); - var tqreply = $("").text(deAlert.bcontent); - - tr1.append(tnno, tnnoData, tncate, tncateData); - tr3.append(tqcont); - tr4.append(tqreply); - blankTr2.append(blankTd2); - table.append(tr1, blankTr2, tr3, tr4); - } + } @@ -730,6 +798,60 @@ }); } + + function findBoardDetailAjax(bno){ + + //console.log("아작스 전에 nno 확인 : " + nno); + + var searchBno = new Object(); + searchBno.bno = bno; + searchBno.usno = ${loginUser.usno}; + searchBno.usnews = ${loginUser.usnews}; + + //console.log("usn = " + ${loginUser.usno}); + //console.log("usnews = " + ${loginUser.usnews}); + + $.ajax({ + url : "${contextPath}/mypage/alertboardajax", + data : JSON.stringify(searchBno), + type : "post", + contentType : "application/json; charset=utf-8", + dataType : "json", + success : function(data) { + console.log(data); + + table = $("#modalYTable"); + table.html(""); + + var tr1 = $(""); + var tnno = $("").text("번호 : "); + var tnnoData = $("").text(data.bno); + + var tncate = $("").text("유형 : "); + var tncateData = $("").text("공지사항"); + + var blankTr2 = $(""); + var blankTd2 = $("").text(" "); + + var tr3 = $(""); + var tqcont = $("").text("제목 : " + data.btitle); + + var tr4 = $(""); + var tqreply = $("").text(data.bcontent); + + tr1.append(tnno, tnnoData, tncate, tncateData); + tr3.append(tqcont); + tr4.append(tqreply); + blankTr2.append(blankTd2); + table.append(tr1, blankTr2, tr3, tr4); + }, + error : function(e) { + alert("error code : " + e.status + "\n" + + "message : " + e.responseText); + } + + }); + } diff --git a/src/main/webapp/WEB-INF/views/common/navi.jsp b/src/main/webapp/WEB-INF/views/common/navi.jsp index 995694a1..8303b89f 100644 --- a/src/main/webapp/WEB-INF/views/common/navi.jsp +++ b/src/main/webapp/WEB-INF/views/common/navi.jsp @@ -928,9 +928,7 @@ diff --git a/src/main/webapp/WEB-INF/views/common/naviWhite.jsp b/src/main/webapp/WEB-INF/views/common/naviWhite.jsp index 68347912..138a4155 100644 --- a/src/main/webapp/WEB-INF/views/common/naviWhite.jsp +++ b/src/main/webapp/WEB-INF/views/common/naviWhite.jsp @@ -932,11 +932,8 @@ }); - diff --git a/src/main/webapp/WEB-INF/views/mypage/mp_MyRoutes.jsp b/src/main/webapp/WEB-INF/views/mypage/mp_MyRoutes.jsp index fc781c7f..253ca713 100644 --- a/src/main/webapp/WEB-INF/views/mypage/mp_MyRoutes.jsp +++ b/src/main/webapp/WEB-INF/views/mypage/mp_MyRoutes.jsp @@ -15,6 +15,7 @@ +
- +
@@ -288,7 +332,7 @@
<%--

${ rtNum.count }일차.

--%> -

${rt.value[0].route_date}

+

${rt.value[0].route_date}


@@ -349,7 +393,29 @@
+
+ + + +
+
+
+ +
+ + + \ No newline at end of file diff --git a/src/main/webapp/WEB-INF/views/mypage/mp_Wallet.jsp b/src/main/webapp/WEB-INF/views/mypage/mp_Wallet.jsp index f64b8c9d..1032549e 100644 --- a/src/main/webapp/WEB-INF/views/mypage/mp_Wallet.jsp +++ b/src/main/webapp/WEB-INF/views/mypage/mp_Wallet.jsp @@ -531,28 +531,28 @@ arr.push({accClassify:"${item.accClassify}" - , oneTotalSum : "${item.oneTotalSum}"}); + , totalSum : "${item.totalSum}"}); if(arr.length == 1){ for(var j=0; j<5; j++){ - arr.push({accClassify : '', oneTotalSum : 0}); + arr.push({accClassify : '', totalSum : 0}); } } else if(arr.length == 2){ for(var j=0; j<4; j++){ - arr.push({accClassify : '', oneTotalSum : 0}); + arr.push({accClassify : '', totalSum : 0}); } } else if(arr.length == 3){ for(var j=0; j<3; j++){ - arr.push({accClassify : '', oneTotalSum : 0}); + arr.push({accClassify : '', totalSum : 0}); } } else if(arr.length == 4){ for(var j=0; j<2; j++){ - arr.push({accClassify : '', oneTotalSum : 0}); + arr.push({accClassify : '', totalSum : 0}); } } else if(arr.length == 5){ for(var j=0; j<1; j++){ - arr.push({accClassify : '', oneTotalSum : 0}); + arr.push({accClassify : '', totalSum : 0}); } } else{ console.log(arr); @@ -564,7 +564,7 @@ data = { datasets: [{ backgroundColor: ['#40634c', '#467355', '#689978','#88b897','#badbc5', '#c9f5d7'], - data: [arr[0].oneTotalSum, arr[1].oneTotalSum, arr[2].oneTotalSum, arr[3].oneTotalSum,arr[4].oneTotalSum, arr[5].oneTotalSum], + data: [arr[0].totalSum, arr[1].totalSum, arr[2].totalSum, arr[3].totalSum,arr[4].totalSum, arr[5].totalSum], }], labels: [arr[0].accClassify,arr[1].accClassify,arr[2].accClassify,arr[3].accClassify,arr[4].accClassify,arr[5].accClassify] diff --git a/src/main/webapp/WEB-INF/views/mypage/mp_news.jsp b/src/main/webapp/WEB-INF/views/mypage/mp_news.jsp index 88ffe492..4ad91572 100644 --- a/src/main/webapp/WEB-INF/views/mypage/mp_news.jsp +++ b/src/main/webapp/WEB-INF/views/mypage/mp_news.jsp @@ -736,7 +736,7 @@ console.log(data); - table = $("#alertTable"); + table = $("#thisTable"); table.html(""); @@ -757,8 +757,6 @@ var ajncate = $("").text("신고접수"); } else if(data[i].ncate == 'P'){ var ajncate = $("").text("포인트"); - } else if(data[i] = 'B'){ - var ajncate = $("").text("공지사항"); } else{ var ajncate = $("").text("배너광고"); } @@ -778,8 +776,6 @@ var ajncate = $("").text("신고접수"); } else if(data[i].ncate == 'P'){ var ajncate = $("").text("포인트"); - } else if(data[i] = 'B'){ - var ajncate = $("").text("공지사항"); } else{ var ajncate = $("").text("배너광고"); } From 42bf231d1c6fff1f2585428b057e0881e5b8884f Mon Sep 17 00:00:00 2001 From: jh-b1 Date: Fri, 30 Apr 2021 11:34:35 +0900 Subject: [PATCH 6/6] =?UTF-8?q?[=EB=A6=AC=EC=8A=A4=ED=8A=B8=ED=8E=98?= =?UTF-8?q?=EC=9D=B4=EC=A7=80=20=EC=B9=B4=ED=85=8C=EA=B3=A0=EB=A6=AC]?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 기능구현 --- .../controller/businessController.java | 29 +++++- .../business/model/dao/businessDao.java | 2 + .../business/model/dao/businessDaoImpl.java | 12 ++- .../model/service/businessService.java | 2 + .../model/service/businessServiceImpl.java | 12 ++- .../business/model/vo/business/Business.java | 1 + .../resources/mappers/business-mapper.xml | 95 ++++++++++++++++++- .../views/business/hotel/hotel_list.jsp | 72 +++++++------- .../views/business/rentcar/car_list.jsp | 26 ++--- .../business/restaurant/restaurant_list.jsp | 34 ++++--- .../WEB-INF/views/business/tour/tour_list.jsp | 29 +++--- 11 files changed, 239 insertions(+), 75 deletions(-) diff --git a/src/main/java/com/kh/samdado/business/controller/businessController.java b/src/main/java/com/kh/samdado/business/controller/businessController.java index faf33008..cf4deb7f 100644 --- a/src/main/java/com/kh/samdado/business/controller/businessController.java +++ b/src/main/java/com/kh/samdado/business/controller/businessController.java @@ -1084,7 +1084,15 @@ public ModelAndView carList(ModelAndView mv) { } List carList = bService.selectCarList(); - + List reviewList = bService.selectReviewList(); + for(Business t : carList) { + for(Review r : reviewList) { + if(t.getBus_code() == r.getBus_code()) { + t.setAvstar(r.getAvstar()); + t.setRevcnt(r.getRevcnt()); + } + } + } if(carList != null) { mv.addObject("carList", carList); mv.setViewName("business/rentcar/car_list"); @@ -1196,6 +1204,15 @@ public List starList(HttpServletResponse response, @RequestParam Strin //System.out.println(starList); return starList; + } + @RequestMapping(value="starList2", method=RequestMethod.POST) + @ResponseBody + public List starList2(HttpServletResponse response, @RequestParam String kinds) { + + List starList2 = bService.starList2(); + //System.out.println(starList); + return starList2; + } @RequestMapping(value="reviewList", method=RequestMethod.POST) @@ -1208,6 +1225,16 @@ public List reviewList(HttpServletResponse response, @RequestParam Str } + @RequestMapping(value="reviewList2", method=RequestMethod.POST) + @ResponseBody + public List reviewList2(HttpServletResponse response, @RequestParam String kinds) { + + List reviewList2 = bService.reviewList2(); + + return reviewList2; + + } + //찜하기 ajax받기 @RequestMapping("/jjim") @ResponseBody diff --git a/src/main/java/com/kh/samdado/business/model/dao/businessDao.java b/src/main/java/com/kh/samdado/business/model/dao/businessDao.java index 9584882d..51fcdf3f 100644 --- a/src/main/java/com/kh/samdado/business/model/dao/businessDao.java +++ b/src/main/java/com/kh/samdado/business/model/dao/businessDao.java @@ -186,8 +186,10 @@ public interface businessDao { List selectReviewList(); List starList(); + List starList2(); List reviewList(); + List reviewList2(); List facList(String kind); diff --git a/src/main/java/com/kh/samdado/business/model/dao/businessDaoImpl.java b/src/main/java/com/kh/samdado/business/model/dao/businessDaoImpl.java index fe9e3e8a..eef02961 100644 --- a/src/main/java/com/kh/samdado/business/model/dao/businessDaoImpl.java +++ b/src/main/java/com/kh/samdado/business/model/dao/businessDaoImpl.java @@ -441,12 +441,22 @@ public List starList() { // TODO Auto-generated method stub return sqlSession.selectList("businessMapper.starList"); } + @Override + public List starList2() { + // TODO Auto-generated method stub + return sqlSession.selectList("businessMapper.starList2"); + } @Override - public List reviewList( ) { + public List reviewList() { // TODO Auto-generated method stub return sqlSession.selectList("businessMapper.reviewList"); } + @Override + public List reviewList2( ) { + // TODO Auto-generated method stub + return sqlSession.selectList("businessMapper.reviewList2"); + } @Override public List facList(String kind) { diff --git a/src/main/java/com/kh/samdado/business/model/service/businessService.java b/src/main/java/com/kh/samdado/business/model/service/businessService.java index 65c87e48..fcf49d4e 100644 --- a/src/main/java/com/kh/samdado/business/model/service/businessService.java +++ b/src/main/java/com/kh/samdado/business/model/service/businessService.java @@ -180,8 +180,10 @@ public interface businessService { List selectReviewList(); List starList(); + List starList2(); List reviewList(); + List reviewList2(); List facList(String kind); diff --git a/src/main/java/com/kh/samdado/business/model/service/businessServiceImpl.java b/src/main/java/com/kh/samdado/business/model/service/businessServiceImpl.java index 1e793747..d33d6f0d 100644 --- a/src/main/java/com/kh/samdado/business/model/service/businessServiceImpl.java +++ b/src/main/java/com/kh/samdado/business/model/service/businessServiceImpl.java @@ -409,18 +409,28 @@ public List selectReviewList() { // TODO Auto-generated method stub return bDao.selectReviewList(); } - + @Override public List starList() { // TODO Auto-generated method stub return bDao.starList(); } + @Override + public List starList2() { + // TODO Auto-generated method stub + return bDao.starList2(); + } @Override public List reviewList() { // TODO Auto-generated method stub return bDao.reviewList(); } + @Override + public List reviewList2() { + // TODO Auto-generated method stub + return bDao.reviewList2(); + } @Override public List facList(String kind) { diff --git a/src/main/java/com/kh/samdado/business/model/vo/business/Business.java b/src/main/java/com/kh/samdado/business/model/vo/business/Business.java index f1dd02db..8b8e934b 100644 --- a/src/main/java/com/kh/samdado/business/model/vo/business/Business.java +++ b/src/main/java/com/kh/samdado/business/model/vo/business/Business.java @@ -95,5 +95,6 @@ public class Business { private String avstar; private String revcnt; + private int avgstar; } diff --git a/src/main/resources/mappers/business-mapper.xml b/src/main/resources/mappers/business-mapper.xml index f1331d42..0c2eec5e 100644 --- a/src/main/resources/mappers/business-mapper.xml +++ b/src/main/resources/mappers/business-mapper.xml @@ -648,6 +648,7 @@ PUBLIC "-//mybatis.org//DTD Mapepr 3.0//EN" , PRO_ADULT , PRO_YOUTH , PRO_CHILD + , AVGSTAR FROM BUSINESS B, BUSINESS_ATT BT, TOUR_PRODUCT TP WHERE @@ -677,6 +678,7 @@ PUBLIC "-//mybatis.org//DTD Mapepr 3.0//EN" , HOTEL_CATEGORY , BT.FILE_RENAME , BT.FILE_LV + , AVGSTAR FROM BUSINESS B JOIN @@ -740,6 +742,8 @@ PUBLIC "-//mybatis.org//DTD Mapepr 3.0//EN" , BUS_OPENING , BT.FILE_RENAME , BT.FILE_LV + , AVGSTAR + , RES_CATEGORY FROM BUSINESS B JOIN @@ -774,6 +778,7 @@ PUBLIC "-//mybatis.org//DTD Mapepr 3.0//EN" , BUS_OPENING , BT.FILE_RENAME , BT.FILE_LV + , AVGSTAR FROM BUSINESS B JOIN @@ -1412,6 +1417,7 @@ PUBLIC "-//mybatis.org//DTD Mapepr 3.0//EN" , PRO_CHILD , TOUR_TEMA , TOUR_CATEGORY + , AVGSTAR FROM BUSINESS B, BUSINESS_ATT BT, TOUR_PRODUCT TP WHERE @@ -1447,6 +1453,7 @@ PUBLIC "-//mybatis.org//DTD Mapepr 3.0//EN" , BUS_OPENING , BT.FILE_RENAME , BT.FILE_LV + , AVGSTAR FROM BUSINESS B, BUSINESS_ATT BT WHERE @@ -1488,6 +1495,7 @@ PUBLIC "-//mybatis.org//DTD Mapepr 3.0//EN" , PRO_CHILD , TOUR_TEMA , TOUR_CATEGORY + , AVGSTAR FROM BUSINESS B, BUSINESS_ATT BT, TOUR_PRODUCT TP WHERE @@ -1523,6 +1531,7 @@ PUBLIC "-//mybatis.org//DTD Mapepr 3.0//EN" , BT.FILE_RENAME , BT.FILE_LV , HOTEL_CATEGORY + , AVGSTAR FROM BUSINESS B, BUSINESS_ATT BT WHERE @@ -1585,6 +1594,47 @@ PUBLIC "-//mybatis.org//DTD Mapepr 3.0//EN" ORDER BY AVSTAR + + + "; + str += ""; + str += "★"+ data[i].avgstar +" (후기 "+ data[i].revcnt +"개)"; + str += ""+ data[i].hotel_category +""; + str += ""+ data[i].bus_name +""; + str += "" + str += ""; + str += ""; + str += ""; list += str; } @@ -655,25 +656,27 @@ $("#starList").click(function(){ var kinds = $(this).val(); $.ajax({ - url : '${contextPath}/business/starList', + url : '${contextPath}/business/starList2', type : "post", data : {"kinds" : kinds}, success : function(data){ var cate = document.getElementById("secondlist"); var list = ""; for(var i in data){ - if(data[i].bus_category == 'H'){ - str = "
"; - str += ""; - str += "★"+ data[i].avstar +"(후기 "+ data[i].revcnt +"개)"; - str += ""+ data[i].bus_name +""; - str += "
" - str += ""; - str += "
"; - str += "
"; - - list += str; - } + if(data[i].bus_category == 'H'){ + str = "
"; + str += ""; + str += ""; + str += "★"+ data[i].avstar +" (후기 "+ data[i].revcnt +"개)"; + str += ""+ data[i].hotel_category +""; + str += ""+ data[i].bus_name +""; + str += "" + str += ""; + str += ""; + str += "
"; + + list += str; + } } cate.innerHTML=list; }, @@ -690,7 +693,7 @@ var kinds = $(this).val(); $.ajax({ - url : '${contextPath}/business/reviewList', + url : '${contextPath}/business/reviewList2', type : "post", data : {"kinds" : kinds}, success : function(data){ @@ -699,15 +702,17 @@ for(var i in data){ if(data[i].bus_category == 'H'){ str = "
"; + str += ""; str += ""; - str += "★"+ data[i].avstar +"(후기 "+ data[i].revcnt +"개)"; + str += "★"+ data[i].avstar +" (후기 "+ data[i].revcnt +"개)"; + str += ""+ data[i].hotel_category +""; str += ""+ data[i].bus_name +""; - str += "
" - str += ""; - str += "
"; + str += "" + str += ""; + str += ""; str += "
"; - list += str; + list += str; } } cate.innerHTML=list; @@ -733,10 +738,9 @@ - ★4.90(후기 99+개) + ★${ h.avstar }(후기 ${ h.revcnt }개) ${ h.bus_name } - 38,000 ~ 40,000 원 / 박 - 총액 80,000 원 + ${ h.bus_phone } @@ -753,10 +757,10 @@ - ★4.90(후기 99+개) + ★${ h.avstar } (후기 ${ h.revcnt }개) + ${ h.hotel_category } ${ h.bus_name } - 38,000 ~ 40,000 / 박 - 총액 80,000 + ${ h.bus_phone } diff --git a/src/main/webapp/WEB-INF/views/business/rentcar/car_list.jsp b/src/main/webapp/WEB-INF/views/business/rentcar/car_list.jsp index 0f49bc19..be0f7f68 100644 --- a/src/main/webapp/WEB-INF/views/business/rentcar/car_list.jsp +++ b/src/main/webapp/WEB-INF/views/business/rentcar/car_list.jsp @@ -557,8 +557,9 @@ for(var i in data){ str = "
"; str += ""; - str += "★4.90(후기 99+개)"; + str += "★"+ data[i].avgstar +" (후기 "+ data[i].revcnt +"개)"; str += ""+ data[i].bus_name +""; + str += ""+ data[i].bus_phone +""; str += "" str += ""; str += ""; @@ -606,10 +607,10 @@ str += ""; str += "★"+ data[i].avstar +"(후기 "+ data[i].revcnt +"개)"; str += ""+ data[i].bus_name +""; - str += ""+ data[i].tour_tema +" / "+data[i].tour_category +"" - str += "
" - str += ""; - str += "
"; + str += ""+ data[i].bus_phone +""; + str += "" + str += ""; + str += ""; str += "
"; list += str; @@ -643,10 +644,10 @@ str += ""; str += "★"+ data[i].avstar +"(후기 "+ data[i].revcnt +"개)"; str += ""+ data[i].bus_name +""; - str += ""+ data[i].tour_tema +" / "+data[i].tour_category +"" - str += "
" - str += ""; - str += "
"; + str += ""+ data[i].bus_phone +""; + str += "" + str += ""; + str += ""; str += ""; list += str; @@ -675,7 +676,9 @@ - ${ c.bus_name } + ★${ h.avstar } (후기 ${ h.revcnt }개) + ${ c.bus_name } + ${ c.bus_phone } @@ -692,8 +695,9 @@ - ★4.90(후기 99+개) + ★${ h.avstar } (후기 ${ h.revcnt }개) ${ c.bus_name } + ${ c.bus_phone } diff --git a/src/main/webapp/WEB-INF/views/business/restaurant/restaurant_list.jsp b/src/main/webapp/WEB-INF/views/business/restaurant/restaurant_list.jsp index 7d490766..f43cb487 100644 --- a/src/main/webapp/WEB-INF/views/business/restaurant/restaurant_list.jsp +++ b/src/main/webapp/WEB-INF/views/business/restaurant/restaurant_list.jsp @@ -555,7 +555,7 @@ for(var i in data){ str = "
"; str += ""; - str += "★4.90(후기 99+개)"; + str += "★"+ data[i].avgstar +" (후기 "+ data[i].revcnt +"개)"; str += ""+ data[i].bus_name +""; str += ""+ data[i].res_category +""; str += "" @@ -617,9 +617,11 @@ str = "
"; str += ""; str += ""+ data[i].bus_name +""; - str += "
" - str += ""; - str += "
"; + str += ""+ data[i].res_category +""; + str += ""+ data[i].bus_phone +""; + str += "" + str += ""; + str += ""; str += "
"; list += str; @@ -650,10 +652,11 @@ str += ""; str += "★"+ data[i].avstar +"(후기 "+ data[i].revcnt +"개)"; str += ""+ data[i].bus_name +""; - str += ""+ data[i].tour_tema +" / "+data[i].tour_category +"" - str += "
" - str += ""; - str += "
"; + str += ""+ data[i].res_category +""; + str += ""+ data[i].bus_phone +""; + str += "" + str += ""; + str += ""; str += "
"; list += str; @@ -687,10 +690,11 @@ str += ""; str += "★"+ data[i].avstar +"(후기 "+ data[i].revcnt +"개)"; str += ""+ data[i].bus_name +""; - str += ""+ data[i].tour_tema +" / "+data[i].tour_category +"" - str += "
" - str += ""; - str += "
"; + str += ""+ data[i].res_category +""; + str += ""+ data[i].bus_phone +""; + str += "" + str += ""; + str += ""; str += ""; list += str; @@ -719,8 +723,10 @@ - ${ r.bus_name } + ★${ h.avstar } (후기 ${ h.revcnt }개) + ${ r.bus_name } ${ r.res_category } + ${ r.bus_phone } @@ -737,8 +743,10 @@ + ★${ h.avstar } (후기 ${ h.revcnt }개) ${ r.bus_name } ${ r.res_category } + ${ r.bus_phone } diff --git a/src/main/webapp/WEB-INF/views/business/tour/tour_list.jsp b/src/main/webapp/WEB-INF/views/business/tour/tour_list.jsp index dd1a8790..b93beb50 100644 --- a/src/main/webapp/WEB-INF/views/business/tour/tour_list.jsp +++ b/src/main/webapp/WEB-INF/views/business/tour/tour_list.jsp @@ -657,11 +657,12 @@ str = "
"; str += "" str += ""; - str += ""+ data[i].bus_name +""; + str += "★"+ data[i].avgstar +" (후기 "+ data[i].revcnt +"개)"; + str += ""+ data[i].bus_name +""; str += ""+ data[i].tour_tema +" / "+data[i].tour_category +"" - str += "
" - str += ""; - str += "
"; + str += "" + str += ""; + str += ""; str += "
"; list += str; @@ -693,9 +694,9 @@ str += ""; str += ""+ data[i].bus_name +""; str += ""+ data[i].tour_tema +" / "+data[i].tour_category +"" - str += "
" - str += ""; - str += "
"; + str += "" + str += ""; + str += ""; str += ""; list += str; @@ -723,13 +724,14 @@ for(var i in data){ if(data[i].bus_category == 'T'){ str = "
"; + str += ""; str += ""; str += "★"+ data[i].avstar +"(후기 "+ data[i].revcnt +"개)"; str += ""+ data[i].bus_name +""; str += ""+ data[i].tour_tema +" / "+data[i].tour_category +"" - str += "
" - str += ""; - str += "
"; + str += "" + str += ""; + str += ""; str += "
"; list += str; @@ -760,13 +762,14 @@ for(var i in data){ if(data[i].bus_category == 'T'){ str = "
"; + str += ""; str += ""; str += "★"+ data[i].avstar +"(후기 "+ data[i].revcnt +"개)"; str += ""+ data[i].bus_name +""; str += ""+ data[i].tour_tema +" / "+data[i].tour_category +"" - str += "
" - str += ""; - str += "
"; + str += "" + str += ""; + str += ""; str += "
"; list += str;