fix(oaProject) submit datetime

approve-sys
bob 2 years ago
parent 0ee625979c
commit 9dc6c559d2

@ -0,0 +1,33 @@
package com.ruoyi.flowable.controller;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.flowable.domain.dto.FlowTaskDto;
import com.ruoyi.flowable.service.IFlowInstanceService;
import com.ruoyi.flowable.service.IFlowTaskService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import lombok.Data;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.*;
import java.util.Map;
@Slf4j
@Api(tags = "工作流流程任务管理")
@RestController
@RequestMapping("/flowable/hisTask")
public class FlowHisTaskController {
@Autowired
private IFlowTaskService flowTaskService;
@ApiOperation(value = "我发起的流程", response = FlowTaskDto.class)
@GetMapping(value = "/myProcess")
public AjaxResult myProcess(@ApiParam(value = "当前页码", required = true) @RequestParam Integer pageNum,
@ApiParam(value = "每页条数", required = true) @RequestParam Integer pageSize) {
return flowTaskService.myProcess(pageNum, pageSize);
}
}

@ -0,0 +1,17 @@
package com.ruoyi.flowable.service;
import com.ruoyi.common.core.domain.AjaxResult;
/**
* @author XuanXuan
* @date 2021-04-03 14:42
*/
public interface IFlowHisTaskService {
/**
*
*
* @param taskId id
*/
AjaxResult updateTaskEndTime(String taskId);
}

@ -0,0 +1,93 @@
package com.ruoyi.flowable.service.impl;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.google.common.collect.Lists;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.core.domain.entity.SysRole;
import com.ruoyi.common.core.domain.entity.SysUser;
import com.ruoyi.common.exception.CustomException;
import com.ruoyi.common.utils.SecurityUtils;
import com.ruoyi.flowable.common.constant.ProcessConstants;
import com.ruoyi.flowable.common.enums.FlowComment;
import com.ruoyi.flowable.domain.dto.FlowCommentDto;
import com.ruoyi.flowable.domain.dto.FlowNextDto;
import com.ruoyi.flowable.domain.dto.FlowTaskDto;
import com.ruoyi.flowable.domain.dto.FlowViewerDto;
import com.ruoyi.flowable.domain.vo.FlowTaskVo;
import com.ruoyi.flowable.factory.FlowServiceFactory;
import com.ruoyi.flowable.flow.CustomProcessDiagramGenerator;
import com.ruoyi.flowable.flow.FindNextNodeUtil;
import com.ruoyi.flowable.flow.FlowableUtils;
import com.ruoyi.flowable.service.IFlowHisTaskService;
import com.ruoyi.flowable.service.IFlowTaskService;
import com.ruoyi.flowable.service.ISysDeployFormService;
import com.ruoyi.system.service.ISysRoleService;
import com.ruoyi.system.service.ISysUserService;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.collections4.CollectionUtils;
import org.apache.commons.lang3.StringUtils;
import org.flowable.bpmn.model.Process;
import org.flowable.bpmn.model.*;
import org.flowable.common.engine.api.FlowableException;
import org.flowable.common.engine.api.FlowableObjectNotFoundException;
import org.flowable.common.engine.impl.identity.Authentication;
import org.flowable.engine.ProcessEngineConfiguration;
import org.flowable.engine.history.HistoricActivityInstance;
import org.flowable.engine.history.HistoricProcessInstance;
import org.flowable.engine.history.HistoricProcessInstanceQuery;
import org.flowable.engine.repository.ProcessDefinition;
import org.flowable.engine.runtime.Execution;
import org.flowable.engine.runtime.ProcessInstance;
import org.flowable.engine.task.Comment;
import org.flowable.identitylink.api.history.HistoricIdentityLink;
import org.flowable.image.ProcessDiagramGenerator;
import org.flowable.task.api.DelegationState;
import org.flowable.task.api.Task;
import org.flowable.task.api.TaskQuery;
import org.flowable.task.api.history.HistoricTaskInstance;
import org.flowable.task.api.history.HistoricTaskInstanceQuery;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import javax.annotation.Resource;
import java.io.InputStream;
import java.util.*;
import java.util.concurrent.ConcurrentHashMap;
import java.util.function.Function;
import java.util.function.Predicate;
import java.util.stream.Collectors;
/**
* @author XuanXuan
* @date 2021-04-03
**/
@Service
@Slf4j
public class FlowHisTaskServiceImpl extends FlowServiceFactory implements IFlowHisTaskService {
@Resource
private ISysUserService sysUserService;
@Resource
private ISysRoleService sysRoleService;
@Resource
private ISysDeployFormService sysInstanceFormService;
@Override
public AjaxResult updateTaskEndTime(String taskId) {
if (StringUtils.isBlank(taskId)) {
return AjaxResult.error("修改失败任务id参数无效");
}
HistoricTaskInstance historicTaskInstance = historyService.createHistoricTaskInstanceQuery().taskId(taskId).singleResult();
if (Objects.isNull(historicTaskInstance)) {
return AjaxResult.error("修改失败任务id无效");
}
// historyService.createHistoricTaskInstanceQuery().taskId(taskId).
runtimeService.createChangeActivityStateBuilder().
return null;
}
}

