|
|
@@ -0,0 +1,110 @@
|
|
|
+package com.xjrsoft.module.student.controller;
|
|
|
+
|
|
|
+import cn.hutool.core.bean.BeanUtil;
|
|
|
+import cn.hutool.core.util.ObjectUtil;
|
|
|
+import cn.hutool.core.util.StrUtil;
|
|
|
+import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
|
|
+import com.baomidou.mybatisplus.core.metadata.IPage;
|
|
|
+import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
|
|
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
|
|
+import com.xjrsoft.common.constant.GlobalConstant;
|
|
|
+import com.baomidou.mybatisplus.core.toolkit.StringPool;
|
|
|
+import com.xjrsoft.common.page.ConventPage;
|
|
|
+import com.xjrsoft.common.page.PageOutput;
|
|
|
+import com.xjrsoft.common.model.result.RT;
|
|
|
+import com.xjrsoft.common.utils.VoToColumnUtil;
|
|
|
+import com.xjrsoft.module.student.dto.AddQuotaFormulaRuleDto;
|
|
|
+import com.xjrsoft.module.student.dto.UpdateQuotaFormulaRuleDto;
|
|
|
+import cn.dev33.satoken.annotation.SaCheckPermission;
|
|
|
+
|
|
|
+import com.xjrsoft.module.student.dto.QuotaFormulaRulePageDto;
|
|
|
+import com.xjrsoft.module.student.entity.QuotaFormulaRule;
|
|
|
+import com.xjrsoft.module.student.service.IQuotaFormulaRuleService;
|
|
|
+import com.xjrsoft.module.student.vo.QuotaFormulaRuleConstantPageVo;
|
|
|
+import com.xjrsoft.module.student.vo.QuotaFormulaRulePageVo;
|
|
|
+
|
|
|
+import com.xjrsoft.module.student.vo.QuotaFormulaRuleVo;
|
|
|
+import io.swagger.annotations.Api;
|
|
|
+import io.swagger.annotations.ApiOperation;
|
|
|
+import lombok.AllArgsConstructor;
|
|
|
+import org.springframework.web.bind.annotation.*;
|
|
|
+
|
|
|
+import javax.validation.Valid;
|
|
|
+import javax.validation.constraints.NotNull;
|
|
|
+import java.util.List;
|
|
|
+
|
|
|
+/**
|
|
|
+* @title: 指标公式规则管理
|
|
|
+* @Author szs
|
|
|
+* @Date: 2024-01-29
|
|
|
+* @Version 1.0
|
|
|
+*/
|
|
|
+@RestController
|
|
|
+@RequestMapping("/student" + "/quotaFormulaRule")
|
|
|
+@Api(value = "/student" + "/quotaFormulaRule",tags = "指标公式规则管理代码")
|
|
|
+@AllArgsConstructor
|
|
|
+public class QuotaFormulaRuleController {
|
|
|
+
|
|
|
+
|
|
|
+ private final IQuotaFormulaRuleService quotaFormulaRuleService;
|
|
|
+
|
|
|
+ @GetMapping(value = "/page")
|
|
|
+ @ApiOperation(value="指标公式规则管理列表(分页)")
|
|
|
+ @SaCheckPermission("quotaformularule:detail")
|
|
|
+ public RT<PageOutput<QuotaFormulaRulePageVo>> page(@Valid QuotaFormulaRulePageDto dto){
|
|
|
+
|
|
|
+ Page<QuotaFormulaRulePageVo> page = quotaFormulaRuleService.getPage(new Page<>(dto.getLimit(), dto.getSize()), dto);
|
|
|
+ PageOutput<QuotaFormulaRulePageVo> pageOutput = ConventPage.getPageOutput(page, QuotaFormulaRulePageVo.class);
|
|
|
+ return RT.ok(pageOutput);
|
|
|
+ }
|
|
|
+
|
|
|
+ @GetMapping(value = "/quotaPage")
|
|
|
+ @ApiOperation(value="绑定指标列表")
|
|
|
+ @SaCheckPermission("quotaformularule:detail")
|
|
|
+ public RT<PageOutput<QuotaFormulaRulePageVo>> quotaPage(@Valid QuotaFormulaRulePageDto dto){
|
|
|
+
|
|
|
+ Page<QuotaFormulaRulePageVo> page = quotaFormulaRuleService.getQuota(new Page<>(dto.getLimit(), dto.getSize()), dto);
|
|
|
+ PageOutput<QuotaFormulaRulePageVo> pageOutput = ConventPage.getPageOutput(page, QuotaFormulaRulePageVo.class);
|
|
|
+ return RT.ok(pageOutput);
|
|
|
+ }
|
|
|
+
|
|
|
+ @GetMapping(value = "/info")
|
|
|
+ @ApiOperation(value="根据id查询指标公式规则管理信息")
|
|
|
+ @SaCheckPermission("quotaformularule:detail")
|
|
|
+ public RT<QuotaFormulaRuleVo> info(@RequestParam Long id){
|
|
|
+ QuotaFormulaRule quotaFormulaRule = quotaFormulaRuleService.getById(id);
|
|
|
+ if (quotaFormulaRule == null) {
|
|
|
+ return RT.error("找不到此数据!");
|
|
|
+ }
|
|
|
+ return RT.ok(BeanUtil.toBean(quotaFormulaRule, QuotaFormulaRuleVo.class));
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ @PostMapping
|
|
|
+ @ApiOperation(value = "新增指标公式规则管理")
|
|
|
+ @SaCheckPermission("quotaformularule:add")
|
|
|
+ public RT<Boolean> add(@Valid @RequestBody AddQuotaFormulaRuleDto dto){
|
|
|
+ QuotaFormulaRule quotaFormulaRule = BeanUtil.toBean(dto, QuotaFormulaRule.class);
|
|
|
+ boolean isSuccess = quotaFormulaRuleService.save(quotaFormulaRule);
|
|
|
+ return RT.ok(isSuccess);
|
|
|
+ }
|
|
|
+
|
|
|
+ @PutMapping
|
|
|
+ @ApiOperation(value = "修改指标公式规则管理")
|
|
|
+ @SaCheckPermission("quotaformularule:edit")
|
|
|
+ public RT<Boolean> update(@Valid @RequestBody UpdateQuotaFormulaRuleDto dto){
|
|
|
+
|
|
|
+ QuotaFormulaRule quotaFormulaRule = BeanUtil.toBean(dto, QuotaFormulaRule.class);
|
|
|
+ return RT.ok(quotaFormulaRuleService.updateById(quotaFormulaRule));
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
+ @DeleteMapping
|
|
|
+ @ApiOperation(value = "删除指标公式规则管理")
|
|
|
+ @SaCheckPermission("quotaformularule:delete")
|
|
|
+ public RT<Boolean> delete(@Valid @RequestBody List<Long> ids){
|
|
|
+ return RT.ok(quotaFormulaRuleService.removeBatchByIds(ids));
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
+}
|