business/src/main/java/com/ycl/controller/FlowableTypeController.java | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
business/src/main/java/com/ycl/domain/entity/FlowableType.java | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
business/src/main/java/com/ycl/mapper/FlowableTypeMapper.java | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
business/src/main/java/com/ycl/service/FlowableTypeService.java | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
business/src/main/java/com/ycl/service/impl/FlowableTypeServiceImpl.java | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
business/src/main/resources/mapper/FlowableTypeMapper.xml | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 |
business/src/main/java/com/ycl/controller/FlowableTypeController.java
@@ -3,6 +3,10 @@ import com.baomidou.mybatisplus.core.metadata.IPage; import com.ycl.common.base.Result; import com.ycl.common.constant.UserConstants; import com.ycl.common.core.controller.BaseController; import com.ycl.common.core.domain.AjaxResult; import com.ycl.common.core.domain.entity.SysMenu; import com.ycl.common.group.Add; import com.ycl.common.group.Update; import com.ycl.domain.entity.FlowableType; @@ -21,6 +25,7 @@ import org.springframework.web.bind.annotation.*; import javax.validation.constraints.NotEmpty; import java.util.Date; import java.util.List; /** @@ -31,7 +36,7 @@ @Api(value = "工作流分类", tags = "工作流分类管理") @RestController @RequestMapping("/flowable_type") public class FlowableTypeController { public class FlowableTypeController extends BaseController { private final FlowableTypeService flowableTypeService; @@ -39,6 +44,10 @@ @ApiOperation(value = "添加", notes = "添加") // @PreAuthorize("hasAuthority('flowableType:add')") public Result add(@RequestBody @Validated(Add.class) FlowableType form) { form.setCreateBy(getUsername()); form.setCreateTime(new Date()); form.setUpdateBy(getUsername()); form.setUpdateTime(new Date()); flowableTypeService.save(form); return Result.ok(); } @@ -60,13 +69,11 @@ } @GetMapping("/page") @ApiOperation(value = "分页", notes = "分页") @GetMapping("/list") // @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()); public Result list(FlowableType flowableType) { List<FlowableType> list = flowableTypeService.selectTypeList(flowableType); return Result.ok().data(list); } } business/src/main/java/com/ycl/domain/entity/FlowableType.java
@@ -1,21 +1,25 @@ 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.baomidou.mybatisplus.annotation.*; import com.fasterxml.jackson.annotation.JsonFormat; import com.ycl.common.core.domain.BaseEntity; import com.ycl.system.domain.base.AbsEntity; import lombok.Data; import java.io.Serializable; import java.time.LocalDateTime; import java.util.Date; /** * 流程分类 */ @Data @TableName("t_flowable_type") public class FlowableType extends AbsEntity { public class FlowableType implements Serializable { private static final long serialVersionUID = 1L; @TableId(value = "id", type = IdType.ASSIGN_ID) private Integer id; @TableField(value = "name") private String name; @@ -23,17 +27,40 @@ @TableField(value = "parent_id") private Integer parentId; @TableField(value = "level") private Integer level; @TableField(value = "order_num") private Integer orderNum; @TableField(value = "leaf") private Boolean leaf; // @TableField(value = "level") // private Integer level; // // @TableField(value = "leaf") // private Boolean leaf; /** * 菜单状态(0正常 1停用) */ @TableField(value = "status") private String status; /** 创建者 */ @TableField(value = "create_by") private String createBy; /** 创建时间 */ @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") @TableField(value = "create_time") private Date createTime; /** 更新者 */ @TableField(value = "update_by") private String updateBy; /** 更新时间 */ @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") @TableField(value = "update_time") private Date updateTime; /** 备注 */ @TableField(value = "remark") private String remark; } business/src/main/java/com/ycl/mapper/FlowableTypeMapper.java
@@ -4,8 +4,10 @@ import com.ycl.domain.entity.FlowableType; import org.apache.ibatis.annotations.Mapper; import java.util.List; @Mapper public interface FlowableTypeMapper extends BaseMapper<FlowableType> { List<FlowableType> selectTypeList(FlowableType flowableType); } business/src/main/java/com/ycl/service/FlowableTypeService.java
@@ -9,4 +9,5 @@ public interface FlowableTypeService extends IService<FlowableType> { List<FlowableType> selectTypeList(FlowableType flowableType); } business/src/main/java/com/ycl/service/impl/FlowableTypeServiceImpl.java
@@ -20,4 +20,8 @@ @RequiredArgsConstructor public class FlowableTypeServiceImpl extends ServiceImpl<FlowableTypeMapper, FlowableType> implements FlowableTypeService { @Override public List<FlowableType> selectTypeList(FlowableType flowableType) { return baseMapper.selectTypeList(flowableType); } } business/src/main/resources/mapper/FlowableTypeMapper.xml
@@ -53,5 +53,17 @@ WHERE TP.deleted = 0 </select> <select id="selectTypeList" parameterType="com.ycl.domain.entity.FlowableType" resultType="com.ycl.domain.entity.FlowableType"> select * from t_flowable_type <where> <if test="name != null and name != ''"> AND name like concat('%', #{name}, '%') </if> <if test="status != null and status != ''"> AND status = #{status} </if> </where> order by parent_id, order_num </select> </mapper>