Skip to content

Commit

Permalink
Merge branch 'demo' into #450
Browse files Browse the repository at this point in the history
  • Loading branch information
han1208a authored Apr 30, 2021
2 parents b561745 + 458b798 commit 10026a1
Show file tree
Hide file tree
Showing 40 changed files with 1,197 additions and 683 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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 && insertNewsUser > 0) {
//System.out.println("insertAboard 결과 : " + insertAboard);
model.addAttribute("msg", "공지글 등록에 성공하였습니다.");
return "redirect:/admin/home";
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/com/kh/samdado/admin/model/vo/A_board.java
Original file line number Diff line number Diff line change
Expand Up @@ -30,5 +30,5 @@ public class A_board {
private String bstatus;
private String usno;
private String uspart;

private int usnews;
}
Original file line number Diff line number Diff line change
Expand Up @@ -1084,7 +1084,15 @@ public ModelAndView carList(ModelAndView mv) {
}

List<Business> carList = bService.selectCarList();

List<Review> 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");
Expand All @@ -1095,10 +1103,10 @@ public ModelAndView carList(ModelAndView mv) {
// 예약결제 성공 시 insert

@GetMapping("/pay")
public String payBtn(@ModelAttribute Income i, @ModelAttribute Booking b, @ModelAttribute Point p, int bus_code) {
public String payBtn(@ModelAttribute Income i, @ModelAttribute Booking b, @ModelAttribute Point p, int bus_code, User u) {

// 포인트에 amount 넣어주기
p.setPamount(i.getAmount());
p.setPamount(i.getAmount() * 9/10);

// income에 들어갈 원가 10퍼센트 셋팅
i.setAmount(i.getAmount() * 1/10);
Expand All @@ -1119,7 +1127,12 @@ public String payBtn(@ModelAttribute Income i, @ModelAttribute Booking b, @Model
p.setPbalance(i.getAmount() * 9);
}
// 포인트 넣기
int point = bService.insertPoint(p);
int point = bService.insertPoint(p);

// User테이블 pbalance에 추가하기
u.setUsno(selectUser.getUs_no());
u.setPbalance(p.getPbalance());
int userPbalance = bService.updateUserPblance(u);

// 예약정보 insert
if(b.getBookingLv() == 1) {
Expand Down Expand Up @@ -1196,6 +1209,15 @@ public List<Business> starList(HttpServletResponse response, @RequestParam Strin
//System.out.println(starList);
return starList;

}
@RequestMapping(value="starList2", method=RequestMethod.POST)
@ResponseBody
public List<Business> starList2(HttpServletResponse response, @RequestParam String kinds) {

List<Business> starList2 = bService.starList2();
//System.out.println(starList);
return starList2;

}

@RequestMapping(value="reviewList", method=RequestMethod.POST)
Expand All @@ -1208,6 +1230,16 @@ public List<Business> reviewList(HttpServletResponse response, @RequestParam Str

}

@RequestMapping(value="reviewList2", method=RequestMethod.POST)
@ResponseBody
public List<Business> reviewList2(HttpServletResponse response, @RequestParam String kinds) {

List<Business> reviewList2 = bService.reviewList2();

return reviewList2;

}

//찜하기 ajax받기
@RequestMapping("/jjim")
@ResponseBody
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -136,6 +136,8 @@ public interface businessDao {
int insertPoint(Point p);

public Point findPoint(Point p);

int updateUserPblance(User u);

// 비즈니스 등록 폼, 본인이 등록한 사업장 셀렉
List<Business> selectMyBusinessCategory(User loginUser);
Expand Down Expand Up @@ -186,8 +188,10 @@ public interface businessDao {
List<Review> selectReviewList();

List<Business> starList();
List<Business> starList2();

List<Business> reviewList();
List<Business> reviewList2();

List<Business> facList(String kind);

Expand All @@ -211,6 +215,8 @@ public interface businessDao {








Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -260,6 +260,11 @@ public int insertPoint(Point p) {
public Point findPoint(Point p) {
return sqlSession.selectOne("businessMapper.findPoint", p);
}

@Override
public int updateUserPblance(User u) {
return sqlSession.update("businessMapper.updateUserPblance", u);
}

@Override
public List<Business> businessSearch() {
Expand Down Expand Up @@ -441,12 +446,22 @@ public List<Business> starList() {
// TODO Auto-generated method stub
return sqlSession.selectList("businessMapper.starList");
}
@Override
public List<Business> starList2() {
// TODO Auto-generated method stub
return sqlSession.selectList("businessMapper.starList2");
}

@Override
public List<Business> reviewList( ) {
public List<Business> reviewList() {
// TODO Auto-generated method stub
return sqlSession.selectList("businessMapper.reviewList");
}
@Override
public List<Business> reviewList2( ) {
// TODO Auto-generated method stub
return sqlSession.selectList("businessMapper.reviewList2");
}

@Override
public List<Business> facList(String kind) {
Expand All @@ -467,5 +482,7 @@ public List<Business> rescateList(String kind) {






}
Original file line number Diff line number Diff line change
Expand Up @@ -137,6 +137,8 @@ public interface businessService {
int insertPoint(Point p);

public Point findPoint(Point p);

int updateUserPblance(User u);

// 배너 광고 등록 폼, 본인 사업장 가져오기
List<Business> selectMyBusinessCategory(User loginUser);
Expand Down Expand Up @@ -180,8 +182,10 @@ public interface businessService {
List<Review> selectReviewList();

List<Business> starList();
List<Business> starList2();

List<Business> reviewList();
List<Business> reviewList2();

List<Business> facList(String kind);

Expand Down Expand Up @@ -215,6 +219,8 @@ public interface businessService {








Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -255,6 +255,11 @@ public Point findPoint(Point p) {
// TODO Auto-generated method stub
return bDao.findPoint(p);
}

@Override
public int updateUserPblance(User u) {
return bDao.updateUserPblance(u);
}

// 지혜
@Override
Expand Down Expand Up @@ -409,18 +414,28 @@ public List<Review> selectReviewList() {
// TODO Auto-generated method stub
return bDao.selectReviewList();
}

@Override
public List<Business> starList() {
// TODO Auto-generated method stub
return bDao.starList();
}
@Override
public List<Business> starList2() {
// TODO Auto-generated method stub
return bDao.starList2();
}

@Override
public List<Business> reviewList() {
// TODO Auto-generated method stub
return bDao.reviewList();
}
@Override
public List<Business> reviewList2() {
// TODO Auto-generated method stub
return bDao.reviewList2();
}

@Override
public List<Business> facList(String kind) {
Expand Down Expand Up @@ -451,6 +466,8 @@ public List<Business> rescateList(String kind) {








Expand Down
1 change: 1 addition & 0 deletions src/main/java/com/kh/samdado/business/model/vo/Jjim.java
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ public class Jjim {
private String bus_opening;
private String hotel_facility;
private String usname; // user 테이블 조인
private String avstar;

//BUSINNESS_ATT JOINs
private String file_rename; // 리네임
Expand Down
2 changes: 2 additions & 0 deletions src/main/java/com/kh/samdado/business/model/vo/Review.java
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@ US_NO VARCHAR2(15 BYTE)
private Date c_booking_trv;
private int rent_no;
private int c_bus_code;
private Date c_booking_trvEnd;

private int r_booking_no;
private String r_bus_name;
Expand All @@ -78,6 +79,7 @@ US_NO VARCHAR2(15 BYTE)
private Date r_booking_trv;
private int room_no;
private int r_bus_code;
private Date r_booking_trvEnd;

private int t_booking_no; // 예약번호
private String t_bus_name; // 사업장이름
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -95,5 +95,6 @@ public class Business {

private String avstar;
private String revcnt;
private int avgstar;

}
Loading

0 comments on commit 10026a1

Please sign in to comment.