日期:2014-05-17 浏览次数:20948 次
/*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package com.magus.farmgameclient.business.impl;
import com.magus.farmgameclient.business.BaseBusiness;
import com.magus.farmgameclient.constants.G;
import com.magus.farmgameclient.formbeans.TGameUserFormBean;
import com.magus.farmgameclient.models.TGameGivingRecord;
import com.magus.farmgameclient.models.TGameUser;
import com.magus.farmgameclient.models.TGameUserBag;
import com.magus.farmgameclient.services.TGameGivingRecordService;
import com.magus.farmgameclient.services.TGameUserBagService;
import com.magus.farmgameclient.services.TGameUserService;
import com.magus.shframework.helpers.JsonHelper;
import java.util.List;
import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.springframework.stereotype.Component;
/**
*
* @author gaoxiang
*/
@Component("givingRecordBusinessImpl")
public class GivingRecordBusinessImpl implements BaseBusiness{
private static final Log log = LogFactory.getLog(GivingRecordBusinessImpl.class);
@Resource(name = "tGameUserServiceImpl")
private TGameUserService tGameUserService;
@Resource(name = "tGameUserBagServiceImpl")
private TGameUserBagService tGameUserBagService;
@Resource(name = "tGameGivingRecordServiceImpl")
private TGameGivingRecordService tGameGivingRecordService;
@Override
public String process(HttpServletRequest request, TGameUserFormBean userFormBean) {
String jsonString = "";
try{
//判断用户是否存在
TGameUser user = tGameUserService.findById(TGameUser.class, Long.parseLong(userFormBean.getUserId()));
if(user==null){
jsonString = JsonHelper.setRespCodeAndRespMsg(G.RespCodeAndMsg.USER_NOT_EXISTS_CODE,
G.RespCodeAndMsg.USER_NOT_EXISTS_MSG);
return jsonString;
&