|
|
|
@ -1,5 +1,6 @@ |
|
|
|
|
package com.cweb.controller; |
|
|
|
|
|
|
|
|
|
import com.alibaba.fastjson.JSONArray; |
|
|
|
|
import com.alibaba.fastjson.JSONObject; |
|
|
|
|
import com.github.pagehelper.PageInfo; |
|
|
|
|
import com.hai.common.exception.ErrorCode; |
|
|
|
@ -14,10 +15,7 @@ import com.hai.entity.*; |
|
|
|
|
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 com.hai.service.*; |
|
|
|
|
import com.mysql.jdbc.exceptions.jdbc4.MySQLTransactionRollbackException; |
|
|
|
|
import io.swagger.annotations.Api; |
|
|
|
|
import io.swagger.annotations.ApiOperation; |
|
|
|
@ -57,6 +55,9 @@ public class HighActivityController { |
|
|
|
|
@Resource |
|
|
|
|
private HighActivityAwardUserService highActivityAwardUserService; |
|
|
|
|
|
|
|
|
|
@Resource |
|
|
|
|
private HighActivityPrizeService highActivityPrizeService; |
|
|
|
|
|
|
|
|
|
@Resource |
|
|
|
|
private HighActivityUserLotteryNumService highActivityUserLotteryNumService; |
|
|
|
|
|
|
|
|
@ -132,7 +133,24 @@ public class HighActivityController { |
|
|
|
|
if (activity != null) { |
|
|
|
|
Map<String,Object> map = new HashMap<>(); |
|
|
|
|
map.put("activityInfo", activity); |
|
|
|
|
map.put("activityAward", highActivityAwardService.getListByActivityId(MapUtils.getLong(activity, "id"))); |
|
|
|
|
|
|
|
|
|
// 奖励
|
|
|
|
|
JSONArray awardList = JSONArray.parseArray(JSONArray.toJSONString(highActivityAwardService.getListByActivityId(MapUtils.getLong(activity, "id")))); |
|
|
|
|
for (Object awardObject : awardList) { |
|
|
|
|
JSONObject award = (JSONObject) awardObject; |
|
|
|
|
// 查询奖品
|
|
|
|
|
String prizeStr = ""; |
|
|
|
|
List<HighActivityPrize> list = highActivityPrizeService.getListByAwardId(award.getLong("id")); |
|
|
|
|
for (HighActivityPrize prize : list) { |
|
|
|
|
if (StringUtils.isBlank(prizeStr)) { |
|
|
|
|
prizeStr = prize.getPrizeName() +"("+ prize.getPrizeNum() +"张)"; |
|
|
|
|
} else { |
|
|
|
|
prizeStr += "、"+prize.getPrizeName() +"("+ prize.getPrizeNum() +"张)"; |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
award.put("prizeStr", prizeStr); |
|
|
|
|
} |
|
|
|
|
map.put("activityAward", awardList); |
|
|
|
|
return ResponseMsgUtil.success(map); |
|
|
|
|
} |
|
|
|
|
return ResponseMsgUtil.success(null); |
|
|
|
@ -153,7 +171,23 @@ public class HighActivityController { |
|
|
|
|
if (detail != null) { |
|
|
|
|
Map<String,Object> map = new HashMap<>(); |
|
|
|
|
map.put("activityInfo", detail); |
|
|
|
|
map.put("activityAward", highActivityAwardService.getListByActivityId(detail.getId())); |
|
|
|
|
// 奖励
|
|
|
|
|
JSONArray awardList = JSONArray.parseArray(JSONArray.toJSONString(highActivityAwardService.getListByActivityId(activityId))); |
|
|
|
|
for (Object awardObject : awardList) { |
|
|
|
|
JSONObject award = (JSONObject) awardObject; |
|
|
|
|
// 查询奖品
|
|
|
|
|
String prizeStr = ""; |
|
|
|
|
List<HighActivityPrize> list = highActivityPrizeService.getListByAwardId(award.getLong("id")); |
|
|
|
|
for (HighActivityPrize prize : list) { |
|
|
|
|
if (StringUtils.isBlank(prizeStr)) { |
|
|
|
|
prizeStr = prize.getPrizeName() +"("+ prize.getPrizeNum() +"张)"; |
|
|
|
|
} else { |
|
|
|
|
prizeStr += "、"+prize.getPrizeName() +"("+ prize.getPrizeNum() +"张)"; |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
award.put("prizeStr", prizeStr); |
|
|
|
|
} |
|
|
|
|
map.put("activityAward", awardList); |
|
|
|
|
return ResponseMsgUtil.success(map); |
|
|
|
|
} |
|
|
|
|
return ResponseMsgUtil.success(null); |
|
|
|
|