@ -50,6 +50,15 @@
<div slot="tip" class="el-upload__tip">只能上传jpg/png文件且不超过500kb</div> <div slot="tip" class="el-upload__tip">只能上传jpg/png文件且不超过500kb</div>
</el-upload> </el-upload>
</el-form-item> </el-form-item>
<el-form-item label="申请提交时间">
<el-date-picker
v-model="form.submitDate"
type="datetime"
value-format="yyyy-MM-dd HH:mm:ss"
format="yyyy-MM-dd HH:mm:ss"
placeholder="若未选,系统自动生成">
</el-date-picker>
</el-form-item>
</el-form> </el-form>
<div slot="footer" class="dialog-footer"> <div slot="footer" class="dialog-footer">
<el-button type="primary" @click="startFlow"> </el-button> <el-button type="primary" @click="startFlow"> </el-button>
@ -114,6 +123,7 @@ export default {
form: { form: {
projectId: undefined, projectId: undefined,
workRecord: '', workRecord: '',
submitDate: '',
issue: '', issue: '',
solution: '', solution: '',
}, },

@ -90,18 +90,19 @@
<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"> <!-- <el-descriptions-item 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>-->
{{item.createTime}} <!-- {{item.createTime}}-->
</el-descriptions-item> <!-- </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>
{{item.finishTime}} <span v-if="form.submitDate !==undefined && form.submitDate !==''&& form.submitDate !==null">{{form.submitDate}}</span>
</el-descriptions-item> <span v-else>{{item.finishTime}}</span>
<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>
<!-- <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}}

@ -152,18 +152,19 @@
<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"> <!-- <el-descriptions-item 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>-->
{{item.createTime}} <!-- {{item.createTime}}-->
</el-descriptions-item> <!-- </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>
{{item.finishTime}} <span v-if="form.submitDate !==undefined && form.submitDate !==''&& form.submitDate !==null">{{form.submitDate}}</span>
</el-descriptions-item> <span v-else>{{item.finishTime}}</span>
<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>
<!-- <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}}
@ -364,6 +365,7 @@ export default {
projectId: 0, projectId: 0,
workRecord: '', workRecord: '',
issue: '', issue: '',
submitDate: '',
solution: '', solution: '',
}, },
fileList: [], fileList: [],
@ -380,7 +382,7 @@ export default {
checkSendUser: false // checkSendUser: false //
}; };
}, },
created() { activated() {
this.taskForm.deployId = this.$route.query && this.$route.query.deployId; this.taskForm.deployId = this.$route.query && this.$route.query.deployId;
this.taskForm.taskId = this.$route.query && this.$route.query.taskId; this.taskForm.taskId = this.$route.query && this.$route.query.taskId;
this.taskForm.procInsId = this.$route.query && this.$route.query.procInsId; this.taskForm.procInsId = this.$route.query && this.$route.query.procInsId;

Loading…
Cancel
Save