rev:流程实例关联查询
This commit is contained in:
@@ -1,10 +1,14 @@
|
||||
package org.nl.wms.flow_manage.flow.service.execution.dao.mapper;
|
||||
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
import org.apache.ibatis.annotations.Select;
|
||||
import org.nl.common.domain.entity.PageQuery;
|
||||
import org.nl.wms.flow_manage.flow.service.execution.dao.ActRuExecution;
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import org.nl.wms.flow_manage.flow.service.execution.dto.ExecutionQuery;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
@@ -38,4 +42,6 @@ public interface ActRuExecutionMapper extends BaseMapper<ActRuExecution> {
|
||||
"\t@r <> 0 \n" +
|
||||
"\tAND parent_id > 0 ) as d")
|
||||
String findParent(String proc_inst_id);
|
||||
|
||||
List<Map> pageGetAll(@Param("query") ExecutionQuery query, @Param("pageQuery") PageQuery pageQuery);
|
||||
}
|
||||
|
||||
@@ -2,4 +2,22 @@
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="org.nl.wms.flow_manage.flow.service.execution.dao.mapper.ActRuExecutionMapper">
|
||||
|
||||
<select id="pageGetAll" resultType="java.util.Map">
|
||||
SELECT
|
||||
exe.*,
|
||||
def.name def_name,
|
||||
def.model_key def_model_key,
|
||||
def.description def_description
|
||||
FROM act_ru_execution exe
|
||||
left join act_re_procdef def on exe.deployment_id = def.deployment_id
|
||||
<where>
|
||||
exe.parent_id is null
|
||||
<if test="query.search != null and query.search != ''">
|
||||
and def.model_key LIKE '%${query.search}%'
|
||||
</if>
|
||||
<if test="query.proc_inst_id != null and query.proc_inst_id != ''">
|
||||
and exe.proc_inst_id like '%${query.proc_inst_id}%'
|
||||
</if>
|
||||
</where>
|
||||
</select>
|
||||
</mapper>
|
||||
|
||||
@@ -4,10 +4,13 @@ import cn.hutool.core.collection.CollectionUtil;
|
||||
import cn.hutool.core.lang.Assert;
|
||||
import cn.hutool.core.util.ObjectUtil;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import com.alibaba.fastjson.JSONArray;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.baomidou.mybatisplus.core.conditions.Wrapper;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.github.pagehelper.Page;
|
||||
import com.github.pagehelper.PageHelper;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.nl.common.TableDataInfo;
|
||||
import org.nl.common.domain.entity.PageQuery;
|
||||
@@ -27,6 +30,7 @@ import org.springframework.stereotype.Service;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
@@ -43,16 +47,16 @@ public class ActRuExecutionServiceImpl extends ServiceImpl<ActRuExecutionMapper,
|
||||
private IActReProcdefService procdefService;
|
||||
@Autowired
|
||||
private IActHiExecutionService iActHiExecutionService;
|
||||
@Autowired
|
||||
private ActRuExecutionMapper actRuExecutionMapper;
|
||||
|
||||
@Override
|
||||
public Object getAll(ExecutionQuery query, PageQuery page) {
|
||||
//判断是否存在子实例
|
||||
QueryWrapper<ActRuExecution> build = (QueryWrapper) query.build();
|
||||
build.isNull("parent_id");
|
||||
Page<ActRuExecution> executionPage = this.page(page.build(), build);
|
||||
// List<ActRuExecution> records = executionPage.getRecords();
|
||||
// this.findChildren(records);
|
||||
return TableDataInfo.build(executionPage);
|
||||
public Object getAll(ExecutionQuery query, PageQuery pageQuery) {
|
||||
Page<Object> page = PageHelper.startPage(pageQuery.getPage() + 1, pageQuery.getSize());
|
||||
List<Map> list = actRuExecutionMapper.pageGetAll(query, pageQuery);
|
||||
TableDataInfo<Map> build = TableDataInfo.build(list);
|
||||
build.setTotalElements(page.getTotal());
|
||||
return build;
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -100,7 +104,7 @@ public class ActRuExecutionServiceImpl extends ServiceImpl<ActRuExecutionMapper,
|
||||
public List<String> getChildList(String proc_inst_id) {
|
||||
Assert.notNull(proc_inst_id, "参数不能为空");
|
||||
String allChild = this.baseMapper.findAllChild(proc_inst_id);
|
||||
if (StringUtils.isNotEmpty(allChild)){
|
||||
if (StringUtils.isNotEmpty(allChild)) {
|
||||
return Arrays.asList(allChild.split(","));
|
||||
}
|
||||
return new ArrayList<>();
|
||||
|
||||
@@ -94,14 +94,17 @@
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="parent_id" width="200" label="父流程" />
|
||||
<el-table-column prop="def_name" width="200" label="部署名称" />
|
||||
<el-table-column prop="def_model_key" width="200" label="模型KEY" />
|
||||
<!-- <el-table-column prop="def_description" width="200" label="部署描述" />-->
|
||||
<el-table-column v-if="false" prop="deployment_id" label="流程部署ID" />
|
||||
<el-table-column
|
||||
prop="deployment_name"
|
||||
show-overflow-tooltip
|
||||
show-tooltip-when-overflow
|
||||
width="130"
|
||||
label="流程模型"
|
||||
/>
|
||||
<!-- <el-table-column-->
|
||||
<!-- prop="deployment_name"-->
|
||||
<!-- show-overflow-tooltip-->
|
||||
<!-- show-tooltip-when-overflow-->
|
||||
<!-- width="130"-->
|
||||
<!-- label="流程模型"-->
|
||||
<!-- />-->
|
||||
<el-table-column v-if="false" prop="activity_id" label="当前节点ID" />
|
||||
<el-table-column
|
||||
prop="activity_name"
|
||||
|
||||
Reference in New Issue
Block a user