首页>代码>SSM实现小区业主管理系统,支持在线js电子签名>/ssmqmdj/src/main/java/com/red/controller/XqViewController.java
package com.red.controller;
//Create By MyBatisTools

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;

//Create Datetime:2017-11-27 17:11:41
//SpringMVC Controller
//

import java.text.DateFormat;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.Map;
import java.util.HashMap;
import java.util.List;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpSession;

import org.apache.commons.io.IOUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.propertyeditors.CustomDateEditor;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.WebDataBinder;
import org.springframework.web.bind.annotation.InitBinder;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.servlet.ModelAndView;

import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject;
import com.red.entity.XqYh;
import com.red.entity.XqYzqm;
import com.red.service.XqYhService;
import com.red.service.XqYzqmService;
import com.red.util.SysMsg;
import com.red.util.SysUuid;

@Controller
@RequestMapping("/")
public class XqViewController {
	private static Logger log = LoggerFactory.getLogger(XqViewController.class);

	@Autowired
	public XqYzqmService xqYzqmService;
	@Autowired
	public XqYhService xqYhService;

	@RequestMapping(value = "/index")	
	public ModelAndView index(HttpServletRequest request, HttpServletResponse response, HttpSession session) {

		log.info(">>>index>>>");
		// String lmc= request.getAttribute("loginmc").toString();

		session.removeAttribute("loginmc");
		ModelAndView mv = new ModelAndView();
		mv.setViewName("views/index");
		return mv;

	}

	@RequestMapping(value = "/main")	
	public ModelAndView main(HttpServletRequest request, HttpServletResponse response, HttpSession session) {

		log.info(">>>main>>>");
		 
		ModelAndView mv = new ModelAndView();
		mv.setViewName("views/main");
		return mv;

	}
	
	@RequestMapping(value = "/login")	
	public ModelAndView login(HttpServletRequest request, HttpServletResponse response, HttpSession session) {

		log.info(">>>login>>>");
		// String lmc= request.getAttribute("loginmc").toString();

		session.removeAttribute("loginmc");
		ModelAndView mv = new ModelAndView();
		mv.setViewName("views/login");
		return mv;

	}
	
	@RequestMapping(value = "/loginCheck")	
	public ModelAndView loginCheck(HttpServletRequest request, HttpServletResponse response, HttpSession session)
			throws Exception {

		request.setCharacterEncoding("UTF-8");
		response.setCharacterEncoding("UTF-8");

		log.info(">>>loginCheck>>>");
		ModelAndView mv = new ModelAndView();
		try {
			String lmc = request.getParameter("lmc");
			String lmm = request.getParameter("lmm");
			if (lmm != null) {
				Map<String, Object> map = new HashMap<String, Object>();
				map.put("mc", lmc);

				XqYh xpljYh = xqYhService.selectObjByMc(map);
				// System.out.println(lmm);
				// System.out.println(xpljYh.getMm());
				if (xpljYh != null) {
					if (xpljYh.getMm().equals(lmm)) {
						session.setAttribute("loginmc", lmc);
						// mv.setViewName("yzqmCxGrid");
						mv.setViewName("views/main");
					} else {
						mv.setViewName("views/login");
					}
				} else {
					mv.setViewName("veiws/login");
				}

			}
		} catch (Exception e) {
			mv.setViewName("views/login");
			log.error("err", e);
			
		}

		return mv;

	}

	
	@RequestMapping(value = "/yzmdInput")	
	public ModelAndView ywmdInput(HttpServletRequest request, HttpServletResponse response, HttpSession session) {

		log.info(">>>yzmdInput>>>");
 
		ModelAndView mv = new ModelAndView();
		mv.setViewName("views/yzmdInput");
		return mv;

	}
	@RequestMapping(value = "/yzmdCxGrid")	
	public ModelAndView yzmdCxGrid(HttpServletRequest request, HttpServletResponse response, HttpSession session)
			throws Exception {

		request.setCharacterEncoding("UTF-8");
		response.setCharacterEncoding("UTF-8");

		log.info(">>>yzmdCxGrid>>>");
		ModelAndView mv = new ModelAndView();
		try {

			mv.setViewName("views/yzmdCxGrid");

		} catch (Exception e) {
			log.error("err", e);
		}

		return mv;

	}
	
	@RequestMapping(value = "/yzqm")	
	public ModelAndView yzqm(HttpServletRequest request, HttpServletResponse response, HttpSession session) {

		log.info(">>>yzqm>>>");
 
		ModelAndView mv = new ModelAndView();
		mv.setViewName("views/yzqm");
		return mv;

	}
	
	@RequestMapping(value = "/yzqmCxGrid")	 
	public ModelAndView yzqmCxGrid(HttpServletRequest request, HttpServletResponse response, HttpSession session)
			throws Exception {

		request.setCharacterEncoding("UTF-8");
		response.setCharacterEncoding("UTF-8");

		log.info(">>>yzqmCxGrid>>>");
		ModelAndView mv = new ModelAndView();
		try {

			mv.setViewName("views/yzqmCxGrid");

		} catch (Exception e) {
			log.error("err", e);
		}

		return mv;

	}
	
	@RequestMapping(value = "/yzqmCxQmGrid")	 
	public ModelAndView yzqmCxQmGrid(HttpServletRequest request, HttpServletResponse response, HttpSession session)
			throws Exception {

		request.setCharacterEncoding("UTF-8");
		response.setCharacterEncoding("UTF-8");

		log.info(">>>yzqmCxQmGrid>>>");
		ModelAndView mv = new ModelAndView();
		try {

			mv.setViewName("views/yzqmCxQmGrid");

		} catch (Exception e) {
			log.error("err", e);
		}

		return mv;

	}
}
最近下载更多
libo1212  LV8 2023年5月8日
开开  LV2 2023年4月19日
591231555  LV20 2022年4月18日
tangjj7260  LV18 2022年4月6日
1983448992  LV8 2022年2月2日
Luck_ZDM  LV12 2022年1月25日
543666826  LV33 2021年11月18日
最代码-宋家辉  LV61 2021年10月29日
dxadsaf  LV6 2021年10月19日
wanglinddad  LV55 2021年8月19日
最近浏览更多
zouzou123  LV3 10月18日
3334004690  LV10 6月24日
kaxiqq 5月11日
暂无贡献等级
之额着  LV3 4月22日
xiaozhi丶  LV15 4月15日
laishaofe  LV7 1月16日
lilong007  LV22 2023年12月30日
shuangfu  LV25 2023年12月2日
skook7  LV2 2023年11月21日
拜托你仔细听  LV3 2023年9月21日
顶部 客服 微信二维码 底部
>扫描二维码关注最代码为好友扫描二维码关注最代码为好友