|
@@ -14,6 +14,8 @@ import io.swagger.annotations.ApiOperation;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.web.bind.annotation.*;
|
|
|
|
|
|
+import java.util.Date;
|
|
|
+
|
|
|
@RequestMapping("register")
|
|
|
@Api(tags = "乐团注册")
|
|
|
@RestController
|
|
@@ -30,6 +32,7 @@ public class MusicGroupRegisterController extends BaseController {
|
|
|
@ApiOperation(value = "新增学生报名信息")
|
|
|
@PostMapping("/add")
|
|
|
public HttpResponseResult add(@RequestBody StudentRegistration studentRegistration) {
|
|
|
+ Date date = new Date();
|
|
|
MusicGroup musicGroup = musicGroupService.get(studentRegistration.getMusicGroupId());
|
|
|
if (musicGroup == null) {
|
|
|
return failed("乐团信息不存在");
|
|
@@ -38,6 +41,9 @@ public class MusicGroupRegisterController extends BaseController {
|
|
|
if (hasReg != null) {
|
|
|
return failed("该乐团您已注册");
|
|
|
}
|
|
|
+ if (musicGroup.getApplyExpireDate().compareTo(date) <= 0) {
|
|
|
+ return failed("乐团已截止报名");
|
|
|
+ }
|
|
|
studentRegistration.setOrganId(musicGroup.getOrganId());
|
|
|
return succeed(studentRegistrationService.addStudent(studentRegistration));
|
|
|
}
|