Authored by wangshusheng

判断acitivityId是否为空

... ... @@ -9,6 +9,7 @@ import org.springframework.web.bind.annotation.ResponseBody;
import com.yoho.activity.queue.ApiResponse;
import com.yoho.activity.queue.service.ILuckyUserService;
import com.yoho.error.exception.ServiceException;
import com.yoho.service.model.activity.drawline.request.ActivityReqBO;
import com.yoho.service.model.activity.drawline.response.LuckyUserBO;
import com.yoho.service.model.activity.drawline.response.PageResponseBO;
... ... @@ -53,7 +54,12 @@ public class LuckyUserRest {
@RequestMapping(params = "method=app.drawline.sendAwardToLuckyUser")
@ResponseBody
public ApiResponse sendAwardToLuckyUser(ActivityReqBO activityReqBO){
logger.info("Enter LuckyUserRest.getLuckyUserList: activityReqBO is {}",activityReqBO);
logger.info("Enter LuckyUserRest.sendAwardToLuckyUser: activityReqBO is {}",activityReqBO);
int activityId = activityReqBO.getActivityId();
if(activityId < 1){
logger.warn("LuckyUserRest.sendAwardToLuckyUser: activityId is null");
throw new ServiceException(400, "activityId is null");
}
String message = "发放成功";
try {
luckyUserService.sendAwardToLuckyUser(activityReqBO);
... ...
... ... @@ -174,16 +174,11 @@ public class LuckyUserServiceImpl implements ILuckyUserService {
luckyUserList = luckyUserDAO.selectLuckyUserList();// 不为空
}else{
int activityId = activityReqBO.getActivityId();
if(activityId < 1){
logger.warn("LuckyUserServiceImpl.getLuckyUserList: activityId is null");
throw new ServiceException(400, "activityId is null");
}else{
// 取出指定活动的中奖记录列表
// 查询中奖用户总数
int total = luckyUserDAO.selectCountByActivityId(activityId);
// 查询drawline_lucky_user表里获取中奖用户列表
luckyUserList = luckyUserDAO.selectByActivityId(activityId, 0, total);
}
// 取出指定活动的中奖记录列表
// 查询中奖用户总数
int total = luckyUserDAO.selectCountByActivityId(activityId);
// 查询drawline_lucky_user表里获取中奖用户列表
luckyUserList = luckyUserDAO.selectByActivityId(activityId, 0, total);
}
if(CollectionUtils.isEmpty(luckyUserList)){
... ...