|
|
@@ -72,18 +72,31 @@ public class StartLotteryController {
|
|
|
|
|
|
@ApiOperation(value = "列表")
|
|
|
@RequestMapping(value = "findByActivityId", method = RequestMethod.POST)
|
|
|
- public MessageResult<List<AwardInfo>> findByActivityId(String activityId, HttpServletRequest request) {
|
|
|
+ public MessageResult<Map> findByActivityId(String activityId, HttpServletRequest request) {
|
|
|
String subject = (String) request.getAttribute("subject");
|
|
|
|
|
|
//当前用户ID
|
|
|
System.out.println(subject);
|
|
|
|
|
|
- MessageResult<List<AwardInfo>> msgResult = new MessageResult<>();
|
|
|
+ MessageResult<Map> msgResult = new MessageResult<>();
|
|
|
+
|
|
|
+ Map map = new HashMap();
|
|
|
+
|
|
|
+ ActivityInfo activityInfo = activityInfoService.get(activityId);
|
|
|
+
|
|
|
+ String activityName = "";
|
|
|
+
|
|
|
+ if (activityInfo != null) {
|
|
|
+ activityName = activityInfo.getName();
|
|
|
+ }
|
|
|
|
|
|
List<AwardInfo> awardInfoList = awardInfoService.findByActivityId(activityId);
|
|
|
|
|
|
+ map.put("activityName",activityName);
|
|
|
+ map.put("awardInfoList",awardInfoList);
|
|
|
+
|
|
|
msgResult.setResult(true);
|
|
|
- msgResult.setData(awardInfoList);
|
|
|
+ msgResult.setData(map);
|
|
|
|
|
|
return msgResult;
|
|
|
}
|
|
|
@@ -116,11 +129,13 @@ public class StartLotteryController {
|
|
|
phone = desensitizePhone(lotteryPersonnelInfo.getPhone());
|
|
|
}
|
|
|
winningInfo.setLotteryPersonnelPhone(phone);
|
|
|
+ winningInfo.setLotteryPersonnelNickName(lotteryPersonnelInfo.getNickName());
|
|
|
winningInfo.setLotteryPersonnelImage(lotteryPersonnelInfo.getImage());
|
|
|
}
|
|
|
}
|
|
|
|
|
|
map.put("name", awardInfo.getName());
|
|
|
+ map.put("prizeName", awardInfo.getPrizeName());
|
|
|
map.put("num", winningInfoList.size());
|
|
|
map.put("winningInfoList", winningInfoList);
|
|
|
|
|
|
@@ -162,9 +177,9 @@ public class StartLotteryController {
|
|
|
}
|
|
|
|
|
|
|
|
|
- @ApiOperation(value="获取信息")
|
|
|
+ @ApiOperation(value = "获取信息")
|
|
|
@GetMapping("edit/{id}")
|
|
|
- public MessageResult<AwardInfo> edit(@PathVariable("id") String id){
|
|
|
+ public MessageResult<AwardInfo> edit(@PathVariable("id") String id) {
|
|
|
MessageResult<AwardInfo> msgResult = new MessageResult<>();
|
|
|
|
|
|
try {
|
|
|
@@ -172,7 +187,7 @@ public class StartLotteryController {
|
|
|
|
|
|
if (awardInfo != null) {
|
|
|
ActivityInfo activityInfo = activityInfoService.get(awardInfo.getActivityId());
|
|
|
- if(activityInfo!=null){
|
|
|
+ if (activityInfo != null) {
|
|
|
awardInfo.setActivityName(activityInfo.getName());
|
|
|
}
|
|
|
|
|
|
@@ -204,9 +219,8 @@ public class StartLotteryController {
|
|
|
msgResult.setResult(false);
|
|
|
msgResult.setMessage("数据库不存在该记录!");
|
|
|
}
|
|
|
- }
|
|
|
- catch(Exception ex){
|
|
|
- logger.error(ex.getMessage(),ex);
|
|
|
+ } catch (Exception ex) {
|
|
|
+ logger.error(ex.getMessage(), ex);
|
|
|
|
|
|
msgResult.setResult(false);
|
|
|
msgResult.setMessage(ex.getMessage());
|
|
|
@@ -216,15 +230,14 @@ public class StartLotteryController {
|
|
|
}
|
|
|
|
|
|
|
|
|
-
|
|
|
@ApiOperation(value = "开始抽奖")
|
|
|
@PostMapping("startLotteryAward")
|
|
|
- public MessageResult<List<Map>> startLotteryAward(String activityId,String awardId) {
|
|
|
+ public MessageResult<List<Map>> startLotteryAward(String activityId, String awardId) {
|
|
|
MessageResult<List<Map>> msgResult = new MessageResult<>();
|
|
|
|
|
|
try {
|
|
|
|
|
|
- List<WinningInfo> winningInfoList = winningInfoService.startLottery(activityId,awardId);
|
|
|
+ List<WinningInfo> winningInfoList = winningInfoService.startLottery(activityId, awardId);
|
|
|
|
|
|
List<Map> mapList = new ArrayList<>();
|
|
|
|
|
|
@@ -285,7 +298,6 @@ public class StartLotteryController {
|
|
|
}
|
|
|
|
|
|
|
|
|
-
|
|
|
@ApiOperation(value = "导出")
|
|
|
@RequestMapping(value = "exportExcel", method = RequestMethod.POST)
|
|
|
public MessageResult<Object> exportExcel(String activityId, HttpServletRequest request) {
|
|
|
@@ -411,7 +423,6 @@ public class StartLotteryController {
|
|
|
}
|
|
|
|
|
|
|
|
|
-
|
|
|
private String desensitizePhone(String phone) {
|
|
|
if (phone == null || phone.length() != 11) {
|
|
|
return phone; // 非11位手机号不处理
|