|
@@ -1,6 +1,7 @@
|
|
|
package com.ym.mec.student.controller;
|
|
|
|
|
|
import com.ym.mec.auth.api.entity.SysUser;
|
|
|
+import com.ym.mec.biz.dal.entity.LuckDrawCount;
|
|
|
import com.ym.mec.biz.dal.entity.LuckDrawLog;
|
|
|
import com.ym.mec.biz.dal.page.LuckDrawQueryInfo;
|
|
|
import com.ym.mec.biz.service.LuckDrawCountService;
|
|
@@ -18,6 +19,8 @@ import org.springframework.web.bind.annotation.PostMapping;
|
|
|
import org.springframework.web.bind.annotation.RequestMapping;
|
|
|
import org.springframework.web.bind.annotation.RestController;
|
|
|
|
|
|
+import java.util.Objects;
|
|
|
+
|
|
|
@Api(tags = "抽奖")
|
|
|
@RestController
|
|
|
@RequestMapping(value = "luckDraw")
|
|
@@ -80,7 +83,14 @@ public class LuckDrawController extends BaseController {
|
|
|
if(groupId.equals(3) && user.getOrganId().equals(4)){
|
|
|
groupId = 4;
|
|
|
}
|
|
|
- return succeed(luckDrawCountService.findByIdAndGroupId(user.getId(),groupId));
|
|
|
+ LuckDrawCount luckDrawCount = luckDrawCountService.findByIdAndGroupId(user.getId(), groupId);
|
|
|
+ if(Objects.isNull(luckDrawCount)){
|
|
|
+ luckDrawCount = new LuckDrawCount();
|
|
|
+ luckDrawCount.setUserId(user.getId().longValue());
|
|
|
+ luckDrawCount.setAvailableCount(0);
|
|
|
+ }
|
|
|
+ luckDrawCount.setHZFlag(user.getOrganId().equals(4));
|
|
|
+ return succeed(luckDrawCount);
|
|
|
}
|
|
|
|
|
|
}
|