|
@@ -2,6 +2,7 @@ package com.jpsoft.lotteryActivity.modules.base.controller;
|
|
|
|
|
|
import com.github.pagehelper.Page;
|
|
import com.github.pagehelper.Page;
|
|
import com.jpsoft.lotteryActivity.config.OSSConfig;
|
|
import com.jpsoft.lotteryActivity.config.OSSConfig;
|
|
|
|
+import com.jpsoft.lotteryActivity.modules.base.dto.WinningInfoDTO;
|
|
import com.jpsoft.lotteryActivity.modules.base.entity.ActivityInfo;
|
|
import com.jpsoft.lotteryActivity.modules.base.entity.ActivityInfo;
|
|
import com.jpsoft.lotteryActivity.modules.base.entity.AwardInfo;
|
|
import com.jpsoft.lotteryActivity.modules.base.entity.AwardInfo;
|
|
import com.jpsoft.lotteryActivity.modules.base.entity.LotteryPersonnelInfo;
|
|
import com.jpsoft.lotteryActivity.modules.base.entity.LotteryPersonnelInfo;
|
|
@@ -68,20 +69,29 @@ public class WinningInfoController {
|
|
|
|
|
|
@ApiOperation(value = "添加信息")
|
|
@ApiOperation(value = "添加信息")
|
|
@PostMapping("add")
|
|
@PostMapping("add")
|
|
- public MessageResult<WinningInfo> add(@RequestBody WinningInfo winningInfo, @RequestAttribute String subject) {
|
|
|
|
- MessageResult<WinningInfo> msgResult = new MessageResult<>();
|
|
|
|
|
|
+ public MessageResult<Integer> add(@RequestBody WinningInfoDTO dto, @RequestAttribute String subject) {
|
|
|
|
+ MessageResult<Integer> msgResult = new MessageResult<>();
|
|
|
|
|
|
try {
|
|
try {
|
|
- winningInfo.setId(UUID.randomUUID().toString());
|
|
|
|
- winningInfo.setDelFlag(false);
|
|
|
|
- winningInfo.setCreateBy(subject);
|
|
|
|
- winningInfo.setCreateTime(new Date());
|
|
|
|
|
|
+ List<WinningInfo> winningInfoList = dto.getWinningInfoList();
|
|
|
|
+
|
|
|
|
+ int affectCount = 0;
|
|
|
|
+
|
|
|
|
+ for (WinningInfo winningInfo:winningInfoList) {
|
|
|
|
+ winningInfo.setId(UUID.randomUUID().toString());
|
|
|
|
+ winningInfo.setDelFlag(false);
|
|
|
|
+ winningInfo.setCreateBy(subject);
|
|
|
|
+ winningInfo.setCreateTime(new Date());
|
|
|
|
+ winningInfo.setAwardId(dto.getAwardId());
|
|
|
|
+ winningInfo.setActivityId(dto.getActivityId());
|
|
|
|
+
|
|
|
|
+ affectCount += winningInfoService.insert(winningInfo);
|
|
|
|
+ }
|
|
|
|
|
|
- int affectCount = winningInfoService.insert(winningInfo);
|
|
|
|
|
|
|
|
if (affectCount > 0) {
|
|
if (affectCount > 0) {
|
|
msgResult.setResult(true);
|
|
msgResult.setResult(true);
|
|
- msgResult.setData(winningInfo);
|
|
|
|
|
|
+ msgResult.setData(affectCount);
|
|
} else {
|
|
} else {
|
|
msgResult.setResult(false);
|
|
msgResult.setResult(false);
|
|
msgResult.setMessage("数据库添加失败");
|
|
msgResult.setMessage("数据库添加失败");
|
|
@@ -405,6 +415,7 @@ public class WinningInfoController {
|
|
|
|
|
|
map.put("awardName", awardName);
|
|
map.put("awardName", awardName);
|
|
map.put("awardPrizeName", awardPrizeName);
|
|
map.put("awardPrizeName", awardPrizeName);
|
|
|
|
+ map.put("lotteryPersonnelId", winningInfo.getLotteryPersonnelId());
|
|
|
|
|
|
mapList.add(map);
|
|
mapList.add(map);
|
|
}
|
|
}
|