package com.iamberry.wechat.handles.drp;

import javax.servlet.http.HttpServletRequest;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;

import com.iamberry.wechat.core.entity.ResultMsg;
import com.iamberry.wechat.core.entity.WechatUtils;
import com.iamberry.wechat.face.drp.PlaceInfoService;
import com.iamberry.wechat.face.drp.PlaceLogsService;
import com.iamberry.wechat.tools.ResultInfo;


/**
 * @description 分销收支统计及其记录表
 * @author 欧阳明
 * @Date 2016-04-20
 */
@Controller
@RequestMapping("/wechat/placeLogs")
public class PlaceLogsHandler {

	@Autowired
	private PlaceLogsService placeLogsService;
	
	@Autowired
	private WechatUtils wechatUtils;
	
	@Autowired
	private PlaceInfoService placeInfoService;
	
	
	//返回处理结果
	 public ResultMsg getSuccessResult(){
		ResultMsg remsg=new ResultMsg();
		remsg.setResultCode(ResultInfo.SUCCESSCODE);
		remsg.setMessage(ResultInfo.SUCCESSINFO);
		remsg.setStatus(true);
		return remsg;
	 }
	 
	//获取openid
	public String getOpenid(HttpServletRequest request){
		try {
			return wechatUtils.getUserBySession(request).getUserOpenid();
		} catch (Exception e) {
			e.printStackTrace();
			return "oaH_GwHQSHd2-KxQpihr_b9Y9lOc";
		}
	}
}
	
