74a1d524b4c0164a4b92d6f443a8e2fba5f98d14.svn-base 3.2 KB
/**
 * Copyright © 2015-2018 ODM All rights reserved.
 */
package com.thinkgem.jeesite.modules.sys.web;
 
import java.util.Map;

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

import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;

import com.google.common.collect.Maps;
import com.thinkgem.jeesite.common.config.Global;
import com.thinkgem.jeesite.common.persistence.Page;
import com.thinkgem.jeesite.common.utils.StringUtils;
import com.thinkgem.jeesite.common.web.BaseController;
import com.thinkgem.jeesite.modules.reg.entity.base.RegBasePerson;
import com.thinkgem.jeesite.modules.reg.service.bus.RegBusFdcq2Service;
import com.thinkgem.jeesite.modules.sys.entity.RegBusInterHis;
import com.thinkgem.jeesite.modules.sys.po.JudgeDto;
import com.thinkgem.jeesite.modules.sys.service.InterSiService; 
/**
 * 登0录Controller
 * 
 * @author ThinkGem
 * @version 2013-5-31
 */
@Controller
public class InterSiController extends BaseController { 

	@Autowired
	private InterSiService siService;
	
	/**
	 * 管理登录
	 */
	@RequestMapping(value = "${adminPath}/InterSi/{si_type}/{si_code}", method = RequestMethod.POST)
	public void si_post(HttpServletRequest request,@PathVariable String si_code,@PathVariable String si_type, HttpServletResponse response, Model model) {
		Map resmap = Maps.newHashMap(); 
		try{
			String data = request.getParameter("data");
			String interdata = request.getParameter("interdata");
			resmap =  siService.si_post(data, interdata,si_type+"/"+si_code);
			resmap.put("success", "0");
		}catch(Exception e){
			e.printStackTrace();
			resmap.put("success", "1");
			resmap.put("error_msg", e.getMessage());
		} 
		renderString(response, resmap);
	}
	
	@RequiresPermissions("reg:base:regBasePerson:view")
	@RequestMapping(value = {"${adminPath}/InterSi/list"})
	public String list(RegBusInterHis regBusInterHis, HttpServletRequest request, HttpServletResponse response, Model model) {
		System.out.println(regBusInterHis.getPcode()+"****");
 
		Page<RegBusInterHis> page = siService.findPage(new Page<RegBusInterHis>(request, response), regBusInterHis);
		model.addAttribute("page", page);
		model.addAttribute("regBusInterHis", regBusInterHis); 
		model.addAttribute("pcode", regBusInterHis.getPcode()); 
		 
		return "modules/sys/interHisList";
	}
 
	
	/**
	 * 司法裁决
	 */
	@RequestMapping(value = "${adminPath}/{si_type}/judge", method = RequestMethod.POST)
	public void si_judge(HttpServletRequest request,@PathVariable String si_type, HttpServletResponse response, Model model,JudgeDto dto) {
		Map resmap = Maps.newHashMap(); 
		try{
			String data = request.getParameter("data");
			resmap =  siService.ju_post(dto,si_type+"/judge");
			resmap.put("success", "0");
			
		}catch(Exception e){
			e.printStackTrace();
			resmap.put("success", "1");
			resmap.put("error_msg", e.getMessage());
		} 
		renderString(response, resmap);
	}
	
	
}