zh
2024-11-25 aac98d314df1563537e386ab9df150191035b280
流程分类
6个文件已添加
214 ■■■■■ 已修改文件
business/src/main/java/com/ycl/controller/FlowableTypeController.java 72 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
business/src/main/java/com/ycl/domain/entity/FlowableType.java 39 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
business/src/main/java/com/ycl/mapper/FlowableTypeMapper.java 11 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
business/src/main/java/com/ycl/service/FlowableTypeService.java 12 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
business/src/main/java/com/ycl/service/impl/FlowableTypeServiceImpl.java 23 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
business/src/main/resources/mapper/FlowableTypeMapper.xml 57 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
business/src/main/java/com/ycl/controller/FlowableTypeController.java
New file
@@ -0,0 +1,72 @@
package com.ycl.controller;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.ycl.common.base.Result;
import com.ycl.common.group.Add;
import com.ycl.common.group.Update;
import com.ycl.domain.entity.FlowableType;
import com.ycl.domain.form.PlanForm;
import com.ycl.domain.query.PlanQuery;
import com.ycl.domain.vo.PlanVO;
import com.ycl.framework.utils.PageUtil;
import com.ycl.service.FlowableTypeService;
import com.ycl.service.PlanService;
import com.ycl.system.domain.base.AbsQuery;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.RequiredArgsConstructor;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;
import javax.validation.constraints.NotEmpty;
import java.util.List;
/**
 * 工作流分类 前端控制器
 */
@Validated
@RequiredArgsConstructor
@Api(value = "工作流分类", tags = "工作流分类管理")
@RestController
@RequestMapping("/flowable_type")
public class FlowableTypeController {
    private final FlowableTypeService flowableTypeService;
    @PostMapping
    @ApiOperation(value = "添加", notes = "添加")
//    @PreAuthorize("hasAuthority('flowableType:add')")
    public Result add(@RequestBody @Validated(Add.class) FlowableType form) {
        flowableTypeService.save(form);
        return Result.ok();
    }
    @PutMapping
    @ApiOperation(value = "修改", notes = "修改")
//    @PreAuthorize("hasAuthority('flowableType:edit')")
    public Result update(@RequestBody @Validated(Update.class) FlowableType form) {
        flowableTypeService.updateById(form);
        return Result.ok();
    }
    @DeleteMapping("/{id}")
    @ApiOperation(value = "ID删除", notes = "ID删除")
//    @PreAuthorize("hasAuthority('flowableType:del')")
    public Result removeById(@PathVariable("id") String id) {
        flowableTypeService.removeById(id);
        return Result.ok();
    }
    @GetMapping("/page")
    @ApiOperation(value = "分页", notes = "分页")
//    @PreAuthorize("hasAuthority('flowableType:page')")
    public Result page(AbsQuery query) {
        IPage<FlowableType> page = PageUtil.getPage(query, FlowableType.class);
        flowableTypeService.page(page);
        return Result.ok().data(page.getRecords()).total(page.getTotal());
    }
}
business/src/main/java/com/ycl/domain/entity/FlowableType.java
New file
@@ -0,0 +1,39 @@
package com.ycl.domain.entity;
import com.baomidou.mybatisplus.annotation.FieldFill;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;
import com.ycl.system.domain.base.AbsEntity;
import lombok.Data;
import java.time.LocalDateTime;
/**
 * 流程分类
 */
@Data
@TableName("t_flowable_type")
public class FlowableType extends AbsEntity {
    private static final long serialVersionUID = 1L;
    @TableField(value = "name")
    private String name;
    @TableField(value = "parent_id")
    private Integer parentId;
    @TableField(value = "level")
    private Integer level;
    @TableField(value = "leaf")
    private Boolean leaf;
    @TableField(value = "create_by")
    private String createBy;
    @TableField(value = "update_by")
    private String updateBy;
}
business/src/main/java/com/ycl/mapper/FlowableTypeMapper.java
New file
@@ -0,0 +1,11 @@
package com.ycl.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.ycl.domain.entity.FlowableType;
import org.apache.ibatis.annotations.Mapper;
@Mapper
public interface FlowableTypeMapper extends BaseMapper<FlowableType> {
}
business/src/main/java/com/ycl/service/FlowableTypeService.java
New file
@@ -0,0 +1,12 @@
package com.ycl.service;
import com.baomidou.mybatisplus.extension.service.IService;
import com.ycl.common.base.Result;
import com.ycl.domain.entity.FlowableType;
import java.util.List;
public interface FlowableTypeService extends IService<FlowableType> {
}
business/src/main/java/com/ycl/service/impl/FlowableTypeServiceImpl.java
New file
@@ -0,0 +1,23 @@
package com.ycl.service.impl;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.ycl.common.base.Result;
import com.ycl.domain.entity.FlowableType;
import com.ycl.framework.utils.PageUtil;
import com.ycl.mapper.FlowableTypeMapper;
import com.ycl.service.FlowableTypeService;
import lombok.RequiredArgsConstructor;
import org.springframework.beans.BeanUtils;
import org.springframework.stereotype.Service;
import org.springframework.util.Assert;
import java.util.List;
import java.util.stream.Collectors;
@Service
@RequiredArgsConstructor
public class FlowableTypeServiceImpl extends ServiceImpl<FlowableTypeMapper, FlowableType> implements FlowableTypeService {
}
business/src/main/resources/mapper/FlowableTypeMapper.xml
New file
@@ -0,0 +1,57 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.ycl.mapper.FlowableTypeMapper">
    <!-- 通用查询映射结果 -->
    <resultMap id="BaseResultMap" type="com.ycl.domain.entity.FlowableType">
        <result column="id" property="id" />
        <result column="name" property="name" />
        <result column="parent_id" property="parentId" />
        <result column="level" property="level" />
        <result column="leaf" property="leaf" />
        <result column="create_by" property="createBy"/>
        <result column="update_by" property="updateBy"/>
        <result column="gmt_create_time" property="gmtCreateTime" />
        <result column="gmt_update_time" property="gmtUpdateTime" />
    </resultMap>
    <select id="getById" resultMap="BaseResultMap">
        SELECT
            TP.project_info_id,
            TP.report_status,
            TP.month_status,
            TP.season_status,
            TP.year_status,
            TP.gmt_create_time,
            TP.gmt_update_time,
            TP.id
        FROM
            t_plan TP
        WHERE
            TP.id = #{id} AND TP.deleted = 0
    </select>
    <select id="getPage" resultMap="BaseResultMap">
        SELECT
            TP.project_info_id,
            TP.report_status,
            TP.month_status,
            TP.season_status,
            TP.year_status,
            TP.gmt_create_time,
            TP.gmt_update_time,
            TP.id
        FROM
            t_plan TP
        WHERE
            TP.deleted = 0
    </select>
</mapper>