This commit is contained in:
parent
507ddbeef1
commit
284263e3e7
|
|
@ -0,0 +1,217 @@
|
|||
<?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.pwc.cn.crmsystem.mapper.UserMapper">
|
||||
|
||||
|
||||
<!-- <select id="getUserByUserId" resultMap="CrmUserResult" parameterType="Long">-->
|
||||
<select id="selectUserPassWordByUserId" resultType="String" parameterType="Long">
|
||||
select password
|
||||
from crm_user
|
||||
where id = #{userId}
|
||||
</select>
|
||||
<select id="selectUserByUserName" resultType="com.pwc.cn.crmsystem.pojo.dto.UserDto" parameterType="String">
|
||||
select id,username
|
||||
from crm_user
|
||||
where username = #{userName}
|
||||
</select>
|
||||
<resultMap id="CrmUserResult" type="com.pwc.cn.crmsystem.pojo.vo.UserVo">
|
||||
<id column="id" property="userId"/>
|
||||
<result column="username" property="userName"/>
|
||||
<result column="email" property="email"/>
|
||||
<result column="dept_type" property="deptType"/>
|
||||
<result column="status" property="status"/>
|
||||
<result column="phone" property="phone"/>
|
||||
<result column="phone_type" property="phoneType"/>
|
||||
<result column="position" property="position"/>
|
||||
<result column="create_time" property="createTime"/>
|
||||
<collection property="deptIds" column="id" select="selectDeptIds"/>
|
||||
<collection property="roleIds" column="id" select="selectRoleIds"/>
|
||||
</resultMap>
|
||||
<select id="selectUserList" resultMap="CrmUserResult" parameterType="java.util.Map">
|
||||
select
|
||||
id,
|
||||
username,
|
||||
email,
|
||||
dept_type,
|
||||
status,
|
||||
phone,
|
||||
phone_type,
|
||||
position,
|
||||
create_time
|
||||
from crm_user
|
||||
<where>
|
||||
<if test="params.userName!=null and params.userName!=''">
|
||||
and username like concat('%/', #{params.userName}, '%') escape '/'
|
||||
</if>
|
||||
<if test="params.status!=null and params.status!=''">
|
||||
and status = #{params.status}
|
||||
</if>
|
||||
<if test="params.deptId != -1">
|
||||
and id in (select user_id from crm_user_dept where dept_id = #{params.deptId})
|
||||
</if>
|
||||
</where>
|
||||
</select>
|
||||
<select id="selectUserById" resultMap="CrmUserResult">
|
||||
select id,
|
||||
username,
|
||||
email,
|
||||
dept_type,
|
||||
status,
|
||||
phone,
|
||||
phone_type,
|
||||
position,
|
||||
create_time
|
||||
from crm_user
|
||||
where id = #{userId}
|
||||
</select>
|
||||
<select id="selectUserListToDept" resultMap="CrmUserResult">
|
||||
select
|
||||
id,
|
||||
username,
|
||||
email,
|
||||
dept_type,
|
||||
status,
|
||||
phone,
|
||||
phone_type,
|
||||
position,
|
||||
create_time
|
||||
from crm_user
|
||||
where id in
|
||||
<foreach collection="list" item="item" open="(" close=")" separator="," index="index">
|
||||
#{item}
|
||||
</foreach>
|
||||
</select>
|
||||
<select id="selectDeptIds" resultType="Long">
|
||||
select dept_id
|
||||
from crm_user_dept
|
||||
where user_id = #{userId}
|
||||
</select>
|
||||
<select id="selectRoleIds" resultType="Long">
|
||||
select role_id
|
||||
from crm_user_role
|
||||
where user_id = #{userId}
|
||||
</select>
|
||||
<select id="selectCountDeptUserByDeptId" resultType="java.lang.Integer">
|
||||
select count(*)
|
||||
from crm_user_dept cud
|
||||
left join crm_user_role cur on cur.user_id = cud.user_id
|
||||
where dept_id = #{deptId} and cur.role_id = 3
|
||||
</select>
|
||||
<select id="selectUserListToDeptId" resultType="com.pwc.cn.crmsystem.pojo.vo.UserVo">
|
||||
select
|
||||
cu.id as userId,
|
||||
cu.username,
|
||||
cu.email,
|
||||
cu.dept_type,
|
||||
cu.status,
|
||||
cu.phone,
|
||||
cu.phone_type,
|
||||
cu.position,
|
||||
cu.create_time
|
||||
from crm_user cu
|
||||
left join crm_user_dept cud on cu.id = cud.user_id
|
||||
left join crm_user_role cur on cu.id = cur.user_id
|
||||
where cud.dept_id = #{deptId}
|
||||
and cur.role_id = 3
|
||||
order by cu.create_time
|
||||
</select>
|
||||
|
||||
<insert id="insertUser" parameterType="com.pwc.cn.crmsystem.pojo.CrmUser" useGeneratedKeys="true" keyProperty="id">
|
||||
insert into crm_user
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="username != null and username !=''">username,</if>
|
||||
<if test="email != null and email !=''">email,</if>
|
||||
<if test="phone != null">phone,</if>
|
||||
<if test="phoneType != null and phoneType !=''">phone_type,</if>
|
||||
<if test="sex != null and sex !=''">sex,</if>
|
||||
<if test="avatar != null and avatar !=''">avatar,</if>
|
||||
<if test="password != null and password !=''">password,</if>
|
||||
<if test="status != null and status !=''">status,</if>
|
||||
<if test="deptType != null and deptType !=''">dept_type,</if>
|
||||
<if test="position != null">position,</if>
|
||||
<if test="delFlag != null and delFlag !=''">del_flag,</if>
|
||||
<if test="createBy != null">create_by,</if>
|
||||
<if test="createTime != null">create_time,</if>
|
||||
<if test="updateBy != null">update_by,</if>
|
||||
<if test="updateTime != null">update_time,</if>
|
||||
<if test="remark != null and remark !=''">remark</if>
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
<if test="username != null and username !=''">#{username},</if>
|
||||
<if test="email != null and email !=''">#{email},</if>
|
||||
<if test="phone != null">#{phone},</if>
|
||||
<if test="phoneType != null and phoneType !=''">#{phoneType},</if>
|
||||
<if test="sex != null and sex !=''">#{sex},</if>
|
||||
<if test="avatar != null and avatar !=''">#{avatar},</if>
|
||||
<if test="password != null and password !=''">#{password},</if>
|
||||
<if test="status != null and status !=''">#{status},</if>
|
||||
<if test="deptType != null and deptType !=''">#{deptType},</if>
|
||||
<if test="position != null">#{position},</if>
|
||||
<if test="delFlag != null and delFlag !=''">#{delFlag},</if>
|
||||
<if test="createBy != null">#{createBy},</if>
|
||||
<if test="createTime != null">#{createTime},</if>
|
||||
<if test="updateBy != null">#{updateBy},</if>
|
||||
<if test="updateTime != null">#{updateTime},</if>
|
||||
<if test="remark != null and remark !=''">#{remark},</if>
|
||||
</trim>
|
||||
</insert>
|
||||
|
||||
<insert id="insertUserRole" parameterType="Long">
|
||||
insert into crm_user_role (user_id, role_id) value (#{userId}, #{roleId})
|
||||
</insert>
|
||||
|
||||
|
||||
<insert id="insertUserRoles">
|
||||
insert into crm_user_role (user_id, role_id) values
|
||||
<foreach collection="list" separator="," item="item">
|
||||
(#{item.userId},#{item.roleId})
|
||||
</foreach>
|
||||
</insert>
|
||||
<insert id="insertUserDept">
|
||||
insert into crm_user_dept (user_id, dept_id) values
|
||||
<foreach collection="list" separator="," item="item">
|
||||
(#{item.userId},#{item.deptId})
|
||||
</foreach>
|
||||
</insert>
|
||||
|
||||
<delete id="deleteUserRoleByUserId">
|
||||
delete
|
||||
from crm_user_role
|
||||
where user_id = #{userId}
|
||||
</delete>
|
||||
|
||||
<delete id="deleteUserDeptByUserId">
|
||||
delete
|
||||
from crm_user_dept
|
||||
where user_id = #{userId}
|
||||
</delete>
|
||||
|
||||
<update id="updateUserByUserId" parameterType="com.pwc.cn.crmsystem.pojo.CrmUser">
|
||||
update crm_user
|
||||
<set>
|
||||
<if test="username != null and username !=''">username = #{username},</if>
|
||||
<if test="email != null and email !=''">email = #{email},</if>
|
||||
<if test="phone != null">phone = #{phone},</if>
|
||||
<if test="phoneType != null">phone_type = #{phoneType},</if>
|
||||
<if test="sex != null and sex !=''">sex = #{sex},</if>
|
||||
<if test="avatar != null and avatar !=''">avatar = #{avatar},</if>
|
||||
<if test="password != null and password !=''">password = #{password},</if>
|
||||
<if test="status != null and status !=''">status = #{status},</if>
|
||||
<if test="deptType != null and deptType !=''">dept_type = #{deptType},</if>
|
||||
<if test="position != null">position = #{position},</if>
|
||||
<if test="delFlag != null and delFlag !=''">del_flag = #{delFlag},</if>
|
||||
<if test="updateBy != null">update_by = #{updateBy},</if>
|
||||
<if test="remark != null and remark !=''">remark = #{remark},</if>
|
||||
update_time = sysdate()
|
||||
</set>
|
||||
where id = #{id}
|
||||
</update>
|
||||
|
||||
<delete id="deleteUserByUserId">
|
||||
delete from crm_user where id = #{userId}
|
||||
<if test="deptType != null and deptType != ''">
|
||||
and dept_type = #{deptType}
|
||||
</if>
|
||||
</delete>
|
||||
|
||||
</mapper>
|
||||
|
|
@ -1,55 +0,0 @@
|
|||
package cn.odliken.flow.controller;
|
||||
|
||||
|
||||
import cn.odliken.flow.comment.Result;
|
||||
import cn.odliken.flow.pojo.Flow;
|
||||
import cn.odliken.flow.pojo.GroupsBo;
|
||||
import cn.odliken.flow.service.FlowService;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.UUID;
|
||||
|
||||
@RestController
|
||||
@RequestMapping("/flow")
|
||||
public class FlowController {
|
||||
|
||||
@Autowired
|
||||
private FlowService flowService;
|
||||
|
||||
|
||||
|
||||
@GetMapping("/detail/{formId}")
|
||||
public Result<Flow> detail(@PathVariable String formId){
|
||||
return Result.ok(flowService.selectFlowByFormId(formId));
|
||||
}
|
||||
|
||||
|
||||
@PostMapping("/add")
|
||||
public Result<String> add(@RequestBody Flow flow){
|
||||
flow.setFormId(UUID.randomUUID().toString());
|
||||
flow.setIsStop(1);
|
||||
flow.setIsStop(1);
|
||||
flowService.insertFlow(flow);
|
||||
return Result.ok();
|
||||
}
|
||||
|
||||
|
||||
@GetMapping("/list")
|
||||
public Result<List<GroupsBo>> groups(){
|
||||
return Result.ok(flowService.getGroups());
|
||||
}
|
||||
|
||||
|
||||
@PutMapping("/edit")
|
||||
public Result<String> edit(Flow flow){
|
||||
if (StringUtils.isNotEmpty(flow.getFormId())){
|
||||
return Result.error("id不能为空");
|
||||
}
|
||||
|
||||
return Result.ok();
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,62 @@
|
|||
package cn.odliken.flow.controller;
|
||||
|
||||
|
||||
import cn.odliken.flow.comment.Result;
|
||||
import cn.odliken.flow.pojo.FlowData;
|
||||
import cn.odliken.flow.pojo.FlowGroupBo;
|
||||
import cn.odliken.flow.service.FlowDataService;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.UUID;
|
||||
|
||||
@RestController
|
||||
@RequestMapping("/flow/data")
|
||||
public class FlowDataController {
|
||||
|
||||
@Autowired
|
||||
private FlowDataService flowDataService;
|
||||
|
||||
|
||||
@GetMapping("/{formId}")
|
||||
public Result<FlowData> detail(@PathVariable String formId) {
|
||||
return Result.ok(flowDataService.selectFlowByFormId(formId));
|
||||
}
|
||||
|
||||
@PostMapping
|
||||
public Result<String> add(@RequestBody FlowData flowData) {
|
||||
flowData.setFormId(UUID.randomUUID().toString());
|
||||
flowData.setIsStop(0);
|
||||
flowData.setIsStop(0);
|
||||
flowDataService.insertFlow(flowData);
|
||||
return Result.ok();
|
||||
}
|
||||
|
||||
|
||||
@GetMapping("/list")
|
||||
public Result<List<FlowGroupBo>> groups(FlowData flowData) {
|
||||
return Result.ok(flowDataService.getGroups(flowData));
|
||||
}
|
||||
|
||||
|
||||
@PutMapping
|
||||
public Result<Integer> edit(@RequestBody FlowData flowData) {
|
||||
if (StringUtils.isEmpty(flowData.getFormId())) {
|
||||
return Result.error("id不能为空");
|
||||
}
|
||||
flowDataService.updateFlow(flowData);
|
||||
return Result.ok();
|
||||
}
|
||||
|
||||
@DeleteMapping("/{id}")
|
||||
public Result<Integer> del(@PathVariable String id) {
|
||||
if (StringUtils.isEmpty(id)) {
|
||||
return Result.error();
|
||||
}
|
||||
flowDataService.deleteById(id);
|
||||
return Result.ok();
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,59 @@
|
|||
package cn.odliken.flow.controller;
|
||||
|
||||
|
||||
import cn.odliken.flow.comment.Result;
|
||||
import cn.odliken.flow.pojo.FlowGroup;
|
||||
import cn.odliken.flow.service.FlowGroupService;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.List;
|
||||
|
||||
@RestController
|
||||
@RequestMapping("/flow/group")
|
||||
public class FlowGroupController {
|
||||
|
||||
|
||||
@Resource
|
||||
private FlowGroupService flowGroupService;
|
||||
|
||||
|
||||
@GetMapping("/{id}")
|
||||
public Result<FlowGroup> info(@PathVariable long id) {
|
||||
return Result.ok(flowGroupService.getGroupById(id));
|
||||
}
|
||||
|
||||
|
||||
@GetMapping("/list")
|
||||
public Result<List<FlowGroup>> list() {
|
||||
return Result.ok(flowGroupService.getGroupsList());
|
||||
}
|
||||
|
||||
|
||||
@PostMapping
|
||||
public Result<Integer> add(@RequestBody FlowGroup flowGroup) {
|
||||
flowGroupService.insertGroups(flowGroup);
|
||||
return Result.ok();
|
||||
}
|
||||
|
||||
@PutMapping
|
||||
public Result<Integer> edit(@RequestBody FlowGroup flowGroup) {
|
||||
if (flowGroup.getId() < 0) {
|
||||
return Result.error();
|
||||
}
|
||||
flowGroupService.updateGroup(flowGroup);
|
||||
return Result.ok();
|
||||
}
|
||||
|
||||
|
||||
@DeleteMapping("/{id}")
|
||||
public Result<Integer> del(@PathVariable long id) {
|
||||
if (id < 0) {
|
||||
return Result.error();
|
||||
}
|
||||
flowGroupService.deleteGroupById(id);
|
||||
return Result.ok();
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
|
@ -1,24 +0,0 @@
|
|||
package cn.odliken.flow.controller;
|
||||
|
||||
|
||||
import cn.odliken.flow.comment.Result;
|
||||
import cn.odliken.flow.pojo.Groups;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
@RestController
|
||||
@RequestMapping("/group")
|
||||
public class GroupController {
|
||||
|
||||
|
||||
|
||||
@GetMapping
|
||||
public Result<Groups> list(){
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,25 @@
|
|||
package cn.odliken.flow.mapper;
|
||||
|
||||
import cn.odliken.flow.pojo.FlowData;
|
||||
import cn.odliken.flow.pojo.FlowGroupBo;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
|
||||
public interface FlowDataMapper {
|
||||
|
||||
FlowData selectFlowByFromId(@Param("formId") String formId);
|
||||
|
||||
List<FlowGroupBo> getGroups(FlowData flowData);
|
||||
|
||||
int insertFlow(FlowData flowData);
|
||||
|
||||
int updateFlow(FlowData flowData);
|
||||
|
||||
int deleteById(@Param("formId") String formId);
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,22 @@
|
|||
package cn.odliken.flow.mapper;
|
||||
|
||||
import cn.odliken.flow.pojo.FlowGroup;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public interface FlowGroupMapper {
|
||||
|
||||
List<FlowGroup> getGroupsList();
|
||||
|
||||
|
||||
int insertGroups(FlowGroup flowGroup);
|
||||
|
||||
FlowGroup getGroupById(@Param("id") long id);
|
||||
|
||||
int updateGroup(FlowGroup flowGroup);
|
||||
|
||||
int deleteGroupById(@Param("id") long id);
|
||||
|
||||
|
||||
}
|
||||
|
|
@ -1,22 +0,0 @@
|
|||
package cn.odliken.flow.mapper;
|
||||
|
||||
import cn.odliken.flow.pojo.Flow;
|
||||
import cn.odliken.flow.pojo.GroupsBo;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
|
||||
public interface FlowMapper {
|
||||
|
||||
Flow selectFlowByFromId(@Param("formId") String formId);
|
||||
|
||||
List<GroupsBo> getGroups();
|
||||
|
||||
|
||||
int insertFlow(Flow flow);
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
|
@ -1,15 +0,0 @@
|
|||
package cn.odliken.flow.mapper;
|
||||
|
||||
import cn.odliken.flow.pojo.GroupsBo;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public interface GroupMapper {
|
||||
|
||||
List<GroupsBo> getGroupsList();
|
||||
|
||||
|
||||
int insertGroups();
|
||||
|
||||
|
||||
}
|
||||
|
|
@ -3,7 +3,7 @@ package cn.odliken.flow.pojo;
|
|||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
public class Flow {
|
||||
public class FlowData {
|
||||
private String created;
|
||||
private String formId;
|
||||
private String formItems;
|
||||
|
|
@ -3,7 +3,7 @@ package cn.odliken.flow.pojo;
|
|||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
public class FlowVo {
|
||||
public class FlowDataVo {
|
||||
private String created;
|
||||
private String formId;
|
||||
private String formItems;
|
||||
|
|
@ -3,7 +3,7 @@ package cn.odliken.flow.pojo;
|
|||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
public class Groups {
|
||||
public class FlowGroup {
|
||||
private long id;
|
||||
private String name;
|
||||
}
|
||||
|
|
@ -5,8 +5,8 @@ import lombok.Data;
|
|||
import java.util.List;
|
||||
|
||||
@Data
|
||||
public class GroupsBo {
|
||||
public class FlowGroupBo {
|
||||
private long id;
|
||||
private String name;
|
||||
private List<Flow> items;
|
||||
private List<FlowData> items;
|
||||
}
|
||||
|
|
@ -0,0 +1,23 @@
|
|||
package cn.odliken.flow.service;
|
||||
|
||||
import cn.odliken.flow.pojo.FlowData;
|
||||
import cn.odliken.flow.pojo.FlowGroupBo;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public interface FlowDataService {
|
||||
|
||||
|
||||
int insertFlow(FlowData flowData);
|
||||
|
||||
|
||||
FlowData selectFlowByFormId(String formId);
|
||||
|
||||
|
||||
List<FlowGroupBo> getGroups(FlowData flowData);
|
||||
|
||||
int updateFlow(FlowData flowData);
|
||||
|
||||
|
||||
int deleteById(String formId);
|
||||
}
|
||||
|
|
@ -0,0 +1,21 @@
|
|||
package cn.odliken.flow.service;
|
||||
|
||||
import cn.odliken.flow.pojo.FlowGroup;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public interface FlowGroupService {
|
||||
|
||||
List<FlowGroup> getGroupsList();
|
||||
|
||||
|
||||
int insertGroups(FlowGroup flowGroup);
|
||||
|
||||
FlowGroup getGroupById(long id);
|
||||
|
||||
int updateGroup(FlowGroup flowGroup);
|
||||
|
||||
int deleteGroupById(long id);
|
||||
|
||||
|
||||
}
|
||||
|
|
@ -1,23 +0,0 @@
|
|||
package cn.odliken.flow.service;
|
||||
|
||||
import cn.odliken.flow.pojo.Flow;
|
||||
import cn.odliken.flow.pojo.GroupsBo;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public interface FlowService {
|
||||
|
||||
|
||||
|
||||
|
||||
int insertFlow(Flow flow);
|
||||
|
||||
|
||||
|
||||
Flow selectFlowByFormId(String formId);
|
||||
|
||||
|
||||
List<GroupsBo> getGroups();
|
||||
|
||||
|
||||
}
|
||||
|
|
@ -1,4 +0,0 @@
|
|||
package cn.odliken.flow.service;
|
||||
|
||||
public interface GroupService {
|
||||
}
|
||||
|
|
@ -0,0 +1,42 @@
|
|||
package cn.odliken.flow.service.impl;
|
||||
|
||||
import cn.odliken.flow.mapper.FlowDataMapper;
|
||||
import cn.odliken.flow.pojo.FlowData;
|
||||
import cn.odliken.flow.pojo.FlowGroupBo;
|
||||
import cn.odliken.flow.service.FlowDataService;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.List;
|
||||
|
||||
@Service
|
||||
public class FlowDataServiceImpl implements FlowDataService {
|
||||
|
||||
@Resource
|
||||
private FlowDataMapper flowDataMapper;
|
||||
|
||||
@Override
|
||||
public int insertFlow(FlowData flowData) {
|
||||
return flowDataMapper.insertFlow(flowData);
|
||||
}
|
||||
|
||||
@Override
|
||||
public FlowData selectFlowByFormId(String formId) {
|
||||
return flowDataMapper.selectFlowByFromId(formId);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<FlowGroupBo> getGroups(FlowData flowData) {
|
||||
return flowDataMapper.getGroups(flowData);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int updateFlow(FlowData flowData) {
|
||||
return flowDataMapper.updateFlow(flowData);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int deleteById(String formId) {
|
||||
return flowDataMapper.deleteById(formId);
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,41 @@
|
|||
package cn.odliken.flow.service.impl;
|
||||
|
||||
import cn.odliken.flow.mapper.FlowGroupMapper;
|
||||
import cn.odliken.flow.pojo.FlowGroup;
|
||||
import cn.odliken.flow.service.FlowGroupService;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.List;
|
||||
|
||||
@Service
|
||||
public class FlowGroupServiceImpl implements FlowGroupService {
|
||||
|
||||
@Resource
|
||||
private FlowGroupMapper flowGroupMapper;
|
||||
|
||||
@Override
|
||||
public List<FlowGroup> getGroupsList() {
|
||||
return flowGroupMapper.getGroupsList();
|
||||
}
|
||||
|
||||
@Override
|
||||
public int insertGroups(FlowGroup flowGroup) {
|
||||
return flowGroupMapper.insertGroups(flowGroup);
|
||||
}
|
||||
|
||||
@Override
|
||||
public FlowGroup getGroupById(long id) {
|
||||
return flowGroupMapper.getGroupById(id);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int updateGroup(FlowGroup flowGroup) {
|
||||
return flowGroupMapper.updateGroup(flowGroup);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int deleteGroupById(long id) {
|
||||
return flowGroupMapper.deleteGroupById(id);
|
||||
}
|
||||
}
|
||||
|
|
@ -1,32 +0,0 @@
|
|||
package cn.odliken.flow.service.impl;
|
||||
|
||||
import cn.odliken.flow.mapper.FlowMapper;
|
||||
import cn.odliken.flow.pojo.Flow;
|
||||
import cn.odliken.flow.pojo.GroupsBo;
|
||||
import cn.odliken.flow.service.FlowService;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.List;
|
||||
|
||||
@Service
|
||||
public class FlowServiceImpl implements FlowService {
|
||||
|
||||
@Resource
|
||||
private FlowMapper flowMapper;
|
||||
|
||||
@Override
|
||||
public int insertFlow(Flow flow) {
|
||||
return flowMapper.insertFlow(flow);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Flow selectFlowByFormId(String formId) {
|
||||
return flowMapper.selectFlowByFromId(formId);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<GroupsBo> getGroups() {
|
||||
return flowMapper.getGroups();
|
||||
}
|
||||
}
|
||||
|
|
@ -1,12 +0,0 @@
|
|||
package cn.odliken.flow.service.impl;
|
||||
|
||||
import cn.odliken.flow.service.GroupService;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
|
||||
@Service
|
||||
public class GroupServiceImpl implements GroupService {
|
||||
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,124 @@
|
|||
<?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="cn.odliken.flow.mapper.FlowDataMapper">
|
||||
<resultMap id="GroupResult" type="cn.odliken.flow.pojo.FlowGroupBo">
|
||||
<id column="id" property="id"/>
|
||||
<result column="name" property="name"/>
|
||||
<collection property="items" ofType="cn.odliken.flow.pojo.FlowData">
|
||||
<id column="form_id" property="formId"/>
|
||||
<result column="created" property="created"/>
|
||||
<result column="form_items" property="formItems"/>
|
||||
<result column="form_name" property="formName"/>
|
||||
<result column="group_id" property="groupId"/>
|
||||
<result column="is_delete" property="isDelete"/>
|
||||
<result column="is_stop" property="isStop"/>
|
||||
<result column="logo" property="logo"/>
|
||||
<result column="process" property="process"/>
|
||||
<result column="remark" property="remark"/>
|
||||
<result column="settings" property="settings"/>
|
||||
<result column="sort" property="sort"/>
|
||||
</collection >
|
||||
</resultMap>
|
||||
|
||||
|
||||
<insert id="insertFlow" parameterType="cn.odliken.flow.pojo.FlowData">
|
||||
insert into flow_data
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="created != null and created !=''">created,</if>
|
||||
<if test="formId != null and formId !=''">form_id,</if>
|
||||
<if test="formItems != null and formItems !=''">form_items,</if>
|
||||
<if test="formName != null and formName !=''">form_name,</if>
|
||||
<if test="groupId != null and groupId !=''">group_id,</if>
|
||||
<if test="isDelete != null">is_delete,</if>
|
||||
<if test="isStop != null">is_stop,</if>
|
||||
<if test="logo != null and logo !=''">logo,</if>
|
||||
<if test="process != null and process !=''">flowData.process,</if>
|
||||
<if test="remark != null and remark !=''">remark,</if>
|
||||
<if test="settings != null and settings !=''">settings,</if>
|
||||
<if test="sort != null">sort,</if>
|
||||
<if test="updated != null and updated !=''">updated,</if>
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
<if test="created != null and created !=''">#{created},</if>
|
||||
<if test="formId != null and formId !=''">#{formId},</if>
|
||||
<if test="formItems != null and formItems !=''">#{formItems},</if>
|
||||
<if test="formName != null and formName !=''">#{formName},</if>
|
||||
<if test="groupId != null and groupId !=''">#{groupId},</if>
|
||||
<if test="isDelete != null">#{isDelete},</if>
|
||||
<if test="isStop != null">#{isStop},</if>
|
||||
<if test="logo != null and logo !=''">#{logo},</if>
|
||||
<if test="process != null and process !=''">#{process},</if>
|
||||
<if test="remark != null and remark !=''">#{remark},</if>
|
||||
<if test="settings != null and settings !=''">#{settings},</if>
|
||||
<if test="sort != null">#{sort},</if>
|
||||
<if test="updated != null and updated !=''">#{updated},</if>
|
||||
</trim>
|
||||
|
||||
|
||||
</insert>
|
||||
<update id="updateFlow" parameterType="cn.odliken.flow.pojo.FlowData">
|
||||
update flow_data
|
||||
<set>
|
||||
<if test="created != null and created !=''">created = #{created},</if>
|
||||
<if test="formItems != null and formItems !=''">form_items = #{formItems},</if>
|
||||
<if test="formName != null and formName !=''">form_name = #{formName},</if>
|
||||
<if test="groupId != null and groupId !=''">group_id = #{groupId},</if>
|
||||
<if test="isDelete != null">is_delete = #{isDelete},</if>
|
||||
<if test="isStop != null">is_stop = #{isStop},</if>
|
||||
<if test="logo != null and logo !=''">logo = #{logo},</if>
|
||||
<if test="process != null and process !=''">process = #{process},</if>
|
||||
<if test="remark != null and remark !=''">remark = #{remark},</if>
|
||||
<if test="settings != null and settings !=''">settings = #{settings},</if>
|
||||
<if test="sort != null">sort = #{sort},</if>
|
||||
<if test="updated != null and updated !=''">updated = #{updated},</if>
|
||||
</set>
|
||||
where form_id = #{formId}
|
||||
</update>
|
||||
<update id="deleteById">
|
||||
update flow_data set is_delete = 1 where form_id = #{formId}
|
||||
</update>
|
||||
|
||||
<select id="getGroups" resultMap="GroupResult">
|
||||
select
|
||||
id, name,
|
||||
form_id,
|
||||
form_items,
|
||||
form_name,
|
||||
group_id,
|
||||
is_stop,
|
||||
logo,
|
||||
process,
|
||||
remark,
|
||||
settings,
|
||||
sort,
|
||||
created,
|
||||
updated
|
||||
from flow_group g
|
||||
left join flow_data f on f.group_id = g.id
|
||||
<where>
|
||||
f.is_delete = 0 and g.is_delete = 0
|
||||
<if test="formName!=null and formName!=''">
|
||||
and form_name like concat('%/', #{formName}, '%') escape '/'
|
||||
</if>
|
||||
</where>
|
||||
</select>
|
||||
<select id="selectFlowByFromId" resultType="cn.odliken.flow.pojo.FlowData">
|
||||
select created,
|
||||
form_id,
|
||||
form_items,
|
||||
form_name,
|
||||
group_id,
|
||||
is_delete,
|
||||
is_stop,
|
||||
logo,
|
||||
process,
|
||||
remark,
|
||||
settings,
|
||||
sort,
|
||||
updated
|
||||
from flow_data
|
||||
where form_id = #{formId}
|
||||
</select>
|
||||
|
||||
|
||||
</mapper>
|
||||
|
|
@ -0,0 +1,39 @@
|
|||
<?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="cn.odliken.flow.mapper.FlowGroupMapper">
|
||||
|
||||
|
||||
<insert id="insertGroups">
|
||||
insert into flow_group
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="name != null and name !=''">name,</if>
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
<if test="name != null and name !=''">#{name},</if>
|
||||
</trim>
|
||||
</insert>
|
||||
<update id="updateGroup">
|
||||
update flow_group
|
||||
<set>
|
||||
<if test="name != null and name !=''">name = #{name},</if>
|
||||
</set>
|
||||
where id = #{id}
|
||||
</update>
|
||||
<update id="deleteGroupById">
|
||||
update flow_group
|
||||
set is_delete = 0
|
||||
</update>
|
||||
|
||||
<select id="getGroupsList" resultType="cn.odliken.flow.pojo.FlowGroup">
|
||||
select id, name
|
||||
from flow_group
|
||||
where is_delete = 0
|
||||
</select>
|
||||
<select id="getGroupById" resultType="cn.odliken.flow.pojo.FlowGroup">
|
||||
select id, name
|
||||
from flow_group
|
||||
where id = #{id}
|
||||
</select>
|
||||
|
||||
|
||||
</mapper>
|
||||
|
|
@ -1,100 +0,0 @@
|
|||
<?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="cn.odliken.flow.mapper.FlowMapper">
|
||||
<resultMap id="GroupResult" type="cn.odliken.flow.pojo.GroupsBo">
|
||||
<id column="id" property="id"/>
|
||||
<result column="name" property="name"/>
|
||||
<collection property="items" ofType="cn.odliken.flow.pojo.Flow">
|
||||
<id column="formId" property="formId"/>
|
||||
<result column="created" property="created"/>
|
||||
<result column="formItems" property="formItems"/>
|
||||
<result column="formName" property="formName"/>
|
||||
<result column="groupId" property="groupId"/>
|
||||
<result column="isDelete" property="isDelete"/>
|
||||
<result column="isStop" property="isStop"/>
|
||||
<result column="logo" property="logo"/>
|
||||
<result column="process" property="process"/>
|
||||
<result column="remark" property="remark"/>
|
||||
<result column="settings" property="settings"/>
|
||||
<result column="sort" property="sort"/>
|
||||
</collection >
|
||||
|
||||
</resultMap>
|
||||
|
||||
|
||||
<insert id="insertFlow" parameterType="cn.odliken.flow.pojo.Flow">
|
||||
insert into flow
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="created != null and created !=''">created,</if>
|
||||
<if test="formId != null and formId !=''">formId,</if>
|
||||
<if test="formItems != null and formItems !=''">formItems,</if>
|
||||
<if test="formName != null and formName !=''">formName,</if>
|
||||
<if test="groupId != null and groupId !=''">groupId,</if>
|
||||
<if test="isDelete != null and isDelete !=''">isDelete,</if>
|
||||
<if test="isStop != null and isStop !=''">isStop,</if>
|
||||
<if test="logo != null and logo !=''">logo,</if>
|
||||
<if test="process != null and process !=''">flow.process,</if>
|
||||
<if test="remark != null and remark !=''">remark,</if>
|
||||
<if test="settings != null and settings !=''">settings,</if>
|
||||
<if test="sort != null and sort !=''">sort,</if>
|
||||
<if test="updated != null and updated !=''">updated,</if>
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
<if test="created != null and created !=''">#{created},</if>
|
||||
<if test="formId != null and formId !=''">#{formId},</if>
|
||||
<if test="formItems != null and formItems !=''">#{formItems},</if>
|
||||
<if test="formName != null and formName !=''">#{formName},</if>
|
||||
<if test="groupId != null and groupId !=''">#{groupId},</if>
|
||||
<if test="isDelete != null and isDelete !=''">#{isDelete},</if>
|
||||
<if test="isStop != null and isStop !=''">#{isStop},</if>
|
||||
<if test="logo != null and logo !=''">#{logo},</if>
|
||||
<if test="process != null and process !=''">#{process},</if>
|
||||
<if test="remark != null and remark !=''">#{remark},</if>
|
||||
<if test="settings != null and settings !=''">#{settings},</if>
|
||||
<if test="sort != null and sort !=''">#{sort},</if>
|
||||
<if test="updated != null and updated !=''">#{updated},</if>
|
||||
</trim>
|
||||
|
||||
|
||||
</insert>
|
||||
|
||||
<select id="getGroups" resultMap="GroupResult">
|
||||
select
|
||||
id, name,
|
||||
formId,
|
||||
formItems,
|
||||
formName,
|
||||
groupId,
|
||||
isDelete,
|
||||
isStop,
|
||||
logo,
|
||||
process,
|
||||
remark,
|
||||
settings,
|
||||
sort,
|
||||
created,
|
||||
updated
|
||||
from flowable_group g
|
||||
left join flow f on f.groupId = g.id
|
||||
|
||||
</select>
|
||||
<select id="selectFlowByFromId" resultType="cn.odliken.flow.pojo.Flow">
|
||||
select created,
|
||||
formId,
|
||||
formItems,
|
||||
formName,
|
||||
groupId,
|
||||
isDelete,
|
||||
isStop,
|
||||
logo,
|
||||
process,
|
||||
remark,
|
||||
settings,
|
||||
sort,
|
||||
updated
|
||||
from flow
|
||||
where formId = #{formId}
|
||||
</select>
|
||||
|
||||
|
||||
</mapper>
|
||||
|
|
@ -1,23 +0,0 @@
|
|||
<?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="cn.odliken.flow.mapper.GroupMapper">
|
||||
|
||||
|
||||
|
||||
<insert id="insertGroups">
|
||||
insert into flowable_group
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="name != null and name !=''">name,</if>
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
<if test="name != null and name !=''">#{name},</if>
|
||||
</trim>
|
||||
</insert>
|
||||
|
||||
<select id="getGroupsList" resultType="cn.odliken.flow.pojo.GroupsBo">
|
||||
select id, name
|
||||
from flowable_group
|
||||
</select>
|
||||
|
||||
|
||||
</mapper>
|
||||
|
|
@ -1824,16 +1824,6 @@
|
|||
"integrity": "sha1-4a1IbmxUUBY0xsOXxcEh2qODYHw=",
|
||||
"dev": true
|
||||
},
|
||||
"ansi-styles": {
|
||||
"version": "4.3.0",
|
||||
"resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz",
|
||||
"integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==",
|
||||
"dev": true,
|
||||
"optional": true,
|
||||
"requires": {
|
||||
"color-convert": "^2.0.1"
|
||||
}
|
||||
},
|
||||
"cacache": {
|
||||
"version": "13.0.1",
|
||||
"resolved": "https://registry.npm.taobao.org/cacache/download/cacache-13.0.1.tgz?cache=0&sync_timestamp=1594428108619&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fcacache%2Fdownload%2Fcacache-13.0.1.tgz",
|
||||
|
|
@ -1860,34 +1850,6 @@
|
|||
"unique-filename": "^1.1.1"
|
||||
}
|
||||
},
|
||||
"chalk": {
|
||||
"version": "4.1.2",
|
||||
"resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz",
|
||||
"integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==",
|
||||
"dev": true,
|
||||
"optional": true,
|
||||
"requires": {
|
||||
"ansi-styles": "^4.1.0",
|
||||
"supports-color": "^7.1.0"
|
||||
}
|
||||
},
|
||||
"color-convert": {
|
||||
"version": "2.0.1",
|
||||
"resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz",
|
||||
"integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==",
|
||||
"dev": true,
|
||||
"optional": true,
|
||||
"requires": {
|
||||
"color-name": "~1.1.4"
|
||||
}
|
||||
},
|
||||
"color-name": {
|
||||
"version": "1.1.4",
|
||||
"resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz",
|
||||
"integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==",
|
||||
"dev": true,
|
||||
"optional": true
|
||||
},
|
||||
"find-cache-dir": {
|
||||
"version": "3.3.1",
|
||||
"resolved": "https://registry.npm.taobao.org/find-cache-dir/download/find-cache-dir-3.3.1.tgz",
|
||||
|
|
@ -1909,25 +1871,6 @@
|
|||
"path-exists": "^4.0.0"
|
||||
}
|
||||
},
|
||||
"has-flag": {
|
||||
"version": "4.0.0",
|
||||
"resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz",
|
||||
"integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==",
|
||||
"dev": true,
|
||||
"optional": true
|
||||
},
|
||||
"loader-utils": {
|
||||
"version": "2.0.2",
|
||||
"resolved": "https://registry.npmjs.org/loader-utils/-/loader-utils-2.0.2.tgz",
|
||||
"integrity": "sha512-TM57VeHptv569d/GKh6TAYdzKblwDNiumOdkFnejjD0XwTH87K90w3O7AiJRqdQoXygvi1VQTJTLGhJl7WqA7A==",
|
||||
"dev": true,
|
||||
"optional": true,
|
||||
"requires": {
|
||||
"big.js": "^5.2.2",
|
||||
"emojis-list": "^3.0.0",
|
||||
"json5": "^2.1.2"
|
||||
}
|
||||
},
|
||||
"locate-path": {
|
||||
"version": "5.0.0",
|
||||
"resolved": "https://registry.npm.taobao.org/locate-path/download/locate-path-5.0.0.tgz",
|
||||
|
|
@ -1992,16 +1935,6 @@
|
|||
"minipass": "^3.1.1"
|
||||
}
|
||||
},
|
||||
"supports-color": {
|
||||
"version": "7.2.0",
|
||||
"resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz",
|
||||
"integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==",
|
||||
"dev": true,
|
||||
"optional": true,
|
||||
"requires": {
|
||||
"has-flag": "^4.0.0"
|
||||
}
|
||||
},
|
||||
"terser-webpack-plugin": {
|
||||
"version": "2.3.8",
|
||||
"resolved": "https://registry.npm.taobao.org/terser-webpack-plugin/download/terser-webpack-plugin-2.3.8.tgz?cache=0&sync_timestamp=1597229595508&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fterser-webpack-plugin%2Fdownload%2Fterser-webpack-plugin-2.3.8.tgz",
|
||||
|
|
@ -2018,18 +1951,6 @@
|
|||
"terser": "^4.6.12",
|
||||
"webpack-sources": "^1.4.3"
|
||||
}
|
||||
},
|
||||
"vue-loader-v16": {
|
||||
"version": "npm:vue-loader@16.8.3",
|
||||
"resolved": "https://registry.npmjs.org/vue-loader/-/vue-loader-16.8.3.tgz",
|
||||
"integrity": "sha512-7vKN45IxsKxe5GcVCbc2qFU5aWzyiLrYJyUuMz4BQLKctCj/fmCa0w6fGiiQ2cLFetNcek1ppGJQDCup0c1hpA==",
|
||||
"dev": true,
|
||||
"optional": true,
|
||||
"requires": {
|
||||
"chalk": "^4.1.0",
|
||||
"hash-sum": "^2.0.0",
|
||||
"loader-utils": "^2.0.0"
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
|
|
@ -12023,6 +11944,87 @@
|
|||
}
|
||||
}
|
||||
},
|
||||
"vue-loader-v16": {
|
||||
"version": "npm:vue-loader@16.8.3",
|
||||
"resolved": "https://registry.npmjs.org/vue-loader/-/vue-loader-16.8.3.tgz",
|
||||
"integrity": "sha512-7vKN45IxsKxe5GcVCbc2qFU5aWzyiLrYJyUuMz4BQLKctCj/fmCa0w6fGiiQ2cLFetNcek1ppGJQDCup0c1hpA==",
|
||||
"dev": true,
|
||||
"optional": true,
|
||||
"requires": {
|
||||
"chalk": "^4.1.0",
|
||||
"hash-sum": "^2.0.0",
|
||||
"loader-utils": "^2.0.0"
|
||||
},
|
||||
"dependencies": {
|
||||
"ansi-styles": {
|
||||
"version": "4.3.0",
|
||||
"resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz",
|
||||
"integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==",
|
||||
"dev": true,
|
||||
"optional": true,
|
||||
"requires": {
|
||||
"color-convert": "^2.0.1"
|
||||
}
|
||||
},
|
||||
"chalk": {
|
||||
"version": "4.1.2",
|
||||
"resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz",
|
||||
"integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==",
|
||||
"dev": true,
|
||||
"optional": true,
|
||||
"requires": {
|
||||
"ansi-styles": "^4.1.0",
|
||||
"supports-color": "^7.1.0"
|
||||
}
|
||||
},
|
||||
"color-convert": {
|
||||
"version": "2.0.1",
|
||||
"resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz",
|
||||
"integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==",
|
||||
"dev": true,
|
||||
"optional": true,
|
||||
"requires": {
|
||||
"color-name": "~1.1.4"
|
||||
}
|
||||
},
|
||||
"color-name": {
|
||||
"version": "1.1.4",
|
||||
"resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz",
|
||||
"integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==",
|
||||
"dev": true,
|
||||
"optional": true
|
||||
},
|
||||
"has-flag": {
|
||||
"version": "4.0.0",
|
||||
"resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz",
|
||||
"integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==",
|
||||
"dev": true,
|
||||
"optional": true
|
||||
},
|
||||
"loader-utils": {
|
||||
"version": "2.0.2",
|
||||
"resolved": "https://registry.npmjs.org/loader-utils/-/loader-utils-2.0.2.tgz",
|
||||
"integrity": "sha512-TM57VeHptv569d/GKh6TAYdzKblwDNiumOdkFnejjD0XwTH87K90w3O7AiJRqdQoXygvi1VQTJTLGhJl7WqA7A==",
|
||||
"dev": true,
|
||||
"optional": true,
|
||||
"requires": {
|
||||
"big.js": "^5.2.2",
|
||||
"emojis-list": "^3.0.0",
|
||||
"json5": "^2.1.2"
|
||||
}
|
||||
},
|
||||
"supports-color": {
|
||||
"version": "7.2.0",
|
||||
"resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz",
|
||||
"integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==",
|
||||
"dev": true,
|
||||
"optional": true,
|
||||
"requires": {
|
||||
"has-flag": "^4.0.0"
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"vue-router": {
|
||||
"version": "3.4.3",
|
||||
"resolved": "https://registry.npm.taobao.org/vue-router/download/vue-router-3.4.3.tgz?cache=0&sync_timestamp=1598983087864&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fvue-router%2Fdownload%2Fvue-router-3.4.3.tgz",
|
||||
|
|
|
|||
|
|
@ -3,10 +3,11 @@ import request from '@/api/request.js'
|
|||
|
||||
// 查询表单组
|
||||
export function getFormGroups(param) {
|
||||
console.log(param,"param")
|
||||
return request({
|
||||
url: "/flow/groups",
|
||||
url: "/flow/data/list",
|
||||
method: "get",
|
||||
param: param
|
||||
params: param
|
||||
})
|
||||
}
|
||||
|
||||
|
|
@ -20,18 +21,39 @@ export function groupItemsSort(param) {
|
|||
}
|
||||
|
||||
// 更新表单组
|
||||
export function updateGroup(param, method) {
|
||||
export function updateGroup(param) {
|
||||
return request({
|
||||
url: 'admin/form/group',
|
||||
method: method,
|
||||
url: 'flow/group',
|
||||
method: "put",
|
||||
params: param
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
export function addGroup(param){
|
||||
return request({
|
||||
url: 'flow/group',
|
||||
method: "post",
|
||||
data: param
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
export function delGroup(id){
|
||||
return request({
|
||||
url: 'flow/group/'+id,
|
||||
method: "delete",
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
// 获取表单分组
|
||||
export function getGroup() {
|
||||
return request({
|
||||
url: 'admin/form/group/list',
|
||||
url: 'flow/group/list',
|
||||
method: 'get'
|
||||
})
|
||||
}
|
||||
|
|
@ -45,9 +67,17 @@ export function updateForm(param) {
|
|||
})
|
||||
}
|
||||
|
||||
// 更新表单
|
||||
export function deleteForm(id) {
|
||||
return request({
|
||||
url: 'admin/form/'+id,
|
||||
method: 'delete',
|
||||
})
|
||||
}
|
||||
|
||||
export function createForm(param){
|
||||
return request({
|
||||
url: '/flow/add',
|
||||
url: '/flow/data',
|
||||
method: 'post',
|
||||
data: param
|
||||
})
|
||||
|
|
@ -56,7 +86,7 @@ export function createForm(param){
|
|||
// 查询表单详情
|
||||
export function getFormDetail(id) {
|
||||
return request({
|
||||
url: 'flow/detail/' + id,
|
||||
url: 'flow/data/' + id,
|
||||
method: 'get'
|
||||
})
|
||||
}
|
||||
|
|
@ -64,7 +94,7 @@ export function getFormDetail(id) {
|
|||
// 更新表单详情
|
||||
export function updateFormDetail(param) {
|
||||
return request({
|
||||
url: 'admin/form/detail',
|
||||
url: 'flow/data',
|
||||
method: 'put',
|
||||
data: param
|
||||
})
|
||||
|
|
|
|||
|
|
@ -5,6 +5,7 @@ import { Notification, MessageBox, Message } from "element-ui";
|
|||
|
||||
// 第三方插件
|
||||
import "element-ui/lib/theme-chalk/index.css";
|
||||
import da from "element-ui/src/locale/lang/da";
|
||||
|
||||
Vue.prototype.$axios = axios;
|
||||
// 字体图标
|
||||
|
|
@ -30,8 +31,12 @@ service.interceptors.request.use(
|
|||
|
||||
service.interceptors.response.use(
|
||||
rsp => {
|
||||
|
||||
return rsp.data;
|
||||
let data = rsp.data
|
||||
if (data.success){
|
||||
return data
|
||||
}else {
|
||||
Notification.error({ title: "提醒", message: "服务器出了点小错误" })
|
||||
}
|
||||
},
|
||||
// 拦截异常的响应
|
||||
err => {
|
||||
|
|
|
|||
|
|
@ -245,12 +245,12 @@ export default {
|
|||
})
|
||||
} else {
|
||||
console.log(JSON.stringify(template))
|
||||
// updateFormDetail(template).then(rsp => {
|
||||
// this.$message.success("更新表单成功")
|
||||
// this.$router.push("/formsPanel")
|
||||
// }).catch(err => {
|
||||
// this.$message.error(err)
|
||||
// })
|
||||
updateFormDetail(template).then(rsp => {
|
||||
this.$message.success("更新表单成功")
|
||||
this.$router.push("/formsPanel")
|
||||
}).catch(err => {
|
||||
this.$message.error(err)
|
||||
})
|
||||
}
|
||||
})
|
||||
}
|
||||
|
|
|
|||
|
|
@ -71,7 +71,7 @@
|
|||
import draggable from "vuedraggable";
|
||||
import {
|
||||
getFormGroups, groupItemsSort,
|
||||
getFormDetail, updateGroup, updateForm
|
||||
getFormDetail, updateGroup, updateForm, addGroup, delGroup, deleteForm
|
||||
} from '@/api/design'
|
||||
|
||||
export default {
|
||||
|
|
@ -126,7 +126,8 @@ export default {
|
|||
inputErrorMessage: '分组名不能为空且长度小于30',
|
||||
inputPlaceholder: '请输入分组名'
|
||||
}).then(({value}) => {
|
||||
updateGroup({name: value}, 'post').then(rsp => {
|
||||
console.log(value)
|
||||
addGroup({name: value}).then(rsp => {
|
||||
this.$message.success(rsp.data)
|
||||
this.getGroups()
|
||||
}).catch(err => this.$message.error(err.response.data))
|
||||
|
|
@ -138,7 +139,7 @@ export default {
|
|||
cancelButtonText: '取消',
|
||||
type: 'warning'
|
||||
}).then(() => {
|
||||
updateGroup({id: group.id}, 'delete').then(rsp => {
|
||||
delGroup(group.id).then(rsp => {
|
||||
this.$message.success(rsp.data)
|
||||
this.getGroups()
|
||||
}).catch(err => this.$message.error(err.response.data))
|
||||
|
|
@ -153,7 +154,7 @@ export default {
|
|||
inputPlaceholder: '请输入分组名',
|
||||
inputValue: group.name
|
||||
}).then(({value}) => {
|
||||
updateGroup({id: group.id, name: value}, 'put').then(rsp => {
|
||||
updateGroup({id: group.id, name: value}).then(rsp => {
|
||||
this.$message.success(rsp.data)
|
||||
this.getGroups()
|
||||
}).catch(err => this.$message.error(err.response.data))
|
||||
|
|
@ -188,14 +189,14 @@ export default {
|
|||
cancelButtonText: '取消',
|
||||
type: 'warning'
|
||||
}).then(() => {
|
||||
this.updateForm(item, 'delete');
|
||||
this.deleteForm(item.id);
|
||||
})
|
||||
} else {
|
||||
if (this.moveSelect === null || this.moveSelect === ''){
|
||||
this.$message.error('请选择分组')
|
||||
return;
|
||||
}
|
||||
updateForm({templateId: item.id, type: 'move', groupId: this.moveSelect}).then(rsp => {
|
||||
updateForm(item.id).then(rsp => {
|
||||
this.$message.success(rsp.data)
|
||||
this.getGroups()
|
||||
this.moveSelect = null
|
||||
|
|
|
|||
|
|
@ -25,7 +25,7 @@
|
|||
</el-form-item>
|
||||
<el-form-item label="所在分组" :rules="getRule('请选择表单分组')" class="group" prop="groupId">
|
||||
<el-select v-model="setup.groupId" placeholder="请选择分组" size="medium">
|
||||
<el-option v-for="(op, index) in fromGroup" :key="index" v-show="op.id > 1"
|
||||
<el-option v-for="(op, index) in groupList" :key="index" v-show="op.id > 1"
|
||||
:label="op.name" :value="op.id"></el-option>
|
||||
</el-select>
|
||||
<el-popover placement="bottom-end" title="新建表单分组" width="300" trigger="click">
|
||||
|
|
@ -61,7 +61,7 @@
|
|||
|
||||
<script>
|
||||
import OrgPicker from "@/components/common/OrgPicker";
|
||||
import {getFormGroups, updateGroup} from '@/api/design'
|
||||
import {getFormGroups, getGroup, updateGroup} from '@/api/design'
|
||||
import iconfont from '@/assets/iconfont/iconfont.json'
|
||||
|
||||
export default {
|
||||
|
|
@ -73,7 +73,7 @@ export default {
|
|||
showIconSelect: false,
|
||||
select: [],
|
||||
newGroup: '',
|
||||
fromGroup: [],
|
||||
groupList: [],
|
||||
notifyTypes:[
|
||||
{type:'APP',name:'应用内通知'},
|
||||
{type:'EMAIL',name:'邮件通知'},
|
||||
|
|
@ -113,13 +113,13 @@ export default {
|
|||
rules:{
|
||||
formName:[{}],
|
||||
groupId: [],
|
||||
}
|
||||
},
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
setup() {
|
||||
return this.$store.state.design;
|
||||
}
|
||||
},
|
||||
},
|
||||
created() {
|
||||
this.loadIconfont()
|
||||
|
|
@ -139,8 +139,8 @@ export default {
|
|||
}
|
||||
},
|
||||
getGroups(){
|
||||
getFormGroups().then(res=>{
|
||||
this.fromGroup =res.data
|
||||
getGroup().then(res=>{
|
||||
this.groupList =res.data
|
||||
}).catch(err => this.$message.error(err.response.data))
|
||||
},
|
||||
addGroup() {
|
||||
|
|
|
|||
|
|
@ -7,12 +7,12 @@
|
|||
<el-tab-pane label="审批列表">
|
||||
<el-row style="margin-bottom: 20px">
|
||||
<el-col :xs="12" :sm="10" :md="8" :lg="6" :xl="4">
|
||||
<el-input size="medium" v-model="formList.inputs" placeholder="搜索表单" clearable>
|
||||
<el-input size="medium" v-model="formList.inputs" placeholder="搜索表单" @keyup.enter.native="getGroups" clearable>
|
||||
<i slot="prefix" class="el-input__icon el-icon-search"></i>
|
||||
</el-input>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-collapse v-model="actives" v-show="formList.inputs === ''">
|
||||
<el-collapse v-model="actives">
|
||||
<el-collapse-item v-for="(group, index) in formList.list" :key="index"
|
||||
:title="group.name" :name="group.name"
|
||||
v-show="group.items.length > 0 && group.id > 0">
|
||||
|
|
@ -89,7 +89,7 @@ export default {
|
|||
},
|
||||
methods: {
|
||||
getGroups() {
|
||||
getFormGroups().then(res=>{
|
||||
getFormGroups({formName:this.formList.inputs}).then(res=>{
|
||||
this.formList.list =res.data
|
||||
this.formList.list.forEach(group => {
|
||||
this.actives.push(group.name)
|
||||
|
|
|
|||
Loading…
Reference in New Issue