|
|
@@ -5,6 +5,7 @@ import cn.hutool.core.bean.BeanUtil;
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
|
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
|
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
|
|
+import com.xjrsoft.common.annotation.XjrLog;
|
|
|
import com.xjrsoft.common.model.result.RT;
|
|
|
import com.xjrsoft.common.page.ConventPage;
|
|
|
import com.xjrsoft.common.page.PageOutput;
|
|
|
@@ -64,8 +65,8 @@ public class BandingTaskController {
|
|
|
@GetMapping(value = "/page")
|
|
|
@ApiOperation(value="新生分班任务列表(分页)")
|
|
|
@SaCheckPermission("bandingtask:detail")
|
|
|
+ @XjrLog(value = "新生分班任务列表(分页)")
|
|
|
public RT<PageOutput<BandingTaskPageVo>> page(@Valid BandingTaskPageDto dto){
|
|
|
-
|
|
|
IPage<BandingTaskPageVo> page = bandingTaskService.getPage(new Page<>(dto.getLimit(), dto.getSize()), dto);
|
|
|
PageOutput<BandingTaskPageVo> pageOutput = ConventPage.getPageOutput(page, BandingTaskPageVo.class);
|
|
|
return RT.ok(pageOutput);
|
|
|
@@ -74,6 +75,7 @@ public class BandingTaskController {
|
|
|
@GetMapping(value = "/info")
|
|
|
@ApiOperation(value="根据id查询新生分班任务信息")
|
|
|
@SaCheckPermission("bandingtask:detail")
|
|
|
+ @XjrLog(value = "根据id查询新生分班任务信息")
|
|
|
public RT<BandingTaskVo> info(@RequestParam Long id){
|
|
|
BandingTask bandingTask = bandingTaskService.getById(id);
|
|
|
if (bandingTask == null) {
|
|
|
@@ -86,6 +88,7 @@ public class BandingTaskController {
|
|
|
@PostMapping
|
|
|
@ApiOperation(value = "新增新生分班任务")
|
|
|
@SaCheckPermission("bandingtask:add")
|
|
|
+ @XjrLog(value = "新增新生分班任务")
|
|
|
public RT<Boolean> add(@Valid @RequestBody AddBandingTaskDto dto){
|
|
|
List<BandingTask> list = bandingTaskService.list(
|
|
|
new QueryWrapper<BandingTask>().lambda()
|
|
|
@@ -104,6 +107,7 @@ public class BandingTaskController {
|
|
|
@PostMapping("/set-rule")
|
|
|
@ApiOperation(value = "设置规则")
|
|
|
@SaCheckPermission("bandingtask:set-rule")
|
|
|
+ @XjrLog(value = "设置规则")
|
|
|
public RT<Boolean> setRule(@Valid @RequestBody AddBandingTaskRuleDto dto){
|
|
|
taskRuleService.remove(
|
|
|
new QueryWrapper<BandingTaskRule>().lambda()
|
|
|
@@ -125,6 +129,7 @@ public class BandingTaskController {
|
|
|
@PutMapping
|
|
|
@ApiOperation(value = "修改新生分班任务")
|
|
|
@SaCheckPermission("bandingtask:edit")
|
|
|
+ @XjrLog(value = "修改新生分班任务")
|
|
|
public RT<Boolean> update(@Valid @RequestBody UpdateBandingTaskDto dto){
|
|
|
|
|
|
BandingTask bandingTask = BeanUtil.toBean(dto, BandingTask.class);
|
|
|
@@ -135,6 +140,7 @@ public class BandingTaskController {
|
|
|
@DeleteMapping
|
|
|
@ApiOperation(value = "删除新生分班任务")
|
|
|
@SaCheckPermission("bandingtask:delete")
|
|
|
+ @XjrLog(value = "删除新生分班任务")
|
|
|
public RT<Boolean> delete(@Valid @RequestBody List<Long> ids){
|
|
|
return RT.ok(bandingTaskService.delete(ids));
|
|
|
}
|
|
|
@@ -142,6 +148,7 @@ public class BandingTaskController {
|
|
|
@GetMapping(value = "/rule-list")
|
|
|
@ApiOperation(value="查询所有规则")
|
|
|
@SaCheckPermission("bandingtask:detail")
|
|
|
+ @XjrLog(value = "查询所有规则")
|
|
|
public RT<List<BandingTaskRuleVo>> ruleList(@RequestParam Long id){
|
|
|
List<BandingRule> ruleList = ruleService.list();
|
|
|
|
|
|
@@ -162,6 +169,7 @@ public class BandingTaskController {
|
|
|
@PostMapping("/sure")
|
|
|
@ApiOperation(value = "确认分班")
|
|
|
@SaCheckPermission("bandingTaskClass:sure")
|
|
|
+ @XjrLog(value = "确认分班")
|
|
|
public RT<Boolean> sure(@Valid @RequestBody SureBandingTaskDto dto){
|
|
|
Boolean isSuccess = bandingTaskService.sure(dto);
|
|
|
return RT.ok(isSuccess);
|
|
|
@@ -172,6 +180,7 @@ public class BandingTaskController {
|
|
|
@PostMapping("/automatic-banding")
|
|
|
@ApiOperation(value = "自动分班")
|
|
|
@SaCheckPermission("bandingTaskClass:automatic-banding")
|
|
|
+ @XjrLog(value = "自动分班")
|
|
|
public RT<Boolean> automaticBanding(@Valid @RequestBody AutomaticBandingTaskDto dto){
|
|
|
Boolean aBoolean = bandingTaskService.automaticBanding(dto);
|
|
|
return RT.ok(aBoolean);
|