From 0c0e19fcb610632d3be8a9916d8d533cee221b2e Mon Sep 17 00:00:00 2001 From: hurui <177768073@qq.com> Date: Thu, 30 Sep 2021 14:33:52 +0800 Subject: [PATCH] =?UTF-8?q?=E6=8F=90=E4=BA=A4=E4=BB=A3=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../controller/HighActivityController.java | 27 +++++++++++++++++ .../HighActivityAwardSerialNumMapperExt.java | 3 +- .../dao/HighActivityAwardUserMapperExt.java | 29 +++++++++++++++++++ .../service/HighActivityAwardUserService.java | 9 ++++++ .../HighActivityAwardUserServiceImpl.java | 5 ++++ 5 files changed, 72 insertions(+), 1 deletion(-) diff --git a/hai-bweb/src/main/java/com/bweb/controller/HighActivityController.java b/hai-bweb/src/main/java/com/bweb/controller/HighActivityController.java index 63bcdffa..629e039f 100644 --- a/hai-bweb/src/main/java/com/bweb/controller/HighActivityController.java +++ b/hai-bweb/src/main/java/com/bweb/controller/HighActivityController.java @@ -1,11 +1,14 @@ package com.bweb.controller; import com.alibaba.fastjson.JSONObject; +import com.github.pagehelper.PageHelper; +import com.github.pagehelper.PageInfo; import com.hai.common.exception.ErrorCode; import com.hai.common.exception.ErrorHelp; import com.hai.common.exception.SysCode; import com.hai.common.security.SessionObject; import com.hai.common.security.UserCenter; +import com.hai.common.utils.PageUtil; import com.hai.common.utils.ResponseMsgUtil; import com.hai.entity.HighActivityAward; import com.hai.entity.HighActivityInfo; @@ -15,6 +18,7 @@ import com.hai.enum_type.ActivityInfoStatus; import com.hai.model.HighUserModel; import com.hai.model.ResponseData; import com.hai.service.HighActivityAwardService; +import com.hai.service.HighActivityAwardUserService; import com.hai.service.HighActivityInfoService; import com.hai.service.HighActivityUserLotteryNumService; import io.swagger.annotations.Api; @@ -50,6 +54,8 @@ public class HighActivityController { @Resource private HighActivityUserLotteryNumService highActivityUserLotteryNumService; + @Resource + private HighActivityAwardUserService highActivityAwardUserService; @RequestMapping(value="/editActivityAward",method = RequestMethod.POST) @ResponseBody @@ -129,5 +135,26 @@ public class HighActivityController { } } + @RequestMapping(value="/getWinLotteryList",method = RequestMethod.GET) + @ResponseBody + @ApiOperation(value = "查询活动中奖记录") + public ResponseData getWinLotteryList(@RequestParam(name = "activityId", required = true) Long activityId, + @RequestParam(name = "userPhone", required = false) String userPhone, + @RequestParam(name = "awardName", required = false) String awardName, + @RequestParam(name = "pageNum", required = true) Integer pageNum, + @RequestParam(name = "pageSize", required = true) Integer pageSize) { + try { + Map param = new HashMap<>(); + param.put("userPhone", userPhone); + param.put("awardName", awardName); + + PageHelper.startPage(pageSize,pageSize); + return ResponseMsgUtil.success(new PageInfo<>(highActivityAwardUserService.getWinLotteryUserList(activityId, param))); + + } catch (Exception e) { + log.error("HighActivityController -> getWinLotteryList() error!",e); + return ResponseMsgUtil.exception(e); + } + } } diff --git a/hai-service/src/main/java/com/hai/dao/HighActivityAwardSerialNumMapperExt.java b/hai-service/src/main/java/com/hai/dao/HighActivityAwardSerialNumMapperExt.java index e92350a5..76b10ea9 100644 --- a/hai-service/src/main/java/com/hai/dao/HighActivityAwardSerialNumMapperExt.java +++ b/hai-service/src/main/java/com/hai/dao/HighActivityAwardSerialNumMapperExt.java @@ -4,4 +4,5 @@ package com.hai.dao; * mapper扩展类 */ public interface HighActivityAwardSerialNumMapperExt { -} \ No newline at end of file + +} diff --git a/hai-service/src/main/java/com/hai/dao/HighActivityAwardUserMapperExt.java b/hai-service/src/main/java/com/hai/dao/HighActivityAwardUserMapperExt.java index 8eb80574..cab40958 100644 --- a/hai-service/src/main/java/com/hai/dao/HighActivityAwardUserMapperExt.java +++ b/hai-service/src/main/java/com/hai/dao/HighActivityAwardUserMapperExt.java @@ -18,4 +18,33 @@ public interface HighActivityAwardUserMapperExt { " ORDER BY a.create_time desc LIMIT 50) a" + " LEFT JOIN high_user b on b.id = a.user_id") List> selectWinLotteryList(@Param("activityId") Long activityId); + + + + /** + * 查询活动中奖的用户 + * @param activityId + * @param param + * @return + */ + @Select("") + List> selectWinLotteryUserList(@Param("activityId") Long activityId, @Param("param") Map param); + } diff --git a/hai-service/src/main/java/com/hai/service/HighActivityAwardUserService.java b/hai-service/src/main/java/com/hai/service/HighActivityAwardUserService.java index ef4b4229..31aa3778 100644 --- a/hai-service/src/main/java/com/hai/service/HighActivityAwardUserService.java +++ b/hai-service/src/main/java/com/hai/service/HighActivityAwardUserService.java @@ -20,4 +20,13 @@ public interface HighActivityAwardUserService { * @return */ List> getWinLotteryList(Long activityId); + + /** + * 查询活动中奖记录 + * @param activityId 活动id + * @param param 参数 + * @return + */ + List> getWinLotteryUserList(Long activityId,Map param); + } diff --git a/hai-service/src/main/java/com/hai/service/impl/HighActivityAwardUserServiceImpl.java b/hai-service/src/main/java/com/hai/service/impl/HighActivityAwardUserServiceImpl.java index c0d5f213..b242a808 100644 --- a/hai-service/src/main/java/com/hai/service/impl/HighActivityAwardUserServiceImpl.java +++ b/hai-service/src/main/java/com/hai/service/impl/HighActivityAwardUserServiceImpl.java @@ -40,4 +40,9 @@ public class HighActivityAwardUserServiceImpl implements HighActivityAwardUserSe public List> getWinLotteryList(Long activityId) { return highActivityAwardUserMapper.selectWinLotteryList(activityId); } + + @Override + public List> getWinLotteryUserList(Long activityId, Map param) { + return highActivityAwardUserMapper.selectWinLotteryUserList(activityId,param); + } }