首页>代码>springboot+mybatis+Maven+jsp+Quartz整合实战林业厅项目>/ah_lyt/src/main/java/com/ct/ring/action/FrontAction.java
package com.ct.ring.action; import com.ct.ring.dto.Meeting; import com.ct.ring.service.FrontService; import com.ct.ring.service.MeetingService; import com.ct.ring.service.RoomService; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.boot.autoconfigure.EnableAutoConfiguration; import org.springframework.stereotype.Controller; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.ResponseBody; import org.springframework.web.servlet.ModelAndView; import javax.servlet.http.HttpServletRequest; import java.util.ArrayList; import java.util.HashMap; import java.util.List; import java.util.Map; @Controller @EnableAutoConfiguration public class FrontAction { protected static Logger logger = LoggerFactory.getLogger(FrontAction.class); @Autowired private FrontService frontService; @Autowired private RoomService roomService; @Autowired private MeetingService meetingService; @RequestMapping("/") public ModelAndView index ( ) { ModelAndView mv = new ModelAndView( "front/index" ); return mv; } @RequestMapping("/index") public ModelAndView index ( HttpServletRequest request ) { ModelAndView mv = new ModelAndView( "front/index" ); return mv; } @RequestMapping("/getFrontMeeting") @ResponseBody public List<Map> getMeetingPages ( HttpServletRequest request ) { List<Map> twoList = new ArrayList<Map>( ); Map<String, Object> map = new HashMap<String, Object>(); List<Map> currentList=meetingService.getCurrentMeetingNotice(); if(currentList.size()>0){ System.out.println(currentList.get( 0 ).get( "m_name" ).toString()+"------------");//只取一个会议室 List<Map> nextList=meetingService.getNextMeetingNotice(Integer.valueOf( currentList.get( 0 ).get( "sort" ).toString()),Integer.valueOf( currentList.get( 0 ).get( "m_rid" ).toString())); map.put( "current" ,currentList.get( 0 )); if(nextList.size()>0){ map.put( "next" ,nextList.get( 0 )); } } twoList.add( map ); return twoList; } }