|
|
@@ -0,0 +1,100 @@
|
|
|
+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.AddQuotaFormulaRuleAttributeDto;
|
|
|
+import com.xjrsoft.module.student.dto.UpdateQuotaFormulaRuleAttributeDto;
|
|
|
+import cn.dev33.satoken.annotation.SaCheckPermission;
|
|
|
+
|
|
|
+import com.xjrsoft.module.student.dto.QuotaFormulaRuleAttributePageDto;
|
|
|
+import com.xjrsoft.module.student.entity.QuotaFormulaRuleAttribute;
|
|
|
+import com.xjrsoft.module.student.service.IQuotaFormulaRuleAttributeService;
|
|
|
+import com.xjrsoft.module.student.vo.QuotaFormulaRuleAttributePageVo;
|
|
|
+
|
|
|
+import com.xjrsoft.module.student.vo.QuotaFormulaRuleAttributeVo;
|
|
|
+import com.xjrsoft.module.student.vo.QuotaFormulaRuleConstantPageVo;
|
|
|
+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" + "/quotaFormulaRuleAttribute")
|
|
|
+@Api(value = "/student" + "/quotaFormulaRuleAttribute",tags = "考核表单属性代码")
|
|
|
+@AllArgsConstructor
|
|
|
+public class QuotaFormulaRuleAttributeController {
|
|
|
+
|
|
|
+
|
|
|
+ private final IQuotaFormulaRuleAttributeService quotaFormulaRuleAttributeService;
|
|
|
+
|
|
|
+ @GetMapping(value = "/page")
|
|
|
+ @ApiOperation(value="考核表单属性列表(分页)")
|
|
|
+ @SaCheckPermission("quotaformularuleattribute:detail")
|
|
|
+ public RT<PageOutput<QuotaFormulaRuleAttributePageVo>> page(@Valid QuotaFormulaRuleAttributePageDto dto){
|
|
|
+
|
|
|
+ Page<QuotaFormulaRuleAttributePageVo> page = quotaFormulaRuleAttributeService.getPage(new Page<>(dto.getLimit(), dto.getSize()), dto);
|
|
|
+ PageOutput<QuotaFormulaRuleAttributePageVo> pageOutput = ConventPage.getPageOutput(page, QuotaFormulaRuleAttributePageVo.class);
|
|
|
+ return RT.ok(pageOutput);
|
|
|
+ }
|
|
|
+
|
|
|
+ @GetMapping(value = "/info")
|
|
|
+ @ApiOperation(value="根据id查询考核表单属性信息")
|
|
|
+ @SaCheckPermission("quotaformularuleattribute:detail")
|
|
|
+ public RT<QuotaFormulaRuleAttributeVo> info(@RequestParam Long id){
|
|
|
+ QuotaFormulaRuleAttribute quotaFormulaRuleAttribute = quotaFormulaRuleAttributeService.getById(id);
|
|
|
+ if (quotaFormulaRuleAttribute == null) {
|
|
|
+ return RT.error("找不到此数据!");
|
|
|
+ }
|
|
|
+ return RT.ok(BeanUtil.toBean(quotaFormulaRuleAttribute, QuotaFormulaRuleAttributeVo.class));
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ @PostMapping
|
|
|
+ @ApiOperation(value = "新增考核表单属性")
|
|
|
+ @SaCheckPermission("quotaformularuleattribute:add")
|
|
|
+ public RT<Boolean> add(@Valid @RequestBody AddQuotaFormulaRuleAttributeDto dto){
|
|
|
+ QuotaFormulaRuleAttribute quotaFormulaRuleAttribute = BeanUtil.toBean(dto, QuotaFormulaRuleAttribute.class);
|
|
|
+ boolean isSuccess = quotaFormulaRuleAttributeService.save(quotaFormulaRuleAttribute);
|
|
|
+ return RT.ok(isSuccess);
|
|
|
+ }
|
|
|
+
|
|
|
+ @PutMapping
|
|
|
+ @ApiOperation(value = "修改考核表单属性")
|
|
|
+ @SaCheckPermission("quotaformularuleattribute:edit")
|
|
|
+ public RT<Boolean> update(@Valid @RequestBody UpdateQuotaFormulaRuleAttributeDto dto){
|
|
|
+
|
|
|
+ QuotaFormulaRuleAttribute quotaFormulaRuleAttribute = BeanUtil.toBean(dto, QuotaFormulaRuleAttribute.class);
|
|
|
+ return RT.ok(quotaFormulaRuleAttributeService.updateById(quotaFormulaRuleAttribute));
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
+ @DeleteMapping
|
|
|
+ @ApiOperation(value = "删除考核表单属性")
|
|
|
+ @SaCheckPermission("quotaformularuleattribute:delete")
|
|
|
+ public RT<Boolean> delete(@Valid @RequestBody List<Long> ids){
|
|
|
+ return RT.ok(quotaFormulaRuleAttributeService.removeBatchByIds(ids));
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
+}
|