123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151 |
- package com.ims.eval.controller;
- import com.baomidou.mybatisplus.core.metadata.IPage;
- import com.ims.eval.config.CustomException;
- import com.ims.eval.entity.OrganizationEvaluationRule;
- import com.ims.eval.entity.dto.request.OrganizationEvaluationRuleDTO;
- import com.ims.eval.entity.dto.result.R;
- import com.ims.eval.service.IOrganizationEvaluationRuleService;
- import io.swagger.annotations.ApiOperation;
- import org.springframework.beans.factory.annotation.Autowired;
- import org.springframework.web.bind.annotation.*;
- import java.util.Arrays;
- import java.util.List;
- /**
- * <p>
- * 单位/部门考评配置 前端控制器
- * </p>
- *
- * @author wang
- * @since 2023-03-01
- */
- @RestController
- @RequestMapping("//organization-evaluation-rule")
- public class OrganizationEvaluationRuleController {
- @Autowired
- private IOrganizationEvaluationRuleService organizationEvaluationRuleService;
- /**
- * @param pageNum 当前页数
- * @param pageSize 当前页大小
- * @param id 主键
- * @param organizationName 考评组织名称
- * @param organizationId 考评组织ID
- * @param organizationType 考评类别
- * @param binSection 业务版块
- * @param binStage 业务阶段
- * @param evaluationCycle 考评周期
- * @return
- */
- //@ImsPreAuth("eval:organizationEvaluationRule:view")
- @GetMapping(value = "list")
- public R list(@RequestParam(value = "pageNum") Integer pageNum,
- @RequestParam(value = "pageSize") Integer pageSize,
- @RequestParam(value = "id", required = false) String id,
- @RequestParam(value = "organizationName", required = false) String organizationName,
- @RequestParam(value = "organizationId", required = false) String organizationId,
- @RequestParam(value = "organizationType", required = false) String organizationType,
- @RequestParam(value = "binSection", required = false) String binSection,
- @RequestParam(value = "binStage", required = false) String binStage,
- @RequestParam(value = "evaluationCycle", required = false) String evaluationCycle) {
- IPage<OrganizationEvaluationRule> list = organizationEvaluationRuleService.list2(pageNum, pageSize, id, organizationName, organizationId, organizationType, binSection, binStage, evaluationCycle);
- return R.ok().data(list);
- }
- @GetMapping(value = "list2")
- public R list2(@RequestParam(value = "pageNum") Integer pageNum,
- @RequestParam(value = "pageSize") Integer pageSize,
- @RequestParam(value = "id", required = false) String id,
- @RequestParam(value = "organizationName", required = false) String organizationName,
- @RequestParam(value = "organizationId", required = false) String organizationId,
- @RequestParam(value = "organizationType", required = false) String organizationType,
- @RequestParam(value = "binSection", required = false) String binSection,
- @RequestParam(value = "binStage", required = false) String binStage,
- @RequestParam(value = "evaluationCycle", required = false) String evaluationCycle) {
- IPage<OrganizationEvaluationRule> list = organizationEvaluationRuleService.list(pageNum, pageSize, id, organizationName, organizationId, organizationType, binSection, binStage, evaluationCycle);
- return R.ok().data(list);
- }
- /**
- * 查询所有数据
- *
- * @param id 主键
- * @param organizationName 考评组织名称
- * @param organizationId 考评组织ID
- * @param organizationType 考评类别
- * @param binSection 业务版块
- * @param binStage 业务阶段
- * @param evaluationCycle 考评周期
- * @return
- */
- //@ImsPreAuth("eval:organizationEvaluationRule:view")
- @GetMapping(value = "listAll")
- public R listAll(
- @RequestParam(value = "id", required = false) String id,
- @RequestParam(value = "organizationName", required = false) String organizationName,
- @RequestParam(value = "organizationId", required = false) String organizationId,
- @RequestParam(value = "organizationType", required = false) String organizationType,
- @RequestParam(value = "binSection", required = false) String binSection,
- @RequestParam(value = "binStage", required = false) String binStage,
- @RequestParam(value = "evaluationCycle", required = false) String evaluationCycle) {
- List<OrganizationEvaluationRule> list = organizationEvaluationRuleService.listAll(id, organizationName, organizationId, organizationType, binSection, binStage, evaluationCycle);
- return R.ok().data(list);
- }
- /**
- * 添加
- *
- * @param evaluationRule
- * @return
- */
- //@ImsPreAuth("eval:organizationEvaluationRule:edit")
- @PostMapping(value = "/save")
- @ApiOperation(value = "新增(修改)", notes = "新增(修改)")
- public R addAll(@RequestBody OrganizationEvaluationRule evaluationRule) {
- try {
- boolean b = organizationEvaluationRuleService.saveOrUpdate(evaluationRule);
- if (b) {
- return R.ok().data(b);
- } else {
- return R.error().data("保存失败!");
- }
- } catch (CustomException e) {
- return R.customError(e.getMessage()).data("失败!");
- }
- }
- /**
- * 批量删除
- *
- * @param ids
- * @return
- */
- //@ImsPreAuth("eval:organizationEvaluationRule:remove")
- @PostMapping(value = "/remove/{ids}")
- @ApiOperation(value = "删除", notes = "删除")
- public R deleteAll(@PathVariable("ids") String ids) {
- String[] strings = ids.split(",");
- boolean b = organizationEvaluationRuleService.removeByIds(Arrays.asList(strings));
- if (b) {
- return R.ok().data(b);
- } else {
- return R.error().data("删除失败!");
- }
- }
- }
|