|
@@ -9,6 +9,7 @@ import org.springframework.beans.factory.annotation.Autowired;
|
|
import org.springframework.web.bind.annotation.*;
|
|
import org.springframework.web.bind.annotation.*;
|
|
|
|
|
|
import java.util.Date;
|
|
import java.util.Date;
|
|
|
|
+import java.util.List;
|
|
|
|
|
|
@RequestMapping("subject")
|
|
@RequestMapping("subject")
|
|
@Api(tags = "科目服务")
|
|
@Api(tags = "科目服务")
|
|
@@ -21,11 +22,7 @@ public class SubjectController extends BaseController {
|
|
@ApiOperation(value = "新增科目")
|
|
@ApiOperation(value = "新增科目")
|
|
@PostMapping("/add")
|
|
@PostMapping("/add")
|
|
public Object add(@RequestBody Subject subject){
|
|
public Object add(@RequestBody Subject subject){
|
|
- Subject subjectByCode = subjectService.findByCode(subject.getCode());
|
|
|
|
- if(subjectByCode != null){
|
|
|
|
- return failed("科目编号已存在,请核查");
|
|
|
|
- }
|
|
|
|
- subjectService.insert(subject);
|
|
|
|
|
|
+ subjectService.addSubject(subject);
|
|
return succeed();
|
|
return succeed();
|
|
}
|
|
}
|
|
|
|
|
|
@@ -39,15 +36,18 @@ public class SubjectController extends BaseController {
|
|
@ApiOperation(value = "修改科目")
|
|
@ApiOperation(value = "修改科目")
|
|
@PutMapping("/update")
|
|
@PutMapping("/update")
|
|
public Object update(@RequestBody Subject subject){
|
|
public Object update(@RequestBody Subject subject){
|
|
- Subject subjectByCode = subjectService.findByCode(subject.getCode());
|
|
|
|
- if(subjectByCode != null && !subjectByCode.getId().equals(subject.getId())){
|
|
|
|
- return failed("科目编号已存在,请核查");
|
|
|
|
- }
|
|
|
|
subject.setUpdateTime(new Date());
|
|
subject.setUpdateTime(new Date());
|
|
subjectService.update(subject);
|
|
subjectService.update(subject);
|
|
return succeed();
|
|
return succeed();
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ @ApiOperation(value = "批量修改科目")
|
|
|
|
+ @PutMapping("/batchUpdate")
|
|
|
|
+ public Object batchUpdate(@RequestBody List<Subject> subjects){
|
|
|
|
+ subjectService.batchUpdate(subjects);
|
|
|
|
+ return succeed();
|
|
|
|
+ }
|
|
|
|
+
|
|
@ApiOperation(value = "根据科目编号查询科目")
|
|
@ApiOperation(value = "根据科目编号查询科目")
|
|
@GetMapping("/get/{id}")
|
|
@GetMapping("/get/{id}")
|
|
public Object get(@ApiParam(value = "科目编号", required = true) @PathVariable("id") Integer id){
|
|
public Object get(@ApiParam(value = "科目编号", required = true) @PathVariable("id") Integer id){
|
|
@@ -67,9 +67,9 @@ public class SubjectController extends BaseController {
|
|
}
|
|
}
|
|
|
|
|
|
@ApiOperation(value = "通过乐团编号查询乐团科目规划")
|
|
@ApiOperation(value = "通过乐团编号查询乐团科目规划")
|
|
- @PostMapping("/querySubByMusicGroupId")
|
|
|
|
|
|
+ @GetMapping("/querySubByMusicGroupId")
|
|
@ApiImplicitParams({ @ApiImplicitParam(name = "musicGroupId", value = "乐团编号", required = true, dataType = "Integer")})
|
|
@ApiImplicitParams({ @ApiImplicitParam(name = "musicGroupId", value = "乐团编号", required = true, dataType = "Integer")})
|
|
- public Object findSubByMusicGroupId(@RequestBody Integer musicGroupId){
|
|
|
|
|
|
+ public Object findSubByMusicGroupId(@RequestParam Integer musicGroupId){
|
|
return succeed(subjectService.findSubByMusicGroupId(musicGroupId));
|
|
return succeed(subjectService.findSubByMusicGroupId(musicGroupId));
|
|
}
|
|
}
|
|
|
|
|
|
@@ -83,7 +83,7 @@ public class SubjectController extends BaseController {
|
|
@ApiOperation(value = "通过乐团编号获取声部列表以及声部报名、缴费、计划人数")
|
|
@ApiOperation(value = "通过乐团编号获取声部列表以及声部报名、缴费、计划人数")
|
|
@GetMapping("/findSubApplyDetail")
|
|
@GetMapping("/findSubApplyDetail")
|
|
@ApiImplicitParams({ @ApiImplicitParam(name = "musicGroupId", value = "乐团编号", required = true, dataType = "Integer")})
|
|
@ApiImplicitParams({ @ApiImplicitParam(name = "musicGroupId", value = "乐团编号", required = true, dataType = "Integer")})
|
|
- public Object findSubApplyDetail(@RequestBody Integer musicGroupId){
|
|
|
|
|
|
+ public Object findSubApplyDetail(@RequestParam Integer musicGroupId){
|
|
return succeed(subjectService.findSubApplyDetail(musicGroupId));
|
|
return succeed(subjectService.findSubApplyDetail(musicGroupId));
|
|
}
|
|
}
|
|
}
|
|
}
|