Merge branch 'approve-sys'

deliver/approver-flow
bob 2 years ago
commit 793c8435fc

@ -95,7 +95,7 @@ public class FlowTaskController {
@ApiOperation(value = "修改任务完成时间", response = FlowTaskDto.class) @ApiOperation(value = "修改任务完成时间", response = FlowTaskDto.class)
@PostMapping(value = "/updateTaskFinishDate") @PostMapping(value = "/updateTaskFinishDate")
public AjaxResult updateTaskFinishDate(@RequestBody UpdateVariablesSubmitDateVo vo) { public AjaxResult updateTaskFinishDate(@RequestBody UpdateVariablesSubmitDateVo vo) {
return flowTaskService.updateVariablesSubmitDate(vo); return flowTaskService.updateTaskFinishDate(vo);
} }
@ApiOperation(value = "审批任务") @ApiOperation(value = "审批任务")

@ -12,6 +12,8 @@ public class UpdateVariablesSubmitDateVo {
@ApiModelProperty("任务id") @ApiModelProperty("任务id")
private String taskId; private String taskId;
@ApiModelProperty("任务顺序编号")
private String taskIndex;
@ApiModelProperty("提交时间") @ApiModelProperty("提交时间")
private String finishDate; private String finishDate;

@ -167,7 +167,7 @@ public interface IFlowTaskService {
AjaxResult processVariables(String taskId); AjaxResult processVariables(String taskId);
AjaxResult updateVariablesSubmitDate(String processInstanceId,String submitDate); AjaxResult updateVariablesSubmitDate(String processInstanceId,String submitDate);
AjaxResult updateVariablesSubmitDate(UpdateVariablesSubmitDateVo vo); AjaxResult updateTaskFinishDate(UpdateVariablesSubmitDateVo vo);
/** /**
* *

@ -2,8 +2,10 @@ package com.ruoyi.flowable.service.impl;
import cn.hutool.core.date.DatePattern; import cn.hutool.core.date.DatePattern;
import cn.hutool.core.date.DateTime;
import cn.hutool.core.date.DateUtil; import cn.hutool.core.date.DateUtil;
import cn.hutool.core.map.MapUtil; import cn.hutool.core.map.MapUtil;
import cn.hutool.core.util.ObjectUtil;
import cn.hutool.core.util.StrUtil; import cn.hutool.core.util.StrUtil;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.google.common.collect.Lists; import com.google.common.collect.Lists;
@ -237,11 +239,9 @@ public class FlowTaskServiceImpl extends FlowServiceFactory implements IFlowTask
} catch (FlowableException e) { } catch (FlowableException e) {
throw new CustomException("无法取消或开始活动"); throw new CustomException("无法取消或开始活动");
} }
runtimeService.updateBusinessStatus(flowTaskVo.getInstanceId(), FlowStatus.REJECT.getValue()); runtimeService.updateBusinessStatus(flowTaskVo.getInstanceId(), FlowStatus.REJECT.getValue());
} }
/** /**
* 退 * 退
* *
@ -998,23 +998,37 @@ public class FlowTaskServiceImpl extends FlowServiceFactory implements IFlowTask
return AjaxResult.success(); return AjaxResult.success();
} }
@Override @Override
public AjaxResult updateVariablesSubmitDate(UpdateVariablesSubmitDateVo vo) { public AjaxResult updateTaskFinishDate(UpdateVariablesSubmitDateVo vo) {
if (StringUtils.isBlank(vo.getProcessInstanceId()) || StringUtils.isBlank(vo.getFinishDate())) { if (StringUtils.isBlank(vo.getProcessInstanceId()) || StringUtils.isBlank(vo.getFinishDate())) {
return AjaxResult.error("更新提交时间失败,参数无效"); return AjaxResult.error("更新提交时间失败,参数无效");
} }
Execution execution = runtimeService.createExecutionQuery().processInstanceId(vo.getProcessInstanceId()).variableExists("submitDate").singleResult(); HistoricTaskInstance historicTaskInstance = historyService.createHistoricTaskInstanceQuery().processInstanceId(vo.getProcessInstanceId()).taskId(vo.getTaskId()).singleResult();
ProcessInstance processInstance = runtimeService.createProcessInstanceQuery().processInstanceId(vo.getProcessInstanceId()).includeProcessVariables().singleResult(); if (Objects.isNull(historicTaskInstance)) {
if (Objects.isNull(execution)) { return AjaxResult.error("更新提交时间失败,此任务不存在");
}
String executionId = historicTaskInstance.getExecutionId();
if (Objects.isNull(executionId)) {
return AjaxResult.error("更新提交时间失败,查询错误"); return AjaxResult.error("更新提交时间失败,查询错误");
} }
ProcessInstance processInstance = runtimeService.createProcessInstanceQuery().processInstanceId(vo.getProcessInstanceId()).includeProcessVariables().singleResult();
Map<String, Object> variables = processInstance.getProcessVariables(); Map<String, Object> variables = processInstance.getProcessVariables();
Map<String, Object> map = (Map<String , Object>)MapUtils.getMap(variables, USER_MODIFY_TASK_FINISH_TIME_VARIABLE_KEY,new HashMap<>()); Map<String, Object> map = (Map<String , Object>)MapUtils.getMap(variables, USER_MODIFY_TASK_FINISH_TIME_VARIABLE_KEY,new HashMap<>());
map.put(vo.getTaskId(), DateUtil.parse(vo.getFinishDate(), DatePattern.NORM_DATETIME_FORMATTER)); DateTime submitDate = DateUtil.parse(vo.getFinishDate(), DatePattern.NORM_DATETIME_FORMATTER);
runtimeService.setVariable(execution.getId(),USER_MODIFY_TASK_FINISH_TIME_VARIABLE_KEY,map); map.put(vo.getTaskId(),submitDate);
runtimeService.setVariable(vo.getProcessInstanceId(), USER_MODIFY_TASK_FINISH_TIME_VARIABLE_KEY,map);
updateSubmitDate(vo.getProcessInstanceId(), historicTaskInstance.getName(), submitDate);
return AjaxResult.success(); return AjaxResult.success();
} }
public void updateSubmitDate( String processInstanceId,String taskName, DateTime submitDate) {
if (ObjectUtil.notEqual("提交汇报",taskName)) {
return;
}
runtimeService.setVariable(processInstanceId,"submitDate",submitDate);
}
/** /**
* *
* *

@ -24,17 +24,17 @@
</el-form-item> </el-form-item>
</el-form> </el-form>
<el-row :gutter="10" class="mb8"> <!-- <el-row :gutter="10" class="mb8">-->
<el-col :span="1.5"> <!-- <el-col :span="1.5">-->
<el-button <!-- <el-button-->
type="primary" <!-- type="primary"-->
plain <!-- plain-->
icon="el-icon-plus" <!-- icon="el-icon-plus"-->
size="mini" <!-- size="mini"-->
@click="handleAdd" <!-- @click="handleAdd"-->
v-hasPermi="['system:deployment:add']" <!-- v-hasPermi="['system:deployment:add']"-->
>新增流程</el-button> <!-- >新增流程</el-button>-->
</el-col> <!-- </el-col>-->
<!-- <el-col :span="1.5">--> <!-- <el-col :span="1.5">-->
<!-- <el-button--> <!-- <el-button-->
<!-- type="danger"--> <!-- type="danger"-->
@ -46,29 +46,23 @@
<!-- v-hasPermi="['system:deployment:remove']"--> <!-- v-hasPermi="['system:deployment:remove']"-->
<!-- >删除</el-button>--> <!-- >删除</el-button>-->
<!-- </el-col>--> <!-- </el-col>-->
<el-col :span="1.5"> <!-- <el-col :span="1.5">-->
<el-button <!-- <el-button-->
type="warning" <!-- type="warning"-->
plain <!-- plain-->
icon="el-icon-download" <!-- icon="el-icon-download"-->
size="mini" <!-- size="mini"-->
@click="handleExport" <!-- @click="handleExport"-->
v-hasPermi="['system:deployment:export']" <!-- v-hasPermi="['system:deployment:export']"-->
>导出</el-button> <!-- >导出</el-button>-->
</el-col> <!-- </el-col>-->
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar> <!-- <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>-->
</el-row> <!-- </el-row>-->
<el-table v-loading="loading" :data="myProcessList" border @selection-change="handleSelectionChange"> <el-table v-loading="loading" :data="myProcessList" border @selection-change="handleSelectionChange">
<el-table-column type="selection" width="55" align="center" /> <el-table-column type="selection" width="55" align="center" />
<el-table-column label="流程编号" align="center" prop="procInsId" :show-overflow-tooltip="true"/> <el-table-column label="项目名称" align="center" prop="projectName" :show-overflow-tooltip="true"/>
<el-table-column label="流程名称" align="center" prop="procDefName" :show-overflow-tooltip="true"/> <el-table-column label="工作问题" align="center" prop="workIssue" :show-overflow-tooltip="true"/>
<el-table-column label="流程类别" align="center" prop="category" width="100px" />
<el-table-column label="流程版本" align="center" width="80px">
<template slot-scope="scope">
<el-tag size="medium" >v{{ scope.row.procDefVersion }}</el-tag>
</template>
</el-table-column>
<el-table-column label="提交时间" align="center" prop="createTime" width="180"/> <el-table-column label="提交时间" align="center" prop="createTime" width="180"/>
<el-table-column label="流程状态" align="center" width="100"> <el-table-column label="流程状态" align="center" width="100">
<template slot-scope="scope"> <template slot-scope="scope">

@ -159,7 +159,7 @@
<el-descriptions-item v-if="item.finishTime" label-class-name="my-label"> <el-descriptions-item v-if="item.finishTime" label-class-name="my-label">
<template slot="label"><i class="el-icon-date"></i>处理时间</template> <template slot="label"><i class="el-icon-date"></i>处理时间</template>
<span>{{item.finishTime}}</span> <span>{{item.finishTime}}</span>
<span > <el-button align="right" @click="handleUpdateTaskFinishDate(item.taskId)" size="mini" round plain type="primary">修改时间</el-button></span> <span > <el-button align="right" @click="handleUpdateTaskFinishDate(item.taskId,index)" size="mini" round plain type="primary">修改时间</el-button></span>
</el-descriptions-item > </el-descriptions-item >
<!-- <el-descriptions-item v-if="item.duration" label-class-name="my-label">--> <!-- <el-descriptions-item v-if="item.duration" label-class-name="my-label">-->
<!-- <template slot="label"><i class="el-icon-time"></i>耗时</template>--> <!-- <template slot="label"><i class="el-icon-time"></i>耗时</template>-->
@ -408,6 +408,7 @@ export default {
rejectOpen: false, rejectOpen: false,
updateFinishDateOpen: false, updateFinishDateOpen: false,
taskId: '', taskId: '',
taskIndex: '',
rejectTitle: null, rejectTitle: null,
userData:[], userData:[],
checkSendUser: false // checkSendUser: false //
@ -450,9 +451,10 @@ export default {
); );
}, },
/** 修改任务提交时间 */ /** 修改任务提交时间 */
handleUpdateTaskFinishDate(taskId) { handleUpdateTaskFinishDate(taskId,taskIndex) {
this.updateFinishDateOpen = true; this.updateFinishDateOpen = true;
this.taskId = taskId; this.taskId = taskId;
this.taskIndex = taskIndex;
}, },
/** 修改任务提交时间 */ /** 修改任务提交时间 */
@ -460,6 +462,7 @@ export default {
const params = { const params = {
processInstanceId: this.taskForm.procInsId, processInstanceId: this.taskForm.procInsId,
taskId: this.taskId, taskId: this.taskId,
taskIndex: this.taskIndex,
finishDate: this.finishDate finishDate: this.finishDate
} }
updateTaskFinishDate(params).then( res => { updateTaskFinishDate(params).then( res => {

@ -158,31 +158,16 @@
<template slot="label"><i class="el-icon-user"></i>候选办理</template> <template slot="label"><i class="el-icon-user"></i>候选办理</template>
{{item.candidate}} {{item.candidate}}
</el-descriptions-item> </el-descriptions-item>
<!-- <el-descriptions-item label-class-name="my-label">-->
<!-- <template slot="label"><i class="el-icon-date"></i>接收时间</template>-->
<!-- {{item.createTime}}-->
<!-- </el-descriptions-item>-->
<el-descriptions-item v-if="item.finishTime" label-class-name="my-label"> <el-descriptions-item v-if="item.finishTime" label-class-name="my-label">
<template slot="label"><i class="el-icon-date"></i>处理时间</template> <template slot="label"><i class="el-icon-date"></i>处理时间</template>
<span v-if="form.submitDate !==undefined && form.submitDate !==''&& form.submitDate !==null">{{form.submitDate}}</span> <span>{{item.finishTime}}</span>
<span v-else>{{item.finishTime}}</span>
</el-descriptions-item > </el-descriptions-item >
<!-- <el-descriptions-item v-if="item.duration" label-class-name="my-label">-->
<!-- <template slot="label"><i class="el-icon-time"></i>耗时</template>-->
<!-- {{item.duration}}-->
<!-- </el-descriptions-item>-->
<el-descriptions-item v-if="item.comment" label-class-name="my-label"> <el-descriptions-item v-if="item.comment" label-class-name="my-label">
<template slot="label"><i class="el-icon-tickets"></i>处理意见</template> <template slot="label"><i class="el-icon-tickets"></i>处理意见</template>
{{item.comment.comment}} {{item.comment.comment}}
</el-descriptions-item> </el-descriptions-item>
</el-descriptions> </el-descriptions>
<!-- <p v-if="item.comment">-->
<!-- <el-tag type="success" v-if="item.comment.type === '1'"> {{item.comment.comment}}</el-tag>-->
<!-- <el-tag type="warning" v-if="item.comment.type === '2'"> {{item.comment.comment}}</el-tag>-->
<!-- <el-tag type="danger" v-if="item.comment.type === '3'"> {{item.comment.comment}}</el-tag>-->
<!-- </p>-->
<img v-if="isRefuse(item.comment)" src="@/assets/images/refuse.png" width="50" height="50"> <img v-if="isRefuse(item.comment)" src="@/assets/images/refuse.png" width="50" height="50">
</el-card> </el-card>
</el-timeline-item> </el-timeline-item>

@ -24,21 +24,21 @@
</el-form-item> </el-form-item>
</el-form> </el-form>
<el-row :gutter="10" class="mb8"> <!-- <el-row :gutter="10" class="mb8">-->
<el-col :span="1.5"> <!-- <el-col :span="1.5">-->
<el-button <!-- <el-button-->
type="danger" <!-- type="danger"-->
plain <!-- plain-->
icon="el-icon-delete" <!-- icon="el-icon-delete"-->
size="mini" <!-- size="mini"-->
:disabled="multiple" <!-- :disabled="multiple"-->
@click="handleDelete" <!-- @click="handleDelete"-->
v-hasPermi="['system:deployment:remove']" <!-- v-hasPermi="['system:deployment:remove']"-->
>删除 <!-- >删除-->
</el-button> <!-- </el-button>-->
</el-col> <!-- </el-col>-->
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar> <!-- <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>-->
</el-row> <!-- </el-row>-->
<el-table v-loading="loading" :data="todoList" border @selection-change="handleSelectionChange"> <el-table v-loading="loading" :data="todoList" border @selection-change="handleSelectionChange">
<el-table-column type="selection" width="55" align="center"/> <el-table-column type="selection" width="55" align="center"/>

Loading…
Cancel
Save