提交代码

dev-discount
胡锐 3 years ago
parent d5d05b13af
commit 0c0e19fcb6
  1. 27
      hai-bweb/src/main/java/com/bweb/controller/HighActivityController.java
  2. 3
      hai-service/src/main/java/com/hai/dao/HighActivityAwardSerialNumMapperExt.java
  3. 29
      hai-service/src/main/java/com/hai/dao/HighActivityAwardUserMapperExt.java
  4. 9
      hai-service/src/main/java/com/hai/service/HighActivityAwardUserService.java
  5. 5
      hai-service/src/main/java/com/hai/service/impl/HighActivityAwardUserServiceImpl.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<String, Object> 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);
}
}
}

@ -4,4 +4,5 @@ package com.hai.dao;
* mapper扩展类
*/
public interface HighActivityAwardSerialNumMapperExt {
}
}

@ -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<Map<String, Object>> selectWinLotteryList(@Param("activityId") Long activityId);
/**
* 查询活动中奖的用户
* @param activityId
* @param param
* @return
*/
@Select("<script>" +
" select " +
" b.phone userPhone," +
" b.`name` userName," +
" a.`name` awardName," +
" a.create_time winLotteryTime " +
" from " +
" (select a.user_id,b.name,a.create_time from high_activity_award_user a,high_activity_award b" +
" where " +
" a.activity_award_id = b.id " +
" and b.activity_info_id = #{activityId}" +
" <if test='param.awardName != null'> and b.`name` LIKE concat('%',#{param.awardName},'%') </if>" +
" GROUP BY a.id" +
" ORDER BY a.create_time desc) a" +
" LEFT JOIN high_user b on a.user_id = b.id" +
" where 1 = 1" +
" <if test='param.userPhone != null'> and b.phone = #{param.userPhone} </if>" +
"</script>")
List<Map<String, Object>> selectWinLotteryUserList(@Param("activityId") Long activityId, @Param("param") Map<String, Object> param);
}

@ -20,4 +20,13 @@ public interface HighActivityAwardUserService {
* @return
*/
List<Map<String, Object>> getWinLotteryList(Long activityId);
/**
* 查询活动中奖记录
* @param activityId 活动id
* @param param 参数
* @return
*/
List<Map<String,Object>> getWinLotteryUserList(Long activityId,Map<String, Object> param);
}

@ -40,4 +40,9 @@ public class HighActivityAwardUserServiceImpl implements HighActivityAwardUserSe
public List<Map<String, Object>> getWinLotteryList(Long activityId) {
return highActivityAwardUserMapper.selectWinLotteryList(activityId);
}
@Override
public List<Map<String, Object>> getWinLotteryUserList(Long activityId, Map<String, Object> param) {
return highActivityAwardUserMapper.selectWinLotteryUserList(activityId,param);
}
}

Loading…
Cancel
Save