提交修改
This commit is contained in:
parent
a6ef4bd937
commit
95ecea6fcc
@ -0,0 +1,89 @@
|
|||||||
|
package com.lz.modules.app.controller;
|
||||||
|
|
||||||
|
import java.util.Arrays;
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
|
import com.lz.common.utils.PageUtils;
|
||||||
|
import com.lz.common.utils.R;
|
||||||
|
import com.lz.modules.flow.entity.FlowManager;
|
||||||
|
import com.lz.modules.flow.service.FlowManagerService;
|
||||||
|
import org.apache.shiro.authz.annotation.RequiresPermissions;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.web.bind.annotation.PathVariable;
|
||||||
|
import org.springframework.web.bind.annotation.RequestBody;
|
||||||
|
import org.springframework.web.bind.annotation.RequestMapping;
|
||||||
|
import org.springframework.web.bind.annotation.RequestParam;
|
||||||
|
import org.springframework.web.bind.annotation.RestController;
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 流程管理表
|
||||||
|
*
|
||||||
|
* @author zgh
|
||||||
|
* @email zgh@ldxinyong.com
|
||||||
|
* @date 2020-09-22 17:25:35
|
||||||
|
*/
|
||||||
|
@RestController
|
||||||
|
@RequestMapping("user/lzflowmanager")
|
||||||
|
public class FlowManagerController {
|
||||||
|
@Autowired
|
||||||
|
private FlowManagerService flowManagerService;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 列表
|
||||||
|
*/
|
||||||
|
@RequestMapping("/list")
|
||||||
|
@RequiresPermissions("user:lzflowmanager:list")
|
||||||
|
public R list(@RequestParam Map<String, Object> params){
|
||||||
|
PageUtils page = flowManagerService.queryPage(params);
|
||||||
|
|
||||||
|
return R.ok().put("page", page);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 信息
|
||||||
|
*/
|
||||||
|
@RequestMapping("/info/{id}")
|
||||||
|
@RequiresPermissions("user:lzflowmanager:info")
|
||||||
|
public R info(@PathVariable("id") Long id){
|
||||||
|
FlowManager lzFlowManager = flowManagerService.selectFlowManagerById(id);
|
||||||
|
|
||||||
|
return R.ok().put("lzFlowManager", lzFlowManager);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 保存
|
||||||
|
*/
|
||||||
|
@RequestMapping("/save")
|
||||||
|
@RequiresPermissions("user:lzflowmanager:save")
|
||||||
|
public R save(@RequestBody FlowManager lzFlowManager){
|
||||||
|
flowManagerService.insertFlowManager(lzFlowManager);
|
||||||
|
|
||||||
|
return R.ok();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 修改
|
||||||
|
*/
|
||||||
|
@RequestMapping("/update")
|
||||||
|
@RequiresPermissions("user:lzflowmanager:update")
|
||||||
|
public R update(@RequestBody FlowManager lzFlowManager){
|
||||||
|
flowManagerService.updateById(lzFlowManager);
|
||||||
|
|
||||||
|
return R.ok();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 删除
|
||||||
|
*/
|
||||||
|
@RequestMapping("/delete")
|
||||||
|
@RequiresPermissions("user:lzflowmanager:delete")
|
||||||
|
public R delete(@RequestBody Long[] ids){
|
||||||
|
flowManagerService.deleteBatchIds(Arrays.asList(ids));
|
||||||
|
|
||||||
|
return R.ok();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
39
src/main/java/com/lz/modules/flow/dao/FlowManagerMapper.java
Normal file
39
src/main/java/com/lz/modules/flow/dao/FlowManagerMapper.java
Normal file
@ -0,0 +1,39 @@
|
|||||||
|
package com.lz.modules.flow.dao;
|
||||||
|
/**
|
||||||
|
* <p>
|
||||||
|
* 流程管理表 服务类
|
||||||
|
* </p>
|
||||||
|
*
|
||||||
|
* @author quyixiao
|
||||||
|
* @since 2020-09-22
|
||||||
|
*/
|
||||||
|
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||||
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||||
|
import com.lz.modules.flow.entity.FlowManager;
|
||||||
|
import org.apache.ibatis.annotations.Mapper;
|
||||||
|
import org.apache.ibatis.annotations.Param;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
|
@Mapper
|
||||||
|
public interface FlowManagerMapper extends BaseMapper<FlowManager> {
|
||||||
|
|
||||||
|
|
||||||
|
FlowManager selectFlowManagerById(@Param("id") Long id);
|
||||||
|
|
||||||
|
|
||||||
|
Long insertFlowManager(FlowManager flowManager);
|
||||||
|
|
||||||
|
|
||||||
|
int updateFlowManagerById(FlowManager flowManager);
|
||||||
|
|
||||||
|
|
||||||
|
int updateCoverFlowManagerById(FlowManager flowManager);
|
||||||
|
|
||||||
|
|
||||||
|
int deleteFlowManagerById(@Param("id") Long id);
|
||||||
|
|
||||||
|
|
||||||
|
List<FlowManager> selectByCondition(@Param("page") IPage page, @Param("params") Map<String, Object> params);
|
||||||
|
}
|
||||||
114
src/main/java/com/lz/modules/flow/entity/FlowManager.java
Normal file
114
src/main/java/com/lz/modules/flow/entity/FlowManager.java
Normal file
@ -0,0 +1,114 @@
|
|||||||
|
package com.lz.modules.flow.entity;
|
||||||
|
import com.baomidou.mybatisplus.annotation.IdType;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableId;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableName;
|
||||||
|
import lombok.Data;
|
||||||
|
import java.util.Date;
|
||||||
|
/**
|
||||||
|
* <p>
|
||||||
|
* 菜单权限表
|
||||||
|
* </p>*流程管理表
|
||||||
|
* @author quyixiao
|
||||||
|
* @since 2020-09-22
|
||||||
|
*/
|
||||||
|
|
||||||
|
@Data
|
||||||
|
@TableName("lz_flow_manager")
|
||||||
|
public class FlowManager implements java.io.Serializable {
|
||||||
|
//
|
||||||
|
@TableId(value = "id", type = IdType.AUTO)
|
||||||
|
private Long id;
|
||||||
|
//是否删除状态,1:删除,0:有效
|
||||||
|
private Integer isDelete;
|
||||||
|
//创建时间
|
||||||
|
private Date gmtCreate;
|
||||||
|
//最后修改时间
|
||||||
|
private Date gmtModified;
|
||||||
|
//流程名称
|
||||||
|
private String name;
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
public Long getId() {
|
||||||
|
return id;
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @param id
|
||||||
|
*/
|
||||||
|
public void setId(Long id) {
|
||||||
|
this.id = id;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 是否删除状态,1:删除,0:有效
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
public Integer getIsDelete() {
|
||||||
|
return isDelete;
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* 是否删除状态,1:删除,0:有效
|
||||||
|
* @param isDelete
|
||||||
|
*/
|
||||||
|
public void setIsDelete(Integer isDelete) {
|
||||||
|
this.isDelete = isDelete;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 创建时间
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
public Date getGmtCreate() {
|
||||||
|
return gmtCreate;
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* 创建时间
|
||||||
|
* @param gmtCreate
|
||||||
|
*/
|
||||||
|
public void setGmtCreate(Date gmtCreate) {
|
||||||
|
this.gmtCreate = gmtCreate;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 最后修改时间
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
public Date getGmtModified() {
|
||||||
|
return gmtModified;
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* 最后修改时间
|
||||||
|
* @param gmtModified
|
||||||
|
*/
|
||||||
|
public void setGmtModified(Date gmtModified) {
|
||||||
|
this.gmtModified = gmtModified;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 流程名称
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
public String getName() {
|
||||||
|
return name;
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* 流程名称
|
||||||
|
* @param name
|
||||||
|
*/
|
||||||
|
public void setName(String name) {
|
||||||
|
this.name = name;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String toString() {
|
||||||
|
return "FlowManager{" +
|
||||||
|
",id=" + id +
|
||||||
|
",isDelete=" + isDelete +
|
||||||
|
",gmtCreate=" + gmtCreate +
|
||||||
|
",gmtModified=" + gmtModified +
|
||||||
|
",name=" + name +
|
||||||
|
"}";
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -0,0 +1,40 @@
|
|||||||
|
package com.lz.modules.flow.service;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.extension.service.IService;
|
||||||
|
import com.lz.common.utils.PageUtils;
|
||||||
|
import com.lz.modules.flow.entity.FlowManager;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* <p>
|
||||||
|
* 流程管理表 服务类
|
||||||
|
* </p>
|
||||||
|
*
|
||||||
|
* @author quyixiao
|
||||||
|
* @since 2020-09-22
|
||||||
|
*/
|
||||||
|
public interface FlowManagerService extends IService<FlowManager> {
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
FlowManager selectFlowManagerById(Long id);
|
||||||
|
|
||||||
|
|
||||||
|
Long insertFlowManager(FlowManager flowManager);
|
||||||
|
|
||||||
|
|
||||||
|
int updateFlowManagerById(FlowManager flowManager);
|
||||||
|
|
||||||
|
|
||||||
|
int updateCoverFlowManagerById(FlowManager flowManager);
|
||||||
|
|
||||||
|
|
||||||
|
int deleteFlowManagerById(Long id);
|
||||||
|
|
||||||
|
|
||||||
|
PageUtils queryPage(Map<String, Object> params);
|
||||||
|
|
||||||
|
void deleteBatchIds(List<Long> asList);
|
||||||
|
}
|
||||||
@ -0,0 +1,84 @@
|
|||||||
|
package com.lz.modules.flow.service.impl;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||||
|
import com.lz.common.utils.NumberUtil;
|
||||||
|
import com.lz.common.utils.PageUtils;
|
||||||
|
import com.lz.modules.flow.dao.FlowManagerMapper;
|
||||||
|
import com.lz.modules.flow.entity.FlowManager;
|
||||||
|
import com.lz.modules.flow.service.FlowManagerService;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* <p>
|
||||||
|
* 流程管理表 服务类
|
||||||
|
* </p>
|
||||||
|
*
|
||||||
|
* @author quyixiao
|
||||||
|
* @since 2020-09-22
|
||||||
|
*/
|
||||||
|
|
||||||
|
@Service
|
||||||
|
public class FlowManagerServiceImpl extends ServiceImpl<FlowManagerMapper, FlowManager> implements FlowManagerService {
|
||||||
|
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private FlowManagerMapper flowManagerMapper;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public FlowManager selectFlowManagerById(Long id){
|
||||||
|
return flowManagerMapper.selectFlowManagerById(id);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Long insertFlowManager(FlowManager flowManager){
|
||||||
|
return flowManagerMapper.insertFlowManager(flowManager);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int updateFlowManagerById(FlowManager flowManager){
|
||||||
|
return flowManagerMapper.updateFlowManagerById(flowManager);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int updateCoverFlowManagerById(FlowManager flowManager){
|
||||||
|
return flowManagerMapper.updateCoverFlowManagerById(flowManager);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int deleteFlowManagerById(Long id){
|
||||||
|
return flowManagerMapper.deleteFlowManagerById(id);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public PageUtils queryPage(Map<String, Object> params) {
|
||||||
|
|
||||||
|
PageUtils pageUtils = PageUtils.startPage(
|
||||||
|
NumberUtil.objToIntDefault(params.get("page"), 1),
|
||||||
|
NumberUtil.objToIntDefault(params.get("limit"), 10)).doSelect(
|
||||||
|
page -> flowManagerMapper.selectByCondition(page, params)
|
||||||
|
);
|
||||||
|
|
||||||
|
return pageUtils;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void deleteBatchIds(List<Long> asList) {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
79
src/main/resources/mapper/flow/FlowManagerMapper.xml
Normal file
79
src/main/resources/mapper/flow/FlowManagerMapper.xml
Normal file
@ -0,0 +1,79 @@
|
|||||||
|
<?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.lz.modules.flow.dao.FlowManagerMapper">
|
||||||
|
|
||||||
|
<!-- 通用查询映射结果 -->
|
||||||
|
<resultMap id="BaseResultMap" type="com.lz.modules.flow.entity.FlowManager">
|
||||||
|
<id column="id" property="id"/>
|
||||||
|
<result column="is_delete" property="isDelete"/>
|
||||||
|
<result column="gmt_create" property="gmtCreate"/>
|
||||||
|
<result column="gmt_modified" property="gmtModified"/>
|
||||||
|
<result column="name" property="name"/>
|
||||||
|
</resultMap>
|
||||||
|
|
||||||
|
|
||||||
|
<!-- 通用查询结果列 -->
|
||||||
|
<sql id="Base_Column_List">
|
||||||
|
id AS id, is_delete AS isDelete, gmt_create AS gmtCreate, gmt_modified AS gmtModified, name AS name
|
||||||
|
</sql>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
<select id="selectFlowManagerById" resultType="FlowManager" >
|
||||||
|
select * from lz_flow_manager where id=#{id} and is_delete = 0 limit 1
|
||||||
|
</select>
|
||||||
|
|
||||||
|
|
||||||
|
<insert id="insertFlowManager" parameterType="FlowManager" useGeneratedKeys="true" keyProperty="id" >
|
||||||
|
insert into lz_flow_manager(
|
||||||
|
<if test="name != null">name, </if>
|
||||||
|
is_delete,
|
||||||
|
gmt_create,
|
||||||
|
gmt_modified
|
||||||
|
)values(
|
||||||
|
<if test="name != null">#{ name}, </if>
|
||||||
|
0,
|
||||||
|
now(),
|
||||||
|
now()
|
||||||
|
)
|
||||||
|
</insert>
|
||||||
|
|
||||||
|
|
||||||
|
<update id="updateFlowManagerById" parameterType="FlowManager" >
|
||||||
|
update
|
||||||
|
lz_flow_manager
|
||||||
|
<trim prefix="set" suffixOverrides=",">
|
||||||
|
<if test="isDelete != null">is_delete = #{isDelete},</if>
|
||||||
|
<if test="gmtCreate != null">gmt_create = #{gmtCreate},</if>
|
||||||
|
<if test="name != null">name = #{name}</if>
|
||||||
|
</trim>
|
||||||
|
,gmt_modified = now()
|
||||||
|
where id = #{id}
|
||||||
|
</update>
|
||||||
|
|
||||||
|
|
||||||
|
<update id="updateCoverFlowManagerById" parameterType="FlowManager" >
|
||||||
|
update
|
||||||
|
lz_flow_manager
|
||||||
|
set
|
||||||
|
is_delete = #{isDelete},
|
||||||
|
gmt_create = #{gmtCreate},
|
||||||
|
name = #{name}
|
||||||
|
,gmt_modified = now()
|
||||||
|
where id = #{id}
|
||||||
|
</update>
|
||||||
|
|
||||||
|
|
||||||
|
<update id="deleteFlowManagerById" parameterType="java.lang.Long">
|
||||||
|
update lz_flow_manager set is_delete = 1 where id=#{id} limit 1
|
||||||
|
</update>
|
||||||
|
|
||||||
|
|
||||||
|
<select id="selectByCondition" resultType="com.lz.modules.flow.entity.FlowManager">
|
||||||
|
select * from lz_flow_manager where is_delete = 0
|
||||||
|
</select>
|
||||||
|
|
||||||
|
|
||||||
|
</mapper>
|
||||||
|
|
||||||
@ -43,3 +43,21 @@ INSERT INTO `sys_menu` (`parent_id`, `name`, `url`, `perms`, `type`, `icon`, `or
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
-- 菜单SQL
|
||||||
|
INSERT INTO `sys_menu` (`parent_id`, `name`, `url`, `perms`, `type`, `icon`, `order_num`)
|
||||||
|
VALUES ('55', '流程管理表', 'user/lzflowmanager', NULL, '1', 'config', '6');
|
||||||
|
|
||||||
|
-- 按钮父菜单ID
|
||||||
|
set @parentId = @@identity;
|
||||||
|
|
||||||
|
|
||||||
|
-- 菜单对应按钮SQL
|
||||||
|
INSERT INTO `sys_menu` (`parent_id`, `name`, `url`, `perms`, `type`, `icon`, `order_num`)
|
||||||
|
SELECT @parentId, '查看', null, 'user:lzflowmanager:list,user:lzflowmanager:info', '2', null, '6';
|
||||||
|
INSERT INTO `sys_menu` (`parent_id`, `name`, `url`, `perms`, `type`, `icon`, `order_num`)
|
||||||
|
SELECT @parentId, '新增', null, 'user:lzflowmanager:save', '2', null, '6';
|
||||||
|
INSERT INTO `sys_menu` (`parent_id`, `name`, `url`, `perms`, `type`, `icon`, `order_num`)
|
||||||
|
SELECT @parentId, '修改', null, 'user:lzflowmanager:update', '2', null, '6';
|
||||||
|
INSERT INTO `sys_menu` (`parent_id`, `name`, `url`, `perms`, `type`, `icon`, `order_num`)
|
||||||
|
SELECT @parentId, '删除', null, 'user:lzflowmanager:delete', '2', null, '6';
|
||||||
|
|||||||
@ -51,7 +51,7 @@ public class Create {
|
|||||||
}
|
}
|
||||||
public static void main(String[] args) {
|
public static void main(String[] args) {
|
||||||
Create ot=new Create();
|
Create ot=new Create();
|
||||||
String [] tableNames = {"lz_record_role"};
|
String [] tableNames = {"lz_flow_manager"};
|
||||||
try {
|
try {
|
||||||
ot.generatorCode(tableNames);
|
ot.generatorCode(tableNames);
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
|
|||||||
@ -63,7 +63,7 @@ public class MysqlMain {
|
|||||||
}
|
}
|
||||||
List<TablesBean> list = new ArrayList<TablesBean>();
|
List<TablesBean> list = new ArrayList<TablesBean>();
|
||||||
|
|
||||||
list.add(new TablesBean("lz_flow_record"));
|
list.add(new TablesBean("lz_flow_manager"));
|
||||||
|
|
||||||
List<TablesBean> list2 = new ArrayList<TablesBean>();
|
List<TablesBean> list2 = new ArrayList<TablesBean>();
|
||||||
Map<String, String> map = MysqlUtil2ShowCreateTable.getComments();
|
Map<String, String> map = MysqlUtil2ShowCreateTable.getComments();
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user