Browse Source

更新文件 advertiseAction.java

陈士柏 2 years ago
parent
commit
fca73f0260
1 changed files with 4 additions and 5 deletions
  1. 4 5
      mhotel/src/com/happy/action/advertiseAction.java

+ 4 - 5
mhotel/src/com/happy/action/advertiseAction.java

@@ -260,12 +260,11 @@ public class advertiseAction extends ActionSupport implements ServletRequestAwar
                 advertise.setTownId(articleTweet.getLocationId());
                 advertise.setTownId(articleTweet.getLocationId());
             }
             }
             if (advertise.getJumpWay().equals("小程序") && advertise.getJumpDirection().equals("民宿") && !advertise.getJumpPoint().equals("首页")){
             if (advertise.getJumpWay().equals("小程序") && advertise.getJumpDirection().equals("民宿") && !advertise.getJumpPoint().equals("首页")){
-                AdminManager adminManager = adminManagerService.getById(Integer.parseInt(advertise.getJumpPoint()));
-                HotelDict hotelDict = hotelDictService.getById(Integer.parseInt(adminManager.getHotelTownship()));
-                advertise.setTownId(hotelDict.getName());
-                List<Hotel> hotelList = hotelService.queryList(" and manager_id='"+adminManager.getId()+"' ");
+                Hotel hotelList = hotelService.getById(Integer.parseInt(advertise.getJumpPoint()));
                 if (hotelList!=null){
                 if (hotelList!=null){
-                    advertise.setJumpPoint(String.valueOf(hotelList.get(0).getId()));
+                    AdminManager adminManager = adminManagerService.getById(hotelList.getManagerId());
+                    HotelDict hotelDict = hotelDictService.getById(Integer.parseInt(adminManager.getHotelTownship()));
+                    advertise.setTownId(hotelDict.getName());
                 }
                 }
             }
             }
             advertise.setCreateTime(TimeExchange.getTime());
             advertise.setCreateTime(TimeExchange.getTime());