| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112 |
- /*
- * Copyright (c) 2018-2028, Chill Zhuang All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice,
- * this list of conditions and the following disclaimer.
- * Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- * Neither the name of the dreamlu.net developer nor the names of its
- * contributors may be used to endorse or promote products derived from
- * this software without specific prior written permission.
- * Author: Chill 庄骞 (smallchill@163.com)
- */
- package com.blade.check.controller;
- import com.alibaba.cloud.commons.lang.StringUtils;
- import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
- import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
- import com.blade.check.entity.AuditPathsLevels;
- import com.blade.check.service.IAuditPathsLevelsService;
- import io.swagger.annotations.Api;
- import io.swagger.annotations.ApiOperation;
- import io.swagger.annotations.ApiParam;
- import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport;
- import lombok.AllArgsConstructor;
- import javax.validation.Valid;
- import org.springblade.core.mp.support.Condition;
- import org.springblade.core.mp.support.Query;
- import org.springblade.core.tool.api.R;
- import org.springblade.core.tool.utils.Func;
- import org.springframework.web.bind.annotation.*;
- import com.baomidou.mybatisplus.core.metadata.IPage;
- import com.blade.check.entity.AuditPaths;
- import com.blade.check.vo.AuditPathsVO;
- import com.blade.check.service.IAuditPathsService;
- import org.springblade.core.boot.ctrl.BladeController;
- import java.util.List;
- /**
- * 审批流配置主表 控制器
- *
- * @author BladeX
- * @since 2021-12-07
- */
- @RestController
- @AllArgsConstructor
- @RequestMapping("/auditpaths")
- @Api(value = "审批流配置主表", tags = "审批流配置主表接口")
- public class AuditPathsController extends BladeController {
- private final IAuditPathsService auditPathsService;
- private final IAuditPathsLevelsService auditPathsLevelsService;
- /**
- * 详情
- */
- @GetMapping("/detail")
- @ApiOperationSupport(order = 1)
- @ApiOperation(value = "详情-审批流配置主表", notes = "传入auditPaths")
- public R<AuditPaths> detail(AuditPaths auditPaths) {
- AuditPaths detail = auditPathsService.getOne(Condition.getQueryWrapper(auditPaths));
- List<AuditPathsLevels> pathsLevelsList = auditPathsLevelsService.list(new LambdaQueryWrapper<AuditPathsLevels>().eq(AuditPathsLevels::getPathId, detail.getId()));
- detail.setAuditPathsLevels(pathsLevelsList);
- return R.data(detail);
- }
- /**
- * 列表-审批流配置主表
- */
- @GetMapping("/list")
- @ApiOperationSupport(order = 2)
- @ApiOperation(value = "列表-审批流配置主表", notes = "传入auditPaths")
- public R<IPage<AuditPaths>> list(AuditPaths auditPaths, Query query) {
- LambdaQueryWrapper<AuditPaths> lambdaQueryWrapper=new LambdaQueryWrapper<>();
- lambdaQueryWrapper.like(StringUtils.isNotBlank(auditPaths.getPathName()),AuditPaths::getPathName,auditPaths.getPathName())
- .orderByDesc(AuditPaths::getOpDate);
- IPage<AuditPaths> pages = auditPathsService.page(Condition.getPage(query),lambdaQueryWrapper);
- return R.data(pages);
- }
- /**
- * 新增或编辑审批流配置
- * */
- @PostMapping("/modify")
- @ApiOperationSupport(order = 3)
- @ApiOperation(value = "新增或编辑审批流配置", notes = "传入auditPaths")
- public R modify(@Valid @RequestBody AuditPaths auditPaths)
- {
- return R.data(auditPathsService.modify(auditPaths));
- }
- /**
- * 删除 审批流配置主表
- */
- @PostMapping("/remove")
- @ApiOperationSupport(order = 4)
- @ApiOperation(value = "删除-审批流配置主表", notes = "传入ids")
- public R remove(@ApiParam(value = "主键集合", required = true) @RequestParam String ids) {
- return R.status(auditPathsService.removeByIds(Func.toLongList(ids)));
- }
- }
|