rev:流程实例关联查询

This commit is contained in:
2024-07-18 16:13:39 +08:00
parent 43cefb6a83
commit a1615a1ae9
4 changed files with 48 additions and 17 deletions

View File

@@ -1,10 +1,14 @@
package org.nl.wms.flow_manage.flow.service.execution.dao.mapper; 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.apache.ibatis.annotations.Select;
import org.nl.common.domain.entity.PageQuery;
import org.nl.wms.flow_manage.flow.service.execution.dao.ActRuExecution; import org.nl.wms.flow_manage.flow.service.execution.dao.ActRuExecution;
import com.baomidou.mybatisplus.core.mapper.BaseMapper; 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.List;
import java.util.Map;
/** /**
* <p> * <p>
@@ -38,4 +42,6 @@ public interface ActRuExecutionMapper extends BaseMapper<ActRuExecution> {
"\t@r <> 0 \n" + "\t@r <> 0 \n" +
"\tAND parent_id > 0 ) as d") "\tAND parent_id > 0 ) as d")
String findParent(String proc_inst_id); String findParent(String proc_inst_id);
List<Map> pageGetAll(@Param("query") ExecutionQuery query, @Param("pageQuery") PageQuery pageQuery);
} }

View File

@@ -2,4 +2,22 @@
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> <!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"> <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> </mapper>

View File

@@ -4,10 +4,13 @@ import cn.hutool.core.collection.CollectionUtil;
import cn.hutool.core.lang.Assert; import cn.hutool.core.lang.Assert;
import cn.hutool.core.util.ObjectUtil; import cn.hutool.core.util.ObjectUtil;
import cn.hutool.core.util.StrUtil; 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.Wrapper;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; 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.apache.commons.lang3.StringUtils;
import org.nl.common.TableDataInfo; import org.nl.common.TableDataInfo;
import org.nl.common.domain.entity.PageQuery; import org.nl.common.domain.entity.PageQuery;
@@ -27,6 +30,7 @@ import org.springframework.stereotype.Service;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.Arrays; import java.util.Arrays;
import java.util.List; import java.util.List;
import java.util.Map;
/** /**
* <p> * <p>
@@ -43,16 +47,16 @@ public class ActRuExecutionServiceImpl extends ServiceImpl<ActRuExecutionMapper,
private IActReProcdefService procdefService; private IActReProcdefService procdefService;
@Autowired @Autowired
private IActHiExecutionService iActHiExecutionService; private IActHiExecutionService iActHiExecutionService;
@Autowired
private ActRuExecutionMapper actRuExecutionMapper;
@Override @Override
public Object getAll(ExecutionQuery query, PageQuery page) { public Object getAll(ExecutionQuery query, PageQuery pageQuery) {
//判断是否存在子实例 Page<Object> page = PageHelper.startPage(pageQuery.getPage() + 1, pageQuery.getSize());
QueryWrapper<ActRuExecution> build = (QueryWrapper) query.build(); List<Map> list = actRuExecutionMapper.pageGetAll(query, pageQuery);
build.isNull("parent_id"); TableDataInfo<Map> build = TableDataInfo.build(list);
Page<ActRuExecution> executionPage = this.page(page.build(), build); build.setTotalElements(page.getTotal());
// List<ActRuExecution> records = executionPage.getRecords(); return build;
// this.findChildren(records);
return TableDataInfo.build(executionPage);
} }
@Override @Override
@@ -100,7 +104,7 @@ public class ActRuExecutionServiceImpl extends ServiceImpl<ActRuExecutionMapper,
public List<String> getChildList(String proc_inst_id) { public List<String> getChildList(String proc_inst_id) {
Assert.notNull(proc_inst_id, "参数不能为空"); Assert.notNull(proc_inst_id, "参数不能为空");
String allChild = this.baseMapper.findAllChild(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 Arrays.asList(allChild.split(","));
} }
return new ArrayList<>(); return new ArrayList<>();

View File

@@ -94,14 +94,17 @@
</template> </template>
</el-table-column> </el-table-column>
<el-table-column prop="parent_id" width="200" label="父流程" /> <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 v-if="false" prop="deployment_id" label="流程部署ID" />
<el-table-column <!-- <el-table-column-->
prop="deployment_name" <!-- prop="deployment_name"-->
show-overflow-tooltip <!-- show-overflow-tooltip-->
show-tooltip-when-overflow <!-- show-tooltip-when-overflow-->
width="130" <!-- width="130"-->
label="流程模型" <!-- label="流程模型"-->
/> <!-- />-->
<el-table-column v-if="false" prop="activity_id" label="当前节点ID" /> <el-table-column v-if="false" prop="activity_id" label="当前节点ID" />
<el-table-column <el-table-column
prop="activity_name" prop="activity_name"