|
@@ -2,6 +2,7 @@ package com.ym.mec.web.controller;
|
|
|
|
|
|
import com.ym.mec.common.controller.BaseController;
|
|
import com.ym.mec.common.controller.BaseController;
|
|
import com.ym.mec.web.dal.entity.Subject;
|
|
import com.ym.mec.web.dal.entity.Subject;
|
|
|
|
+import com.ym.mec.web.dal.page.GoodsQueryInfo;
|
|
import com.ym.mec.web.dal.page.SubjectQueryInfo;
|
|
import com.ym.mec.web.dal.page.SubjectQueryInfo;
|
|
import com.ym.mec.web.service.SubjectService;
|
|
import com.ym.mec.web.service.SubjectService;
|
|
import io.swagger.annotations.*;
|
|
import io.swagger.annotations.*;
|
|
@@ -9,6 +10,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 = "科目服务")
|
|
@@ -18,33 +20,10 @@ public class SubjectController extends BaseController {
|
|
@Autowired
|
|
@Autowired
|
|
private SubjectService subjectService;
|
|
private SubjectService subjectService;
|
|
|
|
|
|
- @ApiOperation(value = "新增科目")
|
|
|
|
- @PostMapping("/add")
|
|
|
|
- public Object add(@RequestBody Subject subject){
|
|
|
|
- Subject subjectByCode = subjectService.findByCode(subject.getCode());
|
|
|
|
- if(subjectByCode != null){
|
|
|
|
- return failed("科目编号已存在,请核查");
|
|
|
|
- }
|
|
|
|
- subjectService.insert(subject);
|
|
|
|
- return succeed();
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- @ApiOperation(value = "删除科目")
|
|
|
|
- @DeleteMapping("/del/{id}")
|
|
|
|
- public Object del(@ApiParam(value = "科目编号", required = true) @PathVariable("id") Integer id){
|
|
|
|
- subjectService.delete(id);
|
|
|
|
- return succeed();
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- @ApiOperation(value = "修改科目")
|
|
|
|
- @PutMapping("/update")
|
|
|
|
|
|
+ @ApiOperation(value = "修改、新增科目")
|
|
|
|
+ @PostMapping("/upset")
|
|
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());
|
|
|
|
- subjectService.update(subject);
|
|
|
|
|
|
+ subjectService.upSetSubject(subject);
|
|
return succeed();
|
|
return succeed();
|
|
}
|
|
}
|
|
|
|
|
|
@@ -55,21 +34,27 @@ public class SubjectController extends BaseController {
|
|
}
|
|
}
|
|
|
|
|
|
@ApiOperation(value = "分页查询科目列表")
|
|
@ApiOperation(value = "分页查询科目列表")
|
|
- @PostMapping("/queryPage")
|
|
|
|
- public Object queryPage(@RequestBody SubjectQueryInfo queryInfo){
|
|
|
|
|
|
+ @GetMapping("/queryPage")
|
|
|
|
+ public Object queryPage(@RequestBody(required = false) SubjectQueryInfo queryInfo){
|
|
|
|
+ if(queryInfo == null){
|
|
|
|
+ queryInfo = new SubjectQueryInfo();
|
|
|
|
+ }
|
|
return succeed(subjectService.queryPage(queryInfo));
|
|
return succeed(subjectService.queryPage(queryInfo));
|
|
}
|
|
}
|
|
|
|
|
|
@ApiOperation(value = "分页查询科目树状列表")
|
|
@ApiOperation(value = "分页查询科目树状列表")
|
|
- @PostMapping("/queryPageTree")
|
|
|
|
- public Object queryPageTree(@RequestBody SubjectQueryInfo queryInfo){
|
|
|
|
|
|
+ @GetMapping("/queryPageTree")
|
|
|
|
+ public Object queryPageTree(@RequestBody(required = false) SubjectQueryInfo queryInfo){
|
|
|
|
+ if(queryInfo == null){
|
|
|
|
+ queryInfo = new SubjectQueryInfo();
|
|
|
|
+ }
|
|
return succeed(subjectService.queryPageTree(queryInfo));
|
|
return succeed(subjectService.queryPageTree(queryInfo));
|
|
}
|
|
}
|
|
|
|
|
|
@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));
|
|
}
|
|
}
|
|
|
|
|
|
@@ -80,10 +65,17 @@ public class SubjectController extends BaseController {
|
|
return succeed(subjectService.findDefaultSubByGroupId(musicGroupId));
|
|
return succeed(subjectService.findDefaultSubByGroupId(musicGroupId));
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ @ApiOperation(value = "标记声部关联的商品列表")
|
|
|
|
+ @PostMapping("/markGoods")
|
|
|
|
+ @ApiImplicitParams({ @ApiImplicitParam(name = "musicGroupId", value = "乐团编号", required = true, dataType = "Integer")})
|
|
|
|
+ public Object markGoods(@RequestParam Integer musicGroupId){
|
|
|
|
+ return succeed(subjectService.findDefaultSubByGroupId(musicGroupId));
|
|
|
|
+ }
|
|
|
|
+
|
|
@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));
|
|
}
|
|
}
|
|
}
|
|
}
|