首页>代码>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;
    }

}
最近下载更多
skipple3  LV39 2023年10月25日
烟雨晨风  LV1 2022年11月30日
wy4525  LV6 2022年8月12日
tangjj7260  LV18 2022年4月25日
171337601  LV9 2022年4月18日
shuangcen  LV1 2022年1月4日
没朋友的键盘侠  LV8 2022年1月1日
wanjiale  LV3 2021年9月18日
lironggang  LV38 2021年8月16日
mudingc木钉  LV30 2021年7月7日
最近浏览更多
guaixia163  LV13 4月7日
java小书童  LV17 1月18日
admin_z  LV22 2023年12月22日
XNDIC522 2023年11月6日
暂无贡献等级
skipple3  LV39 2023年10月25日
张朕朕  LV3 2023年9月10日
huangtian  LV3 2023年7月11日
171337601  LV9 2023年6月28日
include  LV8 2023年6月20日
jlmarket  LV22 2023年6月15日
顶部 客服 微信二维码 底部
>扫描二维码关注最代码为好友扫描二维码关注最代码为好友