package com.nationalelectric.greenH5;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.UUID;
import javax.annotation.Resource;
import org.codehaus.jackson.map.ObjectMapper;
import org.codehaus.jackson.type.TypeReference;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.jdbc.core.BeanPropertyRowMapper;
import org.springframework.stereotype.Controller;
import org.springframework.transaction.annotation.Transactional;
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.ResponseBody;
import com.jysoft.weChat.util.Wechatconfig;
import com.jysoft.weChat.vo.ContentVo;
import com.nationalelectirc.Constant.Constant;
import com.nationalelectirc.utils.RestResult;
import com.nationalelectric.greenH5.bizc.BaseServiceImpl;
import com.nationalelectric.greenH5.bizc.IGreenGrantAuthBizc;
import com.nationalelectric.greenH5.po.GreenGrantAuth;
import com.nationalelectric.greenH5.po.GreenUserInfo;
import com.nationalelectric.greenH5.po.GreenUserRoleRel;
import com.sgcc.uap.persistence.IHibernateDao;
/**
* 概述:
*
* 功能:
*
* @author chenweikang
*/
@Controller
@RequestMapping("/greenGrantAuth")
public class GreenGrantAuthController extends GreenBaseController {
@Autowired
private BaseServiceImpl BaseService;
/**
* 就餐登记service
*/
@Resource
private IGreenGrantAuthBizc greenGrantAuthBizc;
/**
* HibernateDao逻辑构件
*/
@Autowired
IHibernateDao hibernateDao;
@Autowired
private BaseServiceImpl baseService;
/**
* 查询跨区登记记录
* @param requestBody
* @return
*/
@RequestMapping(value = "/iOpenidGetUserInfo", method = RequestMethod.POST)
@ResponseBody
public RestResult iOpenidGetUserInfo(@RequestBody GreenUserInfo greenUserInfo) {
try {
String openId = greenUserInfo.getWxOpenId();
System.out.println("openIdopenIdopenId---->"+openId);
String sqlByOpenId = "select u.id as \"id\",u.wxOpenId as \"wxOpenId\", '' as \"wxProfile\",u.real_name as \"realName\",u.mobile as \"mobile\",u.face_Pic1 as \"face_Pic1\",u.identityAuth as \"identityAuth\",u.id_card as \"id_card\",u.userLevel as \"userLevel\",u.department_id as \"department_id\","
+ "u.department_name as \"departmentName\",u.org_name as \"orgName\" ,u.org_id as \"orgId\" ,u.gender as \"gender\",u.class_name as \"className\","
+ "u.is_inner as \"isInner\",u.user_status as \"userStatus\",r.role_id as \"role\", "
+ " u.dept_name_url as \"deptNameUrl\",u.dept_ID_url as \"deptIdUrl\" "
+ " from green_user_info u "
+ " left join green_user_role_rel r on u.id = r.user_id "
+ " where u.isc_id = '"+openId+"' AND u.IS_DELETED = 'N'";
